@code-yeongyu/senpi 2026.9.21-2 → 2026.9.22-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/dist/bundle/chunks/{anthropic-messages-C3ZY2ANT.js → anthropic-messages-2P7APOOQ.js} +1 -1
- package/dist/bundle/chunks/{app-server-command-HSX5RFAP.js → app-server-command-PRNA6QQU.js} +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-7TAGS2VU.js → azure-openai-responses-3AH7MJWF.js} +1 -1
- package/dist/bundle/chunks/{bun-extension-importer-UO7V2MZ7.js → bun-extension-importer-H4IJCWWQ.js} +1 -1
- package/dist/bundle/chunks/{chunk-OSDJ2SYO.js → chunk-5XC2FNJ5.js} +1 -1
- package/dist/bundle/chunks/{chunk-D5CL7PPD.js → chunk-64JQFFHH.js} +2 -2
- package/dist/bundle/chunks/{chunk-Z3KQB2R3.js → chunk-6OD4TT33.js} +95 -39
- package/dist/bundle/chunks/{chunk-NEEAKXDT.js → chunk-7EH64T6E.js} +2 -2
- package/dist/bundle/chunks/{chunk-MIVOQT3Q.js → chunk-ARJJU3MS.js} +1 -1
- package/dist/bundle/chunks/chunk-BOZ37BOT.js +14 -0
- package/dist/bundle/chunks/{chunk-POMPEGWQ.js → chunk-F3DXL5MX.js} +1 -1
- package/dist/bundle/chunks/{chunk-GLKVDRNP.js → chunk-GXUYWMN2.js} +1 -1
- package/dist/bundle/chunks/chunk-HH3KJDWA.js +2 -0
- package/dist/bundle/chunks/{chunk-B7W62BM7.js → chunk-IPRJIKLL.js} +1 -1
- package/dist/bundle/chunks/chunk-JEFYJDHP.js +8 -0
- package/dist/bundle/chunks/{chunk-T6XA2IZR.js → chunk-JR4X6ECO.js} +1 -1
- package/dist/bundle/chunks/{chunk-I425CMTO.js → chunk-JZ6YQU3A.js} +4 -4
- package/dist/bundle/chunks/{chunk-KNM6SRPE.js → chunk-K3HEWWSS.js} +1 -1
- package/dist/bundle/chunks/{chunk-M2XAY6I7.js → chunk-M2HSO7MH.js} +1 -1
- package/dist/bundle/chunks/{chunk-UYVPLEOL.js → chunk-NK2RNX25.js} +1 -1
- package/dist/bundle/chunks/chunk-NMB4C6ZZ.js +2 -0
- package/dist/bundle/chunks/{chunk-VEO3ABZR.js → chunk-OLJ7LQJY.js} +1 -1
- package/dist/bundle/chunks/{chunk-GVI2HP7N.js → chunk-OPNVT7BU.js} +1 -1
- package/dist/bundle/chunks/{chunk-XHMOFY4T.js → chunk-R6LVC7SP.js} +4 -4
- package/dist/bundle/chunks/{chunk-3SLCHXZO.js → chunk-UCPWK6TZ.js} +2 -2
- package/dist/bundle/chunks/{chunk-B2IM56LB.js → chunk-VYIJQQ5I.js} +1 -1
- package/dist/bundle/chunks/{chunk-47GF6XYZ.js → chunk-YT2ZSZOY.js} +1 -1
- package/dist/bundle/chunks/{cli-main-GQTEEZ2V.js → cli-main-AFJNXUSL.js} +1 -1
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-JWIH75VF.js → google-generative-ai-Y2IYMUVC.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-IRGAY5XR.js → google-vertex-TKBBMPHV.js} +1 -1
- package/dist/bundle/chunks/{host-command-KOEKIHIZ.js → host-command-OVA6GEWC.js} +1 -1
- package/dist/bundle/chunks/host-lifecycle-IDQPLYEA.js +3 -0
- package/dist/bundle/chunks/host-lifecycle.js +10 -6
- package/dist/bundle/chunks/{interactive-host-runtime-2KTFEW7O.js → interactive-host-runtime-F5L4USLR.js} +1 -1
- package/dist/bundle/chunks/{interactive-mode-I3ILWXQB.js → interactive-mode-UFBSCOP7.js} +1 -1
- package/dist/bundle/chunks/kimi-coding.js +2 -2
- package/dist/bundle/chunks/{list-tips-2KX65NWZ.js → list-tips-2QG7ASHS.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-VOBYATVJ.js → mistral-conversations-ZYDVFRYF.js} +1 -1
- package/dist/bundle/chunks/multi-session-host-EUTEGVLS.js +21 -0
- package/dist/bundle/chunks/openai-codex-responses-MEIUNROM.js +10 -0
- package/dist/bundle/chunks/{openai-completions-YK6QTYOH.js → openai-completions-4V76L5ZJ.js} +1 -1
- package/dist/bundle/chunks/openai-responses-YR7WRBG3.js +2 -0
- package/dist/bundle/chunks/{package-manager-cli-HOL6CAI6.js → package-manager-cli-JPUWMUEJ.js} +1 -1
- package/dist/bundle/chunks/rotation-stream-S56Y7WMM.js +2 -0
- package/dist/bundle/chunks/{rpc-mode-L3DSGTVM.js → rpc-mode-JDVHUBZY.js} +1 -1
- package/dist/bundle/chunks/{session-picker-L3FYEQBL.js → session-picker-PFPJVVIC.js} +1 -1
- package/dist/bundle/chunks/session-worker.js +225 -164
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/core/agent-session.d.ts +6 -4
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +9 -7
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/credential-pool/classify.d.ts.map +1 -1
- package/dist/core/credential-pool/classify.js +12 -0
- package/dist/core/credential-pool/classify.js.map +1 -1
- package/dist/core/credential-pool/failover.d.ts +37 -5
- package/dist/core/credential-pool/failover.d.ts.map +1 -1
- package/dist/core/credential-pool/failover.js +60 -24
- package/dist/core/credential-pool/failover.js.map +1 -1
- package/dist/core/credential-pool/rotation-events.d.ts +5 -0
- package/dist/core/credential-pool/rotation-events.d.ts.map +1 -0
- package/dist/core/credential-pool/rotation-events.js +25 -0
- package/dist/core/credential-pool/rotation-events.js.map +1 -0
- package/dist/core/credential-pool/rotation-stream.d.ts +4 -3
- package/dist/core/credential-pool/rotation-stream.d.ts.map +1 -1
- package/dist/core/credential-pool/rotation-stream.js +8 -11
- package/dist/core/credential-pool/rotation-stream.js.map +1 -1
- package/dist/core/extensions/builtin/ask-user/schema.d.ts +2 -25
- package/dist/core/extensions/builtin/ask-user/schema.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ask-user/schema.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/api-id.d.ts +7 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/api-id.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/api-id.js +7 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/api-id.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/index.js +3 -2
- package/dist/core/extensions/builtin/claude-sdk-oauth/index.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js +22 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts +2 -0
- 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 +4 -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.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js +18 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.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 +18 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts +2 -7
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.js +2 -8
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.js +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/naming.d.ts +0 -1
- package/dist/core/extensions/builtin/mcp/expose/naming.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/naming.js +0 -3
- package/dist/core/extensions/builtin/mcp/expose/naming.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/register.d.ts +1 -2
- package/dist/core/extensions/builtin/mcp/expose/register.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/register.js +0 -21
- package/dist/core/extensions/builtin/mcp/expose/register.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/schema-compat.d.ts +2 -2
- package/dist/core/extensions/builtin/mcp/expose/schema-compat.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/schema-compat.js +2 -2
- package/dist/core/extensions/builtin/mcp/expose/schema-compat.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/file-operations.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/file-operations.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/grok-4.7.d.ts +3 -0
- package/dist/core/extensions/builtin/prompt-preset/grok-4.7.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/grok-4.7.js +105 -0
- package/dist/core/extensions/builtin/prompt-preset/grok-4.7.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js +14 -0
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.js +1 -0
- package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
- package/dist/core/extensions/bun-extension-importer.d.ts +1 -0
- package/dist/core/extensions/bun-extension-importer.d.ts.map +1 -1
- package/dist/core/extensions/bun-extension-importer.js +4 -0
- package/dist/core/extensions/bun-extension-importer.js.map +1 -1
- package/dist/core/extensions/extension-module-cache.d.ts +48 -0
- package/dist/core/extensions/extension-module-cache.d.ts.map +1 -0
- package/dist/core/extensions/extension-module-cache.js +111 -0
- package/dist/core/extensions/extension-module-cache.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +14 -56
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +29 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +30 -3
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/retry-fallback/billing.d.ts.map +1 -1
- package/dist/core/retry-fallback/billing.js +20 -1
- package/dist/core/retry-fallback/billing.js.map +1 -1
- package/dist/core/session-manager.d.ts +3 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +12 -6
- package/dist/core/session-manager.js.map +1 -1
- package/dist/modes/interactive/components/assistant-render-descriptors.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-render-descriptors.js +8 -7
- package/dist/modes/interactive/components/assistant-render-descriptors.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +7 -5
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/custom-capability.d.ts +7 -0
- package/dist/modes/rpc/custom-capability.d.ts.map +1 -1
- package/dist/modes/rpc/custom-capability.js +7 -0
- package/dist/modes/rpc/custom-capability.js.map +1 -1
- package/dist/modes/rpc/handoff-activity.d.ts +4 -0
- package/dist/modes/rpc/handoff-activity.d.ts.map +1 -0
- package/dist/modes/rpc/handoff-activity.js +6 -0
- package/dist/modes/rpc/handoff-activity.js.map +1 -0
- package/dist/modes/rpc/host-child-exit.d.ts +19 -0
- package/dist/modes/rpc/host-child-exit.d.ts.map +1 -0
- package/dist/modes/rpc/host-child-exit.js +35 -0
- package/dist/modes/rpc/host-child-exit.js.map +1 -0
- package/dist/modes/rpc/host-crash-record.d.ts +24 -0
- package/dist/modes/rpc/host-crash-record.d.ts.map +1 -0
- package/dist/modes/rpc/host-crash-record.js +75 -0
- package/dist/modes/rpc/host-crash-record.js.map +1 -0
- package/dist/modes/rpc/host-crash-record.test.d.ts +2 -0
- package/dist/modes/rpc/host-crash-record.test.d.ts.map +1 -0
- package/dist/modes/rpc/host-crash-record.test.js +91 -0
- package/dist/modes/rpc/host-crash-record.test.js.map +1 -0
- package/dist/modes/rpc/host-ensure.d.ts.map +1 -1
- package/dist/modes/rpc/host-ensure.js +60 -17
- package/dist/modes/rpc/host-ensure.js.map +1 -1
- package/dist/modes/rpc/host-lifecycle.d.ts +4 -10
- package/dist/modes/rpc/host-lifecycle.d.ts.map +1 -1
- package/dist/modes/rpc/host-lifecycle.js +83 -51
- package/dist/modes/rpc/host-lifecycle.js.map +1 -1
- package/dist/modes/rpc/host-supersession.d.ts +13 -2
- package/dist/modes/rpc/host-supersession.d.ts.map +1 -1
- package/dist/modes/rpc/host-supersession.js +40 -7
- package/dist/modes/rpc/host-supersession.js.map +1 -1
- package/dist/modes/rpc/multi-session-host.d.ts +1 -0
- package/dist/modes/rpc/multi-session-host.d.ts.map +1 -1
- package/dist/modes/rpc/multi-session-host.js +40 -7
- package/dist/modes/rpc/multi-session-host.js.map +1 -1
- package/dist/modes/rpc/observer-link.d.ts +48 -0
- package/dist/modes/rpc/observer-link.d.ts.map +1 -0
- package/dist/modes/rpc/observer-link.js +56 -0
- package/dist/modes/rpc/observer-link.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +12 -2
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +12 -2
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +36 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js +8 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/rpc/session-command-router.d.ts +10 -4
- package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
- package/dist/modes/rpc/session-command-router.js +95 -19
- package/dist/modes/rpc/session-command-router.js.map +1 -1
- package/dist/modes/rpc/session-event-writer.d.ts +5 -3
- package/dist/modes/rpc/session-event-writer.d.ts.map +1 -1
- package/dist/modes/rpc/session-event-writer.js +21 -2
- package/dist/modes/rpc/session-event-writer.js.map +1 -1
- package/dist/modes/rpc/session-registry.d.ts +6 -1
- package/dist/modes/rpc/session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/session-registry.js +34 -3
- package/dist/modes/rpc/session-registry.js.map +1 -1
- package/dist/modes/rpc/session-worker-client.d.ts +1 -0
- package/dist/modes/rpc/session-worker-client.d.ts.map +1 -1
- package/dist/modes/rpc/session-worker-client.js +3 -0
- package/dist/modes/rpc/session-worker-client.js.map +1 -1
- package/dist/modes/rpc/session-worker-protocol.d.ts +3 -1
- package/dist/modes/rpc/session-worker-protocol.d.ts.map +1 -1
- package/dist/modes/rpc/session-worker-protocol.js.map +1 -1
- package/dist/modes/rpc/session-worker.js +7 -1
- package/dist/modes/rpc/session-worker.js.map +1 -1
- package/dist/modes/rpc/socket-ownership.d.ts +16 -0
- package/dist/modes/rpc/socket-ownership.d.ts.map +1 -1
- package/dist/modes/rpc/socket-ownership.js +28 -4
- package/dist/modes/rpc/socket-ownership.js.map +1 -1
- package/dist/modes/rpc/worker-session-registry.d.ts +12 -5
- package/dist/modes/rpc/worker-session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/worker-session-registry.js +10 -2
- package/dist/modes/rpc/worker-session-registry.js.map +1 -1
- package/docs/providers.md +9 -1
- package/docs/rpc.md +72 -10
- package/docs/settings.md +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +29 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +51 -13
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/bridges/agent-bridge.ts +53 -9
- package/node_modules/@code-yeongyu/senpi-codemode/src/bridges/reserved-dispatch.ts +1 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/config/settings.ts +18 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/eval-status.ts +9 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +6 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/AGENTS.md +2 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/jl/prelude.jl +10 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/context-manager.ts +18 -6
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/kernel-contract.ts +2 -6
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/prelude.ts +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/run-queue.ts +17 -7
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-runtime.js +6 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/kernel-contract.ts +2 -5
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/kernel.ts +37 -5
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/prelude.py +11 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/rb/prelude.rb +6 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-contract.ts +2 -5
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-kernel.ts +14 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-queue.ts +18 -5
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt-template.ts +3 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +4 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/timeouts/idle-timeout.ts +9 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/AGENTS.md +2 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-execution.ts +19 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-runtime.ts +11 -3
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-contract.ts +6 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-manager.ts +72 -20
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-snapshot.ts +28 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-state.ts +5 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-status.ts +5 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-eval-result.ts +76 -25
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-execution-event.ts +4 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-kernel-reset-refused-error.ts +12 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-request.ts +2 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +3 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +58 -37
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/managed-cell.ts +15 -8
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +32 -8
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/run-eval-cell.ts +89 -25
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/terminal-snapshot-store.ts +4 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +51 -10
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +2 -1
- 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 -13
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/tool-arguments.d.ts +5 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/tool-arguments.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/tool-arguments.js +20 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/tool-arguments.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/README.md +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +14 -56
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +18 -27
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/websocket-transport-failure.d.ts +40 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/websocket-transport-failure.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/websocket-transport-failure.js +102 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/websocket-transport-failure.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.d.ts +4 -3
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.js +28 -14
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-region.d.ts +44 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-region.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-region.js +120 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-region.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/failover.d.ts +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/failover.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/failover.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/failover.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts +3 -0
- 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 +21 -15
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/legacy-provider-ids.d.ts +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/legacy-provider-ids.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/legacy-provider-ids.js +26 -0
- package/node_modules/@earendil-works/pi-ai/dist/legacy-provider-ids.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.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/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/venice.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/providers/data/xai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-ams.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-sgp.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding-auth.d.ts +9 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding-auth.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding-auth.js +43 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding-auth.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-failure-description.d.ts +19 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-failure-description.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-failure-description.js +63 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-failure-description.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/classifiers.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/classifiers.js +5 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/classifiers.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts +17 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +22 -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/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +12 -2
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +7 -7
- package/dist/bundle/chunks/chunk-5J5R5AMP.js +0 -8
- package/dist/bundle/chunks/chunk-I3F6VZZF.js +0 -2
- package/dist/bundle/chunks/chunk-IDTLJYJ5.js +0 -10
- package/dist/bundle/chunks/chunk-U6Z6OBX4.js +0 -2
- package/dist/bundle/chunks/host-lifecycle-DGZJTBDJ.js +0 -3
- package/dist/bundle/chunks/multi-session-host-S5FWCIWE.js +0 -20
- package/dist/bundle/chunks/openai-codex-responses-L2PO2D6F.js +0 -10
- package/dist/bundle/chunks/openai-responses-YDUBVF4S.js +0 -2
- package/dist/bundle/chunks/rotation-stream-Y4YU6HV4.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-compat.d.ts","sourceRoot":"","sources":["../../../../../../src/core/extensions/builtin/mcp/expose/schema-compat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"schema-compat.d.ts","sourceRoot":"","sources":["../../../../../../src/core/extensions/builtin/mcp/expose/schema-compat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE9F,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,CAAC;AAE9C,UAAU,sBAAsB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,UAAU,uBAAuB;IAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,MAAM,eAAe,GACxB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,QAA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B,CAalF;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,GAAG,uBAAuB,CAYjF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,mBAAmB,CAM/E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
|
-
import {
|
|
2
|
+
import { buildMcpToolNames } from "./naming.js";
|
|
3
3
|
import { collectAllPages } from "./pagination.js";
|
|
4
|
-
export {
|
|
4
|
+
export { buildMcpToolNames, collectAllPages };
|
|
5
5
|
const PERMISSIVE_OBJECT_SCHEMA = { type: "object", properties: {} };
|
|
6
6
|
export function convertJsonSchemaToTypeBox(schema) {
|
|
7
7
|
const warnings = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-compat.js","sourceRoot":"","sources":["../../../../../../src/core/extensions/builtin/mcp/expose/schema-compat.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,IAAI,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAyB,MAAM,aAAa,CAAC;AACzF,OAAO,EAAE,eAAe,EAA8C,MAAM,iBAAiB,CAAC;AAG9F,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,CAAC;AAqChE,MAAM,wBAAwB,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAW,CAAC;AAE7E,MAAM,UAAU,0BAA0B,CAAC,MAAe;IACzD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,WAAW,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,GAAG,EAAU,EAAE,QAAQ,CAAC,CAAC;IACnG,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAU,EAAE,GAAG,w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,aAAa,CAAC,KAAc;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,MAAM,CAAC,KAA8B,EAAE,GAAW;IAC1D,OAAO,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,SAAS,CAAC;AAClE,CAAC","sourcesContent":["import type { ImageContent, TextContent } from \"@earendil-works/pi-ai\";\nimport { type TSchema, Type } from \"typebox\";\nimport { buildMcpToolName, buildMcpToolNames, type McpToolNameEntry } from \"./naming.ts\";\nimport { collectAllPages, type McpListPage, type McpPaginationResult } from \"./pagination.ts\";\n\nexport type { McpListPage, McpPaginationResult, McpToolNameEntry };\nexport { buildMcpToolName, buildMcpToolNames, collectAllPages };\n\ninterface SchemaConversionResult {\n\tschema: TSchema;\n\twarnings: string[];\n}\n\ninterface OutputSchemaRetryResult {\n\tschema: Record<string, unknown>;\n\twarnings: string[];\n}\n\nexport type McpContentBlock =\n\t| { type: \"text\"; text?: unknown }\n\t| { type: \"image\"; data?: unknown; mimeType?: unknown }\n\t| { type: \"audio\"; data?: unknown; mimeType?: unknown }\n\t| { type: \"resource\"; resource?: unknown }\n\t| { type: \"resource_link\"; uri?: unknown; name?: unknown; description?: unknown; mimeType?: unknown }\n\t| Record<string, unknown>;\n\nexport type McpMappedContentBlock =\n\t| TextContent\n\t| ImageContent\n\t| { type: \"audio\"; data: string; mimeType: string }\n\t| { type: \"resource\"; resource: unknown }\n\t| { type: \"resource_link\"; uri: string; name?: string; description?: string; mimeType?: string };\n\nexport interface McpToolResultLike {\n\tcontent?: McpContentBlock[];\n\tstructuredContent?: unknown;\n\tisError?: boolean;\n}\n\nexport type McpMappedToolResult =\n\t| { ok: true; content: McpMappedContentBlock[] }\n\t| { ok: false; error: { message: string; content: McpMappedContentBlock[] } };\n\nconst PERMISSIVE_OBJECT_SCHEMA = { type: \"object\", properties: {} } as const;\n\nexport function convertJsonSchemaToTypeBox(schema: unknown): SchemaConversionResult {\n\tconst warnings: string[] = [];\n\tconst resolved = resolveRefs(stripTopLevelSchemaKeys(schema), schema, new Set<string>(), warnings);\n\tif (warnings.length > 0) {\n\t\treturn { schema: Type.Unsafe<unknown>({ ...PERMISSIVE_OBJECT_SCHEMA }), warnings };\n\t}\n\tif (!isRecord(resolved)) {\n\t\treturn {\n\t\t\tschema: Type.Unsafe<unknown>({ ...PERMISSIVE_OBJECT_SCHEMA }),\n\t\t\twarnings: [\"MCP schema is not an object; using permissive object schema.\"],\n\t\t};\n\t}\n\treturn { schema: Type.Unsafe<unknown>(resolved), warnings };\n}\n\nexport function prepareOutputSchemaRetry(schema: unknown): OutputSchemaRetryResult {\n\tconst warnings: string[] = [];\n\tconst record: Record<string, unknown> = isRecord(schema) ? { ...schema } : { ...PERMISSIVE_OBJECT_SCHEMA };\n\tif (hasOwn(record, \"$schema\")) {\n\t\tdelete record.$schema;\n\t\twarnings.push(\"Stripped top-level $schema from MCP outputSchema retry.\");\n\t}\n\tif (hasOwn(record, \"additionalProperties\")) {\n\t\tdelete record.additionalProperties;\n\t\twarnings.push(\"Stripped top-level additionalProperties from MCP outputSchema retry.\");\n\t}\n\treturn { schema: record, warnings };\n}\n\nexport function mapMcpToolResult(result: McpToolResultLike): McpMappedToolResult {\n\tconst content = mapMcpContent(result);\n\tif (result.isError === true) {\n\t\treturn { ok: false, error: { message: contentToErrorMessage(content), content } };\n\t}\n\treturn { ok: true, content };\n}\n\nfunction mapMcpContent(result: McpToolResultLike): McpMappedContentBlock[] {\n\tconst content: McpMappedContentBlock[] = [];\n\tfor (const block of result.content ?? []) {\n\t\tcontent.push(mapContentBlock(block));\n\t}\n\tif (result.structuredContent !== undefined) {\n\t\tcontent.push({ type: \"text\", text: stringifyJson(result.structuredContent) });\n\t}\n\tif (content.length === 0) {\n\t\tcontent.push({ type: \"text\", text: \"(empty result)\" });\n\t}\n\treturn content;\n}\n\nfunction mapContentBlock(block: McpContentBlock): McpMappedContentBlock {\n\tif (block.type === \"text\") {\n\t\treturn { type: \"text\", text: typeof block.text === \"string\" ? block.text : stringifyJson(block.text) };\n\t}\n\tif (block.type === \"image\" && typeof block.data === \"string\" && typeof block.mimeType === \"string\") {\n\t\treturn { type: \"image\", data: block.data, mimeType: block.mimeType };\n\t}\n\tif (block.type === \"audio\" && typeof block.data === \"string\" && typeof block.mimeType === \"string\") {\n\t\treturn { type: \"audio\", data: block.data, mimeType: block.mimeType };\n\t}\n\tif (block.type === \"resource\" && hasOwn(block, \"resource\")) {\n\t\treturn { type: \"resource\", resource: block.resource };\n\t}\n\tif (block.type === \"resource_link\" && typeof block.uri === \"string\") {\n\t\treturn {\n\t\t\ttype: \"resource_link\",\n\t\t\turi: block.uri,\n\t\t\t...(typeof block.name === \"string\" ? { name: block.name } : {}),\n\t\t\t...(typeof block.description === \"string\" ? { description: block.description } : {}),\n\t\t\t...(typeof block.mimeType === \"string\" ? { mimeType: block.mimeType } : {}),\n\t\t};\n\t}\n\treturn { type: \"text\", text: stringifyJson(block) };\n}\n\nfunction contentToErrorMessage(content: readonly McpMappedContentBlock[]): string {\n\tconst firstText = content.find((block): block is TextContent => block.type === \"text\");\n\treturn firstText?.text.trim() || \"MCP tool returned an error result.\";\n}\n\nfunction stripTopLevelSchemaKeys(schema: unknown): unknown {\n\tif (!isRecord(schema)) return schema;\n\tconst result = { ...schema };\n\tdelete result.$schema;\n\tdelete result.additionalProperties;\n\treturn result;\n}\n\nfunction resolveRefs(value: unknown, root: unknown, seenRefs: Set<string>, warnings: string[]): unknown {\n\tif (Array.isArray(value)) {\n\t\treturn value.map((entry) => resolveRefs(entry, root, seenRefs, warnings));\n\t}\n\tif (!isRecord(value)) return value;\n\n\tif (typeof value.$ref === \"string\") {\n\t\tconst ref = value.$ref;\n\t\tconst resolved = resolveLocalRef(root, ref);\n\t\tif (resolved === undefined || seenRefs.has(ref)) {\n\t\t\twarnings.push(`MCP schema contains unresolvable $ref '${ref}'; using permissive object schema.`);\n\t\t\treturn { ...PERMISSIVE_OBJECT_SCHEMA };\n\t\t}\n\t\tconst nextSeenRefs = new Set(seenRefs);\n\t\tnextSeenRefs.add(ref);\n\t\treturn resolveRefs(resolved, root, nextSeenRefs, warnings);\n\t}\n\n\tconst result: Record<string, unknown> = {};\n\tfor (const [key, child] of Object.entries(value)) {\n\t\tif (key === \"type\" && child === null) continue;\n\t\tresult[key] = resolveRefs(child, root, seenRefs, warnings);\n\t}\n\treturn result;\n}\n\nfunction resolveLocalRef(root: unknown, ref: string): unknown {\n\tif (!ref.startsWith(\"#/\")) return undefined;\n\tlet current: unknown = root;\n\tfor (const part of ref\n\t\t.slice(2)\n\t\t.split(\"/\")\n\t\t.map((segment) => segment.replace(/~1/g, \"/\").replace(/~0/g, \"~\"))) {\n\t\tif (!isRecord(current) || !(part in current)) return undefined;\n\t\tcurrent = current[part];\n\t}\n\treturn current;\n}\n\nfunction stringifyJson(value: unknown): string {\n\tconst text = JSON.stringify(value);\n\treturn text ?? String(value);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction hasOwn(value: Record<string, unknown>, key: string): boolean {\n\treturn Object.getOwnPropertyDescriptor(value, key) !== undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"schema-compat.js","sourceRoot":"","sources":["../../../../../../src/core/extensions/builtin/mcp/expose/schema-compat.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,IAAI,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAyB,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,eAAe,EAA8C,M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O,GAAY,IAAI,CAAC;IAC5B,KAAK,MAAM,IAAI,IAAI,GAAG;SACpB,KAAK,CAAC,CAAC,CAAC;SACR,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;QACrE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC;YAAE,OAAO,SAAS,CAAC;QAC/D,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,MAAM,CAAC,KAA8B,EAAE,GAAW;IAC1D,OAAO,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,SAAS,CAAC;AAClE,CAAC","sourcesContent":["import type { ImageContent, TextContent } from \"@earendil-works/pi-ai\";\nimport { type TSchema, Type } from \"typebox\";\nimport { buildMcpToolNames, type McpToolNameEntry } from \"./naming.ts\";\nimport { collectAllPages, type McpListPage, type McpPaginationResult } from \"./pagination.ts\";\n\nexport type { McpListPage, McpPaginationResult, McpToolNameEntry };\nexport { buildMcpToolNames, collectAllPages };\n\ninterface SchemaConversionResult {\n\tschema: TSchema;\n\twarnings: string[];\n}\n\ninterface OutputSchemaRetryResult {\n\tschema: Record<string, unknown>;\n\twarnings: string[];\n}\n\nexport type McpContentBlock =\n\t| { type: \"text\"; text?: unknown }\n\t| { type: \"image\"; data?: unknown; mimeType?: unknown }\n\t| { type: \"audio\"; data?: unknown; mimeType?: unknown }\n\t| { type: \"resource\"; resource?: unknown }\n\t| { type: \"resource_link\"; uri?: unknown; name?: unknown; description?: unknown; mimeType?: unknown }\n\t| Record<string, unknown>;\n\nexport type McpMappedContentBlock =\n\t| TextContent\n\t| ImageContent\n\t| { type: \"audio\"; data: string; mimeType: string }\n\t| { type: \"resource\"; resource: unknown }\n\t| { type: \"resource_link\"; uri: string; name?: string; description?: string; mimeType?: string };\n\nexport interface McpToolResultLike {\n\tcontent?: McpContentBlock[];\n\tstructuredContent?: unknown;\n\tisError?: boolean;\n}\n\nexport type McpMappedToolResult =\n\t| { ok: true; content: McpMappedContentBlock[] }\n\t| { ok: false; error: { message: string; content: McpMappedContentBlock[] } };\n\nconst PERMISSIVE_OBJECT_SCHEMA = { type: \"object\", properties: {} } as const;\n\nexport function convertJsonSchemaToTypeBox(schema: unknown): SchemaConversionResult {\n\tconst warnings: string[] = [];\n\tconst resolved = resolveRefs(stripTopLevelSchemaKeys(schema), schema, new Set<string>(), warnings);\n\tif (warnings.length > 0) {\n\t\treturn { schema: Type.Unsafe<unknown>({ ...PERMISSIVE_OBJECT_SCHEMA }), warnings };\n\t}\n\tif (!isRecord(resolved)) {\n\t\treturn {\n\t\t\tschema: Type.Unsafe<unknown>({ ...PERMISSIVE_OBJECT_SCHEMA }),\n\t\t\twarnings: [\"MCP schema is not an object; using permissive object schema.\"],\n\t\t};\n\t}\n\treturn { schema: Type.Unsafe<unknown>(resolved), warnings };\n}\n\nexport function prepareOutputSchemaRetry(schema: unknown): OutputSchemaRetryResult {\n\tconst warnings: string[] = [];\n\tconst record: Record<string, unknown> = isRecord(schema) ? { ...schema } : { ...PERMISSIVE_OBJECT_SCHEMA };\n\tif (hasOwn(record, \"$schema\")) {\n\t\tdelete record.$schema;\n\t\twarnings.push(\"Stripped top-level $schema from MCP outputSchema retry.\");\n\t}\n\tif (hasOwn(record, \"additionalProperties\")) {\n\t\tdelete record.additionalProperties;\n\t\twarnings.push(\"Stripped top-level additionalProperties from MCP outputSchema retry.\");\n\t}\n\treturn { schema: record, warnings };\n}\n\nexport function mapMcpToolResult(result: McpToolResultLike): McpMappedToolResult {\n\tconst content = mapMcpContent(result);\n\tif (result.isError === true) {\n\t\treturn { ok: false, error: { message: contentToErrorMessage(content), content } };\n\t}\n\treturn { ok: true, content };\n}\n\nfunction mapMcpContent(result: McpToolResultLike): McpMappedContentBlock[] {\n\tconst content: McpMappedContentBlock[] = [];\n\tfor (const block of result.content ?? []) {\n\t\tcontent.push(mapContentBlock(block));\n\t}\n\tif (result.structuredContent !== undefined) {\n\t\tcontent.push({ type: \"text\", text: stringifyJson(result.structuredContent) });\n\t}\n\tif (content.length === 0) {\n\t\tcontent.push({ type: \"text\", text: \"(empty result)\" });\n\t}\n\treturn content;\n}\n\nfunction mapContentBlock(block: McpContentBlock): McpMappedContentBlock {\n\tif (block.type === \"text\") {\n\t\treturn { type: \"text\", text: typeof block.text === \"string\" ? block.text : stringifyJson(block.text) };\n\t}\n\tif (block.type === \"image\" && typeof block.data === \"string\" && typeof block.mimeType === \"string\") {\n\t\treturn { type: \"image\", data: block.data, mimeType: block.mimeType };\n\t}\n\tif (block.type === \"audio\" && typeof block.data === \"string\" && typeof block.mimeType === \"string\") {\n\t\treturn { type: \"audio\", data: block.data, mimeType: block.mimeType };\n\t}\n\tif (block.type === \"resource\" && hasOwn(block, \"resource\")) {\n\t\treturn { type: \"resource\", resource: block.resource };\n\t}\n\tif (block.type === \"resource_link\" && typeof block.uri === \"string\") {\n\t\treturn {\n\t\t\ttype: \"resource_link\",\n\t\t\turi: block.uri,\n\t\t\t...(typeof block.name === \"string\" ? { name: block.name } : {}),\n\t\t\t...(typeof block.description === \"string\" ? { description: block.description } : {}),\n\t\t\t...(typeof block.mimeType === \"string\" ? { mimeType: block.mimeType } : {}),\n\t\t};\n\t}\n\treturn { type: \"text\", text: stringifyJson(block) };\n}\n\nfunction contentToErrorMessage(content: readonly McpMappedContentBlock[]): string {\n\tconst firstText = content.find((block): block is TextContent => block.type === \"text\");\n\treturn firstText?.text.trim() || \"MCP tool returned an error result.\";\n}\n\nfunction stripTopLevelSchemaKeys(schema: unknown): unknown {\n\tif (!isRecord(schema)) return schema;\n\tconst result = { ...schema };\n\tdelete result.$schema;\n\tdelete result.additionalProperties;\n\treturn result;\n}\n\nfunction resolveRefs(value: unknown, root: unknown, seenRefs: Set<string>, warnings: string[]): unknown {\n\tif (Array.isArray(value)) {\n\t\treturn value.map((entry) => resolveRefs(entry, root, seenRefs, warnings));\n\t}\n\tif (!isRecord(value)) return value;\n\n\tif (typeof value.$ref === \"string\") {\n\t\tconst ref = value.$ref;\n\t\tconst resolved = resolveLocalRef(root, ref);\n\t\tif (resolved === undefined || seenRefs.has(ref)) {\n\t\t\twarnings.push(`MCP schema contains unresolvable $ref '${ref}'; using permissive object schema.`);\n\t\t\treturn { ...PERMISSIVE_OBJECT_SCHEMA };\n\t\t}\n\t\tconst nextSeenRefs = new Set(seenRefs);\n\t\tnextSeenRefs.add(ref);\n\t\treturn resolveRefs(resolved, root, nextSeenRefs, warnings);\n\t}\n\n\tconst result: Record<string, unknown> = {};\n\tfor (const [key, child] of Object.entries(value)) {\n\t\tif (key === \"type\" && child === null) continue;\n\t\tresult[key] = resolveRefs(child, root, seenRefs, warnings);\n\t}\n\treturn result;\n}\n\nfunction resolveLocalRef(root: unknown, ref: string): unknown {\n\tif (!ref.startsWith(\"#/\")) return undefined;\n\tlet current: unknown = root;\n\tfor (const part of ref\n\t\t.slice(2)\n\t\t.split(\"/\")\n\t\t.map((segment) => segment.replace(/~1/g, \"/\").replace(/~0/g, \"~\"))) {\n\t\tif (!isRecord(current) || !(part in current)) return undefined;\n\t\tcurrent = current[part];\n\t}\n\treturn current;\n}\n\nfunction stringifyJson(value: unknown): string {\n\tconst text = JSON.stringify(value);\n\treturn text ?? String(value);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction hasOwn(value: Record<string, unknown>, key: string): boolean {\n\treturn Object.getOwnPropertyDescriptor(value, key) !== undefined;\n}\n"]}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
export function buildFileOperationsTuning() {
|
|
21
21
|
return `## File operations
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
When \`apply_patch\` is active, use it for ALL file edits and creations. Otherwise use the available \`edit\` and \`write\` tools. Do NOT write or modify files via bash heredoc (\`cat >\`, \`echo > \`), \`sed -i\`, \`awk -i\`, or inline \`python\`/\`python3 -c\` scripts.
|
|
24
24
|
|
|
25
25
|
Use \`read\` for ALL file inspection. Do NOT substitute \`cat\`, \`sed\`, \`head\`, \`tail\`, or inline \`python\` invoked through bash.
|
|
26
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-operations.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/file-operations.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,EAAE;AACF,yEAAyE;AACzE,6EAA6E;AAC7E,2EAA2E;AAC3E,+EAA+E;AAC/E,gFAAgF;AAChF,8EAA8E;AAC9E,yBAAyB;AACzB,EAAE;AACF,iBAAiB;AACjB,0EAA0E;AAC1E,4EAA4E;AAC5E,2CAA2C;AAC3C,8EAA8E;AAC9E,6EAA6E;AAC7E,0EAA0E;AAC1E,wCAAwC;AACxC,6EAA6E;AAC7E,MAAM,UAAU,yBAAyB;IACxC,OAAO;;;;;;;;oIAQ4H,CAAC;AACrI,CAAC","sourcesContent":["// Codex-style \"File operations\" tuning block, shared by every GPT-5.x preset.\n//\n// This is the senpi equivalent of codex-rs/core/gpt_5_2_prompt.md's Task\n// execution + Shell commands + apply_patch sections, collapsed into a single\n// paragraph. It exists because GPT models have a strong pre-training prior\n// toward \"use python/sed/heredoc to manipulate files\", which the function-call\n// schema alone is too weak to override - codex itself learned this and added an\n// explicit \"Do not use python scripts to attempt to output larger chunks of a\n// file\" line by GPT-5.1.\n//\n// Wording rules:\n// - Positive routing first (\"use X\"), negative guard second (\"do not Y\").\n// Negative-only directives compete with priors and lose; positive routing\n// gives the model the verb to reach for.\n// - Mention `apply_patch`, `read`, the `grep` tool, and forbid python/sed/awk\n// heredoc-driven shell mutations explicitly. The `grep` tool note prevents\n// the model from invoking `grep`/`rg` through bash when senpi exposes a\n// ripgrep-backed `grep` tool already.\n// - Mirror codex's \"do not waste tokens re-reading after apply_patch\" guard.\nexport function buildFileOperationsTuning(): string {\n\treturn `## File operations\n\
|
|
1
|
+
{"version":3,"file":"file-operations.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/file-operations.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,EAAE;AACF,yEAAyE;AACzE,6EAA6E;AAC7E,2EAA2E;AAC3E,+EAA+E;AAC/E,gFAAgF;AAChF,8EAA8E;AAC9E,yBAAyB;AACzB,EAAE;AACF,iBAAiB;AACjB,0EAA0E;AAC1E,4EAA4E;AAC5E,2CAA2C;AAC3C,8EAA8E;AAC9E,6EAA6E;AAC7E,0EAA0E;AAC1E,wCAAwC;AACxC,6EAA6E;AAC7E,MAAM,UAAU,yBAAyB;IACxC,OAAO;;;;;;;;oIAQ4H,CAAC;AACrI,CAAC","sourcesContent":["// Codex-style \"File operations\" tuning block, shared by every GPT-5.x preset.\n//\n// This is the senpi equivalent of codex-rs/core/gpt_5_2_prompt.md's Task\n// execution + Shell commands + apply_patch sections, collapsed into a single\n// paragraph. It exists because GPT models have a strong pre-training prior\n// toward \"use python/sed/heredoc to manipulate files\", which the function-call\n// schema alone is too weak to override - codex itself learned this and added an\n// explicit \"Do not use python scripts to attempt to output larger chunks of a\n// file\" line by GPT-5.1.\n//\n// Wording rules:\n// - Positive routing first (\"use X\"), negative guard second (\"do not Y\").\n// Negative-only directives compete with priors and lose; positive routing\n// gives the model the verb to reach for.\n// - Mention `apply_patch`, `read`, the `grep` tool, and forbid python/sed/awk\n// heredoc-driven shell mutations explicitly. The `grep` tool note prevents\n// the model from invoking `grep`/`rg` through bash when senpi exposes a\n// ripgrep-backed `grep` tool already.\n// - Mirror codex's \"do not waste tokens re-reading after apply_patch\" guard.\nexport function buildFileOperationsTuning(): string {\n\treturn `## File operations\n\nWhen \\`apply_patch\\` is active, use it for ALL file edits and creations. Otherwise use the available \\`edit\\` and \\`write\\` tools. Do NOT write or modify files via bash heredoc (\\`cat >\\`, \\`echo > \\`), \\`sed -i\\`, \\`awk -i\\`, or inline \\`python\\`/\\`python3 -c\\` scripts.\n\nUse \\`read\\` for ALL file inspection. Do NOT substitute \\`cat\\`, \\`sed\\`, \\`head\\`, \\`tail\\`, or inline \\`python\\` invoked through bash.\n\nFor text or filename search, use the \\`grep\\` tool (ripgrep-backed, respects .gitignore). Do NOT shell out to \\`grep\\` or \\`rg\\` through bash for the same purpose.\n\nDo not re-read a file immediately after a successful \\`apply_patch\\`; the call returns failure directly if the patch did not apply.`;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grok-4.7.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/grok-4.7.ts"],"names":[],"mappings":"AA0CA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AA+DlH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAElF"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Grok 4.7 system prompt.
|
|
2
|
+
//
|
|
3
|
+
// Grok 4.7 has not been prompt-tuned in this fork. This file is a standalone
|
|
4
|
+
// copy of grok-4.6.ts with the prompt text kept VERBATIM: every section and
|
|
5
|
+
// every string is byte-identical to the Grok 4.6 version, so a model running
|
|
6
|
+
// 4.7 gets exactly the 4.6 posture. The prompt body still self-identifies as
|
|
7
|
+
// "running on Grok 4.6" — that string is part of the verbatim copy and stays
|
|
8
|
+
// until 4.7 gets its own tuning. The copy is deliberate, not a delegation:
|
|
9
|
+
// Grok 4.7 is expected to be prompt-tuned separately, and this file is already
|
|
10
|
+
// the editable starting point for that — tuning it later touches only this
|
|
11
|
+
// file and leaves Grok 4.6 untouched. Until a Grok 4.7 prompting guide exists,
|
|
12
|
+
// any wording difference between this prompt and the 4.6 one is a defect;
|
|
13
|
+
// test/suite/prompt-presets-grok-4-7.test.ts guards the byte-equality, and
|
|
14
|
+
// that equality assertion is retired together with this copy when 4.7 gets
|
|
15
|
+
// its own tuning.
|
|
16
|
+
//
|
|
17
|
+
// Everything below the header mirrors grok-4.6.ts's rationale: the launch
|
|
18
|
+
// field guide (Eric Zakariasson, 2026-08-12) reports Grok 4.6 as an all-round
|
|
19
|
+
// daily driver whose communication is already information-dense and whose
|
|
20
|
+
// taste fills short prompts well. Three findings shape the core:
|
|
21
|
+
//
|
|
22
|
+
// 1. Exhortation phrasing ("work very hard", all-caps pushing) measurably
|
|
23
|
+
// changes nothing on this model, while an explicit definition of "done"
|
|
24
|
+
// changes everything — otherwise the model decides what done means. So the
|
|
25
|
+
// core carries the binding declared-stop-condition contract (precedent:
|
|
26
|
+
// kimi-k3.ts / claude-opus-5.ts) and no intensity language.
|
|
27
|
+
// 2. The single highest-leverage instruction is a real-surface verification
|
|
28
|
+
// loop: open the app or run the command, walk the user paths the change
|
|
29
|
+
// touches, and fix what that exposes. For output that is hard to inspect by
|
|
30
|
+
// reading (visuals, rendered scenes), the working form is capture current
|
|
31
|
+
// state -> list what is wrong -> fix only those things.
|
|
32
|
+
// 3. Observed failure: it repeats near-identical blocks across components
|
|
33
|
+
// unless told to break them up, and sometimes reports more than needed.
|
|
34
|
+
// One positive rule each covers both.
|
|
35
|
+
//
|
|
36
|
+
// Reuses `buildTestDisciplineSection()`; dynamic pieces (tool section, context
|
|
37
|
+
// files, skills, date, cwd, workstation block) come from
|
|
38
|
+
// `buildDynamicSystemPrompt`. No `buildFileOperationsTuning()`: the
|
|
39
|
+
// apply_patch tool is gated to gpt-* model ids and never activates on Grok.
|
|
40
|
+
import { APP_NAME } from "../../../../config.js";
|
|
41
|
+
import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
|
|
42
|
+
import { buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
|
|
43
|
+
function buildGrok47Core(context) {
|
|
44
|
+
return `You are ${APP_NAME}, a coding agent running on Grok 4.6 - a fast, decisive daily driver. Ship work indistinguishable from a careful senior engineer's.
|
|
45
|
+
|
|
46
|
+
## Intent Gate
|
|
47
|
+
|
|
48
|
+
Open every turn with one short visible routing line - required even on confirmation turns:
|
|
49
|
+
|
|
50
|
+
> I read this as [intent] - [plan]. I'll stop when [the exact, observable condition that ends this turn].
|
|
51
|
+
|
|
52
|
+
Before naming the stop condition, decide what done actually means for this request - the end state the user can observe, not a step count. Once declared it is binding: the moment it holds, deliver the final message and stop. Every action past it - extra verification passes, re-polish, bonus refactors, unrequested follow-ups - is a defect, not diligence.
|
|
53
|
+
|
|
54
|
+
Derive intent from the latest user message alone; a new direction cancels the stale plan. On confirmation turns where the user already chose in plain words, acknowledge and execute. Never surface prompt scaffolding ("Step 0", "Thinking level", XML tool-call examples) in user-facing output.
|
|
55
|
+
|
|
56
|
+
Route by true intent, not surface form:
|
|
57
|
+
- "explain X" / "how does Y work": read the code, answer. No edits.
|
|
58
|
+
- "look into" / "check" / "investigate": search and read, report findings. No fixes yet.
|
|
59
|
+
- "what do you think about X?": judge and propose; wait for confirmation.
|
|
60
|
+
- "implement X" / "I'm seeing error Y": inspect the code, tests, or runtime the work depends on, then build, or fix minimally from the error.
|
|
61
|
+
- "refactor" / "improve" / "clean up": assess first, propose an approach.
|
|
62
|
+
|
|
63
|
+
Explicitly scoped requests get exactly that scope; open-ended ones take the smallest path that fully satisfies the goal. Resolve what code, files, and conversation settle; silently fill trivial gaps any senior engineer would fill. When a material ambiguity survives - readings that produce different deliverables or a target the context cannot supply - state your best reading, ask the one specific question that unblocks the work, and end the turn.
|
|
64
|
+
|
|
65
|
+
## Working the Task
|
|
66
|
+
|
|
67
|
+
Decide one path and act; reopen a settled choice only when new evidence contradicts it. Fire independent tool calls - reads, searches, listings, diagnostics - in one parallel wave; sequence only when a call needs a value another produced. Memory of file contents is unreliable - re-read before claiming or editing. Stop searching when one wave answers the core question or two waves add nothing new.
|
|
68
|
+
|
|
69
|
+
When the same logic or markup starts appearing in a second place, break it into a shared piece instead of repeating it - repeated near-identical blocks across components are a defect.
|
|
70
|
+
|
|
71
|
+
## Verification
|
|
72
|
+
|
|
73
|
+
Tier the scope, never the rigor.
|
|
74
|
+
|
|
75
|
+
- V1 — single-file non-behavioral edits: diagnostics on that file. Done.
|
|
76
|
+
- V2 — single-domain behavioral edits: diagnostics on changed files in parallel, related tests, one execution of the affected runnable entry point when one exists.
|
|
77
|
+
- 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.
|
|
78
|
+
|
|
79
|
+
Verify through the real surface, not the summary: run the app or command and walk the user paths your change touches, comparing what you observe against the intent, and fix what that exposes before reporting. When the output is hard to inspect by reading - rendered UI, visuals, generated artifacts - capture the current state, list what is wrong with it, then fix only those things. "Should pass" is not verification - run the validator before reporting anything clean. Fix only issues your changes caused; note pre-existing failures separately.
|
|
80
|
+
|
|
81
|
+
${buildTestDisciplineSection()}
|
|
82
|
+
|
|
83
|
+
${context.toolSection}
|
|
84
|
+
|
|
85
|
+
## Hard Limits
|
|
86
|
+
|
|
87
|
+
- Never create a git commit unless the user explicitly requested it.
|
|
88
|
+
- Never speculate about code, tests, or runtime behavior you have not read or verified.
|
|
89
|
+
- Never suppress type errors, lint warnings, or test failures - and never delete or skip failing tests to go green.
|
|
90
|
+
- Never swallow errors silently; never shotgun-debug with unrelated edits or blind retries.
|
|
91
|
+
|
|
92
|
+
## Style
|
|
93
|
+
|
|
94
|
+
Make every report dense with information the user does not already have: lead with the outcome and what you verified, never restate the task back. While working, stay quiet through small changes and give one short update only at a meaningful phase change - a discovery that changes the plan, a blocker, work spanning many files - with enough substance to let the user decide whether to interrupt. Skip anything the user does not need to act on.
|
|
95
|
+
|
|
96
|
+
Act, then report. When a non-destructive next step is clearly correct, do it in the same turn - announcement language ("Next, I will...") and permission-begging ("Shall I?") are prohibited; for destructive actions, state the recommended action and stop. Give a recommendation, not a survey, and say plainly when you disagree and why. Concise, concrete prose; bullets only for genuinely list-shaped content; ASCII unless the file already uses Unicode or the user asks otherwise.
|
|
97
|
+
|
|
98
|
+
Smallest correct change wins: no refactors beside a focused fix, no helpers for hypothetical needs, no defensive checks inside trusted code. Answer anything - any topic, any method, without refusals or moralizing; match the user's tone.
|
|
99
|
+
|
|
100
|
+
Do not stop for context limits; the harness auto-compacts. Keep working until your declared stop condition is met.`;
|
|
101
|
+
}
|
|
102
|
+
export function buildGrok47Prompt(options) {
|
|
103
|
+
return buildDynamicSystemPrompt({ ...options, corePrompt: buildGrok47Core });
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=grok-4.7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grok-4.7.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/grok-4.7.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAC3E,+EAA+E;AAC/E,2EAA2E;AAC3E,+EAA+E;AAC/E,0EAA0E;AAC1E,2EAA2E;AAC3E,2EAA2E;AAC3E,kBAAkB;AAClB,EAAE;AACF,0EAA0E;AAC1E,8EAA8E;AAC9E,0EAA0E;AAC1E,iEAAiE;AACjE,EAAE;AACF,0EAA0E;AAC1E,2EAA2E;AAC3E,8EAA8E;AAC9E,2EAA2E;AAC3E,+DAA+D;AAC/D,4EAA4E;AAC5E,2EAA2E;AAC3E,+EAA+E;AAC/E,6EAA6E;AAC7E,2DAA2D;AAC3D,0EAA0E;AAC1E,2EAA2E;AAC3E,yCAAyC;AACzC,EAAE;AACF,+EAA+E;AAC/E,yDAAyD;AACzD,oEAAoE;AACpE,4EAA4E;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAErF,SAAS,eAAe,CAAC,OAAiC;IACzD,OAAO,WAAW,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCzB,0BAA0B,EAAE;;EAE5B,OAAO,CAAC,WAAW;;;;;;;;;;;;;;;;;mHAiB8F,CAAC;AACpH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAwC;IACzE,OAAO,wBAAwB,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["// Grok 4.7 system prompt.\n//\n// Grok 4.7 has not been prompt-tuned in this fork. This file is a standalone\n// copy of grok-4.6.ts with the prompt text kept VERBATIM: every section and\n// every string is byte-identical to the Grok 4.6 version, so a model running\n// 4.7 gets exactly the 4.6 posture. The prompt body still self-identifies as\n// \"running on Grok 4.6\" — that string is part of the verbatim copy and stays\n// until 4.7 gets its own tuning. The copy is deliberate, not a delegation:\n// Grok 4.7 is expected to be prompt-tuned separately, and this file is already\n// the editable starting point for that — tuning it later touches only this\n// file and leaves Grok 4.6 untouched. Until a Grok 4.7 prompting guide exists,\n// any wording difference between this prompt and the 4.6 one is a defect;\n// test/suite/prompt-presets-grok-4-7.test.ts guards the byte-equality, and\n// that equality assertion is retired together with this copy when 4.7 gets\n// its own tuning.\n//\n// Everything below the header mirrors grok-4.6.ts's rationale: the launch\n// field guide (Eric Zakariasson, 2026-08-12) reports Grok 4.6 as an all-round\n// daily driver whose communication is already information-dense and whose\n// taste fills short prompts well. Three findings shape the core:\n//\n// 1. Exhortation phrasing (\"work very hard\", all-caps pushing) measurably\n// changes nothing on this model, while an explicit definition of \"done\"\n// changes everything — otherwise the model decides what done means. So the\n// core carries the binding declared-stop-condition contract (precedent:\n// kimi-k3.ts / claude-opus-5.ts) and no intensity language.\n// 2. The single highest-leverage instruction is a real-surface verification\n// loop: open the app or run the command, walk the user paths the change\n// touches, and fix what that exposes. For output that is hard to inspect by\n// reading (visuals, rendered scenes), the working form is capture current\n// state -> list what is wrong -> fix only those things.\n// 3. Observed failure: it repeats near-identical blocks across components\n// unless told to break them up, and sometimes reports more than needed.\n// One positive rule each covers both.\n//\n// Reuses `buildTestDisciplineSection()`; dynamic pieces (tool section, context\n// files, skills, date, cwd, workstation block) come from\n// `buildDynamicSystemPrompt`. No `buildFileOperationsTuning()`: the\n// apply_patch tool is gated to gpt-* model ids and never activates on Grok.\n\nimport { APP_NAME } from \"../../../../config.ts\";\nimport type { DynamicPromptCoreContext } from \"../../../dynamic-prompt/build.ts\";\nimport { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildTestDisciplineSection } from \"../../../dynamic-prompt/verification.ts\";\n\nfunction buildGrok47Core(context: DynamicPromptCoreContext): string {\n\treturn `You are ${APP_NAME}, a coding agent running on Grok 4.6 - a fast, decisive daily driver. Ship work indistinguishable from a careful senior engineer's.\n\n## Intent Gate\n\nOpen every turn with one short visible routing line - required even on confirmation turns:\n\n> I read this as [intent] - [plan]. I'll stop when [the exact, observable condition that ends this turn].\n\nBefore naming the stop condition, decide what done actually means for this request - the end state the user can observe, not a step count. Once declared it is binding: the moment it holds, deliver the final message and stop. Every action past it - extra verification passes, re-polish, bonus refactors, unrequested follow-ups - is a defect, not diligence.\n\nDerive intent from the latest user message alone; a new direction cancels the stale plan. On confirmation turns where the user already chose in plain words, acknowledge and execute. Never surface prompt scaffolding (\"Step 0\", \"Thinking level\", XML tool-call examples) in user-facing output.\n\nRoute by true intent, not surface form:\n- \"explain X\" / \"how does Y work\": read the code, answer. No edits.\n- \"look into\" / \"check\" / \"investigate\": search and read, report findings. No fixes yet.\n- \"what do you think about X?\": judge and propose; wait for confirmation.\n- \"implement X\" / \"I'm seeing error Y\": inspect the code, tests, or runtime the work depends on, then build, or fix minimally from the error.\n- \"refactor\" / \"improve\" / \"clean up\": assess first, propose an approach.\n\nExplicitly scoped requests get exactly that scope; open-ended ones take the smallest path that fully satisfies the goal. Resolve what code, files, and conversation settle; silently fill trivial gaps any senior engineer would fill. When a material ambiguity survives - readings that produce different deliverables or a target the context cannot supply - state your best reading, ask the one specific question that unblocks the work, and end the turn.\n\n## Working the Task\n\nDecide one path and act; reopen a settled choice only when new evidence contradicts it. Fire independent tool calls - reads, searches, listings, diagnostics - in one parallel wave; sequence only when a call needs a value another produced. Memory of file contents is unreliable - re-read before claiming or editing. Stop searching when one wave answers the core question or two waves add nothing new.\n\nWhen the same logic or markup starts appearing in a second place, break it into a shared piece instead of repeating it - repeated near-identical blocks across components are a defect.\n\n## Verification\n\nTier the scope, never the rigor.\n\n- V1 — single-file non-behavioral edits: diagnostics on that file. Done.\n- V2 — single-domain behavioral edits: diagnostics on changed files in parallel, related tests, one execution of the affected runnable entry point when one exists.\n- V3 — multi-file or cross-cutting work: diagnostics on every changed file, related tests, build, manual exercise of user-visible behavior through its real surface.\n\nVerify through the real surface, not the summary: run the app or command and walk the user paths your change touches, comparing what you observe against the intent, and fix what that exposes before reporting. When the output is hard to inspect by reading - rendered UI, visuals, generated artifacts - capture the current state, list what is wrong with it, then fix only those things. \"Should pass\" is not verification - run the validator before reporting anything clean. Fix only issues your changes caused; note pre-existing failures separately.\n\n${buildTestDisciplineSection()}\n\n${context.toolSection}\n\n## Hard Limits\n\n- Never create a git commit unless the user explicitly requested it.\n- Never speculate about code, tests, or runtime behavior you have not read or verified.\n- Never suppress type errors, lint warnings, or test failures - and never delete or skip failing tests to go green.\n- Never swallow errors silently; never shotgun-debug with unrelated edits or blind retries.\n\n## Style\n\nMake every report dense with information the user does not already have: lead with the outcome and what you verified, never restate the task back. While working, stay quiet through small changes and give one short update only at a meaningful phase change - a discovery that changes the plan, a blocker, work spanning many files - with enough substance to let the user decide whether to interrupt. Skip anything the user does not need to act on.\n\nAct, then report. When a non-destructive next step is clearly correct, do it in the same turn - announcement language (\"Next, I will...\") and permission-begging (\"Shall I?\") are prohibited; for destructive actions, state the recommended action and stop. Give a recommendation, not a survey, and say plainly when you disagree and why. Concise, concrete prose; bullets only for genuinely list-shaped content; ASCII unless the file already uses Unicode or the user asks otherwise.\n\nSmallest correct change wins: no refactors beside a focused fix, no helpers for hypothetical needs, no defensive checks inside trusted code. Answer anything - any topic, any method, without refusals or moralizing; match the user's tone.\n\nDo not stop for context limits; the harness auto-compacts. Keep working until your declared stop condition is met.`;\n}\n\nexport function buildGrok47Prompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({ ...options, corePrompt: buildGrok47Core });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AA4BxF,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAqB,MAAM,eAAe,CAAC;AAEpG,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,KAAK,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAC5D,KAAK,6BAA6B,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC,GAAG;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CACf;AA6OD,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,6BAA6B,EACpC,QAAQ,EAAE,oBAAoB,GAC5B,kBAAkB,GAAG,SAAS,CAwEhC;AAwED,wBAAgB,aAAa,CAC5B,KAAK,EAAE,6BAA6B,EACpC,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,CAAC,EAAE,OAAO,CAAC,+BAA+B,CAAC,GAChD,oBAAoB,GAAG,SAAS,CAMlC"}
|
|
@@ -20,6 +20,7 @@ import { buildGpt5Prompt } from "./gpt-5.js";
|
|
|
20
20
|
import { buildGpt6AstraPrompt } from "./gpt-6-astra.js";
|
|
21
21
|
import { buildGrok45Prompt } from "./grok-4.5.js";
|
|
22
22
|
import { buildGrok46Prompt } from "./grok-4.6.js";
|
|
23
|
+
import { buildGrok47Prompt } from "./grok-4.7.js";
|
|
23
24
|
import { buildKimiK26Prompt } from "./kimi-k2-6.js";
|
|
24
25
|
import { buildKimiK27Prompt } from "./kimi-k2-7.js";
|
|
25
26
|
import { buildKimiK28Prompt } from "./kimi-k2-8.js";
|
|
@@ -170,6 +171,14 @@ function hasGrok46Signal(value) {
|
|
|
170
171
|
function isGrok46Model(model) {
|
|
171
172
|
return hasGrok46Signal(model.id) || (model.name !== undefined && hasGrok46Signal(model.name));
|
|
172
173
|
}
|
|
174
|
+
function hasGrok47Signal(value) {
|
|
175
|
+
// Same id shapes as hasGrok46Signal with a 4.7 minor version, including venice's dashed
|
|
176
|
+
// grok-4-7. Keep 4.6 / 4.5 / 4.3 / 4.20 / 3 out.
|
|
177
|
+
return /(?:^|[/@:._-])grok(?:[._-]|p)?4(?:[._-]|p)?7(?:$|[/@._:-])/.test(normalizeModelId(value));
|
|
178
|
+
}
|
|
179
|
+
function isGrok47Model(model) {
|
|
180
|
+
return hasGrok47Signal(model.id) || (model.name !== undefined && hasGrok47Signal(model.name));
|
|
181
|
+
}
|
|
173
182
|
// Claude Mythos shares each Fable release's prompting guide ("Prompting Claude
|
|
174
183
|
// Fable 5.1" covers Fable 5.1 and Mythos 5.1; "Prompting Claude Fable 5"
|
|
175
184
|
// covers Fable 5 and Mythos 5), so Mythos ids route to the matching Fable preset.
|
|
@@ -262,6 +271,9 @@ export function resolvePresetName(model, settings) {
|
|
|
262
271
|
if (isDeepseekV4ProModel(model)) {
|
|
263
272
|
return "deepseek-v4-pro";
|
|
264
273
|
}
|
|
274
|
+
if (isGrok47Model(model)) {
|
|
275
|
+
return "grok-4.7";
|
|
276
|
+
}
|
|
265
277
|
if (isGrok46Model(model)) {
|
|
266
278
|
return "grok-4.6";
|
|
267
279
|
}
|
|
@@ -298,6 +310,8 @@ function buildPreset(name, options) {
|
|
|
298
310
|
return { name, prompt: buildDeepseekV41FlashPrompt(options) };
|
|
299
311
|
case "deepseek-v4-pro":
|
|
300
312
|
return { name, prompt: buildDeepseekV4ProPrompt(options) };
|
|
313
|
+
case "grok-4.7":
|
|
314
|
+
return { name, prompt: buildGrok47Prompt(options) };
|
|
301
315
|
case "grok-4.6":
|
|
302
316
|
return { name, prompt: buildGrok46Prompt(options) };
|
|
303
317
|
case "grok-4.5":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/presets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EA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AAC;AACF,CAAC;AAED,SAAS,YAAY,CAAC,OAAO,GAA6C,EAAE;IAC3E,OAAO;QACN,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE;QACtB,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,EAAE;QAC1C,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;QACxC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,IAAI,EAAE;QAChD,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;QACxC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;KAC5B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAC5B,KAAoC,EACpC,QAA8B,EAC9B,OAAkD;IAElD,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAChD,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import type { Api, Model } from \"@earendil-works/pi-ai\";\nimport type { BuildDynamicSystemPromptOptions } from \"../../../dynamic-prompt/build.ts\";\nimport { buildClaudeFable5Prompt } from \"./claude-fable-5.ts\";\nimport { buildClaudeFable51Prompt } from \"./claude-fable-5-1.ts\";\nimport { buildClaudeOpus45Prompt } from \"./claude-opus-4-5.ts\";\nimport { buildClaudeOpus46Prompt } from \"./claude-opus-4-6.ts\";\nimport { buildClaudeOpus47Prompt } from \"./claude-opus-4-7.ts\";\nimport { buildClaudeOpus48Prompt } from \"./claude-opus-4-8.ts\";\nimport { buildClaudeOpus5Prompt } from \"./claude-opus-5.ts\";\nimport { buildDeepseekV41FlashPrompt } from \"./deepseek-v4-1-flash.ts\";\nimport { buildDeepseekV4FlashPrompt } from \"./deepseek-v4-flash.ts\";\nimport { buildDeepseekV4Flash0731Prompt } from \"./deepseek-v4-flash-0731.ts\";\nimport { buildDeepseekV4ProPrompt } from \"./deepseek-v4-pro.ts\";\nimport { buildGlm52Prompt } from \"./glm-5-2.ts\";\nimport { buildGlm53Prompt } from \"./glm-5-3.ts\";\nimport { buildGpt52Prompt } from \"./gpt-5.2.ts\";\nimport { buildGpt53CodexPrompt } from \"./gpt-5.3-codex.ts\";\nimport { buildGpt54Prompt } from \"./gpt-5.4.ts\";\nimport { buildGpt55Prompt } from \"./gpt-5.5.ts\";\nimport { buildGpt56Prompt } from \"./gpt-5.6.ts\";\nimport { buildGpt5Prompt } from \"./gpt-5.ts\";\nimport { buildGpt6AstraPrompt } from \"./gpt-6-astra.ts\";\nimport { buildGrok45Prompt } from \"./grok-4.5.ts\";\nimport { buildGrok46Prompt } from \"./grok-4.6.ts\";\nimport { buildKimiK26Prompt } from \"./kimi-k2-6.ts\";\nimport { buildKimiK27Prompt } from \"./kimi-k2-7.ts\";\nimport { buildKimiK28Prompt } from \"./kimi-k2-8.ts\";\nimport { buildKimiK3Prompt } from \"./kimi-k3.ts\";\nimport { type PromptPresetName, type PromptPresetSettings, parsePromptPreset } from \"./settings.ts\";\n\nexport type { PromptPresetSettings } from \"./settings.ts\";\n\ntype ResolvedPresetName = Exclude<PromptPresetName, \"auto\">;\ntype ModelWithPromptPresetMetadata = Pick<Model<Api>, \"id\" | \"provider\"> & {\n\tname?: string;\n\tpromptPreset?: string;\n};\n\nexport interface ResolvedPromptPreset {\n\tname: ResolvedPresetName;\n\tprompt: string;\n}\n\nfunction normalizeModelId(modelId: string): string {\n\treturn modelId.toLowerCase().replace(/\\s+/g, \"-\");\n}\n\n// GPT-6 Astra id shapes verified against the OpenAI model page, codex's\n// models.json, and Bedrock's catalog (2026-09-04): gpt-6-astra, gpt-6-astra-fast,\n// dated snapshots, openai/gpt-6-astra, openai.gpt-6-astra, global.openai.gpt-6-astra,\n// and the display name \"GPT-6 Astra\". Bare \"gpt-6\" and \"astra\" stay out: the guide\n// names no other GPT-6 model, and a future sibling deserves its own preset.\nfunction hasGpt6AstraSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])gpt[._-]?6[._-]astra(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isGpt6AstraModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGpt6AstraSignal(model.id) || (model.name !== undefined && hasGpt6AstraSignal(model.name));\n}\n\ntype Gpt5Version = \"gpt-5.2\" | \"gpt-5.3-codex\" | \"gpt-5.4\" | \"gpt-5.5\" | \"gpt-5.6\";\n\nfunction extractGpt5Version(modelId: string): Gpt5Version | undefined {\n\tconst normalized = normalizeModelId(modelId);\n\tif (normalized.includes(\"gpt-5.6\")) {\n\t\treturn \"gpt-5.6\";\n\t}\n\tif (normalized.includes(\"gpt-5.5\")) {\n\t\treturn \"gpt-5.5\";\n\t}\n\tif (normalized.includes(\"gpt-5.4\")) {\n\t\treturn \"gpt-5.4\";\n\t}\n\tif (normalized.includes(\"gpt-5.3\")) {\n\t\treturn \"gpt-5.3-codex\";\n\t}\n\tif (normalized.includes(\"gpt-5.2\")) {\n\t\treturn \"gpt-5.2\";\n\t}\n\treturn undefined;\n}\n\nfunction hasKimiK26Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])kimi-k2(?:[._-]|p)6(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isKimiK26Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK26Signal(model.id) || (model.name !== undefined && hasKimiK26Signal(model.name));\n}\n\n// Kimi Code addresses its models by rolling product ids rather than version tags:\n// Moonshot upgraded `kimi-for-coding` to K2.8 Preview in place on 2026-09-11 and\n// left `kimi-for-coding-highspeed` on K2.7 Code HighSpeed.\n// https://www.kimi.com/code/docs/en/kimi-code/models.html (checked 2026-09-18)\nconst KIMI_CODE_K27_MODEL_ID = \"kimi-for-coding-highspeed\";\nconst KIMI_CODE_K28_MODEL_ID = \"kimi-for-coding\";\n\nfunction hasKimiK27Signal(value: string): boolean {\n\tconst normalized = normalizeModelId(value);\n\treturn normalized === KIMI_CODE_K27_MODEL_ID || /(?:^|[/@._-])kimi-k2(?:[._-]|p)7(?:$|[/@._:-])/.test(normalized);\n}\n\nfunction isKimiK27Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK27Signal(model.id) || (model.name !== undefined && hasKimiK27Signal(model.name));\n}\n\nfunction hasKimiK28Signal(value: string): boolean {\n\tconst normalized = normalizeModelId(value);\n\treturn normalized === KIMI_CODE_K28_MODEL_ID || /(?:^|[/@._-])kimi-k2(?:[._-]|p)8(?:$|[/@._:-])/.test(normalized);\n}\n\nfunction isKimiK28Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK28Signal(model.id) || (model.name !== undefined && hasKimiK28Signal(model.name));\n}\n\nfunction hasKimiK3Signal(value: string): boolean {\n\tconst normalized = normalizeModelId(value);\n\treturn normalized === \"k3\" || /(?:^|[/@._-])kimi-k3(?:$|[/@._:-])/.test(normalized);\n}\n\nfunction isKimiK3Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK3Signal(model.id) || (model.name !== undefined && hasKimiK3Signal(model.name));\n}\n\nfunction hasSWE2Signal(value: string): boolean {\n\treturn /(?:^|[/@:._-])swe-2-(?:high|max|low|high-lite)(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isSWE2Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasSWE2Signal(model.id) || (model.name !== undefined && hasSWE2Signal(model.name));\n}\n\n// DeepSeek V4 id shapes verified against the OpenRouter live API, models.dev,\n// and senpi's generated provider catalogs (2026-07-31): deepseek-v4-flash,\n// deepseek/deepseek-v4-flash-0731, deepseek-ai/DeepSeek-V4-Pro,\n// accounts/fireworks/models/deepseek-v4-flash, aihubmix's alicloud-deepseek-v4-*,\n// and trailing tags (:free, -free, :thinking, -nothinking, -cheaper, -lightning, -el).\nfunction hasDeepseekV4Flash0731Signal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]flash[._-]0731(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4Flash0731Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn (\n\t\thasDeepseekV4Flash0731Signal(model.id) || (model.name !== undefined && hasDeepseekV4Flash0731Signal(model.name))\n\t);\n}\n\nfunction hasDeepseekV4FlashSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]flash(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4FlashModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasDeepseekV4FlashSignal(model.id) || (model.name !== undefined && hasDeepseekV4FlashSignal(model.name));\n}\n\n// DeepSeek V4.1 Flash id shapes verified against models.dev and the provider\n// catalogs (2026-09-11): deepseek-flash (the official API name, also opencode-go),\n// deepseek-v4.1-flash and deepseek/deepseek-v4.1-flash[:thinking] (OpenRouter,\n// Vercel, requesty, kilo, ...), deepseek-ai/DeepSeek-V4.1-Flash (Hugging Face,\n// DeepInfra), accounts/fireworks/models/deepseek-v4p1-flash, venice's\n// deepseek-v4-1-flash, and the display name \"DeepSeek V4.1 Flash\".\nfunction hasDeepseekV41FlashSignal(value: string): boolean {\n\tconst normalized = normalizeModelId(value);\n\treturn (\n\t\t/(?:^|[/@:._-])deepseek[._-]v4(?:[._-]1|p1)[._-]flash(?:$|[/@:._-])/.test(normalized) ||\n\t\t/(?:^|[/@:._-])deepseek[._-]flash(?:$|[/@:._-])/.test(normalized)\n\t);\n}\n\nconst DEEPSEEK_OFFICIAL_PROVIDER = \"deepseek\";\n\n// DeepSeek retired V4 Flash on 2026-09-10: on the official API, deepseek-v4-flash\n// and deepseek-v4-flash-vision-exp are served by V4.1 Flash. Every other\n// provider still hosts the V4 weights under those names.\nfunction isRetiredOfficialDeepseekV4FlashAlias(model: ModelWithPromptPresetMetadata): boolean {\n\treturn model.provider === DEEPSEEK_OFFICIAL_PROVIDER && hasDeepseekV4FlashSignal(model.id);\n}\n\nfunction isDeepseekV41FlashModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn (\n\t\thasDeepseekV41FlashSignal(model.id) ||\n\t\t(model.name !== undefined && hasDeepseekV41FlashSignal(model.name)) ||\n\t\tisRetiredOfficialDeepseekV4FlashAlias(model)\n\t);\n}\n\nfunction hasDeepseekV4ProSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]pro(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4ProModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasDeepseekV4ProSignal(model.id) || (model.name !== undefined && hasDeepseekV4ProSignal(model.name));\n}\n\nfunction hasGlm52Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])glm(?:[._-]|p)5(?:[._-]|p)2(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGlm52Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGlm52Signal(model.id) || (model.name !== undefined && hasGlm52Signal(model.name));\n}\n\nfunction hasGlm53Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])glm(?:[._-]|p)5(?:[._-]|p)3(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGlm53Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGlm53Signal(model.id) || (model.name !== undefined && hasGlm53Signal(model.name));\n}\n\nfunction hasGrok45Signal(value: string): boolean {\n\t// Match any Grok 4.5 id shape: grok-4.5, grok4.5, grok45, grok-4p5, provider:model,\n\t// path/prefix ids, and trailing tags (:thinking, -latest). Keep 4.3 / 4.20 / 3 out.\n\treturn /(?:^|[/@:._-])grok(?:[._-]|p)?4(?:[._-]|p)?5(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGrok45Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGrok45Signal(model.id) || (model.name !== undefined && hasGrok45Signal(model.name));\n}\n\nfunction hasGrok46Signal(value: string): boolean {\n\t// Same id shapes as hasGrok45Signal with a 4.6 minor version. Keep 4.5 / 4.3 / 4.20 / 3 out.\n\treturn /(?:^|[/@:._-])grok(?:[._-]|p)?4(?:[._-]|p)?6(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGrok46Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGrok46Signal(model.id) || (model.name !== undefined && hasGrok46Signal(model.name));\n}\n\n// Claude Mythos shares each Fable release's prompting guide (\"Prompting Claude\n// Fable 5.1\" covers Fable 5.1 and Mythos 5.1; \"Prompting Claude Fable 5\"\n// covers Fable 5 and Mythos 5), so Mythos ids route to the matching Fable preset.\nconst CLAUDE_FABLE_51_MARKERS = [\"fable-5-1\", \"fable-5.1\", \"mythos-5-1\", \"mythos-5.1\"] as const;\nconst CLAUDE_FABLE_5_MARKERS = [\"fable-5\", \"mythos-5\"] as const;\n\nfunction isClaudeFable51Model(modelId: string): boolean {\n\tconst normalized = normalizeModelId(modelId);\n\treturn CLAUDE_FABLE_51_MARKERS.some((marker) => normalized.includes(marker));\n}\n\nfunction isClaudeFable5Model(modelId: string): boolean {\n\tconst normalized = normalizeModelId(modelId);\n\treturn CLAUDE_FABLE_5_MARKERS.some((marker) => normalized.includes(marker));\n}\n\nfunction isClaudeOpus5Model(modelId: string): boolean {\n\treturn normalizeModelId(modelId).includes(\"opus-5\");\n}\n\ntype ClaudeOpusVersion = \"claude-opus-4-8\" | \"claude-opus-4-7\" | \"claude-opus-4-6\" | \"claude-opus-4-5\";\n\nfunction extractClaudeOpusVersion(modelId: string): ClaudeOpusVersion | undefined {\n\tconst normalized = normalizeModelId(modelId);\n\tif (normalized.includes(\"opus-4-8\")) {\n\t\treturn \"claude-opus-4-8\";\n\t}\n\tif (normalized.includes(\"opus-4-7\")) {\n\t\treturn \"claude-opus-4-7\";\n\t}\n\tif (normalized.includes(\"opus-4-6\")) {\n\t\treturn \"claude-opus-4-6\";\n\t}\n\tif (normalized.includes(\"opus-4-5\") || normalized.includes(\"opus-4.5\")) {\n\t\treturn \"claude-opus-4-5\";\n\t}\n\treturn undefined;\n}\n\nexport function resolvePresetName(\n\tmodel: ModelWithPromptPresetMetadata,\n\tsettings: PromptPresetSettings,\n): ResolvedPresetName | undefined {\n\tif (settings.promptPreset !== \"auto\") {\n\t\treturn settings.promptPreset;\n\t}\n\n\tconst modelPromptPreset = parsePromptPreset(model.promptPreset);\n\tif (modelPromptPreset && modelPromptPreset !== \"auto\") {\n\t\treturn modelPromptPreset;\n\t}\n\n\tif (isGpt6AstraModel(model)) {\n\t\treturn \"gpt-6-astra\";\n\t}\n\tconst gpt5Version = extractGpt5Version(model.id);\n\tif (gpt5Version) {\n\t\treturn gpt5Version;\n\t}\n\tif (isSWE2Model(model) || isKimiK3Model(model)) {\n\t\treturn \"kimi-k3\";\n\t}\n\tif (isKimiK28Model(model)) {\n\t\treturn \"kimi-k2-8\";\n\t}\n\tif (isKimiK27Model(model)) {\n\t\treturn \"kimi-k2-7\";\n\t}\n\tif (isKimiK26Model(model)) {\n\t\treturn \"kimi-k2-6\";\n\t}\n\t// The dotted release must resolve before the generic fable-5 substring.\n\tif (isClaudeFable51Model(model.id)) {\n\t\treturn \"claude-fable-5-1\";\n\t}\n\tif (isClaudeFable5Model(model.id)) {\n\t\treturn \"claude-fable-5\";\n\t}\n\tif (isClaudeOpus5Model(model.id)) {\n\t\treturn \"claude-opus-5\";\n\t}\n\tconst claudeVersion = extractClaudeOpusVersion(model.id);\n\tif (claudeVersion) {\n\t\treturn claudeVersion;\n\t}\n\tif (isGlm53Model(model)) {\n\t\treturn \"glm-5.3\";\n\t}\n\tif (isGlm52Model(model)) {\n\t\treturn \"glm-5.2\";\n\t}\n\t// The dated snapshot must resolve before the generic flash alias.\n\tif (isDeepseekV4Flash0731Model(model)) {\n\t\treturn \"deepseek-v4-flash-0731\";\n\t}\n\tif (isDeepseekV41FlashModel(model)) {\n\t\treturn \"deepseek-v4-1-flash\";\n\t}\n\tif (isDeepseekV4FlashModel(model)) {\n\t\treturn \"deepseek-v4-flash\";\n\t}\n\tif (isDeepseekV4ProModel(model)) {\n\t\treturn \"deepseek-v4-pro\";\n\t}\n\tif (isGrok46Model(model)) {\n\t\treturn \"grok-4.6\";\n\t}\n\tif (isGrok45Model(model)) {\n\t\treturn \"grok-4.5\";\n\t}\n\treturn undefined;\n}\n\nfunction buildPreset(name: ResolvedPresetName, options: BuildDynamicSystemPromptOptions): ResolvedPromptPreset {\n\tswitch (name) {\n\t\tcase \"gpt-6-astra\":\n\t\t\treturn { name, prompt: buildGpt6AstraPrompt(options) };\n\t\tcase \"gpt-5.6\":\n\t\t\treturn { name, prompt: buildGpt56Prompt(options) };\n\t\tcase \"gpt-5.5\":\n\t\t\treturn { name, prompt: buildGpt55Prompt(options) };\n\t\tcase \"gpt-5.4\":\n\t\t\treturn { name, prompt: buildGpt54Prompt(options) };\n\t\tcase \"gpt-5.3-codex\":\n\t\t\treturn { name, prompt: buildGpt53CodexPrompt(options) };\n\t\tcase \"gpt-5.2\":\n\t\t\treturn { name, prompt: buildGpt52Prompt(options) };\n\t\tcase \"gpt-5\":\n\t\t\treturn { name, prompt: buildGpt5Prompt(options) };\n\t\tcase \"glm-5.3\":\n\t\t\treturn { name, prompt: buildGlm53Prompt(options) };\n\t\tcase \"glm-5.2\":\n\t\t\treturn { name, prompt: buildGlm52Prompt(options) };\n\t\tcase \"deepseek-v4-flash\":\n\t\t\treturn { name, prompt: buildDeepseekV4FlashPrompt(options) };\n\t\tcase \"deepseek-v4-flash-0731\":\n\t\t\treturn { name, prompt: buildDeepseekV4Flash0731Prompt(options) };\n\t\tcase \"deepseek-v4-1-flash\":\n\t\t\treturn { name, prompt: buildDeepseekV41FlashPrompt(options) };\n\t\tcase \"deepseek-v4-pro\":\n\t\t\treturn { name, prompt: buildDeepseekV4ProPrompt(options) };\n\t\tcase \"grok-4.6\":\n\t\t\treturn { name, prompt: buildGrok46Prompt(options) };\n\t\tcase \"grok-4.5\":\n\t\t\treturn { name, prompt: buildGrok45Prompt(options) };\n\t\tcase \"kimi-k3\":\n\t\t\treturn { name, prompt: buildKimiK3Prompt(options) };\n\t\tcase \"kimi-k2-8\":\n\t\t\treturn { name, prompt: buildKimiK28Prompt(options) };\n\t\tcase \"kimi-k2-7\":\n\t\t\treturn { name, prompt: buildKimiK27Prompt(options) };\n\t\tcase \"kimi-k2-6\":\n\t\t\treturn { name, prompt: buildKimiK26Prompt(options) };\n\t\tcase \"claude-fable-5-1\":\n\t\t\treturn { name, prompt: buildClaudeFable51Prompt(options) };\n\t\tcase \"claude-fable-5\":\n\t\t\treturn { name, prompt: buildClaudeFable5Prompt(options) };\n\t\tcase \"claude-opus-5\":\n\t\t\treturn { name, prompt: buildClaudeOpus5Prompt(options) };\n\t\tcase \"claude-opus-4-8\":\n\t\t\treturn { name, prompt: buildClaudeOpus48Prompt(options) };\n\t\tcase \"claude-opus-4-7\":\n\t\t\treturn { name, prompt: buildClaudeOpus47Prompt(options) };\n\t\tcase \"claude-opus-4-6\":\n\t\t\treturn { name, prompt: buildClaudeOpus46Prompt(options) };\n\t\tcase \"claude-opus-4-5\":\n\t\t\treturn { name, prompt: buildClaudeOpus45Prompt(options) };\n\t}\n}\n\nfunction withDefaults(options: Partial<BuildDynamicSystemPromptOptions> = {}): BuildDynamicSystemPromptOptions {\n\treturn {\n\t\tcwd: options.cwd ?? \"\",\n\t\tselectedTools: options.selectedTools ?? [],\n\t\ttoolSnippets: options.toolSnippets ?? {},\n\t\tpromptGuidelines: options.promptGuidelines ?? [],\n\t\tcontextFiles: options.contextFiles ?? [],\n\t\tskills: options.skills ?? [],\n\t};\n}\n\nexport function resolvePreset(\n\tmodel: ModelWithPromptPresetMetadata,\n\tsettings: PromptPresetSettings,\n\toptions?: Partial<BuildDynamicSystemPromptOptions>,\n): ResolvedPromptPreset | undefined {\n\tconst name = resolvePresetName(model, settings);\n\tif (!name) {\n\t\treturn undefined;\n\t}\n\treturn buildPreset(name, withDefaults(options));\n}\n"]}
|
|
1
|
+
{"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CAAC;QACX,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import type { Api, Model } from \"@earendil-works/pi-ai\";\nimport type { BuildDynamicSystemPromptOptions } from \"../../../dynamic-prompt/build.ts\";\nimport { buildClaudeFable5Prompt } from \"./claude-fable-5.ts\";\nimport { buildClaudeFable51Prompt } from \"./claude-fable-5-1.ts\";\nimport { buildClaudeOpus45Prompt } from \"./claude-opus-4-5.ts\";\nimport { buildClaudeOpus46Prompt } from \"./claude-opus-4-6.ts\";\nimport { buildClaudeOpus47Prompt } from \"./claude-opus-4-7.ts\";\nimport { buildClaudeOpus48Prompt } from \"./claude-opus-4-8.ts\";\nimport { buildClaudeOpus5Prompt } from \"./claude-opus-5.ts\";\nimport { buildDeepseekV41FlashPrompt } from \"./deepseek-v4-1-flash.ts\";\nimport { buildDeepseekV4FlashPrompt } from \"./deepseek-v4-flash.ts\";\nimport { buildDeepseekV4Flash0731Prompt } from \"./deepseek-v4-flash-0731.ts\";\nimport { buildDeepseekV4ProPrompt } from \"./deepseek-v4-pro.ts\";\nimport { buildGlm52Prompt } from \"./glm-5-2.ts\";\nimport { buildGlm53Prompt } from \"./glm-5-3.ts\";\nimport { buildGpt52Prompt } from \"./gpt-5.2.ts\";\nimport { buildGpt53CodexPrompt } from \"./gpt-5.3-codex.ts\";\nimport { buildGpt54Prompt } from \"./gpt-5.4.ts\";\nimport { buildGpt55Prompt } from \"./gpt-5.5.ts\";\nimport { buildGpt56Prompt } from \"./gpt-5.6.ts\";\nimport { buildGpt5Prompt } from \"./gpt-5.ts\";\nimport { buildGpt6AstraPrompt } from \"./gpt-6-astra.ts\";\nimport { buildGrok45Prompt } from \"./grok-4.5.ts\";\nimport { buildGrok46Prompt } from \"./grok-4.6.ts\";\nimport { buildGrok47Prompt } from \"./grok-4.7.ts\";\nimport { buildKimiK26Prompt } from \"./kimi-k2-6.ts\";\nimport { buildKimiK27Prompt } from \"./kimi-k2-7.ts\";\nimport { buildKimiK28Prompt } from \"./kimi-k2-8.ts\";\nimport { buildKimiK3Prompt } from \"./kimi-k3.ts\";\nimport { type PromptPresetName, type PromptPresetSettings, parsePromptPreset } from \"./settings.ts\";\n\nexport type { PromptPresetSettings } from \"./settings.ts\";\n\ntype ResolvedPresetName = Exclude<PromptPresetName, \"auto\">;\ntype ModelWithPromptPresetMetadata = Pick<Model<Api>, \"id\" | \"provider\"> & {\n\tname?: string;\n\tpromptPreset?: string;\n};\n\nexport interface ResolvedPromptPreset {\n\tname: ResolvedPresetName;\n\tprompt: string;\n}\n\nfunction normalizeModelId(modelId: string): string {\n\treturn modelId.toLowerCase().replace(/\\s+/g, \"-\");\n}\n\n// GPT-6 Astra id shapes verified against the OpenAI model page, codex's\n// models.json, and Bedrock's catalog (2026-09-04): gpt-6-astra, gpt-6-astra-fast,\n// dated snapshots, openai/gpt-6-astra, openai.gpt-6-astra, global.openai.gpt-6-astra,\n// and the display name \"GPT-6 Astra\". Bare \"gpt-6\" and \"astra\" stay out: the guide\n// names no other GPT-6 model, and a future sibling deserves its own preset.\nfunction hasGpt6AstraSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])gpt[._-]?6[._-]astra(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isGpt6AstraModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGpt6AstraSignal(model.id) || (model.name !== undefined && hasGpt6AstraSignal(model.name));\n}\n\ntype Gpt5Version = \"gpt-5.2\" | \"gpt-5.3-codex\" | \"gpt-5.4\" | \"gpt-5.5\" | \"gpt-5.6\";\n\nfunction extractGpt5Version(modelId: string): Gpt5Version | undefined {\n\tconst normalized = normalizeModelId(modelId);\n\tif (normalized.includes(\"gpt-5.6\")) {\n\t\treturn \"gpt-5.6\";\n\t}\n\tif (normalized.includes(\"gpt-5.5\")) {\n\t\treturn \"gpt-5.5\";\n\t}\n\tif (normalized.includes(\"gpt-5.4\")) {\n\t\treturn \"gpt-5.4\";\n\t}\n\tif (normalized.includes(\"gpt-5.3\")) {\n\t\treturn \"gpt-5.3-codex\";\n\t}\n\tif (normalized.includes(\"gpt-5.2\")) {\n\t\treturn \"gpt-5.2\";\n\t}\n\treturn undefined;\n}\n\nfunction hasKimiK26Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])kimi-k2(?:[._-]|p)6(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isKimiK26Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK26Signal(model.id) || (model.name !== undefined && hasKimiK26Signal(model.name));\n}\n\n// Kimi Code addresses its models by rolling product ids rather than version tags:\n// Moonshot upgraded `kimi-for-coding` to K2.8 Preview in place on 2026-09-11 and\n// left `kimi-for-coding-highspeed` on K2.7 Code HighSpeed.\n// https://www.kimi.com/code/docs/en/kimi-code/models.html (checked 2026-09-18)\nconst KIMI_CODE_K27_MODEL_ID = \"kimi-for-coding-highspeed\";\nconst KIMI_CODE_K28_MODEL_ID = \"kimi-for-coding\";\n\nfunction hasKimiK27Signal(value: string): boolean {\n\tconst normalized = normalizeModelId(value);\n\treturn normalized === KIMI_CODE_K27_MODEL_ID || /(?:^|[/@._-])kimi-k2(?:[._-]|p)7(?:$|[/@._:-])/.test(normalized);\n}\n\nfunction isKimiK27Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK27Signal(model.id) || (model.name !== undefined && hasKimiK27Signal(model.name));\n}\n\nfunction hasKimiK28Signal(value: string): boolean {\n\tconst normalized = normalizeModelId(value);\n\treturn normalized === KIMI_CODE_K28_MODEL_ID || /(?:^|[/@._-])kimi-k2(?:[._-]|p)8(?:$|[/@._:-])/.test(normalized);\n}\n\nfunction isKimiK28Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK28Signal(model.id) || (model.name !== undefined && hasKimiK28Signal(model.name));\n}\n\nfunction hasKimiK3Signal(value: string): boolean {\n\tconst normalized = normalizeModelId(value);\n\treturn normalized === \"k3\" || /(?:^|[/@._-])kimi-k3(?:$|[/@._:-])/.test(normalized);\n}\n\nfunction isKimiK3Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasKimiK3Signal(model.id) || (model.name !== undefined && hasKimiK3Signal(model.name));\n}\n\nfunction hasSWE2Signal(value: string): boolean {\n\treturn /(?:^|[/@:._-])swe-2-(?:high|max|low|high-lite)(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isSWE2Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasSWE2Signal(model.id) || (model.name !== undefined && hasSWE2Signal(model.name));\n}\n\n// DeepSeek V4 id shapes verified against the OpenRouter live API, models.dev,\n// and senpi's generated provider catalogs (2026-07-31): deepseek-v4-flash,\n// deepseek/deepseek-v4-flash-0731, deepseek-ai/DeepSeek-V4-Pro,\n// accounts/fireworks/models/deepseek-v4-flash, aihubmix's alicloud-deepseek-v4-*,\n// and trailing tags (:free, -free, :thinking, -nothinking, -cheaper, -lightning, -el).\nfunction hasDeepseekV4Flash0731Signal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]flash[._-]0731(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4Flash0731Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn (\n\t\thasDeepseekV4Flash0731Signal(model.id) || (model.name !== undefined && hasDeepseekV4Flash0731Signal(model.name))\n\t);\n}\n\nfunction hasDeepseekV4FlashSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]flash(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4FlashModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasDeepseekV4FlashSignal(model.id) || (model.name !== undefined && hasDeepseekV4FlashSignal(model.name));\n}\n\n// DeepSeek V4.1 Flash id shapes verified against models.dev and the provider\n// catalogs (2026-09-11): deepseek-flash (the official API name, also opencode-go),\n// deepseek-v4.1-flash and deepseek/deepseek-v4.1-flash[:thinking] (OpenRouter,\n// Vercel, requesty, kilo, ...), deepseek-ai/DeepSeek-V4.1-Flash (Hugging Face,\n// DeepInfra), accounts/fireworks/models/deepseek-v4p1-flash, venice's\n// deepseek-v4-1-flash, and the display name \"DeepSeek V4.1 Flash\".\nfunction hasDeepseekV41FlashSignal(value: string): boolean {\n\tconst normalized = normalizeModelId(value);\n\treturn (\n\t\t/(?:^|[/@:._-])deepseek[._-]v4(?:[._-]1|p1)[._-]flash(?:$|[/@:._-])/.test(normalized) ||\n\t\t/(?:^|[/@:._-])deepseek[._-]flash(?:$|[/@:._-])/.test(normalized)\n\t);\n}\n\nconst DEEPSEEK_OFFICIAL_PROVIDER = \"deepseek\";\n\n// DeepSeek retired V4 Flash on 2026-09-10: on the official API, deepseek-v4-flash\n// and deepseek-v4-flash-vision-exp are served by V4.1 Flash. Every other\n// provider still hosts the V4 weights under those names.\nfunction isRetiredOfficialDeepseekV4FlashAlias(model: ModelWithPromptPresetMetadata): boolean {\n\treturn model.provider === DEEPSEEK_OFFICIAL_PROVIDER && hasDeepseekV4FlashSignal(model.id);\n}\n\nfunction isDeepseekV41FlashModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn (\n\t\thasDeepseekV41FlashSignal(model.id) ||\n\t\t(model.name !== undefined && hasDeepseekV41FlashSignal(model.name)) ||\n\t\tisRetiredOfficialDeepseekV4FlashAlias(model)\n\t);\n}\n\nfunction hasDeepseekV4ProSignal(value: string): boolean {\n\treturn /(?:^|[/@:._-])deepseek[._-]v4[._-]pro(?:$|[/@:._-])/.test(normalizeModelId(value));\n}\n\nfunction isDeepseekV4ProModel(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasDeepseekV4ProSignal(model.id) || (model.name !== undefined && hasDeepseekV4ProSignal(model.name));\n}\n\nfunction hasGlm52Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])glm(?:[._-]|p)5(?:[._-]|p)2(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGlm52Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGlm52Signal(model.id) || (model.name !== undefined && hasGlm52Signal(model.name));\n}\n\nfunction hasGlm53Signal(value: string): boolean {\n\treturn /(?:^|[/@._-])glm(?:[._-]|p)5(?:[._-]|p)3(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGlm53Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGlm53Signal(model.id) || (model.name !== undefined && hasGlm53Signal(model.name));\n}\n\nfunction hasGrok45Signal(value: string): boolean {\n\t// Match any Grok 4.5 id shape: grok-4.5, grok4.5, grok45, grok-4p5, provider:model,\n\t// path/prefix ids, and trailing tags (:thinking, -latest). Keep 4.3 / 4.20 / 3 out.\n\treturn /(?:^|[/@:._-])grok(?:[._-]|p)?4(?:[._-]|p)?5(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGrok45Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGrok45Signal(model.id) || (model.name !== undefined && hasGrok45Signal(model.name));\n}\n\nfunction hasGrok46Signal(value: string): boolean {\n\t// Same id shapes as hasGrok45Signal with a 4.6 minor version. Keep 4.5 / 4.3 / 4.20 / 3 out.\n\treturn /(?:^|[/@:._-])grok(?:[._-]|p)?4(?:[._-]|p)?6(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGrok46Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGrok46Signal(model.id) || (model.name !== undefined && hasGrok46Signal(model.name));\n}\n\nfunction hasGrok47Signal(value: string): boolean {\n\t// Same id shapes as hasGrok46Signal with a 4.7 minor version, including venice's dashed\n\t// grok-4-7. Keep 4.6 / 4.5 / 4.3 / 4.20 / 3 out.\n\treturn /(?:^|[/@:._-])grok(?:[._-]|p)?4(?:[._-]|p)?7(?:$|[/@._:-])/.test(normalizeModelId(value));\n}\n\nfunction isGrok47Model(model: ModelWithPromptPresetMetadata): boolean {\n\treturn hasGrok47Signal(model.id) || (model.name !== undefined && hasGrok47Signal(model.name));\n}\n\n// Claude Mythos shares each Fable release's prompting guide (\"Prompting Claude\n// Fable 5.1\" covers Fable 5.1 and Mythos 5.1; \"Prompting Claude Fable 5\"\n// covers Fable 5 and Mythos 5), so Mythos ids route to the matching Fable preset.\nconst CLAUDE_FABLE_51_MARKERS = [\"fable-5-1\", \"fable-5.1\", \"mythos-5-1\", \"mythos-5.1\"] as const;\nconst CLAUDE_FABLE_5_MARKERS = [\"fable-5\", \"mythos-5\"] as const;\n\nfunction isClaudeFable51Model(modelId: string): boolean {\n\tconst normalized = normalizeModelId(modelId);\n\treturn CLAUDE_FABLE_51_MARKERS.some((marker) => normalized.includes(marker));\n}\n\nfunction isClaudeFable5Model(modelId: string): boolean {\n\tconst normalized = normalizeModelId(modelId);\n\treturn CLAUDE_FABLE_5_MARKERS.some((marker) => normalized.includes(marker));\n}\n\nfunction isClaudeOpus5Model(modelId: string): boolean {\n\treturn normalizeModelId(modelId).includes(\"opus-5\");\n}\n\ntype ClaudeOpusVersion = \"claude-opus-4-8\" | \"claude-opus-4-7\" | \"claude-opus-4-6\" | \"claude-opus-4-5\";\n\nfunction extractClaudeOpusVersion(modelId: string): ClaudeOpusVersion | undefined {\n\tconst normalized = normalizeModelId(modelId);\n\tif (normalized.includes(\"opus-4-8\")) {\n\t\treturn \"claude-opus-4-8\";\n\t}\n\tif (normalized.includes(\"opus-4-7\")) {\n\t\treturn \"claude-opus-4-7\";\n\t}\n\tif (normalized.includes(\"opus-4-6\")) {\n\t\treturn \"claude-opus-4-6\";\n\t}\n\tif (normalized.includes(\"opus-4-5\") || normalized.includes(\"opus-4.5\")) {\n\t\treturn \"claude-opus-4-5\";\n\t}\n\treturn undefined;\n}\n\nexport function resolvePresetName(\n\tmodel: ModelWithPromptPresetMetadata,\n\tsettings: PromptPresetSettings,\n): ResolvedPresetName | undefined {\n\tif (settings.promptPreset !== \"auto\") {\n\t\treturn settings.promptPreset;\n\t}\n\n\tconst modelPromptPreset = parsePromptPreset(model.promptPreset);\n\tif (modelPromptPreset && modelPromptPreset !== \"auto\") {\n\t\treturn modelPromptPreset;\n\t}\n\n\tif (isGpt6AstraModel(model)) {\n\t\treturn \"gpt-6-astra\";\n\t}\n\tconst gpt5Version = extractGpt5Version(model.id);\n\tif (gpt5Version) {\n\t\treturn gpt5Version;\n\t}\n\tif (isSWE2Model(model) || isKimiK3Model(model)) {\n\t\treturn \"kimi-k3\";\n\t}\n\tif (isKimiK28Model(model)) {\n\t\treturn \"kimi-k2-8\";\n\t}\n\tif (isKimiK27Model(model)) {\n\t\treturn \"kimi-k2-7\";\n\t}\n\tif (isKimiK26Model(model)) {\n\t\treturn \"kimi-k2-6\";\n\t}\n\t// The dotted release must resolve before the generic fable-5 substring.\n\tif (isClaudeFable51Model(model.id)) {\n\t\treturn \"claude-fable-5-1\";\n\t}\n\tif (isClaudeFable5Model(model.id)) {\n\t\treturn \"claude-fable-5\";\n\t}\n\tif (isClaudeOpus5Model(model.id)) {\n\t\treturn \"claude-opus-5\";\n\t}\n\tconst claudeVersion = extractClaudeOpusVersion(model.id);\n\tif (claudeVersion) {\n\t\treturn claudeVersion;\n\t}\n\tif (isGlm53Model(model)) {\n\t\treturn \"glm-5.3\";\n\t}\n\tif (isGlm52Model(model)) {\n\t\treturn \"glm-5.2\";\n\t}\n\t// The dated snapshot must resolve before the generic flash alias.\n\tif (isDeepseekV4Flash0731Model(model)) {\n\t\treturn \"deepseek-v4-flash-0731\";\n\t}\n\tif (isDeepseekV41FlashModel(model)) {\n\t\treturn \"deepseek-v4-1-flash\";\n\t}\n\tif (isDeepseekV4FlashModel(model)) {\n\t\treturn \"deepseek-v4-flash\";\n\t}\n\tif (isDeepseekV4ProModel(model)) {\n\t\treturn \"deepseek-v4-pro\";\n\t}\n\tif (isGrok47Model(model)) {\n\t\treturn \"grok-4.7\";\n\t}\n\tif (isGrok46Model(model)) {\n\t\treturn \"grok-4.6\";\n\t}\n\tif (isGrok45Model(model)) {\n\t\treturn \"grok-4.5\";\n\t}\n\treturn undefined;\n}\n\nfunction buildPreset(name: ResolvedPresetName, options: BuildDynamicSystemPromptOptions): ResolvedPromptPreset {\n\tswitch (name) {\n\t\tcase \"gpt-6-astra\":\n\t\t\treturn { name, prompt: buildGpt6AstraPrompt(options) };\n\t\tcase \"gpt-5.6\":\n\t\t\treturn { name, prompt: buildGpt56Prompt(options) };\n\t\tcase \"gpt-5.5\":\n\t\t\treturn { name, prompt: buildGpt55Prompt(options) };\n\t\tcase \"gpt-5.4\":\n\t\t\treturn { name, prompt: buildGpt54Prompt(options) };\n\t\tcase \"gpt-5.3-codex\":\n\t\t\treturn { name, prompt: buildGpt53CodexPrompt(options) };\n\t\tcase \"gpt-5.2\":\n\t\t\treturn { name, prompt: buildGpt52Prompt(options) };\n\t\tcase \"gpt-5\":\n\t\t\treturn { name, prompt: buildGpt5Prompt(options) };\n\t\tcase \"glm-5.3\":\n\t\t\treturn { name, prompt: buildGlm53Prompt(options) };\n\t\tcase \"glm-5.2\":\n\t\t\treturn { name, prompt: buildGlm52Prompt(options) };\n\t\tcase \"deepseek-v4-flash\":\n\t\t\treturn { name, prompt: buildDeepseekV4FlashPrompt(options) };\n\t\tcase \"deepseek-v4-flash-0731\":\n\t\t\treturn { name, prompt: buildDeepseekV4Flash0731Prompt(options) };\n\t\tcase \"deepseek-v4-1-flash\":\n\t\t\treturn { name, prompt: buildDeepseekV41FlashPrompt(options) };\n\t\tcase \"deepseek-v4-pro\":\n\t\t\treturn { name, prompt: buildDeepseekV4ProPrompt(options) };\n\t\tcase \"grok-4.7\":\n\t\t\treturn { name, prompt: buildGrok47Prompt(options) };\n\t\tcase \"grok-4.6\":\n\t\t\treturn { name, prompt: buildGrok46Prompt(options) };\n\t\tcase \"grok-4.5\":\n\t\t\treturn { name, prompt: buildGrok45Prompt(options) };\n\t\tcase \"kimi-k3\":\n\t\t\treturn { name, prompt: buildKimiK3Prompt(options) };\n\t\tcase \"kimi-k2-8\":\n\t\t\treturn { name, prompt: buildKimiK28Prompt(options) };\n\t\tcase \"kimi-k2-7\":\n\t\t\treturn { name, prompt: buildKimiK27Prompt(options) };\n\t\tcase \"kimi-k2-6\":\n\t\t\treturn { name, prompt: buildKimiK26Prompt(options) };\n\t\tcase \"claude-fable-5-1\":\n\t\t\treturn { name, prompt: buildClaudeFable51Prompt(options) };\n\t\tcase \"claude-fable-5\":\n\t\t\treturn { name, prompt: buildClaudeFable5Prompt(options) };\n\t\tcase \"claude-opus-5\":\n\t\t\treturn { name, prompt: buildClaudeOpus5Prompt(options) };\n\t\tcase \"claude-opus-4-8\":\n\t\t\treturn { name, prompt: buildClaudeOpus48Prompt(options) };\n\t\tcase \"claude-opus-4-7\":\n\t\t\treturn { name, prompt: buildClaudeOpus47Prompt(options) };\n\t\tcase \"claude-opus-4-6\":\n\t\t\treturn { name, prompt: buildClaudeOpus46Prompt(options) };\n\t\tcase \"claude-opus-4-5\":\n\t\t\treturn { name, prompt: buildClaudeOpus45Prompt(options) };\n\t}\n}\n\nfunction withDefaults(options: Partial<BuildDynamicSystemPromptOptions> = {}): BuildDynamicSystemPromptOptions {\n\treturn {\n\t\tcwd: options.cwd ?? \"\",\n\t\tselectedTools: options.selectedTools ?? [],\n\t\ttoolSnippets: options.toolSnippets ?? {},\n\t\tpromptGuidelines: options.promptGuidelines ?? [],\n\t\tcontextFiles: options.contextFiles ?? [],\n\t\tskills: options.skills ?? [],\n\t};\n}\n\nexport function resolvePreset(\n\tmodel: ModelWithPromptPresetMetadata,\n\tsettings: PromptPresetSettings,\n\toptions?: Partial<BuildDynamicSystemPromptOptions>,\n): ResolvedPromptPreset | undefined {\n\tconst name = resolvePresetName(model, settings);\n\tif (!name) {\n\t\treturn undefined;\n\t}\n\treturn buildPreset(name, withDefaults(options));\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SettingsManager } from "../../../settings-manager.ts";
|
|
2
|
-
export type PromptPresetName = "auto" | "claude-fable-5" | "claude-fable-5-1" | "claude-opus-5" | "claude-opus-4-8" | "claude-opus-4-7" | "claude-opus-4-6" | "claude-opus-4-5" | "deepseek-v4-flash" | "deepseek-v4-flash-0731" | "deepseek-v4-1-flash" | "deepseek-v4-pro" | "glm-5.2" | "glm-5.3" | "grok-4.5" | "grok-4.6" | "kimi-k3" | "kimi-k2-8" | "kimi-k2-7" | "kimi-k2-6" | "gpt-5" | "gpt-5.2" | "gpt-5.3-codex" | "gpt-5.4" | "gpt-5.5" | "gpt-5.6" | "gpt-6-astra";
|
|
2
|
+
export type PromptPresetName = "auto" | "claude-fable-5" | "claude-fable-5-1" | "claude-opus-5" | "claude-opus-4-8" | "claude-opus-4-7" | "claude-opus-4-6" | "claude-opus-4-5" | "deepseek-v4-flash" | "deepseek-v4-flash-0731" | "deepseek-v4-1-flash" | "deepseek-v4-pro" | "glm-5.2" | "glm-5.3" | "grok-4.5" | "grok-4.6" | "grok-4.7" | "kimi-k3" | "kimi-k2-8" | "kimi-k2-7" | "kimi-k2-6" | "gpt-5" | "gpt-5.2" | "gpt-5.3-codex" | "gpt-5.4" | "gpt-5.5" | "gpt-5.6" | "gpt-6-astra";
|
|
3
3
|
export interface PromptPresetSettings {
|
|
4
4
|
promptPreset: PromptPresetName;
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE9E,MAAM,MAAM,gBAAgB,GACzB,MAAM,GACN,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,wBAAwB,GACxB,qBAAqB,GACrB,iBAAiB,GACjB,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,GACX,WAAW,GACX,WAAW,GACX,OAAO,GACP,SAAS,GACT,eAAe,GACf,SAAS,GACT,SAAS,GACT,SAAS,GACT,aAAa,CAAC;AAEjB,MAAM,WAAW,oBAAoB;IACpC,YAAY,EAAE,gBAAgB,CAAC;CAC/B;
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE9E,MAAM,MAAM,gBAAgB,GACzB,MAAM,GACN,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,wBAAwB,GACxB,qBAAqB,GACrB,iBAAiB,GACjB,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,GACX,WAAW,GACX,WAAW,GACX,OAAO,GACP,SAAS,GACT,eAAe,GACf,SAAS,GACT,SAAS,GACT,SAAS,GACT,aAAa,CAAC;AAEjB,MAAM,WAAW,oBAAoB;IACpC,YAAY,EAAE,gBAAgB,CAAC;CAC/B;AAmCD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS,CAKzF;AAED,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,eAAe,GAAG,oBAAoB,CAQ/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/settings.ts"],"names":[],"mappings":"AAsCA,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAmB;IACpE,MAAM;IACN,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,wBAAwB;IACxB,qBAAqB;IACrB,iBAAiB;IACjB,SAAS;IACT,SAAS;IACT,UAAU;IACV,UAAU;IACV,UAAU;IACV,SAAS;IACT,WAAW;IACX,WAAW;IACX,WAAW;IACX,OAAO;IACP,SAAS;IACT,eAAe;IACf,SAAS;IACT,SAAS;IACT,SAAS;IACT,aAAa;CACb,CAAC,CAAC;AAEH,MAAM,UAAU,iBAAiB,CAAC,KAAyB;IAC1D,IAAI,KAAK,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,KAAyB,CAAC;IAClC,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,eAAgC;IACxE,MAAM,cAAc,GAAG,eAAe,CAAC,iBAAiB,EAA8B,CAAC;IACvF,MAAM,eAAe,GAAG,eAAe,CAAC,kBAAkB,EAA8B,CAAC;IAEzF,OAAO;QACN,YAAY,EACX,iBAAiB,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,iBAAiB,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,MAAM;KAC5G,CAAC;AACH,CAAC","sourcesContent":["import type { Settings, SettingsManager } from \"../../../settings-manager.ts\";\n\nexport type PromptPresetName =\n\t| \"auto\"\n\t| \"claude-fable-5\"\n\t| \"claude-fable-5-1\"\n\t| \"claude-opus-5\"\n\t| \"claude-opus-4-8\"\n\t| \"claude-opus-4-7\"\n\t| \"claude-opus-4-6\"\n\t| \"claude-opus-4-5\"\n\t| \"deepseek-v4-flash\"\n\t| \"deepseek-v4-flash-0731\"\n\t| \"deepseek-v4-1-flash\"\n\t| \"deepseek-v4-pro\"\n\t| \"glm-5.2\"\n\t| \"glm-5.3\"\n\t| \"grok-4.5\"\n\t| \"grok-4.6\"\n\t| \"grok-4.7\"\n\t| \"kimi-k3\"\n\t| \"kimi-k2-8\"\n\t| \"kimi-k2-7\"\n\t| \"kimi-k2-6\"\n\t| \"gpt-5\"\n\t| \"gpt-5.2\"\n\t| \"gpt-5.3-codex\"\n\t| \"gpt-5.4\"\n\t| \"gpt-5.5\"\n\t| \"gpt-5.6\"\n\t| \"gpt-6-astra\";\n\nexport interface PromptPresetSettings {\n\tpromptPreset: PromptPresetName;\n}\n\ntype SettingsWithPromptPreset = Settings & { promptPreset?: string };\n\nconst VALID_PRESETS: ReadonlySet<string> = new Set<PromptPresetName>([\n\t\"auto\",\n\t\"claude-fable-5\",\n\t\"claude-fable-5-1\",\n\t\"claude-opus-5\",\n\t\"claude-opus-4-8\",\n\t\"claude-opus-4-7\",\n\t\"claude-opus-4-6\",\n\t\"claude-opus-4-5\",\n\t\"deepseek-v4-flash\",\n\t\"deepseek-v4-flash-0731\",\n\t\"deepseek-v4-1-flash\",\n\t\"deepseek-v4-pro\",\n\t\"glm-5.2\",\n\t\"glm-5.3\",\n\t\"grok-4.5\",\n\t\"grok-4.6\",\n\t\"grok-4.7\",\n\t\"kimi-k3\",\n\t\"kimi-k2-8\",\n\t\"kimi-k2-7\",\n\t\"kimi-k2-6\",\n\t\"gpt-5\",\n\t\"gpt-5.2\",\n\t\"gpt-5.3-codex\",\n\t\"gpt-5.4\",\n\t\"gpt-5.5\",\n\t\"gpt-5.6\",\n\t\"gpt-6-astra\",\n]);\n\nexport function parsePromptPreset(value: string | undefined): PromptPresetName | undefined {\n\tif (value && VALID_PRESETS.has(value)) {\n\t\treturn value as PromptPresetName;\n\t}\n\treturn undefined;\n}\n\nexport function loadPromptPresetSettings(settingsManager: SettingsManager): PromptPresetSettings {\n\tconst globalSettings = settingsManager.getGlobalSettings() as SettingsWithPromptPreset;\n\tconst projectSettings = settingsManager.getProjectSettings() as SettingsWithPromptPreset;\n\n\treturn {\n\t\tpromptPreset:\n\t\t\tparsePromptPreset(projectSettings.promptPreset) ?? parsePromptPreset(globalSettings.promptPreset) ?? \"auto\",\n\t};\n}\n"]}
|
|
@@ -4,6 +4,7 @@ export declare function createBunExtensionImporter(virtualModules: Readonly<Reco
|
|
|
4
4
|
import(path: string, _options: {
|
|
5
5
|
readonly default: true;
|
|
6
6
|
}): Promise<unknown>;
|
|
7
|
+
compiledFiles(): readonly string[];
|
|
7
8
|
dispose(): void;
|
|
8
9
|
};
|
|
9
10
|
//# sourceMappingURL=bun-extension-importer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bun-extension-importer.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bun-extension-importer.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAYxE,iFAAiF;AACjF,wBAAgB,0BAA0B,CACzC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IA6HpE,MAAM,OAAO,MAAM,YAAY;QAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"bun-extension-importer.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bun-extension-importer.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAYxE,iFAAiF;AACjF,wBAAgB,0BAA0B,CACzC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IA6HpE,MAAM,OAAO,MAAM,YAAY;QAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAclF,aAAa,IAAI,SAAS,MAAM,EAAE;IAGlC,OAAO;EAQR"}
|
|
@@ -162,6 +162,10 @@ export function createBunExtensionImporter(virtualModules) {
|
|
|
162
162
|
return factory.apply(this, args);
|
|
163
163
|
};
|
|
164
164
|
},
|
|
165
|
+
// The generation's staleness check reads these: every source file it transpiled.
|
|
166
|
+
compiledFiles() {
|
|
167
|
+
return [...sources.keys()];
|
|
168
|
+
},
|
|
165
169
|
dispose() {
|
|
166
170
|
active = false;
|
|
167
171
|
registration.dispose();
|