pi-mono/packages/coding-agent/docs
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
..
images docs(coding-agent): refresh documentation (#9898) 2026-09-22 16:48:19 +02:00
cli-integration.md fix(coding-agent): warn and exit non-zero in print mode on truncated response 2026-10-12 16:06:42 +02:00
cli.md docs: fix provider checklist, MCP anchors, and missing commands/settings (#11338) 2026-10-23 17:02:41 +02:00
codemode.md fix(coding-agent): queue codemode scripts at the worker limit 2026-10-20 20:50:27 +02:00
compaction.md fix(coding-agent): remove fixed output limits from summary requests (#11036) 2026-10-16 13:53:16 +02:00
configuration.md feat(coding-agent): codemode and MCP 2026-09-29 09:12:50 +02:00
containerization.md docs(coding-agent): refresh documentation (#9898) 2026-09-22 16:48:19 +02:00
custom-provider.md docs(coding-agent): shorten device-code login guidance 2026-10-22 21:38:58 +02:00
docs.json docs(ai,coding-agent): generate models.json reference from schemas (#11038) 2026-10-16 21:53:00 +01:00
environment-variables.md docs: fix provider checklist, MCP anchors, and missing commands/settings (#11338) 2026-10-23 17:02:41 +02:00
extensions.md docs(coding-agent): restore the full extensions guide, corrected against current source (#11498) 2026-10-28 00:31:24 +02:00
how-pi-works.md docs(coding-agent): refresh documentation (#9898) 2026-09-22 16:48:19 +02:00
index.md docs(coding-agent): add Radius to providers page, rename provider docs sections 2026-10-01 17:06:00 +02:00
json.md feat(tui,coding-agent): report program status via OSC 7501 2026-10-07 19:05:41 +00:00
keybindings.md feat(coding-agent): use pi.dev configuration schemas (#10751) 2026-10-11 14:48:42 +01:00
llama-cpp.md docs(coding-agent): update llama.cpp setup for llama.app (#10179) 2026-10-27 16:21:37 +01:00
mcp.md refactor(codemode,coding-agent): decouple MCP from codemode 2026-10-12 09:19:30 +02:00
message-types.md feat(ai): carry responseModel on pi-messages terminal events (#11265) 2026-10-23 10:54:18 +02:00
models-configuration.md feat(ai,coding-agent): image input for System One classifiers 2026-10-21 23:53:47 +02:00
models.md feat(ai,coding-agent): image input for System One classifiers 2026-10-21 23:53:47 +02:00
nvidia-rtx-llama-cpp.md docs(coding-agent): restructure NVIDIA RTX llama.cpp prerequisites 2026-10-13 15:04:38 +01:00
packages.md fix(coding-agent): start when a configured package fails to install (#11304) 2026-10-23 12:27:45 +02:00
prompt-templates.md docs(coding-agent): refresh documentation (#9898) 2026-09-22 16:48:19 +02:00
providers.md feat(ai,coding-agent): list only the OpenRouter models a key may use (#10672) 2026-10-12 10:17:40 +02:00
quickstart.md feat(coding-agent): add Nix flake (#9137) 2026-10-02 18:30:51 +02:00
rpc-commands.md feat(coding-agent): report prompt disposition in RPC responses 2026-09-25 14:53:11 +02:00
rpc-extension-ui.md docs(coding-agent): refresh documentation (#9898) 2026-09-22 16:48:19 +02:00
rpc.md feat(coding-agent): report prompt disposition in RPC responses 2026-09-25 14:53:11 +02:00
sdk.md docs(coding-agent): add Radius to providers page, rename provider docs sections 2026-10-01 17:06:00 +02:00
security.md feat(coding-agent): codemode and MCP 2026-09-29 09:12:50 +02:00
session-format.md feat(coding-agent): Virtual models (#10035) 2026-09-28 23:30:45 +02:00
sessions.md feat(coding-agent): configure session share destination 2026-10-13 15:41:13 +02:00
settings.md docs: fix provider checklist, MCP anchors, and missing commands/settings (#11338) 2026-10-23 17:02:41 +02:00
shell-aliases.md docs(coding-agent): refresh documentation (#9898) 2026-09-22 16:48:19 +02:00
skills.md docs(coding-agent): refresh documentation (#9898) 2026-09-22 16:48:19 +02:00
slash-commands.md docs: fix provider checklist, MCP anchors, and missing commands/settings (#11338) 2026-10-23 17:02:41 +02:00
terminal-setup.md feat(tui,coding-agent): report program status via OSC 7501 2026-10-07 19:05:41 +00:00
termux.md docs(coding-agent): refresh documentation (#9898) 2026-09-22 16:48:19 +02:00
themes.md feat(coding-agent): use pi.dev configuration schemas (#10751) 2026-10-11 14:48:42 +01:00
tmux.md docs(coding-agent): refresh documentation (#9898) 2026-09-22 16:48:19 +02:00
tui.md feat(coding-agent): let inline ctx.ui.custom() components report blocked program status (#11471) 2026-10-27 09:27:28 +01:00
usage.md feat(coding-agent): configure session share destination 2026-10-13 15:41:13 +02:00
virtual-models.md feat(coding-agent): Virtual models (#10035) 2026-09-28 23:30:45 +02:00
windows.md fix(coding-agent): resolve Windows shells from installation directories 2026-10-19 21:55:12 +02:00