Add customTools option back to createAgentSession SDK

- Accepts ToolDefinition[] directly (simplified from old { path?, tool } format)
- Tools are combined with extension-registered tools
- Updated sdk.md documentation
- Updated CHANGELOG
This commit is contained in:
Mario Zechner 2026-01-05 03:34:36 +01:00
parent 6bd5e419a6
commit 8da793b1ba
4 changed files with 56 additions and 101 deletions

View file

@ -811,8 +811,8 @@ pi.registerTool({
details: { progress: 50 },
});
// Run commands with cancellation support
const result = await ctx.exec("some-command", [], { signal });
// Run commands via pi.exec (captured from extension closure)
const result = await pi.exec("some-command", [], { signal });
// Return result
return {
@ -941,9 +941,9 @@ ctx.ui.notify("Done!", "info"); // "info" | "warning" | "error"
ctx.ui.setStatus("my-ext", "Processing...");
ctx.ui.setStatus("my-ext", undefined); // Clear
// Widget above editor (string array or Component)
// Widget above editor (string array or factory function)
ctx.ui.setWidget("my-widget", ["Line 1", "Line 2"]);
ctx.ui.setWidget("my-widget", new Text(theme.fg("accent", "Custom"), 0, 0));
ctx.ui.setWidget("my-widget", (tui, theme) => new Text(theme.fg("accent", "Custom"), 0, 0));
ctx.ui.setWidget("my-widget", undefined); // Clear
// Terminal title