mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
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>
|
||
|---|---|---|
| .. | ||
| images | ||
| compaction.md | ||
| containerization.md | ||
| custom-provider.md | ||
| development.md | ||
| docs.json | ||
| environment-variables.md | ||
| extensions.md | ||
| index.md | ||
| json.md | ||
| keybindings.md | ||
| llama-cpp.md | ||
| models.md | ||
| packages.md | ||
| prompt-templates.md | ||
| providers.md | ||
| quickstart.md | ||
| rpc.md | ||
| sdk.md | ||
| security.md | ||
| session-format.md | ||
| sessions.md | ||
| settings.md | ||
| shell-aliases.md | ||
| skills.md | ||
| terminal-setup.md | ||
| termux.md | ||
| themes.md | ||
| tmux.md | ||
| tui.md | ||
| usage.md | ||
| windows.md | ||