Reorder execute params: (toolCallId, params, onUpdate, ctx, signal?)

Optional signal now at the end for cleaner API
This commit is contained in:
Mario Zechner 2025-12-31 12:14:28 +01:00
parent 4c9c453646
commit 19c4182c21
9 changed files with 15 additions and 15 deletions

View file

@ -50,7 +50,7 @@
- `ToolAPI` renamed to `CustomToolAPI`
- `ToolContext` renamed to `CustomToolContext`
- `ToolSessionEvent` renamed to `CustomToolSessionEvent`
- `execute()` signature changed: now takes `(toolCallId, params, signal, onUpdate, ctx: CustomToolContext)`
- `execute()` signature changed: now takes `(toolCallId, params, onUpdate, ctx: CustomToolContext, signal?)`
- `onSession()` signature changed: now takes `(event: CustomToolSessionEvent, ctx: CustomToolContext)`
- `CustomToolSessionEvent` simplified: only has `reason` and `previousSessionFile` (use `ctx.sessionManager.getBranch()` to get entries)
- `CustomToolContext` provides `sessionManager: ReadonlySessionManager`, `modelRegistry`, and `model`