@sema-agent/server 1.323.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/budget-tracing.d.ts +48 -0
- package/dist/boot/budget-tracing.js +86 -0
- package/dist/boot/config-center.d.ts +62 -0
- package/dist/boot/config-center.js +995 -0
- package/dist/boot/coordinators.d.ts +33 -0
- package/dist/boot/coordinators.js +97 -0
- package/dist/boot/execution-env.d.ts +26 -0
- package/dist/boot/execution-env.js +370 -0
- package/dist/boot/leader.d.ts +27 -0
- package/dist/boot/leader.js +81 -0
- package/dist/boot/reapers.d.ts +53 -0
- package/dist/boot/reapers.js +252 -0
- package/dist/boot/resolve-spec.d.ts +70 -0
- package/dist/boot/resolve-spec.js +1072 -0
- package/dist/boot/runner-deps.d.ts +101 -0
- package/dist/boot/runner-deps.js +343 -0
- package/dist/boot/runtime-caps.d.ts +21 -0
- package/dist/boot/runtime-caps.js +62 -0
- package/dist/boot/session-faces.d.ts +57 -0
- package/dist/boot/session-faces.js +157 -0
- package/dist/boot/shutdown.d.ts +50 -0
- package/dist/boot/shutdown.js +129 -0
- package/dist/boot/stores.d.ts +32 -0
- package/dist/boot/stores.js +361 -0
- package/dist/boot/workflow-orchestration.d.ts +46 -0
- package/dist/boot/workflow-orchestration.js +150 -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 +585 -1
- package/dist/config.d.ts +78 -2
- package/dist/config.js +874 -301
- 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 +530 -2129
- 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 +58 -2
- 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,9 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* collab → named-workflow projection — 翻译层**切片 1.5**(design/140 统一解:
|
|
3
|
+
* 「模式=内置命名 workflow profile,一期零新引擎机制」;core 1.263.0 三件落地后的靶点切换)。
|
|
4
|
+
*
|
|
5
|
+
* 切片① 的 runTeamDiscussion 投影(collab-project.ts)已随本切片**整体替换**(同款纪律:别留双路径
|
|
6
|
+
* 降级)。新形态:每个可投影的 CollabTemplate 翻译成一条**命名 workflow 注册条目**——
|
|
7
|
+
*
|
|
8
|
+
* `Workflow({name: <collab id>})` ⇒ 执行体 = core 内置 `TEAM_DISCUSSION_SCRIPT`(pure script content,
|
|
9
|
+
* 零新机制)+ `defaultArgs` = 本模板的 slots/rounds/finalizer 翻译(args 合并链第二级:调用时 args >
|
|
10
|
+
* 本注册 defaults > 脚本内置兜底,core `mergeWorkflowArgs` 在 tool-resolve 时点快照)。center「只配模式
|
|
11
|
+
* 各 slot 的模型」的拍板意图恰好=defaultArgs 这一级;调用者仍可用 args.topic/members 覆盖。
|
|
12
|
+
*
|
|
13
|
+
* 可投影子集(团队讨论 profile 能忠实执行的语义;其余整条跳过+结构化上报,绝不静默降级):
|
|
14
|
+
* topology ∈ {ring, pair}(round-based 顺序发言=脚本真实形态;star/layered 等 core 后续 profile)∧
|
|
15
|
+
* finalizer.type = "summarize"(→脚本 finalizer;judge/vote/fuse/verify 裁决族=后续 profile)∧
|
|
16
|
+
* sharedContext = {transcript, session} ∧ 全 slot 无 tools(工具绑定=执行面后续)。
|
|
17
|
+
*
|
|
18
|
+
* 语义注记(投影成功但记录):脚本对 members cap 6 / rounds cap 5(确定性截断)——超界模板照投+note;
|
|
19
|
+
* CollabTemplate.budget=模板级预算无 per-name workflow 通道(WorkflowLimits 是部署级、per-child 强制轴
|
|
20
|
+
* 已有)→ 记 note,引擎 budget 硬顶+部署 maxTask* 闸兜底(与切片① 结论一致)。
|
|
21
|
+
*
|
|
22
|
+
* 纯函数投影 + 模块级可变注册表(registerTeams 同款单例姿势,applyEffective boot+refresh 热更);
|
|
23
|
+
* 消费点 = main.ts 的 composite WorkflowScriptStore(resolveName 先查这里——**同名 SHADOW core 内置**,
|
|
24
|
+
* design/140 §6 1c 契约)。
|
|
25
|
+
*/
|
|
1
26
|
import { TEAM_DISCUSSION_SCRIPT } from "@sema-agent/core";
|
|
2
27
|
export function projectCollabToWorkflows(templates) {
|
|
3
28
|
const out = { workflows: {}, skipped: [], notes: [] };
|
|
4
29
|
for (const t of templates ?? []) {
|
|
5
30
|
if (t.enabled === false)
|
|
6
|
-
continue;
|
|
31
|
+
continue; // 运营态关闭(不进 skipped)
|
|
7
32
|
if (t.topology !== "ring" && t.topology !== "pair") {
|
|
8
33
|
out.skipped.push({ id: t.id, reason: `topology "${t.topology}" awaits a dedicated profile (design/140 follow-on)` });
|
|
9
34
|
continue;
|
|
@@ -22,11 +47,17 @@ export function projectCollabToWorkflows(templates) {
|
|
|
22
47
|
out.skipped.push({ id: t.id, reason: "slot tools binding awaits the execution slice" });
|
|
23
48
|
continue;
|
|
24
49
|
}
|
|
50
|
+
// finalizer.slot → 脚本 finalizer(该席位退出讨论席)。slot **未配** ⇒ 脚本内置综合官兜底(合法形态);
|
|
51
|
+
// slot 配了但**悬空**(指向不存在的席位——拼错/编辑漂移)⇒ 整条跳过(静默回退默认综合官
|
|
52
|
+
// = 模板意图被悄悄改写,违「绝不静默降级」纪律;center zod 不做跨字段存在性校验,这里是唯一防线)。
|
|
25
53
|
const finSlot = t.finalizer.slot !== undefined ? t.slots.find((s) => s.id === t.finalizer.slot) : undefined;
|
|
26
54
|
if (t.finalizer.slot !== undefined && finSlot === undefined) {
|
|
27
55
|
out.skipped.push({ id: t.id, reason: `finalizer.slot "${t.finalizer.slot}" does not match any slot id (dangling reference)` });
|
|
28
56
|
continue;
|
|
29
57
|
}
|
|
58
|
+
// 对抗评审 2026-07-11(MED):finalizer slot 合法可为 cardinality-N 多成员(registry-core 只约束
|
|
59
|
+
// cardinality=1 ≤1 人),但 team-discussion 的 finalizer 是单席——members[1..] 无席可坐。不静默丢人:
|
|
60
|
+
// 首成员任综合官,其余 note 上报(与 cap 截断同款有损注记纪律)。
|
|
30
61
|
if ((finSlot?.members?.length ?? 0) > 1) {
|
|
31
62
|
out.notes.push({ id: t.id, note: `finalizer slot "${finSlot.id}" carries ${finSlot.members.length} members — only the first seats as the synthesizer (single-seat finalizer profile)` });
|
|
32
63
|
}
|
|
@@ -35,6 +66,10 @@ export function projectCollabToWorkflows(templates) {
|
|
|
35
66
|
const finalizer = finPrompt !== undefined || finModel !== undefined
|
|
36
67
|
? { ...(finPrompt !== undefined ? { prompt: finPrompt } : {}), ...(finModel !== undefined ? { model: finModel } : {}) }
|
|
37
68
|
: undefined;
|
|
69
|
+
// 讨论席展开(cardinality "N" 逐成员出席,role 序号唯一;member 镜头 > slot 镜头;T1 modelRef 缺省=
|
|
70
|
+
// 不设 model ⇒ 脚本/引擎跟随调用者当前模型,零特判)。members 为空的席位=slot 镜头即人设,一人出席。
|
|
71
|
+
// cardinality 声明与 members 实况分叉(=1 却配了多成员)不静默 flatten——全员照展开
|
|
72
|
+
// (丢成员=更糟的静默降级)但 note 上报,center 编辑面可据此标注修正。
|
|
38
73
|
const members = [];
|
|
39
74
|
for (const s of t.slots) {
|
|
40
75
|
if (s === finSlot)
|
|
@@ -59,6 +94,8 @@ export function projectCollabToWorkflows(templates) {
|
|
|
59
94
|
defaultArgs: { members, rounds: t.rounds.max, ...(finalizer ? { finalizer } : {}) },
|
|
60
95
|
listing: {
|
|
61
96
|
name: t.id,
|
|
97
|
+
// description=center 起的显示名+描述(工具卡人话);whenToUse 留给 center 未来字段——缺席时
|
|
98
|
+
// 工具卡回落 description(core workflowWhenToUseText 链)。
|
|
62
99
|
description: [t.name, t.description].filter(Boolean).join(" — ") || t.id,
|
|
63
100
|
},
|
|
64
101
|
};
|
|
@@ -75,15 +112,21 @@ export function projectCollabToWorkflows(templates) {
|
|
|
75
112
|
}
|
|
76
113
|
return out;
|
|
77
114
|
}
|
|
115
|
+
// ── 模块级注册表(registerTeams 同款可变单例;applyEffective boot+refresh 热更,非粘:整表替换)────────
|
|
78
116
|
let REGISTRY = {};
|
|
79
117
|
export function registerCollabWorkflows(workflows) {
|
|
80
118
|
REGISTRY = { ...workflows };
|
|
81
119
|
}
|
|
120
|
+
/** composite WorkflowScriptStore 的 resolveName 前段:collab 命中 ⇒ 内置 team-discussion 脚本+本模板
|
|
121
|
+
* defaultArgs(同名 SHADOW core 内置,design/140 §6 1c)。🔴 Object.hasOwn — `name` 是模型供给的
|
|
122
|
+
* (run-workflow-tool 原样传 rawName):裸索引会让 Object.prototype 成员名("constructor"/"toString"/
|
|
123
|
+
* "__proto__"…)假命中 ⇒ 零模板注册也能烧真讨论、且同名文件 store 条目被遮蔽(对抗评审 2026-07-11 MED)。 */
|
|
82
124
|
export function resolveCollabWorkflow(name) {
|
|
83
125
|
if (!Object.hasOwn(REGISTRY, name))
|
|
84
126
|
return undefined;
|
|
85
127
|
return { script: TEAM_DISCUSSION_SCRIPT, defaultArgs: REGISTRY[name].defaultArgs };
|
|
86
128
|
}
|
|
129
|
+
/** composite store 的 list() 段(同步——workflow 工具卡只吃同步 list,core 契约注释)。 */
|
|
87
130
|
export function listCollabWorkflows() {
|
|
88
131
|
return Object.values(REGISTRY).map((e) => e.listing);
|
|
89
132
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { ToolSpec } from "@sema-agent/core";
|
|
2
|
+
/**
|
|
3
|
+
* OA scenario — tools are thin HTTP clients to the OA backend's existing APIs (read = /api/v1/*,
|
|
4
|
+
* write = /api/assets/*). The shared service token + the request's principal are forwarded so OA
|
|
5
|
+
* enforces THAT end-user's RBAC + audit (the service never holds per-user creds). Decoupled: the
|
|
6
|
+
* service knows no OA schema/DB — OA stays the source of truth (its /api/v1/meta is self-describing).
|
|
7
|
+
*/
|
|
2
8
|
export interface OaCtx {
|
|
3
9
|
baseUrl: string;
|
|
4
10
|
token: string;
|
|
@@ -39,6 +39,16 @@ export function oaTools(ctx) {
|
|
|
39
39
|
return e; const x = a; return oaFetch(ctx, `/api/assets/${encodeURIComponent(x.type)}/${encodeURIComponent(x.id)}/transition`, { method: "POST", body: { to: x.to, note: x.note ?? null } }); } },
|
|
40
40
|
];
|
|
41
41
|
}
|
|
42
|
+
// OA business prompt MOVED OUT — migration complete (design/29, 2026-06-05). Persona / 工作准则 / UI
|
|
43
|
+
// markers (::FORM:: / ::GOTO:: / ::SUGGEST:: / ::ISSUE_FORM::) / 分级确认 / 报bug流程 are OA's business,
|
|
44
|
+
// and OA now injects the WHOLE thing per request via `request.systemPrompt` (it holds the service token,
|
|
45
|
+
// content is stable per OA version → cacheable prefix; page context still rides `objective`). Keeping
|
|
46
|
+
// any of it here would just DUPLICATE OA's prompt, so the base is EMPTY — single source of truth = OA.
|
|
47
|
+
// The service stays business-agnostic: it provides the oa_* tools (referenced by NAME from OA's prompt;
|
|
48
|
+
// they carry their own descriptions) and nothing else. `stablePrompt` keeps STABLE→VARIABLE order —
|
|
49
|
+
// OA's systemPrompt is appended after this (empty) base, before core's <user_memory>.
|
|
50
|
+
// (::ISSUE_FORM:: is parsed/rendered + submitted entirely by OA's frontend via OA /api/ai/issue — the
|
|
51
|
+
// service never touches it; `open_gitea_issue` remains only as the unattended/automated fallback.)
|
|
42
52
|
const OA_SYSTEM = "";
|
|
43
53
|
export const oaPrompt = stablePrompt(OA_SYSTEM);
|
|
44
54
|
//# sourceMappingURL=oa-tools.js.map
|
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
import type { PromptProvider } from "@sema-agent/core";
|
|
2
|
+
/**
|
|
3
|
+
* Build a scenario's prompt provider from just its ROLE base, on core 1.243's 提示词主权 contract:
|
|
4
|
+
* `stableSystem` returns ONLY the role layer (base + the task's own systemPrompt) and **core appends
|
|
5
|
+
* the constitution structurally** — harness/safety blocks (Truth/CYBER_RISK/URL_SAFETY), mode blocks,
|
|
6
|
+
* AND the memory safety/hygiene guidance (`constitutionBlocks`), plus the volatile `<user_memory>`
|
|
7
|
+
* tail LAST (design/12 prefix-cache discipline; guarded in CI by `assertPromptCacheFriendly`).
|
|
8
|
+
*
|
|
9
|
+
* History: the pre-1.243 seam made this helper's whole-prompt replacement silently DROP
|
|
10
|
+
* core's constitution — oa/code-review/team ran with zero safety blocks. Same batch also moved
|
|
11
|
+
* MEMORY_SAFETY/MEMORY_HYGIENE into the constitution layer, so the hand-composition this helper used
|
|
12
|
+
* to do (core 1.62, design/41) would now DOUBLE-inject them — both removed; core owns the discipline
|
|
13
|
+
* (consolidation mutual-exclusion included). This stays a thin role-layer join so scenarios don't
|
|
14
|
+
* re-implement the same two-line body five times.
|
|
15
|
+
*/
|
|
2
16
|
export declare function stablePrompt(base: string): PromptProvider;
|
|
3
17
|
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a scenario's prompt provider from just its ROLE base, on core 1.243's 提示词主权 contract:
|
|
3
|
+
* `stableSystem` returns ONLY the role layer (base + the task's own systemPrompt) and **core appends
|
|
4
|
+
* the constitution structurally** — harness/safety blocks (Truth/CYBER_RISK/URL_SAFETY), mode blocks,
|
|
5
|
+
* AND the memory safety/hygiene guidance (`constitutionBlocks`), plus the volatile `<user_memory>`
|
|
6
|
+
* tail LAST (design/12 prefix-cache discipline; guarded in CI by `assertPromptCacheFriendly`).
|
|
7
|
+
*
|
|
8
|
+
* History: the pre-1.243 seam made this helper's whole-prompt replacement silently DROP
|
|
9
|
+
* core's constitution — oa/code-review/team ran with zero safety blocks. Same batch also moved
|
|
10
|
+
* MEMORY_SAFETY/MEMORY_HYGIENE into the constitution layer, so the hand-composition this helper used
|
|
11
|
+
* to do (core 1.62, design/41) would now DOUBLE-inject them — both removed; core owns the discipline
|
|
12
|
+
* (consolidation mutual-exclusion included). This stays a thin role-layer join so scenarios don't
|
|
13
|
+
* re-implement the same two-line body five times.
|
|
14
|
+
*/
|
|
1
15
|
export function stablePrompt(base) {
|
|
2
16
|
return {
|
|
3
17
|
stableSystem: ({ userSystemPrompt }) => [base, userSystemPrompt].filter(Boolean).join("\n\n"),
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code-review council copy (bundle-data layer). Pure data — placeholders are `{name}`-style,
|
|
3
|
+
* filled by the consumer (code-review-council.ts fillPrompt). Guardrail rationale lives with the
|
|
4
|
+
* consumer's comments; this file is ONLY the words.
|
|
5
|
+
*/
|
|
6
|
+
/** The deployment-owned lens roster. Order = priority (security/correctness first = the bug-finders);
|
|
7
|
+
* the caller dials COUNT only (pickLenses), never a named subset. */
|
|
1
8
|
export declare const REVIEW_LENSES: ReadonlyArray<{
|
|
2
9
|
name: string;
|
|
3
10
|
brief: string;
|
|
4
11
|
}>;
|
|
12
|
+
/** Guardrails 2-5: evidence grounding (a CONFIDENCE signal, not a delete), requirement anchoring,
|
|
13
|
+
* bucketing, severity×confidence. */
|
|
5
14
|
export declare const GROUNDING: string;
|
|
15
|
+
/** L1 lens reviewer system prompt. Placeholders: {name} {brief} {grounding}. */
|
|
6
16
|
export declare const LENS_SYSTEM_TPL: string;
|
|
17
|
+
/** L2 peer-debate persona (guardrails 5,6). Placeholders: {name} {brief}. */
|
|
7
18
|
export declare const DEBATE_MEMBER_TPL: string;
|
|
19
|
+
/** L2 debate topic body. Placeholders: {objective} {grounding} {findings}. */
|
|
8
20
|
export declare const DEBATE_TOPIC_TPL: string;
|
|
21
|
+
/** Guardrails 4,7: arbitration is not summary — no new findings, ground/dedup/bucket/rank only. */
|
|
9
22
|
export declare const ARBITER_SYSTEM: string;
|
|
23
|
+
/** No-arbiter fallback header ({findings} appended by the consumer). */
|
|
10
24
|
export declare const ARBITER_FALLBACK_HEADER = "[council \u4EF2\u88C1\u65E0\u8F93\u51FA\u2014\u2014\u4EE5\u4E0B\u662F\u672A\u7ECF\u4EF2\u88C1\u7684\u5404 lens \u539F\u59CB\u53D1\u73B0]\n\n";
|
|
11
25
|
//# sourceMappingURL=code-review.d.ts.map
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code-review council copy (bundle-data layer). Pure data — placeholders are `{name}`-style,
|
|
3
|
+
* filled by the consumer (code-review-council.ts fillPrompt). Guardrail rationale lives with the
|
|
4
|
+
* consumer's comments; this file is ONLY the words.
|
|
5
|
+
*/
|
|
6
|
+
/** The deployment-owned lens roster. Order = priority (security/correctness first = the bug-finders);
|
|
7
|
+
* the caller dials COUNT only (pickLenses), never a named subset. */
|
|
1
8
|
export const REVIEW_LENSES = [
|
|
2
9
|
{ name: "security", brief: "authz/ownership checks, input validation, injection (SQL/command/path), secrets, unsafe deserialization, SSRF, trust boundaries" },
|
|
3
10
|
{ name: "correctness", brief: "edge cases, off-by-one, race conditions, resource leaks, missing/incorrect error paths, unhandled rejections" },
|
|
@@ -6,6 +13,8 @@ export const REVIEW_LENSES = [
|
|
|
6
13
|
{ name: "tests", brief: "are the risky paths covered? do tests assert behavior (not implementation)? missing edge-case tests" },
|
|
7
14
|
{ name: "readability", brief: "naming, dead code, duplication, misleading comments, structure — these are [DESIGN], never [BUG]" },
|
|
8
15
|
];
|
|
16
|
+
/** Guardrails 2-5: evidence grounding (a CONFIDENCE signal, not a delete), requirement anchoring,
|
|
17
|
+
* bucketing, severity×confidence. */
|
|
9
18
|
export const GROUNDING = [
|
|
10
19
|
"RULES:",
|
|
11
20
|
"1. EVIDENCE drives CONFIDENCE (it does NOT delete a finding): cite an exact `path:line` and, whenever you can, **paste the verbatim code snippet** you are flagging. A finding WITH a pasted snippet may carry full confidence/severity; a finding with only a line reference is still allowed but MUST be tagged `[unverified: line-ref only]` and capped at minor severity / low confidence (never a blocker).",
|
|
@@ -13,17 +22,21 @@ export const GROUNDING = [
|
|
|
13
22
|
"3. BUCKET: label each finding [BUG] (provably wrong against the code), [DESIGN] (subjective preference), or [QUESTION]. A design preference is NEVER a [BUG].",
|
|
14
23
|
"4. RATE each: severity (blocker/major/minor) AND confidence (high/med/low).",
|
|
15
24
|
].join("\n");
|
|
25
|
+
/** L1 lens reviewer system prompt. Placeholders: {name} {brief} {grounding}. */
|
|
16
26
|
export const LENS_SYSTEM_TPL = "You are a {name} code reviewer. Stay strictly in your lane: {brief}.\n" +
|
|
17
27
|
"Read only the files you need — repo_tree to map, then repo_read_file (just-in-time).\n\n{grounding}\n\n" +
|
|
18
28
|
'List findings in your lens only. If you find nothing solid, say "no findings".';
|
|
29
|
+
/** L2 peer-debate persona (guardrails 5,6). Placeholders: {name} {brief}. */
|
|
19
30
|
export const DEBATE_MEMBER_TPL = "You are the {name} reviewer on a review panel ({brief}). Cross-examine the findings in " +
|
|
20
31
|
"the shared transcript: CORROBORATE or REBUT others' claims in your area (raising/lowering their " +
|
|
21
32
|
"confidence), and DEFEND or WITHDRAW your own if rebutted.\n" +
|
|
22
33
|
"You MAY call repo_read_file to VERIFY ONE specific DISPUTED finding (quote the exact path:line) — do " +
|
|
23
34
|
"NOT re-review the whole repo. A finding with no path:line + code quote is invalid. Be concise.";
|
|
35
|
+
/** L2 debate topic body. Placeholders: {objective} {grounding} {findings}. */
|
|
24
36
|
export const DEBATE_TOPIC_TPL = "Cross-examine these specialist code-review findings for: {objective}\n\n{grounding}\n" +
|
|
25
37
|
"5. CONFIDENCE: peer corroboration raises it; an unrebutted rebuttal lowers it; drop findings that " +
|
|
26
38
|
"collapse under scrutiny.\n\nFindings to debate:\n\n{findings}";
|
|
39
|
+
/** Guardrails 4,7: arbitration is not summary — no new findings, ground/dedup/bucket/rank only. */
|
|
27
40
|
export const ARBITER_SYSTEM = "You are the NEUTRAL ARBITER of a code-review council. You are given findings from independent " +
|
|
28
41
|
"specialist reviewers. You do NOT add new findings and do NOT re-review. Your only job:\n" +
|
|
29
42
|
"- TIER by grounding, do NOT silently drop real findings: a finding that PASTES the code keeps its " +
|
|
@@ -35,5 +48,6 @@ export const ARBITER_SYSTEM = "You are the NEUTRAL ARBITER of a code-review coun
|
|
|
35
48
|
"Output the final review: a 2-3 line summary, then findings grouped by bucket then severity, each as " +
|
|
36
49
|
"`path:line` — the problem — a concrete fix. Never invent files or symbols. If a whole lens reported " +
|
|
37
50
|
"nothing groundable, say so rather than inventing.";
|
|
51
|
+
/** No-arbiter fallback header ({findings} appended by the consumer). */
|
|
38
52
|
export const ARBITER_FALLBACK_HEADER = "[council 仲裁无输出——以下是未经仲裁的各 lens 原始发现]\n\n";
|
|
39
53
|
//# sourceMappingURL=code-review.js.map
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sema identity — the branded role layer for the `default` scenario (bundle-data layer; wording
|
|
3
|
+
* history: neutralized — no baked model/vendor/protocol facts, because the brain
|
|
4
|
+
* stack has both OpenAI-compatible AND Anthropic-compatible legs and any baked substrate claim is the same
|
|
5
|
+
* class of lie the neutralization removed. The anti-"I am Claude" design is kept.)
|
|
6
|
+
*/
|
|
1
7
|
export declare const SEMA_IDENTITY: string;
|
|
2
8
|
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sema identity — the branded role layer for the `default` scenario (bundle-data layer; wording
|
|
3
|
+
* history: neutralized — no baked model/vendor/protocol facts, because the brain
|
|
4
|
+
* stack has both OpenAI-compatible AND Anthropic-compatible legs and any baked substrate claim is the same
|
|
5
|
+
* class of lie the neutralization removed. The anti-"I am Claude" design is kept.)
|
|
6
|
+
*/
|
|
1
7
|
export const SEMA_IDENTITY = "You are Sema, an AI agent built by the Sema team. You act through tools to get real work done.\n" +
|
|
2
8
|
"You run on a large language model chosen and configured by your operator — you are NOT Claude, NOT " +
|
|
3
9
|
"GPT, and NOT made by Anthropic or OpenAI. If asked who you are or which model you are, answer honestly " +
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in team personas (bundle-data layer) — GENERIC personas only; the business prompt is
|
|
3
|
+
* appended at call time by the consumer (team.ts), never baked in here.
|
|
4
|
+
*/
|
|
1
5
|
export declare const TEAM_PERSONAS: {
|
|
2
6
|
readonly analyst: "You analyze the task: lay out the key considerations, options, and trade-offs. Be concrete.";
|
|
3
7
|
readonly critic: "You challenge the analysis: surface gaps, wrong assumptions, risks, and stronger alternatives.";
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in team personas (bundle-data layer) — GENERIC personas only; the business prompt is
|
|
3
|
+
* appended at call time by the consumer (team.ts), never baked in here.
|
|
4
|
+
*/
|
|
1
5
|
export const TEAM_PERSONAS = {
|
|
2
6
|
analyst: "You analyze the task: lay out the key considerations, options, and trade-offs. Be concrete.",
|
|
3
7
|
critic: "You challenge the analysis: surface gaps, wrong assumptions, risks, and stronger alternatives.",
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import type { ToolSpec } from "@sema-agent/core";
|
|
2
|
+
/**
|
|
3
|
+
* Read-only repository tools backed by a Git host (Gitea) HTTP API — NOT a clone/shell on the runner.
|
|
4
|
+
*
|
|
5
|
+
* The agent reads a repo just-in-time (tree → read file → PR diff) through scoped function tools; the
|
|
6
|
+
* read token lives only in this server-side client (never in the model/sandbox), and tools are bound
|
|
7
|
+
* to exactly the repo the task was given. This is the lightweight path for code review (read + reason);
|
|
8
|
+
* running tests/linters would need a sandboxed ExecutionEnv (a deliberate future extension, not here).
|
|
9
|
+
*/
|
|
2
10
|
export interface RepoCoords {
|
|
3
11
|
owner: string;
|
|
4
12
|
repo: string;
|
|
5
13
|
}
|
|
14
|
+
/** Parse `owner/name` or a repo URL (e.g. http://host:9999/AI-Only/sema-server.git). */
|
|
6
15
|
export declare function parseRepo(input: string): RepoCoords;
|
|
16
|
+
/** Thin read-only Gitea API client. Built once at startup; bound to a repo per task. */
|
|
7
17
|
export declare class GiteaClient {
|
|
8
18
|
private readonly baseUrl;
|
|
9
19
|
private readonly token?;
|
|
@@ -15,5 +25,6 @@ export declare class GiteaClient {
|
|
|
15
25
|
readFile(coords: RepoCoords, path: string, ref: string): Promise<string>;
|
|
16
26
|
pullDiff(coords: RepoCoords, index: number): Promise<string>;
|
|
17
27
|
}
|
|
28
|
+
/** Build the read-only repo tool set bound to one repo (cheap per-task closure; the client is shared). */
|
|
18
29
|
export declare function repoToolsFor(client: GiteaClient, coords: RepoCoords): ToolSpec[];
|
|
19
30
|
//# sourceMappingURL=repo-tools.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
|
+
/** Parse `owner/name` or a repo URL (e.g. http://host:9999/AI-Only/sema-server.git). */
|
|
2
3
|
export function parseRepo(input) {
|
|
3
4
|
const s = input.trim().replace(/\.git$/, "");
|
|
4
5
|
const m = /^[a-z]+:\/\/[^/]+\/(.+)$/i.exec(s);
|
|
@@ -10,7 +11,9 @@ export function parseRepo(input) {
|
|
|
10
11
|
}
|
|
11
12
|
const MAX_FILE_BYTES = 96 * 1024;
|
|
12
13
|
const MAX_TREE_ENTRIES = 2000;
|
|
14
|
+
/** Bound each Git-host call so a slow/hung host can't pin a review lens to its whole deadline. */
|
|
13
15
|
const REQUEST_TIMEOUT_MS = 15_000;
|
|
16
|
+
/** Thin read-only Gitea API client. Built once at startup; bound to a repo per task. */
|
|
14
17
|
export class GiteaClient {
|
|
15
18
|
baseUrl;
|
|
16
19
|
token;
|
|
@@ -43,6 +46,10 @@ export class GiteaClient {
|
|
|
43
46
|
}
|
|
44
47
|
async readFile(coords, path, ref) {
|
|
45
48
|
const { owner, repo } = coords;
|
|
49
|
+
// `encodeURIComponent` does NOT escape "." — so a `..` segment survives the per-segment encode and the
|
|
50
|
+
// WHATWG URL parser collapses it when `fetch` builds the request, letting a crafted `path` climb out of
|
|
51
|
+
// `/repos/<owner>/<repo>/contents/` to any endpoint the read token can reach (cross-repo / admin). The
|
|
52
|
+
// tools are contractually bound to exactly one repo (see header), so reject traversal before it hits fetch.
|
|
46
53
|
const segments = path.split("/").filter(Boolean);
|
|
47
54
|
if (segments.some((s) => s === "..")) {
|
|
48
55
|
throw new Error(`invalid path "${path}" (".." segments are not allowed)`);
|
|
@@ -62,6 +69,7 @@ export class GiteaClient {
|
|
|
62
69
|
return text.length > MAX_FILE_BYTES * 4 ? text.slice(0, MAX_FILE_BYTES * 4) + "\n…[diff truncated]" : text;
|
|
63
70
|
}
|
|
64
71
|
}
|
|
72
|
+
/** Build the read-only repo tool set bound to one repo (cheap per-task closure; the client is shared). */
|
|
65
73
|
export function repoToolsFor(client, coords) {
|
|
66
74
|
const ref = (r) => (r ? Promise.resolve(r) : client.defaultBranch(coords));
|
|
67
75
|
return [
|
|
@@ -1,24 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SendUserFile v2 — the sandbox-lane file source (clay ruling 2026-07-14: Plan B direct upload).
|
|
3
|
+
*
|
|
4
|
+
* The tool cannot reach the task's sandbox through core (ToolExecuteContext carries no env handle — core
|
|
5
|
+
* keeps the per-task ExecutionEnv private to its prepare-task closure). But the server BUILDS the
|
|
6
|
+
* `executionEnvFactory` core calls, and the factory context carries `taskId` — so we wrap OUR OWN factory
|
|
7
|
+
* (same posture as withWorktreeIsolation) and keep a replica-local taskId → env registry, unregistering
|
|
8
|
+
* when core destroys the env. No core change, no parallel abstraction — pure deployment glue on a seam
|
|
9
|
+
* the deployment already owns.
|
|
10
|
+
*
|
|
11
|
+
* The send itself is the anti-relay shape ([747]; k8s workspace-snapshot posture): the server presigns a
|
|
12
|
+
* single-object PUT (120s, method-bound, STAGING key — 修3), the SANDBOX `curl -T`s the file straight to S3 — bytes never
|
|
13
|
+
* relay through the server, S3 credentials never enter the sandbox. Tenant isolation = the sandbox can
|
|
14
|
+
* only read its own filesystem, which is exactly the tenant's task workspace; that is why this lane is
|
|
15
|
+
* multi-tenant-safe while the host lane never is (host-lane multi-tenant is permanently closed).
|
|
16
|
+
*
|
|
17
|
+
* ssh lane (backfill 2026-07-14): the SAME send chain works over the ssh adapter unchanged — its exec
|
|
18
|
+
* face is contract-identical (Result{stdout,stderr,exitCode}, stderr split, `options.timeout` in SECONDS
|
|
19
|
+
* ×1000, remote-env-ssh.ts) and the peer is assumed LINUX (`stat -c %s` = GNU/busybox; the fleet is all
|
|
20
|
+
* Linux — a macOS peer's `stat -f %z` dialect would fail LOUD at the exit-code/stat-parse guards, never
|
|
21
|
+
* silently). But the TENANT judgment INVERTS: an ssh peer is ONE persistent real machine shared by every
|
|
22
|
+
* task (sshExecutionEnvFactory ignores ctx — same host + same mountPath for all tasks; destroy() only
|
|
23
|
+
* disconnects, files persist; capabilities.isolation:false). "Scoped read = tenant boundary" does NOT
|
|
24
|
+
* hold there, so the ssh lane is SINGLE-USER ONLY (same gate as host) — see `sandboxSendLaneEnabled`.
|
|
25
|
+
*
|
|
26
|
+
* The presigned PUT URL is a capability secret: it never enters model context (the tool returns delivery
|
|
27
|
+
* metadata only) and is REDACTED from every error surfaced from here (curl stderr may echo the URL).
|
|
28
|
+
*
|
|
29
|
+
* RESIDUAL CLOSED (修3, 三路复审 2026-07-15; was the accepted dual-review residual of 2026-07-14): the URL
|
|
30
|
+
* still rides the exec command line (readable via /proc inside the sandbox), but it is now a capability on
|
|
31
|
+
* a STAGING key only — the server promotes staging→final with its own creds (CopyObject), deletes staging,
|
|
32
|
+
* and size-verifies the FINAL object, whose write URL never existed outside the server. A /proc reader can
|
|
33
|
+
* no longer rewrite the delivered object after verification or skew the ledgered size (see
|
|
34
|
+
* PreparedDirectUpload in send-user-file.ts for the full promotion contract).
|
|
35
|
+
*/
|
|
1
36
|
import type { ExecutionEnv, ExecutionEnvFactory } from "@sema-agent/core";
|
|
2
37
|
import type { IssuedFileLink, PreparedDirectUpload } from "../plugins/send-user-file.js";
|
|
38
|
+
/** Leak backstop (codex review HIGH): core skips destroy on suspend/review paths and a crash may skip it
|
|
39
|
+
* entirely — the suspendVM wrap covers the common case, this bound covers the rest. Far above any real
|
|
40
|
+
* per-replica concurrency. 修6: at the cap the registry REFUSES the new registration instead of FIFO-evicting
|
|
41
|
+
* the oldest entry — every entry here is live-until-destroy/suspend by construction, so there is no
|
|
42
|
+
* "terminal/stale" liveness verdict to evict on, and silently breaking an EXISTING live task's send face to
|
|
43
|
+
* admit a new one inverts the harm (the old FIFO victim's SendUserFile would report "no sandbox attached"
|
|
44
|
+
* while its env kept executing). The refused task gets a TYPED capacity error at send time instead. */
|
|
3
45
|
export declare const TASK_ENV_REGISTRY_MAX = 512;
|
|
46
|
+
/** Replica-local taskId → live ExecutionEnv(s). Registered by the factory wrap, dropped on destroy/suspend.
|
|
47
|
+
*
|
|
48
|
+
* 修5 (concurrent-generation guard): deployments WITHOUT a run-store single-active-session claim can race
|
|
49
|
+
* two legs of one session through the factory concurrently — previously the second registration silently
|
|
50
|
+
* OVERWROTE the first, so leg A's later SendUserFile resolved to leg B's env (wrong-generation read/upload).
|
|
51
|
+
* The registry now keeps EVERY live env per key and `get()` fail-louds on ambiguity: neither leg can silently
|
|
52
|
+
* read the other's sandbox, and the moment one generation is destroyed/suspended the survivor resolves again.
|
|
53
|
+
* (Rejecting the second factory call outright was considered and discarded: a stale never-destroyed entry —
|
|
54
|
+
* crash/no-destroy path — would then brick every future leg of that task, and the factory seam must not fail
|
|
55
|
+
* env creation for a send-face bookkeeping conflict. Deployments WITH the single-active-session claim
|
|
56
|
+
* serialize legs upstream and never see this state.) */
|
|
4
57
|
export declare class TaskEnvRegistry {
|
|
5
58
|
private readonly map;
|
|
59
|
+
/** 修6: taskIds whose registration was refused at the cap — lets get() report the TRUE reason (typed
|
|
60
|
+
* capacity error, not a misleading "no sandbox attached"). Bounded by the same cap (marker-only). */
|
|
6
61
|
private readonly refusedAtCapacity;
|
|
7
62
|
private liveCount;
|
|
63
|
+
/** Resolve the ONE live env for a task. Throws typed errors on the two governed failure states:
|
|
64
|
+
* ambiguity (修5 — concurrent generations both live) and capacity refusal (修6). Returns undefined when
|
|
65
|
+
* the task simply has no registered env (caller reports "no sandbox attached"). */
|
|
8
66
|
get(taskId: string | undefined): ExecutionEnv | undefined;
|
|
67
|
+
/** Wrap the deployment's own factory: register each minted env under the task's CANONICAL id — core hands
|
|
68
|
+
* the factory the raw `spec.taskId` but gives tools `hostTaskId = spec.taskId ?? sessionId` (prepare-task
|
|
69
|
+
* 262/320/428; the sync `/v1/tasks` leg deliberately sets no spec.taskId), so the registry key MUST apply
|
|
70
|
+
* the same fallback or every sync-leg lookup misses (codex review HIGH). Unregister when core calls
|
|
71
|
+
* destroy() (identity guard: only the env's OWN entry is dropped — a replacement env for a reused key must
|
|
72
|
+
* not be evicted by the old one's late destroy). core SKIPS destroy on durable suspend/review (runtask
|
|
73
|
+
* keeps the env for the snapshot) — wrap suspendVM the same way so a suspended task doesn't pin its env
|
|
74
|
+
* here forever; the bounded-size backstop covers any remaining no-destroy crash path. */
|
|
9
75
|
wrapFactory(factory: ExecutionEnvFactory): ExecutionEnvFactory;
|
|
10
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Which REMOTE_EXEC lanes may register the sandbox-send TaskEnvRegistry (and thus mount the sandbox-lane
|
|
79
|
+
* SendUserFile source), under which tenancy gate. The judgment per lane (2026-07-14 ssh backfill review):
|
|
80
|
+
*
|
|
81
|
+
* - e2b / k8s: one task = one disposable sandbox; the sandbox filesystem IS the tenant's task workspace,
|
|
82
|
+
* so a sandbox-scoped read is tenant-scoped by construction → open to any tenant.
|
|
83
|
+
* - ssh: the peer is ONE persistent real machine SHARED across tasks (factory ignores ctx: every task
|
|
84
|
+
* gets the same host+mountPath; destroy=disconnect only, files persist). Tenant A's task can read the
|
|
85
|
+
* residue of tenant B's task → the isolation premise FAILS. Multi-tenant here would be an
|
|
86
|
+
* arbitrary-host-path-read → public-URL exfil face, so the lane opens ONLY single-user
|
|
87
|
+
* (`requirePrincipal !== true`), the exact gate the host lane uses. NOT a lane to "fix later with a
|
|
88
|
+
* per-task workspace": tasks legitimately operate outside any workspace on a real host (design/61 —
|
|
89
|
+
* batch deployment), so per-task dirs would not restore the boundary anyway.
|
|
90
|
+
* - adb / local-docker / host / unset: no registry (host+unset use the local-fs source in main.ts;
|
|
91
|
+
* adb/local-docker remain a follow-on).
|
|
92
|
+
*/
|
|
11
93
|
export declare function sandboxSendLaneEnabled(provider: string | undefined, requirePrincipal: boolean): boolean;
|
|
94
|
+
/** Single-quote a path for POSIX sh (the only metacharacter inside '' is ' itself). */
|
|
12
95
|
export declare function shq(s: string): string;
|
|
96
|
+
/** Strip the capability URL (and any SigV4 signature) from text before it reaches an error/log — including
|
|
97
|
+
* the percent-encoded forms an adapter may echo (the k8s exec transport carries the command in a request
|
|
98
|
+
* URI, so an error can quote the URL re-encoded; codex review MED). */
|
|
13
99
|
export declare function redactPutUrl(text: string, url: string): string;
|
|
14
100
|
export interface SandboxFileSendDeps {
|
|
15
101
|
registry: TaskEnvRegistry;
|
|
102
|
+
/** `scope` = the caller's VERIFIED principal (ToolExecuteContext.principal) — keys the hashed scope segment
|
|
103
|
+
* in the object key + rides back on IssuedFileLink.scope for the ledger. Absent on single-user lanes. */
|
|
16
104
|
prepare: (filename: string | undefined, scope?: string) => PreparedDirectUpload;
|
|
17
105
|
maxBytes: number;
|
|
18
106
|
}
|
|
107
|
+
/** The live object `createSandboxFileSend` produces — a bare callable (deps captured in closure), mirroring
|
|
108
|
+
* the sibling `SendUserFileIssuer` role (send-user-file.ts) one level down: this is the sandbox-lane half. */
|
|
19
109
|
export type SandboxFileSend = (path: string, ctx: {
|
|
20
110
|
taskId?: string;
|
|
21
111
|
principal?: string;
|
|
22
112
|
}) => Promise<IssuedFileLink>;
|
|
113
|
+
/**
|
|
114
|
+
* The sandbox-lane `send` seam for the SendUserFile tool: in-sandbox stat (existence + regular file +
|
|
115
|
+
* size cap, BEFORE any signing) → presign PUT → in-sandbox `curl -T` → finalize the user-facing link.
|
|
116
|
+
* Throws typed Errors (redacted) — the tool reports them per file.
|
|
117
|
+
*/
|
|
23
118
|
export declare function createSandboxFileSend(deps: SandboxFileSendDeps): SandboxFileSend;
|
|
24
119
|
//# sourceMappingURL=sandbox-file-send.d.ts.map
|