@sema-ai/core 1.275.1
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 +5433 -0
- package/LICENSE +27 -0
- package/NOTICE.md +30 -0
- package/README.md +1040 -0
- package/dist/agents/agent-definition.d.ts +10 -0
- package/dist/agents/agent-definition.d.ts.map +1 -0
- package/dist/agents/agent-definition.js +18 -0
- package/dist/agents/agent-definition.js.map +1 -0
- package/dist/agents/builtin-agents.d.ts +69 -0
- package/dist/agents/builtin-agents.d.ts.map +1 -0
- package/dist/agents/builtin-agents.js +177 -0
- package/dist/agents/builtin-agents.js.map +1 -0
- package/dist/agents/cascade.d.ts +101 -0
- package/dist/agents/cascade.d.ts.map +1 -0
- package/dist/agents/cascade.js +189 -0
- package/dist/agents/cascade.js.map +1 -0
- package/dist/agents/observer.d.ts +209 -0
- package/dist/agents/observer.d.ts.map +1 -0
- package/dist/agents/observer.js +495 -0
- package/dist/agents/observer.js.map +1 -0
- package/dist/agents/repair-loop.d.ts +236 -0
- package/dist/agents/repair-loop.d.ts.map +1 -0
- package/dist/agents/repair-loop.js +293 -0
- package/dist/agents/repair-loop.js.map +1 -0
- package/dist/agents/session-util.d.ts +8 -0
- package/dist/agents/session-util.d.ts.map +1 -0
- package/dist/agents/session-util.js +9 -0
- package/dist/agents/session-util.js.map +1 -0
- package/dist/agents/subagent-steps.d.ts +93 -0
- package/dist/agents/subagent-steps.d.ts.map +1 -0
- package/dist/agents/subagent-steps.js +206 -0
- package/dist/agents/subagent-steps.js.map +1 -0
- package/dist/agents/subagent.d.ts +441 -0
- package/dist/agents/subagent.d.ts.map +1 -0
- package/dist/agents/subagent.js +2492 -0
- package/dist/agents/subagent.js.map +1 -0
- package/dist/agents/suspend-guard.d.ts +35 -0
- package/dist/agents/suspend-guard.d.ts.map +1 -0
- package/dist/agents/suspend-guard.js +48 -0
- package/dist/agents/suspend-guard.js.map +1 -0
- package/dist/agents/teacher.d.ts +137 -0
- package/dist/agents/teacher.d.ts.map +1 -0
- package/dist/agents/teacher.js +575 -0
- package/dist/agents/teacher.js.map +1 -0
- package/dist/agents/team.d.ts +211 -0
- package/dist/agents/team.d.ts.map +1 -0
- package/dist/agents/team.js +293 -0
- package/dist/agents/team.js.map +1 -0
- package/dist/agents/tool-filter.d.ts +29 -0
- package/dist/agents/tool-filter.d.ts.map +1 -0
- package/dist/agents/tool-filter.js +50 -0
- package/dist/agents/tool-filter.js.map +1 -0
- package/dist/agents/verify.d.ts +177 -0
- package/dist/agents/verify.d.ts.map +1 -0
- package/dist/agents/verify.js +305 -0
- package/dist/agents/verify.js.map +1 -0
- package/dist/bench/metrics.d.ts +714 -0
- package/dist/bench/metrics.d.ts.map +1 -0
- package/dist/bench/metrics.js +618 -0
- package/dist/bench/metrics.js.map +1 -0
- package/dist/bin/sema-tb.d.ts +3 -0
- package/dist/bin/sema-tb.d.ts.map +1 -0
- package/dist/bin/sema-tb.js +516 -0
- package/dist/bin/sema-tb.js.map +1 -0
- package/dist/bin/tb-env.d.ts +13 -0
- package/dist/bin/tb-env.d.ts.map +1 -0
- package/dist/bin/tb-env.js +26 -0
- package/dist/bin/tb-env.js.map +1 -0
- package/dist/brain/anthropic.d.ts +46 -0
- package/dist/brain/anthropic.d.ts.map +1 -0
- package/dist/brain/anthropic.js +830 -0
- package/dist/brain/anthropic.js.map +1 -0
- package/dist/brain/circuit-breaker.d.ts +46 -0
- package/dist/brain/circuit-breaker.d.ts.map +1 -0
- package/dist/brain/circuit-breaker.js +173 -0
- package/dist/brain/circuit-breaker.js.map +1 -0
- package/dist/brain/degrading.d.ts +98 -0
- package/dist/brain/degrading.d.ts.map +1 -0
- package/dist/brain/degrading.js +249 -0
- package/dist/brain/degrading.js.map +1 -0
- package/dist/brain/errors.d.ts +31 -0
- package/dist/brain/errors.d.ts.map +1 -0
- package/dist/brain/errors.js +58 -0
- package/dist/brain/errors.js.map +1 -0
- package/dist/brain/failover.d.ts +18 -0
- package/dist/brain/failover.d.ts.map +1 -0
- package/dist/brain/failover.js +118 -0
- package/dist/brain/failover.js.map +1 -0
- package/dist/brain/model-presets.d.ts +36 -0
- package/dist/brain/model-presets.d.ts.map +1 -0
- package/dist/brain/model-presets.js +54 -0
- package/dist/brain/model-presets.js.map +1 -0
- package/dist/brain/openai.d.ts +43 -0
- package/dist/brain/openai.d.ts.map +1 -0
- package/dist/brain/openai.js +784 -0
- package/dist/brain/openai.js.map +1 -0
- package/dist/brain/reasoning.d.ts +138 -0
- package/dist/brain/reasoning.d.ts.map +1 -0
- package/dist/brain/reasoning.js +146 -0
- package/dist/brain/reasoning.js.map +1 -0
- package/dist/brain/repetition.d.ts +60 -0
- package/dist/brain/repetition.d.ts.map +1 -0
- package/dist/brain/repetition.js +121 -0
- package/dist/brain/repetition.js.map +1 -0
- package/dist/brain/request-params.d.ts +29 -0
- package/dist/brain/request-params.d.ts.map +1 -0
- package/dist/brain/request-params.js +78 -0
- package/dist/brain/request-params.js.map +1 -0
- package/dist/brain/retry.d.ts +18 -0
- package/dist/brain/retry.d.ts.map +1 -0
- package/dist/brain/retry.js +42 -0
- package/dist/brain/retry.js.map +1 -0
- package/dist/brain/routing.d.ts +19 -0
- package/dist/brain/routing.d.ts.map +1 -0
- package/dist/brain/routing.js +44 -0
- package/dist/brain/routing.js.map +1 -0
- package/dist/brain/status-sink.d.ts +46 -0
- package/dist/brain/status-sink.d.ts.map +1 -0
- package/dist/brain/status-sink.js +36 -0
- package/dist/brain/status-sink.js.map +1 -0
- package/dist/brain/stream-engine.d.ts +85 -0
- package/dist/brain/stream-engine.d.ts.map +1 -0
- package/dist/brain/stream-engine.js +391 -0
- package/dist/brain/stream-engine.js.map +1 -0
- package/dist/brain/timeout.d.ts +44 -0
- package/dist/brain/timeout.d.ts.map +1 -0
- package/dist/brain/timeout.js +41 -0
- package/dist/brain/timeout.js.map +1 -0
- package/dist/brain/tool-call-repair.d.ts +15 -0
- package/dist/brain/tool-call-repair.d.ts.map +1 -0
- package/dist/brain/tool-call-repair.js +67 -0
- package/dist/brain/tool-call-repair.js.map +1 -0
- package/dist/brain/walltime.d.ts +14 -0
- package/dist/brain/walltime.d.ts.map +1 -0
- package/dist/brain/walltime.js +14 -0
- package/dist/brain/walltime.js.map +1 -0
- package/dist/core/arg-summary.d.ts +19 -0
- package/dist/core/arg-summary.d.ts.map +1 -0
- package/dist/core/arg-summary.js +96 -0
- package/dist/core/arg-summary.js.map +1 -0
- package/dist/core/ask-question.d.ts +113 -0
- package/dist/core/ask-question.d.ts.map +1 -0
- package/dist/core/ask-question.js +246 -0
- package/dist/core/ask-question.js.map +1 -0
- package/dist/core/auto-compaction.d.ts +341 -0
- package/dist/core/auto-compaction.d.ts.map +1 -0
- package/dist/core/auto-compaction.js +495 -0
- package/dist/core/auto-compaction.js.map +1 -0
- package/dist/core/auto-promote.d.ts +126 -0
- package/dist/core/auto-promote.d.ts.map +1 -0
- package/dist/core/auto-promote.js +171 -0
- package/dist/core/auto-promote.js.map +1 -0
- package/dist/core/background-shell.d.ts +128 -0
- package/dist/core/background-shell.d.ts.map +1 -0
- package/dist/core/background-shell.js +42 -0
- package/dist/core/background-shell.js.map +1 -0
- package/dist/core/cache-break-detector.d.ts +63 -0
- package/dist/core/cache-break-detector.d.ts.map +1 -0
- package/dist/core/cache-break-detector.js +0 -0
- package/dist/core/cache-break-detector.js.map +1 -0
- package/dist/core/canonical-json.d.ts +45 -0
- package/dist/core/canonical-json.d.ts.map +1 -0
- package/dist/core/canonical-json.js +132 -0
- package/dist/core/canonical-json.js.map +1 -0
- package/dist/core/checkpoint-store.d.ts +1101 -0
- package/dist/core/checkpoint-store.d.ts.map +1 -0
- package/dist/core/checkpoint-store.js +514 -0
- package/dist/core/checkpoint-store.js.map +1 -0
- package/dist/core/consolidate-scope.d.ts +94 -0
- package/dist/core/consolidate-scope.d.ts.map +1 -0
- package/dist/core/consolidate-scope.js +158 -0
- package/dist/core/consolidate-scope.js.map +1 -0
- package/dist/core/context-edit.d.ts +82 -0
- package/dist/core/context-edit.d.ts.map +1 -0
- package/dist/core/context-edit.js +149 -0
- package/dist/core/context-edit.js.map +1 -0
- package/dist/core/context-guard.d.ts +43 -0
- package/dist/core/context-guard.d.ts.map +1 -0
- package/dist/core/context-guard.js +171 -0
- package/dist/core/context-guard.js.map +1 -0
- package/dist/core/dynamic-recall.d.ts +100 -0
- package/dist/core/dynamic-recall.d.ts.map +1 -0
- package/dist/core/dynamic-recall.js +108 -0
- package/dist/core/dynamic-recall.js.map +1 -0
- package/dist/core/exec-gate.d.ts +74 -0
- package/dist/core/exec-gate.d.ts.map +1 -0
- package/dist/core/exec-gate.js +143 -0
- package/dist/core/exec-gate.js.map +1 -0
- package/dist/core/exec-output-tail.d.ts +37 -0
- package/dist/core/exec-output-tail.d.ts.map +1 -0
- package/dist/core/exec-output-tail.js +63 -0
- package/dist/core/exec-output-tail.js.map +1 -0
- package/dist/core/file-snapshot-store.d.ts +137 -0
- package/dist/core/file-snapshot-store.d.ts.map +1 -0
- package/dist/core/file-snapshot-store.js +319 -0
- package/dist/core/file-snapshot-store.js.map +1 -0
- package/dist/core/git-worktree-env.d.ts +41 -0
- package/dist/core/git-worktree-env.d.ts.map +1 -0
- package/dist/core/git-worktree-env.js +64 -0
- package/dist/core/git-worktree-env.js.map +1 -0
- package/dist/core/hooks.d.ts +372 -0
- package/dist/core/hooks.d.ts.map +1 -0
- package/dist/core/hooks.js +269 -0
- package/dist/core/hooks.js.map +1 -0
- package/dist/core/lsp-diagnostics.d.ts +74 -0
- package/dist/core/lsp-diagnostics.d.ts.map +1 -0
- package/dist/core/lsp-diagnostics.js +125 -0
- package/dist/core/lsp-diagnostics.js.map +1 -0
- package/dist/core/lsp-protocol.d.ts +28 -0
- package/dist/core/lsp-protocol.d.ts.map +1 -0
- package/dist/core/lsp-protocol.js +179 -0
- package/dist/core/lsp-protocol.js.map +1 -0
- package/dist/core/lsp-session.d.ts +56 -0
- package/dist/core/lsp-session.d.ts.map +1 -0
- package/dist/core/lsp-session.js +185 -0
- package/dist/core/lsp-session.js.map +1 -0
- package/dist/core/lsp.d.ts +132 -0
- package/dist/core/lsp.d.ts.map +1 -0
- package/dist/core/lsp.js +147 -0
- package/dist/core/lsp.js.map +1 -0
- package/dist/core/mcp.d.ts +294 -0
- package/dist/core/mcp.d.ts.map +1 -0
- package/dist/core/mcp.js +992 -0
- package/dist/core/mcp.js.map +1 -0
- package/dist/core/media-byte-cap.d.ts +34 -0
- package/dist/core/media-byte-cap.d.ts.map +1 -0
- package/dist/core/media-byte-cap.js +76 -0
- package/dist/core/media-byte-cap.js.map +1 -0
- package/dist/core/memory-engine/data-plane.d.ts +103 -0
- package/dist/core/memory-engine/data-plane.d.ts.map +1 -0
- package/dist/core/memory-engine/data-plane.js +272 -0
- package/dist/core/memory-engine/data-plane.js.map +1 -0
- package/dist/core/memory-engine/dual-root.d.ts +40 -0
- package/dist/core/memory-engine/dual-root.d.ts.map +1 -0
- package/dist/core/memory-engine/dual-root.js +95 -0
- package/dist/core/memory-engine/dual-root.js.map +1 -0
- package/dist/core/memory-engine/engine.d.ts +161 -0
- package/dist/core/memory-engine/engine.d.ts.map +1 -0
- package/dist/core/memory-engine/engine.js +1110 -0
- package/dist/core/memory-engine/engine.js.map +1 -0
- package/dist/core/memory-engine/file-backend.d.ts +162 -0
- package/dist/core/memory-engine/file-backend.d.ts.map +1 -0
- package/dist/core/memory-engine/file-backend.js +948 -0
- package/dist/core/memory-engine/file-backend.js.map +1 -0
- package/dist/core/memory-engine/frontmatter.d.ts +24 -0
- package/dist/core/memory-engine/frontmatter.d.ts.map +1 -0
- package/dist/core/memory-engine/frontmatter.js +135 -0
- package/dist/core/memory-engine/frontmatter.js.map +1 -0
- package/dist/core/memory-engine/index.d.ts +13 -0
- package/dist/core/memory-engine/index.d.ts.map +1 -0
- package/dist/core/memory-engine/index.js +28 -0
- package/dist/core/memory-engine/index.js.map +1 -0
- package/dist/core/memory-engine/layout.d.ts +123 -0
- package/dist/core/memory-engine/layout.d.ts.map +1 -0
- package/dist/core/memory-engine/layout.js +643 -0
- package/dist/core/memory-engine/layout.js.map +1 -0
- package/dist/core/memory-engine/memory-backend-contract.d.ts +22 -0
- package/dist/core/memory-engine/memory-backend-contract.d.ts.map +1 -0
- package/dist/core/memory-engine/memory-backend-contract.js +271 -0
- package/dist/core/memory-engine/memory-backend-contract.js.map +1 -0
- package/dist/core/memory-engine/migrate.d.ts +17 -0
- package/dist/core/memory-engine/migrate.d.ts.map +1 -0
- package/dist/core/memory-engine/migrate.js +35 -0
- package/dist/core/memory-engine/migrate.js.map +1 -0
- package/dist/core/memory-engine/scan.d.ts +20 -0
- package/dist/core/memory-engine/scan.d.ts.map +1 -0
- package/dist/core/memory-engine/scan.js +84 -0
- package/dist/core/memory-engine/scan.js.map +1 -0
- package/dist/core/memory-engine/scope-contract.d.ts +104 -0
- package/dist/core/memory-engine/scope-contract.d.ts.map +1 -0
- package/dist/core/memory-engine/scope-contract.js +288 -0
- package/dist/core/memory-engine/scope-contract.js.map +1 -0
- package/dist/core/memory-engine/sync-client.d.ts +100 -0
- package/dist/core/memory-engine/sync-client.d.ts.map +1 -0
- package/dist/core/memory-engine/sync-client.js +328 -0
- package/dist/core/memory-engine/sync-client.js.map +1 -0
- package/dist/core/memory-engine/sync.d.ts +97 -0
- package/dist/core/memory-engine/sync.d.ts.map +1 -0
- package/dist/core/memory-engine/sync.js +91 -0
- package/dist/core/memory-engine/sync.js.map +1 -0
- package/dist/core/memory-engine/types.d.ts +279 -0
- package/dist/core/memory-engine/types.d.ts.map +1 -0
- package/dist/core/memory-engine/types.js +9 -0
- package/dist/core/memory-engine/types.js.map +1 -0
- package/dist/core/memory-recall.d.ts +261 -0
- package/dist/core/memory-recall.d.ts.map +1 -0
- package/dist/core/memory-recall.js +600 -0
- package/dist/core/memory-recall.js.map +1 -0
- package/dist/core/memory-vector.d.ts +24 -0
- package/dist/core/memory-vector.d.ts.map +1 -0
- package/dist/core/memory-vector.js +51 -0
- package/dist/core/memory-vector.js.map +1 -0
- package/dist/core/memory.d.ts +502 -0
- package/dist/core/memory.d.ts.map +1 -0
- package/dist/core/memory.js +881 -0
- package/dist/core/memory.js.map +1 -0
- package/dist/core/message-utils.d.ts +7 -0
- package/dist/core/message-utils.d.ts.map +1 -0
- package/dist/core/message-utils.js +10 -0
- package/dist/core/message-utils.js.map +1 -0
- package/dist/core/oracle-isolation.d.ts +85 -0
- package/dist/core/oracle-isolation.d.ts.map +1 -0
- package/dist/core/oracle-isolation.js +121 -0
- package/dist/core/oracle-isolation.js.map +1 -0
- package/dist/core/permission-rules.d.ts +102 -0
- package/dist/core/permission-rules.d.ts.map +1 -0
- package/dist/core/permission-rules.js +357 -0
- package/dist/core/permission-rules.js.map +1 -0
- package/dist/core/present-plan-tool.d.ts +28 -0
- package/dist/core/present-plan-tool.d.ts.map +1 -0
- package/dist/core/present-plan-tool.js +119 -0
- package/dist/core/present-plan-tool.js.map +1 -0
- package/dist/core/pricing.d.ts +48 -0
- package/dist/core/pricing.d.ts.map +1 -0
- package/dist/core/pricing.js +46 -0
- package/dist/core/pricing.js.map +1 -0
- package/dist/core/property-harness.d.ts +126 -0
- package/dist/core/property-harness.d.ts.map +1 -0
- package/dist/core/property-harness.js +192 -0
- package/dist/core/property-harness.js.map +1 -0
- package/dist/core/push-queue.d.ts +10 -0
- package/dist/core/push-queue.d.ts.map +1 -0
- package/dist/core/push-queue.js +42 -0
- package/dist/core/push-queue.js.map +1 -0
- package/dist/core/remote-env.d.ts +432 -0
- package/dist/core/remote-env.d.ts.map +1 -0
- package/dist/core/remote-env.js +77 -0
- package/dist/core/remote-env.js.map +1 -0
- package/dist/core/roles.d.ts +74 -0
- package/dist/core/roles.d.ts.map +1 -0
- package/dist/core/roles.js +272 -0
- package/dist/core/roles.js.map +1 -0
- package/dist/core/runner/active-skill-scope.d.ts +64 -0
- package/dist/core/runner/active-skill-scope.d.ts.map +1 -0
- package/dist/core/runner/active-skill-scope.js +197 -0
- package/dist/core/runner/active-skill-scope.js.map +1 -0
- package/dist/core/runner/assemble-result.d.ts +191 -0
- package/dist/core/runner/assemble-result.d.ts.map +1 -0
- package/dist/core/runner/assemble-result.js +250 -0
- package/dist/core/runner/assemble-result.js.map +1 -0
- package/dist/core/runner/call-cap.d.ts +130 -0
- package/dist/core/runner/call-cap.d.ts.map +1 -0
- package/dist/core/runner/call-cap.js +151 -0
- package/dist/core/runner/call-cap.js.map +1 -0
- package/dist/core/runner/grounding-signal.d.ts +12 -0
- package/dist/core/runner/grounding-signal.d.ts.map +1 -0
- package/dist/core/runner/grounding-signal.js +94 -0
- package/dist/core/runner/grounding-signal.js.map +1 -0
- package/dist/core/runner/image.d.ts +23 -0
- package/dist/core/runner/image.d.ts.map +1 -0
- package/dist/core/runner/image.js +151 -0
- package/dist/core/runner/image.js.map +1 -0
- package/dist/core/runner/memory-consolidation.d.ts +112 -0
- package/dist/core/runner/memory-consolidation.d.ts.map +1 -0
- package/dist/core/runner/memory-consolidation.js +372 -0
- package/dist/core/runner/memory-consolidation.js.map +1 -0
- package/dist/core/runner/prepare-task.d.ts +583 -0
- package/dist/core/runner/prepare-task.d.ts.map +1 -0
- package/dist/core/runner/prepare-task.js +3612 -0
- package/dist/core/runner/prepare-task.js.map +1 -0
- package/dist/core/runner/prompt-suggestions.d.ts +33 -0
- package/dist/core/runner/prompt-suggestions.d.ts.map +1 -0
- package/dist/core/runner/prompt-suggestions.js +116 -0
- package/dist/core/runner/prompt-suggestions.js.map +1 -0
- package/dist/core/runner/runtask.d.ts +274 -0
- package/dist/core/runner/runtask.d.ts.map +1 -0
- package/dist/core/runner/runtask.js +4606 -0
- package/dist/core/runner/runtask.js.map +1 -0
- package/dist/core/runner/session-rule-policy.d.ts +28 -0
- package/dist/core/runner/session-rule-policy.d.ts.map +1 -0
- package/dist/core/runner/session-rule-policy.js +110 -0
- package/dist/core/runner/session-rule-policy.js.map +1 -0
- package/dist/core/runner/strict-output-schema.d.ts +36 -0
- package/dist/core/runner/strict-output-schema.d.ts.map +1 -0
- package/dist/core/runner/strict-output-schema.js +365 -0
- package/dist/core/runner/strict-output-schema.js.map +1 -0
- package/dist/core/runner/synthetic-tools.d.ts +72 -0
- package/dist/core/runner/synthetic-tools.d.ts.map +1 -0
- package/dist/core/runner/synthetic-tools.js +203 -0
- package/dist/core/runner/synthetic-tools.js.map +1 -0
- package/dist/core/runner/tool-disclosure.d.ts +117 -0
- package/dist/core/runner/tool-disclosure.d.ts.map +1 -0
- package/dist/core/runner/tool-disclosure.js +0 -0
- package/dist/core/runner/tool-disclosure.js.map +1 -0
- package/dist/core/runner/turn-attachments.d.ts +381 -0
- package/dist/core/runner/turn-attachments.d.ts.map +1 -0
- package/dist/core/runner/turn-attachments.js +596 -0
- package/dist/core/runner/turn-attachments.js.map +1 -0
- package/dist/core/runner/usage-accounting.d.ts +35 -0
- package/dist/core/runner/usage-accounting.d.ts.map +1 -0
- package/dist/core/runner/usage-accounting.js +45 -0
- package/dist/core/runner/usage-accounting.js.map +1 -0
- package/dist/core/runtime.d.ts +9 -0
- package/dist/core/runtime.d.ts.map +1 -0
- package/dist/core/runtime.js +17 -0
- package/dist/core/runtime.js.map +1 -0
- package/dist/core/safety-axis-vocab.d.ts +33 -0
- package/dist/core/safety-axis-vocab.d.ts.map +1 -0
- package/dist/core/safety-axis-vocab.js +35 -0
- package/dist/core/safety-axis-vocab.js.map +1 -0
- package/dist/core/safety-merge-corpus.d.ts +48 -0
- package/dist/core/safety-merge-corpus.d.ts.map +1 -0
- package/dist/core/safety-merge-corpus.js +203 -0
- package/dist/core/safety-merge-corpus.js.map +1 -0
- package/dist/core/scheduler.d.ts +126 -0
- package/dist/core/scheduler.d.ts.map +1 -0
- package/dist/core/scheduler.js +54 -0
- package/dist/core/scheduler.js.map +1 -0
- package/dist/core/secret-env.d.ts +23 -0
- package/dist/core/secret-env.d.ts.map +1 -0
- package/dist/core/secret-env.js +35 -0
- package/dist/core/secret-env.js.map +1 -0
- package/dist/core/select-model.d.ts +26 -0
- package/dist/core/select-model.d.ts.map +1 -0
- package/dist/core/select-model.js +58 -0
- package/dist/core/select-model.js.map +1 -0
- package/dist/core/sensitive-path-policy.d.ts +24 -0
- package/dist/core/sensitive-path-policy.d.ts.map +1 -0
- package/dist/core/sensitive-path-policy.js +96 -0
- package/dist/core/sensitive-path-policy.js.map +1 -0
- package/dist/core/session-policy-store.d.ts +102 -0
- package/dist/core/session-policy-store.d.ts.map +1 -0
- package/dist/core/session-policy-store.js +177 -0
- package/dist/core/session-policy-store.js.map +1 -0
- package/dist/core/session-reconcile.d.ts +63 -0
- package/dist/core/session-reconcile.d.ts.map +1 -0
- package/dist/core/session-reconcile.js +71 -0
- package/dist/core/session-reconcile.js.map +1 -0
- package/dist/core/session-store.d.ts +99 -0
- package/dist/core/session-store.d.ts.map +1 -0
- package/dist/core/session-store.js +298 -0
- package/dist/core/session-store.js.map +1 -0
- package/dist/core/session.d.ts +144 -0
- package/dist/core/session.d.ts.map +1 -0
- package/dist/core/session.js +56 -0
- package/dist/core/session.js.map +1 -0
- package/dist/core/spec-contract.d.ts +147 -0
- package/dist/core/spec-contract.d.ts.map +1 -0
- package/dist/core/spec-contract.js +340 -0
- package/dist/core/spec-contract.js.map +1 -0
- package/dist/core/strategy-store.d.ts +50 -0
- package/dist/core/strategy-store.d.ts.map +1 -0
- package/dist/core/strategy-store.js +100 -0
- package/dist/core/strategy-store.js.map +1 -0
- package/dist/core/stub-env.d.ts +35 -0
- package/dist/core/stub-env.d.ts.map +1 -0
- package/dist/core/stub-env.js +69 -0
- package/dist/core/stub-env.js.map +1 -0
- package/dist/core/task-notification.d.ts +115 -0
- package/dist/core/task-notification.d.ts.map +1 -0
- package/dist/core/task-notification.js +247 -0
- package/dist/core/task-notification.js.map +1 -0
- package/dist/core/task-outcome.d.ts +80 -0
- package/dist/core/task-outcome.d.ts.map +1 -0
- package/dist/core/task-outcome.js +40 -0
- package/dist/core/task-outcome.js.map +1 -0
- package/dist/core/task-registry.d.ts +349 -0
- package/dist/core/task-registry.d.ts.map +1 -0
- package/dist/core/task-registry.js +1751 -0
- package/dist/core/task-registry.js.map +1 -0
- package/dist/core/tighten-task-spec.d.ts +27 -0
- package/dist/core/tighten-task-spec.d.ts.map +1 -0
- package/dist/core/tighten-task-spec.js +95 -0
- package/dist/core/tighten-task-spec.js.map +1 -0
- package/dist/core/tool-detach.d.ts +31 -0
- package/dist/core/tool-detach.d.ts.map +1 -0
- package/dist/core/tool-detach.js +62 -0
- package/dist/core/tool-detach.js.map +1 -0
- package/dist/core/tool-errors.d.ts +72 -0
- package/dist/core/tool-errors.d.ts.map +1 -0
- package/dist/core/tool-errors.js +194 -0
- package/dist/core/tool-errors.js.map +1 -0
- package/dist/core/tool-name-aliases.d.ts +5 -0
- package/dist/core/tool-name-aliases.d.ts.map +1 -0
- package/dist/core/tool-name-aliases.js +130 -0
- package/dist/core/tool-name-aliases.js.map +1 -0
- package/dist/core/tool-policy.d.ts +295 -0
- package/dist/core/tool-policy.d.ts.map +1 -0
- package/dist/core/tool-policy.js +567 -0
- package/dist/core/tool-policy.js.map +1 -0
- package/dist/core/tool-result-budget.d.ts +44 -0
- package/dist/core/tool-result-budget.d.ts.map +1 -0
- package/dist/core/tool-result-budget.js +140 -0
- package/dist/core/tool-result-budget.js.map +1 -0
- package/dist/core/tool-result-store.d.ts +136 -0
- package/dist/core/tool-result-store.d.ts.map +1 -0
- package/dist/core/tool-result-store.js +219 -0
- package/dist/core/tool-result-store.js.map +1 -0
- package/dist/core/tools.d.ts +14 -0
- package/dist/core/tools.d.ts.map +1 -0
- package/dist/core/tools.js +98 -0
- package/dist/core/tools.js.map +1 -0
- package/dist/core/trace.d.ts +340 -0
- package/dist/core/trace.d.ts.map +1 -0
- package/dist/core/trace.js +12 -0
- package/dist/core/trace.js.map +1 -0
- package/dist/core/types.d.ts +2828 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/untrusted-egress.d.ts +32 -0
- package/dist/core/untrusted-egress.d.ts.map +1 -0
- package/dist/core/untrusted-egress.js +49 -0
- package/dist/core/untrusted-egress.js.map +1 -0
- package/dist/core/untrusted-text.d.ts +64 -0
- package/dist/core/untrusted-text.d.ts.map +1 -0
- package/dist/core/untrusted-text.js +119 -0
- package/dist/core/untrusted-text.js.map +1 -0
- package/dist/core/warm-resume.d.ts +23 -0
- package/dist/core/warm-resume.d.ts.map +1 -0
- package/dist/core/warm-resume.js +28 -0
- package/dist/core/warm-resume.js.map +1 -0
- package/dist/core/with-retry.d.ts +43 -0
- package/dist/core/with-retry.d.ts.map +1 -0
- package/dist/core/with-retry.js +59 -0
- package/dist/core/with-retry.js.map +1 -0
- package/dist/core/workflow-journal-store.d.ts +44 -0
- package/dist/core/workflow-journal-store.d.ts.map +1 -0
- package/dist/core/workflow-journal-store.js +47 -0
- package/dist/core/workflow-journal-store.js.map +1 -0
- package/dist/core/workflow-run-store-contract.d.ts +31 -0
- package/dist/core/workflow-run-store-contract.d.ts.map +1 -0
- package/dist/core/workflow-run-store-contract.js +191 -0
- package/dist/core/workflow-run-store-contract.js.map +1 -0
- package/dist/core/workflow-run-store.d.ts +149 -0
- package/dist/core/workflow-run-store.d.ts.map +1 -0
- package/dist/core/workflow-run-store.js +110 -0
- package/dist/core/workflow-run-store.js.map +1 -0
- package/dist/engine/compaction/compaction.d.ts +139 -0
- package/dist/engine/compaction/compaction.d.ts.map +1 -0
- package/dist/engine/compaction/compaction.js +1030 -0
- package/dist/engine/compaction/compaction.js.map +1 -0
- package/dist/engine/compaction/utils.d.ts +45 -0
- package/dist/engine/compaction/utils.d.ts.map +1 -0
- package/dist/engine/compaction/utils.js +203 -0
- package/dist/engine/compaction/utils.js.map +1 -0
- package/dist/engine/execution-env/kill-tree.d.ts +20 -0
- package/dist/engine/execution-env/kill-tree.d.ts.map +1 -0
- package/dist/engine/execution-env/kill-tree.js +183 -0
- package/dist/engine/execution-env/kill-tree.js.map +1 -0
- package/dist/engine/execution-env/node-execution-env.d.ts +133 -0
- package/dist/engine/execution-env/node-execution-env.d.ts.map +1 -0
- package/dist/engine/execution-env/node-execution-env.js +1031 -0
- package/dist/engine/execution-env/node-execution-env.js.map +1 -0
- package/dist/engine/harness/agent-harness.d.ts +174 -0
- package/dist/engine/harness/agent-harness.d.ts.map +1 -0
- package/dist/engine/harness/agent-harness.js +1053 -0
- package/dist/engine/harness/agent-harness.js.map +1 -0
- package/dist/engine/harness/messages.d.ts +17 -0
- package/dist/engine/harness/messages.d.ts.map +1 -0
- package/dist/engine/harness/messages.js +122 -0
- package/dist/engine/harness/messages.js.map +1 -0
- package/dist/engine/harness/types.d.ts +713 -0
- package/dist/engine/harness/types.d.ts.map +1 -0
- package/dist/engine/harness/types.js +100 -0
- package/dist/engine/harness/types.js.map +1 -0
- package/dist/engine/llm/diagnostics.d.ts +23 -0
- package/dist/engine/llm/diagnostics.d.ts.map +1 -0
- package/dist/engine/llm/diagnostics.js +32 -0
- package/dist/engine/llm/diagnostics.js.map +1 -0
- package/dist/engine/llm/event-stream.d.ts +25 -0
- package/dist/engine/llm/event-stream.d.ts.map +1 -0
- package/dist/engine/llm/event-stream.js +103 -0
- package/dist/engine/llm/event-stream.js.map +1 -0
- package/dist/engine/llm/index.d.ts +12 -0
- package/dist/engine/llm/index.d.ts.map +1 -0
- package/dist/engine/llm/index.js +12 -0
- package/dist/engine/llm/index.js.map +1 -0
- package/dist/engine/llm/types.d.ts +753 -0
- package/dist/engine/llm/types.d.ts.map +1 -0
- package/dist/engine/llm/types.js +2 -0
- package/dist/engine/llm/types.js.map +1 -0
- package/dist/engine/llm/validation.d.ts +8 -0
- package/dist/engine/llm/validation.d.ts.map +1 -0
- package/dist/engine/llm/validation.js +318 -0
- package/dist/engine/llm/validation.js.map +1 -0
- package/dist/engine/loop/agent-loop.d.ts +74 -0
- package/dist/engine/loop/agent-loop.d.ts.map +1 -0
- package/dist/engine/loop/agent-loop.js +1490 -0
- package/dist/engine/loop/agent-loop.js.map +1 -0
- package/dist/engine/loop/runtime-deps.d.ts +17 -0
- package/dist/engine/loop/runtime-deps.d.ts.map +1 -0
- package/dist/engine/loop/runtime-deps.js +21 -0
- package/dist/engine/loop/runtime-deps.js.map +1 -0
- package/dist/engine/loop/types.d.ts +609 -0
- package/dist/engine/loop/types.d.ts.map +1 -0
- package/dist/engine/loop/types.js +2 -0
- package/dist/engine/loop/types.js.map +1 -0
- package/dist/engine/lsp/frame-decoder.d.ts +16 -0
- package/dist/engine/lsp/frame-decoder.d.ts.map +1 -0
- package/dist/engine/lsp/frame-decoder.js +53 -0
- package/dist/engine/lsp/frame-decoder.js.map +1 -0
- package/dist/engine/lsp/node-lsp-manager.d.ts +105 -0
- package/dist/engine/lsp/node-lsp-manager.d.ts.map +1 -0
- package/dist/engine/lsp/node-lsp-manager.js +343 -0
- package/dist/engine/lsp/node-lsp-manager.js.map +1 -0
- package/dist/engine/lsp/stdio-lsp-transport.d.ts +37 -0
- package/dist/engine/lsp/stdio-lsp-transport.d.ts.map +1 -0
- package/dist/engine/lsp/stdio-lsp-transport.js +185 -0
- package/dist/engine/lsp/stdio-lsp-transport.js.map +1 -0
- package/dist/engine/session/import-validate.d.ts +44 -0
- package/dist/engine/session/import-validate.d.ts.map +1 -0
- package/dist/engine/session/import-validate.js +92 -0
- package/dist/engine/session/import-validate.js.map +1 -0
- package/dist/engine/session/memory-repo.d.ts +25 -0
- package/dist/engine/session/memory-repo.d.ts.map +1 -0
- package/dist/engine/session/memory-repo.js +59 -0
- package/dist/engine/session/memory-repo.js.map +1 -0
- package/dist/engine/session/memory-storage.d.ts +14 -0
- package/dist/engine/session/memory-storage.d.ts.map +1 -0
- package/dist/engine/session/memory-storage.js +17 -0
- package/dist/engine/session/memory-storage.js.map +1 -0
- package/dist/engine/session/repo-utils.d.ts +11 -0
- package/dist/engine/session/repo-utils.d.ts.map +1 -0
- package/dist/engine/session/repo-utils.js +40 -0
- package/dist/engine/session/repo-utils.js.map +1 -0
- package/dist/engine/session/session.d.ts +34 -0
- package/dist/engine/session/session.d.ts.map +1 -0
- package/dist/engine/session/session.js +227 -0
- package/dist/engine/session/session.js.map +1 -0
- package/dist/engine/session/storage-base.d.ts +38 -0
- package/dist/engine/session/storage-base.d.ts.map +1 -0
- package/dist/engine/session/storage-base.js +157 -0
- package/dist/engine/session/storage-base.js.map +1 -0
- package/dist/engine/session/timestamps.d.ts +3 -0
- package/dist/engine/session/timestamps.d.ts.map +1 -0
- package/dist/engine/session/timestamps.js +15 -0
- package/dist/engine/session/timestamps.js.map +1 -0
- package/dist/engine/session/uuid.d.ts +2 -0
- package/dist/engine/session/uuid.d.ts.map +1 -0
- package/dist/engine/session/uuid.js +50 -0
- package/dist/engine/session/uuid.js.map +1 -0
- package/dist/index.d.ts +160 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +374 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/harness.d.ts +26 -0
- package/dist/internal/harness.d.ts.map +1 -0
- package/dist/internal/harness.js +24 -0
- package/dist/internal/harness.js.map +1 -0
- package/dist/internal/llm.d.ts +9 -0
- package/dist/internal/llm.d.ts.map +1 -0
- package/dist/internal/llm.js +8 -0
- package/dist/internal/llm.js.map +1 -0
- package/dist/orchestration/builtin-workflows.d.ts +44 -0
- package/dist/orchestration/builtin-workflows.d.ts.map +1 -0
- package/dist/orchestration/builtin-workflows.js +165 -0
- package/dist/orchestration/builtin-workflows.js.map +1 -0
- package/dist/orchestration/dev-vm-script-runner.d.ts +24 -0
- package/dist/orchestration/dev-vm-script-runner.d.ts.map +1 -0
- package/dist/orchestration/dev-vm-script-runner.js +106 -0
- package/dist/orchestration/dev-vm-script-runner.js.map +1 -0
- package/dist/orchestration/goal.d.ts +97 -0
- package/dist/orchestration/goal.d.ts.map +1 -0
- package/dist/orchestration/goal.js +248 -0
- package/dist/orchestration/goal.js.map +1 -0
- package/dist/orchestration/run-spec.d.ts +63 -0
- package/dist/orchestration/run-spec.d.ts.map +1 -0
- package/dist/orchestration/run-spec.js +274 -0
- package/dist/orchestration/run-spec.js.map +1 -0
- package/dist/orchestration/run-workflow-tool.d.ts +187 -0
- package/dist/orchestration/run-workflow-tool.d.ts.map +1 -0
- package/dist/orchestration/run-workflow-tool.js +612 -0
- package/dist/orchestration/run-workflow-tool.js.map +1 -0
- package/dist/orchestration/workflow-governance.d.ts +70 -0
- package/dist/orchestration/workflow-governance.d.ts.map +1 -0
- package/dist/orchestration/workflow-governance.js +176 -0
- package/dist/orchestration/workflow-governance.js.map +1 -0
- package/dist/orchestration/workflow-meta.d.ts +41 -0
- package/dist/orchestration/workflow-meta.d.ts.map +1 -0
- package/dist/orchestration/workflow-meta.js +426 -0
- package/dist/orchestration/workflow-meta.js.map +1 -0
- package/dist/orchestration/workflow-observe.d.ts +77 -0
- package/dist/orchestration/workflow-observe.d.ts.map +1 -0
- package/dist/orchestration/workflow-observe.js +177 -0
- package/dist/orchestration/workflow-observe.js.map +1 -0
- package/dist/orchestration/workflow-primitives.d.ts +31 -0
- package/dist/orchestration/workflow-primitives.d.ts.map +1 -0
- package/dist/orchestration/workflow-primitives.js +104 -0
- package/dist/orchestration/workflow-primitives.js.map +1 -0
- package/dist/orchestration/workflow-sandbox-conformance.d.ts +34 -0
- package/dist/orchestration/workflow-sandbox-conformance.d.ts.map +1 -0
- package/dist/orchestration/workflow-sandbox-conformance.js +301 -0
- package/dist/orchestration/workflow-sandbox-conformance.js.map +1 -0
- package/dist/orchestration/workflow-script-runner.d.ts +127 -0
- package/dist/orchestration/workflow-script-runner.d.ts.map +1 -0
- package/dist/orchestration/workflow-script-runner.js +48 -0
- package/dist/orchestration/workflow-script-runner.js.map +1 -0
- package/dist/orchestration/workflow-script-store.d.ts +99 -0
- package/dist/orchestration/workflow-script-store.d.ts.map +1 -0
- package/dist/orchestration/workflow-script-store.js +133 -0
- package/dist/orchestration/workflow-script-store.js.map +1 -0
- package/dist/orchestration/workflow-size-guideline.d.ts +50 -0
- package/dist/orchestration/workflow-size-guideline.d.ts.map +1 -0
- package/dist/orchestration/workflow-size-guideline.js +78 -0
- package/dist/orchestration/workflow-size-guideline.js.map +1 -0
- package/dist/orchestration/workflow.d.ts +624 -0
- package/dist/orchestration/workflow.d.ts.map +1 -0
- package/dist/orchestration/workflow.js +1596 -0
- package/dist/orchestration/workflow.js.map +1 -0
- package/dist/prompts/default.d.ts +474 -0
- package/dist/prompts/default.d.ts.map +1 -0
- package/dist/prompts/default.js +676 -0
- package/dist/prompts/default.js.map +1 -0
- package/dist/prompts/supervisor.d.ts +60 -0
- package/dist/prompts/supervisor.d.ts.map +1 -0
- package/dist/prompts/supervisor.js +162 -0
- package/dist/prompts/supervisor.js.map +1 -0
- package/dist/scenarios/env.d.ts +41 -0
- package/dist/scenarios/env.d.ts.map +1 -0
- package/dist/scenarios/env.js +65 -0
- package/dist/scenarios/env.js.map +1 -0
- package/dist/scenarios/full-body.d.ts +47 -0
- package/dist/scenarios/full-body.d.ts.map +1 -0
- package/dist/scenarios/full-body.js +36 -0
- package/dist/scenarios/full-body.js.map +1 -0
- package/dist/scenarios/scenario-registry.d.ts +107 -0
- package/dist/scenarios/scenario-registry.d.ts.map +1 -0
- package/dist/scenarios/scenario-registry.js +192 -0
- package/dist/scenarios/scenario-registry.js.map +1 -0
- package/dist/scenarios/teacher-quickstart.d.ts +41 -0
- package/dist/scenarios/teacher-quickstart.d.ts.map +1 -0
- package/dist/scenarios/teacher-quickstart.js +32 -0
- package/dist/scenarios/teacher-quickstart.js.map +1 -0
- package/dist/server/http.d.ts +36 -0
- package/dist/server/http.d.ts.map +1 -0
- package/dist/server/http.js +144 -0
- package/dist/server/http.js.map +1 -0
- package/dist/stores/file/checkpoint-store.d.ts +62 -0
- package/dist/stores/file/checkpoint-store.d.ts.map +1 -0
- package/dist/stores/file/checkpoint-store.js +250 -0
- package/dist/stores/file/checkpoint-store.js.map +1 -0
- package/dist/stores/file/file-snapshot-store.d.ts +43 -0
- package/dist/stores/file/file-snapshot-store.d.ts.map +1 -0
- package/dist/stores/file/file-snapshot-store.js +374 -0
- package/dist/stores/file/file-snapshot-store.js.map +1 -0
- package/dist/stores/file/fs-atomic.d.ts +95 -0
- package/dist/stores/file/fs-atomic.d.ts.map +1 -0
- package/dist/stores/file/fs-atomic.js +415 -0
- package/dist/stores/file/fs-atomic.js.map +1 -0
- package/dist/stores/file/index.d.ts +98 -0
- package/dist/stores/file/index.d.ts.map +1 -0
- package/dist/stores/file/index.js +109 -0
- package/dist/stores/file/index.js.map +1 -0
- package/dist/stores/file/memory-store.d.ts +95 -0
- package/dist/stores/file/memory-store.d.ts.map +1 -0
- package/dist/stores/file/memory-store.js +393 -0
- package/dist/stores/file/memory-store.js.map +1 -0
- package/dist/stores/file/session-policy-store.d.ts +24 -0
- package/dist/stores/file/session-policy-store.d.ts.map +1 -0
- package/dist/stores/file/session-policy-store.js +123 -0
- package/dist/stores/file/session-policy-store.js.map +1 -0
- package/dist/stores/file/session-store.d.ts +34 -0
- package/dist/stores/file/session-store.d.ts.map +1 -0
- package/dist/stores/file/session-store.js +175 -0
- package/dist/stores/file/session-store.js.map +1 -0
- package/dist/stores/file/tool-result-store.d.ts +23 -0
- package/dist/stores/file/tool-result-store.d.ts.map +1 -0
- package/dist/stores/file/tool-result-store.js +61 -0
- package/dist/stores/file/tool-result-store.js.map +1 -0
- package/dist/stores/file/workflow-journal-store.d.ts +36 -0
- package/dist/stores/file/workflow-journal-store.d.ts.map +1 -0
- package/dist/stores/file/workflow-journal-store.js +157 -0
- package/dist/stores/file/workflow-journal-store.js.map +1 -0
- package/dist/stores/file/workflow-run-store.d.ts +58 -0
- package/dist/stores/file/workflow-run-store.d.ts.map +1 -0
- package/dist/stores/file/workflow-run-store.js +178 -0
- package/dist/stores/file/workflow-run-store.js.map +1 -0
- package/dist/stores/pg.d.ts +210 -0
- package/dist/stores/pg.d.ts.map +1 -0
- package/dist/stores/pg.js +652 -0
- package/dist/stores/pg.js.map +1 -0
- package/dist/tools/fs/encoding.d.ts +51 -0
- package/dist/tools/fs/encoding.d.ts.map +1 -0
- package/dist/tools/fs/encoding.js +74 -0
- package/dist/tools/fs/encoding.js.map +1 -0
- package/dist/tools/fs/gh-rate-limit.d.ts +19 -0
- package/dist/tools/fs/gh-rate-limit.d.ts.map +1 -0
- package/dist/tools/fs/gh-rate-limit.js +35 -0
- package/dist/tools/fs/gh-rate-limit.js.map +1 -0
- package/dist/tools/fs/index.d.ts +246 -0
- package/dist/tools/fs/index.d.ts.map +1 -0
- package/dist/tools/fs/index.js +2130 -0
- package/dist/tools/fs/index.js.map +1 -0
- package/dist/tools/fs/pdf.d.ts +106 -0
- package/dist/tools/fs/pdf.d.ts.map +1 -0
- package/dist/tools/fs/pdf.js +178 -0
- package/dist/tools/fs/pdf.js.map +1 -0
- package/dist/tools/fs/repo-map.d.ts +15 -0
- package/dist/tools/fs/repo-map.d.ts.map +1 -0
- package/dist/tools/fs/repo-map.js +251 -0
- package/dist/tools/fs/repo-map.js.map +1 -0
- package/dist/tools/fs/safety.d.ts +168 -0
- package/dist/tools/fs/safety.d.ts.map +1 -0
- package/dist/tools/fs/safety.js +479 -0
- package/dist/tools/fs/safety.js.map +1 -0
- package/dist/tools/fs/search.d.ts +118 -0
- package/dist/tools/fs/search.d.ts.map +1 -0
- package/dist/tools/fs/search.js +650 -0
- package/dist/tools/fs/search.js.map +1 -0
- package/dist/tools/gitea-issue.d.ts +39 -0
- package/dist/tools/gitea-issue.d.ts.map +1 -0
- package/dist/tools/gitea-issue.js +91 -0
- package/dist/tools/gitea-issue.js.map +1 -0
- package/dist/tools/monitor.d.ts +64 -0
- package/dist/tools/monitor.d.ts.map +1 -0
- package/dist/tools/monitor.js +135 -0
- package/dist/tools/monitor.js.map +1 -0
- package/dist/tools/scheduler-tools.d.ts +48 -0
- package/dist/tools/scheduler-tools.d.ts.map +1 -0
- package/dist/tools/scheduler-tools.js +449 -0
- package/dist/tools/scheduler-tools.js.map +1 -0
- package/dist/tools/sql-adapters.d.ts +32 -0
- package/dist/tools/sql-adapters.d.ts.map +1 -0
- package/dist/tools/sql-adapters.js +31 -0
- package/dist/tools/sql-adapters.js.map +1 -0
- package/dist/tools/sql.d.ts +36 -0
- package/dist/tools/sql.d.ts.map +1 -0
- package/dist/tools/sql.js +131 -0
- package/dist/tools/sql.js.map +1 -0
- package/dist/tools/task-list.d.ts +26 -0
- package/dist/tools/task-list.d.ts.map +1 -0
- package/dist/tools/task-list.js +352 -0
- package/dist/tools/task-list.js.map +1 -0
- package/dist/tools/todo.d.ts +11 -0
- package/dist/tools/todo.d.ts.map +1 -0
- package/dist/tools/todo.js +126 -0
- package/dist/tools/todo.js.map +1 -0
- package/dist/tools/web.d.ts +59 -0
- package/dist/tools/web.d.ts.map +1 -0
- package/dist/tools/web.js +607 -0
- package/dist/tools/web.js.map +1 -0
- package/dist/tools/worktree.d.ts +88 -0
- package/dist/tools/worktree.d.ts.map +1 -0
- package/dist/tools/worktree.js +434 -0
- package/dist/tools/worktree.js.map +1 -0
- package/docs/A1-ATTRIBUTION-ROUND1-2026-07-09.md +181 -0
- package/docs/AB-ORACLE-GATE-VERDICT-2026-07-10.md +100 -0
- package/docs/ANCHOR-GAP-INVENTORY-2026-07-09.md +143 -0
- package/docs/ARCHITECTURE.md +125 -0
- package/docs/BUGHUNT-2026-07-05-NIGHT.md +98 -0
- package/docs/BUILD.md +63 -0
- package/docs/CANCEL-ASYNC-ATTRIBUTION-2026-07-09.md +98 -0
- package/docs/CC-198-VS-201-DRIFT-2026-07-09.md +70 -0
- package/docs/CC-BASELINE-FAKE-ZERO-AUDIT-2026-07-09.md +51 -0
- package/docs/CC-DRIFT-198-206-AGENT-TYPES-2026-07-10.md +82 -0
- package/docs/CC-DRIFT-198-206-CHANGELOG-2026-07-10.md +82 -0
- package/docs/CC-DRIFT-198-206-REMINDERS-2026-07-10.md +96 -0
- package/docs/CC-DRIFT-198-206-ROADMAP-2026-07-10.md +110 -0
- package/docs/CC-DRIFT-198-206-TOOL-INVENTORY-2026-07-10.md +53 -0
- package/docs/CC-DRIFT-198-206-USAGE-CONSTANTS-2026-07-10.md +64 -0
- package/docs/CC-DRIFT-198-206-WORKFLOW-2026-07-10.md +83 -0
- package/docs/CC-PARITY-CHECKLIST.md +220 -0
- package/docs/CC-PARITY-DEEP-SWEEP-2026-07-07.md +149 -0
- package/docs/CC-SUBAGENT-PROMPT-STUDY-2026-07-09.md +219 -0
- package/docs/CC-TASK-REMINDER-CADENCE-STUDY-2026-07-09.md +396 -0
- package/docs/CC-TOOL-PARITY-SWEEP-2026-07.md +56 -0
- package/docs/CC-TOOL-PROMPT-DEEP-DIFF-2026-07-08.md +274 -0
- package/docs/CC-TOOLSURFACE-DEEP-DIVE-2026-07-07.md +197 -0
- package/docs/CC206-OBSERVER-ANCHORS-2026-07-11.md +463 -0
- package/docs/CC207-CORE-SWEEP-BACKLOG-2026-07-12.md +155 -0
- package/docs/CENTER-CONTROL-PLANE-SEAM.md +86 -0
- package/docs/CLEANUP-CONTRACT-ANCHOR-2026-07-09.md +83 -0
- package/docs/COLD-START-RSI-2026-07-09.md +72 -0
- package/docs/COMPACTION-LIVE-AUDIT-2026-07-09.md +114 -0
- package/docs/CONTEXT-lifecycle-extension-points-and-stop-attribution.md +71 -0
- package/docs/COREWARS-POLYGLOT-TRIAGE-2026-07-09.md +85 -0
- package/docs/DEADTARGET-OVERFULL-HBOX-2026-07-10.md +92 -0
- package/docs/DEADTARGET-PATH-TRACING-REVERSE-2026-07-10.md +87 -0
- package/docs/DEADTARGET-WINNING-AVG-COREWARS-2026-07-10.md +96 -0
- package/docs/DEEPSEEK-API-LIMITS-PROBE-2026-07-09.md +118 -0
- package/docs/DESIGN-140-MOCK-VERIFY-2026-07-11.md +79 -0
- package/docs/DESIGN-140-VERIFICATION-2026-07-11.md +43 -0
- package/docs/DESIGN-DRAFT-workflow-collab-2026-07-11.md +56 -0
- package/docs/DESIGN-ORACLE-GROUNDING-GATE-2026-07-10.md +167 -0
- package/docs/DESIGN-TFRAG-RECONCILE-SCAFFOLD-2026-07-09.md +102 -0
- package/docs/EXP-PA2-PE-DESIGN-2026-07-11.md +220 -0
- package/docs/EXT-DOGFOOD-2026-07-12.md +50 -0
- package/docs/FINAL-VERIFY-SURFACE-AUDIT-2026-07-09.md +44 -0
- package/docs/FRAG-RECON-INVESTIGATION-2026-07-09.md +183 -0
- package/docs/HANDOFF.md +121 -0
- package/docs/KNOWN-ISSUES.md +96 -0
- package/docs/LEGW-WINDOW-TAX-2026-07-10.md +82 -0
- package/docs/LIVE-PROBE-BATCH-2026-07-11.md +207 -0
- package/docs/M2-CERT-ATTRIBUTION-2026-07-10.md +61 -0
- package/docs/M25-LEG-VARIANCE-ATTRIBUTION-2026-07-10.md +81 -0
- package/docs/MAILMAN-TIMEOUT-ATTRIBUTION-2026-07-10.md +88 -0
- package/docs/MEMORY-BACKEND-DIALECT-NOTES.md +69 -0
- package/docs/MTEB-ESCAPE-HATCH-ATTRIBUTION-2026-07-09.md +57 -0
- package/docs/MTEB-LEADERBOARD-ATTRIBUTION-2026-07-10.md +134 -0
- package/docs/ORACLE-GATE-NEGATIVE-SAMPLE-2026-07-11.md +28 -0
- package/docs/PARITY-CONTEXT-TRANSACTIONS-2026-07-10.md +67 -0
- package/docs/PARITY-PROGRESS-MATRIX-2026-07-10.md +37 -0
- package/docs/PARITY-SPOT-AGENT-TYPES-2026-07-10.md +70 -0
- package/docs/PARITY-SPOT-REMINDERS-2026-07-10.md +144 -0
- package/docs/PARITY-SPOT-TOOL-INVENTORY-2026-07-10.md +61 -0
- package/docs/PARITY-SPOT-USAGE-CONSTANTS-2026-07-10.md +95 -0
- package/docs/PARITY-SPOT-WORKFLOW-2026-07-10.md +93 -0
- package/docs/PASSWORD-RECOVERY-PANEL-VERDICT-2026-07-10.md +62 -0
- package/docs/R8-R9-FINALIZE-COORDINATION-2026-07-09.md +124 -0
- package/docs/REPL-CODE-MODE-EVALUATION-2026-07-10.md +187 -0
- package/docs/REPORT-1249-TARGETED.md +48 -0
- package/docs/RESEARCH-3P-MEMORY-SWAP-2026-07-12.md +273 -0
- package/docs/ROADMAP.md +111 -0
- package/docs/RSI-CLOUD-DEPLOY-2026-07-06.md +289 -0
- package/docs/RSI-PROCESS-AI-COLDSTART-2026-07-11.md +68 -0
- package/docs/S18-THOROUGHNESS-AUDIT-2026-07-09.md +113 -0
- package/docs/SERVICE-INTEGRATION-GUIDE.md +298 -0
- package/docs/SUBAGENT-STREAM-RESILIENCE-PARITY-2026-07-10.md +118 -0
- package/docs/SWEBENCH-PRO-RECON-2026-07-11.md +31 -0
- package/docs/TB-EFFICIENCY-TELEMETRY-2026-07-08.md +114 -0
- package/docs/TB-FAILURE-AUTOPSY-2026-07-05-RERUN.md +67 -0
- package/docs/TB-FAIRNESS-AUDIT-2026-07-08.md +141 -0
- package/docs/TB-FULL-1257-2026-07-08.md +77 -0
- package/docs/TB-LEG-GAP-ATTRIBUTION-1261-1263-2026-07-11.md +154 -0
- package/docs/TB-REGRESSION-DAEMON-KILL-2026-07-08.md +58 -0
- package/docs/TB-RSI-CROSSCHECK-2026-07-06.md +68 -0
- package/docs/TB-RSI-LEDGER.md +30 -0
- package/docs/TB-STABLE-SET-2026-07-08.md +127 -0
- package/docs/TB21-RECON-2026-07-11.md +28 -0
- package/docs/TEST-DESIGN-BATCH-1-2-3.md +97 -0
- package/docs/THIRD-PARTY-INTEGRATION.md +45 -0
- package/docs/TOKEN-ESTIMATE-CALIBRATION-LIVE-2026-07-09.md +102 -0
- package/docs/audit-2026-06-10-/347/254/254/344/272/214/350/275/256-/347/251/272/347/231/275/345/214/272/344/270/216/345/277/230/346/216/245/347/272/277.md +147 -0
- package/docs/audit-2026-06-10-/350/256/241/347/256/227bug/346/211/253/346/217/217.md +163 -0
- package/docs/audit-2026-06-11-/344/277/256/345/244/215/345/244/215/345/256/241/344/270/216/345/233/236/345/275/222/344/270/223/346/211/253.md +95 -0
- package/docs/audit-2026-06-12-design71-P1/346/275/234/344/274/217/351/235/242/350/243/201/345/206/263/344/270/216/345/220/236/351/224/231/345/256/241/350/256/241.md +45 -0
- package/docs/audit-2026-06-12-/345/205/254/345/274/200/346/227/213/351/222/256/346/264/273/346/200/247/344/270/216vendored/346/255/273/350/267/257.md +63 -0
- package/docs/audit-2026-06-15/ADDENDUM-second-pass.md +88 -0
- package/docs/audit-2026-06-15/ARCHITECTURE-AND-ROADMAP.md +187 -0
- package/docs/audit-2026-06-15/DOC-CORRECTIONS.md +105 -0
- package/docs/audit-2026-06-15/INDEX.md +49 -0
- package/docs/audit-2026-06-15/ORCHESTRATION-STATUS.md +98 -0
- package/docs/audit-2026-06-15/PRODUCTION-ISSUES.md +189 -0
- package/docs/audit-2026-06-15/REFERENCES-literature.md +139 -0
- package/docs/audit-2026-06-15/VENDOR-REFACTOR-PLAN.md +96 -0
- package/docs/cc-probe-198/README.md +72 -0
- package/docs/cc-probe-198/STABILITY-AUDIT.md +118 -0
- package/docs/cc-probe-198/live-schema-monitor-worktree-2026-07-09.json +56 -0
- package/docs/cc-probe-198/mount-variants.json +536 -0
- package/docs/cc-probe-198/plan-mode-run.json +1 -0
- package/docs/cc-probe-198/probe-bash-bg.json +224 -0
- package/docs/cc-probe-198/probe-edit-mismatch.json +120 -0
- package/docs/cc-probe-198/probe-read-missing.json +62 -0
- package/docs/cc-probe-198/probe-search-empty.json +127 -0
- package/docs/cc-probe-198/probe-task-family.json +227 -0
- package/docs/cc-probe-198/probes.status +6 -0
- package/docs/cc-probe-198/raw-capture-interactive.json +948 -0
- package/docs/cc-probe-198/raw-capture-print.json +787 -0
- package/docs/cc-probe-198/raw-capture2-interactive.json +948 -0
- package/docs/cc-probe-198/raw-capture2-print.json +787 -0
- package/docs/cc-probe-198/system-prompt.txt +135 -0
- package/docs/cc-probe-198/tools-array.json +962 -0
- package/docs/durability-boundary.md +63 -0
- package/docs/fix-2026-06-10-/350/256/241/347/256/227bug/344/277/256/345/244/215-search/346/211/271.md +75 -0
- package/docs/fix-2026-06-11-/347/254/254/344/272/214/350/275/256-/344/277/256/345/244/215-search/346/211/271.md +62 -0
- package/docs/parity-sweep/REPORT-DYNAMIC.md +97 -0
- package/docs/parity-sweep/REPORT-STATIC-GGB.md +127 -0
- package/docs/parity-sweep/REPORT-STATIC-RWE.md +133 -0
- package/docs/vendor-history.md +385 -0
- package/docs/vendored-upstream-diff-2026-07.md +83 -0
- package/package.json +70 -0
|
@@ -0,0 +1,753 @@
|
|
|
1
|
+
export type { AssistantMessageDiagnostic, DiagnosticErrorInfo } from "./diagnostics.js";
|
|
2
|
+
import type { AssistantMessageDiagnostic } from "./diagnostics.js";
|
|
3
|
+
import type { RepetitionEvent } from "../../brain/repetition.js";
|
|
4
|
+
export type KnownApi = "openai-completions" | "mistral-conversations" | "openai-responses" | "azure-openai-responses" | "openai-chatgpt-responses" | "anthropic-messages" | "bedrock-converse-stream" | "google-generative-ai" | "google-vertex";
|
|
5
|
+
export type Api = KnownApi | (string & {});
|
|
6
|
+
export type KnownImagesApi = "openrouter-images";
|
|
7
|
+
export type ImagesApi = KnownImagesApi | (string & {});
|
|
8
|
+
export type Provider = string;
|
|
9
|
+
export type KnownImagesProvider = "openrouter";
|
|
10
|
+
export type ImagesProvider = string;
|
|
11
|
+
/**
|
|
12
|
+
* Effort/intensity TIERS (no "off" — this is the value a provider effort field takes). ⚠ Name clash
|
|
13
|
+
* by history with the loop-layer `ThinkingLevel` (engine/loop/types.ts), which is the SEVEN-value
|
|
14
|
+
* on/off+tier knob ("off" | these six). Rule of thumb: harness/task config uses the loop's 7-tier
|
|
15
|
+
* type; provider compat fields (`reasoningEffortLevels`/`effortLevels`) use this 6-tier one.
|
|
16
|
+
*/
|
|
17
|
+
export type ThinkingLevel = "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
18
|
+
export type ModelThinkingLevel = "off" | ThinkingLevel;
|
|
19
|
+
export type ThinkingLevelMap = Partial<Record<ModelThinkingLevel, string | null>>;
|
|
20
|
+
export type CacheRetention = "none" | "short" | "long";
|
|
21
|
+
export type Transport = "sse" | "websocket" | "websocket-cached" | "auto";
|
|
22
|
+
export type MaybePromise<T> = T | Promise<T>;
|
|
23
|
+
export interface ProviderResponse {
|
|
24
|
+
status: number;
|
|
25
|
+
headers: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* design/131 — per-task resilience overrides (intent flags, NOT decorator config). A bench/eval or
|
|
29
|
+
* critical task can say "fail rather than fall back" without any new global switch; the deployment's
|
|
30
|
+
* decorator stack stays the single topology owner. All default to today's behavior when absent.
|
|
31
|
+
*/
|
|
32
|
+
export interface ResilienceOptions {
|
|
33
|
+
/** false = this task forbids reactive model DEGRADE (the degrading brain passes the failure through). */
|
|
34
|
+
allowDegrade?: boolean;
|
|
35
|
+
/** false = this task forbids cross-gateway FAILOVER (only the primary brain is tried). */
|
|
36
|
+
allowFailover?: boolean;
|
|
37
|
+
/** true = this task ignores an OPEN circuit breaker's fast-fail (the probe goes through; outcomes
|
|
38
|
+
* are STILL recorded so shared observation is undiminished). Operator-facing — an open breaker
|
|
39
|
+
* exists to protect the provider; bypass only where true failure shape matters (benchmarks). */
|
|
40
|
+
bypassBreaker?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface StreamOptions {
|
|
43
|
+
temperature?: number;
|
|
44
|
+
maxTokens?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Stop sequences forwarded to providers that support them. Providers map this
|
|
47
|
+
* to their native request field, such as OpenAI `stop` or Anthropic
|
|
48
|
+
* `stop_sequences`.
|
|
49
|
+
*/
|
|
50
|
+
stop?: string[];
|
|
51
|
+
signal?: AbortSignal;
|
|
52
|
+
apiKey?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Preferred transport for providers that support multiple transports.
|
|
55
|
+
* Providers that do not support this option ignore it.
|
|
56
|
+
*/
|
|
57
|
+
transport?: Transport;
|
|
58
|
+
/**
|
|
59
|
+
* Prompt cache retention preference. Providers map this to their supported values.
|
|
60
|
+
* Default: "short".
|
|
61
|
+
*/
|
|
62
|
+
cacheRetention?: CacheRetention;
|
|
63
|
+
/**
|
|
64
|
+
* Optional session identifier for providers that support session-based caching.
|
|
65
|
+
* Providers can use this to enable prompt caching, request routing, or other
|
|
66
|
+
* session-aware features. Ignored by providers that don't support it.
|
|
67
|
+
*/
|
|
68
|
+
sessionId?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Optional provider prompt-cache affinity key, distinct from transcript/session identity.
|
|
71
|
+
* Providers that do not support separate cache affinity ignore it.
|
|
72
|
+
*/
|
|
73
|
+
promptCacheKey?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Optional callback for inspecting or replacing provider payloads before sending.
|
|
76
|
+
* Return undefined to keep the payload unchanged.
|
|
77
|
+
*/
|
|
78
|
+
onPayload?: (payload: unknown, model: Model) => MaybePromise<unknown>;
|
|
79
|
+
/**
|
|
80
|
+
* Optional callback invoked after an HTTP response is received and before
|
|
81
|
+
* its body stream is consumed.
|
|
82
|
+
*/
|
|
83
|
+
onResponse?: (response: ProviderResponse, model: Model) => void | Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Optional custom HTTP headers to include in API requests.
|
|
86
|
+
* Merged with provider defaults; can override default headers.
|
|
87
|
+
* Not supported by all providers (e.g., AWS Bedrock uses SDK auth).
|
|
88
|
+
*/
|
|
89
|
+
headers?: Record<string, string>;
|
|
90
|
+
/**
|
|
91
|
+
* HTTP request timeout in milliseconds for providers/SDKs that support it.
|
|
92
|
+
* For example, OpenAI and Anthropic SDK clients default to 10 minutes.
|
|
93
|
+
*/
|
|
94
|
+
timeoutMs?: number;
|
|
95
|
+
/**
|
|
96
|
+
* service [405] P0 — true when `maxTokens` on THIS call was DYNAMICALLY SHRUNK by the wall-clock
|
|
97
|
+
* cap (design/130 P1), not statically configured. A provider hitting max_tokens with ONLY
|
|
98
|
+
* reasoning output should then finish as a RECOVERABLE `length` stop (the loop's truncated-output
|
|
99
|
+
* continue picks it up; the next call is cap-exempt via the runtime reasoning observation) instead
|
|
100
|
+
* of the static-config fail-loud error — under a dynamic cap the truncation is the ENGINE's doing,
|
|
101
|
+
* not a deployment mistake.
|
|
102
|
+
*/
|
|
103
|
+
maxTokensDynamic?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Blackboard [477] — the STATIC leg of the [405] dynamicCut family. True = the caller (the agent
|
|
106
|
+
* loop) is prepared to recover a `length` stop, so a provider hitting the STATIC max_tokens with
|
|
107
|
+
* ONLY reasoning output (a budget-ignoring thinking model — e.g. a Qwen gateway that ignores the
|
|
108
|
+
* thinking control plane and eats the whole static budget in one thought) may finish as a
|
|
109
|
+
* RECOVERABLE `length` stop tagged `staticReasoningCut` instead of the fail-loud config error.
|
|
110
|
+
* The loop grants this only while its per-run stop-loss budget lasts (2 downgrades), then stops
|
|
111
|
+
* passing it — the third truncation fails loud again (no infinite truncate/continue burn).
|
|
112
|
+
* Absent/false ⇒ today's behavior: reasoning-only static max_tokens is a fail-loud error (a
|
|
113
|
+
* genuine misconfiguration must stay loud — e.g. the compaction summarizer relies on the
|
|
114
|
+
* `length_empty` errorKind to escalate its budget).
|
|
115
|
+
*/
|
|
116
|
+
staticReasoningCutDowngrade?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* design/131 (service [404] 拍) — per-task resilience INTENT flags, threaded per call so the
|
|
119
|
+
* resilience decorator stack (degrading / failover / circuit-breaker) can stand aside for THIS
|
|
120
|
+
* task. Intent-only: no decorator topology rides the wire; each layer reads the flag it owns and
|
|
121
|
+
* defaults to today's behavior when absent. See design/131-per-task-resilience-overrides.md.
|
|
122
|
+
*/
|
|
123
|
+
resilience?: ResilienceOptions;
|
|
124
|
+
/**
|
|
125
|
+
* design/130 P2b — absolute soft wall-clock deadline (ms epoch) for THIS call. A provider that
|
|
126
|
+
* observes `Date.now()` crossing it SHOULD cancel the stream deliberately, salvage the prefix
|
|
127
|
+
* streamed so far, and end the turn `error` with the shared walltime-cutoff sentinel message
|
|
128
|
+
* (see src/brain/walltime.ts) — the loop then drives a bounded write-out turn instead of the
|
|
129
|
+
* generation riding into the runner's hard abort. Best-effort contract: a provider that ignores
|
|
130
|
+
* it is still safe (the runner's hard-abort backstop remains the outer bound).
|
|
131
|
+
*/
|
|
132
|
+
callDeadlineMs?: number;
|
|
133
|
+
/**
|
|
134
|
+
* Maximum retry attempts for providers/SDKs that support client-side retries.
|
|
135
|
+
* For example, OpenAI and Anthropic SDK clients default to 2.
|
|
136
|
+
*/
|
|
137
|
+
maxRetries?: number;
|
|
138
|
+
/**
|
|
139
|
+
* Maximum delay in milliseconds to wait for a retry when the server requests a long wait.
|
|
140
|
+
* If the server's requested delay exceeds this value, the request fails immediately
|
|
141
|
+
* with an error containing the requested delay, allowing higher-level retry logic
|
|
142
|
+
* to handle it with user visibility.
|
|
143
|
+
* Default: 60000 (60 seconds). Set to 0 to disable the cap.
|
|
144
|
+
*/
|
|
145
|
+
maxRetryDelayMs?: number;
|
|
146
|
+
/**
|
|
147
|
+
* Optional metadata to include in API requests.
|
|
148
|
+
* Providers extract the fields they understand and ignore the rest.
|
|
149
|
+
* For example, Anthropic uses `user_id` for abuse tracking and rate limiting.
|
|
150
|
+
*/
|
|
151
|
+
metadata?: Record<string, unknown>;
|
|
152
|
+
}
|
|
153
|
+
export type ProviderStreamOptions = StreamOptions & Record<string, unknown>;
|
|
154
|
+
export interface ImagesOptions {
|
|
155
|
+
signal?: AbortSignal;
|
|
156
|
+
apiKey?: string;
|
|
157
|
+
/**
|
|
158
|
+
* Optional callback for inspecting or replacing provider payloads before sending.
|
|
159
|
+
* Return undefined to keep the payload unchanged.
|
|
160
|
+
*/
|
|
161
|
+
onPayload?: (payload: unknown, model: ImagesModel) => MaybePromise<unknown>;
|
|
162
|
+
/**
|
|
163
|
+
* Optional callback invoked after an HTTP response is received.
|
|
164
|
+
*/
|
|
165
|
+
onResponse?: (response: ProviderResponse, model: ImagesModel) => void | Promise<void>;
|
|
166
|
+
/**
|
|
167
|
+
* Optional custom HTTP headers to include in API requests.
|
|
168
|
+
* Merged with provider defaults; can override default headers.
|
|
169
|
+
*/
|
|
170
|
+
headers?: Record<string, string>;
|
|
171
|
+
/**
|
|
172
|
+
* HTTP request timeout in milliseconds for providers/SDKs that support it.
|
|
173
|
+
*/
|
|
174
|
+
timeoutMs?: number;
|
|
175
|
+
/**
|
|
176
|
+
* Maximum retry attempts for providers/SDKs that support client-side retries.
|
|
177
|
+
*/
|
|
178
|
+
maxRetries?: number;
|
|
179
|
+
/**
|
|
180
|
+
* Maximum delay in milliseconds to wait for a retry when the server requests a long wait.
|
|
181
|
+
* If the server's requested delay exceeds this value, the request fails immediately
|
|
182
|
+
* with an error containing the requested delay, allowing higher-level retry logic
|
|
183
|
+
* to handle it with user visibility.
|
|
184
|
+
* Default: 60000 (60 seconds). Set to 0 to disable the cap.
|
|
185
|
+
*/
|
|
186
|
+
maxRetryDelayMs?: number;
|
|
187
|
+
/**
|
|
188
|
+
* Optional metadata to include in API requests.
|
|
189
|
+
* Providers extract the fields they understand and ignore the rest.
|
|
190
|
+
*/
|
|
191
|
+
metadata?: Record<string, unknown>;
|
|
192
|
+
}
|
|
193
|
+
export type ProviderImagesOptions = ImagesOptions & Record<string, unknown>;
|
|
194
|
+
export interface SimpleStreamOptions extends StreamOptions {
|
|
195
|
+
reasoning?: ThinkingLevel;
|
|
196
|
+
}
|
|
197
|
+
export type StreamFunction<TApi extends Api = Api, TOptions extends StreamOptions = StreamOptions> = (model: Model<TApi>, context: Context, options?: TOptions) => AssistantMessageEventStreamContract;
|
|
198
|
+
export type ImagesFunction<TApi extends ImagesApi = ImagesApi, TOptions extends ImagesOptions = ImagesOptions> = (model: ImagesModel<TApi>, context: ImagesContext, options?: TOptions) => Promise<AssistantImages>;
|
|
199
|
+
export interface TextSignatureV1 {
|
|
200
|
+
v: 1;
|
|
201
|
+
id: string;
|
|
202
|
+
phase?: "commentary" | "final_answer";
|
|
203
|
+
}
|
|
204
|
+
export interface TextContent {
|
|
205
|
+
type: "text";
|
|
206
|
+
text: string;
|
|
207
|
+
textSignature?: string;
|
|
208
|
+
}
|
|
209
|
+
export interface ThinkingContent {
|
|
210
|
+
type: "thinking";
|
|
211
|
+
thinking: string;
|
|
212
|
+
thinkingSignature?: string;
|
|
213
|
+
/** When true, the thinking content was redacted by safety filters. The opaque
|
|
214
|
+
* encrypted payload is stored in `thinkingSignature` so it can be passed back
|
|
215
|
+
* to the API for multi-turn continuity. */
|
|
216
|
+
redacted?: boolean;
|
|
217
|
+
}
|
|
218
|
+
export interface ImageContent {
|
|
219
|
+
type: "image";
|
|
220
|
+
data: string;
|
|
221
|
+
mimeType: string;
|
|
222
|
+
}
|
|
223
|
+
/** A binary document payload (today: PDF only — `application/pdf`). Produced by the Read tool's PDF
|
|
224
|
+
* branch (CC FileReadTool parity: the file is sent to the model as a native `document` content block
|
|
225
|
+
* so an Anthropic-family model reads the text layer directly). Provider support is uneven: the
|
|
226
|
+
* anthropic brain forwards it as `{type:"document",source:{type:"base64",…}}`; the openai brain has
|
|
227
|
+
* no equivalent block and substitutes an honest text placeholder (never a silent drop). */
|
|
228
|
+
export interface DocumentContent {
|
|
229
|
+
type: "document";
|
|
230
|
+
data: string;
|
|
231
|
+
mimeType: string;
|
|
232
|
+
}
|
|
233
|
+
export interface ToolCall {
|
|
234
|
+
type: "toolCall";
|
|
235
|
+
id: string;
|
|
236
|
+
name: string;
|
|
237
|
+
arguments: Record<string, unknown>;
|
|
238
|
+
thoughtSignature?: string;
|
|
239
|
+
executionMode?: "sequential" | "parallel";
|
|
240
|
+
}
|
|
241
|
+
export interface Usage {
|
|
242
|
+
input: number;
|
|
243
|
+
output: number;
|
|
244
|
+
cacheRead: number;
|
|
245
|
+
cacheWrite: number;
|
|
246
|
+
totalTokens: number;
|
|
247
|
+
cost: {
|
|
248
|
+
input: number;
|
|
249
|
+
output: number;
|
|
250
|
+
cacheRead: number;
|
|
251
|
+
cacheWrite: number;
|
|
252
|
+
total: number;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
export type StopReason = "stop" | "length" | "toolUse" | "error" | "aborted";
|
|
256
|
+
export interface UserMessage {
|
|
257
|
+
role: "user";
|
|
258
|
+
content: string | (TextContent | ImageContent)[];
|
|
259
|
+
timestamp: number;
|
|
260
|
+
}
|
|
261
|
+
export interface AssistantMessage {
|
|
262
|
+
role: "assistant";
|
|
263
|
+
content: (TextContent | ThinkingContent | ToolCall)[];
|
|
264
|
+
api: Api;
|
|
265
|
+
provider: Provider;
|
|
266
|
+
model: string;
|
|
267
|
+
responseModel?: string;
|
|
268
|
+
responseId?: string;
|
|
269
|
+
diagnostics?: AssistantMessageDiagnostic[];
|
|
270
|
+
usage: Usage;
|
|
271
|
+
/** TB 尸检 T1-5 (codex 1.238 复审 F3): the provider never delivered a usage frame for this message (e.g. a
|
|
272
|
+
* degenerate-repetition cutoff cancelled the stream first) — `usage` above is a zero-synthesized shell.
|
|
273
|
+
* Consumers must treat the numbers as UNKNOWN, not zero. Absent ⇒ usage is provider-reported. */
|
|
274
|
+
usageMissing?: true;
|
|
275
|
+
stopReason: StopReason;
|
|
276
|
+
errorMessage?: string;
|
|
277
|
+
/** Structured cause for `stopReason:"error"` a caller can react to programmatically (errorMessage is
|
|
278
|
+
* human-facing prose and NOT a contract). `"length_empty"` = a max_tokens cut that produced reasoning/
|
|
279
|
+
* scratch but NO answer text (both brains surface that as an error, not a "length" stop) — the compaction
|
|
280
|
+
* summary path escalates its token budget on it. Extend the union as new recoverable causes are classified. */
|
|
281
|
+
errorKind?: "length_empty";
|
|
282
|
+
/**
|
|
283
|
+
* design/124 tier A: this final message was PARTIALLY FINALIZED after a mid-stream connection
|
|
284
|
+
* loss/stall — the substantive streamed prefix (text and/or completed tool calls) was promoted to
|
|
285
|
+
* final content instead of failing the turn (CC 198 queryModelStreaming parity: avoid re-billing +
|
|
286
|
+
* keep the displayed content consistent with the result). `stopReason` is synthesized from the
|
|
287
|
+
* content ("toolUse" when a completed tool call streamed, else "stop"); `errorMessage` carries the
|
|
288
|
+
* CC-verbatim warning ("Response stalled mid-stream." / "Connection closed mid-response."), visible
|
|
289
|
+
* to the model in the transcript. Downstream semantics (agent-loop): `partialFinalized &&
|
|
290
|
+
* stopReason==="stop"` gets a BOUNDED continue nudge (an autonomous run must not book the cut as an
|
|
291
|
+
* incomplete success); `partialFinalized && stopReason==="toolUse"` executes normally (a truncated
|
|
292
|
+
* trailing call was already dropped by the finalize malformed path). Additive — absent everywhere else.
|
|
293
|
+
*/
|
|
294
|
+
partialFinalized?: true;
|
|
295
|
+
/**
|
|
296
|
+
* Degenerate-repetition telemetry for THIS call (clay 2026-07-10: counts + detected segment, not just
|
|
297
|
+
* a boolean). `cut` = the event that cancelled the stream (always paired with the DEGENERATE_MESSAGE
|
|
298
|
+
* errorMessage); `spared` = repetitions that landed in a detection window but were exempted by a
|
|
299
|
+
* 2e1c161 structural allowance (code-line shape / divider run) — deduped per stream by rule+segment.
|
|
300
|
+
* The RSI raw material for judging whether the allowance is too wide or too narrow. Additive —
|
|
301
|
+
* absent when the detector never hit anything.
|
|
302
|
+
*/
|
|
303
|
+
repetition?: {
|
|
304
|
+
cut?: RepetitionEvent;
|
|
305
|
+
spared?: RepetitionEvent[];
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* Blackboard [477]: this `length` stop is a DOWNGRADED reasoning-only STATIC max_tokens hit — the
|
|
309
|
+
* model spent the entire static output budget on thinking (budget-ignoring gateway shape) and the
|
|
310
|
+
* brain, granted `StreamOptions.staticReasoningCutDowngrade`, finished the turn as a recoverable
|
|
311
|
+
* `length` instead of the fail-loud config error. The agent loop counts these per run to enforce
|
|
312
|
+
* the 2-downgrade stop-loss. Additive — absent everywhere else (incl. the dynamicCut shape).
|
|
313
|
+
*/
|
|
314
|
+
staticReasoningCut?: true;
|
|
315
|
+
timestamp: number;
|
|
316
|
+
}
|
|
317
|
+
export interface ToolResultMessage<TDetails = unknown> {
|
|
318
|
+
role: "toolResult";
|
|
319
|
+
toolCallId: string;
|
|
320
|
+
toolName: string;
|
|
321
|
+
content: (TextContent | ImageContent | DocumentContent)[];
|
|
322
|
+
details?: TDetails;
|
|
323
|
+
isError: boolean;
|
|
324
|
+
timestamp: number;
|
|
325
|
+
}
|
|
326
|
+
export type Message = UserMessage | AssistantMessage | ToolResultMessage;
|
|
327
|
+
export type ImagesInputContent = TextContent | ImageContent;
|
|
328
|
+
export type ImagesOutputContent = TextContent | ImageContent;
|
|
329
|
+
export interface ImagesContext {
|
|
330
|
+
input: ImagesInputContent[];
|
|
331
|
+
}
|
|
332
|
+
export type ImagesStopReason = "stop" | "error" | "aborted";
|
|
333
|
+
export interface AssistantImages {
|
|
334
|
+
api: ImagesApi;
|
|
335
|
+
provider: ImagesProvider;
|
|
336
|
+
model: string;
|
|
337
|
+
output: ImagesOutputContent[];
|
|
338
|
+
responseId?: string;
|
|
339
|
+
usage?: Usage;
|
|
340
|
+
stopReason: ImagesStopReason;
|
|
341
|
+
errorMessage?: string;
|
|
342
|
+
timestamp: number;
|
|
343
|
+
}
|
|
344
|
+
import type { TSchema } from "typebox";
|
|
345
|
+
export interface Tool<TParameters extends TSchema = TSchema> {
|
|
346
|
+
name: string;
|
|
347
|
+
/** VENDORED EDIT (design/115 P0): canonical tool renames keep old model/SDK wire names as aliases. */
|
|
348
|
+
aliases?: string[];
|
|
349
|
+
description: string;
|
|
350
|
+
parameters: TParameters;
|
|
351
|
+
}
|
|
352
|
+
export interface Context {
|
|
353
|
+
systemPrompt?: string;
|
|
354
|
+
messages: Message[];
|
|
355
|
+
tools?: Tool[];
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Event protocol for AssistantMessageEventStream.
|
|
359
|
+
*
|
|
360
|
+
* Streams should emit `start` before partial updates, then terminate with either:
|
|
361
|
+
* - `done` carrying the final successful AssistantMessage, or
|
|
362
|
+
* - `error` carrying the final AssistantMessage with stopReason "error" or "aborted"
|
|
363
|
+
* and errorMessage.
|
|
364
|
+
*/
|
|
365
|
+
export type AssistantMessageEvent = {
|
|
366
|
+
type: "start";
|
|
367
|
+
partial: AssistantMessage;
|
|
368
|
+
} | {
|
|
369
|
+
type: "text_start";
|
|
370
|
+
contentIndex: number;
|
|
371
|
+
partial: AssistantMessage;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* VENDORED EDIT (upstream cherry-pick 6fcc945702, monthly diff 2026-06-13): plain text deltas may
|
|
375
|
+
* omit `partial` to avoid retaining one full assistant snapshot per token; consumers replay
|
|
376
|
+
* `delta` from the latest start/end partial checkpoint (agent-loop reconstructs).
|
|
377
|
+
*/
|
|
378
|
+
| {
|
|
379
|
+
type: "text_delta";
|
|
380
|
+
contentIndex: number;
|
|
381
|
+
delta: string;
|
|
382
|
+
partial?: AssistantMessage;
|
|
383
|
+
} | {
|
|
384
|
+
type: "text_end";
|
|
385
|
+
contentIndex: number;
|
|
386
|
+
content: string;
|
|
387
|
+
partial: AssistantMessage;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* design/124 tier B contract note: after a mid-stream failure with only thinking streamed, the
|
|
391
|
+
* brain seals the block (`thinking_end`) and RE-SENDS the whole turn WITHOUT a second `start` —
|
|
392
|
+
* the retry attempt may then legally reopen a thinking block at the SAME contentIndex (the openai
|
|
393
|
+
* parser hardcodes thinking at index 0; the anthropic wire restarts block indexing per attempt).
|
|
394
|
+
* Consumers that render by `partial` snapshot are naturally correct (each retry event carries a
|
|
395
|
+
* fresh snapshot that REPLACES the previous attempt's content — CC's "drop the thinking" semantics);
|
|
396
|
+
* a consumer keying blocks by index gets exactly the intended replacement.
|
|
397
|
+
*/
|
|
398
|
+
| {
|
|
399
|
+
type: "thinking_start";
|
|
400
|
+
contentIndex: number;
|
|
401
|
+
partial: AssistantMessage;
|
|
402
|
+
} | {
|
|
403
|
+
type: "thinking_delta";
|
|
404
|
+
contentIndex: number;
|
|
405
|
+
delta: string;
|
|
406
|
+
partial: AssistantMessage;
|
|
407
|
+
} | {
|
|
408
|
+
type: "thinking_end";
|
|
409
|
+
contentIndex: number;
|
|
410
|
+
content: string;
|
|
411
|
+
partial: AssistantMessage;
|
|
412
|
+
} | {
|
|
413
|
+
type: "toolcall_start";
|
|
414
|
+
contentIndex: number;
|
|
415
|
+
partial: AssistantMessage;
|
|
416
|
+
} | {
|
|
417
|
+
type: "toolcall_delta";
|
|
418
|
+
contentIndex: number;
|
|
419
|
+
delta: string;
|
|
420
|
+
partial: AssistantMessage;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* design/120 P2.0 provider contract — `toolcall_end` may trigger IN-STREAM TOOL EXECUTION
|
|
424
|
+
* (agent-loop P2), so its emission carries real semantics, not just UI progress:
|
|
425
|
+
* - Emit it only when the call's input is COMPLETE and parsed to a valid JSON object (`toolCall`
|
|
426
|
+
* is executable as-is). A malformed/truncated accumulation must emit nothing (fail-closed: the
|
|
427
|
+
* call then never executes in-stream; the brain's finalize surfaces it via its malformed path).
|
|
428
|
+
* - Emit AT MOST ONCE per call, and every emitted call MUST appear — same `id`, same `arguments`
|
|
429
|
+
* object identity not required but same values — in the terminal `done` message's content.
|
|
430
|
+
* (One-directional: content may carry calls that never emitted `toolcall_end`, e.g. trailing
|
|
431
|
+
* calls closed at finalize or text-repaired calls; those simply run on the post-stream batch
|
|
432
|
+
* path.) An `error` terminal is allowed to lack the block; the loop's error-final reconciliation
|
|
433
|
+
* merges executor-held calls back into the persisted content (design/120 §5.4).
|
|
434
|
+
*/
|
|
435
|
+
| {
|
|
436
|
+
type: "toolcall_end";
|
|
437
|
+
contentIndex: number;
|
|
438
|
+
toolCall: ToolCall;
|
|
439
|
+
partial: AssistantMessage;
|
|
440
|
+
} | {
|
|
441
|
+
type: "done";
|
|
442
|
+
reason: Extract<StopReason, "stop" | "length" | "toolUse">;
|
|
443
|
+
message: AssistantMessage;
|
|
444
|
+
} | {
|
|
445
|
+
type: "error";
|
|
446
|
+
reason: Extract<StopReason, "aborted" | "error">;
|
|
447
|
+
error: AssistantMessage;
|
|
448
|
+
};
|
|
449
|
+
export interface AssistantMessageEventStreamContract extends AsyncIterable<AssistantMessageEvent> {
|
|
450
|
+
push(event: AssistantMessageEvent): void;
|
|
451
|
+
end(result?: AssistantMessage): void;
|
|
452
|
+
result(): Promise<AssistantMessage>;
|
|
453
|
+
}
|
|
454
|
+
export interface AssistantMessageEventStreamLike extends AsyncIterable<AssistantMessageEvent> {
|
|
455
|
+
result(): Promise<AssistantMessage>;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Compatibility settings for OpenAI-compatible completions APIs.
|
|
459
|
+
* Use this to override URL-based auto-detection for custom providers.
|
|
460
|
+
*/
|
|
461
|
+
export interface OpenAICompletionsCompat {
|
|
462
|
+
/** Whether the provider supports the `store` field. Default: auto-detected from URL. */
|
|
463
|
+
supportsStore?: boolean;
|
|
464
|
+
/** Whether the provider supports the `developer` role (vs `system`). Default: auto-detected from URL. */
|
|
465
|
+
supportsDeveloperRole?: boolean;
|
|
466
|
+
/** Whether the provider supports `reasoning_effort`. Default: auto-detected from URL. */
|
|
467
|
+
supportsReasoningEffort?: boolean;
|
|
468
|
+
/**
|
|
469
|
+
* Which `reasoning_effort` tiers this endpoint accepts. Absent → the conservative default
|
|
470
|
+
* (`minimal | low | medium | high`), so a higher requested tier (`xhigh`/`max`) clamps down to `high`
|
|
471
|
+
* rather than 422'ing a stock OpenAI endpoint. Declare a higher tier here when the provider genuinely
|
|
472
|
+
* takes it (e.g. `["minimal","low","medium","high","xhigh"]`). See sema-core design/96 S5.
|
|
473
|
+
*/
|
|
474
|
+
reasoningEffortLevels?: ThinkingLevel[];
|
|
475
|
+
/** Whether the provider supports `stream_options: { include_usage: true }` for token usage in streaming responses. Default: true. */
|
|
476
|
+
supportsUsageInStreaming?: boolean;
|
|
477
|
+
/** Which field to use for max tokens. Default: `"max_tokens"` (no URL auto-detection — declare
|
|
478
|
+
* `"max_completion_tokens"` for newer stock-OpenAI models that require it; design/119 #3). */
|
|
479
|
+
maxTokensField?: "max_completion_tokens" | "max_tokens";
|
|
480
|
+
/** Whether tool results require the `name` field. Default: auto-detected from URL. */
|
|
481
|
+
requiresToolResultName?: boolean;
|
|
482
|
+
/** Whether a user message after tool results requires an assistant message in between. Default: auto-detected from URL. */
|
|
483
|
+
requiresAssistantAfterToolResult?: boolean;
|
|
484
|
+
/** Whether thinking blocks must be converted to text blocks with <thinking> delimiters. Default: auto-detected from URL. */
|
|
485
|
+
requiresThinkingAsText?: boolean;
|
|
486
|
+
/** Whether all replayed assistant messages must include an empty reasoning_content field when reasoning is enabled. Default: auto-detected from URL. */
|
|
487
|
+
requiresReasoningContentOnAssistantMessages?: boolean;
|
|
488
|
+
/** Format for reasoning/thinking parameter. "openai" uses reasoning_effort, "openrouter" uses reasoning: { effort }, "deepseek" uses thinking: { type } plus reasoning_effort, "together" uses reasoning: { enabled } plus reasoning_effort when supported, "zai" uses top-level enable_thinking: boolean, "qwen" uses top-level enable_thinking: boolean, and "qwen-chat-template" uses chat_template_kwargs.enable_thinking. Default: "openai". */
|
|
489
|
+
thinkingFormat?: "openai" | "openrouter" | "deepseek" | "together" | "zai" | "qwen" | "qwen-chat-template";
|
|
490
|
+
/** OpenRouter-specific routing preferences. Only used when baseUrl points to OpenRouter. */
|
|
491
|
+
openRouterRouting?: OpenRouterRouting;
|
|
492
|
+
/** Vercel AI Gateway routing preferences. Only used when baseUrl points to Vercel AI Gateway. */
|
|
493
|
+
vercelGatewayRouting?: VercelGatewayRouting;
|
|
494
|
+
/** Whether z.ai supports top-level `tool_stream: true` for streaming tool call deltas. Default: false. */
|
|
495
|
+
zaiToolStream?: boolean;
|
|
496
|
+
/** Whether the provider supports the `strict` field in tool definitions. Default: true. */
|
|
497
|
+
supportsStrictMode?: boolean;
|
|
498
|
+
/** Cache control convention for prompt caching. "anthropic" applies Anthropic-style `cache_control` markers to the system prompt, last tool definition, and last user/assistant text content. */
|
|
499
|
+
cacheControlFormat?: "anthropic";
|
|
500
|
+
/** Whether to send known session-affinity headers (`session_id`, `x-client-request-id`, `x-session-affinity`) from `options.sessionId` when caching is enabled. Default: false. */
|
|
501
|
+
sendSessionAffinityHeaders?: boolean;
|
|
502
|
+
/** Whether the provider supports long prompt cache retention (`prompt_cache_retention: "24h"` or Anthropic-style `cache_control.ttl: "1h"`, depending on format). Default: true. */
|
|
503
|
+
supportsLongCacheRetention?: boolean;
|
|
504
|
+
}
|
|
505
|
+
/** Compatibility settings for OpenAI Responses APIs. */
|
|
506
|
+
export interface OpenAIResponsesCompat {
|
|
507
|
+
/** Whether to send the OpenAI `session_id` cache-affinity header from `options.sessionId` when caching is enabled. Default: true. */
|
|
508
|
+
sendSessionIdHeader?: boolean;
|
|
509
|
+
/** Whether the provider supports `prompt_cache_retention: "24h"`. Default: true. */
|
|
510
|
+
supportsLongCacheRetention?: boolean;
|
|
511
|
+
}
|
|
512
|
+
/** Compatibility settings for Anthropic Messages-compatible APIs. */
|
|
513
|
+
export interface AnthropicMessagesCompat {
|
|
514
|
+
/**
|
|
515
|
+
* How this endpoint takes extended thinking (CC 2.1.198 parity, design/119).
|
|
516
|
+
* - `"budget"` (default, pre-Fable models): `thinking: { type: "enabled", budget_tokens }`.
|
|
517
|
+
* - `"adaptive"` (Fable 5 / Opus 4.8/4.7 class): `thinking: { type: "adaptive" }` — NO
|
|
518
|
+
* `budget_tokens` (these models 400 on a budget), no max_tokens bump; the intensity is carried
|
|
519
|
+
* by `output_config.effort` instead (see {@link effortLevels}). `off` omits the field entirely
|
|
520
|
+
* (these models also reject `{type:"disabled"}`).
|
|
521
|
+
*/
|
|
522
|
+
thinkingMode?: "budget" | "adaptive";
|
|
523
|
+
/**
|
|
524
|
+
* Effort tiers this endpoint accepts via `output_config.effort` (CC 2.1.198 `effort` /
|
|
525
|
+
* `xhigh_effort` / `max_effort` capability bits collapsed into one declared set, matching the
|
|
526
|
+
* `reasoningEffortLevels` pattern on {@link OpenAICompletionsCompat}). Present ⇒ the brain sends
|
|
527
|
+
* `output_config: { effort }` plus the `effort-2025-11-24` beta header, clamping the requested
|
|
528
|
+
* tier DOWN into this set (e.g. Fable 5 = `["low","medium","high","xhigh","max"]`; a model without
|
|
529
|
+
* `xhigh_effort` declares up to `"high"` and higher requests clamp). Absent ⇒ no `output_config`
|
|
530
|
+
* is ever sent (pre-effort models unchanged).
|
|
531
|
+
*/
|
|
532
|
+
effortLevels?: ThinkingLevel[];
|
|
533
|
+
/**
|
|
534
|
+
* Whether the endpoint accepts `temperature` at all. CC 2.1.198 sends temperature only to a
|
|
535
|
+
* legacy allowlist — Fable-5-class models NEVER receive it (400 risk), independent of thinking
|
|
536
|
+
* state. Default true (existing models unchanged); `false` drops a caller temperature
|
|
537
|
+
* unconditionally, not just under extended thinking.
|
|
538
|
+
*/
|
|
539
|
+
supportsTemperature?: boolean;
|
|
540
|
+
/**
|
|
541
|
+
* design/119 S4 (CC 2.1.198 `context_management` capability): when thinking is enabled, send
|
|
542
|
+
* `context_management: { edits: [{ type: "clear_thinking_20251015", keep: "all" }] }` plus the
|
|
543
|
+
* `context-management-2025-06-27` beta — an explicit opt-OUT of the server's default
|
|
544
|
+
* thinking-clearing, preserving cross-turn reasoning continuity (what CC sends on first-party
|
|
545
|
+
* endpoints). Declare only on endpoints that accept the beta (real Anthropic); an
|
|
546
|
+
* Anthropic-COMPATIBLE gateway (e.g. DeepSeek's anthropic endpoint) must leave it off.
|
|
547
|
+
*/
|
|
548
|
+
contextManagement?: boolean;
|
|
549
|
+
/**
|
|
550
|
+
* design/119 S4 (CC 2.1.198): attach the `interleaved-thinking-2025-05-14` beta on tool-enabled
|
|
551
|
+
* requests with thinking on (thinking blocks may interleave with tool_use). Declare per endpoint;
|
|
552
|
+
* absent = no beta (pre-119 behavior; a deployment could already do this via static `headers`).
|
|
553
|
+
*/
|
|
554
|
+
interleavedThinking?: boolean;
|
|
555
|
+
/**
|
|
556
|
+
* Whether the provider accepts per-tool `eager_input_streaming`.
|
|
557
|
+
* When false, the Anthropic provider omits `tools[].eager_input_streaming`
|
|
558
|
+
* and sends the legacy `fine-grained-tool-streaming-2025-05-14` beta header
|
|
559
|
+
* for tool-enabled requests.
|
|
560
|
+
* Default: true.
|
|
561
|
+
*/
|
|
562
|
+
supportsEagerToolInputStreaming?: boolean;
|
|
563
|
+
/** Whether the provider supports Anthropic long cache retention (`cache_control.ttl: "1h"`). Default: true. */
|
|
564
|
+
supportsLongCacheRetention?: boolean;
|
|
565
|
+
/**
|
|
566
|
+
* Whether to send the `x-session-affinity` header from `options.sessionId`
|
|
567
|
+
* when caching is enabled. Required for providers like Fireworks that use
|
|
568
|
+
* session affinity for prompt cache routing (requests to the same replica
|
|
569
|
+
* maximize cache hits).
|
|
570
|
+
* Default: false.
|
|
571
|
+
*/
|
|
572
|
+
sendSessionAffinityHeaders?: boolean;
|
|
573
|
+
/**
|
|
574
|
+
* Whether the provider supports Anthropic-style `cache_control` markers on
|
|
575
|
+
* tool definitions. When false, `cache_control` is omitted from tool params.
|
|
576
|
+
* Some Anthropic-compatible providers (e.g., Fireworks) do not support this
|
|
577
|
+
* field on tools and may reject or ignore it.
|
|
578
|
+
* Default: true.
|
|
579
|
+
*/
|
|
580
|
+
supportsCacheControlOnTools?: boolean;
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* OpenRouter provider routing preferences.
|
|
584
|
+
* Controls which upstream providers OpenRouter routes requests to.
|
|
585
|
+
* Sent as the `provider` field in the OpenRouter API request body.
|
|
586
|
+
* @see https://openrouter.ai/docs/guides/routing/provider-selection
|
|
587
|
+
*/
|
|
588
|
+
export interface OpenRouterRouting {
|
|
589
|
+
/** Whether to allow backup providers to serve requests. Default: true. */
|
|
590
|
+
allow_fallbacks?: boolean;
|
|
591
|
+
/** Whether to filter providers to only those that support all parameters in the request. Default: false. */
|
|
592
|
+
require_parameters?: boolean;
|
|
593
|
+
/** Data collection setting. "allow" (default): allow providers that may store/train on data. "deny": only use providers that don't collect user data. */
|
|
594
|
+
data_collection?: "deny" | "allow";
|
|
595
|
+
/** Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. */
|
|
596
|
+
zdr?: boolean;
|
|
597
|
+
/** Whether to restrict routing to only models that allow text distillation. */
|
|
598
|
+
enforce_distillable_text?: boolean;
|
|
599
|
+
/** An ordered list of provider names/slugs to try in sequence, falling back to the next if unavailable. */
|
|
600
|
+
order?: string[];
|
|
601
|
+
/** List of provider names/slugs to exclusively allow for this request. */
|
|
602
|
+
only?: string[];
|
|
603
|
+
/** List of provider names/slugs to skip for this request. */
|
|
604
|
+
ignore?: string[];
|
|
605
|
+
/** A list of quantization levels to filter providers by (e.g., ["fp16", "bf16", "fp8", "fp6", "int8", "int4", "fp4", "fp32"]). */
|
|
606
|
+
quantizations?: string[];
|
|
607
|
+
/** Sorting strategy. Can be a string (e.g., "price", "throughput", "latency") or an object with `by` and `partition`. */
|
|
608
|
+
sort?: string | {
|
|
609
|
+
/** The sorting metric: "price", "throughput", "latency". */
|
|
610
|
+
by?: string;
|
|
611
|
+
/** Partitioning strategy: "model" (default) or "none". */
|
|
612
|
+
partition?: string | null;
|
|
613
|
+
};
|
|
614
|
+
/** Maximum price per million tokens (USD). */
|
|
615
|
+
max_price?: {
|
|
616
|
+
/** Price per million prompt tokens. */
|
|
617
|
+
prompt?: number | string;
|
|
618
|
+
/** Price per million completion tokens. */
|
|
619
|
+
completion?: number | string;
|
|
620
|
+
/** Price per image. */
|
|
621
|
+
image?: number | string;
|
|
622
|
+
/** Price per audio unit. */
|
|
623
|
+
audio?: number | string;
|
|
624
|
+
/** Price per request. */
|
|
625
|
+
request?: number | string;
|
|
626
|
+
};
|
|
627
|
+
/** Preferred minimum throughput (tokens/second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. */
|
|
628
|
+
preferred_min_throughput?: number | {
|
|
629
|
+
/** Minimum tokens/second at the 50th percentile. */
|
|
630
|
+
p50?: number;
|
|
631
|
+
/** Minimum tokens/second at the 75th percentile. */
|
|
632
|
+
p75?: number;
|
|
633
|
+
/** Minimum tokens/second at the 90th percentile. */
|
|
634
|
+
p90?: number;
|
|
635
|
+
/** Minimum tokens/second at the 99th percentile. */
|
|
636
|
+
p99?: number;
|
|
637
|
+
};
|
|
638
|
+
/** Preferred maximum latency (seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. */
|
|
639
|
+
preferred_max_latency?: number | {
|
|
640
|
+
/** Maximum latency in seconds at the 50th percentile. */
|
|
641
|
+
p50?: number;
|
|
642
|
+
/** Maximum latency in seconds at the 75th percentile. */
|
|
643
|
+
p75?: number;
|
|
644
|
+
/** Maximum latency in seconds at the 90th percentile. */
|
|
645
|
+
p90?: number;
|
|
646
|
+
/** Maximum latency in seconds at the 99th percentile. */
|
|
647
|
+
p99?: number;
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Vercel AI Gateway routing preferences.
|
|
652
|
+
* Controls which upstream providers the gateway routes requests to.
|
|
653
|
+
* @see https://vercel.com/docs/ai-gateway/models-and-providers/provider-options
|
|
654
|
+
*/
|
|
655
|
+
export interface VercelGatewayRouting {
|
|
656
|
+
/** List of provider slugs to exclusively use for this request (e.g., ["bedrock", "anthropic"]). */
|
|
657
|
+
only?: string[];
|
|
658
|
+
/** List of provider slugs to try in order (e.g., ["anthropic", "openai"]). */
|
|
659
|
+
order?: string[];
|
|
660
|
+
}
|
|
661
|
+
export interface Model<TApi extends Api = Api> {
|
|
662
|
+
id: string;
|
|
663
|
+
name: string;
|
|
664
|
+
api: TApi;
|
|
665
|
+
provider: Provider;
|
|
666
|
+
baseUrl: string;
|
|
667
|
+
reasoning: boolean;
|
|
668
|
+
/**
|
|
669
|
+
* design/111 — this model's DEFAULT thinking level (per-model preset). The thinking-resolution chain is
|
|
670
|
+
* `spec.thinking ?? role.thinking ?? model.defaultThinking` (prepare-task) — a caller/role still overrides, but
|
|
671
|
+
* a model that should "think by default" (e.g. an Anthropic reasoning model defaulting to `medium`) declares it
|
|
672
|
+
* here instead of every task/role re-specifying. Absent ⇒ no model-level default (chain falls to `undefined` =
|
|
673
|
+
* thinking off unless a caller/role asks). It is the REQUESTED tier; the per-endpoint clamp (`resolveReasoning`/
|
|
674
|
+
* `reasoningEffortLevels`) still bounds it — a stock-OpenAI endpoint clamps `max`→`high`, while an
|
|
675
|
+
* `anthropic-messages` budget endpoint honors the full range up to `max` unclamped.
|
|
676
|
+
*/
|
|
677
|
+
defaultThinking?: ThinkingLevel;
|
|
678
|
+
/**
|
|
679
|
+
* Maps OpenClaw thinking levels to provider/model-specific values.
|
|
680
|
+
* Missing keys use provider defaults. null marks a level as unsupported.
|
|
681
|
+
*/
|
|
682
|
+
thinkingLevelMap?: ThinkingLevelMap;
|
|
683
|
+
input: ("text" | "image")[];
|
|
684
|
+
cost: {
|
|
685
|
+
input: number;
|
|
686
|
+
output: number;
|
|
687
|
+
cacheRead: number;
|
|
688
|
+
cacheWrite: number;
|
|
689
|
+
};
|
|
690
|
+
contextWindow: number;
|
|
691
|
+
/**
|
|
692
|
+
* Optional effective runtime cap used for compaction/session budgeting.
|
|
693
|
+
* Keeps provider/native contextWindow metadata intact while allowing a
|
|
694
|
+
* smaller practical window.
|
|
695
|
+
*/
|
|
696
|
+
contextTokens?: number;
|
|
697
|
+
/**
|
|
698
|
+
* design/123 D2 — structural token-estimate coefficient: how many CHARACTERS ≈ one token for this
|
|
699
|
+
* model's tokenizer. Used by every structural (non-usage-anchored) token estimate in the engine:
|
|
700
|
+
* the compaction trigger's anchor-less fallback, the request-layer defenses (clearStaleToolResults /
|
|
701
|
+
* trimToBudget), cut-point accounting, the prompt-overhead term, and the summarization input guard.
|
|
702
|
+
* API-agnostic model property (NOT a wire knob), hence top-level and not `compat`.
|
|
703
|
+
*
|
|
704
|
+
* Default **4** (byte-compatible with the historical chars/4 heuristic; CC 198's legacy-family
|
|
705
|
+
* value — claude-3.x / opus·sonnet-4-x / haiku-4-5). Newer families tokenize denser (CC 198 uses
|
|
706
|
+
* **3** for the sonnet-5/fable-5 class). CJK-heavy deployments should consider **2–3**: chars/4
|
|
707
|
+
* underestimates Chinese by 60–75%, which lets the defenses pass over-window requests.
|
|
708
|
+
*/
|
|
709
|
+
charsPerToken?: number;
|
|
710
|
+
maxTokens: number;
|
|
711
|
+
/** Provider-specific request/runtime parameters passed through to provider plugins. */
|
|
712
|
+
params?: Record<string, unknown>;
|
|
713
|
+
/**
|
|
714
|
+
* Extra request-BODY params merged into the provider call (design/40): official provider knobs core
|
|
715
|
+
* doesn't model as first-class — OpenAI `frequency_penalty`/`presence_penalty`/`top_p`/`seed`/`logit_bias`,
|
|
716
|
+
* Anthropic `top_k`/`top_p`/`stop_sequences`, etc. Keys core owns (messages/tools/temperature/…) are
|
|
717
|
+
* stripped (core wins). **Anchored on the Model and stable across turns** — reuse the SAME Model object
|
|
718
|
+
* (stable key-insertion order) for every turn sharing a cache namespace, or the serialized body bytes
|
|
719
|
+
* change and the prefix cache breaks (design/9/31). Not for per-turn variation.
|
|
720
|
+
*/
|
|
721
|
+
extraBody?: Record<string, unknown>;
|
|
722
|
+
/** Extra request HEADERS merged into the provider call. Cannot override auth / content-type / version. */
|
|
723
|
+
headers?: Record<string, string>;
|
|
724
|
+
/**
|
|
725
|
+
* design/119 S3 (CC 2.1.198 parity): model-declared system-prompt guidance sections, appended to
|
|
726
|
+
* the assembled system prompt. This is the declarative home for per-model behavioral patches (CC
|
|
727
|
+
* ships Fable-5 "mitigations" baked behind model-name checks; sema keeps the MECHANISM generic —
|
|
728
|
+
* any Model can carry guidance — and the CONTENT as preset data, zero model-name matching in core).
|
|
729
|
+
* Each entry is one section; joined with blank lines.
|
|
730
|
+
*/
|
|
731
|
+
promptGuidance?: string[];
|
|
732
|
+
/** Compatibility overrides for OpenAI-compatible APIs. If not set, auto-detected from baseUrl. */
|
|
733
|
+
compat?: TApi extends "openai-completions" ? OpenAICompletionsCompat : TApi extends "openai-responses" ? OpenAIResponsesCompat : TApi extends "anthropic-messages" ? AnthropicMessagesCompat : never;
|
|
734
|
+
/** Provider-documented media input limits used by attachment preprocessing. */
|
|
735
|
+
mediaInput?: {
|
|
736
|
+
image?: {
|
|
737
|
+
maxBytes?: number;
|
|
738
|
+
maxPixels?: number;
|
|
739
|
+
maxSidePx?: number;
|
|
740
|
+
preferredSidePx?: number;
|
|
741
|
+
tokenMode?: "tile" | "detail" | "provider";
|
|
742
|
+
};
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
export interface ImagesModel<TApi extends ImagesApi = ImagesApi> extends Omit<Model, "api" | "provider" | "reasoning" | "contextWindow" | "maxTokens" | "compat"> {
|
|
746
|
+
api: TApi;
|
|
747
|
+
provider: ImagesProvider;
|
|
748
|
+
output: ("text" | "image")[];
|
|
749
|
+
}
|
|
750
|
+
export type StreamFn = (model: Model, context: Context, options?: SimpleStreamOptions) => AssistantMessageEventStreamLike | Promise<AssistantMessageEventStreamLike>;
|
|
751
|
+
export type CompleteSimpleFn = (model: Model, context: Pick<Context, "systemPrompt" | "messages">, options?: SimpleStreamOptions) => Promise<AssistantMessage>;
|
|
752
|
+
export type ValidateToolArgumentsFn = (tool: Tool, toolCall: ToolCall) => unknown;
|
|
753
|
+
//# sourceMappingURL=types.d.ts.map
|