@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
|
@@ -1,6 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `RemoteContainerExecutionEnv` — the E2B implementation of core's `RemoteExecutionEnv` seam
|
|
3
|
+
* (core src/core/remote-env.ts, design/48 §5). The service control plane owns this backend; core
|
|
4
|
+
* owns the seam shape (exactly like `CheckpointStore` / `SqlExecutor`).
|
|
5
|
+
*
|
|
6
|
+
* **Scope = design/48 §0.5 v1 minimal slice**: single worker, E2B managed, **Tier 2 only** (every
|
|
7
|
+
* op runs in a per-task E2B Firecracker VM — no tiering/classification), and the ~4 live seam methods
|
|
8
|
+
* `connect` / `execStream` / `workspaceHandle` / `destroy` + the base `ExecutionEnv` (FileSystem + Shell).
|
|
9
|
+
*
|
|
10
|
+
* **v1.5 (design/49, core 1.69):** `suspendVM` (E2B `pause()`) / `resumeVM` (`Sandbox.connect(id)` auto-resume)
|
|
11
|
+
* / `postResumeInit` (reachability + at-rest-encryption red line) are IMPLEMENTED — core orchestrates them when
|
|
12
|
+
* a task with this remote env hits a durable-approval `ask` (workspaceHandle → Checkpoint.state). `reconnect`
|
|
13
|
+
* (cross-replica re-attach to a still-running VM) stays deferred to **v2** (v1.5 always snapshots → resumeVM).
|
|
14
|
+
*
|
|
15
|
+
* **Provider seam discipline (self-host endgame):** every E2B SDK call is confined to this one class. A
|
|
16
|
+
* future OSS-self-hosted E2B (clay's "最终自部署" constraint) swaps the backend without touching consumers.
|
|
17
|
+
*
|
|
18
|
+
* **never-throw invariant:** the base `ExecutionEnv` contract requires every FileSystem/Shell method to
|
|
19
|
+
* encode failure in the returned `Result` (never throw). The one exception is `execStream`, whose async
|
|
20
|
+
* iterator MAY throw `RemoteExecutionError` mid-stream before an `exit` chunk (seam contract, OutputChunk).
|
|
21
|
+
*/
|
|
1
22
|
import { Sandbox, type SandboxOpts, type SandboxConnectOpts } from "e2b";
|
|
2
23
|
import { FileError, ExecutionError, RemoteExecutionError, type ExecutionEnv, type RemoteExecutionEnv, type WorkspaceHandle, type FileInfo, type Result, type OutputChunk, type ExecStreamOptions, type RemoteConnectConfig, type SnapshotId, type SessionToken, type ExecutionEnvFactory, type VmLifecycleOptions, type BackgroundShellCapability, type BackgroundShellId, type BackgroundShellError, type BackgroundSpawnOptions, type BackgroundPoll } from "@sema-agent/core";
|
|
24
|
+
/** Options accepted by `ExecutionEnv.exec` (core does not re-export the type; derive it from the seam). */
|
|
3
25
|
type ExecOpts = Parameters<ExecutionEnv["exec"]>[1];
|
|
26
|
+
/** Minimal optional observability hooks (kept structural so the adapter stays standalone-testable). */
|
|
4
27
|
export interface RemoteEnvObservers {
|
|
5
28
|
logger?: {
|
|
6
29
|
warn(msg: string, meta?: unknown): void;
|
|
@@ -10,43 +33,104 @@ export interface RemoteEnvObservers {
|
|
|
10
33
|
inc(name: string, labels?: Record<string, string>): void;
|
|
11
34
|
};
|
|
12
35
|
}
|
|
36
|
+
/** Construction config for {@link RemoteContainerExecutionEnv}. Secrets/resolved values are control-plane supplied. */
|
|
13
37
|
export interface RemoteContainerEnvConfig extends RemoteEnvObservers {
|
|
38
|
+
/** E2B API key. Resolved by the trusted control plane from env — never baked into an image or committed. */
|
|
14
39
|
apiKey: string;
|
|
40
|
+
/** E2B template id (image). Defaults to the E2B base template. */
|
|
15
41
|
template?: string;
|
|
42
|
+
/** Sandbox lifetime in ms (E2B billing window). Default {@link DEFAULT_TIMEOUT_MS}. */
|
|
16
43
|
timeoutMs?: number;
|
|
44
|
+
/** Workspace root inside the VM; remote paths normalize against it. Default {@link DEFAULT_MOUNT_PATH}. */
|
|
17
45
|
mountPath?: string;
|
|
46
|
+
/** Outbound network for the sandbox (clay: service needs external-network capability). Default `true`. */
|
|
18
47
|
allowInternetAccess?: boolean;
|
|
48
|
+
/** Sandbox metadata (e.g. sessionId/taskId for fleet observability). */
|
|
19
49
|
metadata?: Record<string, string>;
|
|
50
|
+
/**
|
|
51
|
+
* 🔴 Out-of-band secret/config env injected sandbox-WIDE at create (design/48 §5 gap 7, OA Phase-B): every
|
|
52
|
+
* command + background process in the VM sees these, but the VALUES never enter the model prompt, the tool
|
|
53
|
+
* `command` string, or the durable event log (which only records the command `args`, redacted). This is the
|
|
54
|
+
* channel for a credential (e.g. a git token the agent uses via GIT_ASKPASS / a credential helper) WITHOUT
|
|
55
|
+
* routing it through an MCP server. Resolved from the worker's OWN env by the control plane — the values live
|
|
56
|
+
* only here in memory, never logged. ⚠️ A command that *echoes* the value to stdout still lands it in the L1
|
|
57
|
+
* session history (the model reads tool output); the injection keeps it out of the prompt/command, not out of
|
|
58
|
+
* a deliberate echo — consume it without printing (GIT_ASKPASS, `git -c credential.helper`, etc.).
|
|
59
|
+
*/
|
|
20
60
|
sandboxEnv?: Record<string, string>;
|
|
61
|
+
/** 🔴 (hang class-fix) Wall-clock bound (ms) for a control-plane provider RPC — create/resume/pause/kill/
|
|
62
|
+
* isRunning/files.*. A provider hang is surfaced as a typed retryable `RemoteExecutionError("timeout")` after
|
|
63
|
+
* this, instead of pinning the worker for the sandbox lifetime. Default {@link DEFAULT_RPC_TIMEOUT_MS}. */
|
|
21
64
|
rpcTimeoutMs?: number;
|
|
65
|
+
/** 🔴 (hang class-fix) Idle/liveness bound (ms) for a command (exec/execStream): max time with NO output
|
|
66
|
+
* and not yet complete = suspected hang. Also bounds the command-creation RPC. Default {@link DEFAULT_LIVENESS_MS}. */
|
|
22
67
|
livenessMs?: number;
|
|
68
|
+
/** 🔴 Wall-clock for data-transfer/provisioning RPCs (large file io, snapshot suspend/resume,
|
|
69
|
+
* create/connect) — wider than {@link rpcTimeoutMs} so a legit multi-minute transfer is not killed. Default
|
|
70
|
+
* {@link DEFAULT_DATA_TIMEOUT_MS}. */
|
|
23
71
|
dataTimeoutMs?: number;
|
|
24
72
|
}
|
|
73
|
+
/** Minimal slice of the E2B `Sandbox` static API the adapter uses — injectable so tests pass a fake. */
|
|
25
74
|
export interface SandboxApi {
|
|
26
75
|
create(opts?: SandboxOpts): Promise<Sandbox>;
|
|
27
76
|
connect(sandboxId: string, opts?: SandboxConnectOpts): Promise<Sandbox>;
|
|
28
77
|
}
|
|
78
|
+
/** Inject the E2B SDK for tests (a fake `Sandbox`). Defaults to the real SDK. */
|
|
29
79
|
export interface RemoteContainerEnvDeps {
|
|
30
80
|
sandboxApi?: SandboxApi;
|
|
31
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* E2B-backed remote `ExecutionEnv`. **Lazy by default (v1b):** the VM is provisioned on the
|
|
84
|
+
* FIRST FileSystem/Shell/execStream call (auto `connect()`), so a task that never touches the hand pays zero
|
|
85
|
+
* cost. `connect()` may still be called explicitly (idempotent + concurrency-memoized) if the control plane
|
|
86
|
+
* wants to provision eagerly. `destroy()` on task end (the Runner calls it via `hasDestroy`); a never-used env's
|
|
87
|
+
* destroy is a no-op (nothing to kill, no bill). One container per task (design/48 §5 §7 Q7).
|
|
88
|
+
*/
|
|
32
89
|
export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv, BackgroundShellCapability {
|
|
90
|
+
/** Current working directory for relative paths (FileSystem contract; mutable, core may reassign). */
|
|
33
91
|
cwd: string;
|
|
34
92
|
private readonly cfg;
|
|
35
93
|
private readonly sandboxApi;
|
|
36
94
|
private sbx?;
|
|
95
|
+
/** 🔴 BL-31 keep-alive — the E2B sandbox lifetime is hard-capped (≈1h, {@link E2B_SANDBOX_MAX_MS}), but a long
|
|
96
|
+
* leader/repair run legitimately exceeds it. This interval RE-extends the sandbox (`setTimeout(timeoutMs)` resets
|
|
97
|
+
* the auto-kill window from now) while the env is held, so the sandbox tracks ACTUAL usage rather than dying
|
|
98
|
+
* mid-run at the cap (otherwise: a silent dead sandbox at hour 1). Cleared on destroy;
|
|
99
|
+
* a no-op while paused/destroyed. `unref`'d so it never holds the process open. */
|
|
37
100
|
private keepAlive?;
|
|
38
101
|
private handle?;
|
|
102
|
+
/** Terminal once set by {@link destroy} — never reset to false (no resurrection). Guards connect/ensureConnected
|
|
103
|
+
* and the post-await re-check in BOTH async-provision paths ({@link doConnect} and {@link doResumeVM}) against
|
|
104
|
+
* a destroy that races an in-flight provision/restore. */
|
|
39
105
|
private destroyed;
|
|
106
|
+
/** In-flight connect/resume, memoized so concurrent lazy first-use OR resume provisions exactly one VM (no double-bill). */
|
|
40
107
|
private connecting?;
|
|
108
|
+
/** Count of exec/execStream calls in flight — `suspendVM` refuses while > 0 (council #4: never snapshot a running command). */
|
|
41
109
|
private activeCommands;
|
|
110
|
+
/** True between a `suspendVM` (VM paused, external connection dead) and the next `resumeVM` reconnect. While
|
|
111
|
+
* paused, `this.sbx` still points at the (now-dead) handle, so `resumeVM`'s idempotency guard must NOT treat
|
|
112
|
+
* it as live — it has to fall through and actually `Sandbox.connect()`. Without this, a suspend→resume on the
|
|
113
|
+
* SAME env instance skips the reconnect and every later fs/exec runs against the dead VM. */
|
|
42
114
|
private paused;
|
|
43
115
|
constructor(config: RemoteContainerEnvConfig, deps?: RemoteContainerEnvDeps);
|
|
116
|
+
/** design/61 §9: E2B is a FULL RemoteExecutionEnv — an isolated, snapshot-suspendable microVM. (SSH/ADB
|
|
117
|
+
* adapters declare {isolation:false, suspendable:false} — real machines/devices, not snapshotable.) */
|
|
44
118
|
readonly capabilities: {
|
|
45
119
|
isolation: boolean;
|
|
46
120
|
suspendable: boolean;
|
|
47
121
|
};
|
|
48
122
|
workspaceHandle(): WorkspaceHandle;
|
|
123
|
+
/**
|
|
124
|
+
* Public host for a port inside the sandbox (E2B reverse proxy → `<port>-<id>.e2b.app`). The LSP sidecar
|
|
125
|
+
* (design/64 §13.1) uses this to reach the in-sandbox language-server WS bridge over `wss://`. Lazily
|
|
126
|
+
* provisions the VM (like exec/fs); `undefined` if it can't connect → the LSP manager degrades.
|
|
127
|
+
*/
|
|
49
128
|
getHost(port: number): Promise<string | undefined>;
|
|
129
|
+
/**
|
|
130
|
+
* Launch a long-running process as a TRUE E2B background command (resolves once launched, E2B keeps it alive)
|
|
131
|
+
* — for the LSP bridge (design/64 §13.1). NOT the same as `exec` with a shell `&`: E2B reaps a foreground
|
|
132
|
+
* command's process group on completion, which would kill an in-shell `&`/nohup child. Fire-and-forget.
|
|
133
|
+
*/
|
|
50
134
|
startBackground(command: string): Promise<void>;
|
|
51
135
|
connect(config?: RemoteConnectConfig): Promise<{
|
|
52
136
|
ok: true;
|
|
@@ -56,6 +140,12 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
56
140
|
error: RemoteExecutionError;
|
|
57
141
|
}>;
|
|
58
142
|
private doConnect;
|
|
143
|
+
/**
|
|
144
|
+
* v1.5 (design/49): snapshot the workspace via E2B `pause()` (stores fs+memory+process; the snapshot id IS
|
|
145
|
+
* the sandbox id — a paused E2B sandbox is resumed by its id). Atomic contract (council): on failure the VM
|
|
146
|
+
* is left UNTOUCHED (still running) so core can fall back to onAsk. Refuses if a command is in flight
|
|
147
|
+
* (council #4) — never silently snapshot a running command. `abortSignal` bounds a hung pause (council BUG#2).
|
|
148
|
+
*/
|
|
59
149
|
suspendVM(options?: VmLifecycleOptions): Promise<{
|
|
60
150
|
ok: true;
|
|
61
151
|
value: SnapshotId;
|
|
@@ -63,6 +153,12 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
63
153
|
ok: false;
|
|
64
154
|
error: RemoteExecutionError;
|
|
65
155
|
}>;
|
|
156
|
+
/**
|
|
157
|
+
* v1.5: restore from a snapshot via E2B `Sandbox.connect(snapshotId)` (auto-resumes a paused sandbox).
|
|
158
|
+
* Idempotent: a no-op if already on that sandbox. Concurrent resume/connect for the same snapshot share ONE
|
|
159
|
+
* provision (memoized via `connecting`, like {@link connect}) so a racing call never double-creates a billable
|
|
160
|
+
* VM (council #3). `abortSignal` bounds a hung restore.
|
|
161
|
+
*/
|
|
66
162
|
resumeVM(snapshotId: SnapshotId, options?: VmLifecycleOptions): Promise<{
|
|
67
163
|
ok: true;
|
|
68
164
|
value: WorkspaceHandle;
|
|
@@ -71,6 +167,7 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
71
167
|
error: RemoteExecutionError;
|
|
72
168
|
}>;
|
|
73
169
|
private doResumeVM;
|
|
170
|
+
/** Cross-replica re-attach to a still-running VM = v2 (design/49 council #15: v1.5 always snapshots→resumeVM). */
|
|
74
171
|
reconnect(_sessionToken: SessionToken): Promise<{
|
|
75
172
|
ok: true;
|
|
76
173
|
value: WorkspaceHandle;
|
|
@@ -78,6 +175,13 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
78
175
|
ok: false;
|
|
79
176
|
error: RemoteExecutionError;
|
|
80
177
|
}>;
|
|
178
|
+
/**
|
|
179
|
+
* v1.5: re-establish consistency after resumeVM. The resumed VM is restored to its paused state (fs+memory+
|
|
180
|
+
* process); this verifies it is reachable. Per-command secrets are re-applied automatically (this adapter
|
|
181
|
+
* injects envs per command, not persistently). The VM-internal agent rebuilds its own external connections
|
|
182
|
+
* (git/API don't survive pause). 🔴 At-rest snapshot encryption is the provider's here (E2B managed) — a
|
|
183
|
+
* self-hosted E2B (v2) MUST guarantee it before any secret injection (remote-env.ts §5 red line).
|
|
184
|
+
*/
|
|
81
185
|
postResumeInit(): Promise<{
|
|
82
186
|
ok: true;
|
|
83
187
|
value: void;
|
|
@@ -85,6 +189,9 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
85
189
|
ok: false;
|
|
86
190
|
error: RemoteExecutionError;
|
|
87
191
|
}>;
|
|
192
|
+
/** BL-31 — (re)start the periodic sandbox-lifetime extension. `setTimeout(timeoutMs)` resets the auto-kill window
|
|
193
|
+
* from now; we re-arm at ~80% of the (clamped, ≤1h) window so a long-held sandbox never expires mid-run. A no-op
|
|
194
|
+
* when paused/destroyed; `unref`'d so it never keeps the process alive; cleared on destroy. */
|
|
88
195
|
private startKeepAlive;
|
|
89
196
|
private stopKeepAlive;
|
|
90
197
|
destroy(): Promise<void>;
|
|
@@ -128,6 +235,9 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
128
235
|
appendFile(p: string, content: string | Uint8Array, abortSignal?: AbortSignal): Promise<Result<void, FileError>>;
|
|
129
236
|
fileInfo(p: string, abortSignal?: AbortSignal): Promise<Result<FileInfo, FileError>>;
|
|
130
237
|
listDir(p: string, abortSignal?: AbortSignal): Promise<Result<FileInfo[], FileError>>;
|
|
238
|
+
/** 见其余 shell 腿上同名方法的旁注(2026-07-25 六腿补齐):core 的敏感路径门在 `canonicalPath` 失败时退到它;
|
|
239
|
+
* 缺它 ⇒ 合法的悬空链接让整个工具调用失败。必须返回**原始链接目标**(`readlink` 不带 `-f`)。
|
|
240
|
+
* 本腿的文件面也走 `exec`(与 canonicalPath 同通道),所以实现方式与 shell 腿一致。 */
|
|
131
241
|
readLink(p: string, abortSignal?: AbortSignal): Promise<Result<string, FileError>>;
|
|
132
242
|
canonicalPath(p: string, abortSignal?: AbortSignal): Promise<Result<string, FileError>>;
|
|
133
243
|
exists(p: string, abortSignal?: AbortSignal): Promise<Result<boolean, FileError>>;
|
|
@@ -147,9 +257,35 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
147
257
|
abortSignal?: AbortSignal;
|
|
148
258
|
}): Promise<Result<string, FileError>>;
|
|
149
259
|
private resolve;
|
|
260
|
+
/**
|
|
261
|
+
* 🔴 (hang class-fix) Bound a CONTROL-PLANE provider RPC (create/resume/pause/kill/isRunning/files.*) with a
|
|
262
|
+
* client-side wall-clock deadline + the caller's AbortSignal. Without this, an E2B RPC that hangs (the original
|
|
263
|
+
* bug: ESTABLISHED socket, no response) pins the worker for the whole sandbox lifetime. On deadline we abort the
|
|
264
|
+
* op and throw a typed, retryable {@link RemoteExecutionError} code `"timeout"` (caller retries per idempotency —
|
|
265
|
+
* the adapter NEVER blind-retries). A caller AbortSignal still aborts independently (op surfaces it / "aborted").
|
|
266
|
+
*/
|
|
150
267
|
private rpc;
|
|
268
|
+
/**
|
|
269
|
+
* Per-command wall-clock for the E2B SDK (seconds→ms). 🔴 This is a PHYSICAL CAP, NOT the hang
|
|
270
|
+
* detector. The old code returned `this.cfg.timeoutMs` (the sandbox lifetime) when no `timeout` was given AND
|
|
271
|
+
* had no liveness check → a hung command waited the WHOLE lifetime (~30 min, the original hang bug). The fix is
|
|
272
|
+
* NOT to shorten this cap (that would spuriously kill a long-but-progressing `npm ci`) — it's to add a LIVENESS
|
|
273
|
+
* bound ({@link cfg.livenessMs}) in exec/execStream that catches a *zero-progress* command in ~livenessMs,
|
|
274
|
+
* independent of this cap. So: explicit caller `timeout` wins; else the lifetime is the cap (a command can't
|
|
275
|
+
* outlive its VM) but hang detection no longer depends on it.
|
|
276
|
+
*/
|
|
151
277
|
private commandTimeoutMs;
|
|
278
|
+
/**
|
|
279
|
+
* 🔴 Liveness for the buffered exec WAIT phase. `handle.wait()` is a long-poll with no read timeout —
|
|
280
|
+
* a command that hangs DURING execution (not creation) would otherwise wait the E2B command timeout (= the
|
|
281
|
+
* lifetime when none is set, the original hang bug). Races wait() against an idle check: if no stdout/stderr for
|
|
282
|
+
* `livenessMs`, the command is hung → kill + typed retryable "timeout". `lastProgress()` is bumped by the
|
|
283
|
+
* stdout/stderr callbacks, so a slow-but-PROGRESSING command (long `npm ci`) is never killed. (execStream has
|
|
284
|
+
* its own chunk-driven idle timer; this is the buffered-exec analogue.)
|
|
285
|
+
*/
|
|
152
286
|
private waitWithLiveness;
|
|
287
|
+
/** Lazily provision the VM on first use: a task that never touches the hand pays zero cost.
|
|
288
|
+
* Concurrent first-calls share one provision via the memoized {@link connect}. */
|
|
153
289
|
private ensureConnected;
|
|
154
290
|
private fsReady;
|
|
155
291
|
private tempResult;
|
|
@@ -158,6 +294,16 @@ export declare class RemoteContainerExecutionEnv implements RemoteExecutionEnv,
|
|
|
158
294
|
private execError;
|
|
159
295
|
private remoteError;
|
|
160
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* Build the deployment-level `RunnerDeps.executionEnvFactory` (design/48 v1b). Wiring this onto a
|
|
299
|
+
* deployment makes it a "code-agent worker": every task's hand runs in a per-task E2B VM. Deployments that do
|
|
300
|
+
* NOT set this (e.g. OA / review) keep the in-process stub env — routing is **deployment-level** (the factory
|
|
301
|
+
* ctx carries only sessionId/taskId, never a service scenario; that stays out of the generic core seam).
|
|
302
|
+
*
|
|
303
|
+
* The factory returns the env **unconnected** (lazy): the VM is provisioned on first FS/Shell/execStream use,
|
|
304
|
+
* so a task that never touches the hand (e.g. a leader that only plans) pays zero VM cost. The Runner owns the
|
|
305
|
+
* lifetime and calls `destroy()` on task end (via `hasDestroy`); a never-used env's destroy is a no-op.
|
|
306
|
+
*/
|
|
161
307
|
export declare function e2bExecutionEnvFactory(config: RemoteContainerEnvConfig, deps?: RemoteContainerEnvDeps): ExecutionEnvFactory;
|
|
162
308
|
export {};
|
|
163
309
|
//# sourceMappingURL=remote-env-e2b.d.ts.map
|