Update CHANGELOG, README, and custom-tools.md for new CustomTool API

- Add custom tools API rework to CHANGELOG breaking changes
- Update docs/custom-tools.md with new types and signatures
- Update README quick example with correct execute signature
This commit is contained in:
Mario Zechner 2025-12-31 12:10:37 +01:00
parent 568150f18b
commit 4c9c453646
3 changed files with 58 additions and 26 deletions

View file

@ -45,7 +45,17 @@
- **SessionManager**:
- `getSessionFile()` now returns `string | undefined` (undefined for in-memory sessions)
- **Themes**: Custom themes must add `selectedBg`, `customMessageBg`, `customMessageText`, `customMessageLabel` color tokens (50 total)
- **Custom tools**: `dispose()` method removed from `CustomAgentTool`. Use `onSession` with `reason: "shutdown"` instead for cleanup. `SessionEvent.reason` now includes `"shutdown"`.
- **Custom tools API**:
- `CustomAgentTool` renamed to `CustomTool`
- `ToolAPI` renamed to `CustomToolAPI`
- `ToolContext` renamed to `CustomToolContext`
- `ToolSessionEvent` renamed to `CustomToolSessionEvent`
- `execute()` signature changed: now takes `(toolCallId, params, signal, onUpdate, ctx: CustomToolContext)`
- `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`
- `dispose()` method removed - use `onSession` with `reason: "shutdown"` for cleanup
- `CustomToolFactory` return type changed to `CustomTool<any, any>` for type compatibility
- **Renamed exports**:
- `messageTransformer``convertToLlm`
- `SessionContext` alias `LoadedSession` removed (use `SessionContext` directly)