feat(coding-agent): use built-in renderers for tool overrides without custom renderers

When overriding a built-in tool (read, bash, edit, write, grep, find, ls)
without providing renderCall/renderResult, the built-in renderer is now
used automatically. This allows wrapping built-in tools for logging or
access control without reimplementing the UI (syntax highlighting, diffs, etc.).
This commit is contained in:
Mario Zechner 2026-01-08 13:25:41 +01:00
parent 66cbcee347
commit bbf0d92e8c
2 changed files with 30 additions and 12 deletions

View file

@ -959,6 +959,8 @@ pi --no-tools -e ./my-extension.ts
See [examples/extensions/tool-override.ts](../examples/extensions/tool-override.ts) for a complete example that overrides `read` with logging and access control.
**Rendering:** If your override doesn't provide custom `renderCall`/`renderResult` functions, the built-in renderer is used automatically (syntax highlighting, diffs, etc.). This lets you wrap built-in tools for logging or access control without reimplementing the UI.
**Your implementation must match the exact result shape**, including the `details` type. The UI and session logic depend on these shapes for rendering and state tracking.
Built-in tool implementations: