Add extensions option to createAgentSession SDK

- Accept ExtensionFactory[] for inline extensions (merged with discovery)
- Mark preloadedExtensions as @internal (CLI implementation detail)
- Update sdk.md with inline extension example
- Update CHANGELOG
This commit is contained in:
Mario Zechner 2026-01-05 03:38:56 +01:00
parent 8da793b1ba
commit 79cb8f0906
6 changed files with 138 additions and 24 deletions

View file

@ -198,6 +198,7 @@ pi --extension ./safety.ts -e ./todo.ts
- Examples: `examples/hooks/` and `examples/custom-tools/` merged into `examples/extensions/`
- README: Extensions section expanded with custom tools, commands, events, state persistence, shortcuts, flags, and UI examples
- SDK: `customTools` option now accepts `ToolDefinition[]` directly (simplified from `Array<{ path?, tool }>`)
- SDK: `extensions` option accepts `ExtensionFactory[]` for inline extensions
- SDK: `additionalExtensionPaths` replaces both `additionalHookPaths` and `additionalCustomToolPaths`
## [0.34.2] - 2026-01-04