pi-mono/packages/coding-agent/docs
pungggi 04b15259b2
feat(extensions): expose ctx.scopedModels to extensions (#7191)
Extensions have no way to read the session's scoped model set (the models
resolved from --models / enabledModels against the available catalogue --
the same list /scoped-models shows). The only model surfaces on
ExtensionContext are ctx.model (active) and ctx.modelRegistry.getAvailable()
(the whole catalogue, unfiltered), so an extension that wants a scoped
model picker must either enumerate everything or re-implement pi's scope
resolution (minimatch on provider/modelId / bare modelId + enabledModels +
--models) from disk -- duplicating core logic.

Add ctx.scopedModels: readonly ScopedModel[] to ExtensionContext, mirroring
how ctx.model is exposed (field -> bindCore -> lazy getter in createContext()).
Empty when no scoping is configured (all available models usable). Each entry
is { model, thinkingLevel? }.

- types.ts: ExtensionContext.scopedModels + ExtensionContextActions.getScopedModels
- runner.ts: field, bindCore wiring, lazy scopedModels getter
- agent-session.ts: provide getScopedModels: () => this._scopedModels
- test: assert ctx.scopedModels reflects the action (default [] + live ref)
- docs/extensions.md: document the new field

Co-authored-by: ngSoftware <alessandro@pungitore.ch>
2026-07-28 08:31:01 +02:00
..
images Add pi.dev donation attribution 2026-02-03 23:00:40 +01:00
compaction.md fix(agent,ai): don't cache write compaction or branch summaries (#6618) 2026-07-23 23:03:23 +02:00
containerization.md docs(coding-agent): reorder containerization patterns 2026-06-15 09:16:13 +02:00
custom-provider.md feat(ai): expose pending stop reason while streaming (#7151) 2026-07-27 11:56:15 +02:00
development.md docs(coding-agent): fix development AGENTS link 2026-05-27 22:51:30 +02:00
docs.json docs(coding-agent): document security model 2026-06-08 15:56:29 +02:00
environment-variables.md feat(coding-agent): expose session metadata to bash tools (#6967) 2026-07-22 20:15:02 +02:00
extensions.md feat(extensions): expose ctx.scopedModels to extensions (#7191) 2026-07-28 08:31:01 +02:00
index.md feat(coding-agent): expose session metadata to bash tools (#6967) 2026-07-22 20:15:02 +02:00
json.md add docs for new event types 2026-07-21 15:40:11 +00:00
keybindings.md feat(coding-agent): add message copy shortcut 2026-07-10 21:35:53 +02:00
llama-cpp.md feat(coding-agent): add Hugging Face llama search 2026-07-17 17:13:39 +02:00
models.md feat(ai): support constrained sampling (#6341) 2026-07-23 23:48:40 +02:00
packages.md feat(coding-agent): add model catalog refresh flag 2026-07-16 12:46:49 +02:00
prompt-templates.md fix(coding-agent): support all-argument prompt defaults closes #6695 2026-07-17 13:52:32 +02:00
providers.md feat(ai): add manual redirect URL fallback to OpenRouter OAuth login (#7114) 2026-07-27 11:58:04 +02:00
quickstart.md fix(coding-agent): fall back to text clipboard paste 2026-07-10 21:46:15 +02:00
rpc.md feat(coding-agent): emit bash_execution_update events (#6971) 2026-07-23 12:28:12 +02:00
sdk.md add docs for new event types 2026-07-21 15:40:11 +00:00
security.md docs(coding-agent): reorder containerization patterns 2026-06-15 09:16:13 +02:00
session-format.md feat(ai): expose pending stop reason while streaming (#7151) 2026-07-27 11:56:15 +02:00
sessions.md Add startup session name flag 2026-05-29 11:40:58 +02:00
settings.md fix(ai): make provider retries abortable (#6980) 2026-07-23 12:25:37 +02:00
shell-aliases.md docs(coding-agent): add windows.md and shell-aliases.md 2026-01-25 22:12:03 +01:00
skills.md feat(coding-agent): add project trust gating 2026-06-05 10:51:43 +02:00
terminal-setup.md fix(tui): bind ctrl+j as newline by default 2026-06-22 13:57:02 +02:00
termux.md docs: recommend scriptless npm installs 2026-05-20 14:47:18 +02:00
themes.md feat(ai): add max thinking level 2026-07-09 22:30:53 +02:00
tmux.md docs(coding-agent): update tmux requirement docs 2026-06-07 10:34:57 +02:00
tui.md docs(coding-agent): fix obsolete extension UI examples closes #6735 2026-07-17 09:36:59 +02:00
usage.md feat(coding-agent): expose session metadata to bash tools (#6967) 2026-07-22 20:15:02 +02:00
windows.md docs(coding-agent): add windows.md and shell-aliases.md 2026-01-25 22:12:03 +01:00