@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
|
-
{"openai-responses":{"grok-4.20-0309-non-reasoning":{"id":"grok-4.20-0309-non-reasoning","name":"Grok 4.20 (Non-Reasoning)","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":false,"input":["text","image"],"cost":{"input":1.25,"output":2.5,"cacheRead":0.2,"cacheWrite":0},"contextWindow":1000000,"maxTokens":30000,"thinkingLevelMap":{"off":null,"minimal":null}},"grok-4.20-0309-reasoning":{"id":"grok-4.20-0309-reasoning","name":"Grok 4.20 (Reasoning)","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text","image"],"cost":{"input":1.25,"output":2.5,"cacheRead":0.2,"cacheWrite":0},"contextWindow":1000000,"maxTokens":30000},"grok-4.3":{"id":"grok-4.3","name":"Grok 4.3","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":2.5,"cacheRead":0.2,"cacheWrite":0},"contextWindow":1000000,"maxTokens":30000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"grok-4.5":{"id":"grok-4.5","name":"Grok 4.5","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":true,"input":["text","image"],"cost":{"input":2,"output":6,"cacheRead":0.3,"cacheWrite":0},"contextWindow":500000,"maxTokens":500000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"grok-4.6":{"id":"grok-4.6","name":"Grok 4.6","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"input":["text","image"],"cost":{"input":2,"output":6,"cacheRead":0.5,"cacheWrite":0},"contextWindow":500000,"maxTokens":500000}}}
|
|
1
|
+
{"openai-responses":{"grok-4.20-0309-non-reasoning":{"id":"grok-4.20-0309-non-reasoning","name":"Grok 4.20 (Non-Reasoning)","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":false,"input":["text","image"],"cost":{"input":1.25,"output":2.5,"cacheRead":0.2,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":2.5,"output":5,"cacheRead":0.4,"cacheWrite":0}]},"contextWindow":1000000,"maxTokens":30000,"thinkingLevelMap":{"off":null,"minimal":null}},"grok-4.20-0309-reasoning":{"id":"grok-4.20-0309-reasoning","name":"Grok 4.20 (Reasoning)","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text","image"],"cost":{"input":1.25,"output":2.5,"cacheRead":0.2,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":2.5,"output":5,"cacheRead":0.4,"cacheWrite":0}]},"contextWindow":1000000,"maxTokens":30000},"grok-4.3":{"id":"grok-4.3","name":"Grok 4.3","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":2.5,"cacheRead":0.2,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":2.5,"output":5,"cacheRead":0.4,"cacheWrite":0}]},"contextWindow":1000000,"maxTokens":30000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"grok-4.5":{"id":"grok-4.5","name":"Grok 4.5","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":true,"input":["text","image"],"cost":{"input":2,"output":6,"cacheRead":0.3,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":4,"output":12,"cacheRead":0.6,"cacheWrite":0}]},"contextWindow":500000,"maxTokens":500000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"grok-4.6":{"id":"grok-4.6","name":"Grok 4.6","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"input":["text","image"],"cost":{"input":2,"output":6,"cacheRead":0.5,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":4,"output":12,"cacheRead":1,"cacheWrite":0}]},"contextWindow":500000,"maxTokens":500000},"grok-4.7":{"id":"grok-4.7","name":"Grok 4.7","api":"openai-responses","provider":"xai","baseUrl":"https://api.x.ai/v1","compat":{"supportsLongCacheRetention":false},"reasoning":true,"input":["text","image"],"cost":{"input":2,"output":6,"cacheRead":0.5,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":4,"output":12,"cacheRead":1,"cacheWrite":0}]},"contextWindow":500000,"maxTokens":500000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo-V2.5","api":"openai-completions","provider":"xiaomi-token-plan-ams","baseUrl":"https://token-plan-ams.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo-V2.5-Pro","api":"openai-completions","provider":"xiaomi-token-plan-ams","baseUrl":"https://token-plan-ams.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072}}}
|
|
1
|
+
{"openai-completions":{"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo-V2.5","api":"openai-completions","provider":"xiaomi-token-plan-ams","baseUrl":"https://token-plan-ams.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo-V2.5-Pro","api":"openai-completions","provider":"xiaomi-token-plan-ams","baseUrl":"https://token-plan-ams.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi-token-plan-ams","baseUrl":"https://token-plan-ams.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","api":"openai-completions","provider":"xiaomi-token-plan-ams","baseUrl":"https://token-plan-ams.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo-V2.5","api":"openai-completions","provider":"xiaomi-token-plan-cn","baseUrl":"https://token-plan-cn.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo-V2.5-Pro","api":"openai-completions","provider":"xiaomi-token-plan-cn","baseUrl":"https://token-plan-cn.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072}}}
|
|
1
|
+
{"openai-completions":{"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo-V2.5","api":"openai-completions","provider":"xiaomi-token-plan-cn","baseUrl":"https://token-plan-cn.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo-V2.5-Pro","api":"openai-completions","provider":"xiaomi-token-plan-cn","baseUrl":"https://token-plan-cn.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi-token-plan-cn","baseUrl":"https://token-plan-cn.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","api":"openai-completions","provider":"xiaomi-token-plan-cn","baseUrl":"https://token-plan-cn.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo-V2.5","api":"openai-completions","provider":"xiaomi-token-plan-sgp","baseUrl":"https://token-plan-sgp.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo-V2.5-Pro","api":"openai-completions","provider":"xiaomi-token-plan-sgp","baseUrl":"https://token-plan-sgp.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072}}}
|
|
1
|
+
{"openai-completions":{"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo-V2.5","api":"openai-completions","provider":"xiaomi-token-plan-sgp","baseUrl":"https://token-plan-sgp.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo-V2.5-Pro","api":"openai-completions","provider":"xiaomi-token-plan-sgp","baseUrl":"https://token-plan-sgp.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi-token-plan-sgp","baseUrl":"https://token-plan-sgp.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","api":"openai-completions","provider":"xiaomi-token-plan-sgp","baseUrl":"https://token-plan-sgp.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo-V2.5","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0.14,"output":0.28,"cacheRead":0.0028,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo-V2.5-Pro","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text"],"cost":{"input":0.435,"output":0.87,"cacheRead":0.0036,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.5-pro-ultraspeed":{"id":"mimo-v2.5-pro-ultraspeed","name":"MiMo-V2.5-Pro-UltraSpeed","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text"],"cost":{"input":1.305,"output":2.61,"cacheRead":0.0108,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072}}}
|
|
1
|
+
{"openai-completions":{"mimo-v2.5":{"id":"mimo-v2.5","name":"MiMo-V2.5","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0.14,"output":0.28,"cacheRead":0.0028,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.5-pro":{"id":"mimo-v2.5-pro","name":"MiMo-V2.5-Pro","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text"],"cost":{"input":0.435,"output":0.87,"cacheRead":0.0036,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.5-pro-ultraspeed":{"id":"mimo-v2.5-pro-ultraspeed","name":"MiMo-V2.5-Pro-UltraSpeed","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text"],"cost":{"input":1.305,"output":2.61,"cacheRead":0.0108,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.6-flash":{"id":"mimo-v2.6-flash","name":"MiMo-V2.6-Flash","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0.14,"output":0.28,"cacheRead":0.0028,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.6-pro":{"id":"mimo-v2.6-pro","name":"MiMo-V2.6-Pro","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":0.435,"output":0.87,"cacheRead":0.0036,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072},"mimo-v2.6-pro-ultraspeed":{"id":"mimo-v2.6-pro-ultraspeed","name":"MiMo-V2.6-Pro-UltraSpeed","api":"openai-completions","provider":"xiaomi","baseUrl":"https://api.xiaomimimo.com/v1","compat":{"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","supportsDisabledThinking":false},"reasoning":true,"input":["text","image"],"cost":{"input":4.35,"output":8.7,"cacheRead":0.036,"cacheWrite":0},"contextWindow":1048576,"maxTokens":131072}}}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ApiKeyAuth } from "../auth/types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Kimi Code api-key auth: the key resolves like `envApiKeyAuth` (stored key,
|
|
4
|
+
* then `KIMI_API_KEY`), and the account's region rides along as credential env
|
|
5
|
+
* so an international key is routed to kimi.ai. No client identity headers:
|
|
6
|
+
* a platform key is not a subscription session (#1504).
|
|
7
|
+
*/
|
|
8
|
+
export declare function kimiCodeApiKeyAuth(): ApiKeyAuth;
|
|
9
|
+
//# sourceMappingURL=kimi-coding-auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kimi-coding-auth.d.ts","sourceRoot":"","sources":["../../src/providers/kimi-coding-auth.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,kBAAkB,CAAC;AAUhE;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,UAAU,CA4B/C"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { chooseKimiCodeLoginEndpoints, KIMI_CODE_OAUTH_HOST_ENV, KIMI_CODE_REGION_ENV, KIMI_OAUTH_HOST_ENV, resolveKimiCodeEndpoints, } from "../auth/oauth/kimi-region.js";
|
|
2
|
+
const KIMI_API_KEY_ENV = "KIMI_API_KEY";
|
|
3
|
+
async function envValue(ctx, name, signal) {
|
|
4
|
+
const value = await ctx.env(name);
|
|
5
|
+
signal.throwIfAborted();
|
|
6
|
+
return value || undefined;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Kimi Code api-key auth: the key resolves like `envApiKeyAuth` (stored key,
|
|
10
|
+
* then `KIMI_API_KEY`), and the account's region rides along as credential env
|
|
11
|
+
* so an international key is routed to kimi.ai. No client identity headers:
|
|
12
|
+
* a platform key is not a subscription session (#1504).
|
|
13
|
+
*/
|
|
14
|
+
export function kimiCodeApiKeyAuth() {
|
|
15
|
+
return {
|
|
16
|
+
name: "Kimi API key",
|
|
17
|
+
login: async (interaction) => {
|
|
18
|
+
const endpoints = await chooseKimiCodeLoginEndpoints(interaction);
|
|
19
|
+
const key = await interaction.prompt({ type: "secret", message: "Enter Kimi API key" });
|
|
20
|
+
interaction.signal.throwIfAborted();
|
|
21
|
+
return { type: "api_key", key, ...(endpoints.env ? { env: endpoints.env } : {}) };
|
|
22
|
+
},
|
|
23
|
+
resolve: async ({ ctx, credential, signal }) => {
|
|
24
|
+
signal.throwIfAborted();
|
|
25
|
+
const key = credential?.key || (await envValue(ctx, KIMI_API_KEY_ENV, signal));
|
|
26
|
+
if (!key)
|
|
27
|
+
return undefined;
|
|
28
|
+
const endpoints = resolveKimiCodeEndpoints({
|
|
29
|
+
storedRegion: credential?.env?.[KIMI_CODE_REGION_ENV],
|
|
30
|
+
storedOauthHost: credential?.env?.[KIMI_CODE_OAUTH_HOST_ENV],
|
|
31
|
+
envOauthHost: (await envValue(ctx, KIMI_CODE_OAUTH_HOST_ENV, signal)) ??
|
|
32
|
+
(await envValue(ctx, KIMI_OAUTH_HOST_ENV, signal)),
|
|
33
|
+
envRegion: await envValue(ctx, KIMI_CODE_REGION_ENV, signal),
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
auth: { apiKey: key, ...(endpoints.apiBaseUrl ? { baseUrl: endpoints.apiBaseUrl } : {}) },
|
|
37
|
+
...(credential?.env ? { env: credential.env } : {}),
|
|
38
|
+
source: credential?.key ? "stored credential" : KIMI_API_KEY_ENV,
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=kimi-coding-auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kimi-coding-auth.js","sourceRoot":"","sources":["../../src/providers/kimi-coding-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,4BAA4B,EAC5B,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,GACxB,MAAM,8BAA8B,CAAC;AAGtC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAExC,KAAK,UAAU,QAAQ,CAAC,GAAgB,EAAE,IAAY,EAAE,M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AAG,EAAE,wBAAwB,EAAE,MAAM,CAAC,CAAC;oBACvD,CAAC,MAAM,QAAQ,CAAC,GAAG,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC;gBACnD,SAAS,EAAE,MAAM,QAAQ,CAAC,GAAG,EAAE,oBAAoB,EAAE,MAAM,CAAC;aAC5D,CAAC,CAAC;YACH,OAAO;gBACN,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;gBACzF,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnD,MAAM,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,gBAAgB;aAChE,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["import {\n\tchooseKimiCodeLoginEndpoints,\n\tKIMI_CODE_OAUTH_HOST_ENV,\n\tKIMI_CODE_REGION_ENV,\n\tKIMI_OAUTH_HOST_ENV,\n\tresolveKimiCodeEndpoints,\n} from \"../auth/oauth/kimi-region.ts\";\nimport type { ApiKeyAuth, AuthContext } from \"../auth/types.ts\";\n\nconst KIMI_API_KEY_ENV = \"KIMI_API_KEY\";\n\nasync function envValue(ctx: AuthContext, name: string, signal: AbortSignal): Promise<string | undefined> {\n\tconst value = await ctx.env(name);\n\tsignal.throwIfAborted();\n\treturn value || undefined;\n}\n\n/**\n * Kimi Code api-key auth: the key resolves like `envApiKeyAuth` (stored key,\n * then `KIMI_API_KEY`), and the account's region rides along as credential env\n * so an international key is routed to kimi.ai. No client identity headers:\n * a platform key is not a subscription session (#1504).\n */\nexport function kimiCodeApiKeyAuth(): ApiKeyAuth {\n\treturn {\n\t\tname: \"Kimi API key\",\n\t\tlogin: async (interaction) => {\n\t\t\tconst endpoints = await chooseKimiCodeLoginEndpoints(interaction);\n\t\t\tconst key = await interaction.prompt({ type: \"secret\", message: \"Enter Kimi API key\" });\n\t\t\tinteraction.signal.throwIfAborted();\n\t\t\treturn { type: \"api_key\", key, ...(endpoints.env ? { env: endpoints.env } : {}) };\n\t\t},\n\t\tresolve: async ({ ctx, credential, signal }) => {\n\t\t\tsignal.throwIfAborted();\n\t\t\tconst key = credential?.key || (await envValue(ctx, KIMI_API_KEY_ENV, signal));\n\t\t\tif (!key) return undefined;\n\t\t\tconst endpoints = resolveKimiCodeEndpoints({\n\t\t\t\tstoredRegion: credential?.env?.[KIMI_CODE_REGION_ENV],\n\t\t\t\tstoredOauthHost: credential?.env?.[KIMI_CODE_OAUTH_HOST_ENV],\n\t\t\t\tenvOauthHost:\n\t\t\t\t\t(await envValue(ctx, KIMI_CODE_OAUTH_HOST_ENV, signal)) ??\n\t\t\t\t\t(await envValue(ctx, KIMI_OAUTH_HOST_ENV, signal)),\n\t\t\t\tenvRegion: await envValue(ctx, KIMI_CODE_REGION_ENV, signal),\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tauth: { apiKey: key, ...(endpoints.apiBaseUrl ? { baseUrl: endpoints.apiBaseUrl } : {}) },\n\t\t\t\t...(credential?.env ? { env: credential.env } : {}),\n\t\t\t\tsource: credential?.key ? \"stored credential\" : KIMI_API_KEY_ENV,\n\t\t\t};\n\t\t},\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kimi-coding.d.ts","sourceRoot":"","sources":["../../src/providers/kimi-coding.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"kimi-coding.d.ts","sourceRoot":"","sources":["../../src/providers/kimi-coding.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAK7D,wBAAgB,kBAAkB,IAAI,QAAQ,CAAC,oBAAoB,CAAC,CAoBnE"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { anthropicMessagesApi } from "../api/anthropic-messages.lazy.js";
|
|
2
|
-
import {
|
|
2
|
+
import { lazyOAuth } from "../auth/helpers.js";
|
|
3
3
|
import { loadKimiCodingOAuth } from "../auth/oauth/load.js";
|
|
4
4
|
import { createProvider } from "../models.js";
|
|
5
5
|
import { KIMI_CODE_RETRY_PROFILE } from "../utils/retry-profile/profiles.js";
|
|
6
6
|
import { KIMI_CODING_MODELS } from "./kimi-coding.models.js";
|
|
7
|
+
import { kimiCodeApiKeyAuth } from "./kimi-coding-auth.js";
|
|
7
8
|
export function kimiCodingProvider() {
|
|
8
9
|
return createProvider({
|
|
9
10
|
id: "kimi-coding",
|
|
10
11
|
name: "Kimi For Coding",
|
|
11
12
|
baseUrl: "https://api.kimi.com/coding",
|
|
12
13
|
auth: {
|
|
13
|
-
apiKey:
|
|
14
|
+
apiKey: kimiCodeApiKeyAuth(),
|
|
14
15
|
oauth: lazyOAuth({
|
|
15
16
|
name: "Kimi Code (subscription)",
|
|
16
17
|
isSubscription: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kimi-coding.js","sourceRoot":"","sources":["../../src/providers/kimi-coding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"kimi-coding.js","sourceRoot":"","sources":["../../src/providers/kimi-coding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAiB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,UAAU,kBAAkB;IACjC,OAAO,cAAc,CAAC;QACrB,EAAE,EAAE,aAAa;QACjB,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,6BAA6B;QACtC,IAAI,EAAE;YACL,MAAM,EAAE,kBAAkB,EAAE;YAC5B,KAAK,EAAE,SAAS,CAAC;gBAChB,IAAI,EAAE,0BAA0B;gBAChC,cAAc,EAAE,IAAI;gBACpB,UAAU,EAAE,wBAAwB;gBACpC,IAAI,EAAE,mBAAmB;aACzB,CAAC;SACF;QACD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC;QACzC,GAAG,EAAE,oBAAoB,EAAE;QAC3B,yEAAyE;QACzE,2DAA2D;QAC3D,WAAW,EAAE,uBAAuB;KACpC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { anthropicMessagesApi } from \"../api/anthropic-messages.lazy.ts\";\nimport { lazyOAuth } from \"../auth/helpers.ts\";\nimport { loadKimiCodingOAuth } from \"../auth/oauth/load.ts\";\nimport { createProvider, type Provider } from \"../models.ts\";\nimport { KIMI_CODE_RETRY_PROFILE } from \"../utils/retry-profile/profiles.ts\";\nimport { KIMI_CODING_MODELS } from \"./kimi-coding.models.ts\";\nimport { kimiCodeApiKeyAuth } from \"./kimi-coding-auth.ts\";\n\nexport function kimiCodingProvider(): Provider<\"anthropic-messages\"> {\n\treturn createProvider({\n\t\tid: \"kimi-coding\",\n\t\tname: \"Kimi For Coding\",\n\t\tbaseUrl: \"https://api.kimi.com/coding\",\n\t\tauth: {\n\t\t\tapiKey: kimiCodeApiKeyAuth(),\n\t\t\toauth: lazyOAuth({\n\t\t\t\tname: \"Kimi Code (subscription)\",\n\t\t\t\tisSubscription: true,\n\t\t\t\tloginLabel: \"Sign in with Kimi Code\",\n\t\t\t\tload: loadKimiCodingOAuth,\n\t\t\t}),\n\t\t},\n\t\tmodels: Object.values(KIMI_CODING_MODELS),\n\t\tapi: anthropicMessagesApi(),\n\t\t// Same upstream service (api.kimi.com/coding, protocol anthropic) as the\n\t\t// kimi-code CLI, so its own retry policy applies verbatim.\n\t\tretryPolicy: KIMI_CODE_RETRY_PROFILE,\n\t});\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ProviderStallDescriptionOptions } from "./retry.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Session-internal replay-suppression signal, read off the error text by the
|
|
4
|
+
* retry predicates. A failover lane stamps it when replaying the turn could
|
|
5
|
+
* duplicate side effects that already happened mid-stream. It must stay on the
|
|
6
|
+
* message those predicates inspect and must never reach anything a person
|
|
7
|
+
* reads; byte-identical across every lane that stamps or checks it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TURN_RETRY_SUPPRESSION_PREFIX = "senpi:no-turn-retry:";
|
|
10
|
+
export declare function stripTurnRetrySuppressionPrefix(message: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Plain-language replacement for a provider failure's own `Error.message`,
|
|
13
|
+
* with the internal replay marker removed. Covers the stream-stall watchdogs
|
|
14
|
+
* (delegated to {@link describeProviderStallForUser}) and WebSocket transport
|
|
15
|
+
* interruptions; returns undefined for failures that have no wording here so
|
|
16
|
+
* the caller can fall back to the (marker-stripped) raw text.
|
|
17
|
+
*/
|
|
18
|
+
export declare function describeProviderFailureForUser(errorMessage: string | undefined, options?: ProviderStallDescriptionOptions): string | undefined;
|
|
19
|
+
//# sourceMappingURL=provider-failure-description.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-failure-description.d.ts","sourceRoot":"","sources":["../../src/utils/provider-failure-description.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAErH;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,yBAAyB,CAAC;AAEpE,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvE;AA4BD;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC7C,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,OAAO,GAAE,+BAAoC,GAC3C,MAAM,GAAG,SAAS,CAkBpB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { describeProviderStallForUser, formatStallDuration } from "./retry.js";
|
|
2
|
+
/**
|
|
3
|
+
* Session-internal replay-suppression signal, read off the error text by the
|
|
4
|
+
* retry predicates. A failover lane stamps it when replaying the turn could
|
|
5
|
+
* duplicate side effects that already happened mid-stream. It must stay on the
|
|
6
|
+
* message those predicates inspect and must never reach anything a person
|
|
7
|
+
* reads; byte-identical across every lane that stamps or checks it.
|
|
8
|
+
*/
|
|
9
|
+
export const TURN_RETRY_SUPPRESSION_PREFIX = "senpi:no-turn-retry:";
|
|
10
|
+
export function stripTurnRetrySuppressionPrefix(message) {
|
|
11
|
+
return message.replaceAll(TURN_RETRY_SUPPRESSION_PREFIX, "");
|
|
12
|
+
}
|
|
13
|
+
const WEBSOCKET_CLOSED_PATTERN = /^WebSocket closed\b/i;
|
|
14
|
+
const WEBSOCKET_ERROR_PATTERN = /^WebSocket error$/i;
|
|
15
|
+
const WEBSOCKET_CONNECT_TIMEOUT_PATTERN = /^WebSocket connect timeout after (\d+)ms/i;
|
|
16
|
+
const RECOVERY_SENTENCE = {
|
|
17
|
+
"no-fallback-configured": "No fallback model is configured for it, so nothing could take the turn over: run /fallback to add one, or send the message again to continue from the partial reply.",
|
|
18
|
+
"chain-exhausted": "Every model in its fallback chain was tried as well: run /fallback to review the chain, or send the message again to continue from the partial reply.",
|
|
19
|
+
};
|
|
20
|
+
function transportSymptom(errorMessage, subject) {
|
|
21
|
+
if (WEBSOCKET_CLOSED_PATTERN.test(errorMessage)) {
|
|
22
|
+
return `The connection to ${subject} dropped before the reply finished (${errorMessage}).`;
|
|
23
|
+
}
|
|
24
|
+
if (WEBSOCKET_ERROR_PATTERN.test(errorMessage)) {
|
|
25
|
+
return `The connection to ${subject} reported an error before the reply finished (${errorMessage}).`;
|
|
26
|
+
}
|
|
27
|
+
const connectTimeout = WEBSOCKET_CONNECT_TIMEOUT_PATTERN.exec(errorMessage);
|
|
28
|
+
if (connectTimeout) {
|
|
29
|
+
const provider = subject.replace(/^the provider/, "The provider");
|
|
30
|
+
return `${provider} did not accept the connection within ${formatStallDuration(Number(connectTimeout[1]))}.`;
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Plain-language replacement for a provider failure's own `Error.message`,
|
|
36
|
+
* with the internal replay marker removed. Covers the stream-stall watchdogs
|
|
37
|
+
* (delegated to {@link describeProviderStallForUser}) and WebSocket transport
|
|
38
|
+
* interruptions; returns undefined for failures that have no wording here so
|
|
39
|
+
* the caller can fall back to the (marker-stripped) raw text.
|
|
40
|
+
*/
|
|
41
|
+
export function describeProviderFailureForUser(errorMessage, options = {}) {
|
|
42
|
+
if (!errorMessage)
|
|
43
|
+
return undefined;
|
|
44
|
+
const message = stripTurnRetrySuppressionPrefix(errorMessage).trim();
|
|
45
|
+
if (!message)
|
|
46
|
+
return undefined;
|
|
47
|
+
const stall = describeProviderStallForUser(message, options);
|
|
48
|
+
if (stall !== undefined)
|
|
49
|
+
return stall;
|
|
50
|
+
const subject = options.model ? `the provider for ${options.model}` : "the provider";
|
|
51
|
+
const symptom = transportSymptom(message, subject);
|
|
52
|
+
if (symptom === undefined)
|
|
53
|
+
return undefined;
|
|
54
|
+
const sentences = [symptom];
|
|
55
|
+
const attempts = options.attempts ?? 0;
|
|
56
|
+
if (attempts > 0) {
|
|
57
|
+
sentences.push(`Retried ${attempts} time${attempts === 1 ? "" : "s"} on the same model with the same result.`);
|
|
58
|
+
}
|
|
59
|
+
if (options.recovery)
|
|
60
|
+
sentences.push(RECOVERY_SENTENCE[options.recovery]);
|
|
61
|
+
return sentences.join(" ");
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=provider-failure-description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-failure-description.js","sourceRoot":"","sources":["../../src/utils/provider-failure-description.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAwC,MAAM,YAAY,CAAC;AAErH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,sBAAsB,CAAC;AAEpE,MAAM,UAAU,+BAA+B,CAAC,OAAe;IAC9D,OAAO,OAAO,CAAC,UAAU,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AACxD,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AACrD,MAAM,iCAAiC,GAAG,2CAA2C,CAAC;AAEtF,MAAM,iBAAiB,GAA6E;IACnG,wBAAwB,EACvB,sKAAsK;IACvK,iBAAiB,EAChB,uJAAuJ;CACxJ,CAAC;AAEF,SAAS,gBAAgB,CAAC,YAAoB,EAAE,OAAe;IAC9D,IAAI,wBAAwB,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QACjD,OAAO,qBAAqB,OAAO,uCAAuC,YAAY,IAAI,CAAC;IAC5F,CAAC;IACD,IAAI,uBAAuB,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QAChD,OAAO,qBAAqB,OAAO,iDAAiD,YAAY,IAAI,CAAC;IACtG,CAAC;IACD,MAAM,cAAc,GAAG,iCAAiC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC5E,IAAI,cAAc,EAAE,CAAC;QACpB,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;QAClE,OAAO,GAAG,QAAQ,yCAAyC,mBA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sourcesContent":["import { describeProviderStallForUser, formatStallDuration, type ProviderStallDescriptionOptions } from \"./retry.ts\";\n\n/**\n * Session-internal replay-suppression signal, read off the error text by the\n * retry predicates. A failover lane stamps it when replaying the turn could\n * duplicate side effects that already happened mid-stream. It must stay on the\n * message those predicates inspect and must never reach anything a person\n * reads; byte-identical across every lane that stamps or checks it.\n */\nexport const TURN_RETRY_SUPPRESSION_PREFIX = \"senpi:no-turn-retry:\";\n\nexport function stripTurnRetrySuppressionPrefix(message: string): string {\n\treturn message.replaceAll(TURN_RETRY_SUPPRESSION_PREFIX, \"\");\n}\n\nconst WEBSOCKET_CLOSED_PATTERN = /^WebSocket closed\\b/i;\nconst WEBSOCKET_ERROR_PATTERN = /^WebSocket error$/i;\nconst WEBSOCKET_CONNECT_TIMEOUT_PATTERN = /^WebSocket connect timeout after (\\d+)ms/i;\n\nconst RECOVERY_SENTENCE: Record<NonNullable<ProviderStallDescriptionOptions[\"recovery\"]>, string> = {\n\t\"no-fallback-configured\":\n\t\t\"No fallback model is configured for it, so nothing could take the turn over: run /fallback to add one, or send the message again to continue from the partial reply.\",\n\t\"chain-exhausted\":\n\t\t\"Every model in its fallback chain was tried as well: run /fallback to review the chain, or send the message again to continue from the partial reply.\",\n};\n\nfunction transportSymptom(errorMessage: string, subject: string): string | undefined {\n\tif (WEBSOCKET_CLOSED_PATTERN.test(errorMessage)) {\n\t\treturn `The connection to ${subject} dropped before the reply finished (${errorMessage}).`;\n\t}\n\tif (WEBSOCKET_ERROR_PATTERN.test(errorMessage)) {\n\t\treturn `The connection to ${subject} reported an error before the reply finished (${errorMessage}).`;\n\t}\n\tconst connectTimeout = WEBSOCKET_CONNECT_TIMEOUT_PATTERN.exec(errorMessage);\n\tif (connectTimeout) {\n\t\tconst provider = subject.replace(/^the provider/, \"The provider\");\n\t\treturn `${provider} did not accept the connection within ${formatStallDuration(Number(connectTimeout[1]))}.`;\n\t}\n\treturn undefined;\n}\n\n/**\n * Plain-language replacement for a provider failure's own `Error.message`,\n * with the internal replay marker removed. Covers the stream-stall watchdogs\n * (delegated to {@link describeProviderStallForUser}) and WebSocket transport\n * interruptions; returns undefined for failures that have no wording here so\n * the caller can fall back to the (marker-stripped) raw text.\n */\nexport function describeProviderFailureForUser(\n\terrorMessage: string | undefined,\n\toptions: ProviderStallDescriptionOptions = {},\n): string | undefined {\n\tif (!errorMessage) return undefined;\n\tconst message = stripTurnRetrySuppressionPrefix(errorMessage).trim();\n\tif (!message) return undefined;\n\tconst stall = describeProviderStallForUser(message, options);\n\tif (stall !== undefined) return stall;\n\n\tconst subject = options.model ? `the provider for ${options.model}` : \"the provider\";\n\tconst symptom = transportSymptom(message, subject);\n\tif (symptom === undefined) return undefined;\n\n\tconst sentences = [symptom];\n\tconst attempts = options.attempts ?? 0;\n\tif (attempts > 0) {\n\t\tsentences.push(`Retried ${attempts} time${attempts === 1 ? \"\" : \"s\"} on the same model with the same result.`);\n\t}\n\tif (options.recovery) sentences.push(RECOVERY_SENTENCE[options.recovery]);\n\treturn sentences.join(\" \");\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classifiers.d.ts","sourceRoot":"","sources":["../../../src/utils/retry-profile/classifiers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAuB,eAAe,EAAgB,MAAM,YAAY,CAAC;AAqBrF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,EAAE,eAoBjC,CAAC;
|
|
1
|
+
{"version":3,"file":"classifiers.d.ts","sourceRoot":"","sources":["../../../src/utils/retry-profile/classifiers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAuB,eAAe,EAAgB,MAAM,YAAY,CAAC;AAqBrF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,EAAE,eAoBjC,CAAC;AAsBF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,6BAA6B,EAAE,eAwB3C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { classifyErrorMessage } from "../retry.js";
|
|
1
|
+
import { classifyErrorMessage, USAGE_LIMIT_EXHAUSTION } from "../retry.js";
|
|
2
2
|
/**
|
|
3
3
|
* Status codes Kimi's provider-request stage treats as retryable. 429 is its
|
|
4
4
|
* own `rate-limited` verdict (the turn budget treats it through hint tiers);
|
|
@@ -62,6 +62,10 @@ const SENPI_STRUCTURED_RETRYABLE_STATUS_CODES = new Set([
|
|
|
62
62
|
const SENPI_STRUCTURED_TERMINAL_PROVIDER_CODES = new Set([
|
|
63
63
|
"insufficient_quota",
|
|
64
64
|
"credits_required",
|
|
65
|
+
// OpenAI hard account-quota exhaustion (senpi#1969). Declared once in
|
|
66
|
+
// ../retry.ts as USAGE_LIMIT_EXHAUSTION and consumed here so the two
|
|
67
|
+
// packages/ai lists cannot drift.
|
|
68
|
+
...USAGE_LIMIT_EXHAUSTION.codes,
|
|
65
69
|
]);
|
|
66
70
|
/**
|
|
67
71
|
* Senpi assistant-turn classifier: the existing message regexes decide first;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classifiers.js","sourceRoot":"","sources":["../../../src/utils/retry-profile/classifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"classifiers.js","sourceRoot":"","sources":["../../../src/utils/retry-profile/classifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAG3E;;;;;GAKG;AACH,MAAM,2BAA2B,GAAwB,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAE3G,SAAS,sBAAsB,CAAC,UAA8B;IAC7D,IAAI,UAAU,KAAK,SAAS,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,UAAU,C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EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAC5F,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AAChC,CAAC,CAAC","sourcesContent":["import { classifyErrorMessage, USAGE_LIMIT_EXHAUSTION } from \"../retry.ts\";\nimport type { RetryClassification, RetryClassifier, RetryFailure } from \"./types.ts\";\n\n/**\n * Status codes Kimi's provider-request stage treats as retryable. 429 is its\n * own `rate-limited` verdict (the turn budget treats it through hint tiers);\n * the other whitelisted codes are ordinary `transient`. Every other status —\n * client errors and non-whitelisted 5xx alike — is `terminal`.\n */\nconst KIMI_RETRYABLE_STATUS_CODES: ReadonlySet<number> = new Set([408, 409, 429, 500, 502, 503, 504, 529]);\n\nfunction classifyKimiHttpStatus(statusCode: number | undefined): RetryClassification {\n\tif (statusCode === undefined || !KIMI_RETRYABLE_STATUS_CODES.has(statusCode)) {\n\t\treturn { verdict: \"terminal\" };\n\t}\n\treturn statusCode === 429 ? { verdict: \"rate-limited\" } : { verdict: \"transient\" };\n}\n\nfunction assertNever(kind: never): never {\n\tthrow new Error(`Unhandled retry failure kind: ${kind}`);\n}\n\n/**\n * Kimi provider-request classifier, ported from the source provider's retry\n * policy (policy only, not its code). The switch is exhaustive over\n * {@link RetryFailure}[\"kind\"]:\n *\n * - abort / refusal / sensitive / quota-exhausted / image-format / unknown are\n * terminal: user cancellations, content refusals, dead accounts, rejected\n * payloads, and unrecognized failures never recover by re-sending.\n * - connection / timeout / provider failures are transient transport noise.\n * - empty-response is transient unless the model said `finishReason` was\n * \"filtered\", which is a deterministic content rejection.\n * - http-status is retryable only for the whitelisted codes above.\n */\nexport const classifyKimiFailure: RetryClassifier = (failure) => {\n\tswitch (failure.kind) {\n\t\tcase \"abort\":\n\t\tcase \"refusal\":\n\t\tcase \"sensitive\":\n\t\tcase \"quota-exhausted\":\n\t\tcase \"image-format\":\n\t\tcase \"unknown\":\n\t\t\treturn { verdict: \"terminal\" };\n\t\tcase \"connection\":\n\t\tcase \"timeout\":\n\t\tcase \"provider\":\n\t\t\treturn { verdict: \"transient\" };\n\t\tcase \"empty-response\":\n\t\t\treturn failure.finishReason === \"filtered\" ? { verdict: \"terminal\" } : { verdict: \"transient\" };\n\t\tcase \"http-status\":\n\t\t\treturn classifyKimiHttpStatus(failure.statusCode);\n\t\tdefault:\n\t\t\treturn assertNever(failure.kind);\n\t}\n};\n\n/**\n * Structured status codes the senpi default classifier treats as retryable\n * when — and only when — the message regexes have no opinion. Mirrors the\n * transient half of Kimi's table plus the Cloudflare gateway codes senpi\n * already retries by regex.\n */\nconst SENPI_STRUCTURED_RETRYABLE_STATUS_CODES: ReadonlySet<number> = new Set([\n\t408, 409, 429, 500, 502, 503, 504, 522, 524, 529,\n]);\n\n/** Provider error codes that prove a dead account regardless of message text. */\nconst SENPI_STRUCTURED_TERMINAL_PROVIDER_CODES: ReadonlySet<string> = new Set([\n\t\"insufficient_quota\",\n\t\"credits_required\",\n\t// OpenAI hard account-quota exhaustion (senpi#1969). Declared once in\n\t// ../retry.ts as USAGE_LIMIT_EXHAUSTION and consumed here so the two\n\t// packages/ai lists cannot drift.\n\t...USAGE_LIMIT_EXHAUSTION.codes,\n]);\n\n/**\n * Senpi assistant-turn classifier: the existing message regexes decide first;\n * structured failure facts are consulted only where the regexes are silent.\n *\n * Precedence (terminal wins at every tie):\n * 1. Deterministic failure kinds (abort/refusal/sensitive/quota/image-format)\n * are terminal before any text inspection.\n * 2. A non-retryable regex match is terminal — request-shape and quota wording\n * outrank any structured status (a 500 carrying invalid-tool-schema text\n * stays terminal, unlike under {@link classifyKimiFailure}).\n * 3. Structured terminal facts (`shouldRetry: false`, quota provider codes).\n * 4. A retryable regex match is transient — e.g. a 400 carrying Anthropic's\n * server-tool pairing text stays retryable because the request builder\n * repairs the replayed history.\n * 5. Only when the regexes have no opinion does the structured status decide:\n * whitelisted transient codes retry, everything else is terminal.\n * 6. No regex match and no structured facts: terminal, exactly the legacy\n * boolean fallback.\n */\nexport const classifySenpiAssistantFailure: RetryClassifier = (failure) => {\n\tswitch (failure.kind) {\n\t\tcase \"abort\":\n\t\tcase \"refusal\":\n\t\tcase \"sensitive\":\n\t\tcase \"quota-exhausted\":\n\t\tcase \"image-format\":\n\t\t\treturn { verdict: \"terminal\" };\n\t}\n\n\tconst regexVerdict = classifyErrorMessage(failure.message);\n\tif (regexVerdict === \"non-retryable\") return { verdict: \"terminal\" };\n\n\tif (failure.shouldRetry === false) return { verdict: \"terminal\" };\n\tif (failure.providerCodes?.some((code) => SENPI_STRUCTURED_TERMINAL_PROVIDER_CODES.has(code))) {\n\t\treturn { verdict: \"terminal\" };\n\t}\n\n\tif (regexVerdict === \"retryable\") return { verdict: \"transient\" };\n\n\tif (failure.statusCode !== undefined && SENPI_STRUCTURED_RETRYABLE_STATUS_CODES.has(failure.statusCode)) {\n\t\treturn failure.statusCode === 429 ? { verdict: \"rate-limited\" } : { verdict: \"transient\" };\n\t}\n\treturn { verdict: \"terminal\" };\n};\n"]}
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import type { AssistantMessage } from "../types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* OpenAI hard account-quota exhaustion (senpi#1969). The wire evidence is a 429
|
|
4
|
+
* whose body is `{"type":"usage_limit_reached","message":"The usage limit has
|
|
5
|
+
* been reached"}`; `usage_not_included` is the sibling entitlement code. The
|
|
6
|
+
* account cannot serve more requests until its quota resets or its plan changes,
|
|
7
|
+
* so every consumer treats the family as terminal. Declared once here and
|
|
8
|
+
* consumed by both the non-retryable pattern below and the structured terminal
|
|
9
|
+
* provider codes in `retry-profile/classifiers.ts`, so the two lists cannot
|
|
10
|
+
* drift.
|
|
11
|
+
*/
|
|
12
|
+
export declare const USAGE_LIMIT_EXHAUSTION: {
|
|
13
|
+
/** Structured error codes, as extracted into `providerCodes` failure facts. */
|
|
14
|
+
readonly codes: readonly ["usage_limit_reached", "usage_not_included"];
|
|
15
|
+
/** Message markers: the codes appear verbatim in bodies, plus the sentence. */
|
|
16
|
+
readonly markers: readonly ["usage_limit_reached", "usage_not_included", "usage limit has been reached"];
|
|
17
|
+
};
|
|
2
18
|
/**
|
|
3
19
|
* Retry policy: bounded attempts with exponential backoff (`baseDelayMs * 2^(attempt-1)`).
|
|
4
20
|
* `maxAgentDelayMs` caps each computed delay and defaults to 60 seconds.
|
|
@@ -101,6 +117,7 @@ export interface ProviderStallDescriptionOptions {
|
|
|
101
117
|
*/
|
|
102
118
|
recovery?: "no-fallback-configured" | "chain-exhausted";
|
|
103
119
|
}
|
|
120
|
+
export declare function formatStallDuration(timeoutMs: number): string;
|
|
104
121
|
/**
|
|
105
122
|
* Plain-language replacement for a stall watchdog's own `Error.message`.
|
|
106
123
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAWpD;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB;IAClC,+EAA+E;aAC/E,KAAK,YAAG,qBAAqB,EAAE,oBAAoB;IACnD,+EAA+E;aAC/E,OAAO,YAAG,qBAAqB,EAAE,oBAAoB,EAAE,8BAA8B;CAC5E,CAAC;AAuJX;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,qFAAqF;IACrF,UAAU,EAAE,MAAM,CAAC;IACnB,0FAA0F;IAC1F,WAAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,MAA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,OAAO,CAAC,gBAAgB,CAAC,CA6C3B;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAU5E;AAgBD,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAE7E;AA8BD,MAAM,WAAW,+BAA+B;IAC/C,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,wBAAwB,GAAG,iBAAiB,CAAC;CACxD;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAI7D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAC3C,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,OAAO,GAAE,+BAAoC,GAC3C,MAAM,GAAG,SAAS,CAuBpB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAKzE;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAErE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,GAAG,WAAW,GAAG,SAAS,CAKpG"}
|
|
@@ -5,6 +5,22 @@ function buildProviderErrorPattern(patterns) {
|
|
|
5
5
|
function escapeRegExp(text) {
|
|
6
6
|
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* OpenAI hard account-quota exhaustion (senpi#1969). The wire evidence is a 429
|
|
10
|
+
* whose body is `{"type":"usage_limit_reached","message":"The usage limit has
|
|
11
|
+
* been reached"}`; `usage_not_included` is the sibling entitlement code. The
|
|
12
|
+
* account cannot serve more requests until its quota resets or its plan changes,
|
|
13
|
+
* so every consumer treats the family as terminal. Declared once here and
|
|
14
|
+
* consumed by both the non-retryable pattern below and the structured terminal
|
|
15
|
+
* provider codes in `retry-profile/classifiers.ts`, so the two lists cannot
|
|
16
|
+
* drift.
|
|
17
|
+
*/
|
|
18
|
+
export const USAGE_LIMIT_EXHAUSTION = {
|
|
19
|
+
/** Structured error codes, as extracted into `providerCodes` failure facts. */
|
|
20
|
+
codes: ["usage_limit_reached", "usage_not_included"],
|
|
21
|
+
/** Message markers: the codes appear verbatim in bodies, plus the sentence. */
|
|
22
|
+
markers: ["usage_limit_reached", "usage_not_included", "usage limit has been reached"],
|
|
23
|
+
};
|
|
8
24
|
const NON_RETRYABLE_PROVIDER_ERROR_PATTERN = buildProviderErrorPattern([
|
|
9
25
|
// OpenCode Go/free-tier limits returned as 429 JSON error types by OpenCode's
|
|
10
26
|
// Zen API. These are subscription/account limits, not transient throttles.
|
|
@@ -26,6 +42,11 @@ const NON_RETRYABLE_PROVIDER_ERROR_PATTERN = buildProviderErrorPattern([
|
|
|
26
42
|
// spend limit, so same-model retries can never recover it.
|
|
27
43
|
"credits_required",
|
|
28
44
|
"credits are required",
|
|
45
|
+
// OpenAI hard account-quota exhaustion (senpi#1969): the 429 body carries
|
|
46
|
+
// `usage_limit_reached` / "The usage limit has been reached", and the account
|
|
47
|
+
// stays dead until its quota resets — every same-account retry is guaranteed
|
|
48
|
+
// to fail, so the failure is terminal, not rate-limited.
|
|
49
|
+
...USAGE_LIMIT_EXHAUSTION.markers,
|
|
29
50
|
// Request-shape rejections: the provider refused the payload we built, not the
|
|
30
51
|
// work it describes. Gateways wrap these in whatever status they like — the
|
|
31
52
|
// observed Apitopia/Kimi case arrives as `500 server_error: Invalid request:
|
|
@@ -344,7 +365,7 @@ const PROVIDER_STALL_PHASES = [
|
|
|
344
365
|
symptom: "finished its output but never sent the end-of-response event",
|
|
345
366
|
},
|
|
346
367
|
];
|
|
347
|
-
function formatStallDuration(timeoutMs) {
|
|
368
|
+
export function formatStallDuration(timeoutMs) {
|
|
348
369
|
if (timeoutMs < 1000)
|
|
349
370
|
return `${timeoutMs}ms`;
|
|
350
371
|
if (timeoutMs < 120_000)
|