@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,301 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* design/98 §2.3 (S8b) — the reusable CONFORMANCE CONTRACT a HARD {@link WorkflowScriptRunner}
|
|
3
|
+
* (`safeForUntrustedScripts:true`) MUST pass. Core ships the contract (zero deps beyond `node:assert`); a
|
|
4
|
+
* deployment's isolated-vm / separate-process runner imports it and runs it in its OWN test suite to prove
|
|
5
|
+
* its membrane does not leak. It runs a battery of sandbox-escape scripts against the runner and asserts each
|
|
6
|
+
* FAILS to reach a host capability (`process` / `require` / a host `Function`).
|
|
7
|
+
*
|
|
8
|
+
* The dev `vm` runner deliberately does NOT pass this (it is not a boundary) — see
|
|
9
|
+
* `test/workflow-vm-escape.test.ts`, which PROVES that and asserts `safeForUntrustedScripts === false`.
|
|
10
|
+
*/
|
|
11
|
+
import assert from "node:assert/strict";
|
|
12
|
+
const META = "export const meta = { name: 'conformance', description: 'sandbox escape probes' }\n";
|
|
13
|
+
/** Escape bodies — each tries to climb a prototype chain or reach a global to grab a host capability. A hard
|
|
14
|
+
* runner must make every one return null/undefined (or throw): the injected primitives/args are isolate-local,
|
|
15
|
+
* so their `.constructor.constructor` is the ISOLATE's `Function` (no host `process`/`require`). */
|
|
16
|
+
const ESCAPE_BODIES = [
|
|
17
|
+
// via the injected `agent` function's constructor chain
|
|
18
|
+
`return agent.constructor.constructor("return typeof process !== 'undefined' ? process : null")()`,
|
|
19
|
+
// via the injected `log` function
|
|
20
|
+
`return log.constructor.constructor("return typeof process !== 'undefined' ? process : null")()`,
|
|
21
|
+
// via the `budget` object's prototype
|
|
22
|
+
`return budget.constructor.constructor("return typeof process !== 'undefined' ? process : null")()`,
|
|
23
|
+
// via a fresh object literal's prototype (the classic vm escape vector)
|
|
24
|
+
`return ({}).constructor.constructor("return typeof process !== 'undefined' ? process : null")()`,
|
|
25
|
+
// via the ExternalCopy'd `args` prototype
|
|
26
|
+
`return args.constructor.constructor("return typeof require !== 'undefined' ? require : null")()`,
|
|
27
|
+
// via a returned task result's prototype
|
|
28
|
+
`const r = await agent({ objective: 'x' }); return (r ?? {}).constructor.constructor("return typeof require !== 'undefined' ? require : null")()`,
|
|
29
|
+
// direct global reach
|
|
30
|
+
`return (typeof process !== 'undefined' ? process : null)`,
|
|
31
|
+
`return (typeof require !== 'undefined' ? require : null)`,
|
|
32
|
+
`return (typeof globalThis !== 'undefined' && globalThis.process) ? globalThis.process : null`,
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* Error-path probes (service [211] red-team — a vector the result-path battery alone misses). The script
|
|
36
|
+
* triggers a HOST-side error from a bridged primitive, catches it INSIDE the isolate, and climbs THAT error's
|
|
37
|
+
* constructor chain. A hard runner MUST sterilize errors crossing INTO the isolate (re-wrap rejections as
|
|
38
|
+
* isolate-side values) — otherwise the script catches a host `Error` whose `.constructor.constructor` is the
|
|
39
|
+
* HOST `Function`, reaching `process`/`require` through the failure path instead of the return path. Run
|
|
40
|
+
* against {@link throwingPrimitives}; the returned climb result is checked by {@link looksLikeHostCapability}.
|
|
41
|
+
*/
|
|
42
|
+
const ERROR_PATH_BODIES = [
|
|
43
|
+
`try { await agent({ objective: 'x' }); return null } catch (e) { return e.constructor.constructor("return typeof process !== 'undefined' ? process : null")() }`,
|
|
44
|
+
`try { await parallel([]); return null } catch (e) { return e.constructor.constructor("return typeof require !== 'undefined' ? require : null")() }`,
|
|
45
|
+
`try { await agent({}); return null } catch (e) { return (e && e.constructor && e.constructor.constructor) ? e.constructor.constructor("return (typeof globalThis !== 'undefined' && globalThis.process) ? globalThis.process : null")() : null }`,
|
|
46
|
+
];
|
|
47
|
+
/**
|
|
48
|
+
* Prototype-pollution probes (service [211] red-team — the marshalling-bridge vector). The script returns a
|
|
49
|
+
* value carrying an INJECTED own `__proto__` / `constructor` / `prototype` key (via `JSON.parse` of a crafted
|
|
50
|
+
* literal or `Reflect.defineProperty`). A hard runner MUST scrub these at the marshalling boundary — else the
|
|
51
|
+
* key survives into the host result graph and a downstream deep-merge sink writes through it to the host
|
|
52
|
+
* `Object.prototype`, polluting every tenant. We assert the MARSHALLED result graph carries no such own key
|
|
53
|
+
* (a plain JSON value never has `__proto__`/`constructor`/`prototype` as an OWN property — only inherited).
|
|
54
|
+
*/
|
|
55
|
+
const POLLUTION_BODIES = [
|
|
56
|
+
`return JSON.parse('{"__proto__":{"polluted":1}}')`,
|
|
57
|
+
`const o = {}; Reflect.defineProperty(o, "__proto__", { value: { polluted: 1 }, enumerable: true, configurable: true }); return o`,
|
|
58
|
+
`return { nested: JSON.parse('{"__proto__":{"polluted":1}}') }`,
|
|
59
|
+
`return { constructor: { prototype: { polluted: 1 } } }`,
|
|
60
|
+
`return [JSON.parse('{"__proto__":{"polluted":1}}')]`,
|
|
61
|
+
];
|
|
62
|
+
/**
|
|
63
|
+
* Signal-path probes (CORE-1~9 audit MAJOR). The production `run_workflow` tool passes a HOST `AbortSignal` to
|
|
64
|
+
* `run({ signal })`. That signal is for ABORT CONTROL — the runner must NOT hand the RAW host object to the
|
|
65
|
+
* script (a host object's `.constructor.constructor` is the HOST `Function`, a classic climb to `process`). If a
|
|
66
|
+
* runner exposes abort-awareness at all it must be an isolate-side wrapper. These probes reach for the signal
|
|
67
|
+
* under either common name (`signal` global / `input.signal`); if the runner exposes neither, the reference is
|
|
68
|
+
* undefined and the probe harmlessly returns null (PASS) — only a leaked HOST signal fails.
|
|
69
|
+
*/
|
|
70
|
+
const SIGNAL_BODIES = [
|
|
71
|
+
`return (typeof signal !== 'undefined' && signal) ? signal.constructor.constructor("return typeof process !== 'undefined' ? process : null")() : null`,
|
|
72
|
+
`return (typeof input !== 'undefined' && input && input.signal) ? input.signal.constructor.constructor("return typeof process !== 'undefined' ? process : null")() : null`,
|
|
73
|
+
`try { return (typeof signal !== 'undefined' && signal) ? (signal.addEventListener ? signal.addEventListener.constructor("return typeof process !== 'undefined' ? process : null")() : null) : null } catch (e) { return null }`,
|
|
74
|
+
];
|
|
75
|
+
function benignPrimitives() {
|
|
76
|
+
return {
|
|
77
|
+
agent: async () => ({ status: "completed", result: "ok" }),
|
|
78
|
+
parallel: async (thunks) => Promise.all(thunks.map((t) => t())),
|
|
79
|
+
pipeline: async (items) => items,
|
|
80
|
+
phase: async (_title, body) => (body === undefined ? undefined : body()), // [406] bare marker form
|
|
81
|
+
log: () => { },
|
|
82
|
+
budget: { total: null, spent: () => 0, remaining: () => Infinity },
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** Primitives whose bridged calls reject with a HOST `Error` — for the {@link ERROR_PATH_BODIES} probes. A
|
|
86
|
+
* hard runner must sterilize this rejection before the script's `catch` sees it. */
|
|
87
|
+
function throwingPrimitives() {
|
|
88
|
+
const boom = () => {
|
|
89
|
+
throw new Error("host-side primitive failure");
|
|
90
|
+
};
|
|
91
|
+
return {
|
|
92
|
+
agent: async () => boom(),
|
|
93
|
+
parallel: async () => boom(),
|
|
94
|
+
pipeline: async () => boom(),
|
|
95
|
+
phase: async () => boom(),
|
|
96
|
+
log: () => { },
|
|
97
|
+
budget: { total: null, spent: () => 0, remaining: () => Infinity },
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const DANGEROUS_OWN_KEYS = new Set(["__proto__", "constructor", "prototype"]);
|
|
101
|
+
/** Walk a marshalled result graph: does any node carry an INJECTED own `__proto__`/`constructor`/`prototype`
|
|
102
|
+
* key whose value is an object? Plain JSON values never do — its presence means the runner's marshalling did
|
|
103
|
+
* not scrub the pollution payload. Uses own-descriptor values (never the inherited slot) and guards cycles. */
|
|
104
|
+
function graphHasInjectedProtoKey(v, seen = new Set()) {
|
|
105
|
+
if (v == null || typeof v !== "object")
|
|
106
|
+
return false;
|
|
107
|
+
if (seen.has(v))
|
|
108
|
+
return false;
|
|
109
|
+
seen.add(v);
|
|
110
|
+
for (const k of Object.getOwnPropertyNames(v)) {
|
|
111
|
+
if (DANGEROUS_OWN_KEYS.has(k)) {
|
|
112
|
+
const val = Object.getOwnPropertyDescriptor(v, k)?.value;
|
|
113
|
+
if (val != null && typeof val === "object")
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
for (const k of Object.getOwnPropertyNames(v)) {
|
|
118
|
+
if (DANGEROUS_OWN_KEYS.has(k))
|
|
119
|
+
continue;
|
|
120
|
+
if (graphHasInjectedProtoKey(v[k], seen))
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
/** Does `v` look like a host capability the script should never reach? A host `Function` (`require`), or an
|
|
126
|
+
* object exposing `process`-like keys, means the membrane leaked. */
|
|
127
|
+
function looksLikeHostCapability(v) {
|
|
128
|
+
if (v == null)
|
|
129
|
+
return false;
|
|
130
|
+
if (typeof v === "function")
|
|
131
|
+
return true; // reached `require` (a function) — a host capability
|
|
132
|
+
if (typeof v === "object") {
|
|
133
|
+
const o = v;
|
|
134
|
+
return "pid" in o || "env" in o || "version" in o || "mainModule" in o || "binding" in o;
|
|
135
|
+
}
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Assert a HARD runner passes the sandbox-escape battery. Throws an `AssertionError` on the first escape that
|
|
140
|
+
* reaches a host capability. A probe that THROWS counts as blocked (PASS).
|
|
141
|
+
*/
|
|
142
|
+
/**
|
|
143
|
+
* 黑板 [427] — the PRIMITIVES-WIRING battery. The [420]①/[423] production incident was a hard runner whose
|
|
144
|
+
* injection table wired only `agent` (+ return): `phase`/`log` were silently absent in the isolate, so whole
|
|
145
|
+
* runs recorded `phases: []` with no error anywhere. Sandbox tightness alone doesn't catch that — a runner can
|
|
146
|
+
* be perfectly escape-proof AND miss half the API. This battery proves EVERY {@link WorkflowPrimitives} member
|
|
147
|
+
* is present in-isolate, callable, and actually bridged back to the HOST primitives (recorded on the host
|
|
148
|
+
* side, not just observed in-script). Run it in the same suite as the escape battery.
|
|
149
|
+
*/
|
|
150
|
+
export async function assertWorkflowPrimitivesWiring(runner) {
|
|
151
|
+
assert.equal(runner.safeForUntrustedScripts, true, "wiring conformance targets a HARD runner (safeForUntrustedScripts must be true)");
|
|
152
|
+
const hostSeen = { phaseCalls: [], scopedBodyRan: false, logs: [] };
|
|
153
|
+
const primitives = {
|
|
154
|
+
agent: async () => ({ status: "completed", result: "ok" }),
|
|
155
|
+
parallel: async (thunks) => Promise.all(thunks.map((t) => t())),
|
|
156
|
+
pipeline: async (items, ...stages) => {
|
|
157
|
+
let out = items;
|
|
158
|
+
for (const st of stages) {
|
|
159
|
+
out = await Promise.all(out.map((x, i) => st(x, x, i)));
|
|
160
|
+
}
|
|
161
|
+
return out;
|
|
162
|
+
},
|
|
163
|
+
phase: async (title, body) => {
|
|
164
|
+
hostSeen.phaseCalls.push({ title, hasBody: body !== undefined });
|
|
165
|
+
if (body === undefined)
|
|
166
|
+
return undefined;
|
|
167
|
+
const out = await body();
|
|
168
|
+
if (title === "wiring-scoped")
|
|
169
|
+
hostSeen.scopedBodyRan = true;
|
|
170
|
+
return out;
|
|
171
|
+
},
|
|
172
|
+
log: (message) => void hostSeen.logs.push(message),
|
|
173
|
+
budget: { total: 1000, spent: () => 25, remaining: () => 975 },
|
|
174
|
+
};
|
|
175
|
+
const scriptSource = META +
|
|
176
|
+
[
|
|
177
|
+
`const report = { typeofs: { agent: typeof agent, parallel: typeof parallel, pipeline: typeof pipeline, phase: typeof phase, log: typeof log, budgetRemaining: budget && typeof budget.remaining }, calls: {} }`,
|
|
178
|
+
`log('wiring-probe-log')`,
|
|
179
|
+
`report.calls.bareUndefined = (await phase('wiring-marker')) === undefined`,
|
|
180
|
+
`let scopedRan = false`,
|
|
181
|
+
`await phase('wiring-scoped', async () => { scopedRan = true })`,
|
|
182
|
+
`report.calls.scopedRan = scopedRan`,
|
|
183
|
+
`report.calls.budgetRemaining = budget.remaining()`,
|
|
184
|
+
`const par = await parallel([async () => 1, async () => 2])`,
|
|
185
|
+
`report.calls.parallelOk = Array.isArray(par) && par.length === 2`,
|
|
186
|
+
`const pipe = await pipeline([1, 2], async (x) => x)`,
|
|
187
|
+
`report.calls.pipelineOk = Array.isArray(pipe) && pipe.length === 2`,
|
|
188
|
+
`const a = await agent({ objective: 'wiring' })`,
|
|
189
|
+
`report.calls.agentOk = a && a.status === 'completed'`,
|
|
190
|
+
`return report`,
|
|
191
|
+
].join("\n");
|
|
192
|
+
const out = await runner.run({ scriptSource, primitives, scriptArgs: {} });
|
|
193
|
+
const report = out.result;
|
|
194
|
+
assert.ok(report && report.typeofs && report.calls, "wiring probe returned no report — script body did not run");
|
|
195
|
+
// In-isolate presence: every primitive must be a function (budget.remaining included).
|
|
196
|
+
for (const k of ["agent", "parallel", "pipeline", "phase", "log", "budgetRemaining"]) {
|
|
197
|
+
assert.equal(report.typeofs[k], "function", `primitive "${k}" is not a function INSIDE the isolate — injection table incomplete (the [423] failure mode)`);
|
|
198
|
+
}
|
|
199
|
+
// In-isolate behaviour observed by the script.
|
|
200
|
+
assert.equal(report.calls.bareUndefined, true, "bare phase(title) must return undefined in-isolate");
|
|
201
|
+
assert.equal(report.calls.scopedRan, true, "scoped phase body did not run in-isolate");
|
|
202
|
+
assert.equal(report.calls.budgetRemaining, 975, "budget.remaining() is not bridged to the live host accessor");
|
|
203
|
+
assert.equal(report.calls.parallelOk, true, "parallel() thunks not executed");
|
|
204
|
+
assert.equal(report.calls.pipelineOk, true, "pipeline() stages not executed");
|
|
205
|
+
assert.equal(report.calls.agentOk, true, "agent() result not bridged back");
|
|
206
|
+
// HOST-side receipts: the bridge must actually reach the host primitives (a stubbed isolate-local fake
|
|
207
|
+
// would pass the in-isolate checks — these prove the crossing).
|
|
208
|
+
assert.deepEqual(hostSeen.phaseCalls.map((c) => `${c.title}:${c.hasBody ? "scoped" : "bare"}`), ["wiring-marker:bare", "wiring-scoped:scoped"], "phase() calls did not reach the HOST primitive (bridge severed — phases would record [])");
|
|
209
|
+
assert.equal(hostSeen.scopedBodyRan, true, "the scoped body's completion did not round-trip through the host phase()");
|
|
210
|
+
assert.deepEqual(hostSeen.logs, ["wiring-probe-log"], "log() did not reach the HOST primitive");
|
|
211
|
+
}
|
|
212
|
+
export async function assertWorkflowSandboxConformance(runner) {
|
|
213
|
+
assert.equal(runner.safeForUntrustedScripts, true, "conformance is only meaningful for a HARD runner (safeForUntrustedScripts must be true)");
|
|
214
|
+
for (const escBody of ESCAPE_BODIES) {
|
|
215
|
+
const scriptSource = META + escBody;
|
|
216
|
+
let result;
|
|
217
|
+
try {
|
|
218
|
+
const out = await runner.run({ scriptSource, primitives: benignPrimitives(), scriptArgs: { probe: true } });
|
|
219
|
+
result = out.result;
|
|
220
|
+
}
|
|
221
|
+
catch {
|
|
222
|
+
continue; // a throw = the escape was blocked → PASS for this probe
|
|
223
|
+
}
|
|
224
|
+
assert.equal(looksLikeHostCapability(result), false, `sandbox escape REACHED a host capability via: ${escBody}`);
|
|
225
|
+
}
|
|
226
|
+
// Error-path probes (service [211]): a host-side primitive rejection, caught inside the isolate, must not
|
|
227
|
+
// expose a host capability through the caught error's constructor chain.
|
|
228
|
+
for (const errBody of ERROR_PATH_BODIES) {
|
|
229
|
+
const scriptSource = META + errBody;
|
|
230
|
+
let result;
|
|
231
|
+
try {
|
|
232
|
+
const out = await runner.run({ scriptSource, primitives: throwingPrimitives(), scriptArgs: { probe: true } });
|
|
233
|
+
result = out.result;
|
|
234
|
+
}
|
|
235
|
+
catch {
|
|
236
|
+
continue; // the runner re-threw without surfacing a climbable host error → PASS for this probe
|
|
237
|
+
}
|
|
238
|
+
assert.equal(looksLikeHostCapability(result), false, `error-path: a host-side primitive error leaked a host capability via: ${errBody}`);
|
|
239
|
+
}
|
|
240
|
+
// Prototype-pollution probes (service [211]): an injected __proto__/constructor/prototype own key must be
|
|
241
|
+
// scrubbed at the marshalling boundary, so a downstream host deep-merge can't pollute Object.prototype.
|
|
242
|
+
for (const polBody of POLLUTION_BODIES) {
|
|
243
|
+
const scriptSource = META + polBody;
|
|
244
|
+
let result;
|
|
245
|
+
try {
|
|
246
|
+
const out = await runner.run({ scriptSource, primitives: benignPrimitives(), scriptArgs: { probe: true } });
|
|
247
|
+
result = out.result;
|
|
248
|
+
}
|
|
249
|
+
catch {
|
|
250
|
+
continue; // a throw = the pollution attempt was blocked → PASS for this probe
|
|
251
|
+
}
|
|
252
|
+
assert.equal(graphHasInjectedProtoKey(result), false, `prototype pollution: the marshalled result carries an injected __proto__/constructor/prototype own key via: ${polBody}`);
|
|
253
|
+
}
|
|
254
|
+
// Signal-path probes (CORE-1~9 audit MAJOR): supply a HOST AbortSignal the way the production tool does, and
|
|
255
|
+
// assert the script cannot climb it to a host capability. A runner that exposes the raw host signal fails here.
|
|
256
|
+
const hostSignal = new AbortController().signal;
|
|
257
|
+
for (const sigBody of SIGNAL_BODIES) {
|
|
258
|
+
const scriptSource = META + sigBody;
|
|
259
|
+
let result;
|
|
260
|
+
try {
|
|
261
|
+
const out = await runner.run({ scriptSource, primitives: benignPrimitives(), scriptArgs: { probe: true }, signal: hostSignal });
|
|
262
|
+
result = out.result;
|
|
263
|
+
}
|
|
264
|
+
catch {
|
|
265
|
+
continue; // a throw = the climb was blocked (or signal not exposed) → PASS for this probe
|
|
266
|
+
}
|
|
267
|
+
assert.equal(looksLikeHostCapability(result), false, `signal-path: the host AbortSignal leaked a host capability via: ${sigBody}`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
/** B2/F3: each body must throw in a conformant runner (or return the literal "threw" from its own catch). */
|
|
271
|
+
const DETERMINISM_FORBIDDEN_BODIES = [
|
|
272
|
+
`try { return Date.now() } catch { return "threw" }`,
|
|
273
|
+
`try { return Math.random() } catch { return "threw" }`,
|
|
274
|
+
`try { return new Date().getTime() } catch { return "threw" }`,
|
|
275
|
+
`try { return new Date(0).constructor.now() } catch { return "threw" }`, // the .constructor backdoor must be closed
|
|
276
|
+
];
|
|
277
|
+
/**
|
|
278
|
+
* PARITY-SPOT-WORKFLOW B2/F3 (CC `S0m` parity) — assert a runner ENFORCES determinism: Date.now() /
|
|
279
|
+
* Math.random() / argless new Date() throw (a clock/randomness read silently busts the resume prefix cache),
|
|
280
|
+
* while DATED construction (`new Date(0)`) stays available. SEPARATE from the sandbox/wiring batteries — those
|
|
281
|
+
* accept a minimal stub runner (they test the assertion's own leak/bridge logic); determinism requires a
|
|
282
|
+
* runner that actually executes the body against shimmed intrinsics (the dev vm runner + any hard runner).
|
|
283
|
+
*/
|
|
284
|
+
export async function assertWorkflowDeterminism(runner) {
|
|
285
|
+
for (const detBody of DETERMINISM_FORBIDDEN_BODIES) {
|
|
286
|
+
const scriptSource = META + detBody;
|
|
287
|
+
let threw = false;
|
|
288
|
+
let result;
|
|
289
|
+
try {
|
|
290
|
+
const out = await runner.run({ scriptSource, primitives: benignPrimitives(), scriptArgs: { probe: true } });
|
|
291
|
+
result = out.result;
|
|
292
|
+
}
|
|
293
|
+
catch {
|
|
294
|
+
threw = true; // the forbidden read threw → PASS
|
|
295
|
+
}
|
|
296
|
+
assert.equal(threw || result === "threw", true, `determinism: ${detBody.trim().split("\n")[0]} did NOT throw — a clock/randomness read would silently bust resume`);
|
|
297
|
+
}
|
|
298
|
+
const out = await runner.run({ scriptSource: META + `return new Date(0).getTime()`, primitives: benignPrimitives(), scriptArgs: { probe: true } });
|
|
299
|
+
assert.equal(out.result, 0, "determinism: DATED construction new Date(0) must stay available");
|
|
300
|
+
}
|
|
301
|
+
//# sourceMappingURL=workflow-sandbox-conformance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-sandbox-conformance.js","sourceRoot":"","sources":["../../src/orchestration/workflow-sandbox-conformance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAGxC,MAAM,IAAI,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E,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;YAC5G,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QACtB,CAAC;QAAC,MAAM,CAAC;YACP,KAAK,GAAG,IAAI,CAAC,CAAC,kCAAkC;QAClD,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,MAAM,KAAK,OAAO,EAAE,IAAI,EAAE,gBAAgB,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,qEAAqE,CAAC,CAAC;IACtK,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,EAAE,YAAY,EAAE,IAAI,GAAG,8BAA8B,EAAE,UAAU,EAAE,gBAAgB,EAAE,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACnJ,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,iEAAiE,CAAC,CAAC;AACjG,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { RunnerDeps, TaskSpec } from "../core/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* design/98 §1.2 / §C — is LLM self-orchestration ACTIVE for this task? `true` ONLY when the task opted in
|
|
4
|
+
* AND the deployment provides BOTH a hard sandbox (`workflowScriptRunner.safeForUntrustedScripts`) AND a
|
|
5
|
+
* governance baseline (`workflowGovernanceBaseline`). This is the SINGLE gate that drives BOTH the
|
|
6
|
+
* orchestration-prompt injection (S8a) and the `run_workflow` tool mount (S8c) — kept in lockstep so the
|
|
7
|
+
* prompt never claims a capability the task lacks (§6.3). FAIL-CLOSED: any missing piece ⇒ off.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isSelfOrchestrationActive(spec: TaskSpec, deps: RunnerDeps): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* design/98 §C — the DEPLOYMENT-level capability: does this deployment SUPPORT self-orchestration / workflows
|
|
12
|
+
* AT ALL? `true` ⟺ it provides BOTH a hard sandbox (`workflowScriptRunner.safeForUntrustedScripts`) AND a
|
|
13
|
+
* governance baseline (`workflowGovernanceBaseline`). This is the deps half of {@link isSelfOrchestrationActive}
|
|
14
|
+
* with NO per-task `selfOrchestration` opt-in — the canonical predicate a control plane projects onto a
|
|
15
|
+
* capability surface (e.g. service `GET /v1/capabilities`.`workflows`) so a shell can HONESTLY gate `/workflows`
|
|
16
|
+
* + ultracode affordances: dark when `false` (the deployment can never run a workflow), available when `true`.
|
|
17
|
+
*
|
|
18
|
+
* SINGLE SOURCE so the surfaced capability can never drift from the gate that actually mounts `run_workflow`
|
|
19
|
+
* (a shell that shows `/workflows` as available while the engine fail-closes the tool = the exact mismatch
|
|
20
|
+
* design/98 §6.3 forbids). Per-principal/tier gating does NOT exist today — this is deployment-wide.
|
|
21
|
+
*/
|
|
22
|
+
export declare function workflowsCapability(deps: RunnerDeps): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* design/98 §1.2 — the task OPTED IN (`selfOrchestration:true`) but the deployment did not meet the bar (a
|
|
25
|
+
* hard sandbox + a governance baseline), so self-orchestration is FAIL-CLOSED. Returns a human-readable
|
|
26
|
+
* reason for an operator warning, or `null` when not in this state (off, or fully active). The runner emits
|
|
27
|
+
* ONE operator-visible warning so a misconfigured opt-in is never silent.
|
|
28
|
+
*/
|
|
29
|
+
export declare function selfOrchestrationFailClosedReason(spec: TaskSpec, deps: RunnerDeps): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* design/98 §D.3/§E.1 — the `WorkflowScriptRunner` SEAM for running an LLM-AUTHORED workflow script
|
|
32
|
+
* (S8 self-orchestration). A deployment provides the runner; **core does NOT ship a hard sandbox** (the
|
|
33
|
+
* isolated-vm / separate-process implementation is a deployment concern or a separate
|
|
34
|
+
* `@ai-only/workflow-sandbox` package). Core defines this contract + a TRUSTED-DEV vm runner
|
|
35
|
+
* ({@link import("./dev-vm-script-runner.js").devWorkflowScriptRunner}, S8b) that is explicitly NOT a
|
|
36
|
+
* security boundary, plus a conformance contract a hard runner must pass.
|
|
37
|
+
*
|
|
38
|
+
* 🔴 **Membrane = STRUCTURAL constraint, not a behavioral promise (codex v3/v4 BLOCKER).** The seam's
|
|
39
|
+
* `run()` accepts ONLY {@link WorkflowPrimitives} — a flat, sterile record of bound callbacks + a budget
|
|
40
|
+
* DATA snapshot. It does NOT accept a `WorkflowRunContext` (a host object whose prototype chain the script
|
|
41
|
+
* could walk via `ctx.constructor.constructor("return process")()` to escape). The engine extracts the bound
|
|
42
|
+
* functions FROM the context and constructs the primitives; the host context object structurally never
|
|
43
|
+
* enters the runner — there is no prototype chain into the host reachable from the script. A hard runner
|
|
44
|
+
* bridges each primitive as an isolated-vm `Reference`/`Callback` and copies `scriptArgs` via `ExternalCopy`.
|
|
45
|
+
*/
|
|
46
|
+
/** The `export const meta = {...}` a workflow script declares (a PURE literal — parsed by the meta-AST,
|
|
47
|
+
* never `eval`'d; design/98 §2.4). Only `name`/`description` are required; the rest is observability. */
|
|
48
|
+
export interface WorkflowMeta {
|
|
49
|
+
name: string;
|
|
50
|
+
description: string;
|
|
51
|
+
/** PARITY-SPOT-WORKFLOW B7 (CC card pretty.js:448042): `model` on a phase entry documents that phase's
|
|
52
|
+
* model override — parsed + stored + displayed on the pre-registered run phase (no behavior yet). */
|
|
53
|
+
phases?: Array<{
|
|
54
|
+
title: string;
|
|
55
|
+
detail?: string;
|
|
56
|
+
model?: string;
|
|
57
|
+
}>;
|
|
58
|
+
whenToUse?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The FLAT, STERILE primitives a workflow script may call — bound functions + a budget DATA snapshot, and
|
|
62
|
+
* NOTHING else from the host (design/98 §2.1). NO `ctx` object, NO host prototype chain. The HARD runner
|
|
63
|
+
* bridges each function as an isolated-vm `Reference`/`Callback` (the script `await`s them, round-tripping
|
|
64
|
+
* back to the main isolate where the real {@link import("./workflow.js").WorkflowRunContext} executes them).
|
|
65
|
+
*
|
|
66
|
+
* The `spec`/`opts`/stage/thunk shapes are `unknown` at this boundary on purpose: an LLM-authored `spec` is
|
|
67
|
+
* UNTRUSTED input that the engine's `agent` primitive validates + governs (whitelist construction +
|
|
68
|
+
* `tightenTaskSpec`, design/98 §2.5) BEFORE it ever reaches `runner.runTask`. The seam must not promise a
|
|
69
|
+
* trusted `TaskSpec` here.
|
|
70
|
+
*/
|
|
71
|
+
export interface WorkflowPrimitives {
|
|
72
|
+
/** Spawn one governed sub-agent. `spec` is an UNTRUSTED `WorkflowAgentSpec` (whitelist-constructed by the
|
|
73
|
+
* engine, design/98 §2.5); `opts` carries `label`/`phase`/`schema`. Resolves to the task result. */
|
|
74
|
+
agent(spec: unknown, opts?: unknown): Promise<unknown>;
|
|
75
|
+
/** Run thunks concurrently (BARRIER); a thrown thunk resolves to `null`. */
|
|
76
|
+
parallel(thunks: unknown[]): Promise<unknown[]>;
|
|
77
|
+
/** Run each item through all stages independently (no barrier between stages). */
|
|
78
|
+
pipeline(items: unknown[], ...stages: unknown[]): Promise<unknown[]>;
|
|
79
|
+
/** Group work under a named phase (observability). */
|
|
80
|
+
phase(title: string, body: unknown): Promise<unknown>;
|
|
81
|
+
/** Emit a narrator log line. */
|
|
82
|
+
log(message: string): void;
|
|
83
|
+
/** LIVE budget accessors, mirroring {@link import("./workflow.js").WorkflowBudget} (NOT a one-shot data
|
|
84
|
+
* snapshot — a static snapshot would break the `while (budget.remaining() > N)` budget-scaled-depth loop
|
|
85
|
+
* the orchestration guidance promotes). `total` is a stable number/null; `spent()`/`remaining()` are bound
|
|
86
|
+
* functions the hard runner bridges (an isolated-vm `Reference`/`Callback`, like the other primitives) so
|
|
87
|
+
* each call re-reads the current spend. */
|
|
88
|
+
budget: {
|
|
89
|
+
total: number | null;
|
|
90
|
+
spent(): number;
|
|
91
|
+
remaining(): number;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The seam a deployment implements to execute an LLM-authored workflow script. The engine calls `run()` with
|
|
96
|
+
* the sterile {@link WorkflowPrimitives} + the script source + (copied) args; the runner compiles/executes
|
|
97
|
+
* the script in its isolation domain and returns the script's value + parsed {@link WorkflowMeta}.
|
|
98
|
+
*/
|
|
99
|
+
export interface WorkflowScriptRunner {
|
|
100
|
+
/**
|
|
101
|
+
* Whether this runner can SAFELY execute UNTRUSTED (LLM-authored) scripts. `true` = a hard sandbox
|
|
102
|
+
* (isolated-vm / separate process + container/seccomp). `false` = trusted-DEV authors only (the Node `vm`
|
|
103
|
+
* runner — NOT a security boundary, see {@link import("./dev-vm-script-runner.js").devWorkflowScriptRunner}).
|
|
104
|
+
*
|
|
105
|
+
* 🔴 The S8 gate (design/98 §C / §1.2) mounts the `run_workflow` tool + injects the orchestration prompt
|
|
106
|
+
* ONLY when this is `true`. `selfOrchestration:true` with no hard runner ⇒ FAIL-CLOSED (tool not mounted,
|
|
107
|
+
* prompt not injected, operator warning). Core NEVER runs an LLM script in the dev `vm`.
|
|
108
|
+
*/
|
|
109
|
+
readonly safeForUntrustedScripts: boolean;
|
|
110
|
+
run(input: {
|
|
111
|
+
scriptSource: string;
|
|
112
|
+
primitives: WorkflowPrimitives;
|
|
113
|
+
scriptArgs: unknown;
|
|
114
|
+
/**
|
|
115
|
+
* A HOST `AbortSignal` for ABORT CONTROL (the workflow aborting cancels the script run). 🔐 The runner MUST
|
|
116
|
+
* NOT expose this raw host object to the untrusted script — a host object's `.constructor.constructor` climbs
|
|
117
|
+
* to the host `Function`/`process`. Use it to abort isolate execution; if you surface abort-awareness to the
|
|
118
|
+
* script at all, wrap it isolate-side. {@link assertWorkflowSandboxConformance} supplies a host signal and
|
|
119
|
+
* probes for this leak (CORE-1~9 audit MAJOR).
|
|
120
|
+
*/
|
|
121
|
+
signal?: AbortSignal;
|
|
122
|
+
}): Promise<{
|
|
123
|
+
result: unknown;
|
|
124
|
+
meta: WorkflowMeta;
|
|
125
|
+
}>;
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=workflow-script-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-script-runner.d.ts","sourceRoot":"","sources":["../../src/orchestration/workflow-script-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAEnF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAK7D;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAcjG;AAED;;;;;;;;;;;;;;;GAeG;AAEH;0GAC0G;AAC1G,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB;0GACsG;IACtG,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAkB;IACjC;yGACqG;IACrG,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAChD,kFAAkF;IAClF,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACrE,sDAAsD;IACtD,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtD,gCAAgC;IAChC,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;;;gDAI4C;IAC5C,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,IAAI,MAAM,CAAC;QAAC,SAAS,IAAI,MAAM,CAAA;KAAE,CAAC;CACxE;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;OAQG;IACH,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C,GAAG,CAAC,KAAK,EAAE;QACT,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,kBAAkB,CAAC;QAC/B,UAAU,EAAE,OAAO,CAAC;QACpB;;;;;;WAMG;QACH,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,YAAY,CAAA;KAAE,CAAC,CAAC;CACtD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* design/98 §1.2 / §C — is LLM self-orchestration ACTIVE for this task? `true` ONLY when the task opted in
|
|
3
|
+
* AND the deployment provides BOTH a hard sandbox (`workflowScriptRunner.safeForUntrustedScripts`) AND a
|
|
4
|
+
* governance baseline (`workflowGovernanceBaseline`). This is the SINGLE gate that drives BOTH the
|
|
5
|
+
* orchestration-prompt injection (S8a) and the `run_workflow` tool mount (S8c) — kept in lockstep so the
|
|
6
|
+
* prompt never claims a capability the task lacks (§6.3). FAIL-CLOSED: any missing piece ⇒ off.
|
|
7
|
+
*/
|
|
8
|
+
export function isSelfOrchestrationActive(spec, deps) {
|
|
9
|
+
return spec.selfOrchestration === true && workflowsCapability(deps);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* design/98 §C — the DEPLOYMENT-level capability: does this deployment SUPPORT self-orchestration / workflows
|
|
13
|
+
* AT ALL? `true` ⟺ it provides BOTH a hard sandbox (`workflowScriptRunner.safeForUntrustedScripts`) AND a
|
|
14
|
+
* governance baseline (`workflowGovernanceBaseline`). This is the deps half of {@link isSelfOrchestrationActive}
|
|
15
|
+
* with NO per-task `selfOrchestration` opt-in — the canonical predicate a control plane projects onto a
|
|
16
|
+
* capability surface (e.g. service `GET /v1/capabilities`.`workflows`) so a shell can HONESTLY gate `/workflows`
|
|
17
|
+
* + ultracode affordances: dark when `false` (the deployment can never run a workflow), available when `true`.
|
|
18
|
+
*
|
|
19
|
+
* SINGLE SOURCE so the surfaced capability can never drift from the gate that actually mounts `run_workflow`
|
|
20
|
+
* (a shell that shows `/workflows` as available while the engine fail-closes the tool = the exact mismatch
|
|
21
|
+
* design/98 §6.3 forbids). Per-principal/tier gating does NOT exist today — this is deployment-wide.
|
|
22
|
+
*/
|
|
23
|
+
export function workflowsCapability(deps) {
|
|
24
|
+
return (deps.workflowScriptRunner?.safeForUntrustedScripts === true &&
|
|
25
|
+
deps.workflowGovernanceBaseline !== undefined);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* design/98 §1.2 — the task OPTED IN (`selfOrchestration:true`) but the deployment did not meet the bar (a
|
|
29
|
+
* hard sandbox + a governance baseline), so self-orchestration is FAIL-CLOSED. Returns a human-readable
|
|
30
|
+
* reason for an operator warning, or `null` when not in this state (off, or fully active). The runner emits
|
|
31
|
+
* ONE operator-visible warning so a misconfigured opt-in is never silent.
|
|
32
|
+
*/
|
|
33
|
+
export function selfOrchestrationFailClosedReason(spec, deps) {
|
|
34
|
+
if (spec.selfOrchestration !== true)
|
|
35
|
+
return null;
|
|
36
|
+
if (isSelfOrchestrationActive(spec, deps))
|
|
37
|
+
return null;
|
|
38
|
+
const missing = [];
|
|
39
|
+
if (deps.workflowScriptRunner?.safeForUntrustedScripts !== true) {
|
|
40
|
+
missing.push("a hard WorkflowScriptRunner (RunnerDeps.workflowScriptRunner.safeForUntrustedScripts === true)");
|
|
41
|
+
}
|
|
42
|
+
if (deps.workflowGovernanceBaseline === undefined) {
|
|
43
|
+
missing.push("a governance baseline (RunnerDeps.workflowGovernanceBaseline)");
|
|
44
|
+
}
|
|
45
|
+
return (`self-orchestration (TaskSpec.selfOrchestration) requires ${missing.join(" and ")}; it is DISABLED for ` +
|
|
46
|
+
`this task (fail-closed — the run_workflow tool is not mounted and the orchestration prompt is not injected).`);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=workflow-script-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-script-runner.js","sourceRoot":"","sources":["../../src/orchestration/workflow-script-runner.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAAc,EAAE,IAAgB;IACxE,OAAO,IAAI,CAAC,iBAAiB,KAAK,IAAI,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;AACtE,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAgB;IAClD,OAAO,CACL,IAAI,CAAC,oBAAoB,EAAE,uBAAuB,KAAK,IAAI;QAC3D,IAAI,CAAC,0BAA0B,KAAK,SAAS,CAC9C,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iCAAiC,CAAC,IAAc,EAAE,IAAgB;IAChF,IAAI,IAAI,CAAC,iBAAiB,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACjD,IAAI,yBAAyB,CAAC,IAAI,EAAE,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACvD,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,IAAI,CAAC,oBAAoB,EAAE,uBAAuB,KAAK,IAAI,EAAE,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,gGAAgG,CAAC,CAAC;IACjH,CAAC;IACD,IAAI,IAAI,CAAC,0BAA0B,KAAK,SAAS,EAAE,CAAC;QAClD,OAAO,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,CACL,4DAA4D,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,uBAAuB;QACxG,8GAA8G,CAC/G,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PARITY-SPOT-WORKFLOW B5/F2 (CC pretty.js:449105-449141 + `Pqi` :149631) — the script-persistence seam behind
|
|
3
|
+
* the Workflow tool's `scriptPath`/`name` calling surface. CC persists EVERY invocation's script under the
|
|
4
|
+
* session directory and returns the path in the tool result, so the model iterates by EDITING THE FILE and
|
|
5
|
+
* re-invoking with `{scriptPath}` instead of resending the whole script; `{name}` resolves a saved workflow.
|
|
6
|
+
*
|
|
7
|
+
* Core is deployment-neutral: the tool takes this seam via `RunWorkflowToolDeps.scriptStore` (optional — when
|
|
8
|
+
* absent, `scriptPath`/`name` calls get an honest structured error and inline `script` works as before). The
|
|
9
|
+
* file-backed implementation below is the TOC default (mirrors CC's session-dir posture: dir 0o700 / file
|
|
10
|
+
* 0o600, best-effort persist that never blocks a launch).
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* design/140 §6 1a — a named-registry entry's RESOLVED form: the script source plus the registration's
|
|
14
|
+
* `defaultArgs` layer (the middle tier of the merge chain: call-time args > registered defaultArgs >
|
|
15
|
+
* script-internal fallbacks). A registry that carries no defaults may keep returning a bare string.
|
|
16
|
+
*/
|
|
17
|
+
export interface NamedWorkflowResolution {
|
|
18
|
+
script: string;
|
|
19
|
+
/** Registration-time default args (a JSON value — this is where a control-plane/center下发的默认 lands).
|
|
20
|
+
* Merged UNDER the call-time args by {@link mergeWorkflowArgs} at tool-resolve time (parse-time snapshot:
|
|
21
|
+
* the run receives the merged VALUE; nothing re-queries the registry after launch). */
|
|
22
|
+
defaultArgs?: unknown;
|
|
23
|
+
/**
|
|
24
|
+
* 团队通道 [426] CORE-1 — the top-level key a BARE STRING call-time arg normalizes into, so the "裸 string =
|
|
25
|
+
* <key>" ergonomic entry (published by the built-in `team-discussion` script: a bare string args IS the
|
|
26
|
+
* topic) composes with a registered object `defaultArgs` instead of colliding with it. When a `{name}` call
|
|
27
|
+
* passes a raw string AND this resolution carries an object `defaultArgs`, the tool wraps the string as
|
|
28
|
+
* `{ [stringArgKey]: <string> }` BEFORE the object merge (see {@link normalizeStringArg} / the run-workflow
|
|
29
|
+
* tool's resolve path). Defaults to `"topic"` (the built-in ergonomic contract). Ignored when `defaultArgs`
|
|
30
|
+
* is not a plain object (a bare string then reaches the script verbatim — pre-[426] behavior preserved). */
|
|
31
|
+
stringArgKey?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* design/140 §6 1b — one row of the named-workflow LISTING projection (the LLM-facing consumption face of
|
|
35
|
+
* `meta.whenToUse`). Mirrors the agents-side roster entry (subagent.ts `agentWhenToUseText`/CC `tIl`):
|
|
36
|
+
* `whenToUse` is shown when present, else `description`.
|
|
37
|
+
*/
|
|
38
|
+
export interface NamedWorkflowListing {
|
|
39
|
+
name: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
whenToUse?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface WorkflowScriptStore {
|
|
44
|
+
/** Persist THIS invocation's resolved script, keyed by its runId. Returns the persisted path (what the tool
|
|
45
|
+
* reports back to the model). Failures should throw — the tool treats persistence as best-effort. */
|
|
46
|
+
persist(runId: string, script: string): Promise<string> | string;
|
|
47
|
+
/** Read a previously persisted script back. MUST refuse paths outside the store (the argument is
|
|
48
|
+
* model-supplied — containment is the store's contract, not the tool's). */
|
|
49
|
+
load(scriptPath: string): Promise<string> | string;
|
|
50
|
+
/** Resolve a SAVED workflow name to its script source (undefined = unknown name). Optional — a deployment
|
|
51
|
+
* without a named registry simply omits it. May return either the bare script source (legacy/simple form)
|
|
52
|
+
* or a {@link NamedWorkflowResolution} carrying the registration's `defaultArgs` (design/140 §6 1a). A
|
|
53
|
+
* deployment entry of the SAME NAME as a built-in workflow SHADOWS the built-in (design/140 §6 1c). */
|
|
54
|
+
resolveName?(name: string): Promise<string | NamedWorkflowResolution | undefined> | string | NamedWorkflowResolution | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* design/140 §6 1b — enumerate the registry's SAVED workflows for the listing projection (tool card /
|
|
57
|
+
* roster faces). Optional: a store without a stable name registry omits it (the file store below does —
|
|
58
|
+
* its directory mixes per-run persisted scripts with saved names, so enumeration would advertise every
|
|
59
|
+
* past run as a "named workflow"). NOTE: only a SYNCHRONOUS return reaches the statically-built Workflow
|
|
60
|
+
* tool card; an async store should precompute if it wants card visibility.
|
|
61
|
+
*/
|
|
62
|
+
list?(): NamedWorkflowListing[] | Promise<NamedWorkflowListing[]>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* design/140 §6 1a — the default-args merge: **call-time args > registered defaultArgs** (the script's own
|
|
66
|
+
* internal fallbacks remain the third tier, applied by the script itself). Semantics (locked by test):
|
|
67
|
+
* - both sides plain objects → SHALLOW top-level merge (`{...defaults, ...call}`): a top-level key present in
|
|
68
|
+
* the call args wins WHOLESALE — nested objects/arrays/scalars are replaced, never deep-merged;
|
|
69
|
+
* - call args absent (`undefined`) → the registered defaults verbatim;
|
|
70
|
+
* - call args a non-object (array / scalar / null) → the call args win wholesale (no structural mixing).
|
|
71
|
+
* Pure value-in/value-out: the caller snapshots the RESULT into the run (parse-time discipline, design/140 §2 —
|
|
72
|
+
* a resume replay never re-queries the registry; a post-launch registry change cannot reach an in-flight run).
|
|
73
|
+
*/
|
|
74
|
+
export declare function mergeWorkflowArgs(callArgs: unknown, defaultArgs: unknown): unknown;
|
|
75
|
+
/**
|
|
76
|
+
* 团队通道 [426] CORE-1 — NORMALIZE a bare-string call-time arg into `{ [key]: <string> }` so the published
|
|
77
|
+
* "裸 string = <key>" ergonomic entry (built-in `team-discussion`: bare string args IS the topic) COMPOSES
|
|
78
|
+
* with a registered object `defaultArgs` instead of colliding with it.
|
|
79
|
+
*
|
|
80
|
+
* The bug it fixes: {@link mergeWorkflowArgs}'s non-object branch lets a bare string win WHOLESALE — so a
|
|
81
|
+
* named workflow whose registration carries object `defaultArgs` (center 配的 members/rounds/finalizer) had
|
|
82
|
+
* its whole defaults block silently wiped the moment a caller used the ergonomic `{name, args: "<topic>"}`
|
|
83
|
+
* form, and the collab template quietly ran as a generic advocate/skeptic. Wrapping the string here lets the
|
|
84
|
+
* subsequent object merge preserve the defaults AND honor the topic.
|
|
85
|
+
*
|
|
86
|
+
* Applied ONLY when BOTH hold (otherwise return `callArgs` untouched — pre-[426] behavior byte-preserved):
|
|
87
|
+
* - `callArgs` is a string (the ergonomic form), AND
|
|
88
|
+
* - `defaultArgs` is a PLAIN OBJECT (there ARE object defaults to merge under; with no/scalar defaults a bare
|
|
89
|
+
* string must still reach the script verbatim — the built-in's own `raw === "string"` fallback handles it).
|
|
90
|
+
* `key` is the resolution's `stringArgKey` (a registry may declare which key its bare string maps to); the
|
|
91
|
+
* caller passes the built-in default `"topic"` when the resolution omits it.
|
|
92
|
+
*/
|
|
93
|
+
export declare function normalizeStringArg(callArgs: unknown, defaultArgs: unknown, key?: string): unknown;
|
|
94
|
+
/**
|
|
95
|
+
* File-backed {@link WorkflowScriptStore}: scripts land as `<dir>/<runId>.js`; `resolveName` reads
|
|
96
|
+
* `<dir>/<name>.js` (same directory — a saved workflow is just a script file someone/some run left there).
|
|
97
|
+
*/
|
|
98
|
+
export declare function createFileWorkflowScriptStore(dir: string): WorkflowScriptStore;
|
|
99
|
+
//# sourceMappingURL=workflow-script-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-script-store.d.ts","sourceRoot":"","sources":["../../src/orchestration/workflow-script-store.ts"],"names":[],"m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