@sema-agent/server 1.322.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/approval-hmac.d.ts +40 -0
- package/dist/approval-hmac.js +67 -0
- package/dist/approval.d.ts +31 -0
- package/dist/approval.js +72 -4
- package/dist/audit.d.ts +26 -0
- package/dist/audit.js +40 -1
- package/dist/auth-bridge.d.ts +10 -0
- package/dist/auth-bridge.js +47 -4
- package/dist/auth-keys.d.ts +19 -0
- package/dist/auth-keys.js +13 -0
- package/dist/bake-runner/main.d.ts +5 -0
- package/dist/bake-runner/main.js +43 -4
- package/dist/bake-runner/protocol.d.ts +57 -0
- package/dist/bake-runner/protocol.js +58 -3
- package/dist/bake-runner/runner.d.ts +54 -0
- package/dist/bake-runner/runner.js +87 -5
- package/dist/bench/l8/artifact.d.ts +63 -0
- package/dist/bench/l8/artifact.js +61 -2
- package/dist/bench/l8/escape.d.ts +36 -0
- package/dist/bench/l8/escape.js +25 -0
- package/dist/bench/l8/index.d.ts +14 -0
- package/dist/bench/l8/index.js +14 -0
- package/dist/bench/l8/probes.d.ts +74 -0
- package/dist/bench/l8/probes.js +60 -0
- package/dist/bench/l8/run-probes.d.ts +43 -0
- package/dist/bench/l8/run-probes.js +45 -2
- package/dist/bench/s1/arms.d.ts +126 -0
- package/dist/bench/s1/arms.js +188 -13
- package/dist/bench/s1/live-deps.d.ts +66 -0
- package/dist/bench/s1/live-deps.js +249 -11
- package/dist/bench/s1/oracle.d.ts +49 -0
- package/dist/bench/s1/oracle.js +36 -1
- package/dist/bench/s1/repair-oracle-adapter.d.ts +33 -0
- package/dist/bench/s1/repair-oracle-adapter.js +30 -0
- package/dist/bench/s1/reviewer.d.ts +38 -0
- package/dist/bench/s1/reviewer.js +34 -0
- package/dist/bench/s1/row.d.ts +77 -0
- package/dist/bench/s1/row.js +62 -0
- package/dist/bench/s1/run-firm.d.ts +47 -0
- package/dist/bench/s1/run-firm.js +70 -4
- package/dist/bench/s1/runner-ctx.d.ts +71 -0
- package/dist/bench/s1/runner-ctx.js +36 -0
- package/dist/bench/s1/tasks.d.ts +108 -0
- package/dist/bench/s1/tasks.js +115 -0
- package/dist/boot-reclaim.d.ts +19 -0
- package/dist/boot-reclaim.js +20 -0
- package/dist/brain.d.ts +25 -0
- package/dist/brain.js +61 -1
- package/dist/budget.d.ts +66 -0
- package/dist/budget.js +128 -4
- package/dist/capabilities/builtin-tools.d.ts +3 -0
- package/dist/capabilities/builtin-tools.js +3 -0
- package/dist/capabilities/center-plugins.d.ts +17 -1
- package/dist/capabilities/center-plugins.js +45 -4
- package/dist/capabilities/center-prompts.d.ts +46 -0
- package/dist/capabilities/center-prompts.js +57 -3
- package/dist/capabilities/code-review-council.d.ts +28 -0
- package/dist/capabilities/code-review-council.js +40 -7
- package/dist/capabilities/collab-wire.d.ts +2 -0
- package/dist/capabilities/collab-workflows.d.ts +7 -0
- package/dist/capabilities/collab-workflows.js +44 -1
- package/dist/capabilities/oa-tools.d.ts +6 -0
- package/dist/capabilities/oa-tools.js +10 -0
- package/dist/capabilities/prompt.d.ts +14 -0
- package/dist/capabilities/prompt.js +14 -0
- package/dist/capabilities/prompts/code-review.d.ts +14 -0
- package/dist/capabilities/prompts/code-review.js +14 -0
- package/dist/capabilities/prompts/identity.d.ts +6 -0
- package/dist/capabilities/prompts/identity.js +6 -0
- package/dist/capabilities/prompts/team.d.ts +4 -0
- package/dist/capabilities/prompts/team.js +4 -0
- package/dist/capabilities/repo-tools.d.ts +11 -0
- package/dist/capabilities/repo-tools.js +8 -0
- package/dist/capabilities/sandbox-file-send.d.ts +95 -0
- package/dist/capabilities/sandbox-file-send.js +91 -3
- package/dist/capabilities/scenarios.d.ts +130 -0
- package/dist/capabilities/scenarios.js +180 -7
- package/dist/capabilities/select-environment-tool.d.ts +7 -0
- package/dist/capabilities/select-environment-tool.js +30 -0
- package/dist/capabilities/send-user-file-tool.d.ts +33 -0
- package/dist/capabilities/send-user-file-tool.js +65 -1
- package/dist/capabilities/skills.d.ts +29 -0
- package/dist/capabilities/skills.js +13 -2
- package/dist/capabilities/team.d.ts +22 -0
- package/dist/capabilities/team.js +22 -2
- package/dist/capabilities/tool-defer.d.ts +26 -0
- package/dist/capabilities/tool-defer.js +3 -0
- package/dist/config-center/apply-effective.d.ts +65 -0
- package/dist/config-center/apply-effective.js +204 -12
- package/dist/config-center/http-client.d.ts +34 -0
- package/dist/config-center/http-client.js +68 -0
- package/dist/config-center/restart-signal.d.ts +22 -0
- package/dist/config-center/restart-signal.js +39 -0
- package/dist/config-center/skills-mcp.d.ts +20 -1
- package/dist/config-center/skills-mcp.js +42 -7
- package/dist/config-center/types.d.ts +92 -1
- package/dist/config-lkg.d.ts +12 -0
- package/dist/config-lkg.js +41 -0
- package/dist/config-provider.d.ts +78 -0
- package/dist/config-provider.js +165 -2
- package/dist/config-types.d.ts +546 -0
- package/dist/config.d.ts +64 -0
- package/dist/config.js +455 -60
- package/dist/degenerate-instrument.d.ts +38 -0
- package/dist/degenerate-instrument.js +55 -3
- package/dist/elicitation.d.ts +39 -0
- package/dist/elicitation.js +87 -3
- package/dist/env-facts.d.ts +61 -0
- package/dist/env-facts.js +73 -7
- package/dist/fleet/fleet-bus.d.ts +185 -0
- package/dist/fleet/fleet-bus.js +333 -27
- package/dist/fleet/subagent-tail-bus.d.ts +11 -0
- package/dist/fleet/subagent-tail-bus.js +33 -2
- package/dist/fleet-client.d.ts +38 -0
- package/dist/fleet-client.js +44 -9
- package/dist/fleet-lease.d.ts +46 -0
- package/dist/fleet-lease.js +73 -5
- package/dist/hooks/branch-transcript.d.ts +8 -0
- package/dist/hooks/branch-transcript.js +33 -0
- package/dist/hooks/cc-stop-prompt.d.ts +42 -0
- package/dist/hooks/cc-stop-prompt.js +43 -1
- package/dist/hooks/hook-llm.d.ts +15 -0
- package/dist/hooks/hook-llm.js +47 -0
- package/dist/hooks/hook-runner.d.ts +89 -0
- package/dist/hooks/hook-runner.js +327 -18
- package/dist/http/idempotency.d.ts +31 -0
- package/dist/http/idempotency.js +34 -0
- package/dist/http/principal-gate.d.ts +17 -0
- package/dist/http/principal-gate.js +35 -3
- package/dist/http/route-ctx.d.ts +36 -0
- package/dist/http/routes/approvals-assistant.d.ts +25 -0
- package/dist/http/routes/approvals-assistant.js +253 -23
- package/dist/http/routes/attachments.js +22 -4
- package/dist/http/routes/capabilities.d.ts +7 -0
- package/dist/http/routes/capabilities.js +202 -1
- package/dist/http/routes/fleet.d.ts +6 -0
- package/dist/http/routes/fleet.js +94 -5
- package/dist/http/routes/images.d.ts +17 -0
- package/dist/http/routes/images.js +222 -14
- package/dist/http/routes/leader.d.ts +7 -0
- package/dist/http/routes/leader.js +10 -0
- package/dist/http/routes/memory-policy.d.ts +6 -0
- package/dist/http/routes/memory-policy.js +38 -6
- package/dist/http/routes/notify-wake.d.ts +10 -0
- package/dist/http/routes/notify-wake.js +19 -3
- package/dist/http/routes/observability.d.ts +6 -0
- package/dist/http/routes/observability.js +19 -2
- package/dist/http/routes/runs.d.ts +15 -0
- package/dist/http/routes/runs.js +464 -41
- package/dist/http/routes/session-sync.d.ts +15 -0
- package/dist/http/routes/session-sync.js +229 -19
- package/dist/http/routes/sessions-list.d.ts +6 -0
- package/dist/http/routes/sessions-list.js +35 -4
- package/dist/http/routes/sessions.d.ts +14 -0
- package/dist/http/routes/sessions.js +176 -31
- package/dist/http/routes/side-query.d.ts +8 -0
- package/dist/http/routes/side-query.js +26 -1
- package/dist/http/routes/tasks.d.ts +18 -0
- package/dist/http/routes/tasks.js +501 -38
- package/dist/http/routes/trace-usage.d.ts +10 -0
- package/dist/http/routes/trace-usage.js +66 -14
- package/dist/http/routes/workflows.d.ts +12 -0
- package/dist/http/routes/workflows.js +180 -19
- package/dist/http/run-meta.d.ts +11 -0
- package/dist/http/run-meta.js +6 -0
- package/dist/http/send.d.ts +19 -0
- package/dist/http/send.js +11 -0
- package/dist/http/server.d.ts +255 -0
- package/dist/http/server.js +921 -75
- package/dist/http/sse-log.d.ts +15 -0
- package/dist/http/sse-log.js +16 -0
- package/dist/http/tar.d.ts +9 -0
- package/dist/http/tar.js +21 -5
- package/dist/http/wire-gate.d.ts +9 -0
- package/dist/http/wire-gate.js +9 -0
- package/dist/http/wire-types.d.ts +187 -0
- package/dist/http/workspace-content.d.ts +8 -0
- package/dist/http/workspace-content.js +10 -0
- package/dist/images/bake-validate.d.ts +63 -0
- package/dist/images/bake-validate.js +71 -1
- package/dist/images/manifest.d.ts +19 -0
- package/dist/images/manifest.js +6 -1
- package/dist/index.d.ts +1 -5
- package/dist/index.js +10 -5
- package/dist/key-resolver.d.ts +23 -0
- package/dist/key-resolver.js +27 -2
- package/dist/leader/diffout.d.ts +23 -0
- package/dist/leader/diffout.js +8 -1
- package/dist/leader/diffup.d.ts +32 -0
- package/dist/leader/diffup.js +43 -0
- package/dist/leader/endpoint.d.ts +20 -0
- package/dist/leader/endpoint.js +25 -2
- package/dist/leader/fanout.d.ts +60 -0
- package/dist/leader/fanout.js +29 -3
- package/dist/leader/grader-env-factory.d.ts +74 -0
- package/dist/leader/grader-env-factory.js +62 -3
- package/dist/leader/leader.d.ts +97 -0
- package/dist/leader/leader.js +151 -4
- package/dist/leader/merge.d.ts +94 -0
- package/dist/leader/merge.js +112 -9
- package/dist/leader/planner.d.ts +52 -0
- package/dist/leader/planner.js +47 -3
- package/dist/leader/repair-oracle.d.ts +61 -0
- package/dist/leader/repair-oracle.js +59 -1
- package/dist/leader/repair-wire.d.ts +78 -0
- package/dist/leader/repair-wire.js +79 -2
- package/dist/leader/wire.d.ts +79 -0
- package/dist/leader/wire.js +255 -8
- package/dist/lsp/e2b-bridge.d.ts +16 -0
- package/dist/lsp/e2b-bridge.js +32 -4
- package/dist/lsp/e2b-manager.d.ts +10 -0
- package/dist/lsp/e2b-manager.js +18 -2
- package/dist/lsp/lsp-frames.d.ts +12 -0
- package/dist/lsp/lsp-frames.js +12 -0
- package/dist/lsp/manager.d.ts +12 -0
- package/dist/lsp/manager.js +35 -2
- package/dist/lsp/types.d.ts +10 -0
- package/dist/lsp/ws-transport.d.ts +12 -0
- package/dist/lsp/ws-transport.js +53 -5
- package/dist/lsp-evict.d.ts +14 -0
- package/dist/lsp-evict.js +15 -1
- package/dist/main.js +2132 -96
- package/dist/memory-export.d.ts +1 -0
- package/dist/memory-export.js +4 -0
- package/dist/memory-scope.d.ts +49 -0
- package/dist/memory-scope.js +87 -4
- package/dist/memory-sync-client.d.ts +24 -0
- package/dist/memory-sync-client.js +41 -2
- package/dist/memory-sync.d.ts +23 -0
- package/dist/memory-sync.js +70 -1
- package/dist/model-select.d.ts +39 -0
- package/dist/model-select.js +42 -1
- package/dist/observability/cost-quota.d.ts +20 -0
- package/dist/observability/cost-quota.js +4 -0
- package/dist/observability/cost-taxonomy.d.ts +45 -0
- package/dist/observability/cost-taxonomy.js +34 -0
- package/dist/observability/logger.d.ts +1 -0
- package/dist/observability/logger.js +6 -0
- package/dist/observability/metrics.d.ts +13 -0
- package/dist/observability/metrics.js +63 -0
- package/dist/observability/otel-exporter.d.ts +9 -0
- package/dist/observability/otel-exporter.js +11 -3
- package/dist/observability/principal-context.d.ts +9 -0
- package/dist/observability/principal-context.js +9 -0
- package/dist/observability/prompt-manifest.d.ts +37 -0
- package/dist/observability/prompt-manifest.js +35 -1
- package/dist/observability/rate-limit.d.ts +10 -0
- package/dist/observability/rate-limit.js +1 -0
- package/dist/observability/tool-trace.d.ts +24 -0
- package/dist/observability/tool-trace.js +41 -1
- package/dist/orchestration/hardened-vm-runner.d.ts +107 -0
- package/dist/orchestration/hardened-vm-runner.js +119 -4
- package/dist/orchestration/hardened-vm-worker-runner.d.ts +14 -0
- package/dist/orchestration/hardened-vm-worker-runner.js +26 -1
- package/dist/orchestration/hardened-vm-worker.js +27 -0
- package/dist/orchestration/subagent-steer.d.ts +44 -0
- package/dist/orchestration/subagent-steer.js +45 -1
- package/dist/orchestration/workflow-agent-steer.d.ts +54 -0
- package/dist/orchestration/workflow-agent-steer.js +80 -1
- package/dist/orchestration/workflow-completion-inbox.d.ts +189 -2
- package/dist/orchestration/workflow-completion-inbox.js +283 -32
- package/dist/orchestration/workflow-notify-journal.d.ts +132 -1
- package/dist/orchestration/workflow-notify-journal.js +187 -13
- package/dist/parked-decide.d.ts +61 -0
- package/dist/parked-decide.js +58 -1
- package/dist/per-task-image.d.ts +54 -0
- package/dist/per-task-image.js +41 -0
- package/dist/plan-cache-probe.d.ts +35 -0
- package/dist/plan-cache-probe.js +18 -3
- package/dist/plugins/approval-exemption-store.d.ts +7 -0
- package/dist/plugins/approval-exemption-store.js +28 -2
- package/dist/plugins/approval-store-sql.d.ts +64 -0
- package/dist/plugins/approval-store-sql.js +32 -0
- package/dist/plugins/background-agent-store-sql.d.ts +55 -0
- package/dist/plugins/background-agent-store-sql.js +91 -4
- package/dist/plugins/background-shell-support.d.ts +98 -0
- package/dist/plugins/background-shell-support.js +117 -13
- package/dist/plugins/blob-backend.d.ts +104 -0
- package/dist/plugins/blob-backend.js +163 -6
- package/dist/plugins/breaker-state-sql.d.ts +65 -1
- package/dist/plugins/breaker-state-sql.js +46 -8
- package/dist/plugins/caching-session-store.d.ts +42 -0
- package/dist/plugins/caching-session-store.js +63 -3
- package/dist/plugins/checkpoint-store-sql.d.ts +179 -0
- package/dist/plugins/checkpoint-store-sql.js +239 -11
- package/dist/plugins/file-outcome-sink.d.ts +4 -0
- package/dist/plugins/file-outcome-sink.js +9 -0
- package/dist/plugins/file-resume-anchor-store.d.ts +20 -0
- package/dist/plugins/file-resume-anchor-store.js +43 -4
- package/dist/plugins/file-run-store.d.ts +90 -0
- package/dist/plugins/file-run-store.js +145 -13
- package/dist/plugins/file-snapshot-store-sql.d.ts +133 -1
- package/dist/plugins/file-snapshot-store-sql.js +178 -10
- package/dist/plugins/file-workflow-journal-store.d.ts +10 -0
- package/dist/plugins/file-workflow-journal-store.js +10 -0
- package/dist/plugins/fork-routing-session-store.d.ts +47 -0
- package/dist/plugins/fork-routing-session-store.js +51 -3
- package/dist/plugins/host-platform.d.ts +69 -0
- package/dist/plugins/host-platform.js +81 -2
- package/dist/plugins/image-bake-store-sql.d.ts +136 -1
- package/dist/plugins/image-bake-store-sql.js +241 -7
- package/dist/plugins/image-index-sql.d.ts +46 -0
- package/dist/plugins/image-index-sql.js +113 -4
- package/dist/plugins/k8s-bg-scripts.d.ts +34 -0
- package/dist/plugins/k8s-bg-scripts.js +88 -4
- package/dist/plugins/k8s-exec-protocol.d.ts +33 -0
- package/dist/plugins/k8s-exec-protocol.js +41 -0
- package/dist/plugins/local-checkpoint-store.d.ts +40 -0
- package/dist/plugins/local-checkpoint-store.js +86 -7
- package/dist/plugins/local-session-store.d.ts +157 -0
- package/dist/plugins/local-session-store.js +289 -34
- package/dist/plugins/local-task-attachment-store.js +14 -2
- package/dist/plugins/mailbox-store-sql.d.ts +38 -0
- package/dist/plugins/mailbox-store-sql.js +39 -6
- package/dist/plugins/memory-engine-pg.d.ts +30 -0
- package/dist/plugins/memory-engine-pg.js +122 -4
- package/dist/plugins/memory-engine-tidb.d.ts +26 -0
- package/dist/plugins/memory-engine-tidb.js +115 -5
- package/dist/plugins/memory-engine-vector-util.d.ts +5 -0
- package/dist/plugins/memory-engine-vector-util.js +5 -0
- package/dist/plugins/memory-resume-anchor-store.d.ts +8 -0
- package/dist/plugins/memory-resume-anchor-store.js +17 -0
- package/dist/plugins/memory-run-store.d.ts +63 -0
- package/dist/plugins/memory-run-store.js +73 -8
- package/dist/plugins/memory-session-policy-store.d.ts +17 -0
- package/dist/plugins/memory-session-policy-store.js +17 -0
- package/dist/plugins/memory-sync-store-pg.d.ts +42 -0
- package/dist/plugins/memory-sync-store-pg.js +45 -2
- package/dist/plugins/memory-sync-store-tidb.d.ts +9 -0
- package/dist/plugins/memory-sync-store-tidb.js +31 -1
- package/dist/plugins/outcome-ledger-sql.d.ts +63 -0
- package/dist/plugins/outcome-ledger-sql.js +97 -3
- package/dist/plugins/pg-approval-store.d.ts +7 -0
- package/dist/plugins/pg-approval-store.js +7 -0
- package/dist/plugins/pg-breaker-state.d.ts +6 -0
- package/dist/plugins/pg-breaker-state.js +6 -0
- package/dist/plugins/pg-checkpoint-store.d.ts +8 -0
- package/dist/plugins/pg-checkpoint-store.js +8 -0
- package/dist/plugins/pg-cost-quota.d.ts +17 -0
- package/dist/plugins/pg-cost-quota.js +6 -0
- package/dist/plugins/pg-file-snapshot-store.d.ts +6 -0
- package/dist/plugins/pg-file-snapshot-store.js +6 -0
- package/dist/plugins/pg-image-bake.d.ts +9 -0
- package/dist/plugins/pg-image-bake.js +9 -0
- package/dist/plugins/pg-image-index.d.ts +9 -0
- package/dist/plugins/pg-image-index.js +9 -0
- package/dist/plugins/pg-outcome-ledger.d.ts +9 -0
- package/dist/plugins/pg-outcome-ledger.js +9 -0
- package/dist/plugins/pg-pool.d.ts +50 -0
- package/dist/plugins/pg-pool.js +78 -0
- package/dist/plugins/pg-query.d.ts +11 -0
- package/dist/plugins/pg-rate-limiter.d.ts +23 -0
- package/dist/plugins/pg-rate-limiter.js +12 -2
- package/dist/plugins/pg-resume-anchor-store.d.ts +5 -0
- package/dist/plugins/pg-resume-anchor-store.js +5 -0
- package/dist/plugins/pg-run-store.d.ts +7 -0
- package/dist/plugins/pg-run-store.js +7 -0
- package/dist/plugins/pg-safe-json.d.ts +13 -0
- package/dist/plugins/pg-safe-json.js +40 -4
- package/dist/plugins/pg-session-policy-store.d.ts +5 -0
- package/dist/plugins/pg-session-policy-store.js +5 -0
- package/dist/plugins/pg-session-storage.d.ts +72 -0
- package/dist/plugins/pg-session-storage.js +152 -20
- package/dist/plugins/pg-session-store.d.ts +10 -0
- package/dist/plugins/pg-session-store.js +10 -0
- package/dist/plugins/pg-tool-result-store.d.ts +7 -0
- package/dist/plugins/pg-tool-result-store.js +7 -0
- package/dist/plugins/pg-workflow-journal-store.d.ts +7 -0
- package/dist/plugins/pg-workflow-journal-store.js +7 -0
- package/dist/plugins/pg-workflow-run-store.d.ts +7 -0
- package/dist/plugins/pg-workflow-run-store.js +7 -0
- package/dist/plugins/posix-shell-fs.d.ts +3 -0
- package/dist/plugins/posix-shell-fs.js +31 -1
- package/dist/plugins/remote-env-adb.d.ts +25 -0
- package/dist/plugins/remote-env-adb.js +95 -12
- package/dist/plugins/remote-env-e2b.d.ts +146 -0
- package/dist/plugins/remote-env-e2b.js +371 -40
- package/dist/plugins/remote-env-file-error.d.ts +34 -0
- package/dist/plugins/remote-env-file-error.js +37 -0
- package/dist/plugins/remote-env-host.d.ts +151 -0
- package/dist/plugins/remote-env-host.js +468 -70
- package/dist/plugins/remote-env-k8s.d.ts +135 -0
- package/dist/plugins/remote-env-k8s.js +318 -32
- package/dist/plugins/remote-env-local-docker.d.ts +65 -0
- package/dist/plugins/remote-env-local-docker.js +149 -24
- package/dist/plugins/remote-env-ssh.d.ts +35 -0
- package/dist/plugins/remote-env-ssh.js +117 -20
- package/dist/plugins/remote-scratchpad.d.ts +38 -0
- package/dist/plugins/remote-scratchpad.js +32 -2
- package/dist/plugins/remote-shell.d.ts +22 -0
- package/dist/plugins/remote-shell.js +27 -1
- package/dist/plugins/resume-anchor-store-sql.d.ts +28 -0
- package/dist/plugins/resume-anchor-store-sql.js +11 -0
- package/dist/plugins/roster-store-sql.d.ts +27 -0
- package/dist/plugins/roster-store-sql.js +54 -0
- package/dist/plugins/run-store-sql.d.ts +194 -0
- package/dist/plugins/run-store-sql.js +210 -9
- package/dist/plugins/s3-presign.d.ts +20 -0
- package/dist/plugins/s3-presign.js +49 -2
- package/dist/plugins/scheduler-support.d.ts +12 -0
- package/dist/plugins/scheduler-support.js +75 -3
- package/dist/plugins/send-file-ledger.d.ts +15 -0
- package/dist/plugins/send-file-ledger.js +53 -4
- package/dist/plugins/send-user-file.d.ts +77 -0
- package/dist/plugins/send-user-file.js +92 -4
- package/dist/plugins/session-policy-store-sql.d.ts +15 -0
- package/dist/plugins/session-policy-store-sql.js +75 -3
- package/dist/plugins/session-store.d.ts +45 -0
- package/dist/plugins/session-store.js +51 -0
- package/dist/plugins/sql-driver.d.ts +77 -0
- package/dist/plugins/sql-driver.js +4 -0
- package/dist/plugins/sql-escape.d.ts +8 -0
- package/dist/plugins/sql-escape.js +8 -0
- package/dist/plugins/sql-row-helpers.d.ts +25 -0
- package/dist/plugins/sql-row-helpers.js +25 -0
- package/dist/plugins/store-backend.d.ts +103 -0
- package/dist/plugins/store-backend.js +120 -27
- package/dist/plugins/store-contracts.d.ts +62 -0
- package/dist/plugins/store-contracts.js +3 -0
- package/dist/plugins/task-attachment-store.d.ts +60 -0
- package/dist/plugins/task-attachment-store.js +49 -3
- package/dist/plugins/task-list-store-sql.d.ts +25 -0
- package/dist/plugins/task-list-store-sql.js +21 -0
- package/dist/plugins/tidb-approval-store.d.ts +6 -0
- package/dist/plugins/tidb-approval-store.js +6 -0
- package/dist/plugins/tidb-breaker-state.d.ts +5 -0
- package/dist/plugins/tidb-breaker-state.js +5 -0
- package/dist/plugins/tidb-checkpoint-store.d.ts +7 -0
- package/dist/plugins/tidb-checkpoint-store.js +7 -0
- package/dist/plugins/tidb-cost-quota.d.ts +6 -0
- package/dist/plugins/tidb-cost-quota.js +1 -0
- package/dist/plugins/tidb-file-snapshot-store.d.ts +6 -0
- package/dist/plugins/tidb-file-snapshot-store.js +6 -0
- package/dist/plugins/tidb-image-bake.d.ts +8 -0
- package/dist/plugins/tidb-image-bake.js +8 -0
- package/dist/plugins/tidb-image-index.d.ts +8 -0
- package/dist/plugins/tidb-image-index.js +8 -0
- package/dist/plugins/tidb-outcome-ledger.d.ts +10 -0
- package/dist/plugins/tidb-outcome-ledger.js +10 -0
- package/dist/plugins/tidb-pool.d.ts +56 -0
- package/dist/plugins/tidb-pool.js +181 -1
- package/dist/plugins/tidb-rate-limiter.d.ts +11 -0
- package/dist/plugins/tidb-rate-limiter.js +5 -2
- package/dist/plugins/tidb-resume-anchor-store.d.ts +5 -0
- package/dist/plugins/tidb-resume-anchor-store.js +5 -0
- package/dist/plugins/tidb-run-store.d.ts +7 -0
- package/dist/plugins/tidb-run-store.js +7 -0
- package/dist/plugins/tidb-session-policy-store.d.ts +5 -0
- package/dist/plugins/tidb-session-policy-store.js +5 -0
- package/dist/plugins/tidb-session-storage.d.ts +43 -0
- package/dist/plugins/tidb-session-storage.js +62 -3
- package/dist/plugins/tidb-session-store.d.ts +142 -0
- package/dist/plugins/tidb-session-store.js +264 -16
- package/dist/plugins/tidb-tool-result-store.d.ts +5 -0
- package/dist/plugins/tidb-tool-result-store.js +7 -0
- package/dist/plugins/tidb-workflow-journal-store.d.ts +7 -0
- package/dist/plugins/tidb-workflow-journal-store.js +7 -0
- package/dist/plugins/tidb-workflow-run-store.d.ts +8 -0
- package/dist/plugins/tidb-workflow-run-store.js +8 -0
- package/dist/plugins/tool-result-store-sql.d.ts +58 -0
- package/dist/plugins/tool-result-store-sql.js +38 -2
- package/dist/plugins/web-search.d.ts +35 -0
- package/dist/plugins/web-search.js +45 -9
- package/dist/plugins/workflow-journal-limits.d.ts +10 -0
- package/dist/plugins/workflow-journal-limits.js +10 -0
- package/dist/plugins/workflow-journal-store-sql.d.ts +78 -0
- package/dist/plugins/workflow-journal-store-sql.js +59 -3
- package/dist/plugins/workflow-run-store-sql.d.ts +84 -0
- package/dist/plugins/workflow-run-store-sql.js +84 -6
- package/dist/plugins/worktree-isolation.d.ts +45 -0
- package/dist/plugins/worktree-isolation.js +105 -6
- package/dist/plugins/write-behind-counter.d.ts +56 -1
- package/dist/plugins/write-behind-counter.js +53 -14
- package/dist/principal-jwt.d.ts +24 -0
- package/dist/principal-jwt.js +60 -5
- package/dist/project-memory.d.ts +22 -0
- package/dist/project-memory.js +144 -15
- package/dist/prompts-domain-validate.d.ts +28 -0
- package/dist/prompts-domain-validate.js +42 -1
- package/dist/question.d.ts +33 -0
- package/dist/question.js +69 -2
- package/dist/resource-suspend.d.ts +21 -0
- package/dist/resource-suspend.js +16 -0
- package/dist/router/route-orchestration.d.ts +78 -0
- package/dist/router/route-orchestration.js +77 -0
- package/dist/run-local.d.ts +32 -0
- package/dist/run-local.js +172 -8
- package/dist/runs.d.ts +189 -4
- package/dist/runs.js +465 -24
- package/dist/runtime-caps-resolver.d.ts +106 -0
- package/dist/runtime-caps-resolver.js +89 -4
- package/dist/runtime-governance.d.ts +84 -0
- package/dist/runtime-governance.js +127 -1
- package/dist/sandbox-pkg-source.d.ts +23 -0
- package/dist/sandbox-pkg-source.js +37 -0
- package/dist/sealed-key.d.ts +54 -0
- package/dist/sealed-key.js +68 -3
- package/dist/security.d.ts +108 -0
- package/dist/security.js +145 -6
- package/dist/sema-registry.d.ts +21 -0
- package/dist/sema-registry.js +21 -0
- package/dist/session-leaf-bus.d.ts +31 -0
- package/dist/session-leaf-bus.js +32 -0
- package/dist/session-sync-content.d.ts +46 -0
- package/dist/session-sync-content.js +47 -1
- package/dist/session-sync-kernel.d.ts +89 -0
- package/dist/session-sync-kernel.js +48 -3
- package/dist/session-sync.d.ts +125 -0
- package/dist/session-sync.js +181 -8
- package/dist/session-titler.d.ts +26 -0
- package/dist/session-titler.js +41 -7
- package/dist/session-watch.d.ts +53 -1
- package/dist/session-watch.js +73 -9
- package/dist/sighup-idle.d.ts +30 -0
- package/dist/sighup-idle.js +12 -1
- package/dist/spec-fields.d.ts +91 -3
- package/dist/spec-fields.js +116 -4
- package/dist/task-cwd.d.ts +50 -0
- package/dist/task-cwd.js +68 -1
- package/dist/task-mcp.d.ts +47 -0
- package/dist/task-mcp.js +29 -0
- package/dist/task-settings.d.ts +175 -0
- package/dist/task-settings.js +226 -11
- package/dist/task-workflow.d.ts +67 -0
- package/dist/task-workflow.js +75 -8
- package/dist/tool-approval.d.ts +91 -0
- package/dist/tool-approval.js +215 -0
- package/dist/trace/artifacts.d.ts +9 -0
- package/dist/trace/artifacts.js +30 -5
- package/dist/trace/core-keyset-guard.d.ts +18 -0
- package/dist/trace/ledger-sink.d.ts +43 -0
- package/dist/trace/ledger-sink.js +64 -5
- package/dist/trace/project.d.ts +133 -0
- package/dist/trace/project.js +189 -2
- package/dist/trace/redact.d.ts +19 -0
- package/dist/trace/redact.js +66 -9
- package/dist/usage-analytics.d.ts +26 -0
- package/dist/usage-analytics.js +26 -3
- package/package.json +1 -1
package/dist/runs.d.ts
CHANGED
|
@@ -7,6 +7,44 @@ import type { ElicitationCoordinator } from "./elicitation.js";
|
|
|
7
7
|
import type { QuestionCoordinator } from "./question.js";
|
|
8
8
|
import { type FleetRunPublisher } from "./fleet/fleet-bus.js";
|
|
9
9
|
import { type WorkflowCompletionInbox } from "./orchestration/workflow-completion-inbox.js";
|
|
10
|
+
/**
|
|
11
|
+
* stoppedBy (core 1.252): a service cancel is a USER stop — mark the run's still-running background
|
|
12
|
+
* children BEFORE core's teardown reaps them (bare abort = attribution falls back to "system"; core's own
|
|
13
|
+
* reap marks "parent", but first-marker-wins means our earlier "user" is the one that lands). Register this
|
|
14
|
+
* FIRST on the cancel signal so it runs ahead of any later-registered core listener (listener-order
|
|
15
|
+
* guarantee); one registration covers every abort route on that signal (same-replica fast path + the
|
|
16
|
+
* cross-replica flag poll). Advisory only — the cancel itself must never fail on attribution.
|
|
17
|
+
*
|
|
18
|
+
* Access = TASK-scoped children ONLY: owner = the parent taskId (on a RESUME leg: the sessionId — core's
|
|
19
|
+
* canonical taskId there), scope = `principal ?? "default"` (core registers children under
|
|
20
|
+
* `spec.principal ?? "default"`, so an anonymous run's children live in scope "default" and an access
|
|
21
|
+
* WITHOUT scope matched nothing). Session-scoped children are DELIBERATELY not marked: a cancelled parent
|
|
22
|
+
* does NOT take them down (CC Backgrounded semantics — core's teardown reaps with skipSessionScoped), so
|
|
23
|
+
* pre-marking them "user" would misattribute a stop that isn't happening.
|
|
24
|
+
*
|
|
25
|
+
* core 1.256: `markStopSourceForOwner` replaces the old `list()+markStopSource`
|
|
26
|
+
* per-row loop, closing BOTH documented holes — ① the EXPLICIT `sessionScoped` flag
|
|
27
|
+
* (`skipSessionScoped:true`) makes the resume leg safe (its owner key == sessionId COINCIDES with
|
|
28
|
+
* session-scoped children's; the old code couldn't tell them apart and took an honest degrade instead),
|
|
29
|
+
* ② a direct handle-map walk (no `list()` 500-row display cap under-marking >500-children runs). Covers
|
|
30
|
+
* core's full markable set (background_agent / background_bash / monitor); running-only +
|
|
31
|
+
* first-marker-wins guards live inside the seam.
|
|
32
|
+
*/
|
|
33
|
+
/** [1488]③(b) + codex R2: the bg agent-handle OUTPUT read, kind-gated BEFORE any poll. `pollTask` is the
|
|
34
|
+
* generic registry face and polling is NOT side-effect-free for other kinds — a terminal workflow poll
|
|
35
|
+
* fires `onServedTerminal` (acknowledges the completion as served → suppresses its notification) and a
|
|
36
|
+
* bash poll advances the output cursor. `getAccessibleTask` is a pure lookup: resolve + access-check +
|
|
37
|
+
* type-check FIRST; only a `background_agent` row is ever polled (non-blocking). Everything else returns
|
|
38
|
+
* the registry's own not_found shape, indistinguishable from an unknown handle (the route 404s it).
|
|
39
|
+
*
|
|
40
|
+
* 1.250 durable arm (core 1.364, [1511] follow-up delivered): a FULL in-process miss (`!row`) falls
|
|
41
|
+
* through to `pollTask(…, { agentStore })` — core's durable arm only fires for `a*`-shaped handles
|
|
42
|
+
* (DURABLE_AGENT_HANDLE_RE) behind `canAccessAgentRecord`, and with NO in-process handle the live
|
|
43
|
+
* workflow/bash branches are unreachable, so the kind-gate's reason (onServedTerminal / cursor advance)
|
|
44
|
+
* cannot trigger. Terminal rows serve the durable snapshot cross-instance/post-restart; a foreign-writer
|
|
45
|
+
* running row answers the honest "outcome unknown here"; anything else is core's own not_found (byte-same
|
|
46
|
+
* route 404 as today). A row that IS in-process but of the wrong type stays a hard 404 — the process
|
|
47
|
+
* knows the truth, falling back would sidestep the kind gate. */
|
|
10
48
|
export declare function backgroundAgentOutput(registry: typeof defaultTaskRegistry, handle: string, access: {
|
|
11
49
|
owner: string;
|
|
12
50
|
scope: string;
|
|
@@ -23,6 +61,15 @@ export declare function taskHandleOutput(registry: typeof defaultTaskRegistry, h
|
|
|
23
61
|
content: string;
|
|
24
62
|
details: unknown;
|
|
25
63
|
}>;
|
|
64
|
+
/** [1499] CC TaskStop 人侧对位 — stop a background task handle (bash kill / monitor stop / agent abort).
|
|
65
|
+
* Same kind gate as the read face (a workflow stops via its own cancel face, never this verb). stopTask is
|
|
66
|
+
* idempotent on a terminal handle (the registry answers honestly); the stop is attributed "user" via the
|
|
67
|
+
* registry's existing markStopSource machinery (an HTTP stop is the human's hand — parity with the shell's
|
|
68
|
+
* TaskStop attribution). The pre-mark is first-write-wins and MUST come first (core's own stop path marks
|
|
69
|
+
* "parent" internally — marking after would lose the attribution race on success, the common path); the
|
|
70
|
+
* trade (codex R3) is that on a kill-that-didn't-land the pending "user" mark is not clearable through the
|
|
71
|
+
* public registry face — the route surfaces that arm as 409 stop.not_landed, and the atomic fix (a `source`
|
|
72
|
+
* option on stopTask) is a core ask. */
|
|
26
73
|
export declare function taskHandleStop(registry: typeof defaultTaskRegistry, handle: string, access: {
|
|
27
74
|
owner: string;
|
|
28
75
|
scope: string;
|
|
@@ -32,36 +79,174 @@ export declare function taskHandleStop(registry: typeof defaultTaskRegistry, han
|
|
|
32
79
|
details: unknown;
|
|
33
80
|
}>;
|
|
34
81
|
export declare function markChildrenStoppedByUserOnAbort(signal: AbortSignal, taskId: string, principal: string | null | undefined): void;
|
|
82
|
+
/**
|
|
83
|
+
* A session CAS conflict is swallowed by core into a failed `TaskResult` (it is not thrown from
|
|
84
|
+
* `runTaskStream`), so detect it from the result. Prefer the structured `errorCode` (core ≥1.8); fall
|
|
85
|
+
* back to the conflict wording only for older results without one.
|
|
86
|
+
*/
|
|
35
87
|
export declare function isSessionConflictResult(result: {
|
|
36
88
|
status: string;
|
|
37
89
|
errorMessage?: string;
|
|
38
90
|
errorCode?: string;
|
|
39
91
|
}): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* E18 resume-at CALLER error → an HTTP 4xx. A bad/stale resume-at target (the resolved entryId is gone or is not a
|
|
94
|
+
* settled message boundary) surfaces as a FAILED TaskResult carrying a `resume_at.*` errorCode (core swallows the
|
|
95
|
+
* prepare-throw into the result, exactly like a session conflict — runtask catch → status:"failed"+errorCode). The
|
|
96
|
+
* sync path otherwise 200s a failed result; map these to 4xx so a caller mistake reads as one. `not_found` (the
|
|
97
|
+
* entry is genuinely absent) → 404; everything else (not_a_message / conflicts_resume / no_session) → 422.
|
|
98
|
+
*
|
|
99
|
+
* design/114 Phase3: `requireExistingSession` on a genuinely-missing/purged session ALSO surfaces as a failed result
|
|
100
|
+
* (core prepare-task maps the store's `not_found` → `resume.session_not_found`); map it to 404 (the session is gone),
|
|
101
|
+
* the same "caller mistake reads as a 4xx, not a silent 200 fresh run" discipline.
|
|
102
|
+
*
|
|
103
|
+
* [833] rewind exclusive mode (core 1.292 resumeAtMode:"before"): its two edge rejections ride the same `resume_at.*`
|
|
104
|
+
* prefix (before_target_not_user / before_root_unsupported → 422 via the existing branch, errorCode passed through
|
|
105
|
+
* UNCHANGED for the shell). `rewind_snapshot.unresolvable` (rewindFiles + "before": no snapshot at/above the branch
|
|
106
|
+
* point) is core's third rejection with a DIFFERENT prefix — same caller-mistake shape (prepare-throw, nothing
|
|
107
|
+
* billed), map it to 422 explicitly so it doesn't fall through to a 200-with-failed body.
|
|
108
|
+
*/
|
|
40
109
|
export declare function resumeAtHttpStatus(result: {
|
|
41
110
|
status: string;
|
|
42
111
|
errorCode?: string;
|
|
43
112
|
}): number | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* E18 resume-at — per-turn anchor capture, shared by runInBackground AND the resume-leg driveResume so the (single,
|
|
115
|
+
* tricky) capture rule can't drift between the two stream-drain loops.
|
|
116
|
+
*
|
|
117
|
+
* A "turn" in core = ONE assistant message + its tool batch. resume-at is valid ONLY at a SETTLED rewindable boundary
|
|
118
|
+
* — core's prepare-task accepts "user messages or finished assistant-text turns" and REJECTS an assistant message that
|
|
119
|
+
* ends mid-tool-call (resume_at.not_a_message). So we capture an anchor ONLY for a turn that produced text AND ran NO
|
|
120
|
+
* tools: then the turn's leaf at turn_end IS that assistant-text message (the rewindable target). For a tool-using
|
|
121
|
+
* turn neither candidate works — at turn_end the leaf is the turn's LAST tool-result (core appends tool results before
|
|
122
|
+
* emitting turn_end; a tool-result is stored as a `message` so core would SILENTLY branch AFTER the tools ran), and
|
|
123
|
+
* the assistant message itself ends mid-tool-call so core would reject it. The shell still gets a per-message eventId
|
|
124
|
+
* handle on every text event (E2 identity); a rewind to a non-captured (tool-using) message simply 404s — honest,
|
|
125
|
+
* never a silent wrong-point branch. (The adversarial-review HIGH: capturing at turn_end unconditionally mis-anchored
|
|
126
|
+
* every tool-using turn — the common agentic shape — to the tool-result leaf.)
|
|
127
|
+
*
|
|
128
|
+
* Best-effort: a capture failure must NEVER fail the run (it only makes that one turn non-rewindable). `onCaptureFail`
|
|
129
|
+
* surfaces the degrade (a metric) so a SYSTEMATIC failure — e.g. an un-migrated DB missing `resume_anchor` — is
|
|
130
|
+
* observable instead of a silent feature outage.
|
|
131
|
+
*/
|
|
44
132
|
export declare class TurnAnchorCapture {
|
|
45
133
|
private readonly capture;
|
|
46
134
|
private readonly onCaptureFail?;
|
|
135
|
+
/** R8 (CC-parity rewind): capture a USER-message anchor straight from the
|
|
136
|
+
* `message_committed{role:"user"}` event — its `entryId` is the persisted user-message `SessionTreeEntry.id`,
|
|
137
|
+
* ALWAYS a valid `resumeAt` target (core accepts a user message; it rejects a tool-result / mid-tool-call
|
|
138
|
+
* assistant). This is the CC rewind target ("rewind to the prompt" = the code-restore parity path — a code
|
|
139
|
+
* change happens in a tool turn WITHIN a prompt's run, so rewinding to the prompt + rewindFiles undoes it).
|
|
140
|
+
* Keyed by the run's taskId (the handle the shell already holds from the POST response — no eventId→entryId
|
|
141
|
+
* side map / no `getLeafId` inference needed). The assistant-turn capture above stays as an additive bonus. */
|
|
47
142
|
private readonly captureUser?;
|
|
143
|
+
/** The turn's FIRST text_delta eventId = the message's stable resume handle (also stamped on the durable text event). */
|
|
48
144
|
firstTextEventId: string | undefined;
|
|
49
145
|
private turnHadTool;
|
|
50
|
-
constructor(capture: ((eventId: string) => Promise<void>) | undefined, onCaptureFail?: (() => void) | undefined,
|
|
146
|
+
constructor(capture: ((eventId: string) => Promise<void>) | undefined, onCaptureFail?: (() => void) | undefined,
|
|
147
|
+
/** R8 (CC-parity rewind): capture a USER-message anchor straight from the
|
|
148
|
+
* `message_committed{role:"user"}` event — its `entryId` is the persisted user-message `SessionTreeEntry.id`,
|
|
149
|
+
* ALWAYS a valid `resumeAt` target (core accepts a user message; it rejects a tool-result / mid-tool-call
|
|
150
|
+
* assistant). This is the CC rewind target ("rewind to the prompt" = the code-restore parity path — a code
|
|
151
|
+
* change happens in a tool turn WITHIN a prompt's run, so rewinding to the prompt + rewindFiles undoes it).
|
|
152
|
+
* Keyed by the run's taskId (the handle the shell already holds from the POST response — no eventId→entryId
|
|
153
|
+
* side map / no `getLeafId` inference needed). The assistant-turn capture above stays as an additive bonus. */
|
|
154
|
+
captureUser?: ((entryId: string) => Promise<void>) | undefined);
|
|
155
|
+
/** A `message_committed` arrived — capture a USER-message rewind anchor (CC parity). Best-effort (a failure only
|
|
156
|
+
* makes that one prompt non-rewindable). Only `role==="user"`; assistant/toolResult committed entries are handled
|
|
157
|
+
* by the turn-text path (assistant) or deliberately not anchored (toolResult — `resumeAt` rejects them). */
|
|
51
158
|
onMessageCommitted(role: string | undefined, entryId: string | undefined): Promise<void>;
|
|
159
|
+
/** A text_delta arrived — latch the first DEFINED eventId as the message handle (eventId is optional on the stream). */
|
|
52
160
|
onText(eventId: string | undefined): void;
|
|
161
|
+
/** A tool ran this turn — mark it non-rewindable (its leaf will be a tool-result, not a settled assistant-text message). */
|
|
53
162
|
onTool(): void;
|
|
163
|
+
/** turn_end — capture the anchor iff this was a settled assistant-TEXT turn, then reset for the next turn. */
|
|
54
164
|
onTurnEnd(): Promise<void>;
|
|
55
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Strip the durable-resume capability token from a result before it is persisted to the replayable event
|
|
168
|
+
* log / run row or returned to the submitter. The token IS the resume credential (token-as-auth, search
|
|
169
|
+
* [18] Q1b) and must never leave the service. Safe on any result (no-op when absent) — notably core maps a
|
|
170
|
+
* NESTED suspend under verify/cascade to status:"failed" + errorCode "unexpected.suspended" while still
|
|
171
|
+
* spreading `checkpointToken`, so that "failed" path (unlike the stream path's explicit suspend handling)
|
|
172
|
+
* would otherwise leak it into task_event / task_run.result / the sync 200 response. `checkpointGate` is
|
|
173
|
+
* non-secret and intentionally kept.
|
|
174
|
+
*/
|
|
56
175
|
export declare function stripCheckpointToken<T>(result: T): T;
|
|
176
|
+
/** Evict a stale warm-cache entry after a cross-instance write conflict (broken-affinity backstop). */
|
|
57
177
|
export declare function evictIfConflict(runner: Runner, sessionId: string | undefined, result: TaskResult): void;
|
|
178
|
+
/**
|
|
179
|
+
* Drive a task to completion in the background, persisting its events to the durable run log (S2).
|
|
180
|
+
*
|
|
181
|
+
* Text deltas are coalesced into one `text` event per turn (the durable stream is turn-grained for
|
|
182
|
+
* text); tool/lifecycle events are recorded individually. Per-token live streaming stays on the
|
|
183
|
+
* synchronous `/v1/tasks/stream` endpoint. Never throws — failures are recorded on the run.
|
|
184
|
+
*
|
|
185
|
+
* Cancellation (POST /v1/runs/:id/cancel): the run registers an AbortController in `inflight` (same-replica
|
|
186
|
+
* fast path — the cancel handler aborts it directly) and its heartbeat tick polls the durable
|
|
187
|
+
* `cancel_requested` flag (cross-replica, ≤HEARTBEAT_MS lag). Either way the run settles to
|
|
188
|
+
* status "failed" + errorCode "cancelled" (metric label "cancelled"); the entry is removed in `finally`.
|
|
189
|
+
*
|
|
190
|
+
* Preemption (POST /v1/assistant/tasks/:id/preempt, design/80 seam #2): a SECOND, INDEPENDENT controller
|
|
191
|
+
* (`preemptCtrl`, registered in `preemptable`) carries the scheduler's graceful "yield this task" — when raised,
|
|
192
|
+
* core durably SUSPENDS the task at the next clean turn boundary (gate resource_limit, reason "preempt") so it is
|
|
193
|
+
* RESUMABLE, the opposite of cancel's kill. It is wired ONLY on the plain-stream path: the verify/cascade
|
|
194
|
+
* branches finalize with `setTerminal` unconditionally (no `setSuspended`), so a preempt-suspend there would write
|
|
195
|
+
* a non-terminal "suspended" as terminal and release the session lock — and preempt's contract is graceful, not a
|
|
196
|
+
* failure. Cross-replica via the `preempt_requested` flag (same heartbeat tick). Eligibility (resourceSuspend +
|
|
197
|
+
* durable store + durable tool-results + remote env) is core's call: an ineligible task's preemptSignal no-ops.
|
|
198
|
+
*
|
|
199
|
+
* Steering (POST /v1/runs/:id/steer, design/47): the live core `TaskStream` is registered in `steerable` so the
|
|
200
|
+
* HTTP route can inject a mid-task message via `stream.steer()` (drained at the next turn boundary). Same-replica
|
|
201
|
+
* only — a suspended run is steered durably via the checkpoint's `setPendingSteer` instead, and only the
|
|
202
|
+
* plain-stream path holds a steerable stream (the verify/cascade branches return a result, not a stream).
|
|
203
|
+
*/
|
|
58
204
|
export declare function runInBackground(runner: Runner, spec: TaskSpec, runStore: RunStore, taskId: string, metrics?: Metrics, principal?: string, verify?: {
|
|
59
205
|
maxRounds: number;
|
|
60
206
|
costCeilingMicroUsd?: number;
|
|
61
|
-
},
|
|
207
|
+
}, // 快审 F1:number 参升整对象——cost 顶随传
|
|
208
|
+
cascade?: CascadeConfig, instrumentDegenerate?: (result: TaskResult) => void, planCacheProbe?: {
|
|
62
209
|
record: (scope: string | undefined, objective: string, completed: boolean) => void;
|
|
63
|
-
}, persistThinking?: boolean, inflight?: Map<string, AbortController>, preemptable?: Map<string, AbortController>, steerable?: Map<string, TaskStream>, modelUsage?: ModelUsageTracker, elicitation?: ElicitationCoordinator,
|
|
210
|
+
}, persistThinking?: boolean, inflight?: Map<string, AbortController>, preemptable?: Map<string, AbortController>, steerable?: Map<string, TaskStream>, modelUsage?: ModelUsageTracker, elicitation?: ElicitationCoordinator,
|
|
211
|
+
/** E23: the VERIFIED principal (gatedPrincipal) that may answer this run's elicitations — matches the respond
|
|
212
|
+
* owner-gate's identity source (NOT the cost-attribution `principal`, which on a direct door is the spoofable
|
|
213
|
+
* header → can be null while a JWT principal exists). Falls back to the run owner when not supplied. */
|
|
214
|
+
elicitOwner?: string | null,
|
|
215
|
+
/** E18 resume-at: capture the turn's (firstTextEventId → leaf entryId) anchor at each turn_end. Built by the caller
|
|
216
|
+
* closing over {sessionId, owner, sessionStore.getLeafId, resumeAnchorStore}; undefined ⇒ no anchor store wired. */
|
|
217
|
+
captureTurnAnchor?: (eventId: string) => Promise<void>,
|
|
218
|
+
/** MF-Fleet (shell-host contract): the run-scoped fleet-row publisher. `onStart` adds the live row; `onEvent` accrues
|
|
219
|
+
* tokens (turn_end) + subagent child rows (task_progress); `onTerminal` flips/removes it. Fired for ALL legs
|
|
220
|
+
* (verify/cascade/plain-stream) so a background run TRANSITIONS its `GET /v1/fleet/stream` row exactly like the
|
|
221
|
+
* sync leg. No-op when no fleet bus is wired (the publisher is a null-object). */
|
|
222
|
+
fleetPublisher?: FleetRunPublisher,
|
|
223
|
+
/** R8 (CC-parity rewind): capture a USER-message anchor (keyed by this run's taskId) from `message_committed{role:"user"}`
|
|
224
|
+
* — the CC "rewind to the prompt" target. undefined ⇒ no anchor store wired. */
|
|
225
|
+
captureUserMessageAnchor?: (entryId: string) => Promise<void>,
|
|
226
|
+
/** §4④ : AskUserQuestion LIVE coordinator — establishes a per-run onQuestion ALS context (like `elicitation`)
|
|
227
|
+
* so an AskUserQuestion tool call routes to this run's stream + owner-gated respond. undefined ⇒ headless default. */
|
|
228
|
+
question?: QuestionCoordinator,
|
|
229
|
+
/** P1 ①② follow-on (core): the async-workflow completion inbox, drained at the START of this background
|
|
230
|
+
* leg (parity with the sync stream-open drain) into durable `workflow_complete` events a tailing client replays.
|
|
231
|
+
* Owner gate = `elicitOwner ?? owner` (the same verified-principal-with-run-owner-fallback the elicit/question
|
|
232
|
+
* contexts use). undefined ⇒ no push half wired (the WorkflowStatus poll floor stands alone). */
|
|
233
|
+
workflowCompletionInbox?: WorkflowCompletionInbox,
|
|
234
|
+
/** C2 (core 1.219): the replica-local Task-subagent steer-handle registry. When present, this leg
|
|
235
|
+
* opts into core's `onSubagentSpawn` sink — each SYNC delegation's steer handle registers under THIS run's
|
|
236
|
+
* taskId (auto-evicted on child settle) so POST /v1/runs/:id/subagents/:target/steer can route into it. */
|
|
237
|
+
subagentSteer?: {
|
|
64
238
|
register(runId: string, handle: SubagentSteerHandle): () => void;
|
|
65
|
-
},
|
|
239
|
+
},
|
|
240
|
+
/** ask①: emit-target diagnostic sink for the completion-inbox drain below (route/connection/
|
|
241
|
+
* deliveryLagMs per delivered `workflow_complete`). runs.ts has no logger of its own — the caller closes over
|
|
242
|
+
* deps.logger. undefined ⇒ silent (behavior unchanged). */
|
|
243
|
+
completionDiagLog?: (msg: string, meta?: Record<string, unknown>) => void,
|
|
244
|
+
/** SendUserFile(切片2):per-run file_link 帧发射 ALS(question/elicitation 同款)。emit=durable append。 */
|
|
245
|
+
sendUserFile?: SendUserFileEmitter,
|
|
246
|
+
/** [998]② the shared prompt-manifest accumulator (tracer records at prepare; this leg drains the pending
|
|
247
|
+
* record into a durable `prompt_assembled` event — turns/stream read it). undefined ⇒ not wired. */
|
|
248
|
+
promptManifests?: PromptManifestTracker): Promise<void>;
|
|
249
|
+
/** How often a running instance refreshes its run's updated_at (liveness, independent of events).
|
|
250
|
+
* Must stay strictly below `runStaleSec` (asserted at startup) or the reaper would race live runs. */
|
|
66
251
|
export declare const HEARTBEAT_MS = 30000;
|
|
67
252
|
//# sourceMappingURL=runs.d.ts.map
|