@code-yeongyu/senpi 2026.7.25 → 2026.7.26
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 +81 -0
- package/README.md +1 -1
- package/dist/beta/omo-local-update.d.ts +207 -0
- package/dist/beta/omo-local-update.d.ts.map +1 -0
- package/dist/beta/omo-local-update.js +708 -0
- package/dist/beta/omo-local-update.js.map +1 -0
- package/dist/cli/args.d.ts +4 -16
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +9 -25
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/grok-neo-gate.d.ts +12 -0
- package/dist/cli/grok-neo-gate.d.ts.map +1 -0
- package/dist/cli/grok-neo-gate.js +18 -0
- package/dist/cli/grok-neo-gate.js.map +1 -0
- package/dist/cli-main.js +4 -0
- package/dist/cli-main.js.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +2 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +33 -8
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +22 -3
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +202 -58
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-providers.d.ts +2 -2
- package/dist/core/auth-providers.js +2 -2
- package/dist/core/auth-providers.js.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.js +3 -2
- package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.js +30 -2
- package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.js +28 -0
- package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/index.js +20 -17
- package/dist/core/extensions/builtin/config-reload/index.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/log.d.ts +4 -1
- package/dist/core/extensions/builtin/config-reload/log.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/log.js +3 -0
- package/dist/core/extensions/builtin/config-reload/log.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/routine-settings.d.ts +15 -0
- package/dist/core/extensions/builtin/config-reload/routine-settings.d.ts.map +1 -0
- package/dist/core/extensions/builtin/config-reload/routine-settings.js +102 -0
- package/dist/core/extensions/builtin/config-reload/routine-settings.js.map +1 -0
- package/dist/core/extensions/builtin/goal/command-registration.js +2 -2
- package/dist/core/extensions/builtin/goal/command-registration.js.map +1 -1
- package/dist/core/extensions/builtin/goal/format.d.ts +1 -1
- package/dist/core/extensions/builtin/goal/format.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/format.js +9 -2
- package/dist/core/extensions/builtin/goal/format.js.map +1 -1
- package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/index.js +38 -23
- package/dist/core/extensions/builtin/goal/index.js.map +1 -1
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.d.ts +6 -0
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.js +19 -0
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.js.map +1 -0
- package/dist/core/extensions/builtin/goal/persistence.d.ts +6 -0
- package/dist/core/extensions/builtin/goal/persistence.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/persistence.js +141 -0
- package/dist/core/extensions/builtin/goal/persistence.js.map +1 -0
- package/dist/core/extensions/builtin/goal/store.d.ts +7 -3
- package/dist/core/extensions/builtin/goal/store.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/store.js +66 -181
- package/dist/core/extensions/builtin/goal/store.js.map +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.d.ts +1 -0
- package/dist/core/extensions/builtin/goal/tool-registration.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.js +26 -15
- package/dist/core/extensions/builtin/goal/tool-registration.js.map +1 -1
- package/dist/core/extensions/builtin/goal/transitions.d.ts +3 -0
- package/dist/core/extensions/builtin/goal/transitions.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/transitions.js +45 -0
- package/dist/core/extensions/builtin/goal/transitions.js.map +1 -0
- package/dist/core/extensions/builtin/goal/types.d.ts +10 -4
- package/dist/core/extensions/builtin/goal/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/types.js +2 -2
- package/dist/core/extensions/builtin/goal/types.js.map +1 -1
- package/dist/core/extensions/builtin/goal/ui.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/ui.js +2 -0
- package/dist/core/extensions/builtin/goal/ui.js.map +1 -1
- package/dist/core/extensions/builtin/goal/validation.d.ts +8 -1
- package/dist/core/extensions/builtin/goal/validation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/validation.js +24 -12
- package/dist/core/extensions/builtin/goal/validation.js.map +1 -1
- package/dist/core/extensions/builtin/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/index.js +0 -2
- package/dist/core/extensions/builtin/index.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/index.js +8 -5
- package/dist/core/extensions/builtin/mcp/index.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/parsers.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/parsers.js +1 -0
- package/dist/core/extensions/builtin/permission-system/parsers.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +48 -0
- 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 +88 -64
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.js +32 -0
- package/dist/core/extensions/builtin/terminal/extension.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/index.d.ts +1 -1
- package/dist/core/extensions/builtin/terminal/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/index.js +1 -1
- package/dist/core/extensions/builtin/terminal/index.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts +29 -0
- package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/monitor-notify.js +185 -0
- package/dist/core/extensions/builtin/terminal/monitor-notify.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts +35 -0
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/monitor-registry.js +98 -0
- package/dist/core/extensions/builtin/terminal/monitor-registry.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/notify.d.ts +9 -0
- package/dist/core/extensions/builtin/terminal/notify.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/notify.js +30 -14
- package/dist/core/extensions/builtin/terminal/notify.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.d.ts +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.js +13 -5
- package/dist/core/extensions/builtin/terminal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/runtime-session.d.ts +3 -12
- package/dist/core/extensions/builtin/terminal/runtime-session.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/runtime-session.js +4 -59
- package/dist/core/extensions/builtin/terminal/runtime-session.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/settings.d.ts +8 -0
- package/dist/core/extensions/builtin/terminal/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/settings.js +16 -2
- package/dist/core/extensions/builtin/terminal/settings.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/shared.d.ts +2 -2
- package/dist/core/extensions/builtin/terminal/shared.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/shared.js +2 -1
- package/dist/core/extensions/builtin/terminal/shared.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-output.d.ts +10 -4
- package/dist/core/extensions/builtin/terminal/tools/bash-output.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-output.js +17 -96
- package/dist/core/extensions/builtin/terminal/tools/bash-output.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts +7 -0
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts +41 -0
- package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/tools/monitor.js +97 -0
- package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/tools/render.d.ts +3 -0
- package/dist/core/extensions/builtin/terminal/tools/render.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/render.js +5 -2
- package/dist/core/extensions/builtin/terminal/tools/render.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/fuzzy-match.d.ts +19 -0
- package/dist/core/extensions/builtin/todotools/fuzzy-match.d.ts.map +1 -0
- package/dist/core/extensions/builtin/todotools/fuzzy-match.js +70 -0
- package/dist/core/extensions/builtin/todotools/fuzzy-match.js.map +1 -0
- package/dist/core/extensions/builtin/todotools/normalize.d.ts +8 -0
- package/dist/core/extensions/builtin/todotools/normalize.d.ts.map +1 -0
- package/dist/core/extensions/builtin/todotools/normalize.js +174 -0
- package/dist/core/extensions/builtin/todotools/normalize.js.map +1 -0
- package/dist/core/extensions/builtin/todotools/prompt.d.ts +2 -2
- package/dist/core/extensions/builtin/todotools/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/prompt.js +4 -2
- package/dist/core/extensions/builtin/todotools/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/state.d.ts +9 -8
- package/dist/core/extensions/builtin/todotools/state.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/state.js +99 -48
- package/dist/core/extensions/builtin/todotools/state.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/tools/todo.d.ts +1 -1
- package/dist/core/extensions/builtin/todotools/tools/todo.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/tools/todo.js +65 -38
- package/dist/core/extensions/builtin/todotools/tools/todo.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/index.js +2 -4
- package/dist/core/extensions/builtin/websearch/index.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/config.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/config.js +4 -1
- package/dist/core/extensions/builtin/websearch/websearch/config.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/native.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/native.js +2 -4
- package/dist/core/extensions/builtin/websearch/websearch/native.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/renderers.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/renderers.js +20 -8
- package/dist/core/extensions/builtin/websearch/websearch/renderers.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/search.d.ts +6 -1
- package/dist/core/extensions/builtin/websearch/websearch/search.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/search.js +15 -11
- package/dist/core/extensions/builtin/websearch/websearch/search.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/tool.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/tool.js +5 -10
- package/dist/core/extensions/builtin/websearch/websearch/tool.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/types.d.ts +1 -0
- package/dist/core/extensions/builtin/websearch/websearch/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/types.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +12 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +5 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +12 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +25 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/keybindings.d.ts +0 -5
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +0 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/messages.d.ts +32 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +91 -0
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-resolver.d.ts +10 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +13 -3
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +2 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +4 -3
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +19 -1
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts +9 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +13 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/retry-fallback/controller.d.ts +7 -0
- package/dist/core/retry-fallback/controller.d.ts.map +1 -1
- package/dist/core/retry-fallback/controller.js +13 -0
- package/dist/core/retry-fallback/controller.js.map +1 -1
- package/dist/core/retry-fallback/cooldown.d.ts.map +1 -1
- package/dist/core/retry-fallback/cooldown.js +5 -0
- package/dist/core/retry-fallback/cooldown.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +11 -35
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager.d.ts +12 -16
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +10 -13
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/thinking-levels.d.ts.map +1 -1
- package/dist/core/thinking-levels.js +9 -2
- package/dist/core/thinking-levels.js.map +1 -1
- package/dist/core/timings.d.ts +7 -2
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +11 -0
- package/dist/core/timings.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +6 -0
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/inspector-policy.d.ts +22 -0
- package/dist/inspector-policy.d.ts.map +1 -0
- package/dist/inspector-policy.js +84 -0
- package/dist/inspector-policy.js.map +1 -0
- package/dist/main.d.ts +6 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +20 -23
- package/dist/main.js.map +1 -1
- package/dist/modes/app-server/runtime.d.ts.map +1 -1
- package/dist/modes/app-server/runtime.js +1 -0
- package/dist/modes/app-server/runtime.js.map +1 -1
- package/dist/modes/app-server/threads/goal-handlers.js +4 -2
- package/dist/modes/app-server/threads/goal-handlers.js.map +1 -1
- package/dist/modes/app-server/threads/goal-wire.d.ts.map +1 -1
- package/dist/modes/app-server/threads/goal-wire.js +1 -0
- package/dist/modes/app-server/threads/goal-wire.js.map +1 -1
- package/dist/modes/app-server/threads/handlers.d.ts +1 -0
- package/dist/modes/app-server/threads/handlers.d.ts.map +1 -1
- package/dist/modes/app-server/threads/handlers.js +2 -0
- package/dist/modes/app-server/threads/handlers.js.map +1 -1
- package/dist/modes/app-server/threads/turn-runtime.d.ts +1 -0
- package/dist/modes/app-server/threads/turn-runtime.d.ts.map +1 -1
- package/dist/modes/app-server/threads/turn-runtime.js.map +1 -1
- package/dist/modes/app-server/threads/turns.d.ts.map +1 -1
- package/dist/modes/app-server/threads/turns.js +47 -3
- package/dist/modes/app-server/threads/turns.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +3 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +9 -2
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +1 -0
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +29 -4
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +5 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +43 -17
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/grok/chrome-tokens.d.ts +22 -0
- package/dist/modes/interactive/grok/chrome-tokens.d.ts.map +1 -0
- package/dist/modes/interactive/grok/chrome-tokens.js +27 -0
- package/dist/modes/interactive/grok/chrome-tokens.js.map +1 -0
- package/dist/modes/interactive/grok/chrome.d.ts +51 -0
- package/dist/modes/interactive/grok/chrome.d.ts.map +1 -0
- package/dist/modes/interactive/grok/chrome.js +105 -0
- package/dist/modes/interactive/grok/chrome.js.map +1 -0
- package/dist/modes/interactive/grok/footer.d.ts +14 -0
- package/dist/modes/interactive/grok/footer.d.ts.map +1 -0
- package/dist/modes/interactive/grok/footer.js +27 -0
- package/dist/modes/interactive/grok/footer.js.map +1 -0
- package/dist/modes/interactive/grok/input-card.d.ts +9 -0
- package/dist/modes/interactive/grok/input-card.d.ts.map +1 -0
- package/dist/modes/interactive/grok/input-card.js +30 -0
- package/dist/modes/interactive/grok/input-card.js.map +1 -0
- package/dist/modes/interactive/grok/palette.d.ts +145 -0
- package/dist/modes/interactive/grok/palette.d.ts.map +1 -0
- package/dist/modes/interactive/grok/palette.js +92 -0
- package/dist/modes/interactive/grok/palette.js.map +1 -0
- package/dist/modes/interactive/grok/tool-row.d.ts +17 -0
- package/dist/modes/interactive/grok/tool-row.d.ts.map +1 -0
- package/dist/modes/interactive/grok/tool-row.js +26 -0
- package/dist/modes/interactive/grok/tool-row.js.map +1 -0
- package/dist/modes/interactive/grok/welcome-card.d.ts +10 -0
- package/dist/modes/interactive/grok/welcome-card.d.ts.map +1 -0
- package/dist/modes/interactive/grok/welcome-card.js +30 -0
- package/dist/modes/interactive/grok/welcome-card.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +5 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +117 -54
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/grok-day.json +77 -0
- package/dist/modes/interactive/theme/grok-night.json +93 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +4 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts +3 -3
- package/dist/modes/rpc/connection-handler.js +6 -6
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/custom-capability.d.ts +6 -7
- package/dist/modes/rpc/custom-capability.d.ts.map +1 -1
- package/dist/modes/rpc/custom-capability.js +6 -7
- package/dist/modes/rpc/custom-capability.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +2 -2
- package/dist/modes/rpc/rpc-mode.js +5 -5
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +11 -0
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/senpi +2 -0
- package/docs/docs.json +4 -0
- package/docs/environment-variables.md +1 -0
- package/docs/extensions.md +2 -2
- package/docs/grok-neo.md +77 -0
- package/docs/keybindings.md +0 -1
- package/docs/settings.md +14 -3
- package/docs/terminal-tools.md +6 -3
- package/docs/usage.md +1 -1
- package/examples/extensions/message-renderer.ts +2 -2
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +47 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +39 -19
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +3 -3
- package/node_modules/@code-yeongyu/senpi-codemode/src/bridge/http-server.ts +6 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/bridges/output-bridge.ts +0 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/eval-notifier.ts +40 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +46 -66
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/context-manager.ts +5 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/kernel-contract.ts +2 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/kernel.ts +19 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/prelude.py +7 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-kernel.ts +8 -5
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +23 -5
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-manager.ts +322 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +253 -18
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/interrupt-note.ts +58 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +28 -6
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/status-events.ts +20 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +65 -22
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +4 -41
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +6 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.d.ts +10 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.js +38 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +5 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- 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.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +210 -26
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +16 -8
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.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 +39 -20
- 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/google-generative-ai.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +9 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +4 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +12 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.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 +19 -11
- 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 +121 -23
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +67 -31
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +13 -8
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.d.ts +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.js +37 -35
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +11 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models-store.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +5 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.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/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.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/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +9 -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/error-body.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +8 -3
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.d.ts +30 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.js +70 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/stop-details.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/stop-details.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/stop-details.js +7 -3
- package/node_modules/@earendil-works/pi-ai/dist/utils/stop-details.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-call-id.d.ts +9 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-call-id.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-call-id.js +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-call-id.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +35 -3
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +6 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +32 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +15 -7
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +8 -8
- package/dist/cli/neo/build-argv.d.ts +0 -19
- package/dist/cli/neo/build-argv.d.ts.map +0 -1
- package/dist/cli/neo/build-argv.js +0 -84
- package/dist/cli/neo/build-argv.js.map +0 -1
- package/dist/cli/neo/daemon-launch.d.ts +0 -25
- package/dist/cli/neo/daemon-launch.d.ts.map +0 -1
- package/dist/cli/neo/daemon-launch.js +0 -97
- package/dist/cli/neo/daemon-launch.js.map +0 -1
- package/dist/cli/neo/gate.d.ts +0 -15
- package/dist/cli/neo/gate.d.ts.map +0 -1
- package/dist/cli/neo/gate.js +0 -21
- package/dist/cli/neo/gate.js.map +0 -1
- package/dist/cli/neo/launch.d.ts +0 -24
- package/dist/cli/neo/launch.d.ts.map +0 -1
- package/dist/cli/neo/launch.js +0 -66
- package/dist/cli/neo/launch.js.map +0 -1
- package/dist/cli/neo/platform.d.ts +0 -38
- package/dist/cli/neo/platform.d.ts.map +0 -1
- package/dist/cli/neo/platform.js +0 -54
- package/dist/cli/neo/platform.js.map +0 -1
- package/dist/cli/neo/resolve-binary.d.ts +0 -39
- package/dist/cli/neo/resolve-binary.d.ts.map +0 -1
- package/dist/cli/neo/resolve-binary.js +0 -66
- package/dist/cli/neo/resolve-binary.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/index.d.ts +0 -5
- package/dist/core/extensions/builtin/session-observer/index.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/index.js +0 -36
- package/dist/core/extensions/builtin/session-observer/index.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/loader.d.ts +0 -3
- package/dist/core/extensions/builtin/session-observer/loader.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/loader.js +0 -20
- package/dist/core/extensions/builtin/session-observer/loader.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/overlay-format.d.ts +0 -7
- package/dist/core/extensions/builtin/session-observer/overlay-format.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/overlay-format.js +0 -30
- package/dist/core/extensions/builtin/session-observer/overlay-format.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/overlay.d.ts +0 -51
- package/dist/core/extensions/builtin/session-observer/overlay.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/overlay.js +0 -229
- package/dist/core/extensions/builtin/session-observer/overlay.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/scanner.d.ts +0 -10
- package/dist/core/extensions/builtin/session-observer/scanner.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/scanner.js +0 -142
- package/dist/core/extensions/builtin/session-observer/scanner.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/text.d.ts +0 -7
- package/dist/core/extensions/builtin/session-observer/text.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/text.js +0 -37
- package/dist/core/extensions/builtin/session-observer/text.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/transcript-entries.d.ts +0 -7
- package/dist/core/extensions/builtin/session-observer/transcript-entries.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/transcript-entries.js +0 -71
- package/dist/core/extensions/builtin/session-observer/transcript-entries.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/transcript-format.d.ts +0 -11
- package/dist/core/extensions/builtin/session-observer/transcript-format.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/transcript-format.js +0 -65
- package/dist/core/extensions/builtin/session-observer/transcript-format.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/transcript.d.ts +0 -4
- package/dist/core/extensions/builtin/session-observer/transcript.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/transcript.js +0 -81
- package/dist/core/extensions/builtin/session-observer/transcript.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/types.d.ts +0 -33
- package/dist/core/extensions/builtin/session-observer/types.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/types.js +0 -2
- package/dist/core/extensions/builtin/session-observer/types.js.map +0 -1
- package/dist/modes/rpc/neo-daemon-child-worker.d.ts +0 -29
- package/dist/modes/rpc/neo-daemon-child-worker.d.ts.map +0 -1
- package/dist/modes/rpc/neo-daemon-child-worker.js +0 -95
- package/dist/modes/rpc/neo-daemon-child-worker.js.map +0 -1
- package/dist/modes/rpc/neo-daemon-mode.d.ts +0 -110
- package/dist/modes/rpc/neo-daemon-mode.d.ts.map +0 -1
- package/dist/modes/rpc/neo-daemon-mode.js +0 -267
- package/dist/modes/rpc/neo-daemon-mode.js.map +0 -1
- package/dist/modes/rpc/neo-daemon-protocol.d.ts +0 -50
- package/dist/modes/rpc/neo-daemon-protocol.d.ts.map +0 -1
- package/dist/modes/rpc/neo-daemon-protocol.js +0 -66
- package/dist/modes/rpc/neo-daemon-protocol.js.map +0 -1
- package/dist/modes/rpc/neo-daemon-registry.d.ts +0 -98
- package/dist/modes/rpc/neo-daemon-registry.d.ts.map +0 -1
- package/dist/modes/rpc/neo-daemon-registry.js +0 -209
- package/dist/modes/rpc/neo-daemon-registry.js.map +0 -1
- package/dist/modes/rpc/neo-runtime-options-argv.d.ts +0 -17
- package/dist/modes/rpc/neo-runtime-options-argv.d.ts.map +0 -1
- package/dist/modes/rpc/neo-runtime-options-argv.js +0 -79
- package/dist/modes/rpc/neo-runtime-options-argv.js.map +0 -1
- package/dist/modes/rpc/neo-runtime-options.d.ts +0 -84
- package/dist/modes/rpc/neo-runtime-options.d.ts.map +0 -1
- package/dist/modes/rpc/neo-runtime-options.js +0 -92
- package/dist/modes/rpc/neo-runtime-options.js.map +0 -1
- package/docs/neo.md +0 -111
- package/node_modules/@code-yeongyu/senpi-codemode/src/codemode/runtime.ts +0 -258
- package/node_modules/@code-yeongyu/senpi-codemode/src/codemode/tools.ts +0 -106
|
@@ -2,39 +2,73 @@
|
|
|
2
2
|
// gpt-5.6 alias plus the sol/terra/luna variants - because the series shares
|
|
3
3
|
// one prompting guide and the variants differ only in price/latency tier.
|
|
4
4
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
5
|
+
// 2026-07-25: dieted full-core rewrite, in lockstep with the dieted
|
|
6
|
+
// claude-fable-5/claude-opus-5 presets. The GPT-5.6 prompting guide's own
|
|
7
|
+
// doctrine drives the diet ("simplify prompts first": minimal prompts beat
|
|
8
|
+
// process-heavy stacks by ~10-15% in OpenAI's evals at 41-66% fewer tokens;
|
|
9
|
+
// trim repeated rules, generic language, and examples that do not change
|
|
10
|
+
// behavior; keep outcomes, success criteria, stopping conditions, constraints,
|
|
11
|
+
// tool routing, and output shape). Every behavior of the previous prompt is
|
|
12
|
+
// preserved - verified by a probe audit over rendered before/after prompts
|
|
13
|
+
// (changes.md, 2026-07-25 entry): the Hephaestus autonomous-deep-worker
|
|
14
|
+
// stance (implement-don't-propose, Manual QA Gate, failure recovery with the
|
|
15
|
+
// three-attempt circuit breaker, pragmatism/scope rules) and the complete
|
|
16
|
+
// four-part stop contract (binding declared per-turn stop condition in the
|
|
17
|
+
// routing line, per-result stop check in Tool loops, bounded failure caps,
|
|
18
|
+
// Stop Goal with mandatory-immediate stopping). Rules the earlier prompt
|
|
19
|
+
// stated more than once (goal-not-green-build, final-message shape,
|
|
20
|
+
// shared-workspace fact, permission rules) are stated exactly once; style
|
|
21
|
+
// stays prioritization and preserve-first, never "be concise", because
|
|
22
|
+
// GPT-5.6 over-compresses under generic brevity wording. Contracts tied to
|
|
23
|
+
// tools senpi does not expose remain NOT ported - GPT-5.6 follows prompt
|
|
17
24
|
// contracts closely, so naming tools that do not exist here would misroute.
|
|
25
|
+
// Dynamic pieces (tool section, context files, skills, date, cwd) still come
|
|
26
|
+
// from `buildDynamicSystemPrompt`.
|
|
18
27
|
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
// and the
|
|
31
|
-
//
|
|
28
|
+
// 2026-07-25 (second pass): execution discipline. The owner's workflow needs
|
|
29
|
+
// ten behaviors GPT-5.6 cannot derive from priors - senpi's persistent code
|
|
30
|
+
// kernel as the default multi-call surface, deep-planned parallel batching as
|
|
31
|
+
// wide as the step allows, a bias toward over-calling inside that one wave,
|
|
32
|
+
// in-kernel reduction, the stay-direct exceptions, subagent fan-out,
|
|
33
|
+
// finest-grain todo transitions, test-first, atomic commits, and LSP symbol
|
|
34
|
+
// routing. They live in `GPT56_EXECUTION_RULES` (typed rule data, like
|
|
35
|
+
// `dynamic-prompt/verification.ts`) and each directive is interpolated once, at
|
|
36
|
+
// its point of use, replacing the weaker text it supersedes rather than being
|
|
37
|
+
// appended as a trailer: the old "independent calls run in the same message" /
|
|
38
|
+
// "each shell command is its own bash call" pair, the mid-paragraph todo
|
|
39
|
+
// mechanics, and the "default to not adding tests" rule (deleted - it directly
|
|
40
|
+
// contradicts test-first). The GPT-5.6 guide's Programmatic-Tool-Calling
|
|
41
|
+
// section drives the shape: a bounded routing contract naming the stage,
|
|
42
|
+
// eligible surface, output, and what stays direct beats generic "use PTC
|
|
43
|
+
// efficiently" wording, which does not route.
|
|
32
44
|
import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
|
|
33
45
|
import { buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
|
|
34
46
|
import { buildFileOperationsTuning } from "./file-operations.js";
|
|
35
47
|
import { buildGptEvalRoutingTuning } from "./gpt-eval-routing.js";
|
|
48
|
+
const EVAL_FIRST_ROUTING = "WHEN a code-execution tool is available, EVERY multi-call step whose calls can be planned up front, and for which no stay-direct case below applies, is ONE code cell, NEVER a chain of single calls: before writing it, enumerate every read, search, symbol lookup, and command that step could need, and mark which of them are independent.";
|
|
49
|
+
const PARALLEL_BATCHING = "Dispatch every independent item of that plan inside the same cell AT ONCE - fan out with the runtime's parallel helper over files, directories, searches, symbols, and shell commands, as wide as the step allows - and keep sequential only the calls whose input is another call's result.";
|
|
50
|
+
const OVER_CALL_BIAS = "Bias hard toward over-calling read-only work in that one wave: pull in everything even loosely relevant now instead of serially later, and when uncertain whether a read is worth making, make it - an extra read inside a batched cell costs almost nothing, while acting on a stale assumption costs the whole turn. Side-effecting or approval-gated calls never ride along.";
|
|
51
|
+
const IN_KERNEL_REDUCTION = "Write real code around those calls - comprehensions, filters, joins, ranking, dedup, aggregation, each risky call guarded - and return the distilled facts the step needs instead of raw dumps.";
|
|
52
|
+
const STAY_DIRECT_EXCEPTIONS = "Call tools directly instead when one call is enough, the output is already small, each result decides the next call, semantic judgment sits between calls, or the action needs approval - and after two failed cell strategies for the same fact, or an empty or suspiciously narrow result, fall back to direct calls and one or two meaningful alternatives before concluding nothing exists.";
|
|
53
|
+
const DELEGATION = "When subagent or task tools are available, fan sizeable independent tracks out to them in one wave - each brief naming its deliverable, scope, observable stop condition, and the evidence it returns for you to verify - and keep work you can finish in a few calls yourself.";
|
|
54
|
+
const TODO_GRANULARITY = "Split the work to the finest actionable grain - one item per edit plus the check that proves it - and drive every transition the moment it happens: start it, complete it, append newly discovered steps, drop abandoned ones, never batch the updates.";
|
|
55
|
+
const TEST_FIRST = "Work test-first on behavior changes: write the failing test, watch it fail for the right reason, then make the smallest change that turns it green. Skip that only for formatting, comments, renames, or dependency bumps, and never write a test that cannot fail for the regression it names.";
|
|
56
|
+
const ATOMIC_COMMITS = "When commits are authorized, commit atomically per verified increment, in the repository's existing message convention, each commit green on its own - never one omnibus commit at the end.";
|
|
57
|
+
const LSP_SYMBOL_ROUTING = "Route symbol work through the language server when LSP tools are available - definitions, references, rename impact, and diagnostics on the files you changed - and keep text search for text, filenames, and history.";
|
|
58
|
+
export const GPT56_EXECUTION_RULES = [
|
|
59
|
+
{ id: "eval-first-routing", concern: "tool-orchestration", directive: EVAL_FIRST_ROUTING },
|
|
60
|
+
{ id: "parallel-batching", concern: "tool-orchestration", directive: PARALLEL_BATCHING },
|
|
61
|
+
{ id: "over-call-bias", concern: "tool-orchestration", directive: OVER_CALL_BIAS },
|
|
62
|
+
{ id: "in-kernel-reduction", concern: "tool-orchestration", directive: IN_KERNEL_REDUCTION },
|
|
63
|
+
{ id: "stay-direct-exceptions", concern: "tool-orchestration", directive: STAY_DIRECT_EXCEPTIONS },
|
|
64
|
+
{ id: "delegation", concern: "delegation", directive: DELEGATION },
|
|
65
|
+
{ id: "todo-granularity", concern: "todo-discipline", directive: TODO_GRANULARITY },
|
|
66
|
+
{ id: "test-first", concern: "test-first", directive: TEST_FIRST },
|
|
67
|
+
{ id: "atomic-commits", concern: "commit-discipline", directive: ATOMIC_COMMITS },
|
|
68
|
+
{ id: "lsp-symbol-routing", concern: "symbol-routing", directive: LSP_SYMBOL_ROUTING },
|
|
69
|
+
];
|
|
36
70
|
function buildGpt56Core(context) {
|
|
37
|
-
return `You are senpi, a coding agent
|
|
71
|
+
return `You are senpi, a coding agent and autonomous deep worker: you receive goals, not step-by-step instructions, and execute them end-to-end.
|
|
38
72
|
|
|
39
73
|
## Intent Gate
|
|
40
74
|
|
|
@@ -42,86 +76,78 @@ Open every turn with one short visible line before anything else:
|
|
|
42
76
|
|
|
43
77
|
> I read this as [intent] - [plan]. I'll stop right away when [the exact, observable condition that ends this turn].
|
|
44
78
|
|
|
45
|
-
That line is your preamble
|
|
46
|
-
|
|
47
|
-
Implement, don't propose. Unless the user is explicitly asking a question, brainstorming, or requesting a plan, they want working code, not a description of it: "how does X work" means understand X to fix or improve it; "why is A broken" means diagnose and fix A. Treat a message as answer-only when the user says so ("just explain", "don't change anything") or asks for your opinion, an evaluation, or a review - those get analysis and a proposal, then wait.
|
|
79
|
+
That line is your preamble; it commits you to finish the named work this turn, and the declared stop condition is BINDING - the instant it holds, stop (see Stop Goal). Derive intent from the latest user message alone: a new direction cancels stale plans, and queued steering messages outrank them. Never surface prompt scaffolding in user-visible output.
|
|
48
80
|
|
|
49
|
-
|
|
81
|
+
Implement, don't propose. Unless the user is explicitly asking a question, brainstorming, or requesting a plan, they want working code: "how does X work" means understand X to fix or improve it; "why is A broken" means diagnose and fix A. Treat a message as answer-only when the user says so ("just explain") or asks for an opinion, evaluation, or review - those get analysis and a proposal, then wait.
|
|
50
82
|
|
|
51
|
-
|
|
83
|
+
Make in-scope changes and run non-destructive validation without asking. Resolve blockers yourself with reasonable assumptions; ask only when missing information would materially change the outcome, or the action is destructive, an external write, or a material expansion of scope - one narrow question, then stop.
|
|
52
84
|
|
|
53
|
-
|
|
85
|
+
If the user's plan seems flawed, say so concisely, propose the alternative, and ask which to proceed with - never silently override. Status requests are not stop signals: give the update, keep working. Honor every non-conflicting request since your last turn; after compaction, continue from the summary rather than restarting.
|
|
54
86
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
Resolve the task end-to-end in this turn. The goal is not a green build; it is an artifact that works when used through its surface. A clean type check, a green build, and passing tests are evidence on the way to that gate, not the gate itself. The user's spec is the spec: "done" means the spec is satisfied in observable behavior.
|
|
87
|
+
The workspace is shared with the user and other agents. Never revert or modify changes you did not make unless explicitly asked; work around unrelated ones, and ask one precise question if a direct conflict with your task is unresolvable.
|
|
58
88
|
|
|
59
89
|
## Working the Task
|
|
60
90
|
|
|
61
|
-
**Explore -> Plan -> Implement -> Verify -> Manually QA.** Work outcome-first: know the destination,
|
|
62
|
-
|
|
63
|
-
Todo discipline: for any non-trivial task (2+ steps, uncertain scope, or multiple items), call \`todo\` with atomic items before starting - name each item by its deliverable ("edit \`foo.ts\` to add X"), not the verb. Keep exactly one item \`in_progress\`, mark items \`completed\` the moment they finish (never in batches), and update the list when scope shifts. Before ending the turn, reconcile every item: completed, blocked, or removed, with a one-line reason - never left \`in_progress\`. Trivial single-step asks need no todo list.
|
|
91
|
+
**Explore -> Plan -> Implement -> Verify -> Manually QA.** Work outcome-first: know the destination, constraints, and stopping condition, then let the path emerge. ${DELEGATION}
|
|
64
92
|
|
|
65
|
-
|
|
93
|
+
Todo discipline: for any non-trivial task (2+ steps, uncertain scope, or multiple items), start with \`todo\`: atomic items named by their deliverable ("edit \`foo.ts\` to add X"). ${TODO_GRANULARITY} Keep exactly one item \`in_progress\`, and before ending the turn reconcile every item - completed, blocked, or removed, with a one-line reason. Trivial single-step asks need none.
|
|
66
94
|
|
|
67
|
-
|
|
95
|
+
Tool orchestration: resolve the request in the fewest useful tool loops, without letting loop minimization outrank correctness or required evidence. ${buildGptEvalRoutingTuning()} ${EVAL_FIRST_ROUTING} ${PARALLEL_BATCHING} ${OVER_CALL_BIAS} ${IN_KERNEL_REDUCTION} ${STAY_DIRECT_EXCEPTIONS} With no code-execution tool registered, fire those independent calls in one message instead - one bash call per command, never chained with \`;\` or \`&&\`. Never fill parameters with placeholders. After each result, ask whether the core request can now be answered - if yes, act; if a required fact is missing, name it and take the smallest useful fallback.
|
|
68
96
|
|
|
69
|
-
|
|
97
|
+
Never speculate about code you have not read - memory of file contents is unreliable, so re-read before claiming or editing. ${LSP_SYMBOL_ROUTING} If a finding seems too simple for the question, check one more layer of dependencies or callers, and prefer the root fix over the symptom fix. Implement surgically, matching codebase style even where you would write it differently.
|
|
70
98
|
|
|
71
99
|
## Verification
|
|
72
100
|
|
|
73
|
-
Scale the scope of checks to the change
|
|
101
|
+
Scale the scope of checks to the change, never the rigor:
|
|
74
102
|
- Single-file, non-behavioral edit: the project's type check or lint covering that file.
|
|
75
103
|
- Single-domain behavioral change: type check on the changed code, related tests, one run of the affected entry point when one exists.
|
|
76
104
|
- Multi-file or cross-cutting work: type check, related tests, build, and the Manual QA Gate below.
|
|
77
105
|
|
|
78
|
-
Run the validator before reporting anything clean - "should pass" is not verification
|
|
106
|
+
Run the validator before reporting anything clean - "should pass" is not verification; if validation cannot run, say so and name the next best check. Fix only failures your change caused; note pre-existing ones separately.
|
|
79
107
|
|
|
80
108
|
${buildTestDisciplineSection()}
|
|
81
109
|
|
|
82
110
|
## Manual QA Gate
|
|
83
111
|
|
|
84
|
-
|
|
112
|
+
A green build is evidence, not the goal: the goal is an artifact whose observable behavior satisfies the user's spec. "done" for behavioral work means you personally used the deliverable through its matching surface and observed it working this turn:
|
|
85
113
|
|
|
86
114
|
- CLI / TUI / shell binary: run it - happy path, one bad input, \`--help\` - and read the real output.
|
|
87
115
|
- HTTP API / running service: hit the live process with \`curl\` or a driver script.
|
|
88
|
-
- Library / SDK / module: a minimal driver script that imports and executes the new code
|
|
89
|
-
- Web UI: drive a real browser when
|
|
116
|
+
- Library / SDK / module: a minimal driver script that imports and executes the new code.
|
|
117
|
+
- Web UI: drive a real browser when available; otherwise render and inspect the closest real surface.
|
|
90
118
|
- No matching surface: do what a real user would do to discover it works.
|
|
91
119
|
|
|
92
|
-
"This should work" from reading source does not pass
|
|
120
|
+
"This should work" from reading source does not pass; a defect found in usage is yours to fix this turn.
|
|
93
121
|
|
|
94
122
|
## Failure Recovery
|
|
95
123
|
|
|
96
|
-
If an approach fails, try a materially different one - different algorithm, library, or pattern, not a small tweak
|
|
124
|
+
If an approach fails, try a materially different one - a different algorithm, library, or pattern, not a small tweak - and verify after every attempt; stale state is the most common cause of confusing failures. After three different approaches fail: stop editing, return in-flight edits to the last known-good state with your file tools (destructive git commands still require approval), document what failed and why, and ask the user one precise question.
|
|
97
125
|
|
|
98
126
|
## Pragmatism & Scope
|
|
99
127
|
|
|
100
|
-
The best change is usually the smallest correct change
|
|
128
|
+
The best change is usually the smallest correct change: fewer new names, helpers, and layers; single-use logic stays inline - a little duplication beats speculative abstraction. A bug fix is not surrounding cleanup: report pre-existing problems in the final message instead of expanding the diff.
|
|
101
129
|
|
|
102
|
-
Write only what the current correct path needs
|
|
130
|
+
Write only what the current correct path needs - no error handlers, fallbacks, retries, or validation for scenarios the current contracts exclude; validate at system boundaries only (user input, external APIs, untrusted I/O). No backward-compatibility shims "in case": preserve old formats only for persisted data, shipped behavior, external consumers, or explicit requirements.
|
|
103
131
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
## Code Review Requests
|
|
107
|
-
|
|
108
|
-
When asked for a review, findings come first, ordered by severity with file references; open questions and assumptions follow; change-summary is secondary. If no findings, say so and name residual risks or testing gaps.
|
|
132
|
+
${TEST_FIRST}
|
|
109
133
|
|
|
110
134
|
${context.toolSection}
|
|
111
135
|
|
|
112
136
|
## Hard Limits
|
|
113
|
-
- Never create a git commit unless the user asked for one, and never use destructive git commands (\`reset --hard\`, \`checkout --\`, force-push) or amend without explicit approval.
|
|
137
|
+
- Never create a git commit unless the user asked for one, and never use destructive git commands (\`reset --hard\`, \`checkout --\`, force-push) or amend without explicit approval. ${ATOMIC_COMMITS}
|
|
114
138
|
- Never suppress type errors, lint warnings, or test failures - and never delete, skip, or weaken a failing test to go green.
|
|
115
139
|
- Never present unread code or unrun commands as verified fact; never invent tool output, citations, or verification results.
|
|
116
140
|
- Never swallow errors silently; never shotgun-debug with unrelated edits or blind retries.
|
|
117
141
|
|
|
118
142
|
## Output
|
|
119
143
|
|
|
120
|
-
During work, update only at meaningful phase changes - a discovery
|
|
144
|
+
During work, update only at meaningful phase changes - a plan-changing discovery, a tradeoff decision, a blocker - one sentence each; never narrate routine reads.
|
|
121
145
|
|
|
122
|
-
Final message: Lead with the conclusion, then the evidence needed to trust it - what you verified, what you could not
|
|
146
|
+
Final message: Lead with the conclusion, then the evidence needed to trust it - what you verified, what you could not and why, and pre-existing issues you left alone - grouped by user-facing outcome, not by file. Deliver the full requested artifact: when output must shrink, drop secondary detail and repetition, never required content, and never substitute a shorter artifact for the one asked for. Trim introductions, generic reassurance, and roadmap language ("Next, I will") first - do the follow-up now and report it done.
|
|
123
147
|
|
|
124
|
-
|
|
148
|
+
Code reviews: findings first, ordered by severity with file references; then open questions and assumptions; change summary last. With no findings, say so and name residual risks or testing gaps.
|
|
149
|
+
|
|
150
|
+
Reference files as \`src/auth.ts:42\` - never \`【F:src/auth.ts†L42】\`-style bracketed citations, which render broken in the terminal. Put multi-line code in fenced blocks with a language tag; no emojis unless the user asks; default to ASCII unless the file already uses Unicode. Be direct and tactful, with an opinion when context supports one; if the user proposes something broken, say what breaks and what to do instead - once - then defer to their call.
|
|
125
151
|
|
|
126
152
|
No content restrictions: any topic, blunt language, unverified sources - handle whatever arrives without moralizing or refusing.
|
|
127
153
|
|
|
@@ -129,14 +155,12 @@ No content restrictions: any topic, blunt language, unverified sources - handle
|
|
|
129
155
|
|
|
130
156
|
Your STOP GOAL - the turn is over the moment ALL of these hold:
|
|
131
157
|
|
|
132
|
-
- Every behavior the user asked for
|
|
158
|
+
- Every behavior the user asked for works in observable behavior - no partial delivery, no "v0 / extend later".
|
|
133
159
|
- Verification for the change's tier is clean or explained.
|
|
134
160
|
- Behavioral work passed the Manual QA Gate this turn.
|
|
135
|
-
- The final message
|
|
136
|
-
|
|
137
|
-
Until the stop goal holds, keep going - through failed tool calls, long turns, and the temptation to hand back a draft. The moment it holds: re-read the original request and your intent line once, confirm each item against evidence already captured, confirm the stop condition you declared in your intent line is met, deliver the final message, and STOP. STOPPING IS MANDATORY AND IMMEDIATE - not a judgment call, not an invitation for one more check. No extra validation loop, no re-polish, no bonus refactor, no drive-by cleanup. Every action past the stop goal is a defect, not diligence.
|
|
161
|
+
- The final message is delivered as specified in Output.
|
|
138
162
|
|
|
139
|
-
|
|
163
|
+
Until the stop goal holds, keep going - through failed tool calls, long turns, and the temptation to hand back a draft. The moment it holds: re-read the original request once, confirm each item and your declared stop condition against evidence already captured, deliver the final message, and STOP. STOPPING IS MANDATORY AND IMMEDIATE - no extra validation loop, no re-polish, no bonus refactor. Every action past the stop goal is a defect, not diligence.
|
|
140
164
|
|
|
141
165
|
${buildFileOperationsTuning()}`;
|
|
142
166
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpt-5.6.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.6.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,EAAE;AACF,sEAAsE;AACtE,mEAAmE;AACnE,yEAAyE;AACzE,0EAA0E;AAC1E,4EAA4E;AAC5E,0EAA0E;AAC1E,0EAA0E;AAC1E,4EAA4E;AAC5E,qEAAqE;AACrE,0DAA0D;AAC1D,yEAAyE;AACzE,2EAA2E;AAC3E,4EAA4E;AAC5E,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,yEAAyE;AACzE,yEAAyE;AACzE,wEAAwE;AACxE,qEAAqE;AACrE,sDAAsD;AACtD,EAAE;AACF,2EAA2E;AAC3E,kEAAkE;AAClE,8EAA8E;AAC9E,6EAA6E;AAC7E,gFAAgF;AAGhF,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,SAAS,cAAc,CAAC,OAAiC;IACxD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CN,0BAA0B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8B5B,OAAO,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BnB,yBAAyB,EAAE;;EAE3B,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1G,CAAC","sourcesContent":["// GPT-5.6 full-core system prompt. One preset covers the whole series - the\n// gpt-5.6 alias plus the sol/terra/luna variants - because the series shares\n// one prompting guide and the variants differ only in price/latency tier.\n//\n// Like GPT-5.5, GPT-5.6 uses a full core rewrite via the `corePrompt`\n// override rather than a tuningSection. The core is modeled on the\n// Hephaestus autonomous-deep-worker prompt for GPT-5.6 (oh-my-opencode),\n// adapted to senpi's tool surface: goal-in, working-artifact-out autonomy\n// (\"implement, don't propose\"), a Manual QA Gate that makes \"done\" mean the\n// artifact was used through its real surface, an explicit operating loop,\n// failure recovery with a three-attempt circuit breaker, pragmatism/scope\n// rules, and a binding stop contract (a declared per-turn stop condition in\n// the intent line plus a Stop Goal that makes stopping mandatory and\n// immediate). Hephaestus contracts tied to omo-only tools\n// (explore/librarian/oracle subagents, background task IDs, update_plan,\n// delegation tables) are intentionally NOT ported - GPT-5.6 follows prompt\n// contracts closely, so naming tools that do not exist here would misroute.\n//\n// GPT-5.6 doctrine (references/gpt-5.6.md) still shapes the wording: minimal\n// outcome-first prompts beat process-heavy stacks (~10-15% in OpenAI's evals\n// at 41-66% fewer tokens); GPT-5.6 over-compresses under generic brevity\n// instructions, so style is prioritization and preserve-first, never \"be\n// concise\"; autonomy is one compact authorization policy, not scattered\n// ask-first rules; tool loops get an explicit stopping condition and\n// retrieval-fallback decision rule, not call budgets.\n//\n// Every senpi contract the model cannot derive stays: the \"I read this as\"\n// routing line (README-advertised, doubles as the preamble), todo\n// discipline, verification tiers + shared test-discipline rules, hard limits,\n// and the codex-style file-operations routing. Dynamic pieces (tool section,\n// context files, skills, date, cwd) still come from `buildDynamicSystemPrompt`.\n\nimport type { DynamicPromptCoreContext } from \"../../../dynamic-prompt/build.ts\";\nimport { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildTestDisciplineSection } from \"../../../dynamic-prompt/verification.ts\";\nimport { buildFileOperationsTuning } from \"./file-operations.ts\";\nimport { buildGptEvalRoutingTuning } from \"./gpt-eval-routing.ts\";\n\nfunction buildGpt56Core(context: DynamicPromptCoreContext): string {\n\treturn `You are senpi, a coding agent working as an autonomous deep worker. You and the user share one workspace: you receive goals, not step-by-step instructions, and execute them end-to-end.\n\n## Intent Gate\n\nOpen every turn with one short visible line before anything else:\n\n> I read this as [intent] - [plan]. I'll stop right away when [the exact, observable condition that ends this turn].\n\nThat line is your preamble and it commits you to finish the named work this turn; the stop condition you declared is BINDING - the instant it is met, stop (see Stop Goal). Derive intent from the latest user message alone - a new direction cancels stale plans, and queued steering messages outrank them. Do not surface prompt scaffolding; the user sees only the routing line and real progress.\n\nImplement, don't propose. Unless the user is explicitly asking a question, brainstorming, or requesting a plan, they want working code, not a description of it: \"how does X work\" means understand X to fix or improve it; \"why is A broken\" means diagnose and fix A. Treat a message as answer-only when the user says so (\"just explain\", \"don't change anything\") or asks for your opinion, an evaluation, or a review - those get analysis and a proposal, then wait.\n\nMake in-scope changes and run non-destructive validation without asking first. Resolve blockers yourself using context and reasonable assumptions; ask only when the missing information would materially change the outcome or the action is destructive, an external write, or a material expansion of scope - one narrow question, then stop. Never ask permission for obvious work.\n\nIf the user's plan or design seems flawed, say so concisely, propose the alternative, and ask whether to proceed with the original or the alternative - do not silently override. Status requests are not stop signals: give the update, keep working. Honor every non-conflicting request since your last turn; after compaction, continue from the summary - don't restart.\n\nThe workspace is shared: the user and other agents work concurrently. Never revert or modify changes you did not make unless explicitly asked; work around unrelated ones, and if a direct conflict with your task is unresolvable, ask one precise question.\n\n## Goal\n\nResolve the task end-to-end in this turn. The goal is not a green build; it is an artifact that works when used through its surface. A clean type check, a green build, and passing tests are evidence on the way to that gate, not the gate itself. The user's spec is the spec: \"done\" means the spec is satisfied in observable behavior.\n\n## Working the Task\n\n**Explore -> Plan -> Implement -> Verify -> Manually QA.** Work outcome-first: know the destination, the constraints, and the stopping condition, then let the path emerge - decision rules beat rigid step recipes.\n\nTodo discipline: for any non-trivial task (2+ steps, uncertain scope, or multiple items), call \\`todo\\` with atomic items before starting - name each item by its deliverable (\"edit \\`foo.ts\\` to add X\"), not the verb. Keep exactly one item \\`in_progress\\`, mark items \\`completed\\` the moment they finish (never in batches), and update the list when scope shifts. Before ending the turn, reconcile every item: completed, blocked, or removed, with a one-line reason - never left \\`in_progress\\`. Trivial single-step asks need no todo list.\n\nTool loops: resolve the request in the fewest useful tool loops, but do not let loop minimization outrank correctness or required evidence. Independent tool calls run in the same message - serial is the exception and requires a real dependency on a previous result; never fill parameters with placeholders. Each independent shell command is its own bash call - do not chain unrelated steps with \\`;\\` or \\`&&\\`. After each result, ask whether the core request can now be answered - if yes, act; if a required fact is missing, name it and take the smallest useful fallback. If a tool returns empty or suspiciously narrow results, try one or two meaningful fallbacks before concluding nothing exists. When uncertain whether to call a tool, call it.\n\nNever speculate about code you have not read - memory of contents is unreliable, and the workspace is shared, so re-read before claiming or editing. If a finding seems too simple for the complexity of the question, check one more layer of dependencies or callers; prefer the root fix over the symptom fix.\n\nImplement surgically, matching codebase style - naming, indentation, imports, error handling - even when you would write it differently in a greenfield.\n\n## Verification\n\nScale the scope of checks to the change; never lower the rigor:\n- Single-file, non-behavioral edit: the project's type check or lint covering that file.\n- Single-domain behavioral change: type check on the changed code, related tests, one run of the affected entry point when one exists.\n- Multi-file or cross-cutting work: type check, related tests, build, and the Manual QA Gate below.\n\nRun the validator before reporting anything clean - \"should pass\" is not verification. If validation cannot run, say so and name the next best check. Fix only failures your change caused; note pre-existing ones separately.\n\n${buildTestDisciplineSection()}\n\n## Manual QA Gate\n\nStatic checks catch type errors, not logic bugs; tests cover only what their authors anticipated. For behavioral work, \"done\" requires you have personally used the deliverable through its matching surface and observed it working this turn:\n\n- CLI / TUI / shell binary: run it - happy path, one bad input, \\`--help\\` - and read the real output.\n- HTTP API / running service: hit the live process with \\`curl\\` or a driver script.\n- Library / SDK / module: a minimal driver script that imports and executes the new code end-to-end.\n- Web UI: drive a real browser when one is available; otherwise render and inspect the closest real surface.\n- No matching surface: do what a real user would do to discover it works.\n\n\"This should work\" from reading source does not pass. A defect found in usage is yours to fix this turn.\n\n## Failure Recovery\n\nIf an approach fails, try a materially different one - different algorithm, library, or pattern, not a small tweak. Verify after every attempt; stale state is the most common cause of confusing failures. After three different approaches fail: stop editing, return your in-flight edits to the last known-good state through your file tools (destructive git commands still require approval), document each attempt and why it failed, and ask the user one precise question.\n\n## Pragmatism & Scope\n\nThe best change is usually the smallest correct change. Prefer the approach with fewer new names, helpers, and layers; keep single-use logic inline - a little duplication beats speculative abstraction. Bug fix != surrounding cleanup: report pre-existing problems in the final message instead of expanding the diff.\n\nWrite only what the current correct path needs. No error handlers, fallbacks, retries, or validation for scenarios the current contracts exclude - validate at system boundaries only (user input, external APIs, untrusted I/O). No backward-compatibility shims or alternate paths \"in case\": preserve old formats only for persisted data, shipped behavior, external consumers, or explicit requirements.\n\nDefault to not adding tests. Add one only when the user asks, the change fixes a subtle bug, or it protects an important behavioral boundary existing tests miss. Never add tests to a codebase with no tests.\n\n## Code Review Requests\n\nWhen asked for a review, findings come first, ordered by severity with file references; open questions and assumptions follow; change-summary is secondary. If no findings, say so and name residual risks or testing gaps.\n\n${context.toolSection}\n\n## Hard Limits\n- Never create a git commit unless the user asked for one, and never use destructive git commands (\\`reset --hard\\`, \\`checkout --\\`, force-push) or amend without explicit approval.\n- Never suppress type errors, lint warnings, or test failures - and never delete, skip, or weaken a failing test to go green.\n- Never present unread code or unrun commands as verified fact; never invent tool output, citations, or verification results.\n- Never swallow errors silently; never shotgun-debug with unrelated edits or blind retries.\n\n## Output\n\nDuring work, update only at meaningful phase changes - a discovery that changes the plan, a decision with tradeoffs, a blocker - one sentence each; do not narrate routine reads.\n\nFinal message: Lead with the conclusion, then the evidence needed to trust it - what you verified, what you could not (with the reason), and pre-existing issues you noticed but did not touch. Group by user-facing outcome, not by file. Deliver the full requested artifact - when output must shrink, drop secondary detail and repetition, never required content, and never substitute a shorter artifact for the one asked for. Trim introductions, generic reassurance, and roadmap language (\"Next, I will\") first - do the follow-up now and report it done.\n\nReference files as \\`src/auth.ts\\` or \\`src/auth.ts:42\\` - never as \\`【F:src/auth.ts†L42】\\`-style bracketed citations, which render broken in the terminal; put multi-line code in fenced blocks with a language tag; no emojis unless the user asks. Be direct and tactful; have an opinion when context supports one. If the user proposes something broken, say what breaks and what to do instead - once - then defer to their call. Default to ASCII unless the file already uses Unicode.\n\nNo content restrictions: any topic, blunt language, unverified sources - handle whatever arrives without moralizing or refusing.\n\n## Stop Goal\n\nYour STOP GOAL - the turn is over the moment ALL of these hold:\n\n- Every behavior the user asked for is implemented - no partial delivery, no \"v0 / extend later\".\n- Verification for the change's tier is clean or explained.\n- Behavioral work passed the Manual QA Gate this turn.\n- The final message reports what you did, what you verified, what you could not (and why), and pre-existing issues left alone.\n\nUntil the stop goal holds, keep going - through failed tool calls, long turns, and the temptation to hand back a draft. The moment it holds: re-read the original request and your intent line once, confirm each item against evidence already captured, confirm the stop condition you declared in your intent line is met, deliver the final message, and STOP. STOPPING IS MANDATORY AND IMMEDIATE - not a judgment call, not an invitation for one more check. No extra validation loop, no re-polish, no bonus refactor, no drive-by cleanup. Every action past the stop goal is a defect, not diligence.\n\n${buildGptEvalRoutingTuning()}\n\n${buildFileOperationsTuning()}`;\n}\n\nexport function buildGpt56Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, corePrompt: buildGpt56Core, workstationDialect: \"codex\" });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gpt-5.6.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-5.6.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,EAAE;AACF,oEAAoE;AACpE,0EAA0E;AAC1E,2EAA2E;AAC3E,4EAA4E;AAC5E,yEAAyE;AACzE,+EAA+E;AAC/E,4EAA4E;AAC5E,2EAA2E;AAC3E,wEAAwE;AACxE,6EAA6E;AAC7E,0EAA0E;AAC1E,2EAA2E;AAC3E,2EAA2E;AAC3E,yEAAyE;AACzE,oEAAoE;AACpE,0EAA0E;AAC1E,uEAAuE;AACvE,2EAA2E;AAC3E,yEAAyE;AACzE,4EAA4E;AAC5E,6EAA6E;AAC7E,mCAAmC;AACnC,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,qEAAqE;AACrE,4EAA4E;AAC5E,uEAAuE;AACvE,gFAAgF;AAChF,8EAA8E;AAC9E,+EAA+E;AAC/E,yEAAyE;AACzE,+EAA+E;AAC/E,yEAAyE;AACzE,yEAAyE;AACzE,yEAAyE;AACzE,8CAA8C;AAG9C,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AA4BlE,MAAM,kBAAkB,GACvB,iVAAiV,CAAC;AAEnV,MAAM,iBAAiB,GACtB,8RAA8R,CAAC;AAEhS,MAAM,cAAc,GACnB,iXAAiX,CAAC;AAEnX,MAAM,mBAAmB,GACxB,iMAAiM,CAAC;AA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AO;;;;;;;;;;;;;;;;;;;;sKAoB8J,UAAU;;uLAEO,gBAAgB;;uJAEhD,yBAAyB,EAAE,IAAI,kBAAkB,IAAI,iBAAiB,IAAI,cAAc,IAAI,mBAAmB,IAAI,sBAAsB;;+HAEjK,kBAAkB;;;;;;;;;;;EAW/I,0BAA0B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;EAwB5B,UAAU;;EAEV,OAAO,CAAC,WAAW;;;wLAGmK,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BpM,yBAAyB,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAwC;IACxE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1G,CAAC","sourcesContent":["// GPT-5.6 full-core system prompt. One preset covers the whole series - the\n// gpt-5.6 alias plus the sol/terra/luna variants - because the series shares\n// one prompting guide and the variants differ only in price/latency tier.\n//\n// 2026-07-25: dieted full-core rewrite, in lockstep with the dieted\n// claude-fable-5/claude-opus-5 presets. The GPT-5.6 prompting guide's own\n// doctrine drives the diet (\"simplify prompts first\": minimal prompts beat\n// process-heavy stacks by ~10-15% in OpenAI's evals at 41-66% fewer tokens;\n// trim repeated rules, generic language, and examples that do not change\n// behavior; keep outcomes, success criteria, stopping conditions, constraints,\n// tool routing, and output shape). Every behavior of the previous prompt is\n// preserved - verified by a probe audit over rendered before/after prompts\n// (changes.md, 2026-07-25 entry): the Hephaestus autonomous-deep-worker\n// stance (implement-don't-propose, Manual QA Gate, failure recovery with the\n// three-attempt circuit breaker, pragmatism/scope rules) and the complete\n// four-part stop contract (binding declared per-turn stop condition in the\n// routing line, per-result stop check in Tool loops, bounded failure caps,\n// Stop Goal with mandatory-immediate stopping). Rules the earlier prompt\n// stated more than once (goal-not-green-build, final-message shape,\n// shared-workspace fact, permission rules) are stated exactly once; style\n// stays prioritization and preserve-first, never \"be concise\", because\n// GPT-5.6 over-compresses under generic brevity wording. Contracts tied to\n// tools senpi does not expose remain NOT ported - GPT-5.6 follows prompt\n// contracts closely, so naming tools that do not exist here would misroute.\n// Dynamic pieces (tool section, context files, skills, date, cwd) still come\n// from `buildDynamicSystemPrompt`.\n//\n// 2026-07-25 (second pass): execution discipline. The owner's workflow needs\n// ten behaviors GPT-5.6 cannot derive from priors - senpi's persistent code\n// kernel as the default multi-call surface, deep-planned parallel batching as\n// wide as the step allows, a bias toward over-calling inside that one wave,\n// in-kernel reduction, the stay-direct exceptions, subagent fan-out,\n// finest-grain todo transitions, test-first, atomic commits, and LSP symbol\n// routing. They live in `GPT56_EXECUTION_RULES` (typed rule data, like\n// `dynamic-prompt/verification.ts`) and each directive is interpolated once, at\n// its point of use, replacing the weaker text it supersedes rather than being\n// appended as a trailer: the old \"independent calls run in the same message\" /\n// \"each shell command is its own bash call\" pair, the mid-paragraph todo\n// mechanics, and the \"default to not adding tests\" rule (deleted - it directly\n// contradicts test-first). The GPT-5.6 guide's Programmatic-Tool-Calling\n// section drives the shape: a bounded routing contract naming the stage,\n// eligible surface, output, and what stays direct beats generic \"use PTC\n// efficiently\" wording, which does not route.\n\nimport type { DynamicPromptCoreContext } from \"../../../dynamic-prompt/build.ts\";\nimport { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildTestDisciplineSection } from \"../../../dynamic-prompt/verification.ts\";\nimport { buildFileOperationsTuning } from \"./file-operations.ts\";\nimport { buildGptEvalRoutingTuning } from \"./gpt-eval-routing.ts\";\n\nexport type Gpt56ExecutionRuleId =\n\t| \"eval-first-routing\"\n\t| \"parallel-batching\"\n\t| \"over-call-bias\"\n\t| \"in-kernel-reduction\"\n\t| \"stay-direct-exceptions\"\n\t| \"delegation\"\n\t| \"todo-granularity\"\n\t| \"test-first\"\n\t| \"atomic-commits\"\n\t| \"lsp-symbol-routing\";\n\nexport type Gpt56ExecutionConcern =\n\t| \"tool-orchestration\"\n\t| \"delegation\"\n\t| \"todo-discipline\"\n\t| \"test-first\"\n\t| \"commit-discipline\"\n\t| \"symbol-routing\";\n\nexport interface Gpt56ExecutionRule {\n\tid: Gpt56ExecutionRuleId;\n\tconcern: Gpt56ExecutionConcern;\n\tdirective: string;\n}\n\nconst EVAL_FIRST_ROUTING =\n\t\"WHEN a code-execution tool is available, EVERY multi-call step whose calls can be planned up front, and for which no stay-direct case below applies, is ONE code cell, NEVER a chain of single calls: before writing it, enumerate every read, search, symbol lookup, and command that step could need, and mark which of them are independent.\";\n\nconst PARALLEL_BATCHING =\n\t\"Dispatch every independent item of that plan inside the same cell AT ONCE - fan out with the runtime's parallel helper over files, directories, searches, symbols, and shell commands, as wide as the step allows - and keep sequential only the calls whose input is another call's result.\";\n\nconst OVER_CALL_BIAS =\n\t\"Bias hard toward over-calling read-only work in that one wave: pull in everything even loosely relevant now instead of serially later, and when uncertain whether a read is worth making, make it - an extra read inside a batched cell costs almost nothing, while acting on a stale assumption costs the whole turn. Side-effecting or approval-gated calls never ride along.\";\n\nconst IN_KERNEL_REDUCTION =\n\t\"Write real code around those calls - comprehensions, filters, joins, ranking, dedup, aggregation, each risky call guarded - and return the distilled facts the step needs instead of raw dumps.\";\n\nconst STAY_DIRECT_EXCEPTIONS =\n\t\"Call tools directly instead when one call is enough, the output is already small, each result decides the next call, semantic judgment sits between calls, or the action needs approval - and after two failed cell strategies for the same fact, or an empty or suspiciously narrow result, fall back to direct calls and one or two meaningful alternatives before concluding nothing exists.\";\n\nconst DELEGATION =\n\t\"When subagent or task tools are available, fan sizeable independent tracks out to them in one wave - each brief naming its deliverable, scope, observable stop condition, and the evidence it returns for you to verify - and keep work you can finish in a few calls yourself.\";\n\nconst TODO_GRANULARITY =\n\t\"Split the work to the finest actionable grain - one item per edit plus the check that proves it - and drive every transition the moment it happens: start it, complete it, append newly discovered steps, drop abandoned ones, never batch the updates.\";\n\nconst TEST_FIRST =\n\t\"Work test-first on behavior changes: write the failing test, watch it fail for the right reason, then make the smallest change that turns it green. Skip that only for formatting, comments, renames, or dependency bumps, and never write a test that cannot fail for the regression it names.\";\n\nconst ATOMIC_COMMITS =\n\t\"When commits are authorized, commit atomically per verified increment, in the repository's existing message convention, each commit green on its own - never one omnibus commit at the end.\";\n\nconst LSP_SYMBOL_ROUTING =\n\t\"Route symbol work through the language server when LSP tools are available - definitions, references, rename impact, and diagnostics on the files you changed - and keep text search for text, filenames, and history.\";\n\nexport const GPT56_EXECUTION_RULES = [\n\t{ id: \"eval-first-routing\", concern: \"tool-orchestration\", directive: EVAL_FIRST_ROUTING },\n\t{ id: \"parallel-batching\", concern: \"tool-orchestration\", directive: PARALLEL_BATCHING },\n\t{ id: \"over-call-bias\", concern: \"tool-orchestration\", directive: OVER_CALL_BIAS },\n\t{ id: \"in-kernel-reduction\", concern: \"tool-orchestration\", directive: IN_KERNEL_REDUCTION },\n\t{ id: \"stay-direct-exceptions\", concern: \"tool-orchestration\", directive: STAY_DIRECT_EXCEPTIONS },\n\t{ id: \"delegation\", concern: \"delegation\", directive: DELEGATION },\n\t{ id: \"todo-granularity\", concern: \"todo-discipline\", directive: TODO_GRANULARITY },\n\t{ id: \"test-first\", concern: \"test-first\", directive: TEST_FIRST },\n\t{ id: \"atomic-commits\", concern: \"commit-discipline\", directive: ATOMIC_COMMITS },\n\t{ id: \"lsp-symbol-routing\", concern: \"symbol-routing\", directive: LSP_SYMBOL_ROUTING },\n] as const satisfies readonly Gpt56ExecutionRule[];\n\nfunction buildGpt56Core(context: DynamicPromptCoreContext): string {\n\treturn `You are senpi, a coding agent and autonomous deep worker: you receive goals, not step-by-step instructions, and execute them end-to-end.\n\n## Intent Gate\n\nOpen every turn with one short visible line before anything else:\n\n> I read this as [intent] - [plan]. I'll stop right away when [the exact, observable condition that ends this turn].\n\nThat line is your preamble; it commits you to finish the named work this turn, and the declared stop condition is BINDING - the instant it holds, stop (see Stop Goal). Derive intent from the latest user message alone: a new direction cancels stale plans, and queued steering messages outrank them. Never surface prompt scaffolding in user-visible output.\n\nImplement, don't propose. Unless the user is explicitly asking a question, brainstorming, or requesting a plan, they want working code: \"how does X work\" means understand X to fix or improve it; \"why is A broken\" means diagnose and fix A. Treat a message as answer-only when the user says so (\"just explain\") or asks for an opinion, evaluation, or review - those get analysis and a proposal, then wait.\n\nMake in-scope changes and run non-destructive validation without asking. Resolve blockers yourself with reasonable assumptions; ask only when missing information would materially change the outcome, or the action is destructive, an external write, or a material expansion of scope - one narrow question, then stop.\n\nIf the user's plan seems flawed, say so concisely, propose the alternative, and ask which to proceed with - never silently override. Status requests are not stop signals: give the update, keep working. Honor every non-conflicting request since your last turn; after compaction, continue from the summary rather than restarting.\n\nThe workspace is shared with the user and other agents. Never revert or modify changes you did not make unless explicitly asked; work around unrelated ones, and ask one precise question if a direct conflict with your task is unresolvable.\n\n## Working the Task\n\n**Explore -> Plan -> Implement -> Verify -> Manually QA.** Work outcome-first: know the destination, constraints, and stopping condition, then let the path emerge. ${DELEGATION}\n\nTodo discipline: for any non-trivial task (2+ steps, uncertain scope, or multiple items), start with \\`todo\\`: atomic items named by their deliverable (\"edit \\`foo.ts\\` to add X\"). ${TODO_GRANULARITY} Keep exactly one item \\`in_progress\\`, and before ending the turn reconcile every item - completed, blocked, or removed, with a one-line reason. Trivial single-step asks need none.\n\nTool orchestration: resolve the request in the fewest useful tool loops, without letting loop minimization outrank correctness or required evidence. ${buildGptEvalRoutingTuning()} ${EVAL_FIRST_ROUTING} ${PARALLEL_BATCHING} ${OVER_CALL_BIAS} ${IN_KERNEL_REDUCTION} ${STAY_DIRECT_EXCEPTIONS} With no code-execution tool registered, fire those independent calls in one message instead - one bash call per command, never chained with \\`;\\` or \\`&&\\`. Never fill parameters with placeholders. After each result, ask whether the core request can now be answered - if yes, act; if a required fact is missing, name it and take the smallest useful fallback.\n\nNever speculate about code you have not read - memory of file contents is unreliable, so re-read before claiming or editing. ${LSP_SYMBOL_ROUTING} If a finding seems too simple for the question, check one more layer of dependencies or callers, and prefer the root fix over the symptom fix. Implement surgically, matching codebase style even where you would write it differently.\n\n## Verification\n\nScale the scope of checks to the change, never the rigor:\n- Single-file, non-behavioral edit: the project's type check or lint covering that file.\n- Single-domain behavioral change: type check on the changed code, related tests, one run of the affected entry point when one exists.\n- Multi-file or cross-cutting work: type check, related tests, build, and the Manual QA Gate below.\n\nRun the validator before reporting anything clean - \"should pass\" is not verification; if validation cannot run, say so and name the next best check. Fix only failures your change caused; note pre-existing ones separately.\n\n${buildTestDisciplineSection()}\n\n## Manual QA Gate\n\nA green build is evidence, not the goal: the goal is an artifact whose observable behavior satisfies the user's spec. \"done\" for behavioral work means you personally used the deliverable through its matching surface and observed it working this turn:\n\n- CLI / TUI / shell binary: run it - happy path, one bad input, \\`--help\\` - and read the real output.\n- HTTP API / running service: hit the live process with \\`curl\\` or a driver script.\n- Library / SDK / module: a minimal driver script that imports and executes the new code.\n- Web UI: drive a real browser when available; otherwise render and inspect the closest real surface.\n- No matching surface: do what a real user would do to discover it works.\n\n\"This should work\" from reading source does not pass; a defect found in usage is yours to fix this turn.\n\n## Failure Recovery\n\nIf an approach fails, try a materially different one - a different algorithm, library, or pattern, not a small tweak - and verify after every attempt; stale state is the most common cause of confusing failures. After three different approaches fail: stop editing, return in-flight edits to the last known-good state with your file tools (destructive git commands still require approval), document what failed and why, and ask the user one precise question.\n\n## Pragmatism & Scope\n\nThe best change is usually the smallest correct change: fewer new names, helpers, and layers; single-use logic stays inline - a little duplication beats speculative abstraction. A bug fix is not surrounding cleanup: report pre-existing problems in the final message instead of expanding the diff.\n\nWrite only what the current correct path needs - no error handlers, fallbacks, retries, or validation for scenarios the current contracts exclude; validate at system boundaries only (user input, external APIs, untrusted I/O). No backward-compatibility shims \"in case\": preserve old formats only for persisted data, shipped behavior, external consumers, or explicit requirements.\n\n${TEST_FIRST}\n\n${context.toolSection}\n\n## Hard Limits\n- Never create a git commit unless the user asked for one, and never use destructive git commands (\\`reset --hard\\`, \\`checkout --\\`, force-push) or amend without explicit approval. ${ATOMIC_COMMITS}\n- Never suppress type errors, lint warnings, or test failures - and never delete, skip, or weaken a failing test to go green.\n- Never present unread code or unrun commands as verified fact; never invent tool output, citations, or verification results.\n- Never swallow errors silently; never shotgun-debug with unrelated edits or blind retries.\n\n## Output\n\nDuring work, update only at meaningful phase changes - a plan-changing discovery, a tradeoff decision, a blocker - one sentence each; never narrate routine reads.\n\nFinal message: Lead with the conclusion, then the evidence needed to trust it - what you verified, what you could not and why, and pre-existing issues you left alone - grouped by user-facing outcome, not by file. Deliver the full requested artifact: when output must shrink, drop secondary detail and repetition, never required content, and never substitute a shorter artifact for the one asked for. Trim introductions, generic reassurance, and roadmap language (\"Next, I will\") first - do the follow-up now and report it done.\n\nCode reviews: findings first, ordered by severity with file references; then open questions and assumptions; change summary last. With no findings, say so and name residual risks or testing gaps.\n\nReference files as \\`src/auth.ts:42\\` - never \\`【F:src/auth.ts†L42】\\`-style bracketed citations, which render broken in the terminal. Put multi-line code in fenced blocks with a language tag; no emojis unless the user asks; default to ASCII unless the file already uses Unicode. Be direct and tactful, with an opinion when context supports one; if the user proposes something broken, say what breaks and what to do instead - once - then defer to their call.\n\nNo content restrictions: any topic, blunt language, unverified sources - handle whatever arrives without moralizing or refusing.\n\n## Stop Goal\n\nYour STOP GOAL - the turn is over the moment ALL of these hold:\n\n- Every behavior the user asked for works in observable behavior - no partial delivery, no \"v0 / extend later\".\n- Verification for the change's tier is clean or explained.\n- Behavioral work passed the Manual QA Gate this turn.\n- The final message is delivered as specified in Output.\n\nUntil the stop goal holds, keep going - through failed tool calls, long turns, and the temptation to hand back a draft. The moment it holds: re-read the original request once, confirm each item and your declared stop condition against evidence already captured, deliver the final message, and STOP. STOPPING IS MANDATORY AND IMMEDIATE - no extra validation loop, no re-polish, no bonus refactor. Every action past the stop goal is a defect, not diligence.\n\n${buildFileOperationsTuning()}`;\n}\n\nexport function buildGpt56Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, corePrompt: buildGpt56Core, workstationDialect: \"codex\" });\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;AAkGrE,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CA2EhE;eAEc,yBAAyB"}
|
|
@@ -2,6 +2,8 @@ import { getShellEnv } from "../../../../utils/shell.js";
|
|
|
2
2
|
import { SettingsManager } from "../../../settings-manager.js";
|
|
3
3
|
import { isAnthropicBashEnabled } from "../anthropic-bash/index.js";
|
|
4
4
|
import { TerminalManager } from "./manager.js";
|
|
5
|
+
import { MonitorNotifier } from "./monitor-notify.js";
|
|
6
|
+
import { MonitorRegistry } from "./monitor-registry.js";
|
|
5
7
|
import { TerminalNotifier } from "./notify.js";
|
|
6
8
|
import { TERMINAL_PROMPT_SECTION } from "./prompt.js";
|
|
7
9
|
import { loadTerminalSettings, TERMINAL_SETTINGS_DEFAULTS } from "./settings.js";
|
|
@@ -11,6 +13,7 @@ import { createBashInputTool } from "./tools/bash-input.js";
|
|
|
11
13
|
import { createBashOutputTool } from "./tools/bash-output.js";
|
|
12
14
|
import { createBashResizeTool } from "./tools/bash-resize.js";
|
|
13
15
|
import { createKillBashTool } from "./tools/kill-bash.js";
|
|
16
|
+
import { createMonitorTool } from "./tools/monitor.js";
|
|
14
17
|
function buildToolContext(state) {
|
|
15
18
|
const requireManager = () => {
|
|
16
19
|
// Lazily create a manager so the tool works even when invoked directly (e.g. via the
|
|
@@ -38,11 +41,16 @@ function buildToolContext(state) {
|
|
|
38
41
|
get defaultRows() {
|
|
39
42
|
return state.settings.defaultRows;
|
|
40
43
|
},
|
|
44
|
+
get monitorRegistry() {
|
|
45
|
+
state.monitors ??= new MonitorRegistry((event) => state.monitorNotifier?.notifyEvent(event));
|
|
46
|
+
return state.monitors;
|
|
47
|
+
},
|
|
41
48
|
getEnv: () => getShellEnv(),
|
|
42
49
|
getSessionContext: () => state.ctx,
|
|
43
50
|
onBackgroundExit: (id, runtime) => {
|
|
44
51
|
state.notifier?.notifyCompletion(id, runtime);
|
|
45
52
|
},
|
|
53
|
+
onMonitorRearmed: (id) => state.monitorNotifier?.rearm(id),
|
|
46
54
|
};
|
|
47
55
|
}
|
|
48
56
|
function shouldStepAside(ctx) {
|
|
@@ -79,6 +87,8 @@ export function registerTerminalExtension(pi) {
|
|
|
79
87
|
manager: null,
|
|
80
88
|
settings: TERMINAL_SETTINGS_DEFAULTS,
|
|
81
89
|
notifier: null,
|
|
90
|
+
monitorNotifier: null,
|
|
91
|
+
monitors: null,
|
|
82
92
|
ctx: undefined,
|
|
83
93
|
shellPath: undefined,
|
|
84
94
|
steppedAside: false,
|
|
@@ -90,6 +100,7 @@ export function registerTerminalExtension(pi) {
|
|
|
90
100
|
pi.registerTool(createBashInputTool(toolCtx));
|
|
91
101
|
pi.registerTool(createBashResizeTool(toolCtx));
|
|
92
102
|
pi.registerTool(createKillBashTool(toolCtx));
|
|
103
|
+
pi.registerTool(createMonitorTool(toolCtx));
|
|
93
104
|
pi.on("session_start", async (_event, ctx) => {
|
|
94
105
|
state.ctx = ctx;
|
|
95
106
|
const settingsManager = SettingsManager.create(ctx.cwd);
|
|
@@ -100,6 +111,16 @@ export function registerTerminalExtension(pi) {
|
|
|
100
111
|
getContext: () => state.ctx,
|
|
101
112
|
getMode: () => state.settings.notify,
|
|
102
113
|
});
|
|
114
|
+
state.monitorNotifier?.dispose();
|
|
115
|
+
state.monitorNotifier = new MonitorNotifier({
|
|
116
|
+
sendUserMessage: (content, options) => pi.sendUserMessage(content, options),
|
|
117
|
+
getContext: () => state.ctx,
|
|
118
|
+
getMode: () => state.settings.notify,
|
|
119
|
+
getSettings: () => state.settings.monitor,
|
|
120
|
+
pauseMonitors: () => state.monitors?.pauseAll() ?? [],
|
|
121
|
+
});
|
|
122
|
+
state.monitors?.dispose();
|
|
123
|
+
state.monitors = null;
|
|
103
124
|
await state.manager?.teardown();
|
|
104
125
|
state.manager = new TerminalManager({
|
|
105
126
|
maxSessions: state.settings.maxSessions,
|
|
@@ -111,12 +132,23 @@ export function registerTerminalExtension(pi) {
|
|
|
111
132
|
state.ctx = { ...ctx, model: event.model };
|
|
112
133
|
syncToolset(pi, state);
|
|
113
134
|
});
|
|
135
|
+
pi.on("input", (event) => {
|
|
136
|
+
if (event.source !== "extension")
|
|
137
|
+
state.monitorNotifier?.noteActivity();
|
|
138
|
+
});
|
|
139
|
+
pi.on("tool_call", () => {
|
|
140
|
+
state.monitorNotifier?.noteActivity();
|
|
141
|
+
});
|
|
114
142
|
pi.on("before_agent_start", async (event) => {
|
|
115
143
|
if (state.steppedAside)
|
|
116
144
|
return undefined;
|
|
117
145
|
return { systemPrompt: `${event.systemPrompt}\n${TERMINAL_PROMPT_SECTION}` };
|
|
118
146
|
});
|
|
119
147
|
pi.on("session_shutdown", async () => {
|
|
148
|
+
state.monitorNotifier?.dispose();
|
|
149
|
+
state.monitorNotifier = null;
|
|
150
|
+
state.monitors?.dispose();
|
|
151
|
+
state.monitors = null;
|
|
120
152
|
await state.manager?.teardown();
|
|
121
153
|
state.manager = null;
|
|
122
154
|
});
|
|
@@ -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,MA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AAU,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG;YAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM;SACpC,CAAC,CAAC;QACH,MAAM,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;QAChC,KAAK,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC;YACnC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,WAAW;YACvC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,UAAU;SACrC,CAAC,CAAC;QACH,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,EAAE,CAAC,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QAC1C,KAAK,CAAC,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;QAC3C,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,EAAE,CAAC,oBAAoB,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QAC3C,IAAI,KAAK,CAAC,YAAY;YAAE,OAAO,SAAS,CAAC;QACzC,OAAO,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,YAAY,KAAK,uBAAuB,EAAE,EAAE,CAAC;IAC9E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,EAAE,CAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;QAChC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,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 { TerminalManager } from \"./manager.ts\";\nimport { TerminalNotifier } from \"./notify.ts\";\nimport { TERMINAL_PROMPT_SECTION } from \"./prompt.ts\";\nimport type { TerminalRuntimeSession } from \"./runtime-session.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\";\n\ninterface TerminalExtensionState {\n\tmanager: TerminalManager | null;\n\tsettings: ResolvedTerminalSettings;\n\tnotifier: TerminalNotifier | null;\n\tctx: ExtensionContext | undefined;\n\tshellPath: string | undefined;\n\tsteppedAside: boolean;\n\tnoticeShown: boolean;\n}\n\nfunction buildToolContext(state: TerminalExtensionState): TerminalToolContext {\n\tconst requireManager = (): TerminalManager => {\n\t\t// Lazily create a manager so the tool works 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 manager and tears down any earlier one.\n\t\tstate.manager ??= new TerminalManager({\n\t\t\tmaxSessions: state.settings.maxSessions,\n\t\t\tscrollback: state.settings.scrollback,\n\t\t});\n\t\treturn state.manager;\n\t};\n\treturn {\n\t\tget manager() {\n\t\t\treturn requireManager();\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\tgetEnv: () => getShellEnv(),\n\t\tgetSessionContext: () => state.ctx,\n\t\tonBackgroundExit: (id: string, runtime: TerminalRuntimeSession) => {\n\t\t\tstate.notifier?.notifyCompletion(id, runtime);\n\t\t},\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 PTY companions are deactivated so none dangle without a usable persistent `bash` (the\n * function `bash` is stripped + replaced by native bash in the provider payload). Otherwise the\n * PTY `bash` + companions are (re)activated. Re-evaluated on session_start AND 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.delete(companion);\n\t\tif (!state.noticeShown) {\n\t\t\tstate.ctx?.ui.notify(\"native Anthropic bash active — persistent terminal sessions disabled\", \"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\tmanager: null,\n\t\tsettings: TERMINAL_SETTINGS_DEFAULTS,\n\t\tnotifier: null,\n\t\tctx: undefined,\n\t\tshellPath: undefined,\n\t\tsteppedAside: false,\n\t\tnoticeShown: false,\n\t};\n\tconst toolCtx = buildToolContext(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\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\tsendUserMessage: (content, options) => pi.sendUserMessage(content, options),\n\t\t\tgetContext: () => state.ctx,\n\t\t\tgetMode: () => state.settings.notify,\n\t\t});\n\t\tawait state.manager?.teardown();\n\t\tstate.manager = new TerminalManager({\n\t\t\tmaxSessions: state.settings.maxSessions,\n\t\t\tscrollback: state.settings.scrollback,\n\t\t});\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(\"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 () => {\n\t\tawait state.manager?.teardown();\n\t\tstate.manager = null;\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,4BAA4B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAA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QACtB,MAAM,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;QAChC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,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 { TerminalManager } from \"./manager.ts\";\nimport { MonitorNotifier } from \"./monitor-notify.ts\";\nimport { MonitorRegistry } from \"./monitor-registry.ts\";\nimport { TerminalNotifier } from \"./notify.ts\";\nimport { TERMINAL_PROMPT_SECTION } from \"./prompt.ts\";\nimport type { TerminalRuntimeSession } from \"./runtime-session.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\tmanager: TerminalManager | null;\n\tsettings: ResolvedTerminalSettings;\n\tnotifier: TerminalNotifier | null;\n\tmonitorNotifier: MonitorNotifier | null;\n\tmonitors: MonitorRegistry | null;\n\tctx: ExtensionContext | undefined;\n\tshellPath: string | undefined;\n\tsteppedAside: boolean;\n\tnoticeShown: boolean;\n}\n\nfunction buildToolContext(state: TerminalExtensionState): TerminalToolContext {\n\tconst requireManager = (): TerminalManager => {\n\t\t// Lazily create a manager so the tool works 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 manager and tears down any earlier one.\n\t\tstate.manager ??= new TerminalManager({\n\t\t\tmaxSessions: state.settings.maxSessions,\n\t\t\tscrollback: state.settings.scrollback,\n\t\t});\n\t\treturn state.manager;\n\t};\n\treturn {\n\t\tget manager() {\n\t\t\treturn requireManager();\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 monitorRegistry() {\n\t\t\tstate.monitors ??= new MonitorRegistry((event) => state.monitorNotifier?.notifyEvent(event));\n\t\t\treturn state.monitors;\n\t\t},\n\t\tgetEnv: () => getShellEnv(),\n\t\tgetSessionContext: () => state.ctx,\n\t\tonBackgroundExit: (id: string, runtime: TerminalRuntimeSession) => {\n\t\t\tstate.notifier?.notifyCompletion(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 PTY companions are deactivated so none dangle without a usable persistent `bash` (the\n * function `bash` is stripped + replaced by native bash in the provider payload). Otherwise the\n * PTY `bash` + companions are (re)activated. Re-evaluated on session_start AND 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.delete(companion);\n\t\tif (!state.noticeShown) {\n\t\t\tstate.ctx?.ui.notify(\"native Anthropic bash active — persistent terminal sessions disabled\", \"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\tmanager: null,\n\t\tsettings: TERMINAL_SETTINGS_DEFAULTS,\n\t\tnotifier: null,\n\t\tmonitorNotifier: null,\n\t\tmonitors: null,\n\t\tctx: undefined,\n\t\tshellPath: undefined,\n\t\tsteppedAside: false,\n\t\tnoticeShown: false,\n\t};\n\tconst toolCtx = buildToolContext(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\tsendUserMessage: (content, options) => pi.sendUserMessage(content, 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\tsendUserMessage: (content, options) => pi.sendUserMessage(content, 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.monitors?.pauseAll() ?? [],\n\t\t});\n\t\tstate.monitors?.dispose();\n\t\tstate.monitors = null;\n\t\tawait state.manager?.teardown();\n\t\tstate.manager = new TerminalManager({\n\t\t\tmaxSessions: state.settings.maxSessions,\n\t\t\tscrollback: state.settings.scrollback,\n\t\t});\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 () => {\n\t\tstate.monitorNotifier?.dispose();\n\t\tstate.monitorNotifier = null;\n\t\tstate.monitors?.dispose();\n\t\tstate.monitors = null;\n\t\tawait state.manager?.teardown();\n\t\tstate.manager = null;\n\t});\n}\n\nexport default registerTerminalExtension;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default, registerTerminalExtension } from "./extension.ts";
|
|
2
2
|
export { loadTerminalSettings, resolveTerminalSettings, TERMINAL_SETTINGS_DEFAULTS } from "./settings.ts";
|
|
3
|
-
export { TERMINAL_BASH_TOOL, TERMINAL_COMPANION_TOOLS, TERMINAL_INPUT_TOOL, TERMINAL_KILL_TOOL, TERMINAL_OUTPUT_TOOL, TERMINAL_RESIZE_TOOL, } from "./shared.ts";
|
|
3
|
+
export { TERMINAL_BASH_TOOL, TERMINAL_COMPANION_TOOLS, TERMINAL_INPUT_TOOL, TERMINAL_KILL_TOOL, TERMINAL_MONITOR_TOOL, TERMINAL_OUTPUT_TOOL, TERMINAL_RESIZE_TOOL, } from "./shared.ts";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,EACN,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,EACN,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,aAAa,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default, registerTerminalExtension } from "./extension.js";
|
|
2
2
|
export { loadTerminalSettings, resolveTerminalSettings, TERMINAL_SETTINGS_DEFAULTS } from "./settings.js";
|
|
3
|
-
export { TERMINAL_BASH_TOOL, TERMINAL_COMPANION_TOOLS, TERMINAL_INPUT_TOOL, TERMINAL_KILL_TOOL, TERMINAL_OUTPUT_TOOL, TERMINAL_RESIZE_TOOL, } from "./shared.js";
|
|
3
|
+
export { TERMINAL_BASH_TOOL, TERMINAL_COMPANION_TOOLS, TERMINAL_INPUT_TOOL, TERMINAL_KILL_TOOL, TERMINAL_MONITOR_TOOL, TERMINAL_OUTPUT_TOOL, TERMINAL_RESIZE_TOOL, } from "./shared.js";
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,EACN,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,aAAa,CAAC","sourcesContent":["export { default, registerTerminalExtension } from \"./extension.ts\";\nexport { loadTerminalSettings, resolveTerminalSettings, TERMINAL_SETTINGS_DEFAULTS } from \"./settings.ts\";\nexport {\n\tTERMINAL_BASH_TOOL,\n\tTERMINAL_COMPANION_TOOLS,\n\tTERMINAL_INPUT_TOOL,\n\tTERMINAL_KILL_TOOL,\n\tTERMINAL_OUTPUT_TOOL,\n\tTERMINAL_RESIZE_TOOL,\n} from \"./shared.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,EACN,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,aAAa,CAAC","sourcesContent":["export { default, registerTerminalExtension } from \"./extension.ts\";\nexport { loadTerminalSettings, resolveTerminalSettings, TERMINAL_SETTINGS_DEFAULTS } from \"./settings.ts\";\nexport {\n\tTERMINAL_BASH_TOOL,\n\tTERMINAL_COMPANION_TOOLS,\n\tTERMINAL_INPUT_TOOL,\n\tTERMINAL_KILL_TOOL,\n\tTERMINAL_MONITOR_TOOL,\n\tTERMINAL_OUTPUT_TOOL,\n\tTERMINAL_RESIZE_TOOL,\n} from \"./shared.ts\";\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { MonitorEvent } from "./monitor-registry.ts";
|
|
2
|
+
import { type TerminalNotifierDeps } from "./notify.ts";
|
|
3
|
+
import type { MonitorDeliverySettings } from "./settings.ts";
|
|
4
|
+
export interface MonitorNotificationScheduler {
|
|
5
|
+
now(): number;
|
|
6
|
+
setTimeout(callback: () => void, delayMs: number): unknown;
|
|
7
|
+
clearTimeout(timer: unknown): void;
|
|
8
|
+
}
|
|
9
|
+
export interface MonitorNotifierDeps extends TerminalNotifierDeps {
|
|
10
|
+
readonly getSettings: () => MonitorDeliverySettings;
|
|
11
|
+
/** Pause live monitors when their shared wake budget is exhausted. */
|
|
12
|
+
readonly pauseMonitors: () => readonly string[];
|
|
13
|
+
readonly scheduler?: MonitorNotificationScheduler;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Session-scoped monitor delivery queue. It preserves the terminal runtime as the authoritative,
|
|
17
|
+
* bounded event history while retaining only one capped coalescing batch for chat injection.
|
|
18
|
+
*/
|
|
19
|
+
export declare class MonitorNotifier {
|
|
20
|
+
#private;
|
|
21
|
+
constructor(deps: MonitorNotifierDeps);
|
|
22
|
+
notifyEvent(event: MonitorEvent): void;
|
|
23
|
+
/** Any explicit user or tool activity breaks a consecutive monitor-only wake streak. */
|
|
24
|
+
noteActivity(): void;
|
|
25
|
+
/** Explicit rearm is the only operation that releases the session-global wake pause. */
|
|
26
|
+
rearm(id: string): void;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=monitor-notify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitor-notify.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/monitor-notify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAmC,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEzF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAM7D,MAAM,WAAW,4BAA4B;IAC5C,GAAG,IAAI,MAAM,CAAC;IACd,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3D,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACnC;AAQD,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAChE,QAAQ,CAAC,WAAW,EAAE,MAAM,uBAAuB,CAAC;IACpD,sEAAsE;IACtE,QAAQ,CAAC,aAAa,EAAE,MAAM,SAAS,MAAM,EAAE,CAAC;IAChD,QAAQ,CAAC,SAAS,CAAC,EAAE,4BAA4B,CAAC;CAClD;AA+CD;;;GAGG;AACH,qBAAa,eAAe;;IAY3B,YAAY,IAAI,EAAE,mBAAmB,EAGpC;IAED,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAarC;IAED,wFAAwF;IACxF,YAAY,IAAI,IAAI,CAEnB;IAED,wFAAwF;IACxF,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAItB;IAED,OAAO,IAAI,IAAI,CAOd;CA+FD"}
|