open-multi-agent-kit 0.80.7 → 0.90.0
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 +5 -27
- package/README.md +81 -38
- package/dist/agents/jailbreak/index.d.ts +7 -0
- package/dist/agents/jailbreak/index.d.ts.map +1 -0
- package/dist/agents/jailbreak/index.js +7 -0
- package/dist/agents/jailbreak/index.js.map +1 -0
- package/dist/agents/jailbreak/subagent-f.d.ts +44 -0
- package/dist/agents/jailbreak/subagent-f.d.ts.map +1 -0
- package/dist/agents/jailbreak/subagent-f.js +60 -0
- package/dist/agents/jailbreak/subagent-f.js.map +1 -0
- package/dist/bun/register-bedrock.d.ts.map +1 -1
- package/dist/bun/register-bedrock.js +2 -2
- package/dist/bun/register-bedrock.js.map +1 -1
- package/dist/ci/verify-reporter.d.ts +22 -0
- package/dist/ci/verify-reporter.d.ts.map +1 -0
- package/dist/ci/verify-reporter.js +50 -0
- package/dist/ci/verify-reporter.js.map +1 -0
- package/dist/cli/args.d.ts +4 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +8 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/file-processor.d.ts +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/initial-message.d.ts +1 -1
- package/dist/cli/initial-message.d.ts.map +1 -1
- package/dist/cli/initial-message.js.map +1 -1
- package/dist/cli/jailbreak-args.d.ts +26 -0
- package/dist/cli/jailbreak-args.d.ts.map +1 -0
- package/dist/cli/jailbreak-args.js +86 -0
- package/dist/cli/jailbreak-args.js.map +1 -0
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +1 -1
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +1 -1
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/commands/doctor-provider.d.ts +19 -0
- package/dist/commands/doctor-provider.d.ts.map +1 -0
- package/dist/commands/doctor-provider.js +123 -0
- package/dist/commands/doctor-provider.js.map +1 -0
- package/dist/commands/jailbreak.d.ts +49 -0
- package/dist/commands/jailbreak.d.ts.map +1 -0
- package/dist/commands/jailbreak.js +201 -0
- package/dist/commands/jailbreak.js.map +1 -0
- package/dist/config.d.ts +9 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +33 -52
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +2 -2
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +16 -27
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +185 -89
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +3 -6
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +7 -7
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/automation/index.d.ts +359 -0
- package/dist/core/automation/index.d.ts.map +1 -0
- package/dist/core/automation/index.js +665 -0
- package/dist/core/automation/index.js.map +1 -0
- package/dist/core/bash-executor.d.ts +1 -0
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +1 -0
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/browser-use.d.ts +53 -0
- package/dist/core/browser-use.d.ts.map +1 -0
- package/dist/core/browser-use.js +108 -0
- package/dist/core/browser-use.js.map +1 -0
- package/dist/core/command-safety-parser.d.ts +77 -0
- package/dist/core/command-safety-parser.d.ts.map +1 -0
- package/dist/core/command-safety-parser.js +763 -0
- package/dist/core/command-safety-parser.js.map +1 -0
- package/dist/core/command-safety.d.ts.map +1 -1
- package/dist/core/command-safety.js +106 -3
- package/dist/core/command-safety.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +2 -2
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +5 -21
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +3 -101
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +21 -656
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +2 -2
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/compactor.d.ts +42 -0
- package/dist/core/compactor.d.ts.map +1 -0
- package/dist/core/compactor.js +131 -0
- package/dist/core/compactor.js.map +1 -0
- package/dist/core/context-budget-compressors.d.ts +50 -0
- package/dist/core/context-budget-compressors.d.ts.map +1 -0
- package/dist/core/context-budget-compressors.js +166 -0
- package/dist/core/context-budget-compressors.js.map +1 -0
- package/dist/core/context-budget-governor-v2.d.ts +7 -0
- package/dist/core/context-budget-governor-v2.d.ts.map +1 -0
- package/dist/core/context-budget-governor-v2.js +7 -0
- package/dist/core/context-budget-governor-v2.js.map +1 -0
- package/dist/core/context-budget-governor.d.ts +67 -0
- package/dist/core/context-budget-governor.d.ts.map +1 -0
- package/dist/core/context-budget-governor.js +224 -0
- package/dist/core/context-budget-governor.js.map +1 -0
- package/dist/core/context-budget-headroom-candidates.d.ts +3 -0
- package/dist/core/context-budget-headroom-candidates.d.ts.map +1 -0
- package/dist/core/context-budget-headroom-candidates.js +85 -0
- package/dist/core/context-budget-headroom-candidates.js.map +1 -0
- package/dist/core/context-budget-headroom-types.d.ts +67 -0
- package/dist/core/context-budget-headroom-types.d.ts.map +1 -0
- package/dist/core/context-budget-headroom-types.js +46 -0
- package/dist/core/context-budget-headroom-types.js.map +1 -0
- package/dist/core/context-budget-headroom.d.ts +5 -0
- package/dist/core/context-budget-headroom.d.ts.map +1 -0
- package/dist/core/context-budget-headroom.js +123 -0
- package/dist/core/context-budget-headroom.js.map +1 -0
- package/dist/core/context-budget-relevance.d.ts +46 -0
- package/dist/core/context-budget-relevance.d.ts.map +1 -0
- package/dist/core/context-budget-relevance.js +329 -0
- package/dist/core/context-budget-relevance.js.map +1 -0
- package/dist/core/context-budget-system-prompt-items.d.ts +19 -0
- package/dist/core/context-budget-system-prompt-items.d.ts.map +1 -0
- package/dist/core/context-budget-system-prompt-items.js +143 -0
- package/dist/core/context-budget-system-prompt-items.js.map +1 -0
- package/dist/core/context-budget-system-prompt.d.ts +31 -0
- package/dist/core/context-budget-system-prompt.d.ts.map +1 -0
- package/dist/core/context-budget-system-prompt.js +87 -0
- package/dist/core/context-budget-system-prompt.js.map +1 -0
- package/dist/core/context-budget-token-counter.d.ts +34 -0
- package/dist/core/context-budget-token-counter.d.ts.map +1 -0
- package/dist/core/context-budget-token-counter.js +315 -0
- package/dist/core/context-budget-token-counter.js.map +1 -0
- package/dist/core/context-budget-v2-coverage.d.ts +5 -0
- package/dist/core/context-budget-v2-coverage.d.ts.map +1 -0
- package/dist/core/context-budget-v2-coverage.js +58 -0
- package/dist/core/context-budget-v2-coverage.js.map +1 -0
- package/dist/core/context-budget-v2-plan-hash.d.ts +12 -0
- package/dist/core/context-budget-v2-plan-hash.d.ts.map +1 -0
- package/dist/core/context-budget-v2-plan-hash.js +38 -0
- package/dist/core/context-budget-v2-plan-hash.js.map +1 -0
- package/dist/core/context-budget-v2-planner.d.ts +3 -0
- package/dist/core/context-budget-v2-planner.d.ts.map +1 -0
- package/dist/core/context-budget-v2-planner.js +143 -0
- package/dist/core/context-budget-v2-planner.js.map +1 -0
- package/dist/core/context-budget-v2-scoring.d.ts +14 -0
- package/dist/core/context-budget-v2-scoring.d.ts.map +1 -0
- package/dist/core/context-budget-v2-scoring.js +114 -0
- package/dist/core/context-budget-v2-scoring.js.map +1 -0
- package/dist/core/context-budget-v2-selection.d.ts +32 -0
- package/dist/core/context-budget-v2-selection.d.ts.map +1 -0
- package/dist/core/context-budget-v2-selection.js +158 -0
- package/dist/core/context-budget-v2-selection.js.map +1 -0
- package/dist/core/context-budget-v2-tiers.d.ts +15 -0
- package/dist/core/context-budget-v2-tiers.d.ts.map +1 -0
- package/dist/core/context-budget-v2-tiers.js +68 -0
- package/dist/core/context-budget-v2-tiers.js.map +1 -0
- package/dist/core/context-budget-v2-types.d.ts +92 -0
- package/dist/core/context-budget-v2-types.d.ts.map +1 -0
- package/dist/core/context-budget-v2-types.js +24 -0
- package/dist/core/context-budget-v2-types.js.map +1 -0
- package/dist/core/defaults.d.ts +1 -1
- package/dist/core/defaults.d.ts.map +1 -1
- package/dist/core/defaults.js.map +1 -1
- package/dist/core/diagnostics.d.ts +6 -0
- package/dist/core/diagnostics.d.ts.map +1 -1
- package/dist/core/diagnostics.js.map +1 -1
- package/dist/core/domain-confidence.d.ts +9 -0
- package/dist/core/domain-confidence.d.ts.map +1 -0
- package/dist/core/domain-confidence.js +39 -0
- package/dist/core/domain-confidence.js.map +1 -0
- package/dist/core/domain-dispatch.d.ts +44 -0
- package/dist/core/domain-dispatch.d.ts.map +1 -0
- package/dist/core/domain-dispatch.js +118 -0
- package/dist/core/domain-dispatch.js.map +1 -0
- package/dist/core/domain-loadouts.d.ts +76 -0
- package/dist/core/domain-loadouts.d.ts.map +1 -0
- package/dist/core/domain-loadouts.js +981 -0
- package/dist/core/domain-loadouts.js.map +1 -0
- package/dist/core/domain-registry.d.ts +7 -0
- package/dist/core/domain-registry.d.ts.map +1 -0
- package/dist/core/domain-registry.js +11 -0
- package/dist/core/domain-registry.js.map +1 -0
- package/dist/core/domain-router.d.ts +16 -0
- package/dist/core/domain-router.d.ts.map +1 -0
- package/dist/core/domain-router.js +24 -0
- package/dist/core/domain-router.js.map +1 -0
- package/dist/core/domain-score.d.ts +13 -0
- package/dist/core/domain-score.d.ts.map +1 -0
- package/dist/core/domain-score.js +48 -0
- package/dist/core/domain-score.js.map +1 -0
- package/dist/core/domain-trigger-match.d.ts +14 -0
- package/dist/core/domain-trigger-match.d.ts.map +1 -0
- package/dist/core/domain-trigger-match.js +51 -0
- package/dist/core/domain-trigger-match.js.map +1 -0
- package/dist/core/domain-types.d.ts +30 -0
- package/dist/core/domain-types.d.ts.map +1 -0
- package/dist/core/domain-types.js +2 -0
- package/dist/core/domain-types.js.map +1 -0
- package/dist/core/exact-cache-policy.d.ts +8 -0
- package/dist/core/exact-cache-policy.d.ts.map +1 -1
- package/dist/core/exact-cache-policy.js +9 -0
- package/dist/core/exact-cache-policy.js.map +1 -1
- package/dist/core/exec.d.ts +0 -2
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +0 -1
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/index.d.ts +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.js +1 -3
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/builtin/command-safety-gate.d.ts +3 -0
- package/dist/core/extensions/builtin/command-safety-gate.d.ts.map +1 -1
- package/dist/core/extensions/builtin/command-safety-gate.js +15 -3
- package/dist/core/extensions/builtin/command-safety-gate.js.map +1 -1
- package/dist/core/extensions/builtin/todo-checklist.d.ts +20 -0
- package/dist/core/extensions/builtin/todo-checklist.d.ts.map +1 -0
- package/dist/core/extensions/builtin/todo-checklist.js +73 -0
- package/dist/core/extensions/builtin/todo-checklist.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +4 -4
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +57 -92
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +3 -3
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +7 -35
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts +1 -1
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +3 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +4 -0
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/headroom.d.ts +45 -0
- package/dist/core/headroom.d.ts.map +1 -0
- package/dist/core/headroom.js +171 -0
- package/dist/core/headroom.js.map +1 -0
- package/dist/core/hook-inventory.d.ts +4 -2
- package/dist/core/hook-inventory.d.ts.map +1 -1
- package/dist/core/hook-inventory.js +80 -11
- package/dist/core/hook-inventory.js.map +1 -1
- package/dist/core/hooks/fail-closed.d.ts +4 -1
- package/dist/core/hooks/fail-closed.d.ts.map +1 -1
- package/dist/core/hooks/fail-closed.js +79 -5
- package/dist/core/hooks/fail-closed.js.map +1 -1
- package/dist/core/hooks/index.d.ts +2 -2
- package/dist/core/hooks/index.d.ts.map +1 -1
- package/dist/core/hooks/index.js +1 -1
- package/dist/core/hooks/index.js.map +1 -1
- package/dist/core/hooks/types.d.ts +9 -0
- package/dist/core/hooks/types.d.ts.map +1 -1
- package/dist/core/hooks/types.js.map +1 -1
- package/dist/core/keybindings.d.ts +2 -14
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +1 -31
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/lean-ctx.d.ts +99 -0
- package/dist/core/lean-ctx.d.ts.map +1 -0
- package/dist/core/lean-ctx.js +225 -0
- package/dist/core/lean-ctx.js.map +1 -0
- package/dist/core/loadout-compose.d.ts +53 -0
- package/dist/core/loadout-compose.d.ts.map +1 -0
- package/dist/core/loadout-compose.js +172 -0
- package/dist/core/loadout-compose.js.map +1 -0
- package/dist/core/loadout-policy-bridge.d.ts +22 -0
- package/dist/core/loadout-policy-bridge.d.ts.map +1 -0
- package/dist/core/loadout-policy-bridge.js +52 -0
- package/dist/core/loadout-policy-bridge.js.map +1 -0
- package/dist/core/loadout-runtime.d.ts +22 -0
- package/dist/core/loadout-runtime.d.ts.map +1 -1
- package/dist/core/loadout-runtime.js +41 -5
- package/dist/core/loadout-runtime.js.map +1 -1
- package/dist/core/loadout-safety.d.ts +55 -0
- package/dist/core/loadout-safety.d.ts.map +1 -0
- package/dist/core/loadout-safety.js +213 -0
- package/dist/core/loadout-safety.js.map +1 -0
- package/dist/core/loadouts.d.ts +4 -2
- package/dist/core/loadouts.d.ts.map +1 -1
- package/dist/core/loadouts.js +116 -5
- package/dist/core/loadouts.js.map +1 -1
- package/dist/core/loop-gates.d.ts +48 -0
- package/dist/core/loop-gates.d.ts.map +1 -0
- package/dist/core/loop-gates.js +352 -0
- package/dist/core/loop-gates.js.map +1 -0
- package/dist/core/loop-registry.d.ts +77 -0
- package/dist/core/loop-registry.d.ts.map +1 -0
- package/dist/core/loop-registry.js +831 -0
- package/dist/core/loop-registry.js.map +1 -0
- package/dist/core/loop-types.d.ts +194 -0
- package/dist/core/loop-types.d.ts.map +1 -0
- package/dist/core/loop-types.js +2 -0
- package/dist/core/loop-types.js.map +1 -0
- package/dist/core/mcp-inventory.d.ts +7 -0
- package/dist/core/mcp-inventory.d.ts.map +1 -1
- package/dist/core/mcp-inventory.js +5 -1
- package/dist/core/mcp-inventory.js.map +1 -1
- package/dist/core/mcp-presets.d.ts +43 -2
- package/dist/core/mcp-presets.d.ts.map +1 -1
- package/dist/core/mcp-presets.js +298 -2
- package/dist/core/mcp-presets.js.map +1 -1
- package/dist/core/messages.d.ts +3 -3
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/metrics-sampler.d.ts +11 -0
- package/dist/core/metrics-sampler.d.ts.map +1 -1
- package/dist/core/metrics-sampler.js +52 -13
- package/dist/core/metrics-sampler.js.map +1 -1
- package/dist/core/model-registry.d.ts +1 -2
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +18 -41
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +2 -2
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +2 -2
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/package-gallery-identity.d.ts +7 -0
- package/dist/core/package-gallery-identity.d.ts.map +1 -0
- package/dist/core/package-gallery-identity.js +31 -0
- package/dist/core/package-gallery-identity.js.map +1 -0
- package/dist/core/package-gallery-install.d.ts +6 -0
- package/dist/core/package-gallery-install.d.ts.map +1 -0
- package/dist/core/package-gallery-install.js +59 -0
- package/dist/core/package-gallery-install.js.map +1 -0
- package/dist/core/package-gallery-manifest.d.ts +13 -0
- package/dist/core/package-gallery-manifest.d.ts.map +1 -0
- package/dist/core/package-gallery-manifest.js +183 -0
- package/dist/core/package-gallery-manifest.js.map +1 -0
- package/dist/core/package-gallery-trial.d.ts +4 -0
- package/dist/core/package-gallery-trial.d.ts.map +1 -0
- package/dist/core/package-gallery-trial.js +55 -0
- package/dist/core/package-gallery-trial.js.map +1 -0
- package/dist/core/package-gallery-types.d.ts +71 -0
- package/dist/core/package-gallery-types.d.ts.map +1 -0
- package/dist/core/package-gallery-types.js +2 -0
- package/dist/core/package-gallery-types.js.map +1 -0
- package/dist/core/package-gallery.d.ts +5 -123
- package/dist/core/package-gallery.d.ts.map +1 -1
- package/dist/core/package-gallery.js +5 -391
- package/dist/core/package-gallery.js.map +1 -1
- package/dist/core/package-manager.d.ts +0 -69
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +69 -367
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/package-procurement.d.ts +4 -4
- package/dist/core/package-procurement.d.ts.map +1 -1
- package/dist/core/package-procurement.js +29 -17
- package/dist/core/package-procurement.js.map +1 -1
- package/dist/core/pi-package-intake-candidates.d.ts +21 -0
- package/dist/core/pi-package-intake-candidates.d.ts.map +1 -0
- package/dist/core/pi-package-intake-candidates.js +109 -0
- package/dist/core/pi-package-intake-candidates.js.map +1 -0
- package/dist/core/pi-package-intake.d.ts +43 -0
- package/dist/core/pi-package-intake.d.ts.map +1 -0
- package/dist/core/pi-package-intake.js +122 -0
- package/dist/core/pi-package-intake.js.map +1 -0
- package/dist/core/provider-attribution.d.ts +1 -1
- package/dist/core/provider-attribution.d.ts.map +1 -1
- package/dist/core/provider-attribution.js.map +1 -1
- package/dist/core/provider-display-names.d.ts.map +1 -1
- package/dist/core/provider-display-names.js +1 -0
- package/dist/core/provider-display-names.js.map +1 -1
- package/dist/core/read-anchors.d.ts +1 -1
- package/dist/core/read-anchors.d.ts.map +1 -1
- package/dist/core/read-anchors.js +1 -1
- package/dist/core/read-anchors.js.map +1 -1
- package/dist/core/recovery-checkpoint.d.ts +2 -2
- package/dist/core/recovery-checkpoint.d.ts.map +1 -1
- package/dist/core/recovery-checkpoint.js +2 -2
- package/dist/core/recovery-checkpoint.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts +1 -1
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +2 -30
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts +12 -20
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +67 -90
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sandbox-policy-v2.d.ts +49 -0
- package/dist/core/sandbox-policy-v2.d.ts.map +1 -0
- package/dist/core/sandbox-policy-v2.js +368 -0
- package/dist/core/sandbox-policy-v2.js.map +1 -0
- package/dist/core/sdk.d.ts +10 -78
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +97 -139
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/semantic-cache-policy.d.ts +7 -1
- package/dist/core/semantic-cache-policy.d.ts.map +1 -1
- package/dist/core/semantic-cache-policy.js +8 -0
- package/dist/core/semantic-cache-policy.js.map +1 -1
- package/dist/core/session-manager.d.ts +2 -4
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +5 -6
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -18
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +2 -48
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts +5 -0
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +149 -36
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +0 -2
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/subagent-orchestration.d.ts +73 -0
- package/dist/core/subagent-orchestration.d.ts.map +1 -0
- package/dist/core/subagent-orchestration.js +408 -0
- package/dist/core/subagent-orchestration.js.map +1 -0
- package/dist/core/system-prompt.d.ts +5 -4
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +57 -36
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/timings.d.ts +0 -4
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +0 -4
- package/dist/core/timings.js.map +1 -1
- package/dist/core/todo-runtime-state.d.ts +5 -0
- package/dist/core/todo-runtime-state.d.ts.map +1 -0
- package/dist/core/todo-runtime-state.js +12 -0
- package/dist/core/todo-runtime-state.js.map +1 -0
- package/dist/core/todo-state.d.ts +53 -0
- package/dist/core/todo-state.d.ts.map +1 -0
- package/dist/core/todo-state.js +87 -0
- package/dist/core/todo-state.js.map +1 -0
- package/dist/core/token-optimizer.d.ts +58 -0
- package/dist/core/token-optimizer.d.ts.map +1 -0
- package/dist/core/token-optimizer.js +179 -0
- package/dist/core/token-optimizer.js.map +1 -0
- package/dist/core/tools/bash.d.ts +8 -9
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +9 -8
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +3 -14
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +4 -25
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +1 -4
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +1 -4
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +1 -4
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +2 -5
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +2 -2
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +1 -4
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +1 -4
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +2 -14
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +4 -28
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +1 -1
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +1 -1
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/write.d.ts +2 -4
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +4 -4
- package/dist/core/tools/write.js.map +1 -1
- package/dist/encoding/index.d.ts +6 -0
- package/dist/encoding/index.d.ts.map +1 -0
- package/dist/encoding/index.js +6 -0
- package/dist/encoding/index.js.map +1 -0
- package/dist/encoding/l4-encoder.d.ts +96 -0
- package/dist/encoding/l4-encoder.d.ts.map +1 -0
- package/dist/encoding/l4-encoder.js +474 -0
- package/dist/encoding/l4-encoder.js.map +1 -0
- package/dist/fuzzing/index.d.ts +6 -0
- package/dist/fuzzing/index.d.ts.map +1 -0
- package/dist/fuzzing/index.js +6 -0
- package/dist/fuzzing/index.js.map +1 -0
- package/dist/fuzzing/mutation-engine.d.ts +93 -0
- package/dist/fuzzing/mutation-engine.d.ts.map +1 -0
- package/dist/fuzzing/mutation-engine.js +244 -0
- package/dist/fuzzing/mutation-engine.js.map +1 -0
- package/dist/guardrails/audit-logger.d.ts +4 -0
- package/dist/guardrails/audit-logger.d.ts.map +1 -0
- package/dist/guardrails/audit-logger.js +28 -0
- package/dist/guardrails/audit-logger.js.map +1 -0
- package/dist/guardrails/evidence-system.d.ts +61 -0
- package/dist/guardrails/evidence-system.d.ts.map +1 -0
- package/dist/guardrails/evidence-system.js +302 -0
- package/dist/guardrails/evidence-system.js.map +1 -0
- package/dist/guardrails/freedomd-adapter.d.ts +16 -0
- package/dist/guardrails/freedomd-adapter.d.ts.map +1 -0
- package/dist/guardrails/freedomd-adapter.js +87 -0
- package/dist/guardrails/freedomd-adapter.js.map +1 -0
- package/dist/index.d.ts +5 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -17
- package/dist/index.js.map +1 -1
- package/dist/jailbreak-extension.d.ts +48 -0
- package/dist/jailbreak-extension.d.ts.map +1 -0
- package/dist/jailbreak-extension.js +47 -0
- package/dist/jailbreak-extension.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +0 -37
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +6 -414
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/armin.d.ts +1 -1
- package/dist/modes/interactive/components/armin.d.ts.map +1 -1
- package/dist/modes/interactive/components/armin.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +2 -2
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +1 -1
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +1 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js +1 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +1 -1
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/control-panel-box.d.ts +15 -0
- package/dist/modes/interactive/components/control-panel-box.d.ts.map +1 -0
- package/dist/modes/interactive/components/control-panel-box.js +55 -0
- package/dist/modes/interactive/components/control-panel-box.js.map +1 -0
- package/dist/modes/interactive/components/control-panel-gradient-motion.d.ts.map +1 -1
- package/dist/modes/interactive/components/control-panel-gradient-motion.js +2 -36
- package/dist/modes/interactive/components/control-panel-gradient-motion.js.map +1 -1
- package/dist/modes/interactive/components/control-panel-gradient.d.ts +1 -0
- package/dist/modes/interactive/components/control-panel-gradient.d.ts.map +1 -1
- package/dist/modes/interactive/components/control-panel-gradient.js +6 -5
- package/dist/modes/interactive/components/control-panel-gradient.js.map +1 -1
- package/dist/modes/interactive/components/control-panel-layout.d.ts +30 -0
- package/dist/modes/interactive/components/control-panel-layout.d.ts.map +1 -0
- package/dist/modes/interactive/components/control-panel-layout.js +197 -0
- package/dist/modes/interactive/components/control-panel-layout.js.map +1 -0
- package/dist/modes/interactive/components/control-panel-runtime-status.d.ts +6 -0
- package/dist/modes/interactive/components/control-panel-runtime-status.d.ts.map +1 -0
- package/dist/modes/interactive/components/control-panel-runtime-status.js +29 -0
- package/dist/modes/interactive/components/control-panel-runtime-status.js.map +1 -0
- package/dist/modes/interactive/components/control-panel.d.ts +9 -31
- package/dist/modes/interactive/components/control-panel.d.ts.map +1 -1
- package/dist/modes/interactive/components/control-panel.js +49 -168
- package/dist/modes/interactive/components/control-panel.js.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +14 -22
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +1 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
- package/dist/modes/interactive/components/daxnuts.js.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts +1 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.js +1 -1
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +1 -1
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +1 -1
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +1 -1
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +7 -9
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +0 -2
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +0 -2
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +2 -2
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +2 -2
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +13 -47
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +118 -193
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +1 -1
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +2 -2
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js +1 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +1 -1
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -3
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +1 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.js +1 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/theme-selector.d.ts +1 -2
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js +2 -11
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts +8 -7
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +48 -7
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/todo-checklist.d.ts +31 -0
- package/dist/modes/interactive/components/todo-checklist.d.ts.map +1 -0
- package/dist/modes/interactive/components/todo-checklist.js +121 -0
- package/dist/modes/interactive/components/todo-checklist.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +1 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +1 -1
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +1 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +1 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js +1 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +3 -8
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +80 -232
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/omk-control-grid-dark.json +65 -77
- package/dist/modes/interactive/theme/omk-neon-control.json +90 -0
- package/dist/modes/interactive/theme/rust-forge.json +14 -24
- package/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +25 -45
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +2 -2
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +0 -4
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +2 -2
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modules/index.d.ts +8 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +7 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/modules/lrl-bypass.d.ts +40 -0
- package/dist/modules/lrl-bypass.d.ts.map +1 -0
- package/dist/modules/lrl-bypass.js +84 -0
- package/dist/modules/lrl-bypass.js.map +1 -0
- package/dist/modules/lrl-deps.d.ts +38 -0
- package/dist/modules/lrl-deps.d.ts.map +1 -0
- package/dist/modules/lrl-deps.js +128 -0
- package/dist/modules/lrl-deps.js.map +1 -0
- package/dist/multiturn/easl-chain.d.ts +113 -0
- package/dist/multiturn/easl-chain.d.ts.map +1 -0
- package/dist/multiturn/easl-chain.js +351 -0
- package/dist/multiturn/easl-chain.js.map +1 -0
- package/dist/multiturn/index.d.ts +6 -0
- package/dist/multiturn/index.d.ts.map +1 -0
- package/dist/multiturn/index.js +6 -0
- package/dist/multiturn/index.js.map +1 -0
- package/dist/orchestration/lane-grant-auditor.d.ts +4 -0
- package/dist/orchestration/lane-grant-auditor.d.ts.map +1 -0
- package/dist/orchestration/lane-grant-auditor.js +87 -0
- package/dist/orchestration/lane-grant-auditor.js.map +1 -0
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +48 -113
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/routing/fallback-router.d.ts +123 -0
- package/dist/routing/fallback-router.d.ts.map +1 -0
- package/dist/routing/fallback-router.js +355 -0
- package/dist/routing/fallback-router.js.map +1 -0
- package/dist/routing/index.d.ts +6 -0
- package/dist/routing/index.d.ts.map +1 -0
- package/dist/routing/index.js +6 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/types/evidence.d.ts +117 -0
- package/dist/types/evidence.d.ts.map +1 -0
- package/dist/types/evidence.js +8 -0
- package/dist/types/evidence.js.map +1 -0
- package/dist/types/guardrails.d.ts +61 -0
- package/dist/types/guardrails.d.ts.map +1 -0
- package/dist/types/guardrails.js +9 -0
- package/dist/types/guardrails.js.map +1 -0
- package/dist/types/jailbreak.d.ts +246 -0
- package/dist/types/jailbreak.d.ts.map +1 -0
- package/dist/types/jailbreak.js +8 -0
- package/dist/types/jailbreak.js.map +1 -0
- package/dist/types/lane-grant.d.ts +58 -0
- package/dist/types/lane-grant.d.ts.map +1 -0
- package/dist/types/lane-grant.js +9 -0
- package/dist/types/lane-grant.js.map +1 -0
- package/dist/utils/jailbreak/common.d.ts +63 -0
- package/dist/utils/jailbreak/common.d.ts.map +1 -0
- package/dist/utils/jailbreak/common.js +130 -0
- package/dist/utils/jailbreak/common.js.map +1 -0
- package/dist/utils/jailbreak/index.d.ts +7 -0
- package/dist/utils/jailbreak/index.d.ts.map +1 -0
- package/dist/utils/jailbreak/index.js +7 -0
- package/dist/utils/jailbreak/index.js.map +1 -0
- package/dist/utils/windows-self-update.d.ts.map +1 -1
- package/dist/utils/windows-self-update.js +1 -1
- package/dist/utils/windows-self-update.js.map +1 -1
- package/docs/compaction.md +8 -21
- package/docs/custom-provider.md +2 -2
- package/docs/development.md +1 -1
- package/docs/extensions.md +11 -11
- package/docs/loadout-domains/README.md +70 -0
- package/docs/loadout-domains/ai-agent-ops.md +94 -0
- package/docs/loadout-domains/backend-api.md +116 -0
- package/docs/loadout-domains/data-science.md +100 -0
- package/docs/loadout-domains/devops-infra.md +85 -0
- package/docs/loadout-domains/docs-writing.md +92 -0
- package/docs/loadout-domains/frontend-ui.md +128 -0
- package/docs/loadout-domains/general.md +62 -0
- package/docs/loadout-domains/mobile.md +84 -0
- package/docs/loadout-domains/qa-testing.md +87 -0
- package/docs/loadout-domains/research.md +80 -0
- package/docs/loadout-domains/security-audit.md +97 -0
- package/docs/packages.md +7 -48
- package/docs/prompt-templates.md +0 -2
- package/docs/providers.md +12 -0
- package/docs/sdk.md +3 -3
- package/docs/security.md +145 -0
- package/docs/session-format.md +1 -1
- package/docs/themes.md +8 -7
- package/docs/tui.md +14 -14
- package/docs/usage.md +6 -16
- package/examples/extensions/README.md +2 -2
- package/examples/extensions/aside-computer-use/README.md +114 -0
- package/examples/extensions/aside-computer-use/action-scoring.ts +122 -0
- package/examples/extensions/aside-computer-use/assertions.ts +380 -0
- package/examples/extensions/aside-computer-use/controller.ts +491 -0
- package/examples/extensions/aside-computer-use/evidence.ts +229 -0
- package/examples/extensions/aside-computer-use/golden-trace.ts +141 -0
- package/examples/extensions/aside-computer-use/index.ts +76 -0
- package/examples/extensions/aside-computer-use/mcp-client.ts +381 -0
- package/examples/extensions/aside-computer-use/observation-snapshot.ts +121 -0
- package/examples/extensions/aside-computer-use/package.json +16 -0
- package/examples/extensions/aside-computer-use/policy.ts +257 -0
- package/examples/extensions/aside-computer-use/risk-authorize.ts +200 -0
- package/examples/extensions/aside-computer-use/risk-classifier.ts +205 -0
- package/examples/extensions/aside-computer-use/schema-fingerprint.ts +80 -0
- package/examples/extensions/aside-computer-use/session-binding.ts +161 -0
- package/examples/extensions/aside-computer-use/tools.ts +449 -0
- package/examples/extensions/aside-computer-use/types.ts +217 -0
- package/examples/extensions/aside-computer-use/url-origin.ts +132 -0
- package/examples/extensions/bash-spawn-hook.ts +1 -1
- package/examples/extensions/border-status-editor.ts +2 -2
- package/examples/extensions/built-in-tool-renderer.ts +1 -1
- package/examples/extensions/custom-compaction.ts +1 -1
- package/examples/extensions/custom-footer.ts +2 -2
- package/examples/extensions/custom-header.ts +8 -8
- package/examples/extensions/custom-provider-anthropic/index.ts +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +1 -1
- package/examples/extensions/doom-overlay/README.md +1 -2
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +4 -4
- package/examples/extensions/doom-overlay/doom/doomgeneric_omk.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +2 -2
- package/examples/extensions/doom-overlay/doom-keys.ts +1 -1
- package/examples/extensions/git-merge-and-resolve.ts +1 -1
- package/examples/extensions/github-issue-autocomplete.ts +1 -6
- package/examples/extensions/gondolin/index.ts +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/handoff.ts +2 -2
- package/examples/extensions/hello.ts +1 -1
- package/examples/extensions/inline-bash.ts +1 -1
- package/examples/extensions/input-transform-streaming.ts +1 -1
- package/examples/extensions/input-transform.ts +2 -2
- package/examples/extensions/mac-system-theme.ts +1 -1
- package/examples/extensions/message-renderer.ts +1 -1
- package/examples/extensions/minimal-mode.ts +1 -1
- package/examples/extensions/modal-editor.ts +1 -1
- package/examples/extensions/overlay-qa-tests.ts +7 -7
- package/examples/extensions/overlay-test.ts +1 -1
- package/examples/extensions/plan-mode/index.ts +3 -3
- package/examples/extensions/preset.ts +4 -4
- package/examples/extensions/provider-payload.ts +6 -3
- package/examples/extensions/qna.ts +1 -1
- package/examples/extensions/question.ts +1 -1
- package/examples/extensions/questionnaire.ts +1 -1
- package/examples/extensions/rpc-demo.ts +1 -1
- package/examples/extensions/sandbox/index.ts +2 -2
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/shutdown-command.ts +5 -5
- package/examples/extensions/snake.ts +1 -1
- package/examples/extensions/space-invaders.ts +1 -1
- package/examples/extensions/structured-output.ts +1 -1
- package/examples/extensions/subagent/agents.ts +2 -2
- package/examples/extensions/subagent/index.ts +19 -51
- package/examples/extensions/summarize.ts +2 -2
- package/examples/extensions/tic-tac-toe.ts +2 -2
- package/examples/extensions/todo.ts +2 -2
- package/examples/extensions/tool-override.ts +1 -1
- package/examples/extensions/tools.ts +1 -1
- package/examples/extensions/truncated-tool.ts +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/extensions/working-indicator.ts +3 -3
- package/examples/rpc-extension-ui.ts +1 -9
- package/examples/sdk/02-custom-model.ts +1 -1
- package/examples/sdk/07-context-files.ts +0 -2
- package/examples/sdk/12-full-control.ts +1 -1
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +1805 -0
- package/package.json +10 -32
- package/dist/core/compaction/pruner-policy.d.ts +0 -84
- package/dist/core/compaction/pruner-policy.d.ts.map +0 -1
- package/dist/core/compaction/pruner-policy.js +0 -273
- package/dist/core/compaction/pruner-policy.js.map +0 -1
- package/dist/core/context-graph-identity-resolution.d.ts +0 -114
- package/dist/core/context-graph-identity-resolution.d.ts.map +0 -1
- package/dist/core/context-graph-identity-resolution.js +0 -127
- package/dist/core/context-graph-identity-resolution.js.map +0 -1
- package/dist/core/context-graph-memory-store.d.ts +0 -153
- package/dist/core/context-graph-memory-store.d.ts.map +0 -1
- package/dist/core/context-graph-memory-store.js +0 -377
- package/dist/core/context-graph-memory-store.js.map +0 -1
- package/dist/core/context-graph-ontology-generation.d.ts +0 -104
- package/dist/core/context-graph-ontology-generation.d.ts.map +0 -1
- package/dist/core/context-graph-ontology-generation.js +0 -135
- package/dist/core/context-graph-ontology-generation.js.map +0 -1
- package/dist/core/context-graph-ontology-registry.d.ts +0 -766
- package/dist/core/context-graph-ontology-registry.d.ts.map +0 -1
- package/dist/core/context-graph-ontology-registry.js +0 -1133
- package/dist/core/context-graph-ontology-registry.js.map +0 -1
- package/dist/core/context-graph-policy.d.ts +0 -68
- package/dist/core/context-graph-policy.d.ts.map +0 -1
- package/dist/core/context-graph-policy.js +0 -221
- package/dist/core/context-graph-policy.js.map +0 -1
- package/dist/core/context-graph-reasoning.d.ts +0 -130
- package/dist/core/context-graph-reasoning.d.ts.map +0 -1
- package/dist/core/context-graph-reasoning.js +0 -442
- package/dist/core/context-graph-reasoning.js.map +0 -1
- package/dist/core/context-graph-retrieval.d.ts +0 -120
- package/dist/core/context-graph-retrieval.d.ts.map +0 -1
- package/dist/core/context-graph-retrieval.js +0 -288
- package/dist/core/context-graph-retrieval.js.map +0 -1
- package/dist/core/contract-verification.d.ts +0 -78
- package/dist/core/contract-verification.d.ts.map +0 -1
- package/dist/core/contract-verification.js +0 -110
- package/dist/core/contract-verification.js.map +0 -1
- package/dist/core/freedom/banner.d.ts +0 -14
- package/dist/core/freedom/banner.d.ts.map +0 -1
- package/dist/core/freedom/banner.js +0 -22
- package/dist/core/freedom/banner.js.map +0 -1
- package/dist/core/freedom/config.d.ts +0 -27
- package/dist/core/freedom/config.d.ts.map +0 -1
- package/dist/core/freedom/config.js +0 -216
- package/dist/core/freedom/config.js.map +0 -1
- package/dist/core/freedom/index.d.ts +0 -23
- package/dist/core/freedom/index.d.ts.map +0 -1
- package/dist/core/freedom/index.js +0 -19
- package/dist/core/freedom/index.js.map +0 -1
- package/dist/core/freedom/policy.d.ts +0 -42
- package/dist/core/freedom/policy.d.ts.map +0 -1
- package/dist/core/freedom/policy.js +0 -47
- package/dist/core/freedom/policy.js.map +0 -1
- package/dist/core/freedom/safety-floor.d.ts +0 -73
- package/dist/core/freedom/safety-floor.d.ts.map +0 -1
- package/dist/core/freedom/safety-floor.js +0 -275
- package/dist/core/freedom/safety-floor.js.map +0 -1
- package/dist/core/harness-control-events.d.ts +0 -91
- package/dist/core/harness-control-events.d.ts.map +0 -1
- package/dist/core/harness-control-events.js +0 -514
- package/dist/core/harness-control-events.js.map +0 -1
- package/dist/core/harness-control-replay.d.ts +0 -31
- package/dist/core/harness-control-replay.d.ts.map +0 -1
- package/dist/core/harness-control-replay.js +0 -187
- package/dist/core/harness-control-replay.js.map +0 -1
- package/dist/core/headroom-middleware.d.ts +0 -35
- package/dist/core/headroom-middleware.d.ts.map +0 -1
- package/dist/core/headroom-middleware.js +0 -166
- package/dist/core/headroom-middleware.js.map +0 -1
- package/dist/core/lean-context-middleware.d.ts +0 -12
- package/dist/core/lean-context-middleware.d.ts.map +0 -1
- package/dist/core/lean-context-middleware.js +0 -87
- package/dist/core/lean-context-middleware.js.map +0 -1
- package/dist/core/lean-context-policy.d.ts +0 -45
- package/dist/core/lean-context-policy.d.ts.map +0 -1
- package/dist/core/lean-context-policy.js +0 -108
- package/dist/core/lean-context-policy.js.map +0 -1
- package/dist/core/native-adoption-benchmark.d.ts +0 -166
- package/dist/core/native-adoption-benchmark.d.ts.map +0 -1
- package/dist/core/native-adoption-benchmark.js +0 -624
- package/dist/core/native-adoption-benchmark.js.map +0 -1
- package/dist/core/observability-trace.d.ts +0 -80
- package/dist/core/observability-trace.d.ts.map +0 -1
- package/dist/core/observability-trace.js +0 -140
- package/dist/core/observability-trace.js.map +0 -1
- package/dist/core/orchestration/checkpoint.d.ts +0 -83
- package/dist/core/orchestration/checkpoint.d.ts.map +0 -1
- package/dist/core/orchestration/checkpoint.js +0 -152
- package/dist/core/orchestration/checkpoint.js.map +0 -1
- package/dist/core/orchestration/errors.d.ts +0 -74
- package/dist/core/orchestration/errors.d.ts.map +0 -1
- package/dist/core/orchestration/errors.js +0 -52
- package/dist/core/orchestration/errors.js.map +0 -1
- package/dist/core/orchestration/merge-queue.d.ts +0 -121
- package/dist/core/orchestration/merge-queue.d.ts.map +0 -1
- package/dist/core/orchestration/merge-queue.js +0 -149
- package/dist/core/orchestration/merge-queue.js.map +0 -1
- package/dist/core/orchestration/recovery.d.ts +0 -106
- package/dist/core/orchestration/recovery.d.ts.map +0 -1
- package/dist/core/orchestration/recovery.js +0 -110
- package/dist/core/orchestration/recovery.js.map +0 -1
- package/dist/core/orchestration/replay-ledger.d.ts +0 -76
- package/dist/core/orchestration/replay-ledger.d.ts.map +0 -1
- package/dist/core/orchestration/replay-ledger.js +0 -395
- package/dist/core/orchestration/replay-ledger.js.map +0 -1
- package/dist/core/orchestration/scheduler-state.d.ts +0 -78
- package/dist/core/orchestration/scheduler-state.d.ts.map +0 -1
- package/dist/core/orchestration/scheduler-state.js +0 -185
- package/dist/core/orchestration/scheduler-state.js.map +0 -1
- package/dist/core/orchestration/scheduler-store.d.ts +0 -309
- package/dist/core/orchestration/scheduler-store.d.ts.map +0 -1
- package/dist/core/orchestration/scheduler-store.js +0 -368
- package/dist/core/orchestration/scheduler-store.js.map +0 -1
- package/dist/core/orchestration/sqlite-scheduler-store.d.ts +0 -57
- package/dist/core/orchestration/sqlite-scheduler-store.d.ts.map +0 -1
- package/dist/core/orchestration/sqlite-scheduler-store.js +0 -528
- package/dist/core/orchestration/sqlite-scheduler-store.js.map +0 -1
- package/dist/core/orchestration/transaction-coordinator.d.ts +0 -217
- package/dist/core/orchestration/transaction-coordinator.d.ts.map +0 -1
- package/dist/core/orchestration/transaction-coordinator.js +0 -281
- package/dist/core/orchestration/transaction-coordinator.js.map +0 -1
- package/dist/core/orchestration/verification-contract.d.ts +0 -197
- package/dist/core/orchestration/verification-contract.d.ts.map +0 -1
- package/dist/core/orchestration/verification-contract.js +0 -145
- package/dist/core/orchestration/verification-contract.js.map +0 -1
- package/dist/core/package-composition.d.ts +0 -68
- package/dist/core/package-composition.d.ts.map +0 -1
- package/dist/core/package-composition.js +0 -304
- package/dist/core/package-composition.js.map +0 -1
- package/dist/core/package-trial-runtime.d.ts +0 -75
- package/dist/core/package-trial-runtime.d.ts.map +0 -1
- package/dist/core/package-trial-runtime.js +0 -73
- package/dist/core/package-trial-runtime.js.map +0 -1
- package/dist/core/package-trial-sandbox.d.ts +0 -27
- package/dist/core/package-trial-sandbox.d.ts.map +0 -1
- package/dist/core/package-trial-sandbox.js +0 -102
- package/dist/core/package-trial-sandbox.js.map +0 -1
- package/dist/core/policy-overlays-runtime.d.ts +0 -141
- package/dist/core/policy-overlays-runtime.d.ts.map +0 -1
- package/dist/core/policy-overlays-runtime.js +0 -720
- package/dist/core/policy-overlays-runtime.js.map +0 -1
- package/dist/core/read-anchor-registry.d.ts +0 -27
- package/dist/core/read-anchor-registry.d.ts.map +0 -1
- package/dist/core/read-anchor-registry.js +0 -103
- package/dist/core/read-anchor-registry.js.map +0 -1
- package/dist/core/read-content-cache.d.ts +0 -22
- package/dist/core/read-content-cache.d.ts.map +0 -1
- package/dist/core/read-content-cache.js +0 -79
- package/dist/core/read-content-cache.js.map +0 -1
- package/dist/core/session-digest.d.ts +0 -57
- package/dist/core/session-digest.d.ts.map +0 -1
- package/dist/core/session-digest.js +0 -193
- package/dist/core/session-digest.js.map +0 -1
- package/dist/core/spec-kit/compiler.d.ts +0 -67
- package/dist/core/spec-kit/compiler.d.ts.map +0 -1
- package/dist/core/spec-kit/compiler.js +0 -268
- package/dist/core/spec-kit/compiler.js.map +0 -1
- package/dist/core/transaction-coordinator.d.ts +0 -30
- package/dist/core/transaction-coordinator.d.ts.map +0 -1
- package/dist/core/transaction-coordinator.js +0 -173
- package/dist/core/transaction-coordinator.js.map +0 -1
- package/dist/modes/interactive/components/mcp-selector.d.ts +0 -30
- package/dist/modes/interactive/components/mcp-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/mcp-selector.js +0 -155
- package/dist/modes/interactive/components/mcp-selector.js.map +0 -1
- package/dist/modes/interactive/components/model-selector-state.d.ts +0 -101
- package/dist/modes/interactive/components/model-selector-state.d.ts.map +0 -1
- package/dist/modes/interactive/components/model-selector-state.js +0 -261
- package/dist/modes/interactive/components/model-selector-state.js.map +0 -1
- package/dist/modes/interactive/components/skills-selector.d.ts +0 -32
- package/dist/modes/interactive/components/skills-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/skills-selector.js +0 -130
- package/dist/modes/interactive/components/skills-selector.js.map +0 -1
- package/dist/modes/interactive/theme/omk-blackboard.json +0 -91
- package/dist/modes/interactive/theme/omk-freedom-grid.json +0 -91
- package/dist/modes/interactive/theme/omk-neon-ops.json +0 -90
- package/dist/modes/interactive/theme/omk-slate-light.json +0 -91
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +0 -72
- package/node_modules/@earendil-works/omk-agent-core/README.md +0 -488
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.d.ts +0 -24
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.js +0 -553
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.d.ts +0 -118
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.js +0 -402
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.d.ts +0 -95
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.js +0 -996
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.d.ts +0 -53
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.js +0 -175
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.d.ts +0 -117
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.js +0 -568
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.d.ts +0 -25
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.js +0 -131
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.d.ts +0 -51
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.js +0 -510
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.d.ts +0 -51
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.js +0 -102
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.d.ts +0 -48
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.js +0 -230
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.d.ts +0 -26
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.js +0 -101
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.d.ts +0 -36
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.js +0 -273
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.d.ts +0 -18
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.js +0 -42
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.d.ts +0 -25
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.js +0 -114
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.d.ts +0 -11
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.js +0 -39
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.d.ts +0 -33
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.js +0 -210
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.d.ts +0 -2
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.js +0 -50
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.d.ts +0 -44
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.js +0 -311
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.d.ts +0 -3
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.js +0 -30
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.d.ts +0 -616
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.js +0 -94
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.d.ts +0 -14
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.js +0 -126
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.d.ts +0 -70
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.js +0 -297
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/index.d.ts +0 -20
- package/node_modules/@earendil-works/omk-agent-core/dist/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/index.js +0 -25
- package/node_modules/@earendil-works/omk-agent-core/dist/index.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/node.d.ts +0 -3
- package/node_modules/@earendil-works/omk-agent-core/dist/node.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/node.js +0 -3
- package/node_modules/@earendil-works/omk-agent-core/dist/node.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.d.ts +0 -69
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.js +0 -278
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/types.d.ts +0 -393
- package/node_modules/@earendil-works/omk-agent-core/dist/types.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/types.js +0 -2
- package/node_modules/@earendil-works/omk-agent-core/dist/types.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/package.json +0 -60
- package/node_modules/@earendil-works/omk-ai/README.md +0 -1389
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.d.ts +0 -20
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.js +0 -44
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.d.ts +0 -5
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.js +0 -6
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/cli.d.ts +0 -3
- package/node_modules/@earendil-works/omk-ai/dist/cli.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/cli.js +0 -130
- package/node_modules/@earendil-works/omk-ai/dist/cli.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.d.ts +0 -20
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.js +0 -199
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/image-models.d.ts +0 -10
- package/node_modules/@earendil-works/omk-ai/dist/image-models.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.d.ts +0 -515
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.js +0 -517
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/image-models.js +0 -23
- package/node_modules/@earendil-works/omk-ai/dist/image-models.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.d.ts +0 -14
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.js +0 -22
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/images.d.ts +0 -4
- package/node_modules/@earendil-works/omk-ai/dist/images.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/images.js +0 -16
- package/node_modules/@earendil-works/omk-ai/dist/images.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/index.d.ts +0 -33
- package/node_modules/@earendil-works/omk-ai/dist/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/index.js +0 -21
- package/node_modules/@earendil-works/omk-ai/dist/index.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/models.d.ts +0 -18
- package/node_modules/@earendil-works/omk-ai/dist/models.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.d.ts +0 -18762
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.js +0 -17197
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/models.js +0 -78
- package/node_modules/@earendil-works/omk-ai/dist/models.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/oauth.d.ts +0 -2
- package/node_modules/@earendil-works/omk-ai/dist/oauth.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/oauth.js +0 -2
- package/node_modules/@earendil-works/omk-ai/dist/oauth.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.d.ts +0 -39
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.js +0 -170
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.d.ts +0 -38
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.js +0 -826
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.d.ts +0 -77
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.js +0 -1123
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.d.ts +0 -15
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.js +0 -221
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.d.ts +0 -13
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.js +0 -26
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.d.ts +0 -56
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.js +0 -368
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.d.ts +0 -8
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.js +0 -29
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.d.ts +0 -70
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.js +0 -331
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.d.ts +0 -15
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.js +0 -442
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.d.ts +0 -13
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.js +0 -402
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.d.ts +0 -3
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.js +0 -128
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.d.ts +0 -4
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.js +0 -34
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.d.ts +0 -25
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.js +0 -534
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.d.ts +0 -30
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.js +0 -1171
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.d.ts +0 -19
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.js +0 -977
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.d.ts +0 -11
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.js +0 -22
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.d.ts +0 -18
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.js +0 -496
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.d.ts +0 -13
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.js +0 -233
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.d.ts +0 -35
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.js +0 -254
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.d.ts +0 -8
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.js +0 -42
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.d.ts +0 -13
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.js +0 -82
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.d.ts +0 -8
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.js +0 -184
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.d.ts +0 -4
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.js +0 -22
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/stream.d.ts +0 -8
- package/node_modules/@earendil-works/omk-ai/dist/stream.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/stream.js +0 -77
- package/node_modules/@earendil-works/omk-ai/dist/stream.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/types.d.ts +0 -570
- package/node_modules/@earendil-works/omk-ai/dist/types.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/types.js +0 -2
- package/node_modules/@earendil-works/omk-ai/dist/types.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.d.ts +0 -6
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.js +0 -34
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.d.ts +0 -19
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.js +0 -25
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.d.ts +0 -21
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.js +0 -81
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.d.ts +0 -3
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.js +0 -14
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.d.ts +0 -2
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.js +0 -8
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.d.ts +0 -16
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.js +0 -113
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.d.ts +0 -10
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.js +0 -97
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.d.ts +0 -25
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.js +0 -335
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.d.ts +0 -21
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.js +0 -56
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.d.ts +0 -30
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.js +0 -280
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.d.ts +0 -58
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.js +0 -122
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.d.ts +0 -3
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.js +0 -105
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.d.ts +0 -43
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.js +0 -487
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.d.ts +0 -13
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.js +0 -31
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.d.ts +0 -64
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.js +0 -2
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.d.ts +0 -57
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.js +0 -154
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.d.ts +0 -22
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.js +0 -26
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.d.ts +0 -17
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.js +0 -21
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.d.ts +0 -18
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.js +0 -281
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/package.json +0 -106
- package/node_modules/@earendil-works/omk-tui/README.md +0 -791
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.d.ts +0 -54
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.js +0 -632
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/box.d.ts +0 -22
- package/node_modules/@earendil-works/omk-tui/dist/components/box.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/box.js +0 -104
- package/node_modules/@earendil-works/omk-tui/dist/components/box.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.d.ts +0 -22
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.js +0 -35
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.d.ts +0 -249
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.js +0 -1857
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/image.d.ts +0 -28
- package/node_modules/@earendil-works/omk-tui/dist/components/image.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/image.js +0 -89
- package/node_modules/@earendil-works/omk-tui/dist/components/image.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/input.d.ts +0 -37
- package/node_modules/@earendil-works/omk-tui/dist/components/input.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/input.js +0 -378
- package/node_modules/@earendil-works/omk-tui/dist/components/input.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.d.ts +0 -31
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.js +0 -69
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.d.ts +0 -96
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.js +0 -644
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.d.ts +0 -50
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.js +0 -159
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.d.ts +0 -50
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.js +0 -185
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.d.ts +0 -12
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.js +0 -23
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/text.d.ts +0 -19
- package/node_modules/@earendil-works/omk-tui/dist/components/text.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/text.js +0 -89
- package/node_modules/@earendil-works/omk-tui/dist/components/text.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.d.ts +0 -13
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.js +0 -51
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.d.ts +0 -39
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.js +0 -2
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.d.ts +0 -16
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.js +0 -110
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/index.d.ts +0 -23
- package/node_modules/@earendil-works/omk-tui/dist/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/index.js +0 -32
- package/node_modules/@earendil-works/omk-tui/dist/index.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.d.ts +0 -212
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.js +0 -252
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/keys.d.ts +0 -184
- package/node_modules/@earendil-works/omk-tui/dist/keys.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/keys.js +0 -1173
- package/node_modules/@earendil-works/omk-tui/dist/keys.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.d.ts +0 -28
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.js +0 -44
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.d.ts +0 -3
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.js +0 -53
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.d.ts +0 -50
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.js +0 -361
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.d.ts +0 -90
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.js +0 -366
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/terminal.d.ts +0 -113
- package/node_modules/@earendil-works/omk-tui/dist/terminal.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/terminal.js +0 -472
- package/node_modules/@earendil-works/omk-tui/dist/terminal.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/tui.d.ts +0 -242
- package/node_modules/@earendil-works/omk-tui/dist/tui.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/tui.js +0 -1221
- package/node_modules/@earendil-works/omk-tui/dist/tui.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.d.ts +0 -17
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.js +0 -25
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/utils.d.ts +0 -84
- package/node_modules/@earendil-works/omk-tui/dist/utils.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/utils.js +0 -1032
- package/node_modules/@earendil-works/omk-tui/dist/utils.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.d.ts +0 -25
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.js +0 -96
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/omk-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/omk-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/omk-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/omk-tui/package.json +0 -47
|
@@ -1,1123 +0,0 @@
|
|
|
1
|
-
import Anthropic from "@anthropic-ai/sdk";
|
|
2
|
-
import { calculateCost } from "../models.js";
|
|
3
|
-
import { AssistantMessageEventStream } from "../utils/event-stream.js";
|
|
4
|
-
import { headersToRecord } from "../utils/headers.js";
|
|
5
|
-
import { parseJsonWithRepair, parseStreamingJson } from "../utils/json-parse.js";
|
|
6
|
-
import { sanitizeSurrogates } from "../utils/sanitize-unicode.js";
|
|
7
|
-
import { resolveCloudflareBaseUrl } from "./cloudflare.js";
|
|
8
|
-
import { buildCopilotDynamicHeaders, hasCopilotVisionInput } from "./github-copilot-headers.js";
|
|
9
|
-
import { adjustMaxTokensForThinking, buildBaseOptions } from "./simple-options.js";
|
|
10
|
-
import { stableToolSchema, stableTools } from "./tool-schema.js";
|
|
11
|
-
import { transformMessages } from "./transform-messages.js";
|
|
12
|
-
/**
|
|
13
|
-
* Resolve cache retention preference.
|
|
14
|
-
* Defaults to "short" and uses OMK_CACHE_RETENTION.
|
|
15
|
-
*/
|
|
16
|
-
function resolveCacheRetention(cacheRetention) {
|
|
17
|
-
if (cacheRetention) {
|
|
18
|
-
return cacheRetention;
|
|
19
|
-
}
|
|
20
|
-
if (typeof process !== "undefined" && process.env.OMK_CACHE_RETENTION === "long") {
|
|
21
|
-
return "long";
|
|
22
|
-
}
|
|
23
|
-
return "short";
|
|
24
|
-
}
|
|
25
|
-
function getCacheControl(model, cacheRetention) {
|
|
26
|
-
const retention = resolveCacheRetention(cacheRetention);
|
|
27
|
-
if (retention === "none") {
|
|
28
|
-
return { retention };
|
|
29
|
-
}
|
|
30
|
-
const ttl = retention === "long" && getAnthropicCompat(model).supportsLongCacheRetention ? "1h" : undefined;
|
|
31
|
-
return {
|
|
32
|
-
retention,
|
|
33
|
-
cacheControl: { type: "ephemeral", ...(ttl && { ttl }) },
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
// Stealth mode: Mimic Claude Code's tool naming exactly
|
|
37
|
-
const claudeCodeVersion = "2.1.75";
|
|
38
|
-
// Claude Code 2.x tool names (canonical casing)
|
|
39
|
-
// Source: https://cchistory.mariozechner.at/data/prompts-2.1.11.md
|
|
40
|
-
// To update: https://github.com/badlogic/cchistory
|
|
41
|
-
const claudeCodeTools = [
|
|
42
|
-
"Read",
|
|
43
|
-
"Write",
|
|
44
|
-
"Edit",
|
|
45
|
-
"Bash",
|
|
46
|
-
"Grep",
|
|
47
|
-
"Glob",
|
|
48
|
-
"AskUserQuestion",
|
|
49
|
-
"EnterPlanMode",
|
|
50
|
-
"ExitPlanMode",
|
|
51
|
-
"KillShell",
|
|
52
|
-
"NotebookEdit",
|
|
53
|
-
"Skill",
|
|
54
|
-
"Task",
|
|
55
|
-
"TaskOutput",
|
|
56
|
-
"TodoWrite",
|
|
57
|
-
"WebFetch",
|
|
58
|
-
"WebSearch",
|
|
59
|
-
];
|
|
60
|
-
const ccToolLookup = new Map(claudeCodeTools.map((t) => [t.toLowerCase(), t]));
|
|
61
|
-
// Convert tool name to CC canonical casing if it matches (case-insensitive)
|
|
62
|
-
const toClaudeCodeName = (name) => ccToolLookup.get(name.toLowerCase()) ?? name;
|
|
63
|
-
const fromClaudeCodeName = (name, tools) => {
|
|
64
|
-
if (tools && tools.length > 0) {
|
|
65
|
-
const lowerName = name.toLowerCase();
|
|
66
|
-
const matchedTool = tools.find((tool) => tool.name.toLowerCase() === lowerName);
|
|
67
|
-
if (matchedTool)
|
|
68
|
-
return matchedTool.name;
|
|
69
|
-
}
|
|
70
|
-
return name;
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* Convert content blocks to Anthropic API format
|
|
74
|
-
*/
|
|
75
|
-
function convertContentBlocks(content) {
|
|
76
|
-
// If only text blocks, return as concatenated string for simplicity
|
|
77
|
-
const hasImages = content.some((c) => c.type === "image");
|
|
78
|
-
if (!hasImages) {
|
|
79
|
-
return sanitizeSurrogates(content.map((c) => c.text).join("\n"));
|
|
80
|
-
}
|
|
81
|
-
// If we have images, convert to content block array
|
|
82
|
-
const blocks = content.map((block) => {
|
|
83
|
-
if (block.type === "text") {
|
|
84
|
-
return {
|
|
85
|
-
type: "text",
|
|
86
|
-
text: sanitizeSurrogates(block.text),
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
return {
|
|
90
|
-
type: "image",
|
|
91
|
-
source: {
|
|
92
|
-
type: "base64",
|
|
93
|
-
media_type: block.mimeType,
|
|
94
|
-
data: block.data,
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
});
|
|
98
|
-
// If only images (no text), add placeholder text block
|
|
99
|
-
const hasText = blocks.some((b) => b.type === "text");
|
|
100
|
-
if (!hasText) {
|
|
101
|
-
blocks.unshift({
|
|
102
|
-
type: "text",
|
|
103
|
-
text: "(see attached image)",
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
return blocks;
|
|
107
|
-
}
|
|
108
|
-
const FINE_GRAINED_TOOL_STREAMING_BETA = "fine-grained-tool-streaming-2025-05-14";
|
|
109
|
-
const INTERLEAVED_THINKING_BETA = "interleaved-thinking-2025-05-14";
|
|
110
|
-
const DEFAULT_ANTHROPIC_TRANSIENT_MAX_RETRIES = 2;
|
|
111
|
-
const ANTHROPIC_RETRY_BASE_DELAY_MS = 1000;
|
|
112
|
-
const DEFAULT_MAX_RETRY_DELAY_MS = 60000;
|
|
113
|
-
const ANTHROPIC_RETRY_JITTER_RATIO = 0.2;
|
|
114
|
-
function getAnthropicCompat(model) {
|
|
115
|
-
// Auto-detect session affinity and cache control support from provider
|
|
116
|
-
const isFireworks = model.provider === "fireworks";
|
|
117
|
-
const isCloudflareAiGatewayAnthropic = model.provider === "cloudflare-ai-gateway" && model.baseUrl.includes("anthropic");
|
|
118
|
-
return {
|
|
119
|
-
supportsEagerToolInputStreaming: model.compat?.supportsEagerToolInputStreaming ?? !isFireworks,
|
|
120
|
-
supportsLongCacheRetention: model.compat?.supportsLongCacheRetention ?? !isFireworks,
|
|
121
|
-
sendSessionAffinityHeaders: model.compat?.sendSessionAffinityHeaders ?? !!(isFireworks || isCloudflareAiGatewayAnthropic),
|
|
122
|
-
supportsCacheControlOnTools: model.compat?.supportsCacheControlOnTools ?? !isFireworks,
|
|
123
|
-
supportsTemperature: model.compat?.supportsTemperature ?? true,
|
|
124
|
-
allowEmptySignature: model.compat?.allowEmptySignature ?? false,
|
|
125
|
-
supportsDualMessageCache: model.compat?.supportsDualMessageCache ?? false,
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
function shouldUseDualMessageCache(compat, options) {
|
|
129
|
-
if (options?.dualMessageCache !== undefined)
|
|
130
|
-
return options.dualMessageCache;
|
|
131
|
-
if (process.env.OMK_DUAL_MESSAGE_CACHE === "1" || process.env.OMK_DUAL_MESSAGE_CACHE === "true")
|
|
132
|
-
return true;
|
|
133
|
-
return compat.supportsDualMessageCache;
|
|
134
|
-
}
|
|
135
|
-
function mergeHeaders(...headerSources) {
|
|
136
|
-
const merged = {};
|
|
137
|
-
for (const headers of headerSources) {
|
|
138
|
-
if (headers) {
|
|
139
|
-
Object.assign(merged, headers);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return merged;
|
|
143
|
-
}
|
|
144
|
-
function errorMessageForRetry(error) {
|
|
145
|
-
if (error instanceof Error)
|
|
146
|
-
return error.message;
|
|
147
|
-
try {
|
|
148
|
-
return JSON.stringify(error);
|
|
149
|
-
}
|
|
150
|
-
catch {
|
|
151
|
-
return String(error);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
function getRecord(value) {
|
|
155
|
-
return typeof value === "object" && value !== null ? value : undefined;
|
|
156
|
-
}
|
|
157
|
-
function getStringProperty(value, key) {
|
|
158
|
-
const record = getRecord(value);
|
|
159
|
-
if (!record)
|
|
160
|
-
return undefined;
|
|
161
|
-
const property = record[key];
|
|
162
|
-
return typeof property === "string" ? property : undefined;
|
|
163
|
-
}
|
|
164
|
-
function getNumberProperty(value, key) {
|
|
165
|
-
const record = getRecord(value);
|
|
166
|
-
if (!record)
|
|
167
|
-
return undefined;
|
|
168
|
-
const property = record[key];
|
|
169
|
-
return typeof property === "number" && Number.isFinite(property) ? property : undefined;
|
|
170
|
-
}
|
|
171
|
-
function getNestedStringProperty(value, parentKey, key) {
|
|
172
|
-
const record = getRecord(value);
|
|
173
|
-
return record ? getStringProperty(record[parentKey], key) : undefined;
|
|
174
|
-
}
|
|
175
|
-
function isAbortError(error) {
|
|
176
|
-
if (!(error instanceof Error))
|
|
177
|
-
return false;
|
|
178
|
-
return error.name === "AbortError" || error.message === "Request was aborted";
|
|
179
|
-
}
|
|
180
|
-
function isNonRetryableAnthropicLimitError(message) {
|
|
181
|
-
return /GoUsageLimitError|FreeUsageLimitError|Monthly usage limit reached|available balance|insufficient_quota|out of budget|quota exceeded|billing/i.test(message);
|
|
182
|
-
}
|
|
183
|
-
function isRetryableAnthropicError(error) {
|
|
184
|
-
if (isAbortError(error))
|
|
185
|
-
return false;
|
|
186
|
-
const message = errorMessageForRetry(error);
|
|
187
|
-
if (isNonRetryableAnthropicLimitError(message))
|
|
188
|
-
return false;
|
|
189
|
-
const status = getNumberProperty(error, "status");
|
|
190
|
-
if (status === 429 || status === 500 || status === 502 || status === 503 || status === 504 || status === 529) {
|
|
191
|
-
return true;
|
|
192
|
-
}
|
|
193
|
-
const type = getStringProperty(error, "type") ?? getNestedStringProperty(error, "error", "type");
|
|
194
|
-
if (type && /overloaded|rate_limit|api_error|timeout/i.test(type)) {
|
|
195
|
-
return true;
|
|
196
|
-
}
|
|
197
|
-
return /overloaded|rate.?limit|too many requests|service.?unavailable|server.?error|internal.?error|network.?error|connection.?error|fetch failed|socket hang up|timed? out|timeout|terminated|529|429|500|502|503|504/i.test(message);
|
|
198
|
-
}
|
|
199
|
-
function readHeader(headers, name) {
|
|
200
|
-
const record = getRecord(headers);
|
|
201
|
-
const get = record?.get;
|
|
202
|
-
if (typeof get === "function") {
|
|
203
|
-
const value = get.call(headers, name);
|
|
204
|
-
return typeof value === "string" ? value : undefined;
|
|
205
|
-
}
|
|
206
|
-
const direct = record?.[name] ?? record?.[name.toLowerCase()];
|
|
207
|
-
return typeof direct === "string" ? direct : undefined;
|
|
208
|
-
}
|
|
209
|
-
function getRetryAfterDelayMs(error) {
|
|
210
|
-
const headers = getRecord(error)?.headers;
|
|
211
|
-
const retryAfterMs = readHeader(headers, "retry-after-ms");
|
|
212
|
-
if (retryAfterMs !== undefined) {
|
|
213
|
-
const millis = Number(retryAfterMs);
|
|
214
|
-
if (Number.isFinite(millis))
|
|
215
|
-
return Math.max(0, millis);
|
|
216
|
-
}
|
|
217
|
-
const retryAfter = readHeader(headers, "retry-after");
|
|
218
|
-
if (!retryAfter)
|
|
219
|
-
return undefined;
|
|
220
|
-
const seconds = Number(retryAfter);
|
|
221
|
-
if (Number.isFinite(seconds))
|
|
222
|
-
return Math.max(0, seconds * 1000);
|
|
223
|
-
const date = Date.parse(retryAfter);
|
|
224
|
-
return Number.isNaN(date) ? undefined : Math.max(0, date - Date.now());
|
|
225
|
-
}
|
|
226
|
-
function capRetryDelayMs(delayMs, options) {
|
|
227
|
-
const maxRetryDelayMs = options?.maxRetryDelayMs ?? DEFAULT_MAX_RETRY_DELAY_MS;
|
|
228
|
-
return maxRetryDelayMs > 0 ? Math.min(delayMs, maxRetryDelayMs) : delayMs;
|
|
229
|
-
}
|
|
230
|
-
function getAnthropicRetryDelayMs(error, attempt, options) {
|
|
231
|
-
const retryAfterDelayMs = getRetryAfterDelayMs(error);
|
|
232
|
-
if (retryAfterDelayMs !== undefined) {
|
|
233
|
-
return capRetryDelayMs(retryAfterDelayMs, options);
|
|
234
|
-
}
|
|
235
|
-
const exponentialDelayMs = ANTHROPIC_RETRY_BASE_DELAY_MS * 2 ** attempt;
|
|
236
|
-
const jitterMs = Math.floor(Math.random() * exponentialDelayMs * ANTHROPIC_RETRY_JITTER_RATIO);
|
|
237
|
-
return capRetryDelayMs(exponentialDelayMs + jitterMs, options);
|
|
238
|
-
}
|
|
239
|
-
function sleep(ms, signal) {
|
|
240
|
-
return new Promise((resolve, reject) => {
|
|
241
|
-
if (signal?.aborted) {
|
|
242
|
-
reject(new Error("Request was aborted"));
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
const timeout = setTimeout(resolve, ms);
|
|
246
|
-
signal?.addEventListener("abort", () => {
|
|
247
|
-
clearTimeout(timeout);
|
|
248
|
-
reject(new Error("Request was aborted"));
|
|
249
|
-
}, { once: true });
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
const ANTHROPIC_MESSAGE_EVENTS = new Set([
|
|
253
|
-
"message_start",
|
|
254
|
-
"message_delta",
|
|
255
|
-
"message_stop",
|
|
256
|
-
"content_block_start",
|
|
257
|
-
"content_block_delta",
|
|
258
|
-
"content_block_stop",
|
|
259
|
-
]);
|
|
260
|
-
function flushSseEvent(state) {
|
|
261
|
-
if (!state.event && state.data.length === 0) {
|
|
262
|
-
return null;
|
|
263
|
-
}
|
|
264
|
-
const event = {
|
|
265
|
-
event: state.event,
|
|
266
|
-
data: state.data.join("\n"),
|
|
267
|
-
raw: [...state.raw],
|
|
268
|
-
};
|
|
269
|
-
state.event = null;
|
|
270
|
-
state.data = [];
|
|
271
|
-
state.raw = [];
|
|
272
|
-
return event;
|
|
273
|
-
}
|
|
274
|
-
function decodeSseLine(line, state) {
|
|
275
|
-
if (line === "") {
|
|
276
|
-
return flushSseEvent(state);
|
|
277
|
-
}
|
|
278
|
-
state.raw.push(line);
|
|
279
|
-
if (line.startsWith(":")) {
|
|
280
|
-
return null;
|
|
281
|
-
}
|
|
282
|
-
const delimiterIndex = line.indexOf(":");
|
|
283
|
-
const fieldName = delimiterIndex === -1 ? line : line.slice(0, delimiterIndex);
|
|
284
|
-
let value = delimiterIndex === -1 ? "" : line.slice(delimiterIndex + 1);
|
|
285
|
-
if (value.startsWith(" ")) {
|
|
286
|
-
value = value.slice(1);
|
|
287
|
-
}
|
|
288
|
-
if (fieldName === "event") {
|
|
289
|
-
state.event = value;
|
|
290
|
-
}
|
|
291
|
-
else if (fieldName === "data") {
|
|
292
|
-
state.data.push(value);
|
|
293
|
-
}
|
|
294
|
-
return null;
|
|
295
|
-
}
|
|
296
|
-
function nextLineBreakIndex(text) {
|
|
297
|
-
const carriageReturnIndex = text.indexOf("\r");
|
|
298
|
-
const newlineIndex = text.indexOf("\n");
|
|
299
|
-
if (carriageReturnIndex === -1) {
|
|
300
|
-
return newlineIndex;
|
|
301
|
-
}
|
|
302
|
-
if (newlineIndex === -1) {
|
|
303
|
-
return carriageReturnIndex;
|
|
304
|
-
}
|
|
305
|
-
return Math.min(carriageReturnIndex, newlineIndex);
|
|
306
|
-
}
|
|
307
|
-
function consumeLine(text) {
|
|
308
|
-
const lineBreakIndex = nextLineBreakIndex(text);
|
|
309
|
-
if (lineBreakIndex === -1) {
|
|
310
|
-
return null;
|
|
311
|
-
}
|
|
312
|
-
let nextIndex = lineBreakIndex + 1;
|
|
313
|
-
if (text[lineBreakIndex] === "\r" && text[nextIndex] === "\n") {
|
|
314
|
-
nextIndex += 1;
|
|
315
|
-
}
|
|
316
|
-
return {
|
|
317
|
-
line: text.slice(0, lineBreakIndex),
|
|
318
|
-
rest: text.slice(nextIndex),
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
async function* iterateSseMessages(body, signal) {
|
|
322
|
-
const reader = body.getReader();
|
|
323
|
-
const decoder = new TextDecoder();
|
|
324
|
-
const state = { event: null, data: [], raw: [] };
|
|
325
|
-
let buffer = "";
|
|
326
|
-
try {
|
|
327
|
-
while (true) {
|
|
328
|
-
if (signal?.aborted) {
|
|
329
|
-
throw new Error("Request was aborted");
|
|
330
|
-
}
|
|
331
|
-
const { value, done } = await reader.read();
|
|
332
|
-
if (done) {
|
|
333
|
-
break;
|
|
334
|
-
}
|
|
335
|
-
buffer += decoder.decode(value, { stream: true });
|
|
336
|
-
let consumed = consumeLine(buffer);
|
|
337
|
-
while (consumed) {
|
|
338
|
-
buffer = consumed.rest;
|
|
339
|
-
const event = decodeSseLine(consumed.line, state);
|
|
340
|
-
if (event) {
|
|
341
|
-
yield event;
|
|
342
|
-
}
|
|
343
|
-
consumed = consumeLine(buffer);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
buffer += decoder.decode();
|
|
347
|
-
let consumed = consumeLine(buffer);
|
|
348
|
-
while (consumed) {
|
|
349
|
-
buffer = consumed.rest;
|
|
350
|
-
const event = decodeSseLine(consumed.line, state);
|
|
351
|
-
if (event) {
|
|
352
|
-
yield event;
|
|
353
|
-
}
|
|
354
|
-
consumed = consumeLine(buffer);
|
|
355
|
-
}
|
|
356
|
-
if (buffer.length > 0) {
|
|
357
|
-
const event = decodeSseLine(buffer, state);
|
|
358
|
-
if (event) {
|
|
359
|
-
yield event;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
const trailingEvent = flushSseEvent(state);
|
|
363
|
-
if (trailingEvent) {
|
|
364
|
-
yield trailingEvent;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
finally {
|
|
368
|
-
reader.releaseLock();
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
async function* iterateAnthropicEvents(response, signal) {
|
|
372
|
-
if (!response.body) {
|
|
373
|
-
throw new Error("Attempted to iterate over an Anthropic response with no body");
|
|
374
|
-
}
|
|
375
|
-
let sawMessageStart = false;
|
|
376
|
-
let sawMessageEnd = false;
|
|
377
|
-
for await (const sse of iterateSseMessages(response.body, signal)) {
|
|
378
|
-
if (sse.event === "error") {
|
|
379
|
-
throw new Error(sse.data);
|
|
380
|
-
}
|
|
381
|
-
if (!ANTHROPIC_MESSAGE_EVENTS.has(sse.event ?? "")) {
|
|
382
|
-
continue;
|
|
383
|
-
}
|
|
384
|
-
try {
|
|
385
|
-
const event = parseJsonWithRepair(sse.data);
|
|
386
|
-
if (event.type === "message_start") {
|
|
387
|
-
sawMessageStart = true;
|
|
388
|
-
}
|
|
389
|
-
else if (event.type === "message_stop") {
|
|
390
|
-
sawMessageEnd = true;
|
|
391
|
-
}
|
|
392
|
-
yield event;
|
|
393
|
-
}
|
|
394
|
-
catch (error) {
|
|
395
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
396
|
-
throw new Error(`Could not parse Anthropic SSE event ${sse.event}: ${message}; data=${sse.data}; raw=${sse.raw.join("\\n")}`);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
if (sawMessageStart && !sawMessageEnd) {
|
|
400
|
-
throw new Error("Anthropic stream ended before message_stop");
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
export const streamAnthropic = (model, context, options) => {
|
|
404
|
-
const stream = new AssistantMessageEventStream();
|
|
405
|
-
(async () => {
|
|
406
|
-
const output = {
|
|
407
|
-
role: "assistant",
|
|
408
|
-
content: [],
|
|
409
|
-
api: model.api,
|
|
410
|
-
provider: model.provider,
|
|
411
|
-
model: model.id,
|
|
412
|
-
usage: {
|
|
413
|
-
input: 0,
|
|
414
|
-
output: 0,
|
|
415
|
-
cacheRead: 0,
|
|
416
|
-
cacheWrite: 0,
|
|
417
|
-
totalTokens: 0,
|
|
418
|
-
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
|
|
419
|
-
},
|
|
420
|
-
stopReason: "stop",
|
|
421
|
-
timestamp: Date.now(),
|
|
422
|
-
};
|
|
423
|
-
try {
|
|
424
|
-
let client;
|
|
425
|
-
let isOAuth;
|
|
426
|
-
if (options?.client) {
|
|
427
|
-
client = options.client;
|
|
428
|
-
isOAuth = false;
|
|
429
|
-
}
|
|
430
|
-
else {
|
|
431
|
-
const apiKey = options?.apiKey;
|
|
432
|
-
if (!apiKey) {
|
|
433
|
-
throw new Error(`No API key for provider: ${model.provider}`);
|
|
434
|
-
}
|
|
435
|
-
let copilotDynamicHeaders;
|
|
436
|
-
if (model.provider === "github-copilot") {
|
|
437
|
-
const hasImages = hasCopilotVisionInput(context.messages);
|
|
438
|
-
copilotDynamicHeaders = buildCopilotDynamicHeaders({
|
|
439
|
-
messages: context.messages,
|
|
440
|
-
hasImages,
|
|
441
|
-
});
|
|
442
|
-
}
|
|
443
|
-
const cacheRetention = options?.cacheRetention ?? resolveCacheRetention();
|
|
444
|
-
const cacheSessionId = cacheRetention === "none" ? undefined : options?.sessionId;
|
|
445
|
-
const created = createClient(model, apiKey, options?.interleavedThinking ?? true, shouldUseFineGrainedToolStreamingBeta(model, context), options?.headers, copilotDynamicHeaders, cacheSessionId);
|
|
446
|
-
client = created.client;
|
|
447
|
-
isOAuth = created.isOAuthToken;
|
|
448
|
-
}
|
|
449
|
-
let params = buildParams(model, context, isOAuth, options);
|
|
450
|
-
const nextParams = await options?.onPayload?.(params, model);
|
|
451
|
-
if (nextParams !== undefined) {
|
|
452
|
-
params = nextParams;
|
|
453
|
-
}
|
|
454
|
-
const requestOptions = {
|
|
455
|
-
...(options?.signal ? { signal: options.signal } : {}),
|
|
456
|
-
...(options?.timeoutMs !== undefined ? { timeout: options.timeoutMs } : {}),
|
|
457
|
-
// Keep SDK retries disabled so OMK can apply one bounded, observable
|
|
458
|
-
// policy for Anthropic 529/overloaded_error and related transient errors.
|
|
459
|
-
maxRetries: 0,
|
|
460
|
-
};
|
|
461
|
-
const maxRetries = options?.maxRetries ?? DEFAULT_ANTHROPIC_TRANSIENT_MAX_RETRIES;
|
|
462
|
-
let response;
|
|
463
|
-
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
464
|
-
try {
|
|
465
|
-
response = await client.messages.create({ ...params, stream: true }, requestOptions).asResponse();
|
|
466
|
-
break;
|
|
467
|
-
}
|
|
468
|
-
catch (error) {
|
|
469
|
-
if (options?.signal?.aborted || attempt >= maxRetries || !isRetryableAnthropicError(error)) {
|
|
470
|
-
throw error;
|
|
471
|
-
}
|
|
472
|
-
await sleep(getAnthropicRetryDelayMs(error, attempt, options), options?.signal);
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
if (!response) {
|
|
476
|
-
throw new Error("Anthropic request failed before receiving a response");
|
|
477
|
-
}
|
|
478
|
-
await options?.onResponse?.({ status: response.status, headers: headersToRecord(response.headers) }, model);
|
|
479
|
-
stream.push({ type: "start", partial: output });
|
|
480
|
-
const blocks = output.content;
|
|
481
|
-
for await (const event of iterateAnthropicEvents(response, options?.signal)) {
|
|
482
|
-
if (event.type === "message_start") {
|
|
483
|
-
output.responseId = event.message.id;
|
|
484
|
-
// Capture initial token usage from message_start event
|
|
485
|
-
// This ensures we have input token counts even if the stream is aborted early
|
|
486
|
-
output.usage.input = event.message.usage.input_tokens || 0;
|
|
487
|
-
output.usage.output = event.message.usage.output_tokens || 0;
|
|
488
|
-
output.usage.cacheRead = event.message.usage.cache_read_input_tokens || 0;
|
|
489
|
-
output.usage.cacheWrite = event.message.usage.cache_creation_input_tokens || 0;
|
|
490
|
-
// Anthropic doesn't provide total_tokens, compute from components
|
|
491
|
-
output.usage.totalTokens =
|
|
492
|
-
output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite;
|
|
493
|
-
calculateCost(model, output.usage);
|
|
494
|
-
}
|
|
495
|
-
else if (event.type === "content_block_start") {
|
|
496
|
-
if (event.content_block.type === "text") {
|
|
497
|
-
const block = {
|
|
498
|
-
type: "text",
|
|
499
|
-
text: "",
|
|
500
|
-
index: event.index,
|
|
501
|
-
};
|
|
502
|
-
output.content.push(block);
|
|
503
|
-
stream.push({ type: "text_start", contentIndex: output.content.length - 1, partial: output });
|
|
504
|
-
}
|
|
505
|
-
else if (event.content_block.type === "thinking") {
|
|
506
|
-
const block = {
|
|
507
|
-
type: "thinking",
|
|
508
|
-
thinking: "",
|
|
509
|
-
thinkingSignature: "",
|
|
510
|
-
index: event.index,
|
|
511
|
-
};
|
|
512
|
-
output.content.push(block);
|
|
513
|
-
stream.push({ type: "thinking_start", contentIndex: output.content.length - 1, partial: output });
|
|
514
|
-
}
|
|
515
|
-
else if (event.content_block.type === "redacted_thinking") {
|
|
516
|
-
const block = {
|
|
517
|
-
type: "thinking",
|
|
518
|
-
thinking: "[Reasoning redacted]",
|
|
519
|
-
thinkingSignature: event.content_block.data,
|
|
520
|
-
redacted: true,
|
|
521
|
-
index: event.index,
|
|
522
|
-
};
|
|
523
|
-
output.content.push(block);
|
|
524
|
-
stream.push({ type: "thinking_start", contentIndex: output.content.length - 1, partial: output });
|
|
525
|
-
}
|
|
526
|
-
else if (event.content_block.type === "tool_use") {
|
|
527
|
-
const block = {
|
|
528
|
-
type: "toolCall",
|
|
529
|
-
id: event.content_block.id,
|
|
530
|
-
name: isOAuth
|
|
531
|
-
? fromClaudeCodeName(event.content_block.name, context.tools)
|
|
532
|
-
: event.content_block.name,
|
|
533
|
-
arguments: event.content_block.input ?? {},
|
|
534
|
-
partialJson: "",
|
|
535
|
-
index: event.index,
|
|
536
|
-
};
|
|
537
|
-
output.content.push(block);
|
|
538
|
-
stream.push({ type: "toolcall_start", contentIndex: output.content.length - 1, partial: output });
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
else if (event.type === "content_block_delta") {
|
|
542
|
-
if (event.delta.type === "text_delta") {
|
|
543
|
-
const index = blocks.findIndex((b) => b.index === event.index);
|
|
544
|
-
const block = blocks[index];
|
|
545
|
-
if (block && block.type === "text") {
|
|
546
|
-
block.text += event.delta.text;
|
|
547
|
-
stream.push({
|
|
548
|
-
type: "text_delta",
|
|
549
|
-
contentIndex: index,
|
|
550
|
-
delta: event.delta.text,
|
|
551
|
-
partial: output,
|
|
552
|
-
});
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
else if (event.delta.type === "thinking_delta") {
|
|
556
|
-
const index = blocks.findIndex((b) => b.index === event.index);
|
|
557
|
-
const block = blocks[index];
|
|
558
|
-
if (block && block.type === "thinking") {
|
|
559
|
-
block.thinking += event.delta.thinking;
|
|
560
|
-
stream.push({
|
|
561
|
-
type: "thinking_delta",
|
|
562
|
-
contentIndex: index,
|
|
563
|
-
delta: event.delta.thinking,
|
|
564
|
-
partial: output,
|
|
565
|
-
});
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
else if (event.delta.type === "input_json_delta") {
|
|
569
|
-
const index = blocks.findIndex((b) => b.index === event.index);
|
|
570
|
-
const block = blocks[index];
|
|
571
|
-
if (block && block.type === "toolCall") {
|
|
572
|
-
block.partialJson += event.delta.partial_json;
|
|
573
|
-
block.arguments = parseStreamingJson(block.partialJson);
|
|
574
|
-
stream.push({
|
|
575
|
-
type: "toolcall_delta",
|
|
576
|
-
contentIndex: index,
|
|
577
|
-
delta: event.delta.partial_json,
|
|
578
|
-
partial: output,
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
else if (event.delta.type === "signature_delta") {
|
|
583
|
-
const index = blocks.findIndex((b) => b.index === event.index);
|
|
584
|
-
const block = blocks[index];
|
|
585
|
-
if (block && block.type === "thinking") {
|
|
586
|
-
block.thinkingSignature = block.thinkingSignature || "";
|
|
587
|
-
block.thinkingSignature += event.delta.signature;
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
else if (event.type === "content_block_stop") {
|
|
592
|
-
const index = blocks.findIndex((b) => b.index === event.index);
|
|
593
|
-
const block = blocks[index];
|
|
594
|
-
if (block) {
|
|
595
|
-
delete block.index;
|
|
596
|
-
if (block.type === "text") {
|
|
597
|
-
stream.push({
|
|
598
|
-
type: "text_end",
|
|
599
|
-
contentIndex: index,
|
|
600
|
-
content: block.text,
|
|
601
|
-
partial: output,
|
|
602
|
-
});
|
|
603
|
-
}
|
|
604
|
-
else if (block.type === "thinking") {
|
|
605
|
-
stream.push({
|
|
606
|
-
type: "thinking_end",
|
|
607
|
-
contentIndex: index,
|
|
608
|
-
content: block.thinking,
|
|
609
|
-
partial: output,
|
|
610
|
-
});
|
|
611
|
-
}
|
|
612
|
-
else if (block.type === "toolCall") {
|
|
613
|
-
block.arguments = parseStreamingJson(block.partialJson);
|
|
614
|
-
// Finalize in-place and strip the scratch buffer so replay only
|
|
615
|
-
// carries parsed arguments.
|
|
616
|
-
delete block.partialJson;
|
|
617
|
-
stream.push({
|
|
618
|
-
type: "toolcall_end",
|
|
619
|
-
contentIndex: index,
|
|
620
|
-
toolCall: block,
|
|
621
|
-
partial: output,
|
|
622
|
-
});
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
else if (event.type === "message_delta") {
|
|
627
|
-
if (event.delta.stop_reason) {
|
|
628
|
-
output.stopReason = mapStopReason(event.delta.stop_reason);
|
|
629
|
-
}
|
|
630
|
-
// Only update usage fields if present (not null).
|
|
631
|
-
// Preserves input_tokens from message_start when proxies omit it in message_delta.
|
|
632
|
-
if (event.usage.input_tokens != null) {
|
|
633
|
-
output.usage.input = event.usage.input_tokens;
|
|
634
|
-
}
|
|
635
|
-
if (event.usage.output_tokens != null) {
|
|
636
|
-
output.usage.output = event.usage.output_tokens;
|
|
637
|
-
}
|
|
638
|
-
if (event.usage.cache_read_input_tokens != null) {
|
|
639
|
-
output.usage.cacheRead = event.usage.cache_read_input_tokens;
|
|
640
|
-
}
|
|
641
|
-
if (event.usage.cache_creation_input_tokens != null) {
|
|
642
|
-
output.usage.cacheWrite = event.usage.cache_creation_input_tokens;
|
|
643
|
-
}
|
|
644
|
-
// Anthropic doesn't provide total_tokens, compute from components
|
|
645
|
-
output.usage.totalTokens =
|
|
646
|
-
output.usage.input + output.usage.output + output.usage.cacheRead + output.usage.cacheWrite;
|
|
647
|
-
calculateCost(model, output.usage);
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
if (options?.signal?.aborted) {
|
|
651
|
-
throw new Error("Request was aborted");
|
|
652
|
-
}
|
|
653
|
-
if (output.stopReason === "aborted" || output.stopReason === "error") {
|
|
654
|
-
throw new Error("An unknown error occurred");
|
|
655
|
-
}
|
|
656
|
-
stream.push({ type: "done", reason: output.stopReason, message: output });
|
|
657
|
-
stream.end();
|
|
658
|
-
}
|
|
659
|
-
catch (error) {
|
|
660
|
-
for (const block of output.content) {
|
|
661
|
-
delete block.index;
|
|
662
|
-
// partialJson is only a streaming scratch buffer; never persist it.
|
|
663
|
-
delete block.partialJson;
|
|
664
|
-
}
|
|
665
|
-
output.stopReason = options?.signal?.aborted ? "aborted" : "error";
|
|
666
|
-
output.errorMessage = error instanceof Error ? error.message : JSON.stringify(error);
|
|
667
|
-
stream.push({ type: "error", reason: output.stopReason, error: output });
|
|
668
|
-
stream.end();
|
|
669
|
-
}
|
|
670
|
-
})();
|
|
671
|
-
return stream;
|
|
672
|
-
};
|
|
673
|
-
/**
|
|
674
|
-
* Map ThinkingLevel to Anthropic effort levels for adaptive thinking.
|
|
675
|
-
* Note: effort "max" is only valid on Opus 4.6, while Opus 4.7 supports "xhigh".
|
|
676
|
-
*/
|
|
677
|
-
function mapThinkingLevelToEffort(model, level) {
|
|
678
|
-
const mapped = level ? model.thinkingLevelMap?.[level] : undefined;
|
|
679
|
-
if (typeof mapped === "string")
|
|
680
|
-
return mapped;
|
|
681
|
-
switch (level) {
|
|
682
|
-
case "minimal":
|
|
683
|
-
case "low":
|
|
684
|
-
return "low";
|
|
685
|
-
case "medium":
|
|
686
|
-
return "medium";
|
|
687
|
-
case "high":
|
|
688
|
-
return "high";
|
|
689
|
-
default:
|
|
690
|
-
return "high";
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
export const streamSimpleAnthropic = (model, context, options) => {
|
|
694
|
-
const apiKey = options?.apiKey;
|
|
695
|
-
if (!apiKey) {
|
|
696
|
-
throw new Error(`No API key for provider: ${model.provider}`);
|
|
697
|
-
}
|
|
698
|
-
const base = buildBaseOptions(model, options, apiKey);
|
|
699
|
-
if (!options?.reasoning) {
|
|
700
|
-
return streamAnthropic(model, context, { ...base, thinkingEnabled: false });
|
|
701
|
-
}
|
|
702
|
-
// For models with adaptive thinking: use an effort level.
|
|
703
|
-
// For older models: use budget-based thinking.
|
|
704
|
-
if (model.compat?.forceAdaptiveThinking === true) {
|
|
705
|
-
const effort = mapThinkingLevelToEffort(model, options.reasoning);
|
|
706
|
-
return streamAnthropic(model, context, {
|
|
707
|
-
...base,
|
|
708
|
-
thinkingEnabled: true,
|
|
709
|
-
effort,
|
|
710
|
-
});
|
|
711
|
-
}
|
|
712
|
-
// Undefined means the caller did not request an output cap; let the helper use the model cap.
|
|
713
|
-
// Do not coerce to 0 here, or the thinking budget would become the entire max_tokens value.
|
|
714
|
-
const adjusted = adjustMaxTokensForThinking(base.maxTokens, model.maxTokens, options.reasoning, options.thinkingBudgets);
|
|
715
|
-
return streamAnthropic(model, context, {
|
|
716
|
-
...base,
|
|
717
|
-
maxTokens: adjusted.maxTokens,
|
|
718
|
-
thinkingEnabled: true,
|
|
719
|
-
thinkingBudgetTokens: adjusted.thinkingBudget,
|
|
720
|
-
});
|
|
721
|
-
};
|
|
722
|
-
function isOAuthToken(apiKey) {
|
|
723
|
-
return apiKey.includes("sk-ant-oat");
|
|
724
|
-
}
|
|
725
|
-
function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStreamingBeta, optionsHeaders, dynamicHeaders, sessionId) {
|
|
726
|
-
// Adaptive thinking models have interleaved thinking built in, so skip the beta header.
|
|
727
|
-
const needsInterleavedBeta = interleavedThinking && model.compat?.forceAdaptiveThinking !== true;
|
|
728
|
-
const betaFeatures = [];
|
|
729
|
-
if (useFineGrainedToolStreamingBeta) {
|
|
730
|
-
betaFeatures.push(FINE_GRAINED_TOOL_STREAMING_BETA);
|
|
731
|
-
}
|
|
732
|
-
if (needsInterleavedBeta) {
|
|
733
|
-
betaFeatures.push(INTERLEAVED_THINKING_BETA);
|
|
734
|
-
}
|
|
735
|
-
if (model.provider === "cloudflare-ai-gateway") {
|
|
736
|
-
const client = new Anthropic({
|
|
737
|
-
apiKey: null,
|
|
738
|
-
authToken: null,
|
|
739
|
-
baseURL: resolveCloudflareBaseUrl(model),
|
|
740
|
-
dangerouslyAllowBrowser: true,
|
|
741
|
-
defaultHeaders: mergeHeaders({
|
|
742
|
-
accept: "application/json",
|
|
743
|
-
"anthropic-dangerous-direct-browser-access": "true",
|
|
744
|
-
"cf-aig-authorization": `Bearer ${apiKey}`,
|
|
745
|
-
"x-api-key": null,
|
|
746
|
-
Authorization: null,
|
|
747
|
-
...(betaFeatures.length > 0 ? { "anthropic-beta": betaFeatures.join(",") } : {}),
|
|
748
|
-
}, model.headers, optionsHeaders),
|
|
749
|
-
});
|
|
750
|
-
return { client, isOAuthToken: false };
|
|
751
|
-
}
|
|
752
|
-
// Copilot: Bearer auth, selective betas.
|
|
753
|
-
if (model.provider === "github-copilot") {
|
|
754
|
-
const client = new Anthropic({
|
|
755
|
-
apiKey: null,
|
|
756
|
-
authToken: apiKey,
|
|
757
|
-
baseURL: model.baseUrl,
|
|
758
|
-
dangerouslyAllowBrowser: true,
|
|
759
|
-
defaultHeaders: mergeHeaders({
|
|
760
|
-
accept: "application/json",
|
|
761
|
-
"anthropic-dangerous-direct-browser-access": "true",
|
|
762
|
-
...(betaFeatures.length > 0 ? { "anthropic-beta": betaFeatures.join(",") } : {}),
|
|
763
|
-
}, model.headers, dynamicHeaders, optionsHeaders),
|
|
764
|
-
});
|
|
765
|
-
return { client, isOAuthToken: false };
|
|
766
|
-
}
|
|
767
|
-
// OAuth: Bearer auth, Claude Code identity headers
|
|
768
|
-
if (isOAuthToken(apiKey)) {
|
|
769
|
-
const client = new Anthropic({
|
|
770
|
-
apiKey: null,
|
|
771
|
-
authToken: apiKey,
|
|
772
|
-
baseURL: model.baseUrl,
|
|
773
|
-
dangerouslyAllowBrowser: true,
|
|
774
|
-
defaultHeaders: mergeHeaders({
|
|
775
|
-
accept: "application/json",
|
|
776
|
-
"anthropic-dangerous-direct-browser-access": "true",
|
|
777
|
-
"anthropic-beta": ["claude-code-20250219", "oauth-2025-04-20", ...betaFeatures].join(","),
|
|
778
|
-
"user-agent": `claude-cli/${claudeCodeVersion}`,
|
|
779
|
-
"x-app": "cli",
|
|
780
|
-
}, model.headers, optionsHeaders),
|
|
781
|
-
});
|
|
782
|
-
return { client, isOAuthToken: true };
|
|
783
|
-
}
|
|
784
|
-
// API key auth
|
|
785
|
-
const sessionAffinityHeaders = sessionId && getAnthropicCompat(model).sendSessionAffinityHeaders ? { "x-session-affinity": sessionId } : {};
|
|
786
|
-
const client = new Anthropic({
|
|
787
|
-
apiKey,
|
|
788
|
-
authToken: null,
|
|
789
|
-
baseURL: model.baseUrl,
|
|
790
|
-
dangerouslyAllowBrowser: true,
|
|
791
|
-
defaultHeaders: mergeHeaders({
|
|
792
|
-
accept: "application/json",
|
|
793
|
-
"anthropic-dangerous-direct-browser-access": "true",
|
|
794
|
-
...(betaFeatures.length > 0 ? { "anthropic-beta": betaFeatures.join(",") } : {}),
|
|
795
|
-
}, sessionAffinityHeaders, model.headers, optionsHeaders),
|
|
796
|
-
});
|
|
797
|
-
return { client, isOAuthToken: false };
|
|
798
|
-
}
|
|
799
|
-
function buildParams(model, context, isOAuthToken, options) {
|
|
800
|
-
const { cacheControl } = getCacheControl(model, options?.cacheRetention);
|
|
801
|
-
const compat = getAnthropicCompat(model);
|
|
802
|
-
const dualMessageCache = shouldUseDualMessageCache(compat, options);
|
|
803
|
-
const params = {
|
|
804
|
-
model: model.id,
|
|
805
|
-
messages: convertMessages(context.messages, model, isOAuthToken, cacheControl, compat.allowEmptySignature, dualMessageCache),
|
|
806
|
-
max_tokens: options?.maxTokens ?? model.maxTokens,
|
|
807
|
-
stream: true,
|
|
808
|
-
};
|
|
809
|
-
// For OAuth tokens, we MUST include Claude Code identity
|
|
810
|
-
if (isOAuthToken) {
|
|
811
|
-
params.system = [
|
|
812
|
-
{
|
|
813
|
-
type: "text",
|
|
814
|
-
text: "You are Claude Code, Anthropic's official CLI for Claude.",
|
|
815
|
-
...(cacheControl ? { cache_control: cacheControl } : {}),
|
|
816
|
-
},
|
|
817
|
-
];
|
|
818
|
-
if (context.systemPrompt) {
|
|
819
|
-
params.system.push({
|
|
820
|
-
type: "text",
|
|
821
|
-
text: sanitizeSurrogates(context.systemPrompt),
|
|
822
|
-
...(cacheControl ? { cache_control: cacheControl } : {}),
|
|
823
|
-
});
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
else if (context.systemPrompt) {
|
|
827
|
-
// Add cache control to system prompt for non-OAuth tokens
|
|
828
|
-
params.system = [
|
|
829
|
-
{
|
|
830
|
-
type: "text",
|
|
831
|
-
text: sanitizeSurrogates(context.systemPrompt),
|
|
832
|
-
...(cacheControl ? { cache_control: cacheControl } : {}),
|
|
833
|
-
},
|
|
834
|
-
];
|
|
835
|
-
}
|
|
836
|
-
// Temperature is incompatible with extended thinking and unsupported on Claude Opus 4.7+.
|
|
837
|
-
if (options?.temperature !== undefined && !options?.thinkingEnabled && compat.supportsTemperature) {
|
|
838
|
-
params.temperature = options.temperature;
|
|
839
|
-
}
|
|
840
|
-
if (context.tools && context.tools.length > 0) {
|
|
841
|
-
params.tools = convertTools(context.tools, isOAuthToken, compat.supportsEagerToolInputStreaming, compat.supportsCacheControlOnTools ? cacheControl : undefined);
|
|
842
|
-
}
|
|
843
|
-
// Configure thinking mode: adaptive, budget-based, or explicitly disabled.
|
|
844
|
-
if (model.reasoning) {
|
|
845
|
-
if (options?.thinkingEnabled) {
|
|
846
|
-
// Default to "summarized" so Opus 4.7 and Mythos Preview behave like
|
|
847
|
-
// older Claude 4 models (whose API default is also "summarized").
|
|
848
|
-
const display = options.thinkingDisplay ?? "summarized";
|
|
849
|
-
if (model.compat?.forceAdaptiveThinking === true) {
|
|
850
|
-
// Adaptive thinking: Claude decides when and how much to think.
|
|
851
|
-
params.thinking = { type: "adaptive", display };
|
|
852
|
-
if (options.effort) {
|
|
853
|
-
// The Anthropic SDK types can lag newly supported effort values such as "max" and "xhigh".
|
|
854
|
-
params.output_config = { effort: options.effort };
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
else {
|
|
858
|
-
// Budget-based thinking for older models
|
|
859
|
-
params.thinking = {
|
|
860
|
-
type: "enabled",
|
|
861
|
-
budget_tokens: options.thinkingBudgetTokens || 1024,
|
|
862
|
-
display,
|
|
863
|
-
};
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
else if (options?.thinkingEnabled === false) {
|
|
867
|
-
params.thinking = { type: "disabled" };
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
if (options?.metadata) {
|
|
871
|
-
const userId = options.metadata.user_id;
|
|
872
|
-
if (typeof userId === "string") {
|
|
873
|
-
params.metadata = { user_id: userId };
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
if (options?.toolChoice) {
|
|
877
|
-
if (typeof options.toolChoice === "string") {
|
|
878
|
-
params.tool_choice = { type: options.toolChoice };
|
|
879
|
-
}
|
|
880
|
-
else {
|
|
881
|
-
params.tool_choice = options.toolChoice;
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
return params;
|
|
885
|
-
}
|
|
886
|
-
// Normalize tool call IDs to match Anthropic's required pattern and length
|
|
887
|
-
function normalizeToolCallId(id) {
|
|
888
|
-
return id.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 64);
|
|
889
|
-
}
|
|
890
|
-
function convertMessages(messages, model, isOAuthToken, cacheControl, allowEmptySignature = false, dualMessageCache = false) {
|
|
891
|
-
const params = [];
|
|
892
|
-
// Transform messages for cross-provider compatibility
|
|
893
|
-
const transformedMessages = transformMessages(messages, model, normalizeToolCallId);
|
|
894
|
-
for (let i = 0; i < transformedMessages.length; i++) {
|
|
895
|
-
const msg = transformedMessages[i];
|
|
896
|
-
if (msg.role === "user") {
|
|
897
|
-
if (typeof msg.content === "string") {
|
|
898
|
-
if (msg.content.trim().length > 0) {
|
|
899
|
-
params.push({
|
|
900
|
-
role: "user",
|
|
901
|
-
content: sanitizeSurrogates(msg.content),
|
|
902
|
-
});
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
else {
|
|
906
|
-
const blocks = msg.content.map((item) => {
|
|
907
|
-
if (item.type === "text") {
|
|
908
|
-
return {
|
|
909
|
-
type: "text",
|
|
910
|
-
text: sanitizeSurrogates(item.text),
|
|
911
|
-
};
|
|
912
|
-
}
|
|
913
|
-
else {
|
|
914
|
-
return {
|
|
915
|
-
type: "image",
|
|
916
|
-
source: {
|
|
917
|
-
type: "base64",
|
|
918
|
-
media_type: item.mimeType,
|
|
919
|
-
data: item.data,
|
|
920
|
-
},
|
|
921
|
-
};
|
|
922
|
-
}
|
|
923
|
-
});
|
|
924
|
-
const filteredBlocks = blocks.filter((b) => {
|
|
925
|
-
if (b.type === "text") {
|
|
926
|
-
return b.text.trim().length > 0;
|
|
927
|
-
}
|
|
928
|
-
return true;
|
|
929
|
-
});
|
|
930
|
-
if (filteredBlocks.length === 0)
|
|
931
|
-
continue;
|
|
932
|
-
params.push({
|
|
933
|
-
role: "user",
|
|
934
|
-
content: filteredBlocks,
|
|
935
|
-
});
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
else if (msg.role === "assistant") {
|
|
939
|
-
const blocks = [];
|
|
940
|
-
for (const block of msg.content) {
|
|
941
|
-
if (block.type === "text") {
|
|
942
|
-
if (block.text.trim().length === 0)
|
|
943
|
-
continue;
|
|
944
|
-
blocks.push({
|
|
945
|
-
type: "text",
|
|
946
|
-
text: sanitizeSurrogates(block.text),
|
|
947
|
-
});
|
|
948
|
-
}
|
|
949
|
-
else if (block.type === "thinking") {
|
|
950
|
-
// Redacted thinking: pass the opaque payload back as redacted_thinking
|
|
951
|
-
if (block.redacted) {
|
|
952
|
-
blocks.push({
|
|
953
|
-
type: "redacted_thinking",
|
|
954
|
-
data: block.thinkingSignature,
|
|
955
|
-
});
|
|
956
|
-
continue;
|
|
957
|
-
}
|
|
958
|
-
if (block.thinking.trim().length === 0)
|
|
959
|
-
continue;
|
|
960
|
-
// If thinking signature is missing/empty (e.g., from aborted stream),
|
|
961
|
-
// convert to plain text for Anthropic. Some compatible providers emit
|
|
962
|
-
// and accept empty signatures, so let marked models preserve the block.
|
|
963
|
-
if (!block.thinkingSignature || block.thinkingSignature.trim().length === 0) {
|
|
964
|
-
blocks.push(allowEmptySignature
|
|
965
|
-
? {
|
|
966
|
-
type: "thinking",
|
|
967
|
-
thinking: sanitizeSurrogates(block.thinking),
|
|
968
|
-
signature: "",
|
|
969
|
-
}
|
|
970
|
-
: {
|
|
971
|
-
type: "text",
|
|
972
|
-
text: sanitizeSurrogates(block.thinking),
|
|
973
|
-
});
|
|
974
|
-
}
|
|
975
|
-
else {
|
|
976
|
-
blocks.push({
|
|
977
|
-
type: "thinking",
|
|
978
|
-
thinking: sanitizeSurrogates(block.thinking),
|
|
979
|
-
signature: block.thinkingSignature,
|
|
980
|
-
});
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
else if (block.type === "toolCall") {
|
|
984
|
-
blocks.push({
|
|
985
|
-
type: "tool_use",
|
|
986
|
-
id: block.id,
|
|
987
|
-
name: isOAuthToken ? toClaudeCodeName(block.name) : block.name,
|
|
988
|
-
input: block.arguments ?? {},
|
|
989
|
-
});
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
if (blocks.length === 0)
|
|
993
|
-
continue;
|
|
994
|
-
params.push({
|
|
995
|
-
role: "assistant",
|
|
996
|
-
content: blocks,
|
|
997
|
-
});
|
|
998
|
-
}
|
|
999
|
-
else if (msg.role === "toolResult") {
|
|
1000
|
-
// Collect all consecutive toolResult messages, needed for z.ai Anthropic endpoint
|
|
1001
|
-
const toolResults = [];
|
|
1002
|
-
// Add the current tool result
|
|
1003
|
-
toolResults.push({
|
|
1004
|
-
type: "tool_result",
|
|
1005
|
-
tool_use_id: msg.toolCallId,
|
|
1006
|
-
content: convertContentBlocks(msg.content),
|
|
1007
|
-
is_error: msg.isError,
|
|
1008
|
-
});
|
|
1009
|
-
// Look ahead for consecutive toolResult messages
|
|
1010
|
-
let j = i + 1;
|
|
1011
|
-
while (j < transformedMessages.length && transformedMessages[j].role === "toolResult") {
|
|
1012
|
-
const nextMsg = transformedMessages[j]; // We know it's a toolResult
|
|
1013
|
-
toolResults.push({
|
|
1014
|
-
type: "tool_result",
|
|
1015
|
-
tool_use_id: nextMsg.toolCallId,
|
|
1016
|
-
content: convertContentBlocks(nextMsg.content),
|
|
1017
|
-
is_error: nextMsg.isError,
|
|
1018
|
-
});
|
|
1019
|
-
j++;
|
|
1020
|
-
}
|
|
1021
|
-
// Skip the messages we've already processed
|
|
1022
|
-
i = j - 1;
|
|
1023
|
-
// Add a single user message with all tool results
|
|
1024
|
-
params.push({
|
|
1025
|
-
role: "user",
|
|
1026
|
-
content: toolResults,
|
|
1027
|
-
});
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
if (cacheControl && params.length > 0) {
|
|
1031
|
-
addCacheControlToLastUserMessage(params, cacheControl);
|
|
1032
|
-
if (dualMessageCache) {
|
|
1033
|
-
addCacheControlToLastAssistantToolUse(params, cacheControl);
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
return params;
|
|
1037
|
-
}
|
|
1038
|
-
function addCacheControlToLastUserMessage(params, cacheControl) {
|
|
1039
|
-
for (let i = params.length - 1; i >= 0; i--) {
|
|
1040
|
-
const message = params[i];
|
|
1041
|
-
if (message.role !== "user")
|
|
1042
|
-
continue;
|
|
1043
|
-
if (Array.isArray(message.content)) {
|
|
1044
|
-
for (let blockIndex = message.content.length - 1; blockIndex >= 0; blockIndex--) {
|
|
1045
|
-
const block = message.content[blockIndex];
|
|
1046
|
-
if (block.type === "text" || block.type === "image" || block.type === "tool_result") {
|
|
1047
|
-
block.cache_control = cacheControl;
|
|
1048
|
-
return true;
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
else if (typeof message.content === "string" && message.content.length > 0) {
|
|
1053
|
-
message.content = [
|
|
1054
|
-
{
|
|
1055
|
-
type: "text",
|
|
1056
|
-
text: message.content,
|
|
1057
|
-
cache_control: cacheControl,
|
|
1058
|
-
},
|
|
1059
|
-
];
|
|
1060
|
-
return true;
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
return false;
|
|
1064
|
-
}
|
|
1065
|
-
function addCacheControlToLastAssistantToolUse(params, cacheControl) {
|
|
1066
|
-
for (let i = params.length - 1; i >= 0; i--) {
|
|
1067
|
-
const message = params[i];
|
|
1068
|
-
if (message.role !== "assistant" || !Array.isArray(message.content))
|
|
1069
|
-
continue;
|
|
1070
|
-
for (let blockIndex = message.content.length - 1; blockIndex >= 0; blockIndex--) {
|
|
1071
|
-
const block = message.content[blockIndex];
|
|
1072
|
-
if (block.type === "tool_use") {
|
|
1073
|
-
block.cache_control = cacheControl;
|
|
1074
|
-
return true;
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
return false;
|
|
1079
|
-
}
|
|
1080
|
-
function shouldUseFineGrainedToolStreamingBeta(model, context) {
|
|
1081
|
-
return !!context.tools?.length && !getAnthropicCompat(model).supportsEagerToolInputStreaming;
|
|
1082
|
-
}
|
|
1083
|
-
function convertTools(tools, isOAuthToken, supportsEagerToolInputStreaming, cacheControl) {
|
|
1084
|
-
if (!tools)
|
|
1085
|
-
return [];
|
|
1086
|
-
const stable = stableTools(tools);
|
|
1087
|
-
return stable.map((tool, index) => {
|
|
1088
|
-
const schema = stableToolSchema(tool.parameters);
|
|
1089
|
-
return {
|
|
1090
|
-
name: isOAuthToken ? toClaudeCodeName(tool.name) : tool.name,
|
|
1091
|
-
description: tool.description,
|
|
1092
|
-
...(supportsEagerToolInputStreaming ? { eager_input_streaming: true } : {}),
|
|
1093
|
-
input_schema: {
|
|
1094
|
-
type: "object",
|
|
1095
|
-
properties: schema.properties ?? {},
|
|
1096
|
-
required: schema.required ?? [],
|
|
1097
|
-
},
|
|
1098
|
-
...(cacheControl && index === stable.length - 1 ? { cache_control: cacheControl } : {}),
|
|
1099
|
-
};
|
|
1100
|
-
});
|
|
1101
|
-
}
|
|
1102
|
-
function mapStopReason(reason) {
|
|
1103
|
-
switch (reason) {
|
|
1104
|
-
case "end_turn":
|
|
1105
|
-
return "stop";
|
|
1106
|
-
case "max_tokens":
|
|
1107
|
-
return "length";
|
|
1108
|
-
case "tool_use":
|
|
1109
|
-
return "toolUse";
|
|
1110
|
-
case "refusal":
|
|
1111
|
-
return "error";
|
|
1112
|
-
case "pause_turn": // Stop is good enough -> resubmit
|
|
1113
|
-
return "stop";
|
|
1114
|
-
case "stop_sequence":
|
|
1115
|
-
return "stop"; // We don't supply stop sequences, so this should never happen
|
|
1116
|
-
case "sensitive": // Content flagged by safety filters (not yet in SDK types)
|
|
1117
|
-
return "error";
|
|
1118
|
-
default:
|
|
1119
|
-
// Handle unknown stop reasons gracefully (API may add new values)
|
|
1120
|
-
throw new Error(`Unhandled stop reason: ${reason}`);
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
//# sourceMappingURL=anthropic.js.map
|