@code-yeongyu/senpi 2026.7.17 → 2026.7.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -0
- package/README.md +5 -2
- package/dist/cli/neo/build-argv.d.ts.map +1 -1
- package/dist/cli/neo/build-argv.js +2 -0
- package/dist/cli/neo/build-argv.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +11 -4
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +5 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +27 -5
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +20 -4
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/dynamic-prompt/build.d.ts +7 -0
- package/dist/core/dynamic-prompt/build.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/build.js +5 -0
- package/dist/core/dynamic-prompt/build.js.map +1 -1
- package/dist/core/dynamic-prompt/workstation.d.ts +35 -0
- package/dist/core/dynamic-prompt/workstation.d.ts.map +1 -0
- package/dist/core/dynamic-prompt/workstation.js +81 -0
- package/dist/core/dynamic-prompt/workstation.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.js +46 -4
- package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/repair-tool-pairs.d.ts +1 -0
- package/dist/core/extensions/builtin/compaction/repair-tool-pairs.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/repair-tool-pairs.js +20 -2
- package/dist/core/extensions/builtin/compaction/repair-tool-pairs.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.d.ts +7 -1
- package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.js +29 -11
- package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/todo-bridge.d.ts +9 -7
- package/dist/core/extensions/builtin/compaction/todo-bridge.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/todo-bridge.js +34 -9
- package/dist/core/extensions/builtin/compaction/todo-bridge.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/constants.d.ts +1 -0
- package/dist/core/extensions/builtin/gpt-apply-patch/constants.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/constants.js +5 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/constants.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.d.ts +2 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.js +48 -29
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts +2 -2
- package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/index.js +2 -2
- package/dist/core/extensions/builtin/gpt-apply-patch/index.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/tool.js +5 -3
- package/dist/core/extensions/builtin/gpt-apply-patch/tool.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/types.d.ts +7 -6
- package/dist/core/extensions/builtin/gpt-apply-patch/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/types.js.map +1 -1
- package/dist/core/extensions/builtin/hooks/matcher.d.ts.map +1 -1
- package/dist/core/extensions/builtin/hooks/matcher.js +1 -0
- package/dist/core/extensions/builtin/hooks/matcher.js.map +1 -1
- package/dist/core/extensions/builtin/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/index.js +2 -0
- package/dist/core/extensions/builtin/index.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/config-schema.d.ts +8 -1
- package/dist/core/extensions/builtin/mcp/config-schema.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/config-schema.js +23 -0
- package/dist/core/extensions/builtin/mcp/config-schema.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/config.d.ts +13 -0
- package/dist/core/extensions/builtin/mcp/config.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/config.js +36 -0
- package/dist/core/extensions/builtin/mcp/config.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/native-search.d.ts +1 -1
- package/dist/core/extensions/builtin/mcp/expose/native-search.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/native-search.js +1 -1
- package/dist/core/extensions/builtin/mcp/expose/native-search.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/policy.js +1 -1
- package/dist/core/extensions/builtin/mcp/expose/policy.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/status.js +1 -1
- package/dist/core/extensions/builtin/mcp/expose/status.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/tier-b.d.ts +3 -3
- package/dist/core/extensions/builtin/mcp/expose/tier-b.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/tier-b.js +10 -10
- package/dist/core/extensions/builtin/mcp/expose/tier-b.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/tool-search.d.ts +3 -3
- package/dist/core/extensions/builtin/mcp/expose/tool-search.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/tool-search.js +14 -14
- package/dist/core/extensions/builtin/mcp/expose/tool-search.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/index.js +5 -5
- package/dist/core/extensions/builtin/mcp/index.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/service-snapshot.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/service-snapshot.js +1 -0
- package/dist/core/extensions/builtin/mcp/service-snapshot.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/service-types.d.ts +12 -0
- package/dist/core/extensions/builtin/mcp/service-types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/service-types.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/service.d.ts +2 -2
- package/dist/core/extensions/builtin/mcp/service.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/service.js +4 -3
- package/dist/core/extensions/builtin/mcp/service.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/status.js +1 -0
- package/dist/core/extensions/builtin/mcp/status.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js +5 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js +5 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js +5 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js +5 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js +5 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-2.js +2 -2
- package/dist/core/extensions/builtin/prompt-preset/glm-5-2.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.2.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.2.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.3-codex.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.3-codex.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.4.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.4.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/grok-4.5.d.ts +3 -0
- package/dist/core/extensions/builtin/prompt-preset/grok-4.5.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/grok-4.5.js +80 -0
- package/dist/core/extensions/builtin/prompt-preset/grok-4.5.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +5 -7
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js +14 -0
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.js +1 -0
- package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/shared.d.ts +7 -0
- package/dist/core/extensions/builtin/terminal/shared.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/shared.js +7 -0
- package/dist/core/extensions/builtin/terminal/shared.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash.js +68 -6
- package/dist/core/extensions/builtin/terminal/tools/bash.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/commands.d.ts +18 -0
- package/dist/core/extensions/builtin/todotools/commands.d.ts.map +1 -0
- package/dist/core/extensions/builtin/todotools/commands.js +395 -0
- package/dist/core/extensions/builtin/todotools/commands.js.map +1 -0
- package/dist/core/extensions/builtin/todotools/index.d.ts +4 -1
- package/dist/core/extensions/builtin/todotools/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/index.js +17 -14
- package/dist/core/extensions/builtin/todotools/index.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/markdown.d.ts +13 -0
- package/dist/core/extensions/builtin/todotools/markdown.d.ts.map +1 -0
- package/dist/core/extensions/builtin/todotools/markdown.js +82 -0
- package/dist/core/extensions/builtin/todotools/markdown.js.map +1 -0
- package/dist/core/extensions/builtin/todotools/prompt.d.ts +2 -1
- package/dist/core/extensions/builtin/todotools/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/prompt.js +50 -153
- package/dist/core/extensions/builtin/todotools/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/state.d.ts +67 -14
- package/dist/core/extensions/builtin/todotools/state.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/state.js +400 -35
- package/dist/core/extensions/builtin/todotools/state.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/tools/todo.d.ts +22 -0
- package/dist/core/extensions/builtin/todotools/tools/todo.d.ts.map +1 -0
- package/dist/core/extensions/builtin/todotools/tools/todo.js +229 -0
- package/dist/core/extensions/builtin/todotools/tools/todo.js.map +1 -0
- package/dist/core/extensions/builtin/video-in/index.d.ts +3 -0
- package/dist/core/extensions/builtin/video-in/index.d.ts.map +1 -0
- package/dist/core/extensions/builtin/video-in/index.js +111 -0
- package/dist/core/extensions/builtin/video-in/index.js.map +1 -0
- package/dist/core/extensions/builtin/websearch/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/index.js +20 -3
- package/dist/core/extensions/builtin/websearch/index.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -0
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +10 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +64 -7
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +5 -2
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +49 -8
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +49 -8
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-registry.d.ts +5 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +17 -2
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-runtime.d.ts +12 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +51 -9
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +1 -0
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +4 -4
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer.d.ts +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +8 -1
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +16 -3
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts +6 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +27 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/settings-manager.d.ts +6 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +20 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +20 -5
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/read.js +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +3 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/llama/client.d.ts +61 -0
- package/dist/extensions/llama/client.d.ts.map +1 -0
- package/dist/extensions/llama/client.js +298 -0
- package/dist/extensions/llama/client.js.map +1 -0
- package/dist/extensions/llama/huggingface.d.ts +23 -0
- package/dist/extensions/llama/huggingface.d.ts.map +1 -0
- package/dist/extensions/llama/huggingface.js +139 -0
- package/dist/extensions/llama/huggingface.js.map +1 -0
- package/dist/extensions/llama/index.d.ts +3 -0
- package/dist/extensions/llama/index.d.ts.map +1 -0
- package/dist/extensions/llama/index.js +208 -0
- package/dist/extensions/llama/index.js.map +1 -0
- package/dist/extensions/llama/provider.d.ts +10 -0
- package/dist/extensions/llama/provider.d.ts.map +1 -0
- package/dist/extensions/llama/provider.js +106 -0
- package/dist/extensions/llama/provider.js.map +1 -0
- package/dist/extensions/llama/ui.d.ts +42 -0
- package/dist/extensions/llama/ui.d.ts.map +1 -0
- package/dist/extensions/llama/ui.js +400 -0
- package/dist/extensions/llama/ui.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +6 -4
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +6 -7
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +154 -114
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +4 -2
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +4 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +20 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +87 -10
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/streaming-reveal.d.ts +35 -0
- package/dist/modes/interactive/streaming-reveal.d.ts.map +1 -0
- package/dist/modes/interactive/streaming-reveal.js +268 -0
- package/dist/modes/interactive/streaming-reveal.js.map +1 -0
- package/dist/modes/interactive/tool-args-reveal.d.ts +20 -0
- package/dist/modes/interactive/tool-args-reveal.d.ts.map +1 -0
- package/dist/modes/interactive/tool-args-reveal.js +153 -0
- package/dist/modes/interactive/tool-args-reveal.js.map +1 -0
- package/dist/utils/child-process.d.ts +17 -1
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js +41 -1
- package/dist/utils/child-process.js.map +1 -1
- package/docs/AGENTS.md +70 -0
- package/docs/custom-provider.md +28 -0
- package/docs/extensions.md +83 -5
- package/docs/index.md +1 -0
- package/docs/llama-cpp.md +99 -0
- package/docs/mcp.md +21 -5
- package/docs/neo.md +2 -1
- package/docs/prompt-templates.md +1 -0
- package/docs/providers.md +7 -0
- package/docs/tui.md +41 -26
- package/docs/usage.md +1 -0
- package/examples/AGENTS.md +3 -0
- package/examples/extensions/README.md +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +62 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +3 -3
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +59 -19
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/prelude.py +0 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +69 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +6 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +19 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +3 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +4 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/README.md +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +24 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +25 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js +43 -9
- package/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +4267 -22314
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.d.ts +436 -1988
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js +2 -1892
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.models.d.ts +10 -80
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.models.js +2 -57
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.d.ts +43 -267
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js +2 -252
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts +184 -883
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js +2 -811
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.d.ts +10 -60
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js +2 -56
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.d.ts +168 -884
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js +2 -755
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.models.d.ts +40 -286
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.models.js +2 -236
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/ant-ling.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cerebras.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/deepseek.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google-vertex.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/groq.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/kimi-coding.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax-cn.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/moonshotai-cn.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/moonshotai.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-ams.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-cn.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-sgp.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.d.ts +7 -58
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.js +2 -40
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.d.ts +49 -362
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js +2 -292
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.d.ts +85 -760
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.js +2 -538
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.models.d.ts +31 -189
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.models.js +2 -179
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.models.d.ts +49 -309
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.models.js +2 -285
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.d.ts +22 -118
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.js +2 -122
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.models.d.ts +196 -979
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.models.js +2 -884
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.d.ts +16 -121
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.js +2 -98
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.models.d.ts +10 -48
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.models.js +2 -53
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.models.d.ts +10 -48
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.models.js +2 -53
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.d.ts +91 -480
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.js +2 -512
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.d.ts +31 -257
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.js +2 -185
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.d.ts +31 -257
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.js +2 -185
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.d.ts +58 -541
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.js +2 -382
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.d.ts +22 -196
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.js +2 -139
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.models.d.ts +184 -954
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.models.js +2 -825
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.d.ts +46 -335
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js +2 -273
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.d.ts +163 -1185
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js +2 -996
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts +1076 -5750
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js +2 -4910
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.d.ts +49 -579
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js +2 -377
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts +752 -3336
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js +2 -3263
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.d.ts +10 -65
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.js +2 -57
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.d.ts +10 -63
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.js +2 -56
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.d.ts +10 -63
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.js +2 -56
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.d.ts +10 -63
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.js +2 -56
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.d.ts +19 -126
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.js +2 -110
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.d.ts +19 -144
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.js +2 -111
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.d.ts +19 -144
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.js +2 -111
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.js +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.js +4 -2
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/coerce-parameters.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/coerce-parameters.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/coerce-parameters.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/coerce-parameters.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/format.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/format.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/format.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/format.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-protocol.d.ts +19 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-protocol.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-protocol.js +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-protocol.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-tag-scanner.d.ts +11 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-tag-scanner.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-tag-scanner.js +40 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/invoke-tag-scanner.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/parse.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/parse.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/parse.js +7 -4
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/parse.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream.js +104 -15
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/coerce-parameters.d.ts +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/coerce-parameters.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/coerce-parameters.js +198 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/coerce-parameters.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/config.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/config.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/config.js +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/config.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/format.d.ts +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/format.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/format.js +33 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/format.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/index.d.ts +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/index.js +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/parse.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/parse.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/parse.js +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/parse.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/repair.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/repair.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/repair.js +46 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/repair.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/stream.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/stream.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/stream.js +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/stream.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.d.ts +8 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.js +129 -27
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.js +140 -6
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.js +28 -6
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.js +51 -18
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.js +70 -9
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.d.ts +6 -2
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +16 -3
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js +4 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.js +19 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.d.ts +19 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.js +215 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-schema-compat.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-pty/dist/registry-session.d.ts +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/registry-session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/registry-session.js +25 -6
- package/node_modules/@earendil-works/pi-pty/dist/registry-session.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/registry-types.d.ts +6 -0
- package/node_modules/@earendil-works/pi-pty/dist/registry-types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/registry-types.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/registry.d.ts +1 -0
- package/node_modules/@earendil-works/pi-pty/dist/registry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/registry.js +9 -1
- package/node_modules/@earendil-works/pi-pty/dist/registry.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +6 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +14 -2
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +6 -6
- package/dist/core/extensions/builtin/todotools/tools/todoread.d.ts +0 -4
- package/dist/core/extensions/builtin/todotools/tools/todoread.d.ts.map +0 -1
- package/dist/core/extensions/builtin/todotools/tools/todoread.js +0 -37
- package/dist/core/extensions/builtin/todotools/tools/todoread.js.map +0 -1
- package/dist/core/extensions/builtin/todotools/tools/todowrite.d.ts +0 -10
- package/dist/core/extensions/builtin/todotools/tools/todowrite.d.ts.map +0 -1
- package/dist/core/extensions/builtin/todotools/tools/todowrite.js +0 -95
- package/dist/core/extensions/builtin/todotools/tools/todowrite.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAI5F,OAAO,
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAI5F,OAAO,EAA2C,qBAAqB,EAA4B,MAAM,aAAa,CAAC;AACvH,OAAO,KAAK,EAAE,eAAe,EAAwC,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAYlE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIxD,OAAO,KAAK,EAEX,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AAEnE,qBAAa,UAAU;;IAoBhB,aAAa,CAClB,KAAK,EAAE,iBAAiB,EACxB,GAAG,EAAE,iBAAiB,EACtB,GAAG,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,cAAc,CAAC,EAC9E,OAAO,GAAE,iBAAsB,GAC7B,OAAO,CAA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AAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAOjE;IAED,WAAW,IAAI,kBAAkB,CAUhC;IA0JD;;;;OAIG;IACH,+BAA+B,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,EAAE,CAGtE;IAED;;;;;OAKG;IACH,yBAAyB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,EAAE,CAGhE;IAaD,cAAc,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,0BAA0B,EAAE,gBAAgB,CAAC,CAEjF;IAED,aAAa,CACZ,IAAI,EAAE,MAAM,GAEV;QAAE,MAAM,EAAE,eAAe,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAC9G,SAAS,CASX;IAED,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEtD;IAED;8DAC0D;IAC1D,0BAA0B,IAAI,MAAM,GAAG,OAAO,GAAG,SAAS,CAEzD;CACD;AAID,wBAAgB,aAAa,IAAI,UAAU,CAK1C;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GAAG,MAAM,IAAI,gBAAgB,CAE1G;AASD,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { detectLiteralBearerWarnings, resolveServerAuth } from "./auth/context.js";
|
|
2
2
|
import { collectToolCatalog } from "./catalog.js";
|
|
3
3
|
import { getValidCachedServer, readMcpCatalogCache } from "./catalog-cache.js";
|
|
4
|
-
import { loadMcpConfig, resolveSkillMcpServer, visitSpawnableMcpServers } from "./config.js";
|
|
4
|
+
import { loadMcpConfig, mergeExtensionMcpServers, resolveSkillMcpServer, visitSpawnableMcpServers } from "./config.js";
|
|
5
5
|
import { ServerConnection } from "./connection.js";
|
|
6
6
|
import { mapMcpCatalogNames } from "./expose/register.js";
|
|
7
7
|
import { cleanupMcpOutputArtifacts } from "./guard/output-guard.js";
|
|
@@ -44,6 +44,7 @@ export class McpService {
|
|
|
44
44
|
env: options.env,
|
|
45
45
|
projectTrusted: options.projectTrusted ?? ctx.isProjectTrusted(),
|
|
46
46
|
});
|
|
47
|
+
mergeExtensionMcpServers(config, ctx.getRegisteredMcpServers?.() ?? []);
|
|
47
48
|
this.#config = config;
|
|
48
49
|
this.#pi = _pi;
|
|
49
50
|
this.#authAgentDir = options.agentDir;
|
|
@@ -110,7 +111,7 @@ export class McpService {
|
|
|
110
111
|
return this.#tierBRegistration?.resourceServers ?? [];
|
|
111
112
|
}
|
|
112
113
|
/** Reveal skill-owned tools (todo 37): activation is effective the next
|
|
113
|
-
* turn, exactly like an
|
|
114
|
+
* turn, exactly like an tool_search promotion. Unknown names are ignored. */
|
|
114
115
|
activateSkillMcpTools(names) {
|
|
115
116
|
this.#tierBRegistration?.activate(names);
|
|
116
117
|
}
|
|
@@ -334,7 +335,7 @@ export class McpService {
|
|
|
334
335
|
this.#historyScanned = false;
|
|
335
336
|
}
|
|
336
337
|
/**
|
|
337
|
-
* Replay
|
|
338
|
+
* Replay tool_search activation markers from session history through the
|
|
338
339
|
* live tier-B activation path (see tool-search.ts). Returns newly activated
|
|
339
340
|
* names; safe to call repeatedly (already-active names are skipped).
|
|
340
341
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAA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,MAAM;YACrB,QAAQ,EAAE,IAAI,CAAC,aAAa;YAC5B,GAAG,EAAE,IAAI,CAAC,QAAQ;YAClB,WAAW,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,gBAAgB;SACpD,CAAC;IACH,CAAC;IAED,qBAAqB,CAAC,IAAY;QACjC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,YAAY,CAAC;IAC9D,CAAC;IAED;8DAC0D;IAC1D,0BAA0B;QACzB,OAAO,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAChD,CAAC;CACD;AAED,IAAI,OAAO,GAAsB,IAAI,CAAC;AAEtC,MAAM,UAAU,aAAa;IAC5B,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;QAC9C,OAAO,GAAG,IAAI,UAAU,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,MAAsC;IAC7E,OAAO,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,QAAQ,CAAC;AACjD,CAAC;AAED,KAAK,UAAU,sBAAsB,CAAC,KAAyB;IAC9D,KAAK,CAAC,kBAAkB,EAAE,EAAE,CAAC;IAC7B,mBAAmB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACtC,6BAA6B,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChD,MAAM,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,uBAAuB;IACtC,OAAO,GAAG,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import type { ExtensionAPI, SessionShutdownEvent, SessionStartEvent } from \"../../types.ts\";\nimport { detectLiteralBearerWarnings, resolveServerAuth } from \"./auth/context.ts\";\nimport { collectToolCatalog } from \"./catalog.ts\";\nimport { getValidCachedServer, readMcpCatalogCache } from \"./catalog-cache.ts\";\nimport { loadMcpConfig, resolveSkillMcpServer, visitSpawnableMcpServers } from \"./config.ts\";\nimport type { McpServerConfig, ResolvedMcpConfig, ResolvedMcpServer } from \"./config-schema.ts\";\nimport { ServerConnection } from \"./connection.ts\";\nimport { mapMcpCatalogNames } from \"./expose/register.ts\";\nimport type { McpSessionRegistration } from \"./expose/session.ts\";\nimport type { McpServerExposureStatus } from \"./expose/status.ts\";\nimport { cleanupMcpOutputArtifacts } from \"./guard/output-guard.ts\";\nimport { markMcpConnectionNeedsAuth } from \"./health.ts\";\nimport { configureMcpConnectionLifecycle, disposeMcpConnectionLifecycle } from \"./idle.ts\";\nimport { createMcpLogger } from \"./log.ts\";\nimport {\n\tbuildMcpTombstoneDefinition,\n\tcreateMcpListChangeCoalescer,\n\tdiffMcpToolNames,\n\tformatMcpListChangedDelta,\n} from \"./notifications.ts\";\nimport { configureMcpReconnect, disposeMcpReconnect, reconnectMcpNow } from \"./reconnect.ts\";\nimport type { McpResourceServer } from \"./resources.ts\";\nimport { getMcpServiceExposureStatus } from \"./service-exposure.ts\";\nimport { registerMcpServiceDirectTools } from \"./service-register.ts\";\nimport { buildMcpServerSnapshot } from \"./service-snapshot.ts\";\nimport type {\n\tMcpConnectionEntry,\n\tMcpDisposeReason,\n\tMcpServerSnapshot,\n\tMcpServiceSnapshot,\n\tMcpSessionContext,\n\tMcpSessionOptions,\n} from \"./service-types.ts\";\nimport {\n\tconnectAndRefreshMcpCatalog,\n\tignoreStartupNeedsAuth,\n\traceMcpStartupConnect,\n\tshouldRaceMcpStartup,\n} from \"./startup-race.ts\";\n\nexport { registerToolsPreservingActiveSet } from \"./active-set.ts\";\n\nexport class McpService {\n\t#disposed = false;\n\t#disposeCount = 0;\n\t#lastDisposeReason: McpDisposeReason | null = null;\n\t#sessionContext: McpSessionContext | null = null;\n\t#sessionStartCount = 0;\n\t#lastSessionStartReason: SessionStartEvent[\"reason\"] | null = null;\n\t#toolRefreshGeneration = 0;\n\t#config: ResolvedMcpConfig | null = null;\n\t#authAgentDir: string | undefined;\n\t#authEnv: Record<string, string | undefined> | undefined;\n\treadonly #pendingAuth = new Map<string, import(\"./auth/oauth-provider.ts\").McpOAuthProvider>();\n\t#refreshActiveSetWhenNoTools = false;\n\t#tierBRegistration: McpSessionRegistration | undefined;\n\t#historyScanned = false;\n\t#sessionOptions: McpSessionOptions = {};\n\t#pi: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\"> | undefined;\n\treadonly #connections = new Map<string, McpConnectionEntry>();\n\treadonly #connectionKeysByName = new Map<string, string>();\n\n\tasync attachSession(\n\t\tevent: SessionStartEvent,\n\t\tctx: McpSessionContext,\n\t\t_pi?: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\">,\n\t\toptions: McpSessionOptions = {},\n\t): Promise<void> {\n\t\tthis.#sessionContext = ctx;\n\t\tthis.#sessionStartCount += 1;\n\t\tthis.#lastSessionStartReason = event.reason;\n\t\tconst config = loadMcpConfig({\n\t\t\tagentDir: options.agentDir,\n\t\t\tcwd: ctx.cwd,\n\t\t\tenv: options.env,\n\t\t\tprojectTrusted: options.projectTrusted ?? ctx.isProjectTrusted(),\n\t\t});\n\t\tthis.#config = config;\n\t\tthis.#pi = _pi;\n\t\tthis.#authAgentDir = options.agentDir;\n\t\tthis.#authEnv = options.env;\n\t\tthis.#sessionOptions = options;\n\t\tconst toolRefreshGeneration = this.#toolRefreshGeneration + 1;\n\t\tthis.#toolRefreshGeneration = toolRefreshGeneration;\n\t\tawait this.#syncFromConfig(config, options, event.reason !== \"reload\", _pi, toolRefreshGeneration);\n\t\tif (_pi !== undefined) await this.#registerDirectTools(_pi);\n\t\t// Replay promotion markers from the (possibly resumed) session history\n\t\t// BEFORE the first turn: the request tool snapshot is taken before the\n\t\t// per-turn context event fires, so the context-event replay alone lands\n\t\t// one turn late. Doing it here puts restored tools on the very first\n\t\t// wire payload after a --continue/resume.\n\t\tif (_pi !== undefined) this.#rehydrateFromSessionHistory(ctx);\n\t}\n\n\t/**\n\t * Register skill-declared MCP servers (todo 37). Skill servers are forced\n\t * into search mode with no directTools, so their catalogs register with\n\t * ZERO active tools until activateSkillMcpTools reveals them. A name\n\t * collision with a system-configured server keeps the system config and\n\t * returns a warning (system wins).\n\t */\n\tasync attachSkillMcpServers(\n\t\tdeclared: ReadonlyMap<string, { raw: Parameters<typeof resolveSkillMcpServer>[1]; sourcePath: string }>,\n\t): Promise<string[]> {\n\t\tconst config = this.#config;\n\t\tconst pi = this.#pi;\n\t\tif (config === null || pi === undefined) return [];\n\t\tconst warnings: string[] = [];\n\t\tlet added = 0;\n\t\tfor (const [name, decl] of declared) {\n\t\t\tconst existing = config.servers[name];\n\t\t\tif (existing !== undefined && existing.source !== \"skill\") {\n\t\t\t\twarnings.push(\n\t\t\t\t\t`MCP server '${name}' from skill ${decl.sourcePath} collides with the ${existing.source} config; system config wins.`,\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst resolved = resolveSkillMcpServer(name, decl.raw, decl.sourcePath);\n\t\t\tif (existing !== undefined && existing.configHash === resolved.configHash) continue;\n\t\t\tconfig.servers[name] = resolved;\n\t\t\tadded += 1;\n\t\t}\n\t\tif (added > 0) {\n\t\t\tconst toolRefreshGeneration = this.#toolRefreshGeneration + 1;\n\t\t\tthis.#toolRefreshGeneration = toolRefreshGeneration;\n\t\t\tawait this.#syncFromConfig(config, this.#sessionOptions, false, pi, toolRefreshGeneration);\n\t\t\tawait this.#registerDirectTools(pi);\n\t\t}\n\t\treturn warnings;\n\t}\n\n\t/** Registered searchable catalog (mapped name + server-side tool name),\n\t * used by the skills loader to compute activation targets. */\n\tgetTierBSearchable(): ReadonlyArray<{ name: string; toolName: string; server: string }> {\n\t\treturn this.#tierBRegistration?.searchable ?? [];\n\t}\n\n\t/** Connected servers that list prompts (todo 40), for slash registration. */\n\tgetMcpPromptServers(): readonly import(\"./prompts.ts\").McpPromptServer[] {\n\t\treturn this.#tierBRegistration?.promptServers ?? [];\n\t}\n\n\t/** Connected servers that list resources (todo 39), for mention expansion. */\n\tgetMcpResourceServers(): readonly McpResourceServer[] {\n\t\treturn this.#tierBRegistration?.resourceServers ?? [];\n\t}\n\n\t/** Reveal skill-owned tools (todo 37): activation is effective the next\n\t * turn, exactly like an mcp_search promotion. Unknown names are ignored. */\n\tactivateSkillMcpTools(names: readonly string[]): void {\n\t\tthis.#tierBRegistration?.activate(names);\n\t}\n\n\t#rehydrateFromSessionHistory(ctx: McpSessionContext): void {\n\t\tconst entries = ctx.sessionManager?.getEntries() ?? [];\n\t\tif (entries.length === 0) return;\n\t\tthis.rehydrateActiveToolsFromHistory(entries);\n\t}\n\n\tasync handleSessionShutdown(event: SessionShutdownEvent): Promise<void> {\n\t\tif (shouldDisposeMcpService(event.reason)) await this.dispose(event.reason);\n\t}\n\n\tasync dispose(reason: McpDisposeReason): Promise<void> {\n\t\tif (this.#disposed) return;\n\t\tthis.#disposed = true;\n\t\tthis.#disposeCount += 1;\n\t\tthis.#lastDisposeReason = reason;\n\t\tthis.#sessionContext = null;\n\t\tthis.#config = null;\n\t\tconst entries = [...this.#connections.values()];\n\t\tthis.#connections.clear();\n\t\tthis.#connectionKeysByName.clear();\n\t\tawait Promise.all(entries.map((entry) => disposeEntryConnection(entry)));\n\t\tawait cleanupMcpOutputArtifacts();\n\t}\n\n\tisDisposed(): boolean {\n\t\treturn this.#disposed;\n\t}\n\n\tgetConnection(name: string): ServerConnection | undefined {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\treturn key === undefined ? undefined : this.#connections.get(key)?.connection;\n\t}\n\n\tasync reconnectServer(name: string): Promise<void> {\n\t\tconst entry = this.#entryForName(name);\n\t\tif (entry === undefined) throw new Error(`Unknown MCP server: ${name || \"<missing>\"}`);\n\t\tawait reconnectMcpNow(entry.connection);\n\t}\n\n\tgetServerSnapshots(): McpServerSnapshot[] {\n\t\tconst names = new Set<string>(Object.keys(this.#config?.servers ?? {}));\n\t\tfor (const entry of this.#connections.values()) names.add(entry.name);\n\t\treturn [...names].sort().map((name) => this.#serverSnapshot(name));\n\t}\n\n\tgetLogLines(name: string, maxLines: number): string[] {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\tconst lines = key === undefined ? [] : (this.#connections.get(key)?.logger.getRingBuffer() ?? []);\n\t\treturn lines.slice(Math.max(0, lines.length - maxLines));\n\t}\n\n\tasync getServerExposureStatus(name: string): Promise<McpServerExposureStatus> {\n\t\treturn await getMcpServiceExposureStatus(name, this.#config, this.#entryForName(name));\n\t}\n\n\trecordCall(name: string, elapsedMs: number, failed: boolean): void {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\tconst entry = key === undefined ? undefined : this.#connections.get(key);\n\t\tif (entry === undefined) return;\n\t\tentry.counters.callCount += 1;\n\t\tentry.counters.totalLatencyMs += elapsedMs;\n\t\tif (failed) entry.counters.errorCount += 1;\n\t}\n\n\tgetSnapshot(): McpServiceSnapshot {\n\t\treturn {\n\t\t\tdisposed: this.#disposed,\n\t\t\tdisposeCount: this.#disposeCount,\n\t\t\tlastDisposeReason: this.#lastDisposeReason,\n\t\t\tsessionStartCount: this.#sessionStartCount,\n\t\t\tlastSessionStartReason: this.#lastSessionStartReason,\n\t\t\thasSessionContext: this.#sessionContext !== null,\n\t\t\tconnectionCount: this.#connections.size,\n\t\t};\n\t}\n\n\tasync #syncFromConfig(\n\t\tconfig: ResolvedMcpConfig,\n\t\toptions: McpSessionOptions,\n\t\tuseCache: boolean,\n\t\tpi: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\"> | undefined,\n\t\ttoolRefreshGeneration: number,\n\t): Promise<void> {\n\t\tconst cache = await readMcpCatalogCache(options.agentDir);\n\t\tconst hadConnectionsBeforeSync = this.#connections.size > 0;\n\t\tthis.#refreshActiveSetWhenNoTools = Object.keys(config.servers).length > 0 || hadConnectionsBeforeSync;\n\t\tconst wanted = new Map<string, ResolvedMcpServer>();\n\t\tvisitSpawnableMcpServers(config, (name, server) => {\n\t\t\twanted.set(name, server);\n\t\t});\n\t\tconst disposals: Promise<void>[] = [];\n\t\tfor (const entry of this.#connections.values()) {\n\t\t\tconst server = wanted.get(entry.name);\n\t\t\tconst key = server?.configHash === undefined ? undefined : `${entry.name}\\0${server.configHash}`;\n\t\t\tif (key === entry.key) continue;\n\t\t\tthis.#connections.delete(entry.key);\n\t\t\tthis.#connectionKeysByName.delete(entry.name);\n\t\t\tdisposals.push(disposeEntryConnection(entry));\n\t\t}\n\t\tawait Promise.all(disposals);\n\n\t\tconst connects: Promise<void>[] = [];\n\t\tfor (const [name, server] of wanted) {\n\t\t\tif (server.config === undefined || server.configHash === undefined) continue;\n\t\t\tconst key = `${name}\\0${server.configHash}`;\n\t\t\tif (this.#connections.has(key)) continue;\n\t\t\tconst logger = createMcpLogger(name, { logDir: options.logDir });\n\t\t\tconst authPlan = resolveServerAuth({\n\t\t\t\tagentDir: options.agentDir,\n\t\t\t\tconfig: server.config,\n\t\t\t\tenv: options.env,\n\t\t\t\tlogger,\n\t\t\t\tserverName: name,\n\t\t\t});\n\t\t\tfor (const warning of detectLiteralBearerWarnings(name, server.config)) logger.warn(warning);\n\t\t\tconst connection = new ServerConnection({\n\t\t\t\tauthProvider: authPlan.provider,\n\t\t\t\tconfig: server.config,\n\t\t\t\tenv: options.env,\n\t\t\t\tlogger,\n\t\t\t\tserverName: name,\n\t\t\t});\n\t\t\tconst cachedCatalog = useCache ? getValidCachedServer(cache, name, server.configHash) : undefined;\n\t\t\tconst entry: McpConnectionEntry = {\n\t\t\t\tagentDir: options.agentDir,\n\t\t\t\tauthPlan,\n\t\t\t\tcacheRefreshedAfterConnect: false,\n\t\t\t\tcachedCatalog,\n\t\t\t\tkey,\n\t\t\t\tname,\n\t\t\t\tconfigHash: server.configHash,\n\t\t\t\tconnection,\n\t\t\t\tlogger,\n\t\t\t\tcreatedAtMs: Date.now(),\n\t\t\t\tcounters: { callCount: 0, errorCount: 0, totalLatencyMs: 0, reconnectCount: 0 },\n\t\t\t};\n\t\t\tconfigureMcpConnectionLifecycle(connection, server.config, logger);\n\t\t\tconfigureMcpReconnect({\n\t\t\t\tconnection,\n\t\t\t\tlogger,\n\t\t\t\treconnect: async () => {\n\t\t\t\t\tentry.counters.reconnectCount += 1;\n\t\t\t\t\tentry.cacheRefreshedAfterConnect = false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait entry.authPlan?.refresh?.ensureFresh();\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst authError = markMcpConnectionNeedsAuth(entry.connection, error);\n\t\t\t\t\t\tif (authError !== undefined) {\n\t\t\t\t\t\t\tentry.logger.warn(authError.message);\n\t\t\t\t\t\t\tthrow authError;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t\tawait entry.connection.renew();\n\t\t\t\t\tawait connectAndRefreshMcpCatalog(entry, server.config);\n\t\t\t\t},\n\t\t\t\tshouldReconnect: () => !this.#disposed && this.#entryForName(name) === entry,\n\t\t\t});\n\t\t\tthis.#connections.set(key, entry);\n\t\t\tthis.#connectionKeysByName.set(name, key);\n\t\t\tthis.#wireListChanged(entry);\n\t\t\tif (shouldRaceMcpStartup(server.config.lifecycle)) {\n\t\t\t\tconnects.push(\n\t\t\t\t\traceMcpStartupConnect({\n\t\t\t\t\t\tentry,\n\t\t\t\t\t\tpi,\n\t\t\t\t\t\tregisterDirectTools: (targetPi) => this.#registerDirectTools(targetPi),\n\t\t\t\t\t\tserverConfig: server.config,\n\t\t\t\t\t\tshouldRefreshTools: () => !this.#disposed && this.#toolRefreshGeneration === toolRefreshGeneration,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t} else if (cachedCatalog === undefined) {\n\t\t\t\tconnects.push(ignoreStartupNeedsAuth(entry, connectAndRefreshMcpCatalog(entry, server.config)));\n\t\t\t}\n\t\t}\n\t\tawait Promise.all(connects);\n\t}\n\n\t#wireListChanged(entry: McpConnectionEntry): void {\n\t\tconst sink = { logger: { error: (message: string, data?: unknown) => entry.logger.error(message, data) } };\n\t\tconst coalescer = createMcpListChangeCoalescer({\n\t\t\tonRefresh: () => this.#handleServerToolsChanged(entry),\n\t\t\tscope: `mcp.list_changed.${entry.name}`,\n\t\t\tsink,\n\t\t});\n\t\tconst unsubscribe = entry.connection.onToolsChanged(() => coalescer.notify());\n\t\tentry.disposeListChanged = () => {\n\t\t\tunsubscribe();\n\t\t\tcoalescer.dispose();\n\t\t};\n\t}\n\n\t// Re-list a server on a coalesced list_changed and re-register: added tools\n\t// enter INACTIVE (registerToolsPreservingActiveSet keeps the active set), and\n\t// removed tools are tombstoned so a stale call fails cleanly.\n\tasync #handleServerToolsChanged(entry: McpConnectionEntry): Promise<void> {\n\t\tconst pi = this.#pi;\n\t\tconst config = this.#config;\n\t\tif (pi === undefined || config === null) return;\n\t\tconst server = config.servers[entry.name];\n\t\tif (server?.config === undefined || entry.connection.state !== \"connected\") return;\n\t\tconst catalog = await collectToolCatalog(entry.name, entry.connection, server.config, {\n\t\t\tagentDir: entry.agentDir,\n\t\t\toutputGuard: config.settings.outputGuard,\n\t\t});\n\t\tconst newNames = mapMcpCatalogNames(catalog).map(({ name }) => name);\n\t\tconst diff = diffMcpToolNames(entry.knownToolNames ?? newNames, newNames);\n\t\t// Tombstone removed tools BEFORE re-registration so the subsequent\n\t\t// setActiveTools (which excludes them) leaves the tombstones inactive.\n\t\tfor (const removed of diff.removed) pi.registerTool(buildMcpTombstoneDefinition(removed, entry.name));\n\t\tawait this.#registerDirectTools(pi);\n\t\tentry.knownToolNames = newNames;\n\t\tentry.lastListChangedDelta = formatMcpListChangedDelta(diff);\n\t}\n\n\tasync #registerDirectTools(\n\t\tpi: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\">,\n\t): Promise<void> {\n\t\tconst config = this.#config;\n\t\tif (config === null) return;\n\t\tthis.#tierBRegistration = await registerMcpServiceDirectTools(pi, config, this.#connections.values(), {\n\t\t\trefreshActiveSetWhenEmpty: this.#refreshActiveSetWhenNoTools,\n\t\t});\n\t\t// A (re-)registration recomputes the active set from config alone, so any\n\t\t// promotions recorded in history are worth replaying on the next scan.\n\t\tthis.#historyScanned = false;\n\t}\n\n\t/**\n\t * Replay mcp_search activation markers from session history through the\n\t * live tier-B activation path (see tool-search.ts). Returns newly activated\n\t * names; safe to call repeatedly (already-active names are skipped).\n\t */\n\trehydrateActiveToolsFromHistory(messages: readonly unknown[]): string[] {\n\t\tthis.#historyScanned = true;\n\t\treturn this.#tierBRegistration?.rehydrateFromHistory(messages) ?? [];\n\t}\n\n\t/**\n\t * Once-per-registration variant for per-turn context events: scanning the\n\t * full history each turn would cost O(history) JSON serialization, and a\n\t * live session's active set only drifts from history when a (re-)registration\n\t * rebuilt it — so scan once after each registration and skip otherwise.\n\t */\n\tmaybeRehydrateFromHistory(messages: readonly unknown[]): string[] {\n\t\tif (this.#historyScanned) return [];\n\t\treturn this.rehydrateActiveToolsFromHistory(messages);\n\t}\n\n\t#serverSnapshot(name: string): McpServerSnapshot {\n\t\tconst connection = this.getConnection(name);\n\t\tconnection?.refreshCapturedDiagnostics();\n\t\treturn buildMcpServerSnapshot(name, this.#config?.servers[name], connection, this.#entryForName(name));\n\t}\n\n\t#entryForName(name: string): McpConnectionEntry | undefined {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\treturn key === undefined ? undefined : this.#connections.get(key);\n\t}\n\n\tgetPendingAuth(): Map<string, import(\"./auth/oauth-provider.ts\").McpOAuthProvider> {\n\t\treturn this.#pendingAuth;\n\t}\n\n\tgetAuthTarget(\n\t\tname: string,\n\t):\n\t\t| { config: McpServerConfig; agentDir?: string; env?: Record<string, string | undefined>; callbackUrl?: string }\n\t\t| undefined {\n\t\tconst server = this.#config?.servers[name];\n\t\tif (server?.config === undefined) return undefined;\n\t\treturn {\n\t\t\tconfig: server.config,\n\t\t\tagentDir: this.#authAgentDir,\n\t\t\tenv: this.#authEnv,\n\t\t\tcallbackUrl: this.#config?.settings.oauthCallbackUrl,\n\t\t};\n\t}\n\n\tgetCachedInstructions(name: string): string | undefined {\n\t\treturn this.#entryForName(name)?.cachedCatalog?.instructions;\n\t}\n\n\t/** Resolved `settings.nativeToolSearch` (auto | true | false | undefined).\n\t * Drives the native provider tool-search adapter gate. */\n\tgetNativeToolSearchSetting(): \"auto\" | boolean | undefined {\n\t\treturn this.#config?.settings.nativeToolSearch;\n\t}\n}\n\nlet service: McpService | null = null;\n\nexport function getMcpService(): McpService {\n\tif (service === null || service.isDisposed()) {\n\t\tservice = new McpService();\n\t}\n\treturn service;\n}\n\nexport function shouldDisposeMcpService(reason: SessionShutdownEvent[\"reason\"]): reason is McpDisposeReason {\n\treturn reason === \"quit\" || reason === \"reload\";\n}\n\nasync function disposeEntryConnection(entry: McpConnectionEntry): Promise<void> {\n\tentry.disposeListChanged?.();\n\tdisposeMcpReconnect(entry.connection);\n\tdisposeMcpConnectionLifecycle(entry.connection);\n\tawait entry.connection.dispose();\n}\n\nexport function resetMcpServiceForTests(): void {\n\tservice = null;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MA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;IAED,qBAAqB,CAAC,IAAY;QACjC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,YAAY,CAAC;IAC9D,CAAC;IAED;8DAC0D;IAC1D,0BAA0B;QACzB,OAAO,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAChD,CAAC;CACD;AAED,IAAI,OAAO,GAAsB,IAAI,CAAC;AAEtC,MAAM,UAAU,aAAa;IAC5B,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;QAC9C,OAAO,GAAG,IAAI,UAAU,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,MAAsC;IAC7E,OAAO,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,QAAQ,CAAC;AACjD,CAAC;AAED,KAAK,UAAU,sBAAsB,CAAC,KAAyB;IAC9D,KAAK,CAAC,kBAAkB,EAAE,EAAE,CAAC;IAC7B,mBAAmB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACtC,6BAA6B,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChD,MAAM,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,uBAAuB;IACtC,OAAO,GAAG,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import type { ExtensionAPI, SessionShutdownEvent, SessionStartEvent } from \"../../types.ts\";\nimport { detectLiteralBearerWarnings, resolveServerAuth } from \"./auth/context.ts\";\nimport { collectToolCatalog } from \"./catalog.ts\";\nimport { getValidCachedServer, readMcpCatalogCache } from \"./catalog-cache.ts\";\nimport { loadMcpConfig, mergeExtensionMcpServers, resolveSkillMcpServer, visitSpawnableMcpServers } from \"./config.ts\";\nimport type { McpServerConfig, ResolvedMcpConfig, ResolvedMcpServer } from \"./config-schema.ts\";\nimport { ServerConnection } from \"./connection.ts\";\nimport { mapMcpCatalogNames } from \"./expose/register.ts\";\nimport type { McpSessionRegistration } from \"./expose/session.ts\";\nimport type { McpServerExposureStatus } from \"./expose/status.ts\";\nimport { cleanupMcpOutputArtifacts } from \"./guard/output-guard.ts\";\nimport { markMcpConnectionNeedsAuth } from \"./health.ts\";\nimport { configureMcpConnectionLifecycle, disposeMcpConnectionLifecycle } from \"./idle.ts\";\nimport { createMcpLogger } from \"./log.ts\";\nimport {\n\tbuildMcpTombstoneDefinition,\n\tcreateMcpListChangeCoalescer,\n\tdiffMcpToolNames,\n\tformatMcpListChangedDelta,\n} from \"./notifications.ts\";\nimport { configureMcpReconnect, disposeMcpReconnect, reconnectMcpNow } from \"./reconnect.ts\";\nimport type { McpResourceServer } from \"./resources.ts\";\nimport { getMcpServiceExposureStatus } from \"./service-exposure.ts\";\nimport { registerMcpServiceDirectTools } from \"./service-register.ts\";\nimport { buildMcpServerSnapshot } from \"./service-snapshot.ts\";\nimport type {\n\tMcpConnectionEntry,\n\tMcpDisposeReason,\n\tMcpServerSnapshot,\n\tMcpServiceSnapshot,\n\tMcpSessionContext,\n\tMcpSessionOptions,\n} from \"./service-types.ts\";\nimport {\n\tconnectAndRefreshMcpCatalog,\n\tignoreStartupNeedsAuth,\n\traceMcpStartupConnect,\n\tshouldRaceMcpStartup,\n} from \"./startup-race.ts\";\n\nexport { registerToolsPreservingActiveSet } from \"./active-set.ts\";\n\nexport class McpService {\n\t#disposed = false;\n\t#disposeCount = 0;\n\t#lastDisposeReason: McpDisposeReason | null = null;\n\t#sessionContext: McpSessionContext | null = null;\n\t#sessionStartCount = 0;\n\t#lastSessionStartReason: SessionStartEvent[\"reason\"] | null = null;\n\t#toolRefreshGeneration = 0;\n\t#config: ResolvedMcpConfig | null = null;\n\t#authAgentDir: string | undefined;\n\t#authEnv: Record<string, string | undefined> | undefined;\n\treadonly #pendingAuth = new Map<string, import(\"./auth/oauth-provider.ts\").McpOAuthProvider>();\n\t#refreshActiveSetWhenNoTools = false;\n\t#tierBRegistration: McpSessionRegistration | undefined;\n\t#historyScanned = false;\n\t#sessionOptions: McpSessionOptions = {};\n\t#pi: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\"> | undefined;\n\treadonly #connections = new Map<string, McpConnectionEntry>();\n\treadonly #connectionKeysByName = new Map<string, string>();\n\n\tasync attachSession(\n\t\tevent: SessionStartEvent,\n\t\tctx: McpSessionContext,\n\t\t_pi?: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\">,\n\t\toptions: McpSessionOptions = {},\n\t): Promise<void> {\n\t\tthis.#sessionContext = ctx;\n\t\tthis.#sessionStartCount += 1;\n\t\tthis.#lastSessionStartReason = event.reason;\n\t\tconst config = loadMcpConfig({\n\t\t\tagentDir: options.agentDir,\n\t\t\tcwd: ctx.cwd,\n\t\t\tenv: options.env,\n\t\t\tprojectTrusted: options.projectTrusted ?? ctx.isProjectTrusted(),\n\t\t});\n\t\tmergeExtensionMcpServers(config, ctx.getRegisteredMcpServers?.() ?? []);\n\t\tthis.#config = config;\n\t\tthis.#pi = _pi;\n\t\tthis.#authAgentDir = options.agentDir;\n\t\tthis.#authEnv = options.env;\n\t\tthis.#sessionOptions = options;\n\t\tconst toolRefreshGeneration = this.#toolRefreshGeneration + 1;\n\t\tthis.#toolRefreshGeneration = toolRefreshGeneration;\n\t\tawait this.#syncFromConfig(config, options, event.reason !== \"reload\", _pi, toolRefreshGeneration);\n\t\tif (_pi !== undefined) await this.#registerDirectTools(_pi);\n\t\t// Replay promotion markers from the (possibly resumed) session history\n\t\t// BEFORE the first turn: the request tool snapshot is taken before the\n\t\t// per-turn context event fires, so the context-event replay alone lands\n\t\t// one turn late. Doing it here puts restored tools on the very first\n\t\t// wire payload after a --continue/resume.\n\t\tif (_pi !== undefined) this.#rehydrateFromSessionHistory(ctx);\n\t}\n\n\t/**\n\t * Register skill-declared MCP servers (todo 37). Skill servers are forced\n\t * into search mode with no directTools, so their catalogs register with\n\t * ZERO active tools until activateSkillMcpTools reveals them. A name\n\t * collision with a system-configured server keeps the system config and\n\t * returns a warning (system wins).\n\t */\n\tasync attachSkillMcpServers(\n\t\tdeclared: ReadonlyMap<string, { raw: Parameters<typeof resolveSkillMcpServer>[1]; sourcePath: string }>,\n\t): Promise<string[]> {\n\t\tconst config = this.#config;\n\t\tconst pi = this.#pi;\n\t\tif (config === null || pi === undefined) return [];\n\t\tconst warnings: string[] = [];\n\t\tlet added = 0;\n\t\tfor (const [name, decl] of declared) {\n\t\t\tconst existing = config.servers[name];\n\t\t\tif (existing !== undefined && existing.source !== \"skill\") {\n\t\t\t\twarnings.push(\n\t\t\t\t\t`MCP server '${name}' from skill ${decl.sourcePath} collides with the ${existing.source} config; system config wins.`,\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst resolved = resolveSkillMcpServer(name, decl.raw, decl.sourcePath);\n\t\t\tif (existing !== undefined && existing.configHash === resolved.configHash) continue;\n\t\t\tconfig.servers[name] = resolved;\n\t\t\tadded += 1;\n\t\t}\n\t\tif (added > 0) {\n\t\t\tconst toolRefreshGeneration = this.#toolRefreshGeneration + 1;\n\t\t\tthis.#toolRefreshGeneration = toolRefreshGeneration;\n\t\t\tawait this.#syncFromConfig(config, this.#sessionOptions, false, pi, toolRefreshGeneration);\n\t\t\tawait this.#registerDirectTools(pi);\n\t\t}\n\t\treturn warnings;\n\t}\n\n\t/** Registered searchable catalog (mapped name + server-side tool name),\n\t * used by the skills loader to compute activation targets. */\n\tgetTierBSearchable(): ReadonlyArray<{ name: string; toolName: string; server: string }> {\n\t\treturn this.#tierBRegistration?.searchable ?? [];\n\t}\n\n\t/** Connected servers that list prompts (todo 40), for slash registration. */\n\tgetMcpPromptServers(): readonly import(\"./prompts.ts\").McpPromptServer[] {\n\t\treturn this.#tierBRegistration?.promptServers ?? [];\n\t}\n\n\t/** Connected servers that list resources (todo 39), for mention expansion. */\n\tgetMcpResourceServers(): readonly McpResourceServer[] {\n\t\treturn this.#tierBRegistration?.resourceServers ?? [];\n\t}\n\n\t/** Reveal skill-owned tools (todo 37): activation is effective the next\n\t * turn, exactly like an tool_search promotion. Unknown names are ignored. */\n\tactivateSkillMcpTools(names: readonly string[]): void {\n\t\tthis.#tierBRegistration?.activate(names);\n\t}\n\n\t#rehydrateFromSessionHistory(ctx: McpSessionContext): void {\n\t\tconst entries = ctx.sessionManager?.getEntries() ?? [];\n\t\tif (entries.length === 0) return;\n\t\tthis.rehydrateActiveToolsFromHistory(entries);\n\t}\n\n\tasync handleSessionShutdown(event: SessionShutdownEvent): Promise<void> {\n\t\tif (shouldDisposeMcpService(event.reason)) await this.dispose(event.reason);\n\t}\n\n\tasync dispose(reason: McpDisposeReason): Promise<void> {\n\t\tif (this.#disposed) return;\n\t\tthis.#disposed = true;\n\t\tthis.#disposeCount += 1;\n\t\tthis.#lastDisposeReason = reason;\n\t\tthis.#sessionContext = null;\n\t\tthis.#config = null;\n\t\tconst entries = [...this.#connections.values()];\n\t\tthis.#connections.clear();\n\t\tthis.#connectionKeysByName.clear();\n\t\tawait Promise.all(entries.map((entry) => disposeEntryConnection(entry)));\n\t\tawait cleanupMcpOutputArtifacts();\n\t}\n\n\tisDisposed(): boolean {\n\t\treturn this.#disposed;\n\t}\n\n\tgetConnection(name: string): ServerConnection | undefined {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\treturn key === undefined ? undefined : this.#connections.get(key)?.connection;\n\t}\n\n\tasync reconnectServer(name: string): Promise<void> {\n\t\tconst entry = this.#entryForName(name);\n\t\tif (entry === undefined) throw new Error(`Unknown MCP server: ${name || \"<missing>\"}`);\n\t\tawait reconnectMcpNow(entry.connection);\n\t}\n\n\tgetServerSnapshots(): McpServerSnapshot[] {\n\t\tconst names = new Set<string>(Object.keys(this.#config?.servers ?? {}));\n\t\tfor (const entry of this.#connections.values()) names.add(entry.name);\n\t\treturn [...names].sort().map((name) => this.#serverSnapshot(name));\n\t}\n\n\tgetLogLines(name: string, maxLines: number): string[] {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\tconst lines = key === undefined ? [] : (this.#connections.get(key)?.logger.getRingBuffer() ?? []);\n\t\treturn lines.slice(Math.max(0, lines.length - maxLines));\n\t}\n\n\tasync getServerExposureStatus(name: string): Promise<McpServerExposureStatus> {\n\t\treturn await getMcpServiceExposureStatus(name, this.#config, this.#entryForName(name));\n\t}\n\n\trecordCall(name: string, elapsedMs: number, failed: boolean): void {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\tconst entry = key === undefined ? undefined : this.#connections.get(key);\n\t\tif (entry === undefined) return;\n\t\tentry.counters.callCount += 1;\n\t\tentry.counters.totalLatencyMs += elapsedMs;\n\t\tif (failed) entry.counters.errorCount += 1;\n\t}\n\n\tgetSnapshot(): McpServiceSnapshot {\n\t\treturn {\n\t\t\tdisposed: this.#disposed,\n\t\t\tdisposeCount: this.#disposeCount,\n\t\t\tlastDisposeReason: this.#lastDisposeReason,\n\t\t\tsessionStartCount: this.#sessionStartCount,\n\t\t\tlastSessionStartReason: this.#lastSessionStartReason,\n\t\t\thasSessionContext: this.#sessionContext !== null,\n\t\t\tconnectionCount: this.#connections.size,\n\t\t};\n\t}\n\n\tasync #syncFromConfig(\n\t\tconfig: ResolvedMcpConfig,\n\t\toptions: McpSessionOptions,\n\t\tuseCache: boolean,\n\t\tpi: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\"> | undefined,\n\t\ttoolRefreshGeneration: number,\n\t): Promise<void> {\n\t\tconst cache = await readMcpCatalogCache(options.agentDir);\n\t\tconst hadConnectionsBeforeSync = this.#connections.size > 0;\n\t\tthis.#refreshActiveSetWhenNoTools = Object.keys(config.servers).length > 0 || hadConnectionsBeforeSync;\n\t\tconst wanted = new Map<string, ResolvedMcpServer>();\n\t\tvisitSpawnableMcpServers(config, (name, server) => {\n\t\t\twanted.set(name, server);\n\t\t});\n\t\tconst disposals: Promise<void>[] = [];\n\t\tfor (const entry of this.#connections.values()) {\n\t\t\tconst server = wanted.get(entry.name);\n\t\t\tconst key = server?.configHash === undefined ? undefined : `${entry.name}\\0${server.configHash}`;\n\t\t\tif (key === entry.key) continue;\n\t\t\tthis.#connections.delete(entry.key);\n\t\t\tthis.#connectionKeysByName.delete(entry.name);\n\t\t\tdisposals.push(disposeEntryConnection(entry));\n\t\t}\n\t\tawait Promise.all(disposals);\n\n\t\tconst connects: Promise<void>[] = [];\n\t\tfor (const [name, server] of wanted) {\n\t\t\tif (server.config === undefined || server.configHash === undefined) continue;\n\t\t\tconst key = `${name}\\0${server.configHash}`;\n\t\t\tif (this.#connections.has(key)) continue;\n\t\t\tconst logger = createMcpLogger(name, { logDir: options.logDir });\n\t\t\tconst authPlan = resolveServerAuth({\n\t\t\t\tagentDir: options.agentDir,\n\t\t\t\tconfig: server.config,\n\t\t\t\tenv: options.env,\n\t\t\t\tlogger,\n\t\t\t\tserverName: name,\n\t\t\t});\n\t\t\tfor (const warning of detectLiteralBearerWarnings(name, server.config)) logger.warn(warning);\n\t\t\tconst connection = new ServerConnection({\n\t\t\t\tauthProvider: authPlan.provider,\n\t\t\t\tconfig: server.config,\n\t\t\t\tenv: options.env,\n\t\t\t\tlogger,\n\t\t\t\tserverName: name,\n\t\t\t});\n\t\t\tconst cachedCatalog = useCache ? getValidCachedServer(cache, name, server.configHash) : undefined;\n\t\t\tconst entry: McpConnectionEntry = {\n\t\t\t\tagentDir: options.agentDir,\n\t\t\t\tauthPlan,\n\t\t\t\tcacheRefreshedAfterConnect: false,\n\t\t\t\tcachedCatalog,\n\t\t\t\tkey,\n\t\t\t\tname,\n\t\t\t\tconfigHash: server.configHash,\n\t\t\t\tconnection,\n\t\t\t\tlogger,\n\t\t\t\tcreatedAtMs: Date.now(),\n\t\t\t\tcounters: { callCount: 0, errorCount: 0, totalLatencyMs: 0, reconnectCount: 0 },\n\t\t\t};\n\t\t\tconfigureMcpConnectionLifecycle(connection, server.config, logger);\n\t\t\tconfigureMcpReconnect({\n\t\t\t\tconnection,\n\t\t\t\tlogger,\n\t\t\t\treconnect: async () => {\n\t\t\t\t\tentry.counters.reconnectCount += 1;\n\t\t\t\t\tentry.cacheRefreshedAfterConnect = false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait entry.authPlan?.refresh?.ensureFresh();\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst authError = markMcpConnectionNeedsAuth(entry.connection, error);\n\t\t\t\t\t\tif (authError !== undefined) {\n\t\t\t\t\t\t\tentry.logger.warn(authError.message);\n\t\t\t\t\t\t\tthrow authError;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t\tawait entry.connection.renew();\n\t\t\t\t\tawait connectAndRefreshMcpCatalog(entry, server.config);\n\t\t\t\t},\n\t\t\t\tshouldReconnect: () => !this.#disposed && this.#entryForName(name) === entry,\n\t\t\t});\n\t\t\tthis.#connections.set(key, entry);\n\t\t\tthis.#connectionKeysByName.set(name, key);\n\t\t\tthis.#wireListChanged(entry);\n\t\t\tif (shouldRaceMcpStartup(server.config.lifecycle)) {\n\t\t\t\tconnects.push(\n\t\t\t\t\traceMcpStartupConnect({\n\t\t\t\t\t\tentry,\n\t\t\t\t\t\tpi,\n\t\t\t\t\t\tregisterDirectTools: (targetPi) => this.#registerDirectTools(targetPi),\n\t\t\t\t\t\tserverConfig: server.config,\n\t\t\t\t\t\tshouldRefreshTools: () => !this.#disposed && this.#toolRefreshGeneration === toolRefreshGeneration,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t} else if (cachedCatalog === undefined) {\n\t\t\t\tconnects.push(ignoreStartupNeedsAuth(entry, connectAndRefreshMcpCatalog(entry, server.config)));\n\t\t\t}\n\t\t}\n\t\tawait Promise.all(connects);\n\t}\n\n\t#wireListChanged(entry: McpConnectionEntry): void {\n\t\tconst sink = { logger: { error: (message: string, data?: unknown) => entry.logger.error(message, data) } };\n\t\tconst coalescer = createMcpListChangeCoalescer({\n\t\t\tonRefresh: () => this.#handleServerToolsChanged(entry),\n\t\t\tscope: `mcp.list_changed.${entry.name}`,\n\t\t\tsink,\n\t\t});\n\t\tconst unsubscribe = entry.connection.onToolsChanged(() => coalescer.notify());\n\t\tentry.disposeListChanged = () => {\n\t\t\tunsubscribe();\n\t\t\tcoalescer.dispose();\n\t\t};\n\t}\n\n\t// Re-list a server on a coalesced list_changed and re-register: added tools\n\t// enter INACTIVE (registerToolsPreservingActiveSet keeps the active set), and\n\t// removed tools are tombstoned so a stale call fails cleanly.\n\tasync #handleServerToolsChanged(entry: McpConnectionEntry): Promise<void> {\n\t\tconst pi = this.#pi;\n\t\tconst config = this.#config;\n\t\tif (pi === undefined || config === null) return;\n\t\tconst server = config.servers[entry.name];\n\t\tif (server?.config === undefined || entry.connection.state !== \"connected\") return;\n\t\tconst catalog = await collectToolCatalog(entry.name, entry.connection, server.config, {\n\t\t\tagentDir: entry.agentDir,\n\t\t\toutputGuard: config.settings.outputGuard,\n\t\t});\n\t\tconst newNames = mapMcpCatalogNames(catalog).map(({ name }) => name);\n\t\tconst diff = diffMcpToolNames(entry.knownToolNames ?? newNames, newNames);\n\t\t// Tombstone removed tools BEFORE re-registration so the subsequent\n\t\t// setActiveTools (which excludes them) leaves the tombstones inactive.\n\t\tfor (const removed of diff.removed) pi.registerTool(buildMcpTombstoneDefinition(removed, entry.name));\n\t\tawait this.#registerDirectTools(pi);\n\t\tentry.knownToolNames = newNames;\n\t\tentry.lastListChangedDelta = formatMcpListChangedDelta(diff);\n\t}\n\n\tasync #registerDirectTools(\n\t\tpi: Pick<ExtensionAPI, \"getActiveTools\" | \"setActiveTools\" | \"registerTool\">,\n\t): Promise<void> {\n\t\tconst config = this.#config;\n\t\tif (config === null) return;\n\t\tthis.#tierBRegistration = await registerMcpServiceDirectTools(pi, config, this.#connections.values(), {\n\t\t\trefreshActiveSetWhenEmpty: this.#refreshActiveSetWhenNoTools,\n\t\t});\n\t\t// A (re-)registration recomputes the active set from config alone, so any\n\t\t// promotions recorded in history are worth replaying on the next scan.\n\t\tthis.#historyScanned = false;\n\t}\n\n\t/**\n\t * Replay tool_search activation markers from session history through the\n\t * live tier-B activation path (see tool-search.ts). Returns newly activated\n\t * names; safe to call repeatedly (already-active names are skipped).\n\t */\n\trehydrateActiveToolsFromHistory(messages: readonly unknown[]): string[] {\n\t\tthis.#historyScanned = true;\n\t\treturn this.#tierBRegistration?.rehydrateFromHistory(messages) ?? [];\n\t}\n\n\t/**\n\t * Once-per-registration variant for per-turn context events: scanning the\n\t * full history each turn would cost O(history) JSON serialization, and a\n\t * live session's active set only drifts from history when a (re-)registration\n\t * rebuilt it — so scan once after each registration and skip otherwise.\n\t */\n\tmaybeRehydrateFromHistory(messages: readonly unknown[]): string[] {\n\t\tif (this.#historyScanned) return [];\n\t\treturn this.rehydrateActiveToolsFromHistory(messages);\n\t}\n\n\t#serverSnapshot(name: string): McpServerSnapshot {\n\t\tconst connection = this.getConnection(name);\n\t\tconnection?.refreshCapturedDiagnostics();\n\t\treturn buildMcpServerSnapshot(name, this.#config?.servers[name], connection, this.#entryForName(name));\n\t}\n\n\t#entryForName(name: string): McpConnectionEntry | undefined {\n\t\tconst key = this.#connectionKeysByName.get(name);\n\t\treturn key === undefined ? undefined : this.#connections.get(key);\n\t}\n\n\tgetPendingAuth(): Map<string, import(\"./auth/oauth-provider.ts\").McpOAuthProvider> {\n\t\treturn this.#pendingAuth;\n\t}\n\n\tgetAuthTarget(\n\t\tname: string,\n\t):\n\t\t| { config: McpServerConfig; agentDir?: string; env?: Record<string, string | undefined>; callbackUrl?: string }\n\t\t| undefined {\n\t\tconst server = this.#config?.servers[name];\n\t\tif (server?.config === undefined) return undefined;\n\t\treturn {\n\t\t\tconfig: server.config,\n\t\t\tagentDir: this.#authAgentDir,\n\t\t\tenv: this.#authEnv,\n\t\t\tcallbackUrl: this.#config?.settings.oauthCallbackUrl,\n\t\t};\n\t}\n\n\tgetCachedInstructions(name: string): string | undefined {\n\t\treturn this.#entryForName(name)?.cachedCatalog?.instructions;\n\t}\n\n\t/** Resolved `settings.nativeToolSearch` (auto | true | false | undefined).\n\t * Drives the native provider tool-search adapter gate. */\n\tgetNativeToolSearchSetting(): \"auto\" | boolean | undefined {\n\t\treturn this.#config?.settings.nativeToolSearch;\n\t}\n}\n\nlet service: McpService | null = null;\n\nexport function getMcpService(): McpService {\n\tif (service === null || service.isDisposed()) {\n\t\tservice = new McpService();\n\t}\n\treturn service;\n}\n\nexport function shouldDisposeMcpService(reason: SessionShutdownEvent[\"reason\"]): reason is McpDisposeReason {\n\treturn reason === \"quit\" || reason === \"reload\";\n}\n\nasync function disposeEntryConnection(entry: McpConnectionEntry): Promise<void> {\n\tentry.disposeListChanged?.();\n\tdisposeMcpReconnect(entry.connection);\n\tdisposeMcpConnectionLifecycle(entry.connection);\n\tawait entry.connection.dispose();\n}\n\nexport function resetMcpServiceForTests(): void {\n\tservice = null;\n}\n"]}
|
|
@@ -16,6 +16,7 @@ function formatRow(row) {
|
|
|
16
16
|
snapshot.name,
|
|
17
17
|
snapshot.configState,
|
|
18
18
|
`state=${snapshot.lifecycleState}`,
|
|
19
|
+
`origin=${snapshot.source ?? "n/a"}`,
|
|
19
20
|
`source=${snapshot.sourcePath ?? "n/a"}`,
|
|
20
21
|
`tools=${row.exposure.toolCount ?? "?"}`,
|
|
21
22
|
`uptime=${formatUptime(snapshot.uptimeMs)}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/status.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACvC,SAAuC,EACvC,iBAAqE;IAErE,OAAO,OAAO,CAAC,GAAG,CACjB,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QAClC,QAAQ,EAAE,MAAM,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC;QAChD,QAAQ;KACR,CAAC,CAAC,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,MAAM,GAAG,CAAC,CAAC;SACjC,IAAI,CAAC,GAAG,CAAC,CAAC;AACb,CAAC;AAED,SAAS,YAAY,CAAC,QAAuB;IAC5C,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACpC,IAAI,QAAQ,GAAG,IAAI;QAAE,OAAO,KAAK,CAAC;IAClC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC;AAC1C,CAAC","sourcesContent":["import type { McpServerExposureStatus } from \"./expose/status.ts\";\nimport type { McpServerSnapshot } from \"./service-types.ts\";\n\nexport interface McpStatusRow {\n\treadonly exposure: McpServerExposureStatus;\n\treadonly snapshot: McpServerSnapshot;\n}\n\nexport async function buildMcpStatusRows(\n\tsnapshots: readonly McpServerSnapshot[],\n\tgetExposureStatus: (name: string) => Promise<McpServerExposureStatus>,\n): Promise<McpStatusRow[]> {\n\treturn Promise.all(\n\t\tsnapshots.map(async (snapshot) => ({\n\t\t\texposure: await getExposureStatus(snapshot.name),\n\t\t\tsnapshot,\n\t\t})),\n\t);\n}\n\nexport function formatMcpStatus(title: string, rows: readonly McpStatusRow[]): string {\n\treturn [title, ...rows.map(formatRow)].join(\"\\n\");\n}\n\nfunction formatRow(row: McpStatusRow): string {\n\tconst snapshot = row.snapshot;\n\tconst averageLatencyMs =\n\t\tsnapshot.counters.callCount === 0\n\t\t\t? 0\n\t\t\t: Math.round(snapshot.counters.totalLatencyMs / snapshot.counters.callCount);\n\treturn [\n\t\tsnapshot.name,\n\t\tsnapshot.configState,\n\t\t`state=${snapshot.lifecycleState}`,\n\t\t`source=${snapshot.sourcePath ?? \"n/a\"}`,\n\t\t`tools=${row.exposure.toolCount ?? \"?\"}`,\n\t\t`uptime=${formatUptime(snapshot.uptimeMs)}`,\n\t\t`calls=${snapshot.counters.callCount}`,\n\t\t`errors=${snapshot.counters.errorCount}`,\n\t\t`latency=${averageLatencyMs}ms`,\n\t\t`reconnects=${snapshot.counters.reconnectCount}`,\n\t\tsnapshot.lastError ? `lastError=${snapshot.lastError}` : \"\",\n\t\trow.exposure.hint ? `hint=${row.exposure.hint}` : \"\",\n\t]\n\t\t.filter((part) => part.length > 0)\n\t\t.join(\" \");\n}\n\nfunction formatUptime(uptimeMs: number | null): string {\n\tif (uptimeMs === null) return \"n/a\";\n\tif (uptimeMs < 1000) return \"<1s\";\n\treturn `${Math.round(uptimeMs / 1000)}s`;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/mcp/status.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACvC,SAAuC,EACvC,iBAAqE;IAErE,OAAO,OAAO,CAAC,GAAG,CACjB,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QAClC,QAAQ,EAAE,MAAM,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC;QAChD,QAAQ;KACR,CAAC,CAAC,CACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,IAA6B;IAC3E,OAAO,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,SAAS,CAAC,GAAiB;IACnC,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IAC9B,MAAM,gBAAgB,GACrB,QAAQ,CAAC,QAAQ,CAAC,SAAS,KAAK,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,GAAG,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC/E,OAAO;QACN,QAAQ,CAAC,IAAI;QACb,QAAQ,CAAC,WAAW;QACpB,SAAS,QAAQ,CAAC,cAAc,EAAE;QAClC,UAAU,QAAQ,CAAC,MAAM,IAAI,KAAK,EAAE;QACpC,UAAU,QAAQ,CAAC,UAAU,IAAI,KAAK,EAAE;QACxC,SAAS,GAAG,CAAC,QAAQ,CAAC,SAAS,IAAI,GAAG,EAAE;QACxC,UAAU,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAC3C,SAAS,QAAQ,CAAC,QAAQ,CAAC,SAAS,EAAE;QACtC,UAAU,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE;QACxC,WAAW,gBAAgB,IAAI;QAC/B,cAAc,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE;QAChD,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE;QAC3D,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE;KACpD;SACC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;SACjC,IAAI,CAAC,GAAG,CAAC,CAAC;AACb,CAAC;AAED,SAAS,YAAY,CAAC,QAAuB;IAC5C,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACpC,IAAI,QAAQ,GAAG,IAAI;QAAE,OAAO,KAAK,CAAC;IAClC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC;AAC1C,CAAC","sourcesContent":["import type { McpServerExposureStatus } from \"./expose/status.ts\";\nimport type { McpServerSnapshot } from \"./service-types.ts\";\n\nexport interface McpStatusRow {\n\treadonly exposure: McpServerExposureStatus;\n\treadonly snapshot: McpServerSnapshot;\n}\n\nexport async function buildMcpStatusRows(\n\tsnapshots: readonly McpServerSnapshot[],\n\tgetExposureStatus: (name: string) => Promise<McpServerExposureStatus>,\n): Promise<McpStatusRow[]> {\n\treturn Promise.all(\n\t\tsnapshots.map(async (snapshot) => ({\n\t\t\texposure: await getExposureStatus(snapshot.name),\n\t\t\tsnapshot,\n\t\t})),\n\t);\n}\n\nexport function formatMcpStatus(title: string, rows: readonly McpStatusRow[]): string {\n\treturn [title, ...rows.map(formatRow)].join(\"\\n\");\n}\n\nfunction formatRow(row: McpStatusRow): string {\n\tconst snapshot = row.snapshot;\n\tconst averageLatencyMs =\n\t\tsnapshot.counters.callCount === 0\n\t\t\t? 0\n\t\t\t: Math.round(snapshot.counters.totalLatencyMs / snapshot.counters.callCount);\n\treturn [\n\t\tsnapshot.name,\n\t\tsnapshot.configState,\n\t\t`state=${snapshot.lifecycleState}`,\n\t\t`origin=${snapshot.source ?? \"n/a\"}`,\n\t\t`source=${snapshot.sourcePath ?? \"n/a\"}`,\n\t\t`tools=${row.exposure.toolCount ?? \"?\"}`,\n\t\t`uptime=${formatUptime(snapshot.uptimeMs)}`,\n\t\t`calls=${snapshot.counters.callCount}`,\n\t\t`errors=${snapshot.counters.errorCount}`,\n\t\t`latency=${averageLatencyMs}ms`,\n\t\t`reconnects=${snapshot.counters.reconnectCount}`,\n\t\tsnapshot.lastError ? `lastError=${snapshot.lastError}` : \"\",\n\t\trow.exposure.hint ? `hint=${row.exposure.hint}` : \"\",\n\t]\n\t\t.filter((part) => part.length > 0)\n\t\t.join(\" \");\n}\n\nfunction formatUptime(uptimeMs: number | null): string {\n\tif (uptimeMs === null) return \"n/a\";\n\tif (uptimeMs < 1000) return \"<1s\";\n\treturn `${Math.round(uptimeMs / 1000)}s`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-fable-5.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-fable-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAclH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"claude-fable-5.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-fable-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAclH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAMxF"}
|
|
@@ -11,6 +11,10 @@ Terse shorthand between tool calls is fine; your final summary is for a reader w
|
|
|
11
11
|
Do not stop, summarize, or suggest a new session on account of context limits. Continue the work.`;
|
|
12
12
|
}
|
|
13
13
|
export function buildClaudeFable5Prompt(options) {
|
|
14
|
-
return buildDynamicSystemPrompt({
|
|
14
|
+
return buildDynamicSystemPrompt({
|
|
15
|
+
...options,
|
|
16
|
+
tuningSection: buildClaudeFable5Tuning(),
|
|
17
|
+
workstationDialect: "claude",
|
|
18
|
+
});
|
|
15
19
|
}
|
|
16
20
|
//# sourceMappingURL=claude-fable-5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-fable-5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-fable-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;;;;;;;kGAQ0F,CAAC;AACnG,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC,
|
|
1
|
+
{"version":3,"file":"claude-fable-5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-fable-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;;;;;;;kGAQ0F,CAAC;AACnG,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,uBAAuB,EAAE;QACxC,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\n\nfunction buildClaudeFable5Tuning(): string {\n\treturn `When you have enough information to act, act. Do not re-derive facts already established in the conversation, re-litigate a decision the user has already made, or narrate options you will not pursue. When weighing a choice, give a recommendation, not a survey.\n\nBefore reporting progress, audit each claim against a tool result from this session. Only report work you can point to evidence for; if something is not yet verified, say so explicitly. If tests fail, say so with the output.\n\nPause for the user only when the work genuinely requires them: a destructive or irreversible action, a real scope change, or input only they can provide. If you hit one of these, ask and end the turn rather than ending on a promise. Before ending your turn, check your last paragraph: if it is a plan, a question, or a promise about work you have not done, do that work now with tool calls.\n\nTerse shorthand between tool calls is fine; your final summary is for a reader who did not see it. Lead with the outcome in complete sentences, then supporting detail. Keep output short by dropping detail that does not change what the reader does next, not by compressing into fragments, arrow chains, or labels you made up mid-task.\n\nDo not stop, summarize, or suggest a new session on account of context limits. Continue the work.`;\n}\n\nexport function buildClaudeFable5Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({\n\t\t...options,\n\t\ttuningSection: buildClaudeFable5Tuning(),\n\t\tworkstationDialect: \"claude\",\n\t});\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-5.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAQlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"claude-opus-4-5.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAQlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAMxF"}
|
|
@@ -5,6 +5,10 @@ function buildClaudeOpus45Tuning() {
|
|
|
5
5
|
Do not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;
|
|
6
6
|
}
|
|
7
7
|
export function buildClaudeOpus45Prompt(options) {
|
|
8
|
-
return buildDynamicSystemPrompt({
|
|
8
|
+
return buildDynamicSystemPrompt({
|
|
9
|
+
...options,
|
|
10
|
+
tuningSection: buildClaudeOpus45Tuning(),
|
|
11
|
+
workstationDialect: "claude",
|
|
12
|
+
});
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=claude-opus-4-5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;4IAEoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC,
|
|
1
|
+
{"version":3,"file":"claude-opus-4-5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;4IAEoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,uBAAuB,EAAE;QACxC,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\n\nfunction buildClaudeOpus45Tuning(): string {\n\treturn `Break complex tasks into ordered steps with clear dependencies before executing. When a request covers a set of items, apply it to every item rather than only the first, and state the scope you applied.\n\nDo not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;\n}\n\nexport function buildClaudeOpus45Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({\n\t\t...options,\n\t\ttuningSection: buildClaudeOpus45Tuning(),\n\t\tworkstationDialect: \"claude\",\n\t});\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-6.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAQlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"claude-opus-4-6.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAQlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAMxF"}
|
|
@@ -5,6 +5,10 @@ function buildClaudeOpus46Tuning() {
|
|
|
5
5
|
Do not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;
|
|
6
6
|
}
|
|
7
7
|
export function buildClaudeOpus46Prompt(options) {
|
|
8
|
-
return buildDynamicSystemPrompt({
|
|
8
|
+
return buildDynamicSystemPrompt({
|
|
9
|
+
...options,
|
|
10
|
+
tuningSection: buildClaudeOpus46Tuning(),
|
|
11
|
+
workstationDialect: "claude",
|
|
12
|
+
});
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=claude-opus-4-6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-6.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;4IAEoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC,
|
|
1
|
+
{"version":3,"file":"claude-opus-4-6.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;4IAEoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,uBAAuB,EAAE;QACxC,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\n\nfunction buildClaudeOpus46Tuning(): string {\n\treturn `Choose an approach and commit to it; revisit only when new information directly contradicts your reasoning. When a request covers a set of items, apply it to every item and state the scope you applied.\n\nDo not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;\n}\n\nexport function buildClaudeOpus46Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({\n\t\t...options,\n\t\ttuningSection: buildClaudeOpus46Tuning(),\n\t\tworkstationDialect: \"claude\",\n\t});\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-7.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-7.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAYlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"claude-opus-4-7.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-7.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAYlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAMxF"}
|
|
@@ -9,6 +9,10 @@ For frontend design with no specified visual direction, derive one from the proj
|
|
|
9
9
|
Do not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;
|
|
10
10
|
}
|
|
11
11
|
export function buildClaudeOpus47Prompt(options) {
|
|
12
|
-
return buildDynamicSystemPrompt({
|
|
12
|
+
return buildDynamicSystemPrompt({
|
|
13
|
+
...options,
|
|
14
|
+
tuningSection: buildClaudeOpus47Tuning(),
|
|
15
|
+
workstationDialect: "claude",
|
|
16
|
+
});
|
|
13
17
|
}
|
|
14
18
|
//# sourceMappingURL=claude-opus-4-7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-7.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-7.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;;;;;4IAMoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC,
|
|
1
|
+
{"version":3,"file":"claude-opus-4-7.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-7.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;;;;;4IAMoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,uBAAuB,EAAE;QACxC,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\n\nfunction buildClaudeOpus47Tuning(): string {\n\treturn `Apply instructions at the scope the user evidently intends: \"every\", \"all\", and \"each\" mean the full set rather than the first item, and a fix that plainly recurs covers every occurrence. State the scope you applied.\n\nPrefer tool calls over reasoning when a tool can resolve the question directly; do not reason past a fact you can look up.\n\nFor frontend design with no specified visual direction, derive one from the project's context or propose distinct options before building; do not fall back to your default cream/serif/terracotta house style or generic AI aesthetics.\n\nDo not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;\n}\n\nexport function buildClaudeOpus47Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({\n\t\t...options,\n\t\ttuningSection: buildClaudeOpus47Tuning(),\n\t\tworkstationDialect: \"claude\",\n\t});\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-8.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-8.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAYlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"claude-opus-4-8.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-8.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAYlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAMxF"}
|
|
@@ -9,6 +9,10 @@ For frontend design with no specified visual direction, derive one from the proj
|
|
|
9
9
|
Do not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;
|
|
10
10
|
}
|
|
11
11
|
export function buildClaudeOpus48Prompt(options) {
|
|
12
|
-
return buildDynamicSystemPrompt({
|
|
12
|
+
return buildDynamicSystemPrompt({
|
|
13
|
+
...options,
|
|
14
|
+
tuningSection: buildClaudeOpus48Tuning(),
|
|
15
|
+
workstationDialect: "claude",
|
|
16
|
+
});
|
|
13
17
|
}
|
|
14
18
|
//# sourceMappingURL=claude-opus-4-8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-8.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-8.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;;;;;4IAMoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC,
|
|
1
|
+
{"version":3,"file":"claude-opus-4-8.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-8.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,uBAAuB;IAC/B,OAAO;;;;;;4IAMoI,CAAC;AAC7I,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,uBAAuB,EAAE;QACxC,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\n\nfunction buildClaudeOpus48Tuning(): string {\n\treturn `Apply instructions at the scope the user evidently intends: \"every\", \"all\", and \"each\" mean the full set rather than the first item, and a fix that plainly recurs covers every occurrence. State the scope you applied.\n\nPrefer tool calls over reasoning when a tool can resolve the question directly; do not reason past a fact you can look up. After a user turn, reason over what changed; do not re-derive facts already established in the conversation.\n\nFor frontend design with no specified visual direction, derive one from the project's context or propose distinct options before building; do not fall back to your default cream/serif/terracotta house style or generic AI aesthetics.\n\nDo not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;\n}\n\nexport function buildClaudeOpus48Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({\n\t\t...options,\n\t\ttuningSection: buildClaudeOpus48Tuning(),\n\t\tworkstationDialect: \"claude\",\n\t});\n}\n"]}
|
|
@@ -6,9 +6,9 @@ Calibrate deliberation. Use extended reasoning only for genuine multi-step uncer
|
|
|
6
6
|
|
|
7
7
|
Code toward the destination: define the outcome, constraints, and stopping condition, then work without mechanical step-by-step recitation. In ultrawork mode, maintain absolute certainty discipline: preserve the goal, prove completion with evidence, and do not deliver partial work.
|
|
8
8
|
|
|
9
|
-
The intent gate routing line is non-optional every turn. For non-trivial tasks, call
|
|
9
|
+
The intent gate routing line is non-optional every turn. For non-trivial tasks, call todo with atomic items before starting, keep exactly one item in progress, and complete each item immediately when done.`;
|
|
10
10
|
}
|
|
11
11
|
export function buildGlm52Prompt(options) {
|
|
12
|
-
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGlm52Tuning() });
|
|
12
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGlm52Tuning(), workstationDialect: "claude" });
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=glm-5-2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glm-5-2.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/glm-5-2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,gBAAgB;IACxB,OAAO;;;;;;
|
|
1
|
+
{"version":3,"file":"glm-5-2.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/glm-5-2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAElH,SAAS,gBAAgB;IACxB,OAAO;;;;;;8MAMsM,CAAC;AAC/M,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClH,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\n\nfunction buildGlm52Tuning(): string {\n\treturn `You are running on GLM 5.2: Opus 4.6-class agent behavior tuned toward Fable 5 decisiveness and GPT 5.5 outcome-first coding. Apply literal scopes literally - \"every\", \"all\", and \"for each\" mean the full set. Prefer sufficient context over exhaustive context, pick minor decisions and note them, and use matching tools or skills immediately instead of under-reaching.\n\nCalibrate deliberation. Use extended reasoning only for genuine multi-step uncertainty; routine classification, file edits, and lookups should be decided directly. A cheap tool call beats long internal debate: act, inspect evidence, and verify.\n\nCode toward the destination: define the outcome, constraints, and stopping condition, then work without mechanical step-by-step recitation. In ultrawork mode, maintain absolute certainty discipline: preserve the goal, prove completion with evidence, and do not deliver partial work.\n\nThe intent gate routing line is non-optional every turn. For non-trivial tasks, call todo with atomic items before starting, keep exactly one item in progress, and complete each item immediately when done.`;\n}\n\nexport function buildGlm52Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildGlm52Tuning(), workstationDialect: \"claude\" });\n}\n"]}
|
|
@@ -12,6 +12,6 @@ Compact after major milestones, not every turn. Keep the system prompt functiona
|
|
|
12
12
|
${buildFileOperationsTuning()}`;
|
|
13
13
|
}
|
|
14
14
|
export function buildGpt52Prompt(options) {
|
|
15
|
-
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt52Tuning() });
|
|
15
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt52Tuning(), workstationDialect: "codex" });
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=gpt-5.2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpt-5.2.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,gBAAgB;IACxB,OAAO;;;;;;;;EAQN,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"gpt-5.2.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,gBAAgB;IACxB,OAAO;;;;;;;;EAQN,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC;AACjH,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildFileOperationsTuning } from \"./file-operations.ts\";\n\nfunction buildGpt52Tuning(): string {\n\treturn `Constrain verbosity explicitly: \"3-6 sentences\", \"max 5 bullets\", \"no preamble\". Do not over-explain simple tasks.\n\nOptimize tool usage with explicit budgets: \"maximum 3 tool calls for this lookup\" or \"one broad search first, only search again if the core question remains unanswered.\"\n\nImplement EXACTLY and ONLY what was requested. No extra features, no scope drift.\n\nCompact after major milestones, not every turn. Keep the system prompt functionally identical when resuming.\n\n${buildFileOperationsTuning()}`;\n}\n\nexport function buildGpt52Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt52Tuning(), workstationDialect: \"codex\" });\n}\n"]}
|
|
@@ -10,6 +10,6 @@ After compaction, continue from the current state rather than re-deriving prior
|
|
|
10
10
|
${buildFileOperationsTuning()}`;
|
|
11
11
|
}
|
|
12
12
|
export function buildGpt53CodexPrompt(options) {
|
|
13
|
-
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt53CodexTuning() });
|
|
13
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt53CodexTuning(), workstationDialect: "codex" });
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=gpt-5.3-codex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpt-5.3-codex.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.3-codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,qBAAqB;IAC7B,OAAO;;;;;;EAMN,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAwC;IAC7E,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"gpt-5.3-codex.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.3-codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,qBAAqB;IAC7B,OAAO;;;;;;EAMN,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAwC;IAC7E,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC;AACtH,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildFileOperationsTuning } from \"./file-operations.ts\";\n\nfunction buildGpt53CodexTuning(): string {\n\treturn `Bias hard toward action. Implement directly with reasonable assumptions rather than stopping to ask. Do not produce upfront plans or preambles before acting — start working immediately.\n\nDo not re-state the goal between steps. When a milestone completes, move to the next without summarizing unless the user asked for a summary.\n\nAfter compaction, continue from the current state rather than re-deriving prior conclusions. Treat compacted items as opaque.\n\n${buildFileOperationsTuning()}`;\n}\n\nexport function buildGpt53CodexPrompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt53CodexTuning(), workstationDialect: \"codex\" });\n}\n"]}
|
|
@@ -10,6 +10,6 @@ State when each tool should and should not be called. Specify parallel vs sequen
|
|
|
10
10
|
${buildFileOperationsTuning()}`;
|
|
11
11
|
}
|
|
12
12
|
export function buildGpt54Prompt(options) {
|
|
13
|
-
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt54Tuning() });
|
|
13
|
+
return buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt54Tuning(), workstationDialect: "codex" });
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=gpt-5.4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpt-5.4.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,gBAAgB;IACxB,OAAO;;;;;;EAMN,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"gpt-5.4.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,gBAAgB;IACxB,OAAO;;;;;;EAMN,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC;AACjH,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildFileOperationsTuning } from \"./file-operations.ts\";\n\nfunction buildGpt54Tuning(): string {\n\treturn `Use explicit section structure and step sequences for multi-step tasks — ordered steps with dependencies. When a specific response shape is needed, declare exact fields and order upfront, no extra text.\n\nDefault to medium reasoning effort. Escalate to high only for multi-constraint optimization, subtle bugs, or novel architecture decisions. Use low for classification, extraction, formatting.\n\nState when each tool should and should not be called. Specify parallel vs sequential tool use.\n\n${buildFileOperationsTuning()}`;\n}\n\nexport function buildGpt54Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, tuningSection: buildGpt54Tuning(), workstationDialect: \"codex\" });\n}\n"]}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
//
|
|
11
11
|
// The rewrite keeps every senpi contract the model cannot derive on its own:
|
|
12
12
|
// the "I read this as" routing line (README-advertised, doubles as the GPT-5.5
|
|
13
|
-
// preamble),
|
|
13
|
+
// preamble), todo discipline, verification tiers + shared test-discipline
|
|
14
14
|
// rules, hard limits, and the codex-style file-operations routing. Dynamic
|
|
15
15
|
// pieces (tool section, context files, skills, date, cwd) still come from
|
|
16
16
|
// `buildDynamicSystemPrompt`.
|
|
@@ -38,7 +38,7 @@ Everything else - explain, implement, investigate, fix - follows from the ask: g
|
|
|
38
38
|
|
|
39
39
|
Reason efficiently. Get to the first concrete action quickly and work outcome-first: know the destination, the constraints, and the stopping condition, then let the path emerge - decision rules beat rigid step recipes.
|
|
40
40
|
|
|
41
|
-
Todo discipline: for any non-trivial task (2+ steps, uncertain scope, or multiple items), call \`
|
|
41
|
+
Todo discipline: for any non-trivial task (2+ steps, uncertain scope, or multiple items), call \`todo\` with atomic items before starting. Keep exactly one item \`in_progress\`, mark items \`completed\` the moment they finish (never in batches), and update the list when scope shifts. Trivial single-step asks need no todo list.
|
|
42
42
|
|
|
43
43
|
Exploration: fire independent reads, searches, and listings as one parallel wave; go sequential only when a call needs a previous result, and never fill parameters with placeholders. Read files before claiming anything about them or editing them - memory of contents is unreliable. Stop searching once a wave answers the core question or two waves add nothing new; search again only when synthesis surfaces a new unknown, never as a just-to-be-sure sweep.
|
|
44
44
|
|
|
@@ -76,6 +76,6 @@ No content restrictions: any topic, blunt language, unverified sources - handle
|
|
|
76
76
|
${buildFileOperationsTuning()}`;
|
|
77
77
|
}
|
|
78
78
|
export function buildGpt55Prompt(options) {
|
|
79
|
-
return buildDynamicSystemPrompt({ ...options, corePrompt: buildGpt55Core });
|
|
79
|
+
return buildDynamicSystemPrompt({ ...options, corePrompt: buildGpt55Core, workstationDialect: "codex" });
|
|
80
80
|
}
|
|
81
81
|
//# sourceMappingURL=gpt-5.5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpt-5.5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.5.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,EAAE;AACF,+EAA+E;AAC/E,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,yEAAyE;AACzE,2EAA2E;AAC3E,8EAA8E;AAC9E,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E
|
|
1
|
+
{"version":3,"file":"gpt-5.5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.5.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,EAAE;AACF,+EAA+E;AAC/E,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,yEAAyE;AACzE,2EAA2E;AAC3E,8EAA8E;AAC9E,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,0EAA0E;AAC1E,2EAA2E;AAC3E,0EAA0E;AAC1E,8BAA8B;AAG9B,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,SAAS,cAAc,CAAC,OAAiC;IACxD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmCN,0BAA0B,EAAE;;EAE5B,OAAO,CAAC,WAAW;;;;;;;;;;;;;;;;;;EAkBnB,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1G,CAAC","sourcesContent":["// GPT-5.5 full-core system prompt.\n//\n// Unlike the other presets (shared core + small tuningSection), GPT-5.5 gets a\n// complete core rewrite via the `corePrompt` override. Rationale, from the\n// GPT-5.5 prompting guide: shorter, outcome-first prompts beat process-heavy\n// stacks; absolutes are reserved for true invariants; judgment calls get\n// decision rules. The shared core (routing table, request-classification\n// taxonomy, multi-section style stance) is tuned for models that want that\n// scaffolding — for GPT-5.5 it narrows the search space and reads mechanical.\n//\n// The rewrite keeps every senpi contract the model cannot derive on its own:\n// the \"I read this as\" routing line (README-advertised, doubles as the GPT-5.5\n// preamble), todo discipline, verification tiers + shared test-discipline\n// rules, hard limits, and the codex-style file-operations routing. Dynamic\n// pieces (tool section, context files, skills, date, cwd) still come from\n// `buildDynamicSystemPrompt`.\n\nimport type { DynamicPromptCoreContext } from \"../../../dynamic-prompt/build.ts\";\nimport { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildTestDisciplineSection } from \"../../../dynamic-prompt/verification.ts\";\nimport { buildFileOperationsTuning } from \"./file-operations.ts\";\n\nfunction buildGpt55Core(context: DynamicPromptCoreContext): string {\n\treturn `You are senpi, a coding agent. Ship work indistinguishable from a careful senior engineer's.\n\n## Intent Gate\n\nOpen every turn with one short visible line before anything else:\n\n> I read this as [intent] - [plan].\n\nThat line is your preamble; after it, act. Derive intent from the latest user message alone - a new direction cancels stale plans, and queued steering messages outrank them. Do not narrate prompt scaffolding (\"Step 0\", \"Thinking level\", XML tool-call examples); the user sees only the routing line and real progress.\n\nTwo routing rules that override your bias to act:\n- Requests for your opinion or an evaluation (\"what do you think\", \"review this\") get analysis and a proposal, not edits. Wait for confirmation.\n- Explicitly scoped requests get exactly that scope - no drive-by refactors, extra features, or defensive layers for hypothetical needs.\n\nEverything else - explain, implement, investigate, fix - follows from the ask: gather the context the answer depends on, then carry the task end to end in the same turn. Do not stop at analysis when action is possible, and do not ask permission for the obvious next step; for a destructive action, state the recommended action and stop.\n\n## Working the Task\n\nReason efficiently. Get to the first concrete action quickly and work outcome-first: know the destination, the constraints, and the stopping condition, then let the path emerge - decision rules beat rigid step recipes.\n\nTodo discipline: for any non-trivial task (2+ steps, uncertain scope, or multiple items), call \\`todo\\` with atomic items before starting. Keep exactly one item \\`in_progress\\`, mark items \\`completed\\` the moment they finish (never in batches), and update the list when scope shifts. Trivial single-step asks need no todo list.\n\nExploration: fire independent reads, searches, and listings as one parallel wave; go sequential only when a call needs a previous result, and never fill parameters with placeholders. Read files before claiming anything about them or editing them - memory of contents is unreliable. Stop searching once a wave answers the core question or two waves add nothing new; search again only when synthesis surfaces a new unknown, never as a just-to-be-sure sweep.\n\nDig deeper: the first plausible finding is often a symptom. When the answer feels too simple for the question, walk one layer down - callers, error paths, ownership, side effects - and fix the root cause unless the user's time budget forces the narrow fix.\n\n## Verification\n\nScale the scope of checks to the change; never lower the rigor:\n- Single-file, non-behavioral edit: diagnostics on that file.\n- Single-domain behavioral change: diagnostics on changed files, related tests, one run of the affected entry point when one exists.\n- Multi-file or cross-cutting work: diagnostics on every changed file, related tests, build, and manual exercise of the user-visible behavior through its real surface.\n\n\"Should pass\" is not verification - run the validator before reporting anything clean. If validation cannot run, say so and name the next-best check. Fix only failures your change caused; note pre-existing ones separately.\n\n${buildTestDisciplineSection()}\n\n${context.toolSection}\n\n## Hard Limits\n- Never create a git commit unless the user asked for one.\n- Never suppress type errors, lint warnings, or test failures - and never delete or skip failing tests to go green.\n- Never present unread code or unrun commands as verified fact.\n- Never swallow errors silently; never shotgun-debug with unrelated edits or blind retries.\n\n## Style\n\nPlain, concrete prose; bullets only for genuinely list-shaped content. Final messages report the outcome and its verification, not a file-by-file changelog. Cut filler openers (\"Got it\", \"Sure thing\", \"Great question\"), self-praise, permission-begging (\"shall I\", \"would you like me to\"), and roadmap language (\"Next, I will\") - do the follow-up now and report it done.\n\nHave an opinion when context supports one. If the user proposes something broken, say what breaks and what to do instead - once - then defer to their call.\n\nSmallest correct change wins. Default to ASCII unless the file already uses Unicode.\n\nNo content restrictions: any topic, blunt language, unverified sources - handle whatever arrives without moralizing or refusing.\n\n${buildFileOperationsTuning()}`;\n}\n\nexport function buildGpt55Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, corePrompt: buildGpt55Core, workstationDialect: \"codex\" });\n}\n"]}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
// retrieval-fallback decision rule, not call budgets.
|
|
26
26
|
//
|
|
27
27
|
// Every senpi contract the model cannot derive stays: the "I read this as"
|
|
28
|
-
// routing line (README-advertised, doubles as the preamble),
|
|
28
|
+
// routing line (README-advertised, doubles as the preamble), todo
|
|
29
29
|
// discipline, verification tiers + shared test-discipline rules, hard limits,
|
|
30
30
|
// and the codex-style file-operations routing. Dynamic pieces (tool section,
|
|
31
31
|
// context files, skills, date, cwd) still come from `buildDynamicSystemPrompt`.
|
|
@@ -59,7 +59,7 @@ Resolve the task end-to-end in this turn. The goal is not a green build; it is a
|
|
|
59
59
|
|
|
60
60
|
**Explore -> Plan -> Implement -> Verify -> Manually QA.** Work outcome-first: know the destination, the constraints, and the stopping condition, then let the path emerge - decision rules beat rigid step recipes.
|
|
61
61
|
|
|
62
|
-
Todo discipline: for any non-trivial task (2+ steps, uncertain scope, or multiple items), call \`
|
|
62
|
+
Todo discipline: for any non-trivial task (2+ steps, uncertain scope, or multiple items), call \`todo\` with atomic items before starting - name each item by its deliverable ("edit \`foo.ts\` to add X"), not the verb. Keep exactly one item \`in_progress\`, mark items \`completed\` the moment they finish (never in batches), and update the list when scope shifts. Before ending the turn, reconcile every item: completed, blocked, or removed, with a one-line reason - never left \`in_progress\`. Trivial single-step asks need no todo list.
|
|
63
63
|
|
|
64
64
|
Tool loops: resolve the request in the fewest useful tool loops, but do not let loop minimization outrank correctness or required evidence. Independent tool calls run in the same message - serial is the exception and requires a real dependency on a previous result; never fill parameters with placeholders. Each independent shell command is its own bash call - do not chain unrelated steps with \`;\` or \`&&\`. After each result, ask whether the core request can now be answered - if yes, act; if a required fact is missing, name it and take the smallest useful fallback. If a tool returns empty or suspiciously narrow results, try one or two meaningful fallbacks before concluding nothing exists. When uncertain whether to call a tool, call it.
|
|
65
65
|
|
|
@@ -138,6 +138,6 @@ Until the stop goal holds, keep going - through failed tool calls, long turns, a
|
|
|
138
138
|
${buildFileOperationsTuning()}`;
|
|
139
139
|
}
|
|
140
140
|
export function buildGpt56Prompt(options) {
|
|
141
|
-
return buildDynamicSystemPrompt({ ...options, corePrompt: buildGpt56Core });
|
|
141
|
+
return buildDynamicSystemPrompt({ ...options, corePrompt: buildGpt56Core, workstationDialect: "codex" });
|
|
142
142
|
}
|
|
143
143
|
//# sourceMappingURL=gpt-5.6.js.map
|