pi-mono/packages
Christian Klotz 85c2ee3e76
docs(coding-agent): restore the full extensions guide, corrected against current source (#11498)
## Summary

The docs refresh (#9898) cut `docs/extensions.md` from about 3,100 lines
to 130, dropping API reference and tool guidance. #11039 restored part
of it. This PR restores the full guide and corrects it against current
source.

- **Structure:** the original sections, with the ASCII lifecycle diagram
replaced by three Mermaid diagrams (run, turn, session) and ordered hook
lists, plus a handler composition table.
- **Merged:** content added after the cut: tool exposure, calling other
tools, structured output, MCP servers, `registerToolRenderer`, virtual
models, `provider_stream_event`, `before_agent_start` `messageType`.
- **Corrected:** removed or renamed APIs (`modelRegistry.stream()`,
prompt sections are `<tools>`/`<rules>`, `builtin:read` paths,
`highlightCode`), wrong behavior claims (errors only by throwing,
`model_select` on restore, `sendUserMessage` always triggering a turn,
override warning, `truncateLine` bytes), examples that did not
type-check, links to removed `tui.md` patterns and `rpc.md` anchors, and
wrong API lists in the examples table.
- **Kept:** anchors that other docs and changelogs link to, as `<a id>`
tags.
- **Fixed example:** `reload-runtime.ts` tool queued `/reload-runtime`
with `deliverAs: "followUp"`. Queued text reaches the model as a plain
user message, so the command never ran and Pi never reloaded. The tool
now sets a flag and returns `terminate: true`; an `agent_settled`
handler sends `/reload-runtime` with `expandPromptTemplates: true`,
which runs after the settled handlers finish, while the agent is idle.

In the long run it may be better to revisit how API reference is,
provided to the agent, especially since more capable models do explore
the source without it.

## Validation

- `npm run check`
- Edited TypeScript examples type-check against current types
- All relative links and anchors in `extensions.md` resolve, including
inbound anchors from other docs
- `reload-runtime.ts`: faux-provider harness test (temporary, not
committed) shows one reload after the run settles and no extra model
request; the old version never reloads. Also verified in interactive
mode with a real model.
- Reviewed by GPT-6 Astra and GPT-5.6 Sol against source; all findings
applied
2026-10-28 00:31:24 +02:00
..
agent fix(ai,chord,durable,coding-agent): parse streamed tool-call arguments incrementally (fixes #9265) 2026-10-24 08:00:07 +00:00
ai fix(ai): detect LiteLLM ContextWindowExceededError as context overflow (#11494) 2026-10-27 20:27:30 +01:00
chord feat(chord,durable): failures are watch calls; one vocabulary for watches, observers and reports 2026-10-27 20:38:08 +00:00
codemode fix: update deps for security advisories 2026-10-22 11:24:50 +02:00
coding-agent docs(coding-agent): restore the full extensions guide, corrected against current source (#11498) 2026-10-28 00:31:24 +02:00
durable fix(durable): import toCodemodeIdentifier from pi-codemode/declarations 2026-10-27 21:31:47 +00:00
env feat(chord,durable): failures are watch calls; one vocabulary for watches, observers and reports 2026-10-27 20:38:08 +00:00
evals fix(evals): drop autoevals dependency 2026-10-22 23:32:38 +02:00
mcp fix(ai,chord,durable,coding-agent): parse streamed tool-call arguments incrementally (fixes #9265) 2026-10-24 08:00:07 +00:00
telemetry fix(ai): resolve pi-telemetry from source in workspace tests 2026-10-26 21:05:54 +00:00
tui fix(tui): fall back to raw LaTeX when display math is wider than the content width (#11487) 2026-10-27 16:09:08 +01:00