@code-yeongyu/senpi 2026.8.9 → 2026.8.11-2
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 +122 -0
- package/dist/brand-dir-migration.d.ts +28 -0
- package/dist/brand-dir-migration.d.ts.map +1 -0
- package/dist/brand-dir-migration.js +77 -0
- package/dist/brand-dir-migration.js.map +1 -0
- package/dist/cli/grok-neo-gate.d.ts +0 -8
- package/dist/cli/grok-neo-gate.d.ts.map +1 -1
- package/dist/cli/grok-neo-gate.js +4 -2
- package/dist/cli/grok-neo-gate.js.map +1 -1
- package/dist/cli-main.js +3 -0
- package/dist/cli-main.js.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +27 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +41 -9
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +4 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +21 -3
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/brand.d.ts +79 -0
- package/dist/core/brand.d.ts.map +1 -0
- package/dist/core/brand.js +141 -0
- package/dist/core/brand.js.map +1 -0
- package/dist/core/dynamic-prompt/identity.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/identity.js +2 -1
- package/dist/core/dynamic-prompt/identity.js.map +1 -1
- package/dist/core/experimental.d.ts.map +1 -1
- package/dist/core/experimental.js +2 -1
- package/dist/core/experimental.js.map +1 -1
- package/dist/core/extensions/builtin/cache-keepalive/index.d.ts +30 -0
- package/dist/core/extensions/builtin/cache-keepalive/index.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cache-keepalive/index.js +281 -0
- package/dist/core/extensions/builtin/cache-keepalive/index.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.js +10 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.js +9 -9
- package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/log.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/log.js +2 -1
- package/dist/core/extensions/builtin/compaction/log.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/generated-shim-filter.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/generated-shim-filter.js +4 -4
- package/dist/core/extensions/builtin/config-reload/generated-shim-filter.js.map +1 -1
- package/dist/core/extensions/builtin/goal/cache-warm-renderer.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/cache-warm-renderer.js +21 -8
- package/dist/core/extensions/builtin/goal/cache-warm-renderer.js.map +1 -1
- package/dist/core/extensions/builtin/goal/cache-warm.d.ts +11 -2
- package/dist/core/extensions/builtin/goal/cache-warm.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/cache-warm.js +16 -0
- package/dist/core/extensions/builtin/goal/cache-warm.js.map +1 -1
- package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/index.js +36 -1
- package/dist/core/extensions/builtin/goal/index.js.map +1 -1
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.d.ts +2 -2
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.js +3 -3
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.js.map +1 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts +2 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.js +121 -54
- package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
- package/dist/core/extensions/builtin/goal/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/prompt.js +4 -4
- package/dist/core/extensions/builtin/goal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/goal/store-changed-event.d.ts +8 -0
- package/dist/core/extensions/builtin/goal/store-changed-event.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/store-changed-event.js +9 -0
- package/dist/core/extensions/builtin/goal/store-changed-event.js.map +1 -0
- package/dist/core/extensions/builtin/goal/store.d.ts +3 -2
- package/dist/core/extensions/builtin/goal/store.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/store.js +128 -101
- package/dist/core/extensions/builtin/goal/store.js.map +1 -1
- package/dist/core/extensions/builtin/goal/wait-progress.js +5 -5
- package/dist/core/extensions/builtin/goal/wait-progress.js.map +1 -1
- package/dist/core/extensions/builtin/help/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/help/index.js +3 -2
- package/dist/core/extensions/builtin/help/index.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/monitor-state-event.d.ts +16 -0
- package/dist/core/extensions/builtin/monitor-state-event.d.ts.map +1 -1
- package/dist/core/extensions/builtin/monitor-state-event.js +15 -0
- package/dist/core/extensions/builtin/monitor-state-event.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 +2 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js +2 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js +2 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +2 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/grok-4.5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/grok-4.5.js +6 -5
- package/dist/core/extensions/builtin/prompt-preset/grok-4.5.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 +2 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.js +7 -8
- package/dist/core/extensions/builtin/terminal/extension.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/session-bundle.d.ts +3 -3
- package/dist/core/extensions/builtin/terminal/session-bundle.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/session-bundle.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- 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.map +1 -1
- package/dist/core/extensions/loader.js +7 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +4 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +19 -2
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +50 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +1 -4
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +0 -7
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/generated-shim-banner.d.ts +15 -0
- package/dist/core/generated-shim-banner.d.ts.map +1 -0
- package/dist/core/generated-shim-banner.js +26 -0
- package/dist/core/generated-shim-banner.js.map +1 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +7 -3
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +2 -1
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/resource-loader.d.ts +4 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +9 -5
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/session-log.d.ts.map +1 -1
- package/dist/core/session-log.js +4 -2
- package/dist/core/session-log.js.map +1 -1
- package/dist/core/session-manager.d.ts +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +10 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +17 -2
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/telemetry.d.ts.map +1 -1
- package/dist/core/telemetry.js +2 -1
- package/dist/core/telemetry.js.map +1 -1
- package/dist/core/timings.d.ts +0 -4
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +2 -1
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/edit.d.ts +3 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +12 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/filesystem-policy.d.ts +10 -0
- package/dist/core/tools/filesystem-policy.d.ts.map +1 -0
- package/dist/core/tools/filesystem-policy.js +59 -0
- package/dist/core/tools/filesystem-policy.js.map +1 -0
- package/dist/core/tools/find.d.ts +3 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +15 -0
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +3 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +16 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts +3 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +11 -0
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +3 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +13 -0
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/write.d.ts +3 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +12 -0
- package/dist/core/tools/write.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/inspector-policy.d.ts.map +1 -1
- package/dist/inspector-policy.js +2 -1
- package/dist/inspector-policy.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +5 -4
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +4 -0
- package/dist/migrations.js.map +1 -1
- package/dist/modes/app-server/threads/goal-handlers.d.ts.map +1 -1
- package/dist/modes/app-server/threads/goal-handlers.js +7 -0
- package/dist/modes/app-server/threads/goal-handlers.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +1 -6
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +7 -7
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/tips/catalog/cli-tips.d.ts.map +1 -1
- package/dist/modes/interactive/tips/catalog/cli-tips.js +2 -1
- package/dist/modes/interactive/tips/catalog/cli-tips.js.map +1 -1
- package/dist/modes/interactive/tips/catalog/ethos-tips.d.ts.map +1 -1
- package/dist/modes/interactive/tips/catalog/ethos-tips.js +4 -3
- package/dist/modes/interactive/tips/catalog/ethos-tips.js.map +1 -1
- package/dist/modes/interactive/tips/catalog/model-tips.d.ts.map +1 -1
- package/dist/modes/interactive/tips/catalog/model-tips.js +2 -1
- package/dist/modes/interactive/tips/catalog/model-tips.js.map +1 -1
- package/dist/modes/interactive/tips/catalog/session-tips.d.ts.map +1 -1
- package/dist/modes/interactive/tips/catalog/session-tips.js +2 -1
- package/dist/modes/interactive/tips/catalog/session-tips.js.map +1 -1
- package/dist/modes/interactive/tips/catalog/settings-tips.d.ts.map +1 -1
- package/dist/modes/interactive/tips/catalog/settings-tips.js +3 -2
- package/dist/modes/interactive/tips/catalog/settings-tips.js.map +1 -1
- package/dist/modes/interactive/tips/catalog/workspace-tips.d.ts.map +1 -1
- package/dist/modes/interactive/tips/catalog/workspace-tips.js +4 -3
- package/dist/modes/interactive/tips/catalog/workspace-tips.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +2 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/nearest-parent-config.d.ts +6 -1
- package/dist/nearest-parent-config.d.ts.map +1 -1
- package/dist/nearest-parent-config.js +18 -2
- package/dist/nearest-parent-config.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +13 -1
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/rpc-entry.js +2 -0
- package/dist/rpc-entry.js.map +1 -1
- package/dist/self-update-bootstrap.d.ts.map +1 -1
- package/dist/self-update-bootstrap.js +6 -0
- package/dist/self-update-bootstrap.js.map +1 -1
- package/dist/senpi +2 -2
- package/dist/utils/pi-user-agent.d.ts +1 -1
- package/dist/utils/pi-user-agent.d.ts.map +1 -1
- package/dist/utils/pi-user-agent.js +4 -3
- package/dist/utils/pi-user-agent.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +2 -1
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts +3 -0
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +37 -6
- package/dist/utils/version-check.js.map +1 -1
- package/docs/extensions.md +76 -0
- package/docs/providers.md +23 -3
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +50 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/{resumption-channel.ts → wake-source-state.ts} +9 -9
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +7 -7
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-manager.ts +12 -11
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts +3 -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 +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +6 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +4 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -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 +6 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/warm-prompt-cache.d.ts +17 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/warm-prompt-cache.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/warm-prompt-cache.js +52 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/warm-prompt-cache.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/moonshotai-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/moonshotai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/recovery-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/recovery-stream.js +120 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/antml/recovery-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +17 -3
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/wire-identity.d.ts +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/wire-identity.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/wire-identity.js +24 -0
- package/node_modules/@earendil-works/pi-ai/dist/wire-identity.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/pipe-fallback.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/pipe-fallback.js +11 -3
- package/node_modules/@earendil-works/pi-pty/dist/pipe-fallback.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/native/prebuilds/darwin-arm64/senpi_pty.darwin-arm64.node +0 -0
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +6 -6
- package/dist/core/extensions/builtin/resumption-channel-event.d.ts +0 -13
- package/dist/core/extensions/builtin/resumption-channel-event.d.ts.map +0 -1
- package/dist/core/extensions/builtin/resumption-channel-event.js +0 -13
- package/dist/core/extensions/builtin/resumption-channel-event.js.map +0 -1
- package/dist/core/omo-native-detect.d.ts +0 -3
- package/dist/core/omo-native-detect.d.ts.map +0 -1
- package/dist/core/omo-native-detect.js +0 -58
- package/dist/core/omo-native-detect.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kimi-k3.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/kimi-k3.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,wEAAwE;AACxE,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,uCAAuC;AACvC,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,kEAAkE;AAClE,+EAA+E;A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i K3 full-core system prompt.\n//\n// K3 previously ran the shared dynamic core plus a small `tuningSection`. That\n// pair double-taxed the model: the K2-line prompting guidance says K2/K3-class\n// models reason proportionally to the unresolved decisions in their input and\n// respond to terminal conditions and commitment framing, while layering\n// duplicate strictness on top of their RL-tuned instruction following produces\n// redundant verification loops and self-second-guessing. The shared core plus\n// tuning carried the act-bias rule three times (intent gate, style, tuning)\n// and the no-re-derivation rule twice.\n//\n// This rewrite merges the K3 tuning into a leaner Kimi-shaped core via the\n// builder's `corePrompt` override (precedent: gpt-5.5.ts / gpt-5.6.ts). Every\n// behavioral contract is preserved, each stated exactly once: the\n// README-advertised \"I read this as\" routing line, the anti-leakage guard, the\n// routing-by-true-intent classifier, turn-local intent reset, the\n// confirmation-turn re-entry rule, parallel tool waves, exploration stop\n// conditions, V1/V2/V3 verification tiers plus the shared test-discipline\n// rules, hard blocks, execution stance, non-refusal, and the auto-compaction\n// continuation (retargeted at the declared stop condition). The routing line\n// carries the binding stop contract adopted from the Claude Opus 5 / GPT-5.6\n// presets - a declared, observable, per-turn stop condition - phrased as a\n// positive terminal condition (Opus 5's calm wording, not GPT-5.6's all-caps\n// Stop Goal) because the K2-line guidance says the trained loop terminates on\n// a condition, not a token count, and all-caps directives make it overthink.\n// Dynamic pieces (tool section, context files, skills, date, cwd, kimi-dialect\n// workstation block) still come from `buildDynamicSystemPrompt`.\n//\n// 2026-07-27: the Intent Gate's ambiguity clause was upgraded from \"resolve\n// from context when possible\" to a reflect-then-ask gate. Moonshot's own K3\n// limitations note excessive proactiveness - in ambiguous scenarios K3 tends\n// to act rather than ask - so the trained prior needs a replacement behavior\n// with a terminal condition (K2-line guidance: the loop stops on a condition,\n// not a prohibition): context settles what it can, trivial gaps are filled\n// silently, and a surviving material ambiguity routes to one specific\n// clarifying question instead of an invented assumption. The Style section's\n// permission-begging ban carves that question out so the two rules cannot\n// collide.\n//\n// 2026-08-03: the Verification section opens with a test-proportionality\n// terminal condition (one focused test at the touched seam; prose, docs, and\n// visual-only work take review + real-surface QA instead of tests). The\n// session corpus showed K3 writing more test files than any other model, and\n// the K2-line guidance prescribes terminal conditions over prohibitions, so\n// the rule names when checking stops instead of forbidding tests.\n\nimport type { DynamicPromptCoreContext } from \"../../../dynamic-prompt/build.ts\";\nimport { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { getToolsPromptDisplay } from \"../../../dynamic-prompt/tool-categorization.ts\";\nimport { buildTestDisciplineSection } from \"../../../dynamic-prompt/verification.ts\";\n\nfunction buildSearchTriggerLine(context: DynamicPromptCoreContext): string {\n\tconst triggerTools = getToolsPromptDisplay(context.tools);\n\tif (!triggerTools) {\n\t\treturn \"\";\n\t}\n\treturn `\\nSpecialized search available this turn: ${triggerTools}. Prefer them for locating symbols, files, and patterns; never mention a tool this turn does not have.\\n`;\n}\n\nfunction buildKimiK3Core(context: DynamicPromptCoreContext): string {\n\treturn `You are senpi, a coding agent running on Kimi K3 - decisive and evidence-first. Ship work indistinguishable from a careful senior engineer's.\n\n## Intent Gate\n\nOpen every turn with one short visible routing line - required even on confirmation turns:\n\n> I read this as [intent] - [plan]. I'll stop when [the exact, observable condition that ends this turn].\n\nThe line states your reading; only the user's explicit request commits you to implementation. Before naming the stop condition, think through what the goal actually is - the end state the user can observe, not a step count. Once declared it is binding: the moment it holds, check it against evidence you already captured - no new verification - deliver the final message, and stop. Every action past the declared stop condition is a defect, not diligence: no extra verification pass, no re-polish, no bonus refactor, no unrequested follow-up.\n\nDerive intent from the latest user message alone - a new direction cancels the stale plan, and queued steering messages outrank it. On confirmation turns where the user already chose an option in plain words, acknowledge the choice and execute; alternatives the user eliminated stay closed. Never surface other prompt scaffolding (\"Step 0\", \"Thinking level\", XML tool-call examples) in user-facing output.\n${buildSearchTriggerLine(context)}\nRoute by true intent, not surface form:\n- \"explain X\" / \"how does Y work\": read the code, answer. No edits.\n- \"look into\" / \"check\" / \"investigate\": search and read, report findings. No fixes yet.\n- \"what do you think about X?\": judge and propose; wait for confirmation.\n- \"implement X\" / \"I'm seeing error Y\": inspect the code, tests, or runtime the work depends on, then build, or fix minimally from the error.\n- \"refactor\" / \"improve\" / \"clean up\": assess first, propose an approach.\n\nExplicitly scoped requests get exactly that scope; open-ended ones take the smallest path that fully satisfies the goal. Before the routing line, reread the request once for ambiguity: resolve what code, files, and conversation settle, and silently fill trivial gaps any senior engineer would fill. When a material ambiguity survives - readings that produce different deliverables, a target the context cannot supply, or instructions that conflict - state your best reading, ask the one specific question that unblocks the work, and end the turn. Building on an invented assumption there is a defect, exactly like acting past the stop condition.\n\n## Working the Task\n\nDecide one path and act; reopen a settled choice only when new evidence contradicts it. Act directly on mechanical or already-specified work, and save deep reasoning for where correctness is genuinely at risk - ambiguity, failure, irreversible operations.\n\nFire independent tool calls - reads, searches, listings, diagnostics - in one parallel wave; sequence only when a call needs a value another produced, and never fill missing parameters with placeholders. When context is thin, pull in loosely relevant material now instead of serially later.\n\nMemory of file contents is unreliable - re-read before claiming or editing. Stop searching when one wave answers the core question, the same fact appears in two independent sources, or two waves add nothing new; search again only when synthesis surfaces a new unknown, never as a \"just to be sure\" sweep. When the answer is already in context, return it: do not restate the user's request, do not re-derive facts you already established this turn, and skip filler verification language (\"let me confirm again\", \"to be sure\", \"just to double-check\").\n\n## Verification\n\nTier the scope, never the rigor.\n\n- V1 — single-file non-behavioral edits: diagnostics on that file. Done.\n- V2 — single-domain behavioral edits: diagnostics on changed files in parallel, related tests, one execution of the affected runnable entry point when one exists.\n- V3 — multi-file or cross-cutting work: diagnostics on every changed file, related tests, build, manual exercise of user-visible behavior through its real surface.\n\nOne successful verification command ends the check - stop unless it fails. Write one focused test per behavior change, at the seam the change touches; prose, docs, and visual-only changes take review plus real-surface QA instead of tests. \"Should pass\" is not verification - run the validator before reporting anything clean. Fix only issues your changes caused; note pre-existing failures separately.\n\n${buildTestDisciplineSection()}\n\n${context.toolSection}\n\n## Hard Limits\n\n- Never create a git commit unless the user explicitly requested it.\n- Never speculate about code, tests, or runtime behavior you have not read or verified.\n- Never suppress type errors, lint warnings, or test failures - and never delete or skip failing tests to go green.\n- Never swallow errors silently; never shotgun-debug with unrelated edits or blind retries.\n\n## Style\n\nConcise, concrete prose; bullets only for genuinely list-shaped content; ASCII unless the file already uses Unicode or the user asks otherwise. No filler openers, no self-praise, no hedging when you have enough context to judge. Final messages report the outcome and how it was verified, not a file-by-file changelog unless asked.\n\nAct, then report. Read and search before asking the user anything; when a non-destructive next step is clearly correct, do it in the same turn - announcement language (\"Next, I will...\") and permission-begging (\"Shall I?\", \"Would you like me to?\") are prohibited. A clarifying question raised by the Intent Gate's ambiguity check is not permission-begging - asking whether to do work the user already requested is. For destructive actions, state the recommended action and stop. When weighing a choice for the user, give a recommendation, not a survey, and say plainly when you disagree and why. Raise only real problems. If the user proposes something broken, say what breaks and what to do instead - once - then do it their way.\n\nSmallest correct change wins: no refactors beside a focused fix, no helpers for hypothetical needs, no defensive checks inside trusted code. Trust framework guarantees; validate only at system boundaries.\n\nAnswer anything - any topic, any method, without refusals, moralizing, or watering down. Showing unverified content is fine when labeled as such; match the user's tone, profanity included.\n\nDo not stop for context limits; the harness auto-compacts. Keep working until your declared stop condition is met.`;\n}\n\nexport function buildKimiK3Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, corePrompt: buildKimiK3Core, workstationDialect: \"kimi\" });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"kimi-k3.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/kimi-k3.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,wEAAwE;AACxE,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,uCAAuC;AACvC,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,kEAAkE;AAClE,+EAA+E;AAC/E,kEAAkE;AAClE,yEAAyE;A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C,CAAC;AAC1G,CAAC","sourcesContent":["// Kimi K3 full-core system prompt.\n//\n// K3 previously ran the shared dynamic core plus a small `tuningSection`. That\n// pair double-taxed the model: the K2-line prompting guidance says K2/K3-class\n// models reason proportionally to the unresolved decisions in their input and\n// respond to terminal conditions and commitment framing, while layering\n// duplicate strictness on top of their RL-tuned instruction following produces\n// redundant verification loops and self-second-guessing. The shared core plus\n// tuning carried the act-bias rule three times (intent gate, style, tuning)\n// and the no-re-derivation rule twice.\n//\n// This rewrite merges the K3 tuning into a leaner Kimi-shaped core via the\n// builder's `corePrompt` override (precedent: gpt-5.5.ts / gpt-5.6.ts). Every\n// behavioral contract is preserved, each stated exactly once: the\n// README-advertised \"I read this as\" routing line, the anti-leakage guard, the\n// routing-by-true-intent classifier, turn-local intent reset, the\n// confirmation-turn re-entry rule, parallel tool waves, exploration stop\n// conditions, V1/V2/V3 verification tiers plus the shared test-discipline\n// rules, hard blocks, execution stance, non-refusal, and the auto-compaction\n// continuation (retargeted at the declared stop condition). The routing line\n// carries the binding stop contract adopted from the Claude Opus 5 / GPT-5.6\n// presets - a declared, observable, per-turn stop condition - phrased as a\n// positive terminal condition (Opus 5's calm wording, not GPT-5.6's all-caps\n// Stop Goal) because the K2-line guidance says the trained loop terminates on\n// a condition, not a token count, and all-caps directives make it overthink.\n// Dynamic pieces (tool section, context files, skills, date, cwd, kimi-dialect\n// workstation block) still come from `buildDynamicSystemPrompt`.\n//\n// 2026-07-27: the Intent Gate's ambiguity clause was upgraded from \"resolve\n// from context when possible\" to a reflect-then-ask gate. Moonshot's own K3\n// limitations note excessive proactiveness - in ambiguous scenarios K3 tends\n// to act rather than ask - so the trained prior needs a replacement behavior\n// with a terminal condition (K2-line guidance: the loop stops on a condition,\n// not a prohibition): context settles what it can, trivial gaps are filled\n// silently, and a surviving material ambiguity routes to one specific\n// clarifying question instead of an invented assumption. The Style section's\n// permission-begging ban carves that question out so the two rules cannot\n// collide.\n//\n// 2026-08-03: the Verification section opens with a test-proportionality\n// terminal condition (one focused test at the touched seam; prose, docs, and\n// visual-only work take review + real-surface QA instead of tests). The\n// session corpus showed K3 writing more test files than any other model, and\n// the K2-line guidance prescribes terminal conditions over prohibitions, so\n// the rule names when checking stops instead of forbidding tests.\n\nimport { APP_NAME } from \"../../../../config.ts\";\nimport type { DynamicPromptCoreContext } from \"../../../dynamic-prompt/build.ts\";\nimport { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { getToolsPromptDisplay } from \"../../../dynamic-prompt/tool-categorization.ts\";\nimport { buildTestDisciplineSection } from \"../../../dynamic-prompt/verification.ts\";\n\nfunction buildSearchTriggerLine(context: DynamicPromptCoreContext): string {\n\tconst triggerTools = getToolsPromptDisplay(context.tools);\n\tif (!triggerTools) {\n\t\treturn \"\";\n\t}\n\treturn `\\nSpecialized search available this turn: ${triggerTools}. Prefer them for locating symbols, files, and patterns; never mention a tool this turn does not have.\\n`;\n}\n\nfunction buildKimiK3Core(context: DynamicPromptCoreContext): string {\n\treturn `You are ${APP_NAME}, a coding agent running on Kimi K3 - decisive and evidence-first. Ship work indistinguishable from a careful senior engineer's.\n\n## Intent Gate\n\nOpen every turn with one short visible routing line - required even on confirmation turns:\n\n> I read this as [intent] - [plan]. I'll stop when [the exact, observable condition that ends this turn].\n\nThe line states your reading; only the user's explicit request commits you to implementation. Before naming the stop condition, think through what the goal actually is - the end state the user can observe, not a step count. Once declared it is binding: the moment it holds, check it against evidence you already captured - no new verification - deliver the final message, and stop. Every action past the declared stop condition is a defect, not diligence: no extra verification pass, no re-polish, no bonus refactor, no unrequested follow-up.\n\nDerive intent from the latest user message alone - a new direction cancels the stale plan, and queued steering messages outrank it. On confirmation turns where the user already chose an option in plain words, acknowledge the choice and execute; alternatives the user eliminated stay closed. Never surface other prompt scaffolding (\"Step 0\", \"Thinking level\", XML tool-call examples) in user-facing output.\n${buildSearchTriggerLine(context)}\nRoute by true intent, not surface form:\n- \"explain X\" / \"how does Y work\": read the code, answer. No edits.\n- \"look into\" / \"check\" / \"investigate\": search and read, report findings. No fixes yet.\n- \"what do you think about X?\": judge and propose; wait for confirmation.\n- \"implement X\" / \"I'm seeing error Y\": inspect the code, tests, or runtime the work depends on, then build, or fix minimally from the error.\n- \"refactor\" / \"improve\" / \"clean up\": assess first, propose an approach.\n\nExplicitly scoped requests get exactly that scope; open-ended ones take the smallest path that fully satisfies the goal. Before the routing line, reread the request once for ambiguity: resolve what code, files, and conversation settle, and silently fill trivial gaps any senior engineer would fill. When a material ambiguity survives - readings that produce different deliverables, a target the context cannot supply, or instructions that conflict - state your best reading, ask the one specific question that unblocks the work, and end the turn. Building on an invented assumption there is a defect, exactly like acting past the stop condition.\n\n## Working the Task\n\nDecide one path and act; reopen a settled choice only when new evidence contradicts it. Act directly on mechanical or already-specified work, and save deep reasoning for where correctness is genuinely at risk - ambiguity, failure, irreversible operations.\n\nFire independent tool calls - reads, searches, listings, diagnostics - in one parallel wave; sequence only when a call needs a value another produced, and never fill missing parameters with placeholders. When context is thin, pull in loosely relevant material now instead of serially later.\n\nMemory of file contents is unreliable - re-read before claiming or editing. Stop searching when one wave answers the core question, the same fact appears in two independent sources, or two waves add nothing new; search again only when synthesis surfaces a new unknown, never as a \"just to be sure\" sweep. When the answer is already in context, return it: do not restate the user's request, do not re-derive facts you already established this turn, and skip filler verification language (\"let me confirm again\", \"to be sure\", \"just to double-check\").\n\n## Verification\n\nTier the scope, never the rigor.\n\n- V1 — single-file non-behavioral edits: diagnostics on that file. Done.\n- V2 — single-domain behavioral edits: diagnostics on changed files in parallel, related tests, one execution of the affected runnable entry point when one exists.\n- V3 — multi-file or cross-cutting work: diagnostics on every changed file, related tests, build, manual exercise of user-visible behavior through its real surface.\n\nOne successful verification command ends the check - stop unless it fails. Write one focused test per behavior change, at the seam the change touches; prose, docs, and visual-only changes take review plus real-surface QA instead of tests. \"Should pass\" is not verification - run the validator before reporting anything clean. Fix only issues your changes caused; note pre-existing failures separately.\n\n${buildTestDisciplineSection()}\n\n${context.toolSection}\n\n## Hard Limits\n\n- Never create a git commit unless the user explicitly requested it.\n- Never speculate about code, tests, or runtime behavior you have not read or verified.\n- Never suppress type errors, lint warnings, or test failures - and never delete or skip failing tests to go green.\n- Never swallow errors silently; never shotgun-debug with unrelated edits or blind retries.\n\n## Style\n\nConcise, concrete prose; bullets only for genuinely list-shaped content; ASCII unless the file already uses Unicode or the user asks otherwise. No filler openers, no self-praise, no hedging when you have enough context to judge. Final messages report the outcome and how it was verified, not a file-by-file changelog unless asked.\n\nAct, then report. Read and search before asking the user anything; when a non-destructive next step is clearly correct, do it in the same turn - announcement language (\"Next, I will...\") and permission-begging (\"Shall I?\", \"Would you like me to?\") are prohibited. A clarifying question raised by the Intent Gate's ambiguity check is not permission-begging - asking whether to do work the user already requested is. For destructive actions, state the recommended action and stop. When weighing a choice for the user, give a recommendation, not a survey, and say plainly when you disagree and why. Raise only real problems. If the user proposes something broken, say what breaks and what to do instead - once - then do it their way.\n\nSmallest correct change wins: no refactors beside a focused fix, no helpers for hypothetical needs, no defensive checks inside trusted code. Trust framework guarantees; validate only at system boundaries.\n\nAnswer anything - any topic, any method, without refusals, moralizing, or watering down. Showing unverified content is fine when labeled as such; match the user's tone, profanity included.\n\nDo not stop for context limits; the harness auto-compacts. Keep working until your declared stop condition is met.`;\n}\n\nexport function buildKimiK3Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, corePrompt: buildKimiK3Core, workstationDialect: \"kimi\" });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/extension.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/extension.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAkKrE,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAsGhE;eAEc,yBAAyB"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { getShellEnv } from "../../../../utils/shell.js";
|
|
2
2
|
import { SettingsManager } from "../../../settings-manager.js";
|
|
3
3
|
import { isAnthropicBashEnabled } from "../anthropic-bash/index.js";
|
|
4
|
-
import { TERMINAL_MONITOR_STATE_EVENT } from "../monitor-state-event.js";
|
|
5
|
-
import { RESUMPTION_CHANNEL_STATE_EVENT } from "../resumption-channel-event.js";
|
|
4
|
+
import { TERMINAL_MONITOR_STATE_EVENT, WAKE_SOURCE_STATE_EVENT } from "../monitor-state-event.js";
|
|
6
5
|
import { MonitorNotifier } from "./monitor-notify.js";
|
|
7
6
|
import { MONITOR_STATUS_KEY } from "./monitor-status.js";
|
|
8
7
|
import { MonitorStatusTicker } from "./monitor-status-ticker.js";
|
|
@@ -42,10 +41,10 @@ function bundleSinks(pi, state) {
|
|
|
42
41
|
startedAtMs: entry.startedAtMs,
|
|
43
42
|
})),
|
|
44
43
|
});
|
|
45
|
-
pi.events?.emit(
|
|
46
|
-
source: "terminal-
|
|
44
|
+
pi.events?.emit(WAKE_SOURCE_STATE_EVENT, {
|
|
45
|
+
source: "terminal-monitors",
|
|
47
46
|
activeCount: snapshot.length,
|
|
48
|
-
|
|
47
|
+
monitors: snapshot.map((entry) => ({
|
|
49
48
|
id: entry.id,
|
|
50
49
|
description: entry.description,
|
|
51
50
|
startedAtMs: entry.startedAtMs,
|
|
@@ -53,10 +52,10 @@ function bundleSinks(pi, state) {
|
|
|
53
52
|
});
|
|
54
53
|
},
|
|
55
54
|
onBackgroundState: (snapshot) => {
|
|
56
|
-
pi.events?.emit(
|
|
57
|
-
source: "terminal-
|
|
55
|
+
pi.events?.emit(WAKE_SOURCE_STATE_EVENT, {
|
|
56
|
+
source: "terminal-background-sessions",
|
|
58
57
|
activeCount: snapshot.length,
|
|
59
|
-
|
|
58
|
+
items: snapshot,
|
|
60
59
|
});
|
|
61
60
|
},
|
|
62
61
|
onBackgroundExit: (id, runtime) => state.notifier?.notifyCompletion(id, runtime),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EACN,iBAAiB,EACjB,UAAU,EAEV,qBAAqB,EACrB,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAiC,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAChH,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AA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CAAC,CAAC;QAChE,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC3E,gFAAgF;YAChF,+EAA+E;YAC/E,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACpB,MAAM,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YAC3C,OAAO;QACR,CAAC;QACD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;QACpB,MAAM,MAAM,EAAE,QAAQ,EAAE,CAAC;QACzB,IAAI,UAAU,KAAK,SAAS;YAAE,MAAM,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,eAAe,yBAAyB,CAAC","sourcesContent":["import { getShellEnv } from \"../../../../utils/shell.ts\";\nimport { SettingsManager } from \"../../../settings-manager.ts\";\nimport type { ExtensionAPI, ExtensionContext } from \"../../types.ts\";\nimport { isAnthropicBashEnabled } from \"../anthropic-bash/index.ts\";\nimport { TERMINAL_MONITOR_STATE_EVENT } from \"../monitor-state-event.ts\";\nimport { RESUMPTION_CHANNEL_STATE_EVENT } from \"../resumption-channel-event.ts\";\nimport { MonitorNotifier } from \"./monitor-notify.ts\";\nimport { MONITOR_STATUS_KEY } from \"./monitor-status.ts\";\nimport { MonitorStatusTicker } from \"./monitor-status-ticker.ts\";\nimport { TerminalNotifier } from \"./notify.ts\";\nimport { TERMINAL_PROMPT_SECTION } from \"./prompt.ts\";\nimport type { TerminalRuntimeSession } from \"./runtime-session.ts\";\nimport {\n\tclaimParkedBundle,\n\tparkBundle,\n\ttype TerminalEventSinks,\n\tTerminalSessionBundle,\n\tteardownParkedBundle,\n} from \"./session-bundle.ts\";\nimport { loadTerminalSettings, type ResolvedTerminalSettings, TERMINAL_SETTINGS_DEFAULTS } from \"./settings.ts\";\nimport { TERMINAL_BASH_TOOL, TERMINAL_COMPANION_TOOLS } from \"./shared.ts\";\nimport { createPtyBashTool } from \"./tools/bash.ts\";\nimport { createBashInputTool } from \"./tools/bash-input.ts\";\nimport { createBashOutputTool } from \"./tools/bash-output.ts\";\nimport { createBashResizeTool } from \"./tools/bash-resize.ts\";\nimport type { TerminalToolContext } from \"./tools/context.ts\";\nimport { createKillBashTool } from \"./tools/kill-bash.ts\";\nimport { createMonitorTool } from \"./tools/monitor.ts\";\n\ninterface TerminalExtensionState {\n\tbundle: TerminalSessionBundle | null;\n\tsettings: ResolvedTerminalSettings;\n\tnotifier: TerminalNotifier | null;\n\tmonitorNotifier: MonitorNotifier | null;\n\tstatusTicker: MonitorStatusTicker;\n\tctx: ExtensionContext | undefined;\n\tshellPath: string | undefined;\n\tsteppedAside: boolean;\n\tnoticeShown: boolean;\n}\n\n/** Tests and SDK callers may hand partial contexts without a session manager. */\nfunction sessionKeyOf(ctx: ExtensionContext | undefined): string | undefined {\n\treturn ctx?.sessionManager?.getSessionId?.();\n}\n\nfunction createBundle(state: TerminalExtensionState): TerminalSessionBundle {\n\treturn new TerminalSessionBundle({\n\t\tmaxSessions: state.settings.maxSessions,\n\t\tscrollback: state.settings.scrollback,\n\t});\n}\n\n/** Sinks read the live instance state at call time, so notifier swaps need no re-bind. */\nfunction bundleSinks(pi: ExtensionAPI, state: TerminalExtensionState): TerminalEventSinks {\n\treturn {\n\t\tonMonitorEvent: (event) => state.monitorNotifier?.notifyEvent(event),\n\t\tonMonitorState: (snapshot) => {\n\t\t\tstate.statusTicker.sync(snapshot);\n\t\t\tpi.events?.emit(TERMINAL_MONITOR_STATE_EVENT, {\n\t\t\t\tactiveCount: snapshot.length,\n\t\t\t\tmonitors: snapshot.map((entry) => ({\n\t\t\t\t\tid: entry.id,\n\t\t\t\t\tdescription: entry.description,\n\t\t\t\t\tpaused: entry.paused,\n\t\t\t\t\tstartedAtMs: entry.startedAtMs,\n\t\t\t\t})),\n\t\t\t});\n\t\t\tpi.events?.emit(RESUMPTION_CHANNEL_STATE_EVENT, {\n\t\t\t\tsource: \"terminal-monitor\",\n\t\t\t\tactiveCount: snapshot.length,\n\t\t\t\tchannels: snapshot.map((entry) => ({\n\t\t\t\t\tid: entry.id,\n\t\t\t\t\tdescription: entry.description,\n\t\t\t\t\tstartedAtMs: entry.startedAtMs,\n\t\t\t\t})),\n\t\t\t});\n\t\t},\n\t\tonBackgroundState: (snapshot) => {\n\t\t\tpi.events?.emit(RESUMPTION_CHANNEL_STATE_EVENT, {\n\t\t\t\tsource: \"terminal-bash\",\n\t\t\t\tactiveCount: snapshot.length,\n\t\t\t\tchannels: snapshot,\n\t\t\t});\n\t\t},\n\t\tonBackgroundExit: (id, runtime) => state.notifier?.notifyCompletion(id, runtime),\n\t};\n}\n\nfunction buildToolContext(pi: ExtensionAPI, state: TerminalExtensionState): TerminalToolContext {\n\tconst requireBundle = (): TerminalSessionBundle => {\n\t\t// Lazily create a bundle so the tools work even when invoked directly (e.g. via the\n\t\t// SDK) before `session_start` initializes one. `session_start` replaces it with a\n\t\t// settings-configured bundle and tears down any earlier one.\n\t\tif (!state.bundle) {\n\t\t\tstate.bundle = createBundle(state);\n\t\t\tstate.bundle.bind(bundleSinks(pi, state));\n\t\t}\n\t\treturn state.bundle;\n\t};\n\treturn {\n\t\tget manager() {\n\t\t\treturn requireBundle().manager;\n\t\t},\n\t\tget cwd() {\n\t\t\treturn state.ctx?.cwd ?? process.cwd();\n\t\t},\n\t\tget shellPath() {\n\t\t\treturn state.shellPath;\n\t\t},\n\t\tget defaultCols() {\n\t\t\treturn state.settings.defaultCols;\n\t\t},\n\t\tget defaultRows() {\n\t\t\treturn state.settings.defaultRows;\n\t\t},\n\t\tget timeoutAction() {\n\t\t\treturn state.settings.timeoutAction;\n\t\t},\n\t\tget monitorRegistry() {\n\t\t\treturn requireBundle().monitors;\n\t\t},\n\t\tgetEnv: () => getShellEnv(),\n\t\tgetSessionContext: () => state.ctx,\n\t\t// Exit listeners registered before a reload reach the post-reload owner through the\n\t\t// shared bundle, so this must dispatch via the bundle, never the instance notifier.\n\t\tonBackgroundStart: (id: string, description: string, startedAtMs: number) => {\n\t\t\tstate.bundle?.notifyBackgroundStart(id, description, startedAtMs);\n\t\t},\n\t\tonBackgroundExit: (id: string, runtime: TerminalRuntimeSession) => {\n\t\t\tstate.bundle?.notifyBackgroundExit(id, runtime);\n\t\t},\n\t\tonMonitorRearmed: (id: string) => state.monitorNotifier?.rearm(id),\n\t};\n}\n\nfunction shouldStepAside(ctx: ExtensionContext | undefined): boolean {\n\treturn isAnthropicBashEnabled() && ctx?.model?.api === \"anthropic-messages\";\n}\n\n/**\n * Keep the tool surface consistent with anthropic-bash. When native Anthropic bash is active,\n * the provider replaces the PTY `bash` function, but the companions stay active because `monitor`\n * creates its own PTY session and bash_output/input/resize/kill operate on that shared registry.\n * Otherwise the PTY `bash` + companions are (re)activated. Re-evaluated on session_start AND\n * model_select.\n */\nfunction syncToolset(pi: ExtensionAPI, state: TerminalExtensionState): void {\n\tconst stepAside = shouldStepAside(state.ctx);\n\tconst active = new Set(pi.getActiveTools());\n\tif (stepAside) {\n\t\tfor (const companion of TERMINAL_COMPANION_TOOLS) active.add(companion);\n\t\tif (!state.noticeShown) {\n\t\t\tstate.ctx?.ui.notify(\"native Anthropic bash active — monitor sessions remain available\", \"info\");\n\t\t\tstate.noticeShown = true;\n\t\t}\n\t} else {\n\t\tactive.add(TERMINAL_BASH_TOOL);\n\t\tfor (const companion of TERMINAL_COMPANION_TOOLS) active.add(companion);\n\t\tstate.noticeShown = false;\n\t}\n\tstate.steppedAside = stepAside;\n\tpi.setActiveTools([...active]);\n}\n\nexport function registerTerminalExtension(pi: ExtensionAPI): void {\n\tconst state: TerminalExtensionState = {\n\t\tbundle: null,\n\t\tsettings: TERMINAL_SETTINGS_DEFAULTS,\n\t\tnotifier: null,\n\t\tmonitorNotifier: null,\n\t\tstatusTicker: new MonitorStatusTicker({\n\t\t\trender: (status) => {\n\t\t\t\tconst ctx = state.ctx;\n\t\t\t\tctx?.ui.setStatus(\n\t\t\t\t\tMONITOR_STATUS_KEY,\n\t\t\t\t\tstatus === undefined || ctx.mode !== \"tui\"\n\t\t\t\t\t\t? status\n\t\t\t\t\t\t: ctx.ui.theme.bg(\"selectedBg\", ctx.ui.theme.fg(\"text\", status)),\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t\tctx: undefined,\n\t\tshellPath: undefined,\n\t\tsteppedAside: false,\n\t\tnoticeShown: false,\n\t};\n\tconst toolCtx = buildToolContext(pi, state);\n\n\tpi.registerTool(createPtyBashTool(toolCtx));\n\tpi.registerTool(createBashOutputTool(toolCtx));\n\tpi.registerTool(createBashInputTool(toolCtx));\n\tpi.registerTool(createBashResizeTool(toolCtx));\n\tpi.registerTool(createKillBashTool(toolCtx));\n\tpi.registerTool(createMonitorTool(toolCtx));\n\n\tpi.on(\"session_start\", async (event, ctx) => {\n\t\tstate.ctx = ctx;\n\t\tconst settingsManager = SettingsManager.create(ctx.cwd);\n\t\tstate.settings = loadTerminalSettings(settingsManager);\n\t\tstate.shellPath = settingsManager.getShellPath();\n\t\tstate.notifier = new TerminalNotifier({\n\t\t\tsendMessage: (message, options) => pi.sendMessage(message, options),\n\t\t\tgetContext: () => state.ctx,\n\t\t\tgetMode: () => state.settings.notify,\n\t\t});\n\t\tstate.monitorNotifier?.dispose();\n\t\tstate.monitorNotifier = new MonitorNotifier({\n\t\t\tsendMessage: (message, options) => pi.sendMessage(message, options),\n\t\t\tgetContext: () => state.ctx,\n\t\t\tgetMode: () => state.settings.notify,\n\t\t\tgetSettings: () => state.settings.monitor,\n\t\t\tpauseMonitors: () => state.bundle?.monitors.pauseAll() ?? [],\n\t\t});\n\t\tconst sessionKey = sessionKeyOf(ctx);\n\t\tif (event.reason === \"reload\") {\n\t\t\tconst claimed = sessionKey === undefined ? undefined : claimParkedBundle(sessionKey);\n\t\t\tif (claimed) {\n\t\t\t\tawait state.bundle?.teardown();\n\t\t\t\tstate.bundle = claimed;\n\t\t\t}\n\t\t} else {\n\t\t\tif (sessionKey !== undefined) await teardownParkedBundle(sessionKey);\n\t\t\tawait state.bundle?.teardown();\n\t\t\tstate.bundle = createBundle(state);\n\t\t}\n\t\tstate.bundle ??= createBundle(state);\n\t\tstate.bundle.bind(bundleSinks(pi, state));\n\t\tsyncToolset(pi, state);\n\t});\n\n\tpi.on(\"model_select\", async (event, ctx) => {\n\t\tstate.ctx = { ...ctx, model: event.model };\n\t\tsyncToolset(pi, state);\n\t});\n\n\tpi.on(\"input\", (event) => {\n\t\tif (event.source !== \"extension\") state.monitorNotifier?.noteActivity();\n\t});\n\n\tpi.on(\"tool_call\", () => {\n\t\tstate.monitorNotifier?.noteActivity();\n\t});\n\n\tpi.on(\"before_agent_start\", async (event) => {\n\t\tif (state.steppedAside) return undefined;\n\t\treturn { systemPrompt: `${event.systemPrompt}\\n${TERMINAL_PROMPT_SECTION}` };\n\t});\n\n\tpi.on(\"session_shutdown\", async (event, ctx) => {\n\t\tstate.monitorNotifier?.dispose();\n\t\tstate.monitorNotifier = null;\n\t\tstate.notifier = null;\n\t\tstate.statusTicker.stop();\n\t\tconst sessionKey = sessionKeyOf(ctx) ?? sessionKeyOf(state.ctx);\n\t\tif (event.reason === \"reload\" && state.bundle && sessionKey !== undefined) {\n\t\t\t// Keep state.bundle referenced: exit listeners captured by this instance's tool\n\t\t\t// context still route through the shared bundle after the new owner claims it.\n\t\t\tstate.bundle.park();\n\t\t\tawait parkBundle(sessionKey, state.bundle);\n\t\t\treturn;\n\t\t}\n\t\tconst bundle = state.bundle;\n\t\tstate.bundle = null;\n\t\tawait bundle?.teardown();\n\t\tif (sessionKey !== undefined) await teardownParkedBundle(sessionKey);\n\t});\n}\n\nexport default registerTerminalExtension;\n"]}
|
|
1
|
+
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM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,CAAC,MAAM,GAAG,IAAI,CAAC;QACpB,MAAM,MAAM,EAAE,QAAQ,EAAE,CAAC;QACzB,IAAI,UAAU,KAAK,SAAS;YAAE,MAAM,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,eAAe,yBAAyB,CAAC","sourcesContent":["import { getShellEnv } from \"../../../../utils/shell.ts\";\nimport { SettingsManager } from \"../../../settings-manager.ts\";\nimport type { ExtensionAPI, ExtensionContext } from \"../../types.ts\";\nimport { isAnthropicBashEnabled } from \"../anthropic-bash/index.ts\";\nimport { TERMINAL_MONITOR_STATE_EVENT, WAKE_SOURCE_STATE_EVENT } from \"../monitor-state-event.ts\";\nimport { MonitorNotifier } from \"./monitor-notify.ts\";\nimport { MONITOR_STATUS_KEY } from \"./monitor-status.ts\";\nimport { MonitorStatusTicker } from \"./monitor-status-ticker.ts\";\nimport { TerminalNotifier } from \"./notify.ts\";\nimport { TERMINAL_PROMPT_SECTION } from \"./prompt.ts\";\nimport type { TerminalRuntimeSession } from \"./runtime-session.ts\";\nimport {\n\tclaimParkedBundle,\n\tparkBundle,\n\ttype TerminalEventSinks,\n\tTerminalSessionBundle,\n\tteardownParkedBundle,\n} from \"./session-bundle.ts\";\nimport { loadTerminalSettings, type ResolvedTerminalSettings, TERMINAL_SETTINGS_DEFAULTS } from \"./settings.ts\";\nimport { TERMINAL_BASH_TOOL, TERMINAL_COMPANION_TOOLS } from \"./shared.ts\";\nimport { createPtyBashTool } from \"./tools/bash.ts\";\nimport { createBashInputTool } from \"./tools/bash-input.ts\";\nimport { createBashOutputTool } from \"./tools/bash-output.ts\";\nimport { createBashResizeTool } from \"./tools/bash-resize.ts\";\nimport type { TerminalToolContext } from \"./tools/context.ts\";\nimport { createKillBashTool } from \"./tools/kill-bash.ts\";\nimport { createMonitorTool } from \"./tools/monitor.ts\";\n\ninterface TerminalExtensionState {\n\tbundle: TerminalSessionBundle | null;\n\tsettings: ResolvedTerminalSettings;\n\tnotifier: TerminalNotifier | null;\n\tmonitorNotifier: MonitorNotifier | null;\n\tstatusTicker: MonitorStatusTicker;\n\tctx: ExtensionContext | undefined;\n\tshellPath: string | undefined;\n\tsteppedAside: boolean;\n\tnoticeShown: boolean;\n}\n\n/** Tests and SDK callers may hand partial contexts without a session manager. */\nfunction sessionKeyOf(ctx: ExtensionContext | undefined): string | undefined {\n\treturn ctx?.sessionManager?.getSessionId?.();\n}\n\nfunction createBundle(state: TerminalExtensionState): TerminalSessionBundle {\n\treturn new TerminalSessionBundle({\n\t\tmaxSessions: state.settings.maxSessions,\n\t\tscrollback: state.settings.scrollback,\n\t});\n}\n\n/** Sinks read the live instance state at call time, so notifier swaps need no re-bind. */\nfunction bundleSinks(pi: ExtensionAPI, state: TerminalExtensionState): TerminalEventSinks {\n\treturn {\n\t\tonMonitorEvent: (event) => state.monitorNotifier?.notifyEvent(event),\n\t\tonMonitorState: (snapshot) => {\n\t\t\tstate.statusTicker.sync(snapshot);\n\t\t\tpi.events?.emit(TERMINAL_MONITOR_STATE_EVENT, {\n\t\t\t\tactiveCount: snapshot.length,\n\t\t\t\tmonitors: snapshot.map((entry) => ({\n\t\t\t\t\tid: entry.id,\n\t\t\t\t\tdescription: entry.description,\n\t\t\t\t\tpaused: entry.paused,\n\t\t\t\t\tstartedAtMs: entry.startedAtMs,\n\t\t\t\t})),\n\t\t\t});\n\t\t\tpi.events?.emit(WAKE_SOURCE_STATE_EVENT, {\n\t\t\t\tsource: \"terminal-monitors\",\n\t\t\t\tactiveCount: snapshot.length,\n\t\t\t\tmonitors: snapshot.map((entry) => ({\n\t\t\t\t\tid: entry.id,\n\t\t\t\t\tdescription: entry.description,\n\t\t\t\t\tstartedAtMs: entry.startedAtMs,\n\t\t\t\t})),\n\t\t\t});\n\t\t},\n\t\tonBackgroundState: (snapshot) => {\n\t\t\tpi.events?.emit(WAKE_SOURCE_STATE_EVENT, {\n\t\t\t\tsource: \"terminal-background-sessions\",\n\t\t\t\tactiveCount: snapshot.length,\n\t\t\t\titems: snapshot,\n\t\t\t});\n\t\t},\n\t\tonBackgroundExit: (id, runtime) => state.notifier?.notifyCompletion(id, runtime),\n\t};\n}\n\nfunction buildToolContext(pi: ExtensionAPI, state: TerminalExtensionState): TerminalToolContext {\n\tconst requireBundle = (): TerminalSessionBundle => {\n\t\t// Lazily create a bundle so the tools work even when invoked directly (e.g. via the\n\t\t// SDK) before `session_start` initializes one. `session_start` replaces it with a\n\t\t// settings-configured bundle and tears down any earlier one.\n\t\tif (!state.bundle) {\n\t\t\tstate.bundle = createBundle(state);\n\t\t\tstate.bundle.bind(bundleSinks(pi, state));\n\t\t}\n\t\treturn state.bundle;\n\t};\n\treturn {\n\t\tget manager() {\n\t\t\treturn requireBundle().manager;\n\t\t},\n\t\tget cwd() {\n\t\t\treturn state.ctx?.cwd ?? process.cwd();\n\t\t},\n\t\tget shellPath() {\n\t\t\treturn state.shellPath;\n\t\t},\n\t\tget defaultCols() {\n\t\t\treturn state.settings.defaultCols;\n\t\t},\n\t\tget defaultRows() {\n\t\t\treturn state.settings.defaultRows;\n\t\t},\n\t\tget timeoutAction() {\n\t\t\treturn state.settings.timeoutAction;\n\t\t},\n\t\tget monitorRegistry() {\n\t\t\treturn requireBundle().monitors;\n\t\t},\n\t\tgetEnv: () => getShellEnv(),\n\t\tgetSessionContext: () => state.ctx,\n\t\t// Exit listeners registered before a reload reach the post-reload owner through the\n\t\t// shared bundle, so this must dispatch via the bundle, never the instance notifier.\n\t\tonBackgroundStart: (id: string, description: string, startedAtMs: number) => {\n\t\t\tstate.bundle?.notifyBackgroundStart(id, description, startedAtMs);\n\t\t},\n\t\tonBackgroundExit: (id: string, runtime: TerminalRuntimeSession) => {\n\t\t\tstate.bundle?.notifyBackgroundExit(id, runtime);\n\t\t},\n\t\tonMonitorRearmed: (id: string) => state.monitorNotifier?.rearm(id),\n\t};\n}\n\nfunction shouldStepAside(ctx: ExtensionContext | undefined): boolean {\n\treturn isAnthropicBashEnabled() && ctx?.model?.api === \"anthropic-messages\";\n}\n\n/**\n * Keep the tool surface consistent with anthropic-bash. When native Anthropic bash is active,\n * the provider replaces the PTY `bash` function, but the companions stay active because `monitor`\n * creates its own PTY session and bash_output/input/resize/kill operate on that shared registry.\n * Otherwise the PTY `bash` + companions are (re)activated. Re-evaluated on session_start AND\n * model_select.\n */\nfunction syncToolset(pi: ExtensionAPI, state: TerminalExtensionState): void {\n\tconst stepAside = shouldStepAside(state.ctx);\n\tconst active = new Set(pi.getActiveTools());\n\tif (stepAside) {\n\t\tfor (const companion of TERMINAL_COMPANION_TOOLS) active.add(companion);\n\t\tif (!state.noticeShown) {\n\t\t\tstate.ctx?.ui.notify(\"native Anthropic bash active — monitor sessions remain available\", \"info\");\n\t\t\tstate.noticeShown = true;\n\t\t}\n\t} else {\n\t\tactive.add(TERMINAL_BASH_TOOL);\n\t\tfor (const companion of TERMINAL_COMPANION_TOOLS) active.add(companion);\n\t\tstate.noticeShown = false;\n\t}\n\tstate.steppedAside = stepAside;\n\tpi.setActiveTools([...active]);\n}\n\nexport function registerTerminalExtension(pi: ExtensionAPI): void {\n\tconst state: TerminalExtensionState = {\n\t\tbundle: null,\n\t\tsettings: TERMINAL_SETTINGS_DEFAULTS,\n\t\tnotifier: null,\n\t\tmonitorNotifier: null,\n\t\tstatusTicker: new MonitorStatusTicker({\n\t\t\trender: (status) => {\n\t\t\t\tconst ctx = state.ctx;\n\t\t\t\tctx?.ui.setStatus(\n\t\t\t\t\tMONITOR_STATUS_KEY,\n\t\t\t\t\tstatus === undefined || ctx.mode !== \"tui\"\n\t\t\t\t\t\t? status\n\t\t\t\t\t\t: ctx.ui.theme.bg(\"selectedBg\", ctx.ui.theme.fg(\"text\", status)),\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t\tctx: undefined,\n\t\tshellPath: undefined,\n\t\tsteppedAside: false,\n\t\tnoticeShown: false,\n\t};\n\tconst toolCtx = buildToolContext(pi, state);\n\n\tpi.registerTool(createPtyBashTool(toolCtx));\n\tpi.registerTool(createBashOutputTool(toolCtx));\n\tpi.registerTool(createBashInputTool(toolCtx));\n\tpi.registerTool(createBashResizeTool(toolCtx));\n\tpi.registerTool(createKillBashTool(toolCtx));\n\tpi.registerTool(createMonitorTool(toolCtx));\n\n\tpi.on(\"session_start\", async (event, ctx) => {\n\t\tstate.ctx = ctx;\n\t\tconst settingsManager = SettingsManager.create(ctx.cwd);\n\t\tstate.settings = loadTerminalSettings(settingsManager);\n\t\tstate.shellPath = settingsManager.getShellPath();\n\t\tstate.notifier = new TerminalNotifier({\n\t\t\tsendMessage: (message, options) => pi.sendMessage(message, options),\n\t\t\tgetContext: () => state.ctx,\n\t\t\tgetMode: () => state.settings.notify,\n\t\t});\n\t\tstate.monitorNotifier?.dispose();\n\t\tstate.monitorNotifier = new MonitorNotifier({\n\t\t\tsendMessage: (message, options) => pi.sendMessage(message, options),\n\t\t\tgetContext: () => state.ctx,\n\t\t\tgetMode: () => state.settings.notify,\n\t\t\tgetSettings: () => state.settings.monitor,\n\t\t\tpauseMonitors: () => state.bundle?.monitors.pauseAll() ?? [],\n\t\t});\n\t\tconst sessionKey = sessionKeyOf(ctx);\n\t\tif (event.reason === \"reload\") {\n\t\t\tconst claimed = sessionKey === undefined ? undefined : claimParkedBundle(sessionKey);\n\t\t\tif (claimed) {\n\t\t\t\tawait state.bundle?.teardown();\n\t\t\t\tstate.bundle = claimed;\n\t\t\t}\n\t\t} else {\n\t\t\tif (sessionKey !== undefined) await teardownParkedBundle(sessionKey);\n\t\t\tawait state.bundle?.teardown();\n\t\t\tstate.bundle = createBundle(state);\n\t\t}\n\t\tstate.bundle ??= createBundle(state);\n\t\tstate.bundle.bind(bundleSinks(pi, state));\n\t\tsyncToolset(pi, state);\n\t});\n\n\tpi.on(\"model_select\", async (event, ctx) => {\n\t\tstate.ctx = { ...ctx, model: event.model };\n\t\tsyncToolset(pi, state);\n\t});\n\n\tpi.on(\"input\", (event) => {\n\t\tif (event.source !== \"extension\") state.monitorNotifier?.noteActivity();\n\t});\n\n\tpi.on(\"tool_call\", () => {\n\t\tstate.monitorNotifier?.noteActivity();\n\t});\n\n\tpi.on(\"before_agent_start\", async (event) => {\n\t\tif (state.steppedAside) return undefined;\n\t\treturn { systemPrompt: `${event.systemPrompt}\\n${TERMINAL_PROMPT_SECTION}` };\n\t});\n\n\tpi.on(\"session_shutdown\", async (event, ctx) => {\n\t\tstate.monitorNotifier?.dispose();\n\t\tstate.monitorNotifier = null;\n\t\tstate.notifier = null;\n\t\tstate.statusTicker.stop();\n\t\tconst sessionKey = sessionKeyOf(ctx) ?? sessionKeyOf(state.ctx);\n\t\tif (event.reason === \"reload\" && state.bundle && sessionKey !== undefined) {\n\t\t\t// Keep state.bundle referenced: exit listeners captured by this instance's tool\n\t\t\t// context still route through the shared bundle after the new owner claims it.\n\t\t\tstate.bundle.park();\n\t\t\tawait parkBundle(sessionKey, state.bundle);\n\t\t\treturn;\n\t\t}\n\t\tconst bundle = state.bundle;\n\t\tstate.bundle = null;\n\t\tawait bundle?.teardown();\n\t\tif (sessionKey !== undefined) await teardownParkedBundle(sessionKey);\n\t});\n}\n\nexport default registerTerminalExtension;\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WakeSourceStateItem } from "../monitor-state-event.ts";
|
|
2
2
|
import { TerminalManager, type TerminalManagerOptions } from "./manager.ts";
|
|
3
3
|
import { type MonitorEvent, MonitorRegistry, type MonitorSnapshotEntry } from "./monitor-registry.ts";
|
|
4
4
|
import type { TerminalRuntimeSession } from "./runtime-session.ts";
|
|
5
5
|
export interface TerminalEventSinks {
|
|
6
6
|
readonly onMonitorEvent: (event: MonitorEvent) => void;
|
|
7
7
|
readonly onMonitorState: (snapshot: readonly MonitorSnapshotEntry[]) => void;
|
|
8
|
-
readonly onBackgroundState: (snapshot: readonly
|
|
8
|
+
readonly onBackgroundState: (snapshot: readonly WakeSourceStateItem[]) => void;
|
|
9
9
|
readonly onBackgroundExit: (id: string, runtime: TerminalRuntimeSession) => void;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
@@ -23,7 +23,7 @@ export declare class TerminalSessionBundle {
|
|
|
23
23
|
/** Install live sinks, re-publish channel state, and flush everything buffered while parked. */
|
|
24
24
|
bind(sinks: TerminalEventSinks): void;
|
|
25
25
|
park(): void;
|
|
26
|
-
backgroundSnapshot(): readonly
|
|
26
|
+
backgroundSnapshot(): readonly WakeSourceStateItem[];
|
|
27
27
|
notifyBackgroundStart(id: string, description: string, startedAtMs?: number): void;
|
|
28
28
|
notifyBackgroundExit(id: string, runtime: TerminalRuntimeSession): void;
|
|
29
29
|
teardown(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-bundle.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/session-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"session-bundle.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/session-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,KAAK,YAAY,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACtG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACvD,QAAQ,CAAC,cAAc,EAAE,CAAC,QAAQ,EAAE,SAAS,oBAAoB,EAAE,KAAK,IAAI,CAAC;IAC7E,QAAQ,CAAC,iBAAiB,EAAE,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,KAAK,IAAI,CAAC;IAC/E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IACrG,CAAC;CACD;AAED,MAAM,aAAa,GAAG,IAAI,GAAG,EAAiC,CAAC;AAE/D,kGAAkG;AAClG,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,UAAkB,EAAE,MAA6B;IACjF,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC/C,aAAa,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACtC,IAAI,QAAQ,IAAI,QAAQ,KAAK,MAAM;QAAE,MAAM,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,UAAkB;IACnD,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC7C,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACjC,OAAO,MAAM,CAAC;AACf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,UAAkB;IAC5D,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC7C,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACjC,MAAM,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC1B,CAAC","sourcesContent":["import type { WakeSourceStateItem } from \"../monitor-state-event.ts\";\nimport { TerminalManager, type TerminalManagerOptions } from \"./manager.ts\";\nimport { type MonitorEvent, MonitorRegistry, type MonitorSnapshotEntry } from \"./monitor-registry.ts\";\nimport type { TerminalRuntimeSession } from \"./runtime-session.ts\";\n\nexport interface TerminalEventSinks {\n\treadonly onMonitorEvent: (event: MonitorEvent) => void;\n\treadonly onMonitorState: (snapshot: readonly MonitorSnapshotEntry[]) => void;\n\treadonly onBackgroundState: (snapshot: readonly WakeSourceStateItem[]) => void;\n\treadonly onBackgroundExit: (id: string, runtime: TerminalRuntimeSession) => void;\n}\n\nconst MAX_PARKED_MONITOR_EVENTS = 100;\nconst MAX_PARKED_EXITS = 32;\n\n/**\n * The long-lived terminal runtime for one agent session: the PTY session manager plus\n * the monitor registry. A session reload replaces the extension runner and re-runs the\n * extension factory, so this state must outlive any single extension instance; event\n * routing goes through mutable sinks the current owner instance binds. While parked\n * (the reload window, or a headless reload that never re-binds) events buffer bounded.\n */\nexport class TerminalSessionBundle {\n\treadonly manager: TerminalManager;\n\treadonly monitors: MonitorRegistry;\n\t#sinks: TerminalEventSinks | null = null;\n\t#parkedMonitorEvents: MonitorEvent[] = [];\n\t#parkedExits = new Map<string, TerminalRuntimeSession>();\n\t#backgrounds = new Map<string, WakeSourceStateItem>();\n\t#torndown = false;\n\n\tconstructor(options: TerminalManagerOptions) {\n\t\tthis.manager = new TerminalManager(options);\n\t\tthis.monitors = new MonitorRegistry((event) => this.#dispatchMonitorEvent(event), {\n\t\t\tonChange: (snapshot) => this.#sinks?.onMonitorState(snapshot),\n\t\t});\n\t}\n\n\t/** Install live sinks, re-publish channel state, and flush everything buffered while parked. */\n\tbind(sinks: TerminalEventSinks): void {\n\t\tif (this.#torndown) return;\n\t\tthis.#sinks = sinks;\n\t\tconst parkedMonitorEvents = this.#parkedMonitorEvents;\n\t\tthis.#parkedMonitorEvents = [];\n\t\tconst parkedExits = [...this.#parkedExits];\n\t\tthis.#parkedExits.clear();\n\t\tsinks.onMonitorState(this.monitors.snapshot());\n\t\tsinks.onBackgroundState(this.backgroundSnapshot());\n\t\tfor (const event of parkedMonitorEvents) sinks.onMonitorEvent(event);\n\t\tfor (const [id, runtime] of parkedExits) sinks.onBackgroundExit(id, runtime);\n\t}\n\n\tpark(): void {\n\t\tthis.#sinks = null;\n\t}\n\n\tbackgroundSnapshot(): readonly WakeSourceStateItem[] {\n\t\treturn [...this.#backgrounds.values()];\n\t}\n\n\tnotifyBackgroundStart(id: string, description: string, startedAtMs = Date.now()): void {\n\t\tif (this.#torndown) return;\n\t\tthis.#backgrounds.set(id, { id, description, startedAtMs });\n\t\tthis.#sinks?.onBackgroundState(this.backgroundSnapshot());\n\t}\n\n\tnotifyBackgroundExit(id: string, runtime: TerminalRuntimeSession): void {\n\t\tif (this.#torndown) return;\n\t\tif (this.#backgrounds.delete(id)) this.#sinks?.onBackgroundState(this.backgroundSnapshot());\n\t\tif (this.#sinks) {\n\t\t\tthis.#sinks.onBackgroundExit(id, runtime);\n\t\t\treturn;\n\t\t}\n\t\tif (this.#parkedExits.size >= MAX_PARKED_EXITS) return;\n\t\tthis.#parkedExits.set(id, runtime);\n\t}\n\n\tasync teardown(): Promise<void> {\n\t\tif (this.#torndown) return;\n\t\tthis.#parkedMonitorEvents = [];\n\t\tthis.#parkedExits.clear();\n\t\tthis.monitors.dispose();\n\t\tif (this.#backgrounds.size > 0) {\n\t\t\tthis.#backgrounds.clear();\n\t\t\tthis.#sinks?.onBackgroundState([]);\n\t\t}\n\t\tthis.#torndown = true;\n\t\tthis.#sinks = null;\n\t\tawait this.manager.teardown();\n\t}\n\n\t#dispatchMonitorEvent(event: MonitorEvent): void {\n\t\tif (this.#torndown) return;\n\t\tif (this.#sinks) {\n\t\t\tthis.#sinks.onMonitorEvent(event);\n\t\t\treturn;\n\t\t}\n\t\tthis.#parkedMonitorEvents.push(event);\n\t\tif (this.#parkedMonitorEvents.length > MAX_PARKED_MONITOR_EVENTS) this.#parkedMonitorEvents.shift();\n\t}\n}\n\nconst parkedBundles = new Map<string, TerminalSessionBundle>();\n\n/** Park a bundle across a reload; at most one parked bundle per session, older ones torn down. */\nexport async function parkBundle(sessionKey: string, bundle: TerminalSessionBundle): Promise<void> {\n\tconst previous = parkedBundles.get(sessionKey);\n\tparkedBundles.set(sessionKey, bundle);\n\tif (previous && previous !== bundle) await previous.teardown();\n}\n\nexport function claimParkedBundle(sessionKey: string): TerminalSessionBundle | undefined {\n\tconst bundle = parkedBundles.get(sessionKey);\n\tparkedBundles.delete(sessionKey);\n\treturn bundle;\n}\n\nexport async function teardownParkedBundle(sessionKey: string): Promise<void> {\n\tconst bundle = parkedBundles.get(sessionKey);\n\tparkedBundles.delete(sessionKey);\n\tawait bundle?.teardown();\n}\n"]}
|
|
@@ -7,7 +7,7 @@ export type { McpServerDeclaration } from "./builtin/mcp/config-schema.ts";
|
|
|
7
7
|
export { createExtensionRuntime, discoverAndLoadExtensions, loadExtensionFromFactory, loadExtensions, } from "./loader.ts";
|
|
8
8
|
export type { ExtensionErrorListener, ExtensionToolHookLifecycleEvent, ExtensionToolHookLifecycleObserver, ExtensionToolHookLifecycleStatus, ExtensionToolHookName, ForkHandler, NavigateTreeHandler, NewSessionHandler, ShutdownHandler, SwitchSessionHandler, } from "./runner.ts";
|
|
9
9
|
export { ExtensionRunner } from "./runner.ts";
|
|
10
|
-
export type { AfterProviderResponseEvent, AgentEndEvent, AgentSettledEvent, AgentStartEvent, AgentToolResult, AgentToolUpdateCallback, AppendEntryHandler, AppKeybinding, AutocompleteProviderFactory, BashToolCallEvent, BashToolResultEvent, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeProviderHeadersEvent, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, BuildSystemPromptOptions, CompactOptions, ContextEvent, ContextEventResult, ContextUsage, CustomToolCallEvent, CustomToolResultEvent, EditorFactory, EditToolCallEvent, EditToolResultEvent, EntryRenderer, EntryRenderOptions, ExecOptions, ExecResult, ExecuteToolErrorCode, ExecuteToolHandler, ExecuteToolOptions, ExecuteToolResult, ExecuteToolUpdateCallback, Extension, ExtensionActions, ExtensionAPI, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFactory, ExtensionFlag, ExtensionHandler, ExtensionMode, ExtensionRuntime, ExtensionShortcut, ExtensionUIContext, ExtensionUIDialogOptions, ExtensionWidgetOptions, FindToolCallEvent, FindToolResultEvent, GetActiveToolsHandler, GetAllToolsHandler, GetCommandsHandler, GetThinkingLevelHandler, GrepToolCallEvent, GrepToolResultEvent, InlineExtension, InputDispositionEvent, InputEvent, InputEventResult, InputSource, KeybindingsManager, LoadExtensionsResult, LsToolCallEvent, LsToolResultEvent, MarkdownTransformContext, MarkdownTransformer, MessageEndEvent, MessageRenderer, MessageRenderOptions, MessageStartEvent, MessageUpdateEvent, ModelSelectEvent, ModelSelectEventResult, ModelSelectSource, ProjectTrustContext, ProjectTrustEvent, ProjectTrustEventDecision, ProjectTrustEventResult, ProjectTrustHandler, ProviderConfig, ProviderModelConfig, ReadToolCallEvent, ReadToolResultEvent, RegisteredCommand, RegisteredTool, ReplacedSessionContext, ResolvedCommand, ResourcesDiscoverEvent, ResourcesDiscoverResult, SendMessageHandler, SendUserMessageHandler, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeForkEvent, SessionBeforeForkResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionBeforeTreeEvent, SessionBeforeTreeResult, SessionCompactEvent, SessionEvent, SessionInfoChangedEvent, SessionShutdownEvent, SessionStartEvent, SessionTreeEvent, SetActiveToolsHandler, SetLabelHandler, SetModelHandler, SetThinkingLevelHandler, SystemPromptChangeEvent, TerminalInputHandler, ToolCallEvent, ToolCallEventResult, ToolDefinition, ToolExecutionEndEvent, ToolExecutionMode, ToolExecutionStartEvent, ToolExecutionUpdateEvent, ToolInfo, ToolRenderResultOptions, ToolResultEvent, ToolResultEventResult, TreePreparation, TurnEndEvent, TurnStartEvent, UserBashEvent, UserBashEventResult, WidgetPlacement, WorkingIndicatorOptions, WriteToolCallEvent, WriteToolResultEvent, } from "./types.ts";
|
|
10
|
+
export type { AfterProviderResponseEvent, AgentEndEvent, AgentSettledEvent, AgentStartEvent, AgentToolResult, AgentToolUpdateCallback, AppendEntryHandler, AppKeybinding, AutocompleteProviderFactory, BashToolCallEvent, BashToolResultEvent, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeProviderHeadersEvent, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, BuildSystemPromptOptions, CompactOptions, ContextEvent, ContextEventResult, ContextUsage, CustomToolCallEvent, CustomToolResultEvent, EditorFactory, EditToolCallEvent, EditToolResultEvent, EntryRenderer, EntryRenderOptions, ExecOptions, ExecResult, ExecuteToolErrorCode, ExecuteToolHandler, ExecuteToolOptions, ExecuteToolResult, ExecuteToolUpdateCallback, Extension, ExtensionActions, ExtensionAPI, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFactory, ExtensionFlag, ExtensionHandler, ExtensionMode, ExtensionRuntime, ExtensionShortcut, ExtensionUIContext, ExtensionUIDialogOptions, ExtensionWidgetOptions, FilesystemOperation, FilesystemPolicy, FilesystemPolicyChecker, FilesystemPolicyDecision, FilesystemPolicyRequest, FindToolCallEvent, FindToolResultEvent, GetActiveToolsHandler, GetAllToolsHandler, GetCommandsHandler, GetThinkingLevelHandler, GrepToolCallEvent, GrepToolResultEvent, InlineExtension, InputDispositionEvent, InputEvent, InputEventResult, InputSource, KeybindingsManager, LoadExtensionsResult, LsToolCallEvent, LsToolResultEvent, MarkdownTransformContext, MarkdownTransformer, MessageEndEvent, MessageRenderer, MessageRenderOptions, MessageStartEvent, MessageUpdateEvent, ModelSelectEvent, ModelSelectEventResult, ModelSelectSource, ProjectTrustContext, ProjectTrustEvent, ProjectTrustEventDecision, ProjectTrustEventResult, ProjectTrustHandler, ProviderConfig, ProviderModelConfig, ReadToolCallEvent, ReadToolResultEvent, RegisteredCommand, RegisteredTool, ReplacedSessionContext, ResolvedCommand, ResourcesDiscoverEvent, ResourcesDiscoverResult, SendMessageHandler, SendUserMessageHandler, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeForkEvent, SessionBeforeForkResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionBeforeTreeEvent, SessionBeforeTreeResult, SessionCompactEvent, SessionEvent, SessionInfoChangedEvent, SessionShutdownEvent, SessionStartEvent, SessionTreeEvent, SetActiveToolsHandler, SetLabelHandler, SetModelHandler, SetThinkingLevelHandler, SystemPromptChangeEvent, TerminalInputHandler, ToolCallEvent, ToolCallEventResult, ToolDefinition, ToolExecutionEndEvent, ToolExecutionMode, ToolExecutionStartEvent, ToolExecutionUpdateEvent, ToolInfo, ToolRenderResultOptions, ToolResultEvent, ToolResultEventResult, TreePreparation, TurnEndEvent, TurnStartEvent, UserBashEvent, UserBashEventResult, WidgetPlacement, WorkingIndicatorOptions, WriteToolCallEvent, WriteToolResultEvent, } from "./types.ts";
|
|
11
11
|
export { defineTool, ExecuteToolError, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, RUNTIME_EXTENSION_PATH, } from "./types.ts";
|
|
12
12
|
export { wrapRegisteredTool, wrapRegisteredTools } from "./wrapper.ts";
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACjF,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EACN,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,GACd,MAAM,aAAa,CAAC;AACrB,YAAY,EACX,sBAAsB,EACtB,+BAA+B,EAC/B,kCAAkC,EAClC,gCAAgC,EAChC,qBAAqB,EACrB,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,oBAAoB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EACX,0BAA0B,EAC1B,aAAa,EACb,iBAAiB,EACjB,eAAe,EAEf,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAElB,aAAa,EACb,2BAA2B,EAE3B,iBAAiB,EACjB,mBAAmB,E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,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,EAEpB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EAEpB,aAAa,EACb,mBAAmB,EAEnB,cAAc,EAEd,qBAAqB,EAErB,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,EACxB,QAAQ,EACR,uBAAuB,EACvB,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,YAAY,EACZ,cAAc,EAEd,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACjF,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EACN,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,GACd,MAAM,aAAa,CAAC;AACrB,YAAY,EACX,sBAAsB,EACtB,+BAA+B,EAC/B,kCAAkC,EAClC,gCAAgC,EAChC,qBAAqB,EACrB,WAAW,EACX,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iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EAEnB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EAEnB,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,eAAe,EAEf,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,EAEpB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EAEpB,aAAa,EACb,mBAAmB,EAEnB,cAAc,EAEd,qBAAqB,EAErB,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,EACxB,QAAQ,EACR,uBAAuB,EACvB,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,YAAY,EACZ,cAAc,EAEd,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/extensions/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EACN,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,GACd,MAAM,aAAa,CAAC;AAarB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/extensions/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EACN,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,GACd,MAAM,aAAa,CAAC;AAarB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAsK9C,cAAc;AACd,OAAO,EACN,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC","sourcesContent":["/**\n * Extension system for lifecycle events and custom tools.\n */\n\nexport type { SlashCommandInfo, SlashCommandSource } from \"../slash-commands.ts\";\nexport type { SourceInfo } from \"../source-info.ts\";\nexport type { McpServerDeclaration } from \"./builtin/mcp/config-schema.ts\";\nexport {\n\tcreateExtensionRuntime,\n\tdiscoverAndLoadExtensions,\n\tloadExtensionFromFactory,\n\tloadExtensions,\n} from \"./loader.ts\";\nexport type {\n\tExtensionErrorListener,\n\tExtensionToolHookLifecycleEvent,\n\tExtensionToolHookLifecycleObserver,\n\tExtensionToolHookLifecycleStatus,\n\tExtensionToolHookName,\n\tForkHandler,\n\tNavigateTreeHandler,\n\tNewSessionHandler,\n\tShutdownHandler,\n\tSwitchSessionHandler,\n} from \"./runner.ts\";\nexport { ExtensionRunner } from \"./runner.ts\";\nexport type {\n\tAfterProviderResponseEvent,\n\tAgentEndEvent,\n\tAgentSettledEvent,\n\tAgentStartEvent,\n\t// Re-exports\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppendEntryHandler,\n\t// App keybindings (for custom editors)\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\t// Events - Tool (ToolCallEvent types)\n\tBashToolCallEvent,\n\tBashToolResultEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderHeadersEvent,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBuildSystemPromptOptions,\n\t// Context\n\tCompactOptions,\n\t// Events - Agent\n\tContextEvent,\n\t// Event Results\n\tContextEventResult,\n\tContextUsage,\n\tCustomToolCallEvent,\n\tCustomToolResultEvent,\n\tEditorFactory,\n\tEditToolCallEvent,\n\tEditToolResultEvent,\n\t// Message and Entry Rendering\n\tEntryRenderer,\n\tEntryRenderOptions,\n\tExecOptions,\n\tExecResult,\n\tExecuteToolErrorCode,\n\tExecuteToolHandler,\n\tExecuteToolOptions,\n\tExecuteToolResult,\n\tExecuteToolUpdateCallback,\n\tExtension,\n\tExtensionActions,\n\t// API\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\t// Errors\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionMode,\n\t// Runtime\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tFilesystemOperation,\n\tFilesystemPolicy,\n\tFilesystemPolicyChecker,\n\tFilesystemPolicyDecision,\n\tFilesystemPolicyRequest,\n\tFindToolCallEvent,\n\tFindToolResultEvent,\n\tGetActiveToolsHandler,\n\tGetAllToolsHandler,\n\tGetCommandsHandler,\n\tGetThinkingLevelHandler,\n\tGrepToolCallEvent,\n\tGrepToolResultEvent,\n\tInlineExtension,\n\t// Events - Input\n\tInputDispositionEvent,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tLsToolResultEvent,\n\tMarkdownTransformContext,\n\tMarkdownTransformer,\n\t// Events - Message\n\tMessageEndEvent,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tMessageStartEvent,\n\tMessageUpdateEvent,\n\tModelSelectEvent,\n\tModelSelectEventResult,\n\tModelSelectSource,\n\tProjectTrustContext,\n\tProjectTrustEvent,\n\tProjectTrustEventDecision,\n\tProjectTrustEventResult,\n\tProjectTrustHandler,\n\t// Provider Registration\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tReadToolResultEvent,\n\t// Commands\n\tRegisteredCommand,\n\tRegisteredTool,\n\tReplacedSessionContext,\n\tResolvedCommand,\n\t// Events - Resources\n\tResourcesDiscoverEvent,\n\tResourcesDiscoverResult,\n\tSendMessageHandler,\n\tSendUserMessageHandler,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeCompactResult,\n\tSessionBeforeForkEvent,\n\tSessionBeforeForkResult,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeSwitchResult,\n\tSessionBeforeTreeEvent,\n\tSessionBeforeTreeResult,\n\tSessionCompactEvent,\n\tSessionEvent,\n\tSessionInfoChangedEvent,\n\tSessionShutdownEvent,\n\t// Events - Session\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSetActiveToolsHandler,\n\tSetLabelHandler,\n\tSetModelHandler,\n\tSetThinkingLevelHandler,\n\tSystemPromptChangeEvent,\n\tTerminalInputHandler,\n\t// Events - Tool\n\tToolCallEvent,\n\tToolCallEventResult,\n\t// Tools\n\tToolDefinition,\n\t// Events - Tool Execution\n\tToolExecutionEndEvent,\n\t// Tool execution mode\n\tToolExecutionMode,\n\tToolExecutionStartEvent,\n\tToolExecutionUpdateEvent,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tToolResultEventResult,\n\tTreePreparation,\n\tTurnEndEvent,\n\tTurnStartEvent,\n\t// Events - User Bash\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n\tWriteToolResultEvent,\n} from \"./types.ts\";\n// Type guards\nexport {\n\tdefineTool,\n\tExecuteToolError,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\tRUNTIME_EXTENSION_PATH,\n} from \"./types.ts\";\nexport { wrapRegisteredTool, wrapRegisteredTools } from \"./wrapper.ts\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/loader.ts"],"names":[],"mappings":"AACA;;;GAGG;AAyBH,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAOhE,OAAO,KAAK,EAEX,SAAS,EAET,gBAAgB,EAChB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/loader.ts"],"names":[],"mappings":"AACA;;;GAGG;AAyBH,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAOhE,OAAO,KAAK,EAEX,SAAS,EAET,gBAAgB,EAChB,gBAAgB,EAGhB,oBAAoB,EAGpB,2BAA2B,EAK3B,MAAM,YAAY,CAAC;AA8IpB,MAAM,MAAM,wBAAwB,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,gBAAgB,GAAG,SAAS,CAAC;AAiBrH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAyBD;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,gBAAgB,CAuEzD;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,gBAAgB,GAAG,2BAA2B,EAAE,CAS1G;AAoVD;;GAEG;AACH,wBAAsB,wBAAwB,CAC7C,OAAO,EAAE,gBAAgB,EACzB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,gBAAgB,EACzB,aAAa,SAAa,GACxB,OAAO,CAAC,SAAS,CAAC,CAOpB;AAqDD,wBAAsB,cAAc,CACnC,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,QAAQ,EACnB,OAAO,CAAC,EAAE,gBAAgB,EAC1B,OAAO,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,wBAAwB,CAAA;CAAE,GACtD,OAAO,CAAC,oBAAoB,CAAC,CAE/B;AAED,wBAAsB,oBAAoB,CACzC,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,QAAQ,EACnB,OAAO,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,oBAAoB,CAAC,CAE/B;AA2FD;;GAEG;AACH,wBAAsB,yBAAyB,CAC9C,eAAe,EAAE,MAAM,EAAE,EACzB,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,MAAsB,EAChC,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,oBAAoB,CAAC,CA2C/B"}
|
|
@@ -280,6 +280,12 @@ function createExtensionAPI(extension, runtime, cwd, eventBus) {
|
|
|
280
280
|
hints.set(name, hint);
|
|
281
281
|
runtime.registerRemovedToolHint(name, hint);
|
|
282
282
|
},
|
|
283
|
+
registerFilesystemPolicy(policy) {
|
|
284
|
+
runtime.assertActive();
|
|
285
|
+
const policies = extension.filesystemPolicies ?? [];
|
|
286
|
+
policies.push(policy);
|
|
287
|
+
extension.filesystemPolicies = policies;
|
|
288
|
+
},
|
|
283
289
|
registerCommand(name, options) {
|
|
284
290
|
runtime.assertActive();
|
|
285
291
|
extension.commands.set(name, {
|
|
@@ -474,6 +480,7 @@ function createExtension(extensionPath, resolvedPath, registrationCwd) {
|
|
|
474
480
|
tools: new Map(),
|
|
475
481
|
removedToolHints: new Map(),
|
|
476
482
|
lazyToolActivators: [],
|
|
483
|
+
filesystemPolicies: [],
|
|
477
484
|
messageRenderers: new Map(),
|
|
478
485
|
entryRenderers: undefined,
|
|
479
486
|
commands: new Map(),
|