@code-yeongyu/senpi 2026.7.25 → 2026.7.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -0
- package/README.md +1 -1
- package/dist/beta/omo-local-update.d.ts +207 -0
- package/dist/beta/omo-local-update.d.ts.map +1 -0
- package/dist/beta/omo-local-update.js +708 -0
- package/dist/beta/omo-local-update.js.map +1 -0
- package/dist/cli/args.d.ts +4 -16
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +9 -25
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/grok-neo-gate.d.ts +12 -0
- package/dist/cli/grok-neo-gate.d.ts.map +1 -0
- package/dist/cli/grok-neo-gate.js +18 -0
- package/dist/cli/grok-neo-gate.js.map +1 -0
- package/dist/cli-main.js +4 -0
- package/dist/cli-main.js.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +2 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +33 -8
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +22 -3
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +202 -58
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-providers.d.ts +2 -2
- package/dist/core/auth-providers.js +2 -2
- package/dist/core/auth-providers.js.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.js +3 -2
- package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.js +30 -2
- package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.js +28 -0
- package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/index.js +20 -17
- package/dist/core/extensions/builtin/config-reload/index.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/log.d.ts +4 -1
- package/dist/core/extensions/builtin/config-reload/log.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/log.js +3 -0
- package/dist/core/extensions/builtin/config-reload/log.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/routine-settings.d.ts +15 -0
- package/dist/core/extensions/builtin/config-reload/routine-settings.d.ts.map +1 -0
- package/dist/core/extensions/builtin/config-reload/routine-settings.js +102 -0
- package/dist/core/extensions/builtin/config-reload/routine-settings.js.map +1 -0
- package/dist/core/extensions/builtin/goal/command-registration.js +2 -2
- package/dist/core/extensions/builtin/goal/command-registration.js.map +1 -1
- package/dist/core/extensions/builtin/goal/format.d.ts +1 -1
- package/dist/core/extensions/builtin/goal/format.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/format.js +9 -2
- package/dist/core/extensions/builtin/goal/format.js.map +1 -1
- package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/index.js +38 -23
- package/dist/core/extensions/builtin/goal/index.js.map +1 -1
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.d.ts +6 -0
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.js +19 -0
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.js.map +1 -0
- package/dist/core/extensions/builtin/goal/persistence.d.ts +6 -0
- package/dist/core/extensions/builtin/goal/persistence.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/persistence.js +141 -0
- package/dist/core/extensions/builtin/goal/persistence.js.map +1 -0
- package/dist/core/extensions/builtin/goal/store.d.ts +7 -3
- package/dist/core/extensions/builtin/goal/store.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/store.js +66 -181
- package/dist/core/extensions/builtin/goal/store.js.map +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.d.ts +1 -0
- package/dist/core/extensions/builtin/goal/tool-registration.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.js +26 -15
- package/dist/core/extensions/builtin/goal/tool-registration.js.map +1 -1
- package/dist/core/extensions/builtin/goal/transitions.d.ts +3 -0
- package/dist/core/extensions/builtin/goal/transitions.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/transitions.js +45 -0
- package/dist/core/extensions/builtin/goal/transitions.js.map +1 -0
- package/dist/core/extensions/builtin/goal/types.d.ts +10 -4
- package/dist/core/extensions/builtin/goal/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/types.js +2 -2
- package/dist/core/extensions/builtin/goal/types.js.map +1 -1
- package/dist/core/extensions/builtin/goal/ui.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/ui.js +2 -0
- package/dist/core/extensions/builtin/goal/ui.js.map +1 -1
- package/dist/core/extensions/builtin/goal/validation.d.ts +8 -1
- package/dist/core/extensions/builtin/goal/validation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/validation.js +24 -12
- package/dist/core/extensions/builtin/goal/validation.js.map +1 -1
- package/dist/core/extensions/builtin/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/index.js +0 -2
- package/dist/core/extensions/builtin/index.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/index.js +8 -5
- package/dist/core/extensions/builtin/mcp/index.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/parsers.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/parsers.js +1 -0
- package/dist/core/extensions/builtin/permission-system/parsers.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +48 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +88 -64
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.js +32 -0
- package/dist/core/extensions/builtin/terminal/extension.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/index.d.ts +1 -1
- package/dist/core/extensions/builtin/terminal/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/index.js +1 -1
- package/dist/core/extensions/builtin/terminal/index.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts +29 -0
- package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/monitor-notify.js +185 -0
- package/dist/core/extensions/builtin/terminal/monitor-notify.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts +35 -0
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/monitor-registry.js +98 -0
- package/dist/core/extensions/builtin/terminal/monitor-registry.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/notify.d.ts +9 -0
- package/dist/core/extensions/builtin/terminal/notify.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/notify.js +30 -14
- package/dist/core/extensions/builtin/terminal/notify.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.d.ts +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.js +13 -5
- package/dist/core/extensions/builtin/terminal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/runtime-session.d.ts +3 -12
- package/dist/core/extensions/builtin/terminal/runtime-session.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/runtime-session.js +4 -59
- package/dist/core/extensions/builtin/terminal/runtime-session.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/settings.d.ts +8 -0
- package/dist/core/extensions/builtin/terminal/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/settings.js +16 -2
- package/dist/core/extensions/builtin/terminal/settings.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/shared.d.ts +2 -2
- package/dist/core/extensions/builtin/terminal/shared.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/shared.js +2 -1
- package/dist/core/extensions/builtin/terminal/shared.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-output.d.ts +10 -4
- package/dist/core/extensions/builtin/terminal/tools/bash-output.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-output.js +17 -96
- package/dist/core/extensions/builtin/terminal/tools/bash-output.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts +7 -0
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts +41 -0
- package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/tools/monitor.js +97 -0
- package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/tools/render.d.ts +3 -0
- package/dist/core/extensions/builtin/terminal/tools/render.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/render.js +5 -2
- package/dist/core/extensions/builtin/terminal/tools/render.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/fuzzy-match.d.ts +19 -0
- package/dist/core/extensions/builtin/todotools/fuzzy-match.d.ts.map +1 -0
- package/dist/core/extensions/builtin/todotools/fuzzy-match.js +70 -0
- package/dist/core/extensions/builtin/todotools/fuzzy-match.js.map +1 -0
- package/dist/core/extensions/builtin/todotools/normalize.d.ts +8 -0
- package/dist/core/extensions/builtin/todotools/normalize.d.ts.map +1 -0
- package/dist/core/extensions/builtin/todotools/normalize.js +174 -0
- package/dist/core/extensions/builtin/todotools/normalize.js.map +1 -0
- package/dist/core/extensions/builtin/todotools/prompt.d.ts +2 -2
- package/dist/core/extensions/builtin/todotools/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/prompt.js +4 -2
- package/dist/core/extensions/builtin/todotools/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/state.d.ts +9 -8
- package/dist/core/extensions/builtin/todotools/state.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/state.js +99 -48
- package/dist/core/extensions/builtin/todotools/state.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/tools/todo.d.ts +1 -1
- package/dist/core/extensions/builtin/todotools/tools/todo.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/tools/todo.js +65 -38
- package/dist/core/extensions/builtin/todotools/tools/todo.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/index.js +2 -4
- package/dist/core/extensions/builtin/websearch/index.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/config.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/config.js +4 -1
- package/dist/core/extensions/builtin/websearch/websearch/config.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/native.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/native.js +2 -4
- package/dist/core/extensions/builtin/websearch/websearch/native.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/renderers.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/renderers.js +20 -8
- package/dist/core/extensions/builtin/websearch/websearch/renderers.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/search.d.ts +6 -1
- package/dist/core/extensions/builtin/websearch/websearch/search.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/search.js +15 -11
- package/dist/core/extensions/builtin/websearch/websearch/search.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/tool.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/tool.js +5 -10
- package/dist/core/extensions/builtin/websearch/websearch/tool.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/types.d.ts +1 -0
- package/dist/core/extensions/builtin/websearch/websearch/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/types.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +12 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +5 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +12 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +25 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/keybindings.d.ts +0 -5
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +0 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/messages.d.ts +32 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +91 -0
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-resolver.d.ts +10 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +13 -3
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +2 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +4 -3
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +19 -1
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts +9 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +13 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/retry-fallback/controller.d.ts +7 -0
- package/dist/core/retry-fallback/controller.d.ts.map +1 -1
- package/dist/core/retry-fallback/controller.js +13 -0
- package/dist/core/retry-fallback/controller.js.map +1 -1
- package/dist/core/retry-fallback/cooldown.d.ts.map +1 -1
- package/dist/core/retry-fallback/cooldown.js +5 -0
- package/dist/core/retry-fallback/cooldown.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +11 -35
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager.d.ts +12 -16
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +10 -13
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/thinking-levels.d.ts.map +1 -1
- package/dist/core/thinking-levels.js +9 -2
- package/dist/core/thinking-levels.js.map +1 -1
- package/dist/core/timings.d.ts +7 -2
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +11 -0
- package/dist/core/timings.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +6 -0
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/inspector-policy.d.ts +22 -0
- package/dist/inspector-policy.d.ts.map +1 -0
- package/dist/inspector-policy.js +84 -0
- package/dist/inspector-policy.js.map +1 -0
- package/dist/main.d.ts +6 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +20 -23
- package/dist/main.js.map +1 -1
- package/dist/modes/app-server/runtime.d.ts.map +1 -1
- package/dist/modes/app-server/runtime.js +1 -0
- package/dist/modes/app-server/runtime.js.map +1 -1
- package/dist/modes/app-server/threads/goal-handlers.js +4 -2
- package/dist/modes/app-server/threads/goal-handlers.js.map +1 -1
- package/dist/modes/app-server/threads/goal-wire.d.ts.map +1 -1
- package/dist/modes/app-server/threads/goal-wire.js +1 -0
- package/dist/modes/app-server/threads/goal-wire.js.map +1 -1
- package/dist/modes/app-server/threads/handlers.d.ts +1 -0
- package/dist/modes/app-server/threads/handlers.d.ts.map +1 -1
- package/dist/modes/app-server/threads/handlers.js +2 -0
- package/dist/modes/app-server/threads/handlers.js.map +1 -1
- package/dist/modes/app-server/threads/turn-runtime.d.ts +1 -0
- package/dist/modes/app-server/threads/turn-runtime.d.ts.map +1 -1
- package/dist/modes/app-server/threads/turn-runtime.js.map +1 -1
- package/dist/modes/app-server/threads/turns.d.ts.map +1 -1
- package/dist/modes/app-server/threads/turns.js +47 -3
- package/dist/modes/app-server/threads/turns.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +3 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +9 -2
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +1 -0
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +29 -4
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +5 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +43 -17
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/grok/chrome-tokens.d.ts +22 -0
- package/dist/modes/interactive/grok/chrome-tokens.d.ts.map +1 -0
- package/dist/modes/interactive/grok/chrome-tokens.js +27 -0
- package/dist/modes/interactive/grok/chrome-tokens.js.map +1 -0
- package/dist/modes/interactive/grok/chrome.d.ts +51 -0
- package/dist/modes/interactive/grok/chrome.d.ts.map +1 -0
- package/dist/modes/interactive/grok/chrome.js +105 -0
- package/dist/modes/interactive/grok/chrome.js.map +1 -0
- package/dist/modes/interactive/grok/footer.d.ts +14 -0
- package/dist/modes/interactive/grok/footer.d.ts.map +1 -0
- package/dist/modes/interactive/grok/footer.js +27 -0
- package/dist/modes/interactive/grok/footer.js.map +1 -0
- package/dist/modes/interactive/grok/input-card.d.ts +9 -0
- package/dist/modes/interactive/grok/input-card.d.ts.map +1 -0
- package/dist/modes/interactive/grok/input-card.js +30 -0
- package/dist/modes/interactive/grok/input-card.js.map +1 -0
- package/dist/modes/interactive/grok/palette.d.ts +145 -0
- package/dist/modes/interactive/grok/palette.d.ts.map +1 -0
- package/dist/modes/interactive/grok/palette.js +92 -0
- package/dist/modes/interactive/grok/palette.js.map +1 -0
- package/dist/modes/interactive/grok/tool-row.d.ts +17 -0
- package/dist/modes/interactive/grok/tool-row.d.ts.map +1 -0
- package/dist/modes/interactive/grok/tool-row.js +26 -0
- package/dist/modes/interactive/grok/tool-row.js.map +1 -0
- package/dist/modes/interactive/grok/welcome-card.d.ts +10 -0
- package/dist/modes/interactive/grok/welcome-card.d.ts.map +1 -0
- package/dist/modes/interactive/grok/welcome-card.js +30 -0
- package/dist/modes/interactive/grok/welcome-card.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +5 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +117 -54
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/grok-day.json +77 -0
- package/dist/modes/interactive/theme/grok-night.json +93 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +4 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts +3 -3
- package/dist/modes/rpc/connection-handler.js +6 -6
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/custom-capability.d.ts +6 -7
- package/dist/modes/rpc/custom-capability.d.ts.map +1 -1
- package/dist/modes/rpc/custom-capability.js +6 -7
- package/dist/modes/rpc/custom-capability.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +2 -2
- package/dist/modes/rpc/rpc-mode.js +5 -5
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +11 -0
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/senpi +2 -0
- package/docs/docs.json +4 -0
- package/docs/environment-variables.md +1 -0
- package/docs/extensions.md +2 -2
- package/docs/grok-neo.md +77 -0
- package/docs/keybindings.md +0 -1
- package/docs/settings.md +14 -3
- package/docs/terminal-tools.md +6 -3
- package/docs/usage.md +1 -1
- package/examples/extensions/message-renderer.ts +2 -2
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +47 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +39 -19
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +3 -3
- package/node_modules/@code-yeongyu/senpi-codemode/src/bridge/http-server.ts +6 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/bridges/output-bridge.ts +0 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/eval-notifier.ts +40 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +46 -66
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/context-manager.ts +5 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/kernel-contract.ts +2 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/kernel.ts +19 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/prelude.py +7 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/subprocess-kernel.ts +8 -5
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +23 -5
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-manager.ts +322 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +253 -18
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/interrupt-note.ts +58 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +28 -6
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/status-events.ts +20 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +65 -22
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +4 -41
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +6 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.d.ts +10 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.js +38 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +5 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +210 -26
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +16 -8
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +39 -20
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +9 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +4 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +12 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +19 -11
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +121 -23
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +67 -31
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +13 -8
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.d.ts +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.js +37 -35
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +11 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models-store.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +5 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +9 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +8 -3
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.d.ts +30 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.js +70 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/stop-details.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/stop-details.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/stop-details.js +7 -3
- package/node_modules/@earendil-works/pi-ai/dist/utils/stop-details.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-call-id.d.ts +9 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-call-id.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-call-id.js +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-call-id.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +35 -3
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +6 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +32 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +15 -7
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +8 -8
- package/dist/cli/neo/build-argv.d.ts +0 -19
- package/dist/cli/neo/build-argv.d.ts.map +0 -1
- package/dist/cli/neo/build-argv.js +0 -84
- package/dist/cli/neo/build-argv.js.map +0 -1
- package/dist/cli/neo/daemon-launch.d.ts +0 -25
- package/dist/cli/neo/daemon-launch.d.ts.map +0 -1
- package/dist/cli/neo/daemon-launch.js +0 -97
- package/dist/cli/neo/daemon-launch.js.map +0 -1
- package/dist/cli/neo/gate.d.ts +0 -15
- package/dist/cli/neo/gate.d.ts.map +0 -1
- package/dist/cli/neo/gate.js +0 -21
- package/dist/cli/neo/gate.js.map +0 -1
- package/dist/cli/neo/launch.d.ts +0 -24
- package/dist/cli/neo/launch.d.ts.map +0 -1
- package/dist/cli/neo/launch.js +0 -66
- package/dist/cli/neo/launch.js.map +0 -1
- package/dist/cli/neo/platform.d.ts +0 -38
- package/dist/cli/neo/platform.d.ts.map +0 -1
- package/dist/cli/neo/platform.js +0 -54
- package/dist/cli/neo/platform.js.map +0 -1
- package/dist/cli/neo/resolve-binary.d.ts +0 -39
- package/dist/cli/neo/resolve-binary.d.ts.map +0 -1
- package/dist/cli/neo/resolve-binary.js +0 -66
- package/dist/cli/neo/resolve-binary.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/index.d.ts +0 -5
- package/dist/core/extensions/builtin/session-observer/index.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/index.js +0 -36
- package/dist/core/extensions/builtin/session-observer/index.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/loader.d.ts +0 -3
- package/dist/core/extensions/builtin/session-observer/loader.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/loader.js +0 -20
- package/dist/core/extensions/builtin/session-observer/loader.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/overlay-format.d.ts +0 -7
- package/dist/core/extensions/builtin/session-observer/overlay-format.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/overlay-format.js +0 -30
- package/dist/core/extensions/builtin/session-observer/overlay-format.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/overlay.d.ts +0 -51
- package/dist/core/extensions/builtin/session-observer/overlay.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/overlay.js +0 -229
- package/dist/core/extensions/builtin/session-observer/overlay.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/scanner.d.ts +0 -10
- package/dist/core/extensions/builtin/session-observer/scanner.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/scanner.js +0 -142
- package/dist/core/extensions/builtin/session-observer/scanner.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/text.d.ts +0 -7
- package/dist/core/extensions/builtin/session-observer/text.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/text.js +0 -37
- package/dist/core/extensions/builtin/session-observer/text.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/transcript-entries.d.ts +0 -7
- package/dist/core/extensions/builtin/session-observer/transcript-entries.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/transcript-entries.js +0 -71
- package/dist/core/extensions/builtin/session-observer/transcript-entries.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/transcript-format.d.ts +0 -11
- package/dist/core/extensions/builtin/session-observer/transcript-format.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/transcript-format.js +0 -65
- package/dist/core/extensions/builtin/session-observer/transcript-format.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/transcript.d.ts +0 -4
- package/dist/core/extensions/builtin/session-observer/transcript.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/transcript.js +0 -81
- package/dist/core/extensions/builtin/session-observer/transcript.js.map +0 -1
- package/dist/core/extensions/builtin/session-observer/types.d.ts +0 -33
- package/dist/core/extensions/builtin/session-observer/types.d.ts.map +0 -1
- package/dist/core/extensions/builtin/session-observer/types.js +0 -2
- package/dist/core/extensions/builtin/session-observer/types.js.map +0 -1
- package/dist/modes/rpc/neo-daemon-child-worker.d.ts +0 -29
- package/dist/modes/rpc/neo-daemon-child-worker.d.ts.map +0 -1
- package/dist/modes/rpc/neo-daemon-child-worker.js +0 -95
- package/dist/modes/rpc/neo-daemon-child-worker.js.map +0 -1
- package/dist/modes/rpc/neo-daemon-mode.d.ts +0 -110
- package/dist/modes/rpc/neo-daemon-mode.d.ts.map +0 -1
- package/dist/modes/rpc/neo-daemon-mode.js +0 -267
- package/dist/modes/rpc/neo-daemon-mode.js.map +0 -1
- package/dist/modes/rpc/neo-daemon-protocol.d.ts +0 -50
- package/dist/modes/rpc/neo-daemon-protocol.d.ts.map +0 -1
- package/dist/modes/rpc/neo-daemon-protocol.js +0 -66
- package/dist/modes/rpc/neo-daemon-protocol.js.map +0 -1
- package/dist/modes/rpc/neo-daemon-registry.d.ts +0 -98
- package/dist/modes/rpc/neo-daemon-registry.d.ts.map +0 -1
- package/dist/modes/rpc/neo-daemon-registry.js +0 -209
- package/dist/modes/rpc/neo-daemon-registry.js.map +0 -1
- package/dist/modes/rpc/neo-runtime-options-argv.d.ts +0 -17
- package/dist/modes/rpc/neo-runtime-options-argv.d.ts.map +0 -1
- package/dist/modes/rpc/neo-runtime-options-argv.js +0 -79
- package/dist/modes/rpc/neo-runtime-options-argv.js.map +0 -1
- package/dist/modes/rpc/neo-runtime-options.d.ts +0 -84
- package/dist/modes/rpc/neo-runtime-options.d.ts.map +0 -1
- package/dist/modes/rpc/neo-runtime-options.js +0 -92
- package/dist/modes/rpc/neo-runtime-options.js.map +0 -1
- package/docs/neo.md +0 -111
- package/node_modules/@code-yeongyu/senpi-codemode/src/codemode/runtime.ts +0 -258
- package/node_modules/@code-yeongyu/senpi-codemode/src/codemode/tools.ts +0 -106
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Anthropic from "@anthropic-ai/sdk";
|
|
2
2
|
import { calculateCost } from "../models.js";
|
|
3
3
|
import { isVideoMimeType } from "../types.js";
|
|
4
|
+
import { combineAbortSignals } from "../utils/abort-signals.js";
|
|
4
5
|
import { splitDeferredTools } from "../utils/deferred-tools.js";
|
|
5
6
|
import { AssistantMessageEventStream } from "../utils/event-stream.js";
|
|
6
7
|
import { headersToRecord, providerHeadersToRecord } from "../utils/headers.js";
|
|
@@ -8,6 +9,8 @@ import { parseJsonWithRepair, parseStreamingJson } from "../utils/json-parse.js"
|
|
|
8
9
|
import { getProviderEnvValue } from "../utils/provider-env.js";
|
|
9
10
|
import { retryProviderRequest } from "../utils/provider-retry.js";
|
|
10
11
|
import { sanitizeSurrogates } from "../utils/sanitize-unicode.js";
|
|
12
|
+
import { applyServerFallbackAbort, parseServerFallbackReceipt, parseStickyFallbackReceipt, } from "../utils/server-fallback-receipt.js";
|
|
13
|
+
import { normalizeToolCallId } from "../utils/tool-call-id.js";
|
|
11
14
|
import { isForcedToolChoiceUnsupportedError, omitToolChoiceParam } from "../utils/tool-choice-fallback.js";
|
|
12
15
|
import { resolveCloudflareBaseUrl } from "./cloudflare.js";
|
|
13
16
|
import { resolveJsonSchemaStrictSampling } from "./constrained-sampling.js";
|
|
@@ -136,7 +139,35 @@ const FINE_GRAINED_TOOL_STREAMING_BETA = "fine-grained-tool-streaming-2025-05-14
|
|
|
136
139
|
const INTERLEAVED_THINKING_BETA = "interleaved-thinking-2025-05-14";
|
|
137
140
|
const COMPUTER_USE_BETA_PREFIX = "computer-use-";
|
|
138
141
|
const NATIVE_COMPUTER_TOOL_TYPE = "computer_20250124";
|
|
139
|
-
const ADAPTIVE_THINKING_MODEL_MARKERS = [
|
|
142
|
+
const ADAPTIVE_THINKING_MODEL_MARKERS = [
|
|
143
|
+
"opus-4-6",
|
|
144
|
+
"opus-4-7",
|
|
145
|
+
"opus-4-8",
|
|
146
|
+
"opus-5",
|
|
147
|
+
"sonnet-4-6",
|
|
148
|
+
"sonnet-5",
|
|
149
|
+
"fable-5",
|
|
150
|
+
"mythos-5",
|
|
151
|
+
];
|
|
152
|
+
/**
|
|
153
|
+
* Adaptive families that expose the real `xhigh` effort tier. Everything else on the
|
|
154
|
+
* adaptive ladder tops out at `max` (Opus/Sonnet 4.6 are four-tier: low/medium/high/max).
|
|
155
|
+
*/
|
|
156
|
+
const NATIVE_XHIGH_EFFORT_MODEL_MARKERS = [
|
|
157
|
+
"opus-4-7",
|
|
158
|
+
"opus-4-8",
|
|
159
|
+
"opus-5",
|
|
160
|
+
"sonnet-5",
|
|
161
|
+
"fable-5",
|
|
162
|
+
"mythos-5",
|
|
163
|
+
];
|
|
164
|
+
/**
|
|
165
|
+
* Adaptive families that reject `thinking: {type: "disabled"}` outright (verified 400:
|
|
166
|
+
* `"thinking.type.disabled" is not supported for this model`). The generated catalog also encodes
|
|
167
|
+
* this as `compat.supportsDisabledThinking: false`, but `models.json` entries and third-party
|
|
168
|
+
* gateway rows carry no generated compat, so the family fact has to live here as well.
|
|
169
|
+
*/
|
|
170
|
+
const DISABLED_THINKING_REJECTING_MODEL_MARKERS = ["fable-5", "mythos-5"];
|
|
140
171
|
const CLAUDE_FABLE_OR_MYTHOS_MODEL_ID = /^claude-(?:fable|mythos)(?:-|$)/i;
|
|
141
172
|
const UNSUPPORTED_NATIVE_COMPUTER_TOOL_MODEL_MARKERS = [
|
|
142
173
|
"opus-4-6",
|
|
@@ -279,6 +310,97 @@ function isAnthropicWebSearchReplayBlock(raw) {
|
|
|
279
310
|
return true;
|
|
280
311
|
return raw.type === "server_tool_use" && raw.name === "web_search";
|
|
281
312
|
}
|
|
313
|
+
// The user turn a pending server tool can survive is one that carries only
|
|
314
|
+
// tool results. Anything else the wire would emit — real text, an image —
|
|
315
|
+
// closes the assistant turn (the API then 400s the still-open use). A blank
|
|
316
|
+
// message serializes to nothing, so it closes nothing.
|
|
317
|
+
function userMessageClosesServerTurn(message) {
|
|
318
|
+
if (typeof message.content === "string")
|
|
319
|
+
return message.content.trim().length > 0;
|
|
320
|
+
return message.content.some((block) => (block.type === "text" && block.text.trim().length > 0) || block.type === "image");
|
|
321
|
+
}
|
|
322
|
+
function collectProviderNativeToolPairing(messages, model, deferredToolNames, normalizeToolName, discardedFallbackToolCallIds) {
|
|
323
|
+
const resolvedUseIds = new Set();
|
|
324
|
+
const validResultIds = new Set();
|
|
325
|
+
// Uses whose turn can still be resumed. A same-model assistant resets the
|
|
326
|
+
// set: its own result blocks may answer the prior pending uses, and any use
|
|
327
|
+
// it leaves pending becomes the open set. Anything that closes the turn —
|
|
328
|
+
// user text, a tool result whose deferred-tool references serialize sibling
|
|
329
|
+
// text after the results, or another model's assistant — empties it.
|
|
330
|
+
let pendingUseIds = new Set();
|
|
331
|
+
const loadedReferenceNames = new Set();
|
|
332
|
+
for (const message of messages) {
|
|
333
|
+
if (message.role === "assistant") {
|
|
334
|
+
const priorUseIds = pendingUseIds;
|
|
335
|
+
pendingUseIds = new Set();
|
|
336
|
+
if (!isSameAnthropicModel(message, model))
|
|
337
|
+
continue;
|
|
338
|
+
for (const block of message.content) {
|
|
339
|
+
if (block.type !== "providerNative" || !isRecord(block.raw))
|
|
340
|
+
continue;
|
|
341
|
+
const raw = block.raw;
|
|
342
|
+
if (typeof raw.type !== "string" || !REPLAYABLE_ANTHROPIC_PROVIDER_NATIVE_TYPES.has(raw.type))
|
|
343
|
+
continue;
|
|
344
|
+
if (isProviderNativeToolUseBlock(raw) && typeof raw.id === "string")
|
|
345
|
+
pendingUseIds.add(raw.id);
|
|
346
|
+
}
|
|
347
|
+
for (const block of message.content) {
|
|
348
|
+
if (block.type !== "providerNative" || !isRecord(block.raw))
|
|
349
|
+
continue;
|
|
350
|
+
const raw = block.raw;
|
|
351
|
+
if (typeof raw.type !== "string" || !REPLAYABLE_ANTHROPIC_PROVIDER_NATIVE_TYPES.has(raw.type))
|
|
352
|
+
continue;
|
|
353
|
+
const toolUseId = raw.tool_use_id;
|
|
354
|
+
if (typeof toolUseId !== "string")
|
|
355
|
+
continue;
|
|
356
|
+
if (priorUseIds.has(toolUseId) || pendingUseIds.has(toolUseId)) {
|
|
357
|
+
resolvedUseIds.add(toolUseId);
|
|
358
|
+
validResultIds.add(toolUseId);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
if (message.role === "toolResult") {
|
|
364
|
+
// Conversion drops a discarded pre-fallback result without touching
|
|
365
|
+
// loadedToolNames, so it must not load the name here either.
|
|
366
|
+
if (discardedFallbackToolCallIds.has(message.toolCallId))
|
|
367
|
+
continue;
|
|
368
|
+
// convertToolResult emits sibling text after the tool_result blocks only
|
|
369
|
+
// for names that survive the deferred/loaded filter, so only those names
|
|
370
|
+
// close the turn; a stale or already-loaded name leaves the result plain
|
|
371
|
+
// and the pending use resumable.
|
|
372
|
+
let emitsReferences = false;
|
|
373
|
+
for (const name of message.addedToolNames ?? []) {
|
|
374
|
+
const normalizedName = normalizeToolName(name);
|
|
375
|
+
if (!deferredToolNames.has(normalizedName) || loadedReferenceNames.has(normalizedName))
|
|
376
|
+
continue;
|
|
377
|
+
loadedReferenceNames.add(normalizedName);
|
|
378
|
+
emitsReferences = true;
|
|
379
|
+
}
|
|
380
|
+
if (emitsReferences)
|
|
381
|
+
pendingUseIds = new Set();
|
|
382
|
+
continue;
|
|
383
|
+
}
|
|
384
|
+
if (message.role === "user" && userMessageClosesServerTurn(message)) {
|
|
385
|
+
pendingUseIds = new Set();
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
// Whatever is still pending at the end of history belongs to the last
|
|
389
|
+
// assistant message and can still resume, so it is live rather than unpaired.
|
|
390
|
+
return { resolvedUseIds, liveUseIds: pendingUseIds, validResultIds };
|
|
391
|
+
}
|
|
392
|
+
// True for a server-tool block whose counterpart can never arrive: a use that
|
|
393
|
+
// is neither answered nor resumable, or a result whose use is nowhere.
|
|
394
|
+
// Blocks that pair nothing (`fallback`, `container_upload`) are never unpaired.
|
|
395
|
+
function isUnpairedProviderNativeToolBlock(raw, pairing) {
|
|
396
|
+
if (!isRecord(raw))
|
|
397
|
+
return false;
|
|
398
|
+
if (isProviderNativeToolUseBlock(raw)) {
|
|
399
|
+
return typeof raw.id !== "string" || !(pairing.resolvedUseIds.has(raw.id) || pairing.liveUseIds.has(raw.id));
|
|
400
|
+
}
|
|
401
|
+
const toolUseId = raw.tool_use_id;
|
|
402
|
+
return typeof toolUseId === "string" && !pairing.validResultIds.has(toolUseId);
|
|
403
|
+
}
|
|
282
404
|
// tool_use ids referenced by server-tool result blocks in content[0, boundary).
|
|
283
405
|
// A pre-boundary `server_tool_use` whose id is absent here is unpaired — the
|
|
284
406
|
// fallback interrupted the declined attempt before its result arrived — so
|
|
@@ -652,6 +774,10 @@ export const stream = (model, context, options) => {
|
|
|
652
774
|
stopReason: "stop",
|
|
653
775
|
timestamp: Date.now(),
|
|
654
776
|
};
|
|
777
|
+
const serverFallbackAbort = new AbortController();
|
|
778
|
+
let serverFallbackReceipt;
|
|
779
|
+
const combinedAbort = combineAbortSignals([options?.signal, serverFallbackAbort.signal]);
|
|
780
|
+
const requestSignal = combinedAbort.signal;
|
|
655
781
|
try {
|
|
656
782
|
let client;
|
|
657
783
|
let isOAuth;
|
|
@@ -694,7 +820,7 @@ export const stream = (model, context, options) => {
|
|
|
694
820
|
const payloadRequestMetadata = extractPayloadRequestMetadata(params);
|
|
695
821
|
params = payloadRequestMetadata.params;
|
|
696
822
|
const requestOptions = {
|
|
697
|
-
...(
|
|
823
|
+
...(requestSignal ? { signal: requestSignal } : {}),
|
|
698
824
|
...(options?.timeoutMs !== undefined ? { timeout: options.timeoutMs } : {}),
|
|
699
825
|
maxRetries: 0,
|
|
700
826
|
...(payloadRequestMetadata.headers ? { headers: payloadRequestMetadata.headers } : {}),
|
|
@@ -714,7 +840,7 @@ export const stream = (model, context, options) => {
|
|
|
714
840
|
throw error;
|
|
715
841
|
}
|
|
716
842
|
};
|
|
717
|
-
const { response } = await retryProviderRequest(async () => {
|
|
843
|
+
const { params: sentParams, response } = await retryProviderRequest(async () => {
|
|
718
844
|
try {
|
|
719
845
|
return await createRequest();
|
|
720
846
|
}
|
|
@@ -730,12 +856,12 @@ export const stream = (model, context, options) => {
|
|
|
730
856
|
}, {
|
|
731
857
|
maxRetries: options?.maxRetries,
|
|
732
858
|
maxRetryDelayMs: options?.maxRetryDelayMs,
|
|
733
|
-
signal:
|
|
859
|
+
signal: requestSignal,
|
|
734
860
|
});
|
|
735
861
|
await options?.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model);
|
|
736
862
|
stream.push({ type: "start", partial: output });
|
|
737
863
|
const blocks = output.content;
|
|
738
|
-
for await (const event of iterateAnthropicEvents(response,
|
|
864
|
+
for await (const event of iterateAnthropicEvents(response, requestSignal)) {
|
|
739
865
|
if (event.type === "message_start") {
|
|
740
866
|
output.responseId = event.message.id;
|
|
741
867
|
// Capture initial token usage from message_start event
|
|
@@ -749,8 +875,24 @@ export const stream = (model, context, options) => {
|
|
|
749
875
|
output.usage.totalTokens =
|
|
750
876
|
output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite;
|
|
751
877
|
calculateCost(model, output.usage);
|
|
878
|
+
const stickyReceipt = options?.abortServerSideFallback === true
|
|
879
|
+
? parseStickyFallbackReceipt(event.message.usage, sentParams.model, event.message.model)
|
|
880
|
+
: undefined;
|
|
881
|
+
if (stickyReceipt !== undefined) {
|
|
882
|
+
serverFallbackReceipt = stickyReceipt;
|
|
883
|
+
serverFallbackAbort.abort();
|
|
884
|
+
break;
|
|
885
|
+
}
|
|
752
886
|
}
|
|
753
887
|
else if (event.type === "content_block_start") {
|
|
888
|
+
const receipt = options?.abortServerSideFallback === true
|
|
889
|
+
? parseServerFallbackReceipt(event.content_block)
|
|
890
|
+
: undefined;
|
|
891
|
+
if (receipt !== undefined) {
|
|
892
|
+
serverFallbackReceipt = receipt;
|
|
893
|
+
serverFallbackAbort.abort();
|
|
894
|
+
break;
|
|
895
|
+
}
|
|
754
896
|
if (event.content_block.type === "text") {
|
|
755
897
|
const block = {
|
|
756
898
|
type: "text",
|
|
@@ -948,13 +1090,18 @@ export const stream = (model, context, options) => {
|
|
|
948
1090
|
if (options?.signal?.aborted) {
|
|
949
1091
|
throw new Error("Request was aborted");
|
|
950
1092
|
}
|
|
1093
|
+
if (serverFallbackReceipt !== undefined) {
|
|
1094
|
+
applyServerFallbackAbort(output, serverFallbackReceipt);
|
|
1095
|
+
}
|
|
951
1096
|
if (output.stopReason === "aborted" || output.stopReason === "error") {
|
|
952
1097
|
throw new Error(output.errorMessage || "An unknown error occurred");
|
|
953
1098
|
}
|
|
1099
|
+
combinedAbort.cleanup();
|
|
954
1100
|
stream.push({ type: "done", reason: output.stopReason, message: output });
|
|
955
1101
|
stream.end();
|
|
956
1102
|
}
|
|
957
1103
|
catch (error) {
|
|
1104
|
+
combinedAbort.cleanup();
|
|
958
1105
|
for (const block of output.content) {
|
|
959
1106
|
delete block.index;
|
|
960
1107
|
// An aborted stream never reaches content_block_stop; keep whatever
|
|
@@ -989,11 +1136,28 @@ function matchesModelMarker(model, markers) {
|
|
|
989
1136
|
const candidates = getModelMatchCandidates(model);
|
|
990
1137
|
return candidates.some((candidate) => markers.some((marker) => candidate.includes(marker)));
|
|
991
1138
|
}
|
|
992
|
-
function
|
|
993
|
-
return matchesModelMarker(model,
|
|
1139
|
+
function supportsNativeXhighEffort(model) {
|
|
1140
|
+
return matchesModelMarker(model, NATIVE_XHIGH_EFFORT_MODEL_MARKERS);
|
|
1141
|
+
}
|
|
1142
|
+
/** True when the model cannot accept `thinking: {type: "disabled"}` on the wire. */
|
|
1143
|
+
function cannotDisableThinking(model, compat) {
|
|
1144
|
+
if (!compat.supportsDisabledThinking)
|
|
1145
|
+
return true;
|
|
1146
|
+
if (model.thinkingLevelMap?.off === null)
|
|
1147
|
+
return true;
|
|
1148
|
+
return matchesModelMarker(model, DISABLED_THINKING_REJECTING_MODEL_MARKERS);
|
|
994
1149
|
}
|
|
995
|
-
function
|
|
996
|
-
|
|
1150
|
+
function disableThinkingForRequest(params, model, compat) {
|
|
1151
|
+
// A degraded/disabled turn must not retain the caller's higher effort.
|
|
1152
|
+
delete params.output_config;
|
|
1153
|
+
if (cannotDisableThinking(model, compat)) {
|
|
1154
|
+
delete params.thinking;
|
|
1155
|
+
if (supportsAdaptiveThinking(model)) {
|
|
1156
|
+
params.output_config = { effort: "low" };
|
|
1157
|
+
}
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1160
|
+
params.thinking = { type: "disabled" };
|
|
997
1161
|
}
|
|
998
1162
|
function supportsAdaptiveThinking(model) {
|
|
999
1163
|
if (model.compat?.forceAdaptiveThinking !== undefined) {
|
|
@@ -1004,7 +1168,7 @@ function supportsAdaptiveThinking(model) {
|
|
|
1004
1168
|
/**
|
|
1005
1169
|
* Map ThinkingLevel to Anthropic effort levels for adaptive thinking.
|
|
1006
1170
|
* Note: effort "max" is available on all adaptive-thinking Claude models, while native
|
|
1007
|
-
* "xhigh" is only available on Opus 4.7/4.8, Sonnet 5, and Fable 5.
|
|
1171
|
+
* "xhigh" is only available on Opus 4.7/4.8, Opus 5, Sonnet 5, and Fable 5.
|
|
1008
1172
|
*/
|
|
1009
1173
|
function mapThinkingLevelToEffort(model, level) {
|
|
1010
1174
|
const mapped = level ? model.thinkingLevelMap?.[level] : undefined;
|
|
@@ -1019,15 +1183,11 @@ function mapThinkingLevelToEffort(model, level) {
|
|
|
1019
1183
|
case "high":
|
|
1020
1184
|
return "high";
|
|
1021
1185
|
case "xhigh":
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
return "max";
|
|
1026
|
-
return "high";
|
|
1186
|
+
// Only called for adaptive models, so the floor is the adaptive ladder's top
|
|
1187
|
+
// tier (`max`), never `high` — degrading xhigh to high silently under-thinks.
|
|
1188
|
+
return supportsNativeXhighEffort(model) ? "xhigh" : "max";
|
|
1027
1189
|
case "max":
|
|
1028
|
-
|
|
1029
|
-
return "max";
|
|
1030
|
-
return "high";
|
|
1190
|
+
return "max";
|
|
1031
1191
|
default:
|
|
1032
1192
|
return "high";
|
|
1033
1193
|
}
|
|
@@ -1231,12 +1391,19 @@ function buildParams(model, context, isOAuthToken, options, unsignedThinkingRepl
|
|
|
1231
1391
|
};
|
|
1232
1392
|
}
|
|
1233
1393
|
}
|
|
1234
|
-
else if (options?.thinkingEnabled === false
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1394
|
+
else if (options?.thinkingEnabled === false) {
|
|
1395
|
+
// Some adaptive families reject `thinking.type: "disabled"` and default
|
|
1396
|
+
// to reasoning when omitted. Keep their request valid at the cheapest
|
|
1397
|
+
// legal effort; use an explicit disabled block everywhere else.
|
|
1398
|
+
disableThinkingForRequest(params, model, compat);
|
|
1238
1399
|
}
|
|
1239
1400
|
}
|
|
1401
|
+
// Anthropic rejects a thinking-enabled request whose final assistant turn
|
|
1402
|
+
// contains tool_use but does not begin with a thinking block. Cross-model
|
|
1403
|
+
// histories lose their signed thinking blocks (demoted to text or dropped),
|
|
1404
|
+
// so degrade thinking for this request instead of failing every turn.
|
|
1405
|
+
if (params.thinking && params.thinking.type !== "disabled" && finalAssistantTurnStartsWithToolUse(params.messages))
|
|
1406
|
+
disableThinkingForRequest(params, model, compat);
|
|
1240
1407
|
if (options?.metadata) {
|
|
1241
1408
|
const userId = options.metadata.user_id;
|
|
1242
1409
|
if (typeof userId === "string") {
|
|
@@ -1266,9 +1433,24 @@ function applyExtraBodyToAnthropicParams(params, extraBody) {
|
|
|
1266
1433
|
Object.defineProperty(params, key, { value, writable: true, enumerable: true, configurable: true });
|
|
1267
1434
|
}
|
|
1268
1435
|
}
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1436
|
+
/**
|
|
1437
|
+
* Whether the final assistant turn contains tool_use without a leading
|
|
1438
|
+
* thinking/redacted_thinking block. Anthropic requires thinking-enabled
|
|
1439
|
+
* requests to start that turn with a thinking block.
|
|
1440
|
+
*/
|
|
1441
|
+
function finalAssistantTurnStartsWithToolUse(messages) {
|
|
1442
|
+
for (let index = messages.length - 1; index >= 0; index--) {
|
|
1443
|
+
const message = messages[index];
|
|
1444
|
+
if (message.role !== "assistant")
|
|
1445
|
+
continue;
|
|
1446
|
+
if (!Array.isArray(message.content) || message.content.length === 0)
|
|
1447
|
+
return false;
|
|
1448
|
+
const first = message.content[0];
|
|
1449
|
+
if (first.type === "thinking" || first.type === "redacted_thinking")
|
|
1450
|
+
return false;
|
|
1451
|
+
return message.content.some((block) => block.type === "tool_use");
|
|
1452
|
+
}
|
|
1453
|
+
return false;
|
|
1272
1454
|
}
|
|
1273
1455
|
function convertToolResult(msg, isOAuthToken, deferredToolNames, loadedToolNames, normalizeToolName) {
|
|
1274
1456
|
const references = [];
|
|
@@ -1307,6 +1489,7 @@ function convertMessages(transformedMessages, model, isOAuthToken, cacheControl,
|
|
|
1307
1489
|
// assistant turn below; drop their tool_results in lockstep so none dangle.
|
|
1308
1490
|
const discardedFallbackToolCallIds = collectDiscardedFallbackToolCallIds(transformedMessages, model);
|
|
1309
1491
|
const rejectsNativeWebSearchReplay = !getAnthropicCompat(model).supportsWebSearch;
|
|
1492
|
+
const providerNativeToolPairing = collectProviderNativeToolPairing(transformedMessages, model, deferredToolNames, normalizeToolName, discardedFallbackToolCallIds);
|
|
1310
1493
|
for (let i = 0; i < transformedMessages.length; i++) {
|
|
1311
1494
|
const msg = transformedMessages[i];
|
|
1312
1495
|
if (msg.role === "user") {
|
|
@@ -1440,7 +1623,8 @@ function convertMessages(transformedMessages, model, isOAuthToken, cacheControl,
|
|
|
1440
1623
|
else if (block.type === "providerNative") {
|
|
1441
1624
|
if (isSameModel &&
|
|
1442
1625
|
isReplayableAnthropicProviderNativeBlock(block.raw) &&
|
|
1443
|
-
!(rejectsNativeWebSearchReplay && isAnthropicWebSearchReplayBlock(block.raw))
|
|
1626
|
+
!(rejectsNativeWebSearchReplay && isAnthropicWebSearchReplayBlock(block.raw)) &&
|
|
1627
|
+
!isUnpairedProviderNativeToolBlock(block.raw, providerNativeToolPairing)) {
|
|
1444
1628
|
blocks.push(block.raw);
|
|
1445
1629
|
}
|
|
1446
1630
|
}
|