@code-yeongyu/senpi 2026.9.3 → 2026.9.4
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 +75 -0
- package/dist/core/agent-session.d.ts +2 -5
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +32 -29
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/dynamic-prompt/style.js +1 -1
- package/dist/core/dynamic-prompt/style.js.map +1 -1
- package/dist/core/dynamic-prompt/working-task.js +1 -1
- package/dist/core/dynamic-prompt/working-task.js.map +1 -1
- 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/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 +13 -6
- 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/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-opus-4-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js +1 -3
- 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 +1 -11
- 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.js +2 -2
- 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.js +3 -3
- 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 +56 -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 +4 -15
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.js +12 -21
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.js.map +1 -1
- 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/gpt-5.6.d.ts +1 -5
- 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 +1 -6
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts +123 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +202 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-eval-routing.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-eval-routing.js +1 -2
- package/dist/core/extensions/builtin/prompt-preset/gpt-eval-routing.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 +60 -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 +17 -0
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.js +1 -0
- package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.js +5 -2
- package/dist/core/extensions/builtin/terminal/extension.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 +18 -7
- package/dist/core/extensions/builtin/terminal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/tool-search/native-search.d.ts +1 -1
- package/dist/core/extensions/builtin/tool-search/native-search.d.ts.map +1 -1
- package/dist/core/extensions/builtin/tool-search/native-search.js +1 -1
- package/dist/core/extensions/builtin/tool-search/native-search.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/detectors/collapse-paragraphs.d.ts +34 -0
- package/dist/core/extensions/builtin/ttsr/detectors/collapse-paragraphs.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ttsr/detectors/collapse-paragraphs.js +121 -0
- package/dist/core/extensions/builtin/ttsr/detectors/collapse-paragraphs.js.map +1 -0
- package/dist/core/extensions/builtin/ttsr/detectors/collapse.d.ts +2 -0
- package/dist/core/extensions/builtin/ttsr/detectors/collapse.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/detectors/collapse.js +6 -2
- package/dist/core/extensions/builtin/ttsr/detectors/collapse.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +18 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +0 -4
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +0 -6
- package/dist/core/settings-manager.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/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.js +3 -0
- package/dist/modes/rpc/multi-session-host.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +8 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +11 -0
- package/dist/modes/rpc/rpc-client.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.map +1 -1
- package/dist/modes/rpc/session-command-router.js +2 -1
- package/dist/modes/rpc/session-command-router.js.map +1 -1
- package/dist/modes/rpc/session-event-fanout.d.ts +13 -2
- package/dist/modes/rpc/session-event-fanout.d.ts.map +1 -1
- package/dist/modes/rpc/session-event-fanout.js +36 -12
- package/dist/modes/rpc/session-event-fanout.js.map +1 -1
- package/dist/modes/rpc/session-event-writer.d.ts +3 -1
- package/dist/modes/rpc/session-event-writer.d.ts.map +1 -1
- package/dist/modes/rpc/session-event-writer.js +23 -13
- package/dist/modes/rpc/session-event-writer.js.map +1 -1
- 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 +104 -0
- package/docs/settings.md +5 -27
- 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 +38 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +17 -0
- 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 +14 -6
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +2 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +1 -0
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/context-room.d.ts +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/context-room.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/context-room.js +40 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/context-room.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts +1 -3
- 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 +2 -16
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.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/models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +3 -2
- 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/azure-openai-responses.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/openai-codex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.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/overflow.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.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
|
@@ -2,10 +2,18 @@ import type { Context, Tool } from "@earendil-works/pi-ai";
|
|
|
2
2
|
import type { Options } from "./sdk-boundary.ts";
|
|
3
3
|
export declare const SDK_TO_PI_TOOL_NAME: Readonly<Record<string, string>>;
|
|
4
4
|
export declare const PI_TO_SDK_TOOL_NAME: Readonly<Record<string, string>>;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Versioned host-tool denial policy. `configFingerprint` in session-sync.ts hashes this as
|
|
7
|
+
* `hostToolPolicy` into `toolsetHash`; a mismatch is `options_changed` and retires the live
|
|
8
|
+
* resident query. The same hash is persisted in the restart sidecar, so a bump also makes
|
|
9
|
+
* the first admission after an upgrade cold-seed (`flatten` / `options_changed`) instead of
|
|
10
|
+
* resuming the pre-bump SDK session - once per session, intended. Bump when denial copy or
|
|
11
|
+
* hooks change so wording-only edits cannot keep serving the old reason.
|
|
12
|
+
*/
|
|
13
|
+
export declare const HOST_TOOL_POLICY_FINGERPRINT = "host-tool-denial-v2";
|
|
6
14
|
export declare const BUILTIN_SDK_TOOLS: readonly ["Read", "Write", "Edit", "Bash", "Grep", "Glob"];
|
|
7
|
-
export declare const TOOL_EXECUTION_DENIED_MESSAGE
|
|
8
|
-
export declare const HOST_TOOL_EXECUTION_DENIED_MESSAGE
|
|
15
|
+
export declare const TOOL_EXECUTION_DENIED_MESSAGE: string;
|
|
16
|
+
export declare const HOST_TOOL_EXECUTION_DENIED_MESSAGE: string;
|
|
9
17
|
export declare const CUSTOM_TOOLS_MCP_SERVER_NAME = "custom-tools";
|
|
10
18
|
export declare const CUSTOM_TOOLS_MCP_PREFIX = "mcp__custom-tools__";
|
|
11
19
|
export declare const HOST_CAPTURED_SDK_TOOL_MATCHER = "Bash|Write|Edit|Read|Grep|Glob|mcp__custom-tools__.*";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/claude-sdk-oauth/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOhE,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQhE,CAAC;AAEF,eAAO,MAAM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MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAQ1G;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAQzG;AAED,qFAAqF;AACrF,wBAAgB,WAAW,CAC1B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,GACjD,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuCzB;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB,CA6BlE;AAED,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,CAGxD,CAAC"}
|
|
@@ -15,10 +15,19 @@ export const PI_TO_SDK_TOOL_NAME = {
|
|
|
15
15
|
find: "Glob",
|
|
16
16
|
glob: "Glob",
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Versioned host-tool denial policy. `configFingerprint` in session-sync.ts hashes this as
|
|
20
|
+
* `hostToolPolicy` into `toolsetHash`; a mismatch is `options_changed` and retires the live
|
|
21
|
+
* resident query. The same hash is persisted in the restart sidecar, so a bump also makes
|
|
22
|
+
* the first admission after an upgrade cold-seed (`flatten` / `options_changed`) instead of
|
|
23
|
+
* resuming the pre-bump SDK session - once per session, intended. Bump when denial copy or
|
|
24
|
+
* hooks change so wording-only edits cannot keep serving the old reason.
|
|
25
|
+
*/
|
|
26
|
+
export const HOST_TOOL_POLICY_FINGERPRINT = "host-tool-denial-v2";
|
|
19
27
|
export const BUILTIN_SDK_TOOLS = ["Read", "Write", "Edit", "Bash", "Grep", "Glob"];
|
|
20
|
-
export const TOOL_EXECUTION_DENIED_MESSAGE = "
|
|
21
|
-
|
|
28
|
+
export const TOOL_EXECUTION_DENIED_MESSAGE = "Senpi executes this tool on the host and returns its result as the next user message. " +
|
|
29
|
+
"Wait for that result; this denial is not a failure.";
|
|
30
|
+
export const HOST_TOOL_EXECUTION_DENIED_MESSAGE = TOOL_EXECUTION_DENIED_MESSAGE;
|
|
22
31
|
export const CUSTOM_TOOLS_MCP_SERVER_NAME = "custom-tools";
|
|
23
32
|
export const CUSTOM_TOOLS_MCP_PREFIX = `mcp__${CUSTOM_TOOLS_MCP_SERVER_NAME}__`;
|
|
24
33
|
export const HOST_CAPTURED_SDK_TOOL_MATCHER = "Bash|Write|Edit|Read|Grep|Glob|mcp__custom-tools__.*";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/claude-sdk-oauth/tools.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,mBAAmB,GAAqC;IACpE,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;CACZ,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAqC;IACpE,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;CACZ,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,qBAAqB,CAAC;AAElE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAC5F,MAAM,CAAC,MAAM,6BAA6B,GAAG,oDAAoD,CAAC;AAClG,MAAM,CAAC,MAAM,kCAAkC,GAC9C,mGAAmG,CAAC;AACrG,MAAM,CAAC,MAAM,4BAA4B,GAAG,cAAc,CAAC;AAC3D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AAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAC3C,MAAM,OAAO,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAChD,IAAI,OAAO,EAAE,CAAC;YACb,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACtB,SAAS;QACV,CAAC;QACD,MAAM,aAAa,GAAG,GAAG,uBAAuB,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC/D,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAClD,mBAAmB,CAAC,GAAG,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QACnD,kBAAkB,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,kBAAkB,CAAC,GAAG,CAAC,aAAa,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC;AAC1F,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAuC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC1E,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,6BAA6B;CACtC,CAAC,CAAC","sourcesContent":["import type { Context, Tool } from \"@earendil-works/pi-ai\";\nimport type { Options } from \"./sdk-boundary.ts\";\n\nexport const SDK_TO_PI_TOOL_NAME: Readonly<Record<string, string>> = {\n\tread: \"read\",\n\twrite: \"write\",\n\tedit: \"edit\",\n\tbash: \"bash\",\n\tgrep: \"grep\",\n\tglob: \"find\",\n};\n\nexport const PI_TO_SDK_TOOL_NAME: Readonly<Record<string, string>> = {\n\tread: \"Read\",\n\twrite: \"Write\",\n\tedit: \"Edit\",\n\tbash: \"Bash\",\n\tgrep: \"Grep\",\n\tfind: \"Glob\",\n\tglob: \"Glob\",\n};\n\nexport const HOST_TOOL_POLICY_FINGERPRINT = \"host-tool-denial-v1\";\n\nexport const BUILTIN_SDK_TOOLS = [\"Read\", \"Write\", \"Edit\", \"Bash\", \"Grep\", \"Glob\"] as const;\nexport const TOOL_EXECUTION_DENIED_MESSAGE = \"Tool execution is unavailable in this environment.\";\nexport const HOST_TOOL_EXECUTION_DENIED_MESSAGE =\n\t\"This tool call is captured and executed by the host. Do not retry with other tools; end the turn.\";\nexport const CUSTOM_TOOLS_MCP_SERVER_NAME = \"custom-tools\";\nexport const CUSTOM_TOOLS_MCP_PREFIX = `mcp__${CUSTOM_TOOLS_MCP_SERVER_NAME}__`;\nexport const HOST_CAPTURED_SDK_TOOL_MATCHER = \"Bash|Write|Edit|Read|Grep|Glob|mcp__custom-tools__.*\";\nexport const HOST_TOOL_DENIAL_HOOKS: NonNullable<Options[\"hooks\"]> = {\n\tPreToolUse: [\n\t\t{\n\t\t\tmatcher: HOST_CAPTURED_SDK_TOOL_MATCHER,\n\t\t\thooks: [\n\t\t\t\tasync () => ({\n\t\t\t\t\tcontinue: false,\n\t\t\t\t\thookSpecificOutput: {\n\t\t\t\t\t\thookEventName: \"PreToolUse\",\n\t\t\t\t\t\tpermissionDecision: \"deny\",\n\t\t\t\t\t\tpermissionDecisionReason: HOST_TOOL_EXECUTION_DENIED_MESSAGE,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport type ResolvedSdkTools = {\n\tsdkTools: string[];\n\tcustomTools: Tool[];\n\tcustomToolNameToSdk: Map<string, string>;\n\tcustomToolNameToPi: Map<string, string>;\n};\n\nfunction pascalCase(value: string): string {\n\treturn value\n\t\t.split(/[^a-zA-Z0-9]+/)\n\t\t.filter(Boolean)\n\t\t.map((part) => `${part[0]?.toUpperCase() ?? \"\"}${part.slice(1)}`)\n\t\t.join(\"\");\n}\n\nexport function mapPiToolNameToSdk(name: string, customToolNameToSdk?: ReadonlyMap<string, string>): string {\n\tconst normalized = name.toLowerCase();\n\treturn (\n\t\tcustomToolNameToSdk?.get(name) ??\n\t\tcustomToolNameToSdk?.get(normalized) ??\n\t\tPI_TO_SDK_TOOL_NAME[normalized] ??\n\t\tpascalCase(name)\n\t);\n}\n\nexport function mapSdkToolNameToPi(name: string, customToolNameToPi?: ReadonlyMap<string, string>): string {\n\tconst normalized = name.toLowerCase();\n\treturn (\n\t\tSDK_TO_PI_TOOL_NAME[normalized] ??\n\t\tcustomToolNameToPi?.get(name) ??\n\t\tcustomToolNameToPi?.get(normalized) ??\n\t\t(normalized.startsWith(CUSTOM_TOOLS_MCP_PREFIX) ? name.slice(CUSTOM_TOOLS_MCP_PREFIX.length) : name)\n\t);\n}\n\n/** Translate Claude Code's built-in-tool inputs into senpi's active tool schemas. */\nexport function mapToolArgs(\n\ttoolName: string,\n\targs: Readonly<Record<string, unknown>> | undefined,\n): Record<string, unknown> {\n\tconst input = args ?? {};\n\tswitch (toolName.toLowerCase()) {\n\t\tcase \"read\":\n\t\t\treturn { path: input.file_path ?? input.path, offset: input.offset, limit: input.limit };\n\t\tcase \"write\":\n\t\t\treturn { path: input.file_path ?? input.path, content: input.content };\n\t\tcase \"edit\":\n\t\t\treturn {\n\t\t\t\tpath: input.file_path ?? input.path,\n\t\t\t\tedits: Array.isArray(input.edits)\n\t\t\t\t\t? input.edits\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\toldText: input.old_string ?? input.oldText ?? input.old_text,\n\t\t\t\t\t\t\t\tnewText: input.new_string ?? input.newText ?? input.new_text,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t};\n\t\tcase \"bash\":\n\t\t\treturn {\n\t\t\t\tcommand: input.command,\n\t\t\t\ttimeout: typeof input.timeout === \"number\" ? input.timeout / 1_000 : input.timeout,\n\t\t\t};\n\t\tcase \"grep\":\n\t\t\treturn {\n\t\t\t\tpattern: input.pattern,\n\t\t\t\tpath: input.path,\n\t\t\t\tglob: input.glob,\n\t\t\t\tignoreCase: input[\"-i\"] ?? input.ignoreCase,\n\t\t\t\tcontext: input.context ?? input[\"-C\"],\n\t\t\t\tlimit: input.head_limit ?? input.limit,\n\t\t\t};\n\t\tcase \"glob\":\n\t\tcase \"find\":\n\t\t\treturn { pattern: input.pattern, path: input.path, limit: input.limit };\n\t\tdefault:\n\t\t\treturn { ...input };\n\t}\n}\n\nexport function resolveSdkTools(context: Context): ResolvedSdkTools {\n\tif (!context.tools) {\n\t\treturn {\n\t\t\tsdkTools: [...BUILTIN_SDK_TOOLS],\n\t\t\tcustomTools: [],\n\t\t\tcustomToolNameToSdk: new Map(),\n\t\t\tcustomToolNameToPi: new Map(),\n\t\t};\n\t}\n\n\tconst sdkTools = new Set<string>();\n\tconst customTools: Tool[] = [];\n\tconst customToolNameToSdk = new Map<string, string>();\n\tconst customToolNameToPi = new Map<string, string>();\n\tfor (const tool of context.tools) {\n\t\tconst normalized = tool.name.toLowerCase();\n\t\tconst sdkName = PI_TO_SDK_TOOL_NAME[normalized];\n\t\tif (sdkName) {\n\t\t\tsdkTools.add(sdkName);\n\t\t\tcontinue;\n\t\t}\n\t\tconst customSdkName = `${CUSTOM_TOOLS_MCP_PREFIX}${tool.name}`;\n\t\tcustomTools.push(tool);\n\t\tcustomToolNameToSdk.set(tool.name, customSdkName);\n\t\tcustomToolNameToSdk.set(normalized, customSdkName);\n\t\tcustomToolNameToPi.set(customSdkName, tool.name);\n\t\tcustomToolNameToPi.set(customSdkName.toLowerCase(), tool.name);\n\t}\n\treturn { sdkTools: [...sdkTools], customTools, customToolNameToSdk, customToolNameToPi };\n}\n\nexport const canUseTool: NonNullable<Options[\"canUseTool\"]> = async () => ({\n\tbehavior: \"deny\",\n\tmessage: TOOL_EXECUTION_DENIED_MESSAGE,\n});\n"]}
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/claude-sdk-o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G,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QACnD,kBAAkB,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,kBAAkB,CAAC,GAAG,CAAC,aAAa,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC;AAC1F,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAuC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC1E,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,6BAA6B;CACtC,CAAC,CAAC","sourcesContent":["import type { Context, Tool } from \"@earendil-works/pi-ai\";\nimport type { Options } from \"./sdk-boundary.ts\";\n\nexport const SDK_TO_PI_TOOL_NAME: Readonly<Record<string, string>> = {\n\tread: \"read\",\n\twrite: \"write\",\n\tedit: \"edit\",\n\tbash: \"bash\",\n\tgrep: \"grep\",\n\tglob: \"find\",\n};\n\nexport const PI_TO_SDK_TOOL_NAME: Readonly<Record<string, string>> = {\n\tread: \"Read\",\n\twrite: \"Write\",\n\tedit: \"Edit\",\n\tbash: \"Bash\",\n\tgrep: \"Grep\",\n\tfind: \"Glob\",\n\tglob: \"Glob\",\n};\n\n/**\n * Versioned host-tool denial policy. `configFingerprint` in session-sync.ts hashes this as\n * `hostToolPolicy` into `toolsetHash`; a mismatch is `options_changed` and retires the live\n * resident query. The same hash is persisted in the restart sidecar, so a bump also makes\n * the first admission after an upgrade cold-seed (`flatten` / `options_changed`) instead of\n * resuming the pre-bump SDK session - once per session, intended. Bump when denial copy or\n * hooks change so wording-only edits cannot keep serving the old reason.\n */\nexport const HOST_TOOL_POLICY_FINGERPRINT = \"host-tool-denial-v2\";\n\nexport const BUILTIN_SDK_TOOLS = [\"Read\", \"Write\", \"Edit\", \"Bash\", \"Grep\", \"Glob\"] as const;\nexport const TOOL_EXECUTION_DENIED_MESSAGE =\n\t\"Senpi executes this tool on the host and returns its result as the next user message. \" +\n\t\"Wait for that result; this denial is not a failure.\";\nexport const HOST_TOOL_EXECUTION_DENIED_MESSAGE = TOOL_EXECUTION_DENIED_MESSAGE;\nexport const CUSTOM_TOOLS_MCP_SERVER_NAME = \"custom-tools\";\nexport const CUSTOM_TOOLS_MCP_PREFIX = `mcp__${CUSTOM_TOOLS_MCP_SERVER_NAME}__`;\nexport const HOST_CAPTURED_SDK_TOOL_MATCHER = \"Bash|Write|Edit|Read|Grep|Glob|mcp__custom-tools__.*\";\nexport const HOST_TOOL_DENIAL_HOOKS: NonNullable<Options[\"hooks\"]> = {\n\tPreToolUse: [\n\t\t{\n\t\t\tmatcher: HOST_CAPTURED_SDK_TOOL_MATCHER,\n\t\t\thooks: [\n\t\t\t\tasync () => ({\n\t\t\t\t\tcontinue: false,\n\t\t\t\t\thookSpecificOutput: {\n\t\t\t\t\t\thookEventName: \"PreToolUse\",\n\t\t\t\t\t\tpermissionDecision: \"deny\",\n\t\t\t\t\t\tpermissionDecisionReason: HOST_TOOL_EXECUTION_DENIED_MESSAGE,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport type ResolvedSdkTools = {\n\tsdkTools: string[];\n\tcustomTools: Tool[];\n\tcustomToolNameToSdk: Map<string, string>;\n\tcustomToolNameToPi: Map<string, string>;\n};\n\nfunction pascalCase(value: string): string {\n\treturn value\n\t\t.split(/[^a-zA-Z0-9]+/)\n\t\t.filter(Boolean)\n\t\t.map((part) => `${part[0]?.toUpperCase() ?? \"\"}${part.slice(1)}`)\n\t\t.join(\"\");\n}\n\nexport function mapPiToolNameToSdk(name: string, customToolNameToSdk?: ReadonlyMap<string, string>): string {\n\tconst normalized = name.toLowerCase();\n\treturn (\n\t\tcustomToolNameToSdk?.get(name) ??\n\t\tcustomToolNameToSdk?.get(normalized) ??\n\t\tPI_TO_SDK_TOOL_NAME[normalized] ??\n\t\tpascalCase(name)\n\t);\n}\n\nexport function mapSdkToolNameToPi(name: string, customToolNameToPi?: ReadonlyMap<string, string>): string {\n\tconst normalized = name.toLowerCase();\n\treturn (\n\t\tSDK_TO_PI_TOOL_NAME[normalized] ??\n\t\tcustomToolNameToPi?.get(name) ??\n\t\tcustomToolNameToPi?.get(normalized) ??\n\t\t(normalized.startsWith(CUSTOM_TOOLS_MCP_PREFIX) ? name.slice(CUSTOM_TOOLS_MCP_PREFIX.length) : name)\n\t);\n}\n\n/** Translate Claude Code's built-in-tool inputs into senpi's active tool schemas. */\nexport function mapToolArgs(\n\ttoolName: string,\n\targs: Readonly<Record<string, unknown>> | undefined,\n): Record<string, unknown> {\n\tconst input = args ?? {};\n\tswitch (toolName.toLowerCase()) {\n\t\tcase \"read\":\n\t\t\treturn { path: input.file_path ?? input.path, offset: input.offset, limit: input.limit };\n\t\tcase \"write\":\n\t\t\treturn { path: input.file_path ?? input.path, content: input.content };\n\t\tcase \"edit\":\n\t\t\treturn {\n\t\t\t\tpath: input.file_path ?? input.path,\n\t\t\t\tedits: Array.isArray(input.edits)\n\t\t\t\t\t? input.edits\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\toldText: input.old_string ?? input.oldText ?? input.old_text,\n\t\t\t\t\t\t\t\tnewText: input.new_string ?? input.newText ?? input.new_text,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t};\n\t\tcase \"bash\":\n\t\t\treturn {\n\t\t\t\tcommand: input.command,\n\t\t\t\ttimeout: typeof input.timeout === \"number\" ? input.timeout / 1_000 : input.timeout,\n\t\t\t};\n\t\tcase \"grep\":\n\t\t\treturn {\n\t\t\t\tpattern: input.pattern,\n\t\t\t\tpath: input.path,\n\t\t\t\tglob: input.glob,\n\t\t\t\tignoreCase: input[\"-i\"] ?? input.ignoreCase,\n\t\t\t\tcontext: input.context ?? input[\"-C\"],\n\t\t\t\tlimit: input.head_limit ?? input.limit,\n\t\t\t};\n\t\tcase \"glob\":\n\t\tcase \"find\":\n\t\t\treturn { pattern: input.pattern, path: input.path, limit: input.limit };\n\t\tdefault:\n\t\t\treturn { ...input };\n\t}\n}\n\nexport function resolveSdkTools(context: Context): ResolvedSdkTools {\n\tif (!context.tools) {\n\t\treturn {\n\t\t\tsdkTools: [...BUILTIN_SDK_TOOLS],\n\t\t\tcustomTools: [],\n\t\t\tcustomToolNameToSdk: new Map(),\n\t\t\tcustomToolNameToPi: new Map(),\n\t\t};\n\t}\n\n\tconst sdkTools = new Set<string>();\n\tconst customTools: Tool[] = [];\n\tconst customToolNameToSdk = new Map<string, string>();\n\tconst customToolNameToPi = new Map<string, string>();\n\tfor (const tool of context.tools) {\n\t\tconst normalized = tool.name.toLowerCase();\n\t\tconst sdkName = PI_TO_SDK_TOOL_NAME[normalized];\n\t\tif (sdkName) {\n\t\t\tsdkTools.add(sdkName);\n\t\t\tcontinue;\n\t\t}\n\t\tconst customSdkName = `${CUSTOM_TOOLS_MCP_PREFIX}${tool.name}`;\n\t\tcustomTools.push(tool);\n\t\tcustomToolNameToSdk.set(tool.name, customSdkName);\n\t\tcustomToolNameToSdk.set(normalized, customSdkName);\n\t\tcustomToolNameToPi.set(customSdkName, tool.name);\n\t\tcustomToolNameToPi.set(customSdkName.toLowerCase(), tool.name);\n\t}\n\treturn { sdkTools: [...sdkTools], customTools, customToolNameToSdk, customToolNameToPi };\n}\n\nexport const canUseTool: NonNullable<Options[\"canUseTool\"]> = async () => ({\n\tbehavior: \"deny\",\n\tmessage: TOOL_EXECUTION_DENIED_MESSAGE,\n});\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "../types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The session withholds `bash`, `powershell`, `workflow` and `monitor` from the
|
|
4
|
+
* model's direct tool list exactly when an `eval` tool is registered, so prose
|
|
5
|
+
* surfaces share that one condition instead of each re-deriving it. Registry
|
|
6
|
+
* presence is the session's own gate: a child agent without `eval` keeps the
|
|
7
|
+
* direct tools, and its prompt must keep the direct call shapes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isEvalOnlyRouting(pi: ExtensionAPI): boolean;
|
|
10
|
+
//# sourceMappingURL=eval-only-routing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-only-routing.d.ts","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/eval-only-routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,YAAY,GAAG,OAAO,CAM3D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The session withholds `bash`, `powershell`, `workflow` and `monitor` from the
|
|
3
|
+
* model's direct tool list exactly when an `eval` tool is registered, so prose
|
|
4
|
+
* surfaces share that one condition instead of each re-deriving it. Registry
|
|
5
|
+
* presence is the session's own gate: a child agent without `eval` keeps the
|
|
6
|
+
* direct tools, and its prompt must keep the direct call shapes.
|
|
7
|
+
*/
|
|
8
|
+
export function isEvalOnlyRouting(pi) {
|
|
9
|
+
// Prompt rendering must never be what breaks a session: a host that exposes only
|
|
10
|
+
// the handler surface (and any future partial ExtensionAPI) still gets a prompt,
|
|
11
|
+
// falling back to the direct call shapes that are always callable.
|
|
12
|
+
if (typeof pi.getAllTools !== "function")
|
|
13
|
+
return false;
|
|
14
|
+
return pi.getAllTools().some((tool) => tool.name === "eval");
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=eval-only-routing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-only-routing.js","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/eval-only-routing.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAgB;IACjD,iFAAiF;IACjF,iFAAiF;IACjF,mEAAmE;IACnE,IAAI,OAAO,EAAE,CAAC,WAAW,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC;IACvD,OAAO,EAAE,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import type { ExtensionAPI } from \"../types.ts\";\n\n/**\n * The session withholds `bash`, `powershell`, `workflow` and `monitor` from the\n * model's direct tool list exactly when an `eval` tool is registered, so prose\n * surfaces share that one condition instead of each re-deriving it. Registry\n * presence is the session's own gate: a child agent without `eval` keeps the\n * direct tools, and its prompt must keep the direct call shapes.\n */\nexport function isEvalOnlyRouting(pi: ExtensionAPI): boolean {\n\t// Prompt rendering must never be what breaks a session: a host that exposes only\n\t// the handler surface (and any future partial ExtensionAPI) still gets a prompt,\n\t// falling back to the direct call shapes that are always callable.\n\tif (typeof pi.getAllTools !== \"function\") return false;\n\treturn pi.getAllTools().some((tool) => tool.name === \"eval\");\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpt-account.d.ts","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/gpt-account.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAA2B,MAAM,aAAa,CAAC;AAgFzE,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAmClE"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { getCredentialAccounts, pinCredentialAccount, removeCredentialAccount, } from "../../../core/credential-accounts.js";
|
|
2
|
+
import { emitProviderAccountsChanged } from "./claude-sdk-oauth/account-events.js";
|
|
3
|
+
const OPENAI_CODEX_PROVIDER_ID = "openai-codex";
|
|
4
|
+
const LOGIN_CANCELLED_MESSAGE = "Login cancelled";
|
|
5
|
+
function parseArgs(rawArgs) {
|
|
6
|
+
return rawArgs.trim().split(/\s+/).filter(Boolean);
|
|
7
|
+
}
|
|
8
|
+
function usage(ctx) {
|
|
9
|
+
ctx.ui.notify("Usage: /gpt-account [add | remove <name> | pin <name> | unpin]", "error");
|
|
10
|
+
}
|
|
11
|
+
function authEventMessage(event) {
|
|
12
|
+
if (event === null || typeof event !== "object")
|
|
13
|
+
return "OpenAI Codex OAuth authentication update.";
|
|
14
|
+
const value = event;
|
|
15
|
+
if (value.type === "auth_url" && typeof value.url === "string") {
|
|
16
|
+
return `Open this URL to authorize OpenAI Codex OAuth:\n${value.url}`;
|
|
17
|
+
}
|
|
18
|
+
if (value.type === "device_code" && typeof value.verificationUri === "string") {
|
|
19
|
+
return `Open this URL to authorize OpenAI Codex OAuth:\n${value.verificationUri}`;
|
|
20
|
+
}
|
|
21
|
+
return typeof value.message === "string" ? value.message : "OpenAI Codex OAuth authentication update.";
|
|
22
|
+
}
|
|
23
|
+
async function showAccounts(ctx) {
|
|
24
|
+
const accounts = await getCredentialAccounts(ctx.modelRegistry.authStorage, OPENAI_CODEX_PROVIDER_ID);
|
|
25
|
+
const lines = ["OpenAI Codex OAuth accounts:"];
|
|
26
|
+
if (accounts.length === 0)
|
|
27
|
+
lines.push(" (none)");
|
|
28
|
+
for (const account of accounts) {
|
|
29
|
+
const states = [account.name, account.source, account.blocked ? "blocked" : "available"];
|
|
30
|
+
if (account.pinned)
|
|
31
|
+
states.push("pinned");
|
|
32
|
+
lines.push(` ${states.join(" | ")}`);
|
|
33
|
+
}
|
|
34
|
+
ctx.ui.notify(lines.join("\n"), "info");
|
|
35
|
+
}
|
|
36
|
+
async function addAccount(ctx) {
|
|
37
|
+
if (!ctx.hasUI) {
|
|
38
|
+
ctx.ui.notify("/gpt-account add requires an interactive UI.", "error");
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
await ctx.modelRegistry.modelRuntime.login(OPENAI_CODEX_PROVIDER_ID, "oauth", {
|
|
43
|
+
signal: ctx.signal,
|
|
44
|
+
prompt: async (prompt) => {
|
|
45
|
+
const answer = await ctx.ui.input(prompt.message);
|
|
46
|
+
if (answer === undefined)
|
|
47
|
+
throw new Error(LOGIN_CANCELLED_MESSAGE);
|
|
48
|
+
return answer;
|
|
49
|
+
},
|
|
50
|
+
notify: (event) => ctx.ui.notify(authEventMessage(event), "info"),
|
|
51
|
+
});
|
|
52
|
+
emitProviderAccountsChanged(OPENAI_CODEX_PROVIDER_ID);
|
|
53
|
+
ctx.ui.notify("OpenAI Codex OAuth account added.", "info");
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
57
|
+
if (message === LOGIN_CANCELLED_MESSAGE)
|
|
58
|
+
return;
|
|
59
|
+
ctx.ui.notify(message, "error");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async function removeAccount(ctx, name) {
|
|
63
|
+
if (!name) {
|
|
64
|
+
usage(ctx);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
await removeCredentialAccount(ctx.modelRegistry.authStorage, OPENAI_CODEX_PROVIDER_ID, name);
|
|
68
|
+
ctx.ui.notify(`Removed OpenAI Codex OAuth account '${name}'.`, "info");
|
|
69
|
+
}
|
|
70
|
+
async function pinAccount(ctx, name) {
|
|
71
|
+
if (!name) {
|
|
72
|
+
usage(ctx);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
await pinCredentialAccount(ctx.modelRegistry.authStorage, OPENAI_CODEX_PROVIDER_ID, name);
|
|
76
|
+
ctx.ui.notify(`Pinned OpenAI Codex OAuth account '${name}'.`, "info");
|
|
77
|
+
}
|
|
78
|
+
export default function gptAccountExtension(pi) {
|
|
79
|
+
pi.registerCommand("gpt-account", {
|
|
80
|
+
description: "List and manage OpenAI Codex OAuth accounts.",
|
|
81
|
+
argumentHint: "[add | remove <name> | pin <name> | unpin]",
|
|
82
|
+
handler: async (rawArgs, ctx) => {
|
|
83
|
+
const args = parseArgs(rawArgs);
|
|
84
|
+
const action = args[0] ?? "list";
|
|
85
|
+
try {
|
|
86
|
+
if (action === "list") {
|
|
87
|
+
await showAccounts(ctx);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (action === "add") {
|
|
91
|
+
await addAccount(ctx);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (action === "remove") {
|
|
95
|
+
await removeAccount(ctx, args[1]);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (action === "pin" && args[1] !== "unpin") {
|
|
99
|
+
await pinAccount(ctx, args[1]);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (action === "unpin" || (action === "pin" && args[1] === "unpin")) {
|
|
103
|
+
await pinCredentialAccount(ctx.modelRegistry.authStorage, OPENAI_CODEX_PROVIDER_ID, null);
|
|
104
|
+
ctx.ui.notify("Unpinned OpenAI Codex OAuth account.", "info");
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
usage(ctx);
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
ctx.ui.notify(error instanceof Error ? error.message : String(error), "error");
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=gpt-account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpt-account.js","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/gpt-account.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,GACvB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAEnF,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAChD,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AAElD,SAAS,SAAS,CAAC,OAAe;IACjC,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KA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redentialAccounts,\n\tpinCredentialAccount,\n\tremoveCredentialAccount,\n} from \"../../../core/credential-accounts.ts\";\nimport type { ExtensionAPI, ExtensionCommandContext } from \"../types.ts\";\nimport { emitProviderAccountsChanged } from \"./claude-sdk-oauth/account-events.ts\";\n\nconst OPENAI_CODEX_PROVIDER_ID = \"openai-codex\";\nconst LOGIN_CANCELLED_MESSAGE = \"Login cancelled\";\n\nfunction parseArgs(rawArgs: string): string[] {\n\treturn rawArgs.trim().split(/\\s+/).filter(Boolean);\n}\n\nfunction usage(ctx: ExtensionCommandContext): void {\n\tctx.ui.notify(\"Usage: /gpt-account [add | remove <name> | pin <name> | unpin]\", \"error\");\n}\n\nfunction authEventMessage(event: unknown): string {\n\tif (event === null || typeof event !== \"object\") return \"OpenAI Codex OAuth authentication update.\";\n\tconst value = event as Record<string, unknown>;\n\tif (value.type === \"auth_url\" && typeof value.url === \"string\") {\n\t\treturn `Open this URL to authorize OpenAI Codex OAuth:\\n${value.url}`;\n\t}\n\tif (value.type === \"device_code\" && typeof value.verificationUri === \"string\") {\n\t\treturn `Open this URL to authorize OpenAI Codex OAuth:\\n${value.verificationUri}`;\n\t}\n\treturn typeof value.message === \"string\" ? value.message : \"OpenAI Codex OAuth authentication update.\";\n}\n\nasync function showAccounts(ctx: ExtensionCommandContext): Promise<void> {\n\tconst accounts = await getCredentialAccounts(ctx.modelRegistry.authStorage, OPENAI_CODEX_PROVIDER_ID);\n\tconst lines = [\"OpenAI Codex OAuth accounts:\"];\n\tif (accounts.length === 0) lines.push(\" (none)\");\n\tfor (const account of accounts) {\n\t\tconst states = [account.name, account.source, account.blocked ? \"blocked\" : \"available\"];\n\t\tif (account.pinned) states.push(\"pinned\");\n\t\tlines.push(` ${states.join(\" | \")}`);\n\t}\n\tctx.ui.notify(lines.join(\"\\n\"), \"info\");\n}\n\nasync function addAccount(ctx: ExtensionCommandContext): Promise<void> {\n\tif (!ctx.hasUI) {\n\t\tctx.ui.notify(\"/gpt-account add requires an interactive UI.\", \"error\");\n\t\treturn;\n\t}\n\ttry {\n\t\tawait ctx.modelRegistry.modelRuntime.login(OPENAI_CODEX_PROVIDER_ID, \"oauth\", {\n\t\t\tsignal: ctx.signal,\n\t\t\tprompt: async (prompt) => {\n\t\t\t\tconst answer = await ctx.ui.input(prompt.message);\n\t\t\t\tif (answer === undefined) throw new Error(LOGIN_CANCELLED_MESSAGE);\n\t\t\t\treturn answer;\n\t\t\t},\n\t\t\tnotify: (event) => ctx.ui.notify(authEventMessage(event), \"info\"),\n\t\t});\n\t\temitProviderAccountsChanged(OPENAI_CODEX_PROVIDER_ID);\n\t\tctx.ui.notify(\"OpenAI Codex OAuth account added.\", \"info\");\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tif (message === LOGIN_CANCELLED_MESSAGE) return;\n\t\tctx.ui.notify(message, \"error\");\n\t}\n}\n\nasync function removeAccount(ctx: ExtensionCommandContext, name: string | undefined): Promise<void> {\n\tif (!name) {\n\t\tusage(ctx);\n\t\treturn;\n\t}\n\tawait removeCredentialAccount(ctx.modelRegistry.authStorage, OPENAI_CODEX_PROVIDER_ID, name);\n\tctx.ui.notify(`Removed OpenAI Codex OAuth account '${name}'.`, \"info\");\n}\n\nasync function pinAccount(ctx: ExtensionCommandContext, name: string | undefined): Promise<void> {\n\tif (!name) {\n\t\tusage(ctx);\n\t\treturn;\n\t}\n\tawait pinCredentialAccount(ctx.modelRegistry.authStorage, OPENAI_CODEX_PROVIDER_ID, name);\n\tctx.ui.notify(`Pinned OpenAI Codex OAuth account '${name}'.`, \"info\");\n}\n\nexport default function gptAccountExtension(pi: ExtensionAPI): void {\n\tpi.registerCommand(\"gpt-account\", {\n\t\tdescription: \"List and manage OpenAI Codex OAuth accounts.\",\n\t\targumentHint: \"[add | remove <name> | pin <name> | unpin]\",\n\t\thandler: async (rawArgs, ctx) => {\n\t\t\tconst args = parseArgs(rawArgs);\n\t\t\tconst action = args[0] ?? \"list\";\n\t\t\ttry {\n\t\t\t\tif (action === \"list\") {\n\t\t\t\t\tawait showAccounts(ctx);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (action === \"add\") {\n\t\t\t\t\tawait addAccount(ctx);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (action === \"remove\") {\n\t\t\t\t\tawait removeAccount(ctx, args[1]);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (action === \"pin\" && args[1] !== \"unpin\") {\n\t\t\t\t\tawait pinAccount(ctx, args[1]);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (action === \"unpin\" || (action === \"pin\" && args[1] === \"unpin\")) {\n\t\t\t\t\tawait pinCredentialAccount(ctx.modelRegistry.authStorage, OPENAI_CODEX_PROVIDER_ID, null);\n\t\t\t\t\tctx.ui.notify(\"Unpinned OpenAI Codex OAuth account.\", \"info\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tusage(ctx);\n\t\t\t} catch (error) {\n\t\t\t\tctx.ui.notify(error instanceof Error ? error.message : String(error), \"error\");\n\t\t\t}\n\t\t},\n\t});\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAWpD,OAAO,aAAa,MAAM,WAAW,CAAC;AACtC,OAAO,cAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAWpD,OAAO,aAAa,MAAM,WAAW,CAAC;AACtC,OAAO,cAAc,MAAM,YAAY,CAAC;AAmBxC,OAAO,wBAAwB,MAAM,wBAAwB,CAAC;AAU9D,OAAO,YAAY,MAAM,UAAU,CAAC;AAMpC,MAAM,WAAW,uBAAuB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,gBAAgB,CAAC;CAC1B;AAED,eAAO,MAAM,yBAAyB,wDAAyD,CAAC;AAEhG,eAAO,MAAM,+BAA+B;;;;;CAKoC,CAAC;AAEjF,eAAO,MAAM,iBAAiB,EAAE,uBAAuB,EAsDtD,CAAC"}
|
|
@@ -11,6 +11,7 @@ import cursorCliOauthExtension from "./cursor-cli-oauth/index.js";
|
|
|
11
11
|
import diffExtension from "./diff.js";
|
|
12
12
|
import filesExtension from "./files.js";
|
|
13
13
|
import goalExtension from "./goal/index.js";
|
|
14
|
+
import gptAccountExtension from "./gpt-account.js";
|
|
14
15
|
import gptApplyPatchExtension from "./gpt-apply-patch/index.js";
|
|
15
16
|
import helpExtension from "./help/index.js";
|
|
16
17
|
import historySearchExtension from "./history-search/index.js";
|
|
@@ -93,6 +94,7 @@ export const builtinExtensions = [
|
|
|
93
94
|
// Provider-neutral account listing; sits before the provider lanes so their
|
|
94
95
|
// dedicated commands (claude-account, cursor accounts) keep their own names.
|
|
95
96
|
{ id: "account", factory: accountExtension },
|
|
97
|
+
{ id: "gpt-account", factory: gptAccountExtension },
|
|
96
98
|
{ id: "claude-sdk-oauth", factory: claudeSdkOauthExtension },
|
|
97
99
|
// Registers unconditionally and reports executable/auth state through its oauth check, so it stays beside the other provider lane.
|
|
98
100
|
{ id: "cursor-cli-oauth", factory: cursorCliOauthExtension },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/index.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAC/D,OAAO,2BAA2B,MAAM,iCAAiC,CAAC;AAC1E,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAC3D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AA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E,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE,uBAAuB,EAAE;IAC5D,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE;IAC1C,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE;IACtC,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE;IACtC,EAAE,EAAE,EAAE,iBAAiB,EAAE,OAAO,EAAE,uBAAuB,EAAE;IAC3D,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE;IACtC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE;IACpC,4EAA4E;IAC5E,6EAA6E;IAC7E,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE;IAC5C,EAAE,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE,uBAAuB,EAAE;IAC5D,mIAAmI;IACnI,EAAE,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE,uBAAuB,EAAE;IAC5D,oIAAoI;IACpI,EAAE,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,qBAAqB,EAAE;IACvD,8GAA8G;IAC9G,EAAE,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAE;IACnD,iGAAiG;IACjG,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE;CACpC,CAAC","sourcesContent":["import type { ExtensionFactory } from \"../types.ts\";\nimport accountExtension from \"./account/index.ts\";\nimport anthropicBashExtension from \"./anthropic-bash/index.ts\";\nimport anthropicWebSearchExtension from \"./anthropic-web-search/index.ts\";\nimport bashTimeoutExtension from \"./bash-timeout/index.ts\";\nimport btwExtension from \"./btw/index.ts\";\nimport cacheKeepAliveExtension from \"./cache-keepalive/index.ts\";\nimport claudeSdkOauthExtension from \"./claude-sdk-oauth/index.ts\";\nimport compactionExtension from \"./compaction/index.ts\";\nimport configReloadExtension from \"./config-reload/index.ts\";\nimport cursorCliOauthExtension from \"./cursor-cli-oauth/index.ts\";\nimport diffExtension from \"./diff.ts\";\nimport filesExtension from \"./files.ts\";\nimport goalExtension from \"./goal/index.ts\";\nimport gptApplyPatchExtension from \"./gpt-apply-patch/index.ts\";\nimport helpExtension from \"./help/index.ts\";\nimport historySearchExtension from \"./history-search/index.ts\";\nimport hooksExtension from \"./hooks/index.ts\";\nimport imageGenExtension from \"./imagegen/index.ts\";\nimport importReproExtension from \"./import-repro.ts\";\nimport lookAtExtension from \"./look-at/index.ts\";\nimport loopExtension from \"./loop/index.ts\";\nimport loopGuardExtension from \"./loop-guard/index.ts\";\nimport mcpExtension from \"./mcp/index.ts\";\nimport modelFallbackExtension from \"./model-fallback/index.ts\";\nimport nestedAgentsMdExtension from \"./nested-agents-md/index.ts\";\nimport openaiImageGenExtension from \"./openai-image-gen/index.ts\";\nimport openaiWebSearchExtension from \"./openai-web-search/index.ts\";\nimport permissionSystemExtension from \"./permission-system/index.ts\";\nimport promptPresetExtension from \"./prompt-preset/index.ts\";\nimport promptUrlWidgetExtension from \"./prompt-url-widget.ts\";\nimport reasoningExtension from \"./reasoning/index.ts\";\nimport recommendedModelsExtension from \"./recommended-models/index.ts\";\nimport redrawsExtension from \"./redraws.ts\";\nimport piRulesExtension from \"./rules/index.ts\";\nimport serviceTierExtension from \"./service-tier.ts\";\nimport terminalExtension from \"./terminal/index.ts\";\nimport todowriteExtension from \"./todotools/index.ts\";\nimport toolPairGuardExtension from \"./tool-pair-guard/index.ts\";\nimport toolSearchExtension from \"./tool-search/index.ts\";\nimport tpsExtension from \"./tps.ts\";\nimport ttsrExtension from \"./ttsr/index.ts\";\nimport videoInExtension from \"./video-in/index.ts\";\nimport webfetchExtension from \"./webfetch/index.ts\";\nimport websearchExtension from \"./websearch/index.ts\";\n\nexport interface BuiltinExtensionFactory {\n\tid: string;\n\tfactory: ExtensionFactory;\n}\n\nexport const globalDefaultExtensionIds = [\"diff\", \"files\", \"prompt-url-widget\", \"tps\"] as const;\n\nexport const globalDefaultExtensionFactories = {\n\tdiff: diffExtension,\n\tfiles: filesExtension,\n\t\"prompt-url-widget\": promptUrlWidgetExtension,\n\ttps: tpsExtension,\n} satisfies Record<(typeof globalDefaultExtensionIds)[number], ExtensionFactory>;\n\nexport const builtinExtensions: BuiltinExtensionFactory[] = [\n\t// Loop guard owns the first veto opportunity so repeated calls never re-run hooks or permission prompts.\n\t{ id: \"loop-guard\", factory: loopGuardExtension },\n\t{ id: \"hooks\", factory: hooksExtension },\n\t{ id: \"permission-system\", factory: permissionSystemExtension },\n\t{ id: \"gpt-apply-patch\", factory: gptApplyPatchExtension },\n\t{ id: \"imagegen\", factory: imageGenExtension },\n\t// Follows imagegen so the native injector's bypass wiring observes the registered client tool.\n\t{ id: \"openai-image-gen\", factory: openaiImageGenExtension },\n\t{ id: \"prompt-preset\", factory: promptPresetExtension },\n\t{ id: \"todowrite\", factory: todowriteExtension },\n\t{ id: \"redraws\", factory: redrawsExtension },\n\t{ id: \"anthropic-web-search\", factory: anthropicWebSearchExtension },\n\t{ id: \"anthropic-bash\", factory: anthropicBashExtension },\n\t{ id: \"openai-web-search\", factory: openaiWebSearchExtension },\n\t{ id: \"service-tier\", factory: serviceTierExtension },\n\t// Sits beside service-tier: both are capability-aware model-control commands that only read\n\t// the active model and notify; neither mutates payloads, so relative order is not load-bearing.\n\t{ id: \"reasoning\", factory: reasoningExtension },\n\t{ id: \"model-fallback\", factory: modelFallbackExtension },\n\t{ id: \"recommended-models\", factory: recommendedModelsExtension },\n\t{ id: \"bash-timeout\", factory: bashTimeoutExtension },\n\t// Terminal follows bash-timeout so its injected default reaches the PTY bash, and follows\n\t// anthropic-bash so mutual-exclusion (companion step-aside) is evaluated after it registers.\n\t{ id: \"terminal\", factory: terminalExtension },\n\t{ id: \"tool-pair-guard\", factory: toolPairGuardExtension },\n\t{ id: \"compaction\", factory: compactionExtension },\n\t{ id: \"history-search\", factory: historySearchExtension },\n\t{ id: \"help\", factory: helpExtension },\n\t{ id: \"import-repro\", factory: importReproExtension },\n\t{ id: \"websearch\", factory: websearchExtension },\n\t{ id: \"webfetch\", factory: webfetchExtension },\n\t{ id: \"video-in\", factory: videoInExtension },\n\t{ id: \"look-at\", factory: lookAtExtension },\n\t{ id: \"nested-agents-md\", factory: nestedAgentsMdExtension },\n\t{ id: \"rules\", factory: piRulesExtension },\n\t{ id: \"goal\", factory: goalExtension },\n\t{ id: \"loop\", factory: loopExtension },\n\t{ id: \"cache-keepalive\", factory: cacheKeepAliveExtension },\n\t{ id: \"ttsr\", factory: ttsrExtension },\n\t{ id: \"btw\", factory: btwExtension },\n\t// Provider-neutral account listing; sits before the provider lanes so their\n\t// dedicated commands (claude-account, cursor accounts) keep their own names.\n\t{ id: \"account\", factory: accountExtension },\n\t{ id: \"claude-sdk-oauth\", factory: claudeSdkOauthExtension },\n\t// Registers unconditionally and reports executable/auth state through its oauth check, so it stays beside the other provider lane.\n\t{ id: \"cursor-cli-oauth\", factory: cursorCliOauthExtension },\n\t// Config reload follows settings-dependent builtins so reloads rebuild their resolved settings before catalog feeders observe them.\n\t{ id: \"config-reload\", factory: configReloadExtension },\n\t// Shared catalog wiring loads before MCP, which feeds its tools into the shared catalog as the final builtin.\n\t{ id: \"tool-search\", factory: toolSearchExtension },\n\t// Keep MCP last so its eventual provider-payload tap observes all co-resident builtin mutations.\n\t{ id: \"mcp\", factory: mcpExtension },\n];\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/index.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAC/D,OAAO,2BAA2B,MAAM,iCAAiC,CAAC;AAC1E,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAC3D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,uBAAuB,MAAM,4BAA4B,CAA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EAAE,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE,uBAAuB,EAAE;IAC5D,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE;IAC1C,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE;IACtC,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE;IACtC,EAAE,EAAE,EAAE,iBAAiB,EAAE,OAAO,EAAE,uBAAuB,EAAE;IAC3D,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE;IACtC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE;IACpC,4EAA4E;IAC5E,6EAA6E;IAC7E,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE;IAC5C,EAAE,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAE;IACnD,EAAE,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE,uBAAuB,EAAE;IAC5D,mIAAmI;IACnI,EAAE,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE,uBAAuB,EAAE;IAC5D,oIAAoI;IACpI,EAAE,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,qBAAqB,EAAE;IACvD,8GAA8G;IAC9G,EAAE,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAE;IACnD,iGAAiG;IACjG,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE;CACpC,CAAC","sourcesContent":["import type { ExtensionFactory } from \"../types.ts\";\nimport accountExtension from \"./account/index.ts\";\nimport anthropicBashExtension from \"./anthropic-bash/index.ts\";\nimport anthropicWebSearchExtension from \"./anthropic-web-search/index.ts\";\nimport bashTimeoutExtension from \"./bash-timeout/index.ts\";\nimport btwExtension from \"./btw/index.ts\";\nimport cacheKeepAliveExtension from \"./cache-keepalive/index.ts\";\nimport claudeSdkOauthExtension from \"./claude-sdk-oauth/index.ts\";\nimport compactionExtension from \"./compaction/index.ts\";\nimport configReloadExtension from \"./config-reload/index.ts\";\nimport cursorCliOauthExtension from \"./cursor-cli-oauth/index.ts\";\nimport diffExtension from \"./diff.ts\";\nimport filesExtension from \"./files.ts\";\nimport goalExtension from \"./goal/index.ts\";\nimport gptAccountExtension from \"./gpt-account.ts\";\nimport gptApplyPatchExtension from \"./gpt-apply-patch/index.ts\";\nimport helpExtension from \"./help/index.ts\";\nimport historySearchExtension from \"./history-search/index.ts\";\nimport hooksExtension from \"./hooks/index.ts\";\nimport imageGenExtension from \"./imagegen/index.ts\";\nimport importReproExtension from \"./import-repro.ts\";\nimport lookAtExtension from \"./look-at/index.ts\";\nimport loopExtension from \"./loop/index.ts\";\nimport loopGuardExtension from \"./loop-guard/index.ts\";\nimport mcpExtension from \"./mcp/index.ts\";\nimport modelFallbackExtension from \"./model-fallback/index.ts\";\nimport nestedAgentsMdExtension from \"./nested-agents-md/index.ts\";\nimport openaiImageGenExtension from \"./openai-image-gen/index.ts\";\nimport openaiWebSearchExtension from \"./openai-web-search/index.ts\";\nimport permissionSystemExtension from \"./permission-system/index.ts\";\nimport promptPresetExtension from \"./prompt-preset/index.ts\";\nimport promptUrlWidgetExtension from \"./prompt-url-widget.ts\";\nimport reasoningExtension from \"./reasoning/index.ts\";\nimport recommendedModelsExtension from \"./recommended-models/index.ts\";\nimport redrawsExtension from \"./redraws.ts\";\nimport piRulesExtension from \"./rules/index.ts\";\nimport serviceTierExtension from \"./service-tier.ts\";\nimport terminalExtension from \"./terminal/index.ts\";\nimport todowriteExtension from \"./todotools/index.ts\";\nimport toolPairGuardExtension from \"./tool-pair-guard/index.ts\";\nimport toolSearchExtension from \"./tool-search/index.ts\";\nimport tpsExtension from \"./tps.ts\";\nimport ttsrExtension from \"./ttsr/index.ts\";\nimport videoInExtension from \"./video-in/index.ts\";\nimport webfetchExtension from \"./webfetch/index.ts\";\nimport websearchExtension from \"./websearch/index.ts\";\n\nexport interface BuiltinExtensionFactory {\n\tid: string;\n\tfactory: ExtensionFactory;\n}\n\nexport const globalDefaultExtensionIds = [\"diff\", \"files\", \"prompt-url-widget\", \"tps\"] as const;\n\nexport const globalDefaultExtensionFactories = {\n\tdiff: diffExtension,\n\tfiles: filesExtension,\n\t\"prompt-url-widget\": promptUrlWidgetExtension,\n\ttps: tpsExtension,\n} satisfies Record<(typeof globalDefaultExtensionIds)[number], ExtensionFactory>;\n\nexport const builtinExtensions: BuiltinExtensionFactory[] = [\n\t// Loop guard owns the first veto opportunity so repeated calls never re-run hooks or permission prompts.\n\t{ id: \"loop-guard\", factory: loopGuardExtension },\n\t{ id: \"hooks\", factory: hooksExtension },\n\t{ id: \"permission-system\", factory: permissionSystemExtension },\n\t{ id: \"gpt-apply-patch\", factory: gptApplyPatchExtension },\n\t{ id: \"imagegen\", factory: imageGenExtension },\n\t// Follows imagegen so the native injector's bypass wiring observes the registered client tool.\n\t{ id: \"openai-image-gen\", factory: openaiImageGenExtension },\n\t{ id: \"prompt-preset\", factory: promptPresetExtension },\n\t{ id: \"todowrite\", factory: todowriteExtension },\n\t{ id: \"redraws\", factory: redrawsExtension },\n\t{ id: \"anthropic-web-search\", factory: anthropicWebSearchExtension },\n\t{ id: \"anthropic-bash\", factory: anthropicBashExtension },\n\t{ id: \"openai-web-search\", factory: openaiWebSearchExtension },\n\t{ id: \"service-tier\", factory: serviceTierExtension },\n\t// Sits beside service-tier: both are capability-aware model-control commands that only read\n\t// the active model and notify; neither mutates payloads, so relative order is not load-bearing.\n\t{ id: \"reasoning\", factory: reasoningExtension },\n\t{ id: \"model-fallback\", factory: modelFallbackExtension },\n\t{ id: \"recommended-models\", factory: recommendedModelsExtension },\n\t{ id: \"bash-timeout\", factory: bashTimeoutExtension },\n\t// Terminal follows bash-timeout so its injected default reaches the PTY bash, and follows\n\t// anthropic-bash so mutual-exclusion (companion step-aside) is evaluated after it registers.\n\t{ id: \"terminal\", factory: terminalExtension },\n\t{ id: \"tool-pair-guard\", factory: toolPairGuardExtension },\n\t{ id: \"compaction\", factory: compactionExtension },\n\t{ id: \"history-search\", factory: historySearchExtension },\n\t{ id: \"help\", factory: helpExtension },\n\t{ id: \"import-repro\", factory: importReproExtension },\n\t{ id: \"websearch\", factory: websearchExtension },\n\t{ id: \"webfetch\", factory: webfetchExtension },\n\t{ id: \"video-in\", factory: videoInExtension },\n\t{ id: \"look-at\", factory: lookAtExtension },\n\t{ id: \"nested-agents-md\", factory: nestedAgentsMdExtension },\n\t{ id: \"rules\", factory: piRulesExtension },\n\t{ id: \"goal\", factory: goalExtension },\n\t{ id: \"loop\", factory: loopExtension },\n\t{ id: \"cache-keepalive\", factory: cacheKeepAliveExtension },\n\t{ id: \"ttsr\", factory: ttsrExtension },\n\t{ id: \"btw\", factory: btwExtension },\n\t// Provider-neutral account listing; sits before the provider lanes so their\n\t// dedicated commands (claude-account, cursor accounts) keep their own names.\n\t{ id: \"account\", factory: accountExtension },\n\t{ id: \"gpt-account\", factory: gptAccountExtension },\n\t{ id: \"claude-sdk-oauth\", factory: claudeSdkOauthExtension },\n\t// Registers unconditionally and reports executable/auth state through its oauth check, so it stays beside the other provider lane.\n\t{ id: \"cursor-cli-oauth\", factory: cursorCliOauthExtension },\n\t// Config reload follows settings-dependent builtins so reloads rebuild their resolved settings before catalog feeders observe them.\n\t{ id: \"config-reload\", factory: configReloadExtension },\n\t// Shared catalog wiring loads before MCP, which feeds its tools into the shared catalog as the final builtin.\n\t{ id: \"tool-search\", factory: toolSearchExtension },\n\t// Keep MCP last so its eventual provider-payload tap observes all co-resident builtin mutations.\n\t{ id: \"mcp\", factory: mcpExtension },\n];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-5.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-opus-4-5.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAOlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAWxF"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
|
|
2
2
|
import { buildExecutionToolingSection } from "./execution-tooling.js";
|
|
3
3
|
function buildClaudeOpus45Tuning() {
|
|
4
|
-
return `Break complex tasks into ordered steps with clear dependencies before executing. When a request covers a set of items, apply it to every item rather than only the first, and state the scope you applied
|
|
5
|
-
|
|
6
|
-
Do not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;
|
|
4
|
+
return `Break complex tasks into ordered steps with clear dependencies before executing. When a request covers a set of items, apply it to every item rather than only the first, and state the scope you applied.`;
|
|
7
5
|
}
|
|
8
6
|
export function buildClaudeOpus45Prompt(options) {
|
|
9
7
|
return buildDynamicSystemPrompt({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,SAAS,uBAAuB;IAC/B,OAAO
|
|
1
|
+
{"version":3,"file":"claude-opus-4-5.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,SAAS,uBAAuB;IAC/B,OAAO,4MAA4M,CAAC;AACrN,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE;YACd,4BAA4B,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;YACrF,uBAAuB,EAAE;SACzB;aACC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;aACvC,IAAI,CAAC,MAAM,CAAC;QACd,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildExecutionToolingSection } from \"./execution-tooling.ts\";\n\nfunction buildClaudeOpus45Tuning(): string {\n\treturn `Break complex tasks into ordered steps with clear dependencies before executing. When a request covers a set of items, apply it to every item rather than only the first, and state the scope you applied.`;\n}\n\nexport function buildClaudeOpus45Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({\n\t\t...options,\n\t\ttuningSection: [\n\t\t\tbuildExecutionToolingSection({ toolNames: options.selectedTools, dialect: \"claude\" }),\n\t\t\tbuildClaudeOpus45Tuning(),\n\t\t]\n\t\t\t.filter((section) => section.length > 0)\n\t\t\t.join(\"\\n\\n\"),\n\t\tworkstationDialect: \"claude\",\n\t});\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-6.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-opus-4-6.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAGlH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAMxF"}
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
|
|
2
2
|
import { buildExecutionToolingSection } from "./execution-tooling.js";
|
|
3
|
-
function buildClaudeOpus46Tuning() {
|
|
4
|
-
return `Choose an approach and commit to it; revisit only when new information directly contradicts your reasoning. When a request covers a set of items, apply it to every item and state the scope you applied.
|
|
5
|
-
|
|
6
|
-
Do not wrap up early because the context window is running low; the harness auto-compacts context. Keep working until the task is complete.`;
|
|
7
|
-
}
|
|
8
3
|
export function buildClaudeOpus46Prompt(options) {
|
|
9
4
|
return buildDynamicSystemPrompt({
|
|
10
5
|
...options,
|
|
11
|
-
tuningSection:
|
|
12
|
-
buildExecutionToolingSection({ toolNames: options.selectedTools, dialect: "claude" }),
|
|
13
|
-
buildClaudeOpus46Tuning(),
|
|
14
|
-
]
|
|
15
|
-
.filter((section) => section.length > 0)
|
|
16
|
-
.join("\n\n"),
|
|
6
|
+
tuningSection: buildExecutionToolingSection({ toolNames: options.selectedTools, dialect: "claude" }),
|
|
17
7
|
workstationDialect: "claude",
|
|
18
8
|
});
|
|
19
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-6.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,
|
|
1
|
+
{"version":3,"file":"claude-opus-4-6.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-6.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,4BAA4B,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;QACpG,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildExecutionToolingSection } from \"./execution-tooling.ts\";\n\nexport function buildClaudeOpus46Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({\n\t\t...options,\n\t\ttuningSection: buildExecutionToolingSection({ toolNames: options.selectedTools, dialect: \"claude\" }),\n\t\tworkstationDialect: \"claude\",\n\t});\n}\n"]}
|
|
@@ -5,9 +5,9 @@ function buildClaudeOpus47Tuning() {
|
|
|
5
5
|
|
|
6
6
|
Prefer tool calls over reasoning when a tool can resolve the question directly; do not reason past a fact you can look up.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Spawn the subagents for a fan-out across items or files in the same turn, not one at a time.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
For frontend design with no specified visual direction, derive one from the project's context or propose distinct options before building; do not fall back to your default cream/serif/terracotta house style or generic AI aesthetics.`;
|
|
11
11
|
}
|
|
12
12
|
export function buildClaudeOpus47Prompt(options) {
|
|
13
13
|
return buildDynamicSystemPrompt({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-7.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-7.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,SAAS,uBAAuB;IAC/B,OAAO;;;;;;
|
|
1
|
+
{"version":3,"file":"claude-opus-4-7.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-7.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,SAAS,uBAAuB;IAC/B,OAAO;;;;;;yOAMiO,CAAC;AAC1O,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE;YACd,4BAA4B,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;YACrF,uBAAuB,EAAE;SACzB;aACC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;aACvC,IAAI,CAAC,MAAM,CAAC;QACd,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildExecutionToolingSection } from \"./execution-tooling.ts\";\n\nfunction buildClaudeOpus47Tuning(): string {\n\treturn `Apply instructions at the scope the user evidently intends: \"every\", \"all\", and \"each\" mean the full set rather than the first item, and a fix that plainly recurs covers every occurrence. State the scope you applied.\n\nPrefer tool calls over reasoning when a tool can resolve the question directly; do not reason past a fact you can look up.\n\nSpawn the subagents for a fan-out across items or files in the same turn, not one at a time.\n\nFor frontend design with no specified visual direction, derive one from the project's context or propose distinct options before building; do not fall back to your default cream/serif/terracotta house style or generic AI aesthetics.`;\n}\n\nexport function buildClaudeOpus47Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({\n\t\t...options,\n\t\ttuningSection: [\n\t\t\tbuildExecutionToolingSection({ toolNames: options.selectedTools, dialect: \"claude\" }),\n\t\t\tbuildClaudeOpus47Tuning(),\n\t\t]\n\t\t\t.filter((section) => section.length > 0)\n\t\t\t.join(\"\\n\\n\"),\n\t\tworkstationDialect: \"claude\",\n\t});\n}\n"]}
|
|
@@ -3,11 +3,11 @@ import { buildExecutionToolingSection } from "./execution-tooling.js";
|
|
|
3
3
|
function buildClaudeOpus48Tuning() {
|
|
4
4
|
return `Apply instructions at the scope the user evidently intends: "every", "all", and "each" mean the full set rather than the first item, and a fix that plainly recurs covers every occurrence. State the scope you applied.
|
|
5
5
|
|
|
6
|
-
Prefer tool calls over reasoning when a tool can resolve the question directly; do not reason past a fact you can look up. After a user turn, reason over what changed
|
|
6
|
+
Prefer tool calls over reasoning when a tool can resolve the question directly; do not reason past a fact you can look up. After a user turn, reason over what changed rather than over the whole conversation.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Spawn the subagents for a fan-out across items or files in the same turn, not one at a time.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
For frontend design with no specified visual direction, derive one from the project's context or propose distinct options before building; do not fall back to your default cream/serif/terracotta house style or generic AI aesthetics.`;
|
|
11
11
|
}
|
|
12
12
|
export function buildClaudeOpus48Prompt(options) {
|
|
13
13
|
return buildDynamicSystemPrompt({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-4-8.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-8.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,SAAS,uBAAuB;IAC/B,OAAO;;;;;;
|
|
1
|
+
{"version":3,"file":"claude-opus-4-8.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-4-8.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,SAAS,uBAAuB;IAC/B,OAAO;;;;;;yOAMiO,CAAC;AAC1O,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAwC;IAC/E,OAAO,wBAAwB,CAAC;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE;YACd,4BAA4B,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;YACrF,uBAAuB,EAAE;SACzB;aACC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;aACvC,IAAI,CAAC,MAAM,CAAC;QACd,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildExecutionToolingSection } from \"./execution-tooling.ts\";\n\nfunction buildClaudeOpus48Tuning(): string {\n\treturn `Apply instructions at the scope the user evidently intends: \"every\", \"all\", and \"each\" mean the full set rather than the first item, and a fix that plainly recurs covers every occurrence. State the scope you applied.\n\nPrefer tool calls over reasoning when a tool can resolve the question directly; do not reason past a fact you can look up. After a user turn, reason over what changed rather than over the whole conversation.\n\nSpawn the subagents for a fan-out across items or files in the same turn, not one at a time.\n\nFor frontend design with no specified visual direction, derive one from the project's context or propose distinct options before building; do not fall back to your default cream/serif/terracotta house style or generic AI aesthetics.`;\n}\n\nexport function buildClaudeOpus48Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({\n\t\t...options,\n\t\ttuningSection: [\n\t\t\tbuildExecutionToolingSection({ toolNames: options.selectedTools, dialect: \"claude\" }),\n\t\t\tbuildClaudeOpus48Tuning(),\n\t\t]\n\t\t\t.filter((section) => section.length > 0)\n\t\t\t.join(\"\\n\\n\"),\n\t\tworkstationDialect: \"claude\",\n\t});\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-opus-5.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-5.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-opus-5.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/claude-opus-5.ts"],"names":[],"mappings":"AA4CA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAsElH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAMvF"}
|