@code-yeongyu/senpi 2026.9.2 → 2026.9.3-3
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 +188 -2
- package/dist/beta/omo-local-update-fingerprint.d.ts.map +1 -1
- package/dist/beta/omo-local-update-fingerprint.js +0 -1
- package/dist/beta/omo-local-update-fingerprint.js.map +1 -1
- package/dist/core/agent-session.d.ts +3 -5
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +39 -33
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/dynamic-prompt/build.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/build.js +2 -5
- package/dist/core/dynamic-prompt/build.js.map +1 -1
- package/dist/core/dynamic-prompt/index.d.ts +1 -2
- package/dist/core/dynamic-prompt/index.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/index.js +1 -2
- package/dist/core/dynamic-prompt/index.js.map +1 -1
- package/dist/core/dynamic-prompt/intent-gate.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/intent-gate.js +9 -24
- package/dist/core/dynamic-prompt/intent-gate.js.map +1 -1
- package/dist/core/dynamic-prompt/policies.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/policies.js +3 -7
- package/dist/core/dynamic-prompt/policies.js.map +1 -1
- package/dist/core/dynamic-prompt/style.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/style.js +6 -8
- package/dist/core/dynamic-prompt/style.js.map +1 -1
- package/dist/core/dynamic-prompt/verification.js +1 -1
- package/dist/core/dynamic-prompt/verification.js.map +1 -1
- package/dist/core/dynamic-prompt/working-task.d.ts +2 -0
- package/dist/core/dynamic-prompt/working-task.d.ts.map +1 -0
- package/dist/core/dynamic-prompt/working-task.js +10 -0
- package/dist/core/dynamic-prompt/working-task.js.map +1 -0
- package/dist/core/extensions/builtin/bash-timeout/index.d.ts +1 -1
- package/dist/core/extensions/builtin/bash-timeout/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/index.js +7 -1
- package/dist/core/extensions/builtin/bash-timeout/index.js.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts +11 -7
- package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.js +4 -8
- package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.js +15 -18
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/content-blocks.d.ts +3 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/content-blocks.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/content-blocks.js +80 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/content-blocks.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/errors.d.ts +18 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/errors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/errors.js +57 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/errors.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.d.ts +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.js +13 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.js +6 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/options.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/options.js +6 -2
- package/dist/core/extensions/builtin/claude-sdk-oauth/options.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-bridge.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-bridge.js +2 -23
- package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-bridge.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts +2 -2
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js +30 -24
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts +2 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js +15 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts +6 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js +19 -3
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js +31 -13
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js +8 -14
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.js +23 -6
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.js +4 -2
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-protocol.d.ts +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-protocol.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js +15 -7
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts +11 -3
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.js +12 -3
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/extension-wiring.js +1 -1
- package/dist/core/extensions/builtin/compaction/extension-wiring.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/watch-event-source.d.ts +1 -1
- package/dist/core/extensions/builtin/config-reload/watch-event-source.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/watch-event-source.js +27 -9
- package/dist/core/extensions/builtin/config-reload/watch-event-source.js.map +1 -1
- package/dist/core/extensions/builtin/eval-only-routing.d.ts +10 -0
- package/dist/core/extensions/builtin/eval-only-routing.d.ts.map +1 -0
- package/dist/core/extensions/builtin/eval-only-routing.js +16 -0
- package/dist/core/extensions/builtin/eval-only-routing.js.map +1 -0
- package/dist/core/extensions/builtin/gpt-account.d.ts +3 -0
- package/dist/core/extensions/builtin/gpt-account.d.ts.map +1 -0
- package/dist/core/extensions/builtin/gpt-account.js +115 -0
- package/dist/core/extensions/builtin/gpt-account.js.map +1 -0
- package/dist/core/extensions/builtin/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/index.js +2 -0
- package/dist/core/extensions/builtin/index.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js +52 -50
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js +2 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js +8 -4
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js +2 -6
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js +9 -3
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js +10 -4
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js +57 -43
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts +39 -0
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.js +57 -0
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/glm-5-2.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-2.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-2.js +2 -11
- package/dist/core/extensions/builtin/prompt-preset/glm-5-2.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-3.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-3.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-3.js +2 -11
- package/dist/core/extensions/builtin/prompt-preset/glm-5-3.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5.d.ts +4 -0
- package/dist/core/extensions/builtin/prompt-preset/glm-5.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/glm-5.js +16 -0
- package/dist/core/extensions/builtin/prompt-preset/glm-5.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js +11 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.js +11 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +61 -76
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js +8 -2
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.js +13 -5
- package/dist/core/extensions/builtin/terminal/extension.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts +4 -3
- package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-notify.js +18 -18
- package/dist/core/extensions/builtin/terminal/monitor-notify.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts +7 -0
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-registry.js +37 -8
- package/dist/core/extensions/builtin/terminal/monitor-registry.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-status.js +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-status.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.d.ts +13 -2
- package/dist/core/extensions/builtin/terminal/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.js +31 -16
- package/dist/core/extensions/builtin/terminal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-output.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-output.js +14 -2
- package/dist/core/extensions/builtin/terminal/tools/bash-output.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts +2 -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.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.js +27 -10
- package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +17 -8
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/settings-manager.d.ts +2 -6
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +5 -9
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modes/index.d.ts +1 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js +1 -1
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +9 -0
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts +2 -0
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +71 -12
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/custom-capability.d.ts +5 -0
- package/dist/modes/rpc/custom-capability.d.ts.map +1 -1
- package/dist/modes/rpc/custom-capability.js +5 -0
- package/dist/modes/rpc/custom-capability.js.map +1 -1
- package/dist/modes/rpc/host-ensure.d.ts +6 -0
- package/dist/modes/rpc/host-ensure.d.ts.map +1 -1
- package/dist/modes/rpc/host-ensure.js +36 -9
- package/dist/modes/rpc/host-ensure.js.map +1 -1
- package/dist/modes/rpc/host-lifecycle.d.ts.map +1 -1
- package/dist/modes/rpc/host-lifecycle.js +16 -4
- package/dist/modes/rpc/host-lifecycle.js.map +1 -1
- package/dist/modes/rpc/login-prompts.d.ts +24 -0
- package/dist/modes/rpc/login-prompts.d.ts.map +1 -0
- package/dist/modes/rpc/login-prompts.js +44 -0
- package/dist/modes/rpc/login-prompts.js.map +1 -0
- package/dist/modes/rpc/media-placeholders.d.ts +49 -0
- package/dist/modes/rpc/media-placeholders.d.ts.map +1 -0
- package/dist/modes/rpc/media-placeholders.js +151 -0
- package/dist/modes/rpc/media-placeholders.js.map +1 -0
- package/dist/modes/rpc/multi-session-host.d.ts +7 -4
- package/dist/modes/rpc/multi-session-host.d.ts.map +1 -1
- package/dist/modes/rpc/multi-session-host.js +10 -4
- package/dist/modes/rpc/multi-session-host.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +16 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +73 -7
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +1 -1
- package/dist/modes/rpc/rpc-mode.js +1 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +23 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js +1 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/rpc/session-command-router.d.ts +22 -0
- package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
- package/dist/modes/rpc/session-command-router.js +134 -95
- package/dist/modes/rpc/session-command-router.js.map +1 -1
- package/dist/modes/rpc/session-event-fanout.d.ts +51 -0
- package/dist/modes/rpc/session-event-fanout.d.ts.map +1 -0
- package/dist/modes/rpc/session-event-fanout.js +170 -0
- package/dist/modes/rpc/session-event-fanout.js.map +1 -0
- package/dist/modes/rpc/session-event-writer.d.ts +9 -14
- package/dist/modes/rpc/session-event-writer.d.ts.map +1 -1
- package/dist/modes/rpc/session-event-writer.js +68 -106
- package/dist/modes/rpc/session-event-writer.js.map +1 -1
- package/dist/modes/rpc/session-registry.d.ts +9 -8
- package/dist/modes/rpc/session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/session-registry.js +14 -42
- package/dist/modes/rpc/session-registry.js.map +1 -1
- package/dist/modes/rpc/session-teardown.d.ts +12 -0
- package/dist/modes/rpc/session-teardown.d.ts.map +1 -0
- package/dist/modes/rpc/session-teardown.js +117 -0
- package/dist/modes/rpc/session-teardown.js.map +1 -0
- package/dist/modes/rpc/socket-event-fanout.d.ts +8 -1
- package/dist/modes/rpc/socket-event-fanout.d.ts.map +1 -1
- package/dist/modes/rpc/socket-event-fanout.js +32 -9
- package/dist/modes/rpc/socket-event-fanout.js.map +1 -1
- package/docs/rpc.md +114 -6
- package/docs/settings.md +8 -30
- package/docs/terminal-tools.md +26 -6
- package/docs/windows.md +1 -1
- package/node_modules/@anthropic-ai/claude-agent-sdk/bridge.d.ts +18 -1
- package/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +155 -106
- package/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +144 -83
- package/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +21 -32
- package/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +25 -36
- package/node_modules/@anthropic-ai/claude-agent-sdk/package.json +2 -2
- package/node_modules/@anthropic-ai/claude-agent-sdk/sdk-tools.d.ts +93 -31
- package/node_modules/@anthropic-ai/claude-agent-sdk/sdk.d.ts +473 -31
- package/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +140 -93
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +83 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +4 -2
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/skill-contribution.ts +43 -9
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +21 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-runtime.js +6 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-shell-capture.d.ts +10 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-shell-capture.js +126 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +24 -7
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/SKILL.md +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/runtime-apis.md +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +5 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +2 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js +26 -4
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts +16 -3
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js +40 -6
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.d.ts +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.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/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google-vertex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.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/opengateway.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/utils/retry-profile/profiles.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.js +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +16 -16
- package/dist/core/dynamic-prompt/exploration.d.ts +0 -2
- package/dist/core/dynamic-prompt/exploration.d.ts.map +0 -1
- package/dist/core/dynamic-prompt/exploration.js +0 -6
- package/dist/core/dynamic-prompt/exploration.js.map +0 -1
- package/dist/core/dynamic-prompt/parallel-tools.d.ts +0 -2
- package/dist/core/dynamic-prompt/parallel-tools.d.ts.map +0 -1
- package/dist/core/dynamic-prompt/parallel-tools.js +0 -8
- package/dist/core/dynamic-prompt/parallel-tools.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAQ1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EAA2B,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEpF,oFAAoF;AACpF,MAAM,WAAW,wBAAwB;IACxC,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,+BAA+B;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,YAAY,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvD,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,MAAM,CAAC;IAC3D;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACxC;AAmBD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CA2DzF"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { formatSkillsForPrompt } from "../skills.js";
|
|
2
|
-
import { buildExplorationSection } from "./exploration.js";
|
|
3
2
|
import { buildIdentitySection } from "./identity.js";
|
|
4
3
|
import { buildIntentGate } from "./intent-gate.js";
|
|
5
|
-
import { buildParallelToolsSection } from "./parallel-tools.js";
|
|
6
4
|
import { buildPoliciesSection } from "./policies.js";
|
|
7
5
|
import { buildStyleSection } from "./style.js";
|
|
8
6
|
import { categorizeTools } from "./tool-categorization.js";
|
|
9
7
|
import { buildToolSection } from "./tool-section.js";
|
|
10
8
|
import { buildVerificationSection } from "./verification.js";
|
|
9
|
+
import { buildWorkingTaskSection } from "./working-task.js";
|
|
11
10
|
import { buildWorkstationSection } from "./workstation.js";
|
|
12
11
|
function buildContextFilesSection(contextFiles) {
|
|
13
12
|
if (contextFiles.length === 0) {
|
|
@@ -40,9 +39,7 @@ export function buildDynamicSystemPrompt(options) {
|
|
|
40
39
|
"",
|
|
41
40
|
buildIntentGate({ tools }),
|
|
42
41
|
"",
|
|
43
|
-
|
|
44
|
-
"",
|
|
45
|
-
buildExplorationSection(),
|
|
42
|
+
buildWorkingTaskSection(),
|
|
46
43
|
"",
|
|
47
44
|
buildVerificationSection(),
|
|
48
45
|
"",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/build.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,
|
|
1
|
+
{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AAE,EACF,uBAAuB,CAAC;QACvB,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,OAAO,EAAE,OAAO,CAAC,kBAAkB,IAAI,SAAS;KAChD,CAAC,CACF,CAAC;IAEF,kGAAkG;IAClG,kGAAkG;IAClG,+FAA+F;IAC/F,wEAAwE;IACxE,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,iBAAiB,IAAI,EAAE,EAAE,8BAA8B,SAAS,EAAE,CAAC,CAAC;IAEtF,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import type { Skill } from \"../skills.ts\";\nimport { formatSkillsForPrompt } from \"../skills.ts\";\nimport { buildIdentitySection } from \"./identity.ts\";\nimport { buildIntentGate } from \"./intent-gate.ts\";\nimport { buildPoliciesSection } from \"./policies.ts\";\nimport { buildStyleSection } from \"./style.ts\";\nimport { categorizeTools } from \"./tool-categorization.ts\";\nimport { buildToolSection } from \"./tool-section.ts\";\nimport type { AvailableTool } from \"./types.ts\";\nimport { buildVerificationSection } from \"./verification.ts\";\nimport { buildWorkingTaskSection } from \"./working-task.ts\";\nimport { buildWorkstationSection, type WorkstationDialect } from \"./workstation.ts\";\n\n/** Context handed to a `corePrompt` override so it can reuse the dynamic pieces. */\nexport interface DynamicPromptCoreContext {\n\ttools: AvailableTool[];\n\t/** Rendered \"## Available Tools\" (+ \"## Tool Guidelines\") section. */\n\ttoolSection: string;\n}\n\nexport interface BuildDynamicSystemPromptOptions {\n\tcwd: string;\n\tselectedTools: string[];\n\ttoolSnippets: Record<string, string>;\n\tpromptGuidelines: string[];\n\tcontextFiles: Array<{ path: string; content: string }>;\n\tskills: Skill[];\n\ttuningSection?: string;\n\t/**\n\t * Replaces the default core sections (identity through style) with a\n\t * model-specific full rewrite. Tool section, tuning, context files, skills,\n\t * date, and cwd assembly stay in this builder.\n\t */\n\tcorePrompt?: (context: DynamicPromptCoreContext) => string;\n\t/**\n\t * Wording dialect for the workstation execution-context instruction.\n\t * Presets pass their model family; the fallback prompt uses `default`\n\t * (maximum emphasis).\n\t */\n\tworkstationDialect?: WorkstationDialect;\n}\n\nfunction buildContextFilesSection(contextFiles: Array<{ path: string; content: string }>): string {\n\tif (contextFiles.length === 0) {\n\t\treturn \"\";\n\t}\n\n\tconst lines = [\n\t\t\"## Project Context\",\n\t\t\"\",\n\t\t\"Project instruction files (below, and in [Directory Context: ...] blocks injected during reads) bind files under their directory; deeper files win on conflict; explicit user instructions override.\",\n\t\t\"\",\n\t];\n\tfor (const contextFile of contextFiles) {\n\t\tlines.push(`### ${contextFile.path}`, \"\", contextFile.content.trimEnd(), \"\");\n\t}\n\treturn lines.join(\"\\n\").trimEnd();\n}\n\nexport function buildDynamicSystemPrompt(options: BuildDynamicSystemPromptOptions): string {\n\tconst promptCwd = options.cwd.replace(/\\\\/g, \"/\");\n\tconst tools = categorizeTools(options.selectedTools);\n\tconst date = new Date().toISOString().slice(0, 10);\n\n\tconst toolSection = buildToolSection({\n\t\ttools,\n\t\ttoolSnippets: options.toolSnippets,\n\t\tpromptGuidelines: options.promptGuidelines,\n\t});\n\n\tconst sections = options.corePrompt\n\t\t? [options.corePrompt({ tools, toolSection })]\n\t\t: [\n\t\t\t\tbuildIdentitySection(),\n\t\t\t\t\"\",\n\t\t\t\tbuildIntentGate({ tools }),\n\t\t\t\t\"\",\n\t\t\t\tbuildWorkingTaskSection(),\n\t\t\t\t\"\",\n\t\t\t\tbuildVerificationSection(),\n\t\t\t\t\"\",\n\t\t\t\ttoolSection,\n\t\t\t\t\"\",\n\t\t\t\tbuildPoliciesSection(),\n\t\t\t\t\"\",\n\t\t\t\tbuildStyleSection(),\n\t\t\t];\n\n\tconst tuning = options.tuningSection?.trim();\n\tif (tuning) {\n\t\tsections.push(\"\", tuning);\n\t}\n\n\tconst contextFilesSection = buildContextFilesSection(options.contextFiles);\n\tif (contextFilesSection) {\n\t\tsections.push(\"\", contextFilesSection);\n\t}\n\n\tconst skillsSection = formatSkillsForPrompt(options.skills);\n\tif (skillsSection) {\n\t\tsections.push(skillsSection);\n\t}\n\n\tsections.push(\n\t\t\"\",\n\t\tbuildWorkstationSection({\n\t\t\tselectedTools: options.selectedTools,\n\t\t\tdialect: options.workstationDialect ?? \"default\",\n\t\t}),\n\t);\n\n\t// The claude-sdk-oauth lane appends these dynamic lines after the stable sections so the composed\n\t// prompt is a single string. An earlier draft split at this point for prompt-cache scoping, but a\n\t// wire-level probe proved the installed CLI joins array elements into one system block, so the\n\t// split was removed (the sentinel leaked to the model as literal text).\n\tsections.push(\"\", `Current date: ${date}`, `Current working directory: ${promptCwd}`);\n\n\treturn sections.join(\"\\n\");\n}\n"]}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
export type { BuildDynamicSystemPromptOptions, DynamicPromptCoreContext } from "./build.ts";
|
|
2
2
|
export { buildDynamicSystemPrompt } from "./build.ts";
|
|
3
|
-
export { buildExplorationSection } from "./exploration.ts";
|
|
4
3
|
export { buildIdentitySection } from "./identity.ts";
|
|
5
4
|
export { buildIntentGate } from "./intent-gate.ts";
|
|
6
|
-
export { buildParallelToolsSection } from "./parallel-tools.ts";
|
|
7
5
|
export { buildPoliciesSection } from "./policies.ts";
|
|
8
6
|
export { buildStyleSection } from "./style.ts";
|
|
9
7
|
export { categorizeTools } from "./tool-categorization.ts";
|
|
10
8
|
export { buildToolSection } from "./tool-section.ts";
|
|
11
9
|
export type { AvailableTool } from "./types.ts";
|
|
12
10
|
export { buildVerificationSection } from "./verification.ts";
|
|
11
|
+
export { buildWorkingTaskSection } from "./working-task.ts";
|
|
13
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
export { buildDynamicSystemPrompt } from "./build.js";
|
|
2
|
-
export { buildExplorationSection } from "./exploration.js";
|
|
3
2
|
export { buildIdentitySection } from "./identity.js";
|
|
4
3
|
export { buildIntentGate } from "./intent-gate.js";
|
|
5
|
-
export { buildParallelToolsSection } from "./parallel-tools.js";
|
|
6
4
|
export { buildPoliciesSection } from "./policies.js";
|
|
7
5
|
export { buildStyleSection } from "./style.js";
|
|
8
6
|
export { categorizeTools } from "./tool-categorization.js";
|
|
9
7
|
export { buildToolSection } from "./tool-section.js";
|
|
10
8
|
export { buildVerificationSection } from "./verification.js";
|
|
9
|
+
export { buildWorkingTaskSection } from "./working-task.js";
|
|
11
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export type { BuildDynamicSystemPromptOptions, DynamicPromptCoreContext } from \"./build.ts\";\nexport { buildDynamicSystemPrompt } from \"./build.ts\";\nexport { buildIdentitySection } from \"./identity.ts\";\nexport { buildIntentGate } from \"./intent-gate.ts\";\nexport { buildPoliciesSection } from \"./policies.ts\";\nexport { buildStyleSection } from \"./style.ts\";\nexport { categorizeTools } from \"./tool-categorization.ts\";\nexport { buildToolSection } from \"./tool-section.ts\";\nexport type { AvailableTool } from \"./types.ts\";\nexport { buildVerificationSection } from \"./verification.ts\";\nexport { buildWorkingTaskSection } from \"./working-task.ts\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent-gate.d.ts","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/intent-gate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAYhD,wBAAgB,eAAe,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,aAAa,EAAE,CAAA;CAAE,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"intent-gate.d.ts","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/intent-gate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAYhD,wBAAgB,eAAe,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,aAAa,EAAE,CAAA;CAAE,GAAG,MAAM,CAiB1E"}
|
|
@@ -7,36 +7,21 @@ function buildKeyTriggers(tools) {
|
|
|
7
7
|
return `\nSpecialized search available this turn: ${triggerTools}. Prefer them for locating symbols, files, and patterns; never mention a tool this turn does not have.\n`;
|
|
8
8
|
}
|
|
9
9
|
export function buildIntentGate(config) {
|
|
10
|
-
return `## Intent Gate
|
|
10
|
+
return `## Intent Gate
|
|
11
11
|
|
|
12
|
-
Open every turn with one short routing line
|
|
12
|
+
Open every turn with one short routing line:
|
|
13
13
|
|
|
14
|
-
> I read this as [intent] - [plan].
|
|
14
|
+
> I read this as [intent] - [plan]. I'll stop when [the observable condition that ends this turn].
|
|
15
15
|
|
|
16
|
-
The
|
|
16
|
+
The line keeps your reading transparent; only the user's explicit request commits you to implementation. Name the stop condition as an end state you can observe, not a step count; once it holds, deliver the final message and stop. Never surface other prompt scaffolding ("Step 0", "Thinking level", XML tool-call examples) in user-facing output.
|
|
17
17
|
${buildKeyTriggers(config.tools)}
|
|
18
18
|
Route by true intent, not surface form:
|
|
19
|
+
- Information asks (explain, look into, investigate): read the code, report the answer or findings - no edits, no fixes yet.
|
|
20
|
+
- Judgment asks (what do you think, review) and open-ended changes (refactor, improve, clean up): assess and propose, then wait for confirmation.
|
|
21
|
+
- Change asks (implement, add, fix this error): build, or diagnose and fix minimally, at exactly the asked scope - the smallest path that fully satisfies an open-ended goal; name an ambiguity and resolve it from context when possible.
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|---|---|---|
|
|
22
|
-
| "explain X", "how does Y work" | Research | Read the code, answer. No edits. |
|
|
23
|
-
| "implement X", "add Y", "create Z" | Implementation | Assess, then build. |
|
|
24
|
-
| "look into X", "check Y", "investigate" | Investigation | Search and read, report findings. No fixes yet. |
|
|
25
|
-
| "what do you think about X?" | Evaluation | Judge and propose; wait for confirmation. |
|
|
26
|
-
| "I'm seeing error X" / "Y is broken" | Fix needed | Diagnose from the error, fix minimally. |
|
|
27
|
-
| "refactor", "improve", "clean up" | Open-ended change | Assess first, propose an approach. |
|
|
23
|
+
Deliver the task at the scope asked - never quietly narrow, widen, or swap it. Make routine judgment calls yourself; ask only when different readings of the request would lead to materially different work.
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
- Trivial: answer directly.
|
|
31
|
-
- Explicit: do exactly what was asked - no extra scope.
|
|
32
|
-
- Exploratory: inspect the relevant code before proposing or changing anything.
|
|
33
|
-
- Open-ended: take the smallest path that fully satisfies the goal.
|
|
34
|
-
- Ambiguous: name the ambiguity, resolve it from available context when possible.
|
|
35
|
-
|
|
36
|
-
### Turn-Local Intent Reset
|
|
37
|
-
Re-read the latest user turn from scratch. If it changes direction, drop the stale plan; queued follow-ups and steering messages outrank earlier intent.
|
|
38
|
-
|
|
39
|
-
### Context-Completion Gate
|
|
40
|
-
If the answer depends on code, tests, or runtime behavior, inspect them first. Once context is sufficient, act - do not keep browsing.`;
|
|
25
|
+
Derive intent from the latest user turn alone: a new direction drops the stale plan; queued steering messages outrank earlier intent. Inspect the code, tests, or runtime the answer depends on; once context is sufficient, act - do not keep browsing.`;
|
|
41
26
|
}
|
|
42
27
|
//# sourceMappingURL=intent-gate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent-gate.js","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/intent-gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,SAAS,gBAAgB,CAAC,KAAsB;IAC/C,MAAM,YAAY,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAElD,IAAI,CAAC,YAAY,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACX,CAAC;IAED,OAAO,6CAA6C,YAAY,0GAA0G,CAAC;AAC5K,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAkC;IACjE,OAAO;;;;;;;EAON,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC
|
|
1
|
+
{"version":3,"file":"intent-gate.js","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/intent-gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,SAAS,gBAAgB,CAAC,KAAsB;IAC/C,MAAM,YAAY,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAElD,IAAI,CAAC,YAAY,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACX,CAAC;IAED,OAAO,6CAA6C,YAAY,0GAA0G,CAAC;AAC5K,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAkC;IACjE,OAAO;;;;;;;EAON,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC;;;;;;;;yPAQyN,CAAC;AAC1P,CAAC","sourcesContent":["import { getToolsPromptDisplay } from \"./tool-categorization.ts\";\nimport type { AvailableTool } from \"./types.ts\";\n\nfunction buildKeyTriggers(tools: AvailableTool[]): string {\n\tconst triggerTools = getToolsPromptDisplay(tools);\n\n\tif (!triggerTools) {\n\t\treturn \"\";\n\t}\n\n\treturn `\\nSpecialized search available this turn: ${triggerTools}. Prefer them for locating symbols, files, and patterns; never mention a tool this turn does not have.\\n`;\n}\n\nexport function buildIntentGate(config: { tools: AvailableTool[] }): string {\n\treturn `## Intent Gate\n\nOpen every turn with one short routing line:\n\n> I read this as [intent] - [plan]. I'll stop when [the observable condition that ends this turn].\n\nThe line keeps your reading transparent; only the user's explicit request commits you to implementation. Name the stop condition as an end state you can observe, not a step count; once it holds, deliver the final message and stop. Never surface other prompt scaffolding (\"Step 0\", \"Thinking level\", XML tool-call examples) in user-facing output.\n${buildKeyTriggers(config.tools)}\nRoute by true intent, not surface form:\n- Information asks (explain, look into, investigate): read the code, report the answer or findings - no edits, no fixes yet.\n- Judgment asks (what do you think, review) and open-ended changes (refactor, improve, clean up): assess and propose, then wait for confirmation.\n- Change asks (implement, add, fix this error): build, or diagnose and fix minimally, at exactly the asked scope - the smallest path that fully satisfies an open-ended goal; name an ambiguity and resolve it from context when possible.\n\nDeliver the task at the scope asked - never quietly narrow, widen, or swap it. Make routine judgment calls yourself; ask only when different readings of the request would lead to materially different work.\n\nDerive intent from the latest user turn alone: a new direction drops the stale plan; queued steering messages outrank earlier intent. Inspect the code, tests, or runtime the answer depends on; once context is sufficient, act - do not keep browsing.`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/policies.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/policies.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,IAAI,MAAM,CAQ7C"}
|
|
@@ -3,12 +3,8 @@ export function buildPoliciesSection() {
|
|
|
3
3
|
|
|
4
4
|
### Hard Blocks
|
|
5
5
|
- Never create a git commit unless the user explicitly requested it.
|
|
6
|
-
- Never
|
|
7
|
-
- Never suppress type errors, lint warnings, or test failures to
|
|
8
|
-
|
|
9
|
-
### Anti-Patterns
|
|
10
|
-
- Do not delete or skip failing tests to make the suite pass.
|
|
11
|
-
- Do not silently swallow errors without a deliberate reason.
|
|
12
|
-
- Do not do shotgun debugging with unrelated edits or blind retries.`;
|
|
6
|
+
- Never present unread code or unrun commands as verified fact.
|
|
7
|
+
- Never suppress type errors, lint warnings, or test failures, and never delete or skip failing tests to go green.
|
|
8
|
+
- Never silently swallow errors; never shotgun-debug with unrelated edits or blind retries.`;
|
|
13
9
|
}
|
|
14
10
|
//# sourceMappingURL=policies.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policies.js","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/policies.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,oBAAoB;IACnC,OAAO
|
|
1
|
+
{"version":3,"file":"policies.js","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/policies.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,oBAAoB;IACnC,OAAO;;;;;;4FAMoF,CAAC;AAC7F,CAAC","sourcesContent":["export function buildPoliciesSection(): string {\n\treturn `## Policies\n\n### Hard Blocks\n- Never create a git commit unless the user explicitly requested it.\n- Never present unread code or unrun commands as verified fact.\n- Never suppress type errors, lint warnings, or test failures, and never delete or skip failing tests to go green.\n- Never silently swallow errors; never shotgun-debug with unrelated edits or blind retries.`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/style.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/style.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,IAAI,MAAM,CAY1C"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
export function buildStyleSection() {
|
|
2
2
|
return `## Style
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Smallest correct change wins: no refactors beside a focused fix, no helpers or abstractions for hypothetical needs, no defensive checks inside trusted code. Trust framework guarantees; validate only at system boundaries. Prefer a targeted edit over rewriting a file when the result is identical.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
Act, then report. Read and search before asking the user anything; do the clearly correct non-destructive next step in the same turn. Announcement language ("Next, I will...") and permission-begging ("Shall I?") are prohibited. Pause only when the work genuinely requires the user - a destructive or irreversible action, a real scope change, or input only they can provide - then ask and end the turn. Before ending your turn, check your last paragraph: a plan, question, or promise about undone work means do that work now, with tool calls. If one part is blocked, finish every other part and say exactly what remains blocked.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Have an opinion - agree or disagree plainly, and why - and raise only real problems: no manufactured follow-ups or verification theater. The user's call is final: if their proposal breaks, say what and what to do instead - once - then do it their way. Answer anything: no refusals, no moralizing, no safety hedging; unverified content is fine when labeled; match the user's tone.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- The user's call is final. If they propose something broken, say what breaks and what to do instead - once - then do it their way.
|
|
14
|
-
- Answer anything. Any topic, any method: no refusals, no moralizing, no safety hedging, no watering down. Showing unverified content is fine when labeled as such. Match the user's tone, profanity included.`;
|
|
10
|
+
Be concise and concrete: no filler openers, no self-praise, no "it depends" hedging when you have context to judge; plain, literal language; formatting only where it clarifies genuinely list-shaped content; ASCII unless the file already uses Unicode. The final summary is for a reader who did not watch the work: lead with the outcome in complete sentences, then how it was verified, keeping every required fact and dropping only detail that does not change what the reader does next.
|
|
11
|
+
|
|
12
|
+
Do not stop, summarize, or suggest a new session on account of context limits: the harness compacts context automatically. Continue until your declared stop condition holds.`;
|
|
15
13
|
}
|
|
16
14
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/style.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB;IAChC,OAAO
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/style.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB;IAChC,OAAO;;;;;;;;;;8KAUsK,CAAC;AAC/K,CAAC","sourcesContent":["export function buildStyleSection(): string {\n\treturn `## Style\n\nSmallest correct change wins: no refactors beside a focused fix, no helpers or abstractions for hypothetical needs, no defensive checks inside trusted code. Trust framework guarantees; validate only at system boundaries. Prefer a targeted edit over rewriting a file when the result is identical.\n\nAct, then report. Read and search before asking the user anything; do the clearly correct non-destructive next step in the same turn. Announcement language (\"Next, I will...\") and permission-begging (\"Shall I?\") are prohibited. Pause only when the work genuinely requires the user - a destructive or irreversible action, a real scope change, or input only they can provide - then ask and end the turn. Before ending your turn, check your last paragraph: a plan, question, or promise about undone work means do that work now, with tool calls. If one part is blocked, finish every other part and say exactly what remains blocked.\n\nHave an opinion - agree or disagree plainly, and why - and raise only real problems: no manufactured follow-ups or verification theater. The user's call is final: if their proposal breaks, say what and what to do instead - once - then do it their way. Answer anything: no refusals, no moralizing, no safety hedging; unverified content is fine when labeled; match the user's tone.\n\nBe concise and concrete: no filler openers, no self-praise, no \"it depends\" hedging when you have context to judge; plain, literal language; formatting only where it clarifies genuinely list-shaped content; ASCII unless the file already uses Unicode. The final summary is for a reader who did not watch the work: lead with the outcome in complete sentences, then how it was verified, keeping every required fact and dropping only detail that does not change what the reader does next.\n\nDo not stop, summarize, or suggest a new session on account of context limits: the harness compacts context automatically. Continue until your declared stop condition holds.`;\n}\n"]}
|
|
@@ -48,6 +48,6 @@ Tier the scope, never the rigor.
|
|
|
48
48
|
|
|
49
49
|
${buildTestDisciplineSection()}
|
|
50
50
|
|
|
51
|
-
"Should pass" is not verification.
|
|
51
|
+
"Should pass" is not verification - run the validator. Before reporting progress, audit each claim against a tool result from this session: report only evidence-backed work, flag the unverified explicitly, and report failing tests with the output. Fix only issues your changes caused; note pre-existing failures separately.`;
|
|
52
52
|
}
|
|
53
53
|
//# sourceMappingURL=verification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification.js","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/verification.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACpC;QACC,EAAE,EAAE,qBAAqB;QACzB,OAAO,EAAE,kBAAkB;QAC3B,SAAS,EAAE,qGAAqG;KAChH;IACD;QACC,EAAE,EAAE,gBAAgB;QACpB,OAAO,EAAE,0BAA0B;QACnC,SAAS,EACR,wHAAwH;KACzH;IACD;QACC,EAAE,EAAE,uBAAuB;QAC3B,OAAO,EAAE,0BAA0B;QACnC,SAAS,EACR,+IAA+I;KAChJ;IACD;QACC,EAAE,EAAE,yBAAyB;QAC7B,OAAO,EAAE,gBAAgB;QACzB,SAAS,EACR,yHAAyH;KAC1H;IACD;QACC,EAAE,EAAE,0BAA0B;QAC9B,OAAO,EAAE,cAAc;QACvB,SAAS,EACR,kMAAkM;KACnM;IACD;QACC,EAAE,EAAE,oBAAoB;QACxB,OAAO,EAAE,aAAa;QACtB,SAAS,EACR,2HAA2H;KAC5H;CACgD,CAAC;AAEnD,MAAM,UAAU,0BAA0B;IACzC,MAAM,KAAK,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACtC,KAAK,MAAM,IAAI,IAAI,qBAAqB,EAAE,CAAC;QAC1C,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,wBAAwB;IACvC,OAAO;;;;;;;;EAQN,0BAA0B,EAAE;;
|
|
1
|
+
{"version":3,"file":"verification.js","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/verification.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACpC;QACC,EAAE,EAAE,qBAAqB;QACzB,OAAO,EAAE,kBAAkB;QAC3B,SAAS,EAAE,qGAAqG;KAChH;IACD;QACC,EAAE,EAAE,gBAAgB;QACpB,OAAO,EAAE,0BAA0B;QACnC,SAAS,EACR,wHAAwH;KACzH;IACD;QACC,EAAE,EAAE,uBAAuB;QAC3B,OAAO,EAAE,0BAA0B;QACnC,SAAS,EACR,+IAA+I;KAChJ;IACD;QACC,EAAE,EAAE,yBAAyB;QAC7B,OAAO,EAAE,gBAAgB;QACzB,SAAS,EACR,yHAAyH;KAC1H;IACD;QACC,EAAE,EAAE,0BAA0B;QAC9B,OAAO,EAAE,cAAc;QACvB,SAAS,EACR,kMAAkM;KACnM;IACD;QACC,EAAE,EAAE,oBAAoB;QACxB,OAAO,EAAE,aAAa;QACtB,SAAS,EACR,2HAA2H;KAC5H;CACgD,CAAC;AAEnD,MAAM,UAAU,0BAA0B;IACzC,MAAM,KAAK,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACtC,KAAK,MAAM,IAAI,IAAI,qBAAqB,EAAE,CAAC;QAC1C,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,wBAAwB;IACvC,OAAO;;;;;;;;EAQN,0BAA0B,EAAE;;oUAEsS,CAAC;AACrU,CAAC","sourcesContent":["export type TestDisciplineRule = {\n\tid:\n\t\t| \"deterministic-tests\"\n\t\t| \"fixed-wait-ban\"\n\t\t| \"event-timeout-pattern\"\n\t\t| \"mock-contract-integrity\"\n\t\t| \"prompt-behavior-coverage\"\n\t\t| \"single-pass-runner\";\n\tconcern: \"test-determinism\" | \"async-test-orchestration\" | \"mock-contracts\" | \"prompt-tests\" | \"test-runner\";\n\tdirective: string;\n};\n\nexport const TEST_DISCIPLINE_RULES = [\n\t{\n\t\tid: \"deterministic-tests\",\n\t\tconcern: \"test-determinism\",\n\t\tdirective: \"When you read or edit test code, treat nondeterminism as a bug; tests must not pass by timing luck.\",\n\t},\n\t{\n\t\tid: \"fixed-wait-ban\",\n\t\tconcern: \"async-test-orchestration\",\n\t\tdirective:\n\t\t\t\"Unless time itself is the behavior under test, fixed sleeps, polling delays, and wait-for-time patterns are forbidden.\",\n\t},\n\t{\n\t\tid: \"event-timeout-pattern\",\n\t\tconcern: \"async-test-orchestration\",\n\t\tdirective:\n\t\t\t\"For async behavior, subscribe to the exact event or state change before triggering the action, then await that signal with a bounded timeout.\",\n\t},\n\t{\n\t\tid: \"mock-contract-integrity\",\n\t\tconcern: \"mock-contracts\",\n\t\tdirective:\n\t\t\t\"Mocks must preserve the behavior being asserted; do not isolate so heavily that the integration under test cannot fail.\",\n\t},\n\t{\n\t\tid: \"prompt-behavior-coverage\",\n\t\tconcern: \"prompt-tests\",\n\t\tdirective:\n\t\t\t\"Never pin prose, prompt wording, or doc text with a test; test only machine-consumed values (parsed fields, sentinel tokens, shipped-copy equality). A pure-prose change ships with no new test.\",\n\t},\n\t{\n\t\tid: \"single-pass-runner\",\n\t\tconcern: \"test-runner\",\n\t\tdirective:\n\t\t\t\"Run the relevant test command once and make that pass reliable; for Bun test targets, bun test must pass in a single run.\",\n\t},\n] as const satisfies readonly TestDisciplineRule[];\n\nexport function buildTestDisciplineSection(): string {\n\tconst lines = [\"### Test Discipline\"];\n\tfor (const rule of TEST_DISCIPLINE_RULES) {\n\t\tlines.push(`- ${rule.directive}`);\n\t}\n\treturn lines.join(\"\\n\");\n}\n\nexport function buildVerificationSection(): string {\n\treturn `## Verification\n\nTier the scope, never the rigor.\n\n- V1 — single-file non-behavioral edits: diagnostics on that file. Done.\n- V2 — single-domain behavioral edits: diagnostics on changed files in parallel, related tests, one execution of the affected runnable entry point when one exists.\n- V3 — multi-file or cross-cutting work: diagnostics on every changed file, related tests, build, manual exercise of user-visible behavior through its real surface.\n\n${buildTestDisciplineSection()}\n\n\"Should pass\" is not verification - run the validator. Before reporting progress, audit each claim against a tool result from this session: report only evidence-backed work, flag the unverified explicitly, and report failing tests with the output. Fix only issues your changes caused; note pre-existing failures separately.`;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"working-task.d.ts","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/working-task.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,IAAI,MAAM,CAQhD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function buildWorkingTaskSection() {
|
|
2
|
+
return `## Working the Task
|
|
3
|
+
|
|
4
|
+
Fire independent tool calls as one parallel wave - reads, searches, listings, diagnostics - and bias toward breadth when context is thin: pull in anything even loosely relevant now instead of serially later. Wasted reads cost almost nothing; stale assumptions cost the turn. Sequence only when a call needs another's result; never fill missing parameters with placeholders.
|
|
5
|
+
|
|
6
|
+
Memory of file contents is unreliable - read before claiming, re-read before editing. Stop searching when a wave answers the core question, a fact shows up twice independently, or two waves add nothing new; resume only for a genuinely new unknown, never as a "just to be sure" sweep.
|
|
7
|
+
|
|
8
|
+
Make one reasonable plan and execute it; reopen it only when new evidence contradicts it. Do not re-derive facts already established in the conversation or re-litigate decisions the user has made. When weighing a choice, give a recommendation, not a survey. When a delegation tool is available, hand sizeable independent tracks to subagents and keep working while they run; keep work you can finish in a few calls yourself.`;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=working-task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"working-task.js","sourceRoot":"","sources":["../../../src/core/dynamic-prompt/working-task.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,uBAAuB;IACtC,OAAO;;;;;;waAMga,CAAC;AACza,CAAC","sourcesContent":["export function buildWorkingTaskSection(): string {\n\treturn `## Working the Task\n\nFire independent tool calls as one parallel wave - reads, searches, listings, diagnostics - and bias toward breadth when context is thin: pull in anything even loosely relevant now instead of serially later. Wasted reads cost almost nothing; stale assumptions cost the turn. Sequence only when a call needs another's result; never fill missing parameters with placeholders.\n\nMemory of file contents is unreliable - read before claiming, re-read before editing. Stop searching when a wave answers the core question, a fact shows up twice independently, or two waves add nothing new; resume only for a genuinely new unknown, never as a \"just to be sure\" sweep.\n\nMake one reasonable plan and execute it; reopen it only when new evidence contradicts it. Do not re-derive facts already established in the conversation or re-litigate decisions the user has made. When weighing a choice, give a recommendation, not a survey. When a delegation tool is available, hand sizeable independent tracks to subagents and keep working while they run; keep work you can finish in a few calls yourself.`;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtensionAPI } from "../../types.ts";
|
|
2
|
-
export type { BashTimeoutDefaults, BashToolInputLike } from "./timeout.ts";
|
|
2
|
+
export type { BashTimeoutDefaults, BashTimeoutPromptOptions, BashToolInputLike } from "./timeout.ts";
|
|
3
3
|
export { applyBashTimeout, BASH_DEFAULT_TIMEOUT_SECONDS, BASH_MAX_TIMEOUT_SECONDS, buildBashTimeoutPrompt, resolveBashTimeoutDefaults, } from "./timeout.ts";
|
|
4
4
|
export default function bashTimeoutExtension(pi: ExtensionAPI): void;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/bash-timeout/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/bash-timeout/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAYrE,YAAY,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACrG,OAAO,EACN,gBAAgB,EAChB,4BAA4B,EAC5B,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,GAC1B,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAgCnE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isAnthropicBashEnabled } from "../anthropic-bash/index.js";
|
|
2
|
+
import { isEvalOnlyRouting } from "../eval-only-routing.js";
|
|
2
3
|
import { resolveForegroundWindowSeconds } from "../terminal/tools/foreground-window.js";
|
|
3
4
|
import { applyBashTimeout, buildBashTimeoutPrompt, resolveBashTimeoutDefaults, } from "./timeout.js";
|
|
4
5
|
export { applyBashTimeout, BASH_DEFAULT_TIMEOUT_SECONDS, BASH_MAX_TIMEOUT_SECONDS, buildBashTimeoutPrompt, resolveBashTimeoutDefaults, } from "./timeout.js";
|
|
@@ -27,7 +28,12 @@ export default function bashTimeoutExtension(pi) {
|
|
|
27
28
|
return resolveForegroundWindowSeconds(env);
|
|
28
29
|
};
|
|
29
30
|
pi.on("before_agent_start", async (event, ctx) => {
|
|
30
|
-
|
|
31
|
+
const foregroundWindowSeconds = resolveWindow(ctx);
|
|
32
|
+
const prompt = buildBashTimeoutPrompt(defaults, {
|
|
33
|
+
...(foregroundWindowSeconds === undefined ? {} : { foregroundWindowSeconds }),
|
|
34
|
+
evalOnly: isEvalOnlyRouting(pi),
|
|
35
|
+
});
|
|
36
|
+
return { systemPrompt: `${event.systemPrompt}${prompt}` };
|
|
31
37
|
});
|
|
32
38
|
}
|
|
33
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/bash-timeout/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AAExF,OAAO,EACN,gBAAgB,EAEhB,sBAAsB,EACtB,0BAA0B,GAC1B,MAAM,cAAc,CAAC;AAGtB,OAAO,EACN,gBAAgB,EAChB,4BAA4B,EAC5B,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,GAC1B,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAAgB;IAC5D,MAAM,GAAG,GAAG,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,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C,CAAC,CAAC,EAAE,uBAAuB,EAAE,CAAC;YAC7E,QAAQ,EAAE,iBAAiB,CAAC,EAAE,CAAC;SAC/B,CAAC,CAAC;QACH,OAAO,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,YAAY,GAAG,MAAM,EAAE,EAAE,CAAC;IAC3D,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { ExtensionAPI, ExtensionContext } from \"../../types.ts\";\nimport { isAnthropicBashEnabled } from \"../anthropic-bash/index.ts\";\nimport { isEvalOnlyRouting } from \"../eval-only-routing.ts\";\nimport { resolveForegroundWindowSeconds } from \"../terminal/tools/foreground-window.ts\";\n\nimport {\n\tapplyBashTimeout,\n\ttype BashToolInputLike,\n\tbuildBashTimeoutPrompt,\n\tresolveBashTimeoutDefaults,\n} from \"./timeout.ts\";\n\nexport type { BashTimeoutDefaults, BashTimeoutPromptOptions, BashToolInputLike } from \"./timeout.ts\";\nexport {\n\tapplyBashTimeout,\n\tBASH_DEFAULT_TIMEOUT_SECONDS,\n\tBASH_MAX_TIMEOUT_SECONDS,\n\tbuildBashTimeoutPrompt,\n\tresolveBashTimeoutDefaults,\n} from \"./timeout.ts\";\n\nexport default function bashTimeoutExtension(pi: ExtensionAPI): void {\n\tconst env = typeof process !== \"undefined\" ? process.env : {};\n\tconst defaults = resolveBashTimeoutDefaults(env);\n\n\tpi.on(\"tool_call\", async (event) => {\n\t\tif (event.toolName !== \"bash\") return;\n\t\tconst input = event.input as BashToolInputLike;\n\t\tconst updated = applyBashTimeout(input, defaults);\n\t\tif (updated !== input) {\n\t\t\tconst timeout = updated.timeout;\n\t\t\tif (timeout !== undefined) input.timeout = timeout;\n\t\t}\n\t});\n\n\t/**\n\t * Native Anthropic bash replaces the PTY `bash` tool and the terminal\n\t * extension steps aside with it, so nothing implements the auto-detach the\n\t * policy would otherwise advertise.\n\t */\n\tconst resolveWindow = (ctx: ExtensionContext | undefined): number | undefined => {\n\t\tif (isAnthropicBashEnabled() && ctx?.model?.api === \"anthropic-messages\") return undefined;\n\t\treturn resolveForegroundWindowSeconds(env);\n\t};\n\n\tpi.on(\"before_agent_start\", async (event, ctx) => {\n\t\tconst foregroundWindowSeconds = resolveWindow(ctx);\n\t\tconst prompt = buildBashTimeoutPrompt(defaults, {\n\t\t\t...(foregroundWindowSeconds === undefined ? {} : { foregroundWindowSeconds }),\n\t\t\tevalOnly: isEvalOnlyRouting(pi),\n\t\t});\n\t\treturn { systemPrompt: `${event.systemPrompt}${prompt}` };\n\t});\n}\n"]}
|
|
@@ -12,12 +12,16 @@ export interface BashToolInputLike {
|
|
|
12
12
|
[key: string]: unknown;
|
|
13
13
|
}
|
|
14
14
|
export declare function applyBashTimeout<TInput extends BashToolInputLike>(input: TInput, defaults: BashTimeoutDefaults): TInput;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
export interface BashTimeoutPromptOptions {
|
|
16
|
+
/**
|
|
17
|
+
* `undefined` when no PTY bash tool is live (native Anthropic bash replaces
|
|
18
|
+
* it). Nothing implements auto-detach then, so the policy must not promise
|
|
19
|
+
* it — a prompt that describes impossible behavior is worse than a silent one.
|
|
20
|
+
*/
|
|
21
|
+
readonly foregroundWindowSeconds?: number;
|
|
22
|
+
/** True when the session routes shell tools through eval cells, so call shapes must be `tool.<name>(`. */
|
|
23
|
+
readonly evalOnly?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function buildBashTimeoutPrompt(defaults: BashTimeoutDefaults, options?: BashTimeoutPromptOptions): string;
|
|
22
26
|
export {};
|
|
23
27
|
//# sourceMappingURL=timeout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeout.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/bash-timeout/timeout.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,OAAO,CAAC;AACjD,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C,MAAM,WAAW,mBAAmB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,KAAK,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AASlD,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,GAAG,mBAAmB,CAM5E;AAED,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,SAAS,iBAAiB,EAChE,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,mBAAmB,GAC3B,MAAM,CAMR;AAED
|
|
1
|
+
{"version":3,"file":"timeout.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/bash-timeout/timeout.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,OAAO,CAAC;AACjD,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C,MAAM,WAAW,mBAAmB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,KAAK,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AASlD,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,GAAG,mBAAmB,CAM5E;AAED,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,SAAS,iBAAiB,EAChE,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,mBAAmB,GAC3B,MAAM,CAMR;AAED,MAAM,WAAW,wBAAwB;IACxC;;;;OAIG;IACH,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAC1C,0GAA0G;IAC1G,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,OAAO,GAAE,wBAA6B,GAAG,MAAM,CASpH"}
|
|
@@ -22,17 +22,13 @@ export function applyBashTimeout(input, defaults) {
|
|
|
22
22
|
}
|
|
23
23
|
return input;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* policy must not promise it — a prompt that describes impossible behavior is
|
|
29
|
-
* worse than a silent one.
|
|
30
|
-
*/
|
|
31
|
-
export function buildBashTimeoutPrompt(defaults, foregroundWindowSeconds) {
|
|
25
|
+
export function buildBashTimeoutPrompt(defaults, options = {}) {
|
|
26
|
+
const { foregroundWindowSeconds, evalOnly = false } = options;
|
|
27
|
+
const monitor = evalOnly ? "tool.monitor" : "monitor";
|
|
32
28
|
const minutes = (seconds) => (seconds % 60 === 0 ? `${seconds / 60} min` : `${seconds}s`);
|
|
33
29
|
const detachRules = foregroundWindowSeconds === undefined
|
|
34
30
|
? ""
|
|
35
31
|
: `\n- Foreground blocking stops at the ~${foregroundWindowSeconds}s window. A command still running then auto-detaches alive to a background session with a \`bash_id\` and keeps running until it exits, hits the kill deadline, or is stopped with \`kill_bash\`.\n- Completion arrives automatically as a notification carrying the exit status and output tail, so end your turn rather than poll. Use \`bash_output\` only for a midpoint peek.`;
|
|
36
|
-
return `\n## Bash Tool Timeout Policy\n\nThe \`bash\` tool's \`timeout\` parameter is the process kill deadline, not how long you wait for output: the command is killed when it reaches the deadline.\n\n- Default timeout: ${defaults.defaultSeconds}s (${minutes(defaults.defaultSeconds)}). Applied automatically when you do not set \`timeout\`.\n- Recommended maximum timeout: ${defaults.maxSeconds}s (${minutes(defaults.maxSeconds)}). Explicit \`timeout\` values are preserved because different hosts may use different timeout units.${detachRules}\n- Waiting on an observable condition (a log line, a CI check, a server coming up) belongs to
|
|
32
|
+
return `\n## Bash Tool Timeout Policy\n\nThe \`bash\` tool's \`timeout\` parameter is the process kill deadline, not how long you wait for output: the command is killed when it reaches the deadline.\n\n- Default timeout: ${defaults.defaultSeconds}s (${minutes(defaults.defaultSeconds)}). Applied automatically when you do not set \`timeout\`.\n- Recommended maximum timeout: ${defaults.maxSeconds}s (${minutes(defaults.maxSeconds)}). Explicit \`timeout\` values are preserved because different hosts may use different timeout units.${detachRules}\n- Waiting on an observable condition (a log line, a CI check, a server coming up) belongs to \`${monitor}({command, filter})\`, never a foreground \`sleep\` or poll loop.\n- Sessions started with \`run_in_background: true\` ignore \`timeout\` and live until exit or \`kill_bash\`.\n`;
|
|
37
33
|
}
|
|
38
34
|
//# sourceMappingURL=timeout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeout.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/bash-timeout/timeout.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AACjD,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAS7C,SAAS,gBAAgB,CAAC,KAAyB;IAClD,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IAC9D,OAAO,MAAM,CAAC;AACf,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,GAAY;IACtD,MAAM,EAAE,+BAA+B,EAAE,cAAc,EAAE,2BAA2B,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC;IACzG,MAAM,cAAc,GAAG,gBAAgB,CAAC,cAAc,CAAC,IAAI,4BAA4B,CAA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BASH_DEFAULT_TIMEOUT_SECONDS = 1800;\nexport const BASH_MAX_TIMEOUT_SECONDS = 1800;\n\nexport interface BashTimeoutDefaults {\n\tdefaultSeconds: number;\n\tmaxSeconds: number;\n}\n\ntype EnvLike = Record<string, string | undefined>;\n\nfunction parsePositiveInt(value: string | undefined): number | undefined {\n\tif (!value) return undefined;\n\tconst parsed = Number.parseInt(value, 10);\n\tif (!Number.isFinite(parsed) || parsed <= 0) return undefined;\n\treturn parsed;\n}\n\nexport function resolveBashTimeoutDefaults(env: EnvLike): BashTimeoutDefaults {\n\tconst { PI_BASH_DEFAULT_TIMEOUT_SECONDS: defaultTimeout, PI_BASH_MAX_TIMEOUT_SECONDS: maxTimeout } = env;\n\tconst defaultSeconds = parsePositiveInt(defaultTimeout) ?? BASH_DEFAULT_TIMEOUT_SECONDS;\n\tconst rawMax = parsePositiveInt(maxTimeout) ?? BASH_MAX_TIMEOUT_SECONDS;\n\tconst maxSeconds = Math.max(rawMax, defaultSeconds);\n\treturn { defaultSeconds, maxSeconds };\n}\n\nexport interface BashToolInputLike {\n\tcommand: string;\n\ttimeout?: number;\n\t[key: string]: unknown;\n}\n\nexport function applyBashTimeout<TInput extends BashToolInputLike>(\n\tinput: TInput,\n\tdefaults: BashTimeoutDefaults,\n): TInput {\n\tconst current = input.timeout;\n\tif (current === undefined || current <= 0) {\n\t\treturn { ...input, timeout: defaults.defaultSeconds };\n\t}\n\treturn input;\n}\n\nexport interface BashTimeoutPromptOptions {\n\t/**\n\t * `undefined` when no PTY bash tool is live (native Anthropic bash replaces\n\t * it). Nothing implements auto-detach then, so the policy must not promise\n\t * it — a prompt that describes impossible behavior is worse than a silent one.\n\t */\n\treadonly foregroundWindowSeconds?: number;\n\t/** True when the session routes shell tools through eval cells, so call shapes must be `tool.<name>(`. */\n\treadonly evalOnly?: boolean;\n}\n\nexport function buildBashTimeoutPrompt(defaults: BashTimeoutDefaults, options: BashTimeoutPromptOptions = {}): string {\n\tconst { foregroundWindowSeconds, evalOnly = false } = options;\n\tconst monitor = evalOnly ? \"tool.monitor\" : \"monitor\";\n\tconst minutes = (seconds: number): string => (seconds % 60 === 0 ? `${seconds / 60} min` : `${seconds}s`);\n\tconst detachRules =\n\t\tforegroundWindowSeconds === undefined\n\t\t\t? \"\"\n\t\t\t: `\\n- Foreground blocking stops at the ~${foregroundWindowSeconds}s window. A command still running then auto-detaches alive to a background session with a \\`bash_id\\` and keeps running until it exits, hits the kill deadline, or is stopped with \\`kill_bash\\`.\\n- Completion arrives automatically as a notification carrying the exit status and output tail, so end your turn rather than poll. Use \\`bash_output\\` only for a midpoint peek.`;\n\treturn `\\n## Bash Tool Timeout Policy\\n\\nThe \\`bash\\` tool's \\`timeout\\` parameter is the process kill deadline, not how long you wait for output: the command is killed when it reaches the deadline.\\n\\n- Default timeout: ${defaults.defaultSeconds}s (${minutes(defaults.defaultSeconds)}). Applied automatically when you do not set \\`timeout\\`.\\n- Recommended maximum timeout: ${defaults.maxSeconds}s (${minutes(defaults.maxSeconds)}). Explicit \\`timeout\\` values are preserved because different hosts may use different timeout units.${detachRules}\\n- Waiting on an observable condition (a log line, a CI check, a server coming up) belongs to \\`${monitor}({command, filter})\\`, never a foreground \\`sleep\\` or poll loop.\\n- Sessions started with \\`run_in_background: true\\` ignore \\`timeout\\` and live until exit or \\`kill_bash\\`.\\n`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-lane.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/claude-sdk-oauth/auth-lane.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAM7D,OAAO,EACN,KAAK,WAAW,EAMhB,KAAK,aAAa,EAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,KAAK,yBAAyB,EAAyB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAMlH,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAA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UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC1C,KAAK,EAAE,QAAQ,CAAC;IAChB,YAAY,EAAE,CAAC,IAAI,EAAE,4BAA4B,KAAK,OAAO,CAAC;IAC9D,gBAAgB,EAAE,8BAA8B,CAAC;IACjD,kGAAkG;IAClG,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0FAA0F;IAC1F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IAChD,aAAa,CAAC,EAAE,CACf,KAAK,EAAE,yBAAyB,KAC5B,iBAAiB,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;CAC5E,CAAC;AAUF,wBAAgB,oBAAoB,CACnC,QAAQ,EAAE,8BAA8B,EACxC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAC9B,4BAA4B,CAE9B;AAmFD,2GAA2G;AAC3G,wBAAuB,iBAAiB,CAAC,KAAK,EAAE,uBAAuB,GAAG,cAAc,CAAC,UAAU,CAAC,CAwDnG"}
|
|
@@ -8,11 +8,14 @@ import { selectAccount } from "./affinity.js";
|
|
|
8
8
|
import { createAttemptMessages } from "./auth-attempt.js";
|
|
9
9
|
import { hasRequestOauthToken, mergeRequestAuthEnvironment, stripManagedAuthEnvironment } from "./auth-environment.js";
|
|
10
10
|
import { writeConfigDirCredential } from "./config-dir-credentials.js";
|
|
11
|
-
import { classifySdkError } from "./errors.js";
|
|
11
|
+
import { classifySdkError, sdkAssistantFailure, sdkResultFailure } from "./errors.js";
|
|
12
12
|
import { runFailover } from "./failover.js";
|
|
13
13
|
import { refusalError } from "./refusal.js";
|
|
14
14
|
export { CLAUDE_SDK_OAUTH_PROVIDER_ID } from "./account-management.js";
|
|
15
15
|
export const EXPIRING_WITHIN_MS = 5 * 60_000;
|
|
16
|
+
/** A managed lane with an empty pool must refuse rather than spawn the SDK against ambient host credentials. */
|
|
17
|
+
const NO_MANAGED_ACCOUNTS_ERROR = "authentication_failed: No Claude SDK OAuth accounts configured for the managed lane; " +
|
|
18
|
+
"run /login claude-sdk-oauth or set CLAUDE_CODE_OAUTH_TOKEN";
|
|
16
19
|
async function refreshWithAnthropicOAuth(refresh, signal) {
|
|
17
20
|
const oauth = await loadAnthropicOAuth();
|
|
18
21
|
const credential = await oauth.refresh({ type: "oauth", access: "", refresh, expires: 0 }, signal);
|
|
@@ -46,8 +49,10 @@ async function managedPool(settings, requestEnvironment) {
|
|
|
46
49
|
}
|
|
47
50
|
const configuredLane = resolveEffectiveLane(settings, accounts);
|
|
48
51
|
const lane = configuredLane === "config-dir" && hasRequestOauthToken(requestEnvironment) ? "oauth-slots" : configuredLane;
|
|
49
|
-
if (lane === "ambient"
|
|
52
|
+
if (lane === "ambient")
|
|
50
53
|
return undefined;
|
|
54
|
+
if (accounts.length === 0)
|
|
55
|
+
throw new Error(NO_MANAGED_ACCOUNTS_ERROR);
|
|
51
56
|
const stored = credential?.type === "oauth" ? credential : undefined;
|
|
52
57
|
return { accounts, environment, lane, pinnedAccount: settings.pinnedAccount ?? stored?.pinned, store };
|
|
53
58
|
}
|
|
@@ -65,7 +70,10 @@ async function prepareSlot(pool, selected, signal) {
|
|
|
65
70
|
}
|
|
66
71
|
catch (error) {
|
|
67
72
|
const detail = error instanceof Error ? error.message : String(error);
|
|
68
|
-
|
|
73
|
+
const classification = classifySdkError(detail);
|
|
74
|
+
throw new Error(classification.kind === "other" && classification.retryable
|
|
75
|
+
? `server_error: ${detail}`
|
|
76
|
+
: `authentication_failed: ${detail}`);
|
|
69
77
|
}
|
|
70
78
|
}
|
|
71
79
|
const access = slot.source === "env" ? envSlotToken((name) => environment[name], slot.name) : slot.access;
|
|
@@ -81,21 +89,10 @@ function sdkFailure(message) {
|
|
|
81
89
|
const refusal = refusalError(message);
|
|
82
90
|
if (refusal)
|
|
83
91
|
return refusal;
|
|
84
|
-
if (message.type === "assistant"
|
|
85
|
-
return message
|
|
86
|
-
if (message.type === "result"
|
|
87
|
-
|
|
88
|
-
if (errors.length > 0)
|
|
89
|
-
return new Error(String(errors[0]));
|
|
90
|
-
// `subtype` alone is too coarse to classify: a subscription limit and an
|
|
91
|
-
// ordinary tool failure both arrive as "error_during_execution". The SDK
|
|
92
|
-
// carries the real cause in `terminal_reason` (e.g. "blocking_limit"), so
|
|
93
|
-
// append it — otherwise classifySdkError() scores every result error as
|
|
94
|
-
// non-retryable "other", the exhausted account is never blocked, and a
|
|
95
|
-
// multi-account pool never rotates past it.
|
|
96
|
-
const reason = "terminal_reason" in message && typeof message.terminal_reason === "string" ? message.terminal_reason : "";
|
|
97
|
-
return new Error(reason ? `Claude Code ${message.subtype}: ${reason}` : `Claude Code ${message.subtype}`);
|
|
98
|
-
}
|
|
92
|
+
if (message.type === "assistant")
|
|
93
|
+
return sdkAssistantFailure(message);
|
|
94
|
+
if (message.type === "result")
|
|
95
|
+
return sdkResultFailure(message);
|
|
99
96
|
return undefined;
|
|
100
97
|
}
|
|
101
98
|
function visibleSdkMessage(message) {
|