@sema-agent/server 7.147.0 → 7.149.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/MIGRATION.md +1468 -24
- package/README.md +35 -7
- package/README.zh-CN.md +18 -8
- package/USAGE.md +444 -193
- package/deploy/sema-up/README.md +16 -5
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/templates/_helpers.tpl +20 -4
- package/deploy/sema-up/chart/values.yaml +3 -2
- package/deploy/sema-up/cluster-up.sh +74 -176
- package/deploy/sema-up/kube-up.sh +29 -49
- package/deploy/sema-up/lib/chart-run.sh +23 -0
- package/deploy/sema-up/lib/dataroot.sh +3 -3
- package/deploy/sema-up/lib/health.sh +62 -13
- package/deploy/sema-up/lib/helm-values-cluster.py +18 -0
- package/deploy/sema-up/lib/helm-values-kube.py +35 -0
- package/deploy/sema-up/lib/regcred.py +8 -0
- package/deploy/sema-up/lib/remote/helm-install.sh +3 -0
- package/deploy/sema-up/lib/remote/image-import.sh +6 -0
- package/deploy/sema-up/lib/remote/machine-precheck.sh +11 -0
- package/deploy/sema-up/lib/remote/region-probe.sh +3 -0
- package/deploy/sema-up/lib/remote/stack-ready.sh +26 -0
- package/deploy/sema-up/lib/remote/vxlan-guard.sh +8 -0
- package/deploy/sema-up/lib/render-stack.py +17 -0
- package/deploy/sema-up/lib/shell-text.sh +87 -0
- package/deploy/sema-up/lib/usage-flags.txt +10 -0
- package/deploy/sema-up/lib/usage-head.txt +1 -0
- package/deploy/sema-up/lib/usage-tail.txt +13 -0
- package/deploy/sema-up/preflight.sh +10 -8
- package/deploy/sema-up/sema-up.sh +14 -39
- package/deploy/sema-up/smoke.sh +7 -6
- package/deploy/sema-up/stack/compose.dataroot.yaml +3 -0
- package/deploy/sema-up/stack/compose.yaml +13 -1
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +21 -0
- package/dist/adoption/plan.d.ts +24 -0
- package/dist/adoption/plan.js +53 -1
- package/dist/adoption/runner.d.ts +10 -1
- package/dist/adoption/runner.js +36 -16
- package/dist/approval-card.d.ts +36 -38
- package/dist/approval-gate-currency.js +3 -2
- package/dist/approval-leg-origin.d.ts +33 -0
- package/dist/approval-leg-origin.js +4 -0
- package/dist/approval-reconciler.d.ts +4 -13
- package/dist/approval-reconciler.js +2 -2
- package/dist/approval.d.ts +13 -11
- package/dist/approval.js +3 -3
- package/dist/audit.d.ts +10 -3
- package/dist/audit.js +15 -7
- package/dist/auth-bridge.d.ts +9 -15
- package/dist/auth-bridge.js +4 -11
- package/dist/auth-keys.d.ts +10 -1
- package/dist/auth-keys.js +8 -0
- package/dist/auto-mode-face.d.ts +10 -7
- package/dist/auto-mode-face.js +7 -4
- package/dist/background-agent-name.d.ts +19 -1
- package/dist/background-agent-name.js +12 -2
- package/dist/background-session-reap.d.ts +1 -1
- package/dist/bake-runner/main.js +9 -6
- package/dist/bench/s1/arms.js +6 -5
- package/dist/bench/s1/live-deps.js +5 -2
- package/dist/bench/s1/run-firm.js +6 -5
- package/dist/bind-host.d.ts +25 -0
- package/dist/bind-host.js +25 -0
- package/dist/boot/adoption.d.ts +3 -0
- package/dist/boot/adoption.js +1 -0
- package/dist/boot/deployment-mods.d.ts +1 -1
- package/dist/boot/execution-env.d.ts +17 -7
- package/dist/boot/execution-env.js +47 -42
- package/dist/boot/execution-lane.d.ts +6 -4
- package/dist/boot/execution-lane.js +3 -1
- package/dist/boot/exit-boundary.d.ts +2 -2
- package/dist/boot/exit-boundary.js +6 -5
- package/dist/boot/fatal-exit.d.ts +3 -5
- package/dist/boot/fatal-exit.js +2 -2
- package/dist/boot/leader.d.ts +15 -0
- package/dist/boot/leader.js +17 -15
- package/dist/boot/memory-consolidation.d.ts +37 -29
- package/dist/boot/memory-consolidation.js +11 -5
- package/dist/boot/org-delivery.d.ts +3 -2
- package/dist/boot/org-memory.js +1 -1
- package/dist/boot/parked-revive-gate.js +2 -2
- package/dist/boot/reapers.d.ts +4 -3
- package/dist/boot/reapers.js +19 -16
- package/dist/boot/resolve-spec.d.ts +5 -3
- package/dist/boot/resolve-spec.js +60 -70
- package/dist/boot/retention-lane.d.ts +4 -4
- package/dist/boot/retention-lane.js +2 -2
- package/dist/boot/runner-deps.d.ts +28 -7
- package/dist/boot/runner-deps.js +14 -5
- package/dist/boot/runtime-caps.d.ts +2 -2
- package/dist/boot/runtime-caps.js +16 -2
- package/dist/boot/session-faces.d.ts +16 -7
- package/dist/boot/session-faces.js +114 -94
- package/dist/boot/shutdown.d.ts +5 -4
- package/dist/boot/shutdown.js +6 -4
- package/dist/boot/stage-01-config.d.ts +1 -0
- package/dist/boot/stage-01-config.js +13 -4
- package/dist/boot/stage-02-web-admin-pull.d.ts +2 -0
- package/dist/boot/stage-02-web-admin-pull.js +16 -3
- package/dist/boot/stage-03-store-backend.d.ts +4 -0
- package/dist/boot/stage-03-store-backend.js +4 -3
- package/dist/boot/stage-04-stores.d.ts +3 -0
- package/dist/boot/stage-04-stores.js +2 -2
- package/dist/boot/stage-05-execution-env.d.ts +8 -3
- package/dist/boot/stage-05-execution-env.js +2 -2
- package/dist/boot/stage-06-runners.d.ts +12 -13
- package/dist/boot/stage-06-runners.js +23 -15
- package/dist/boot/stage-07-capability-layer.d.ts +13 -9
- package/dist/boot/stage-07-capability-layer.js +5 -3
- package/dist/boot/stage-08-reapers.d.ts +13 -9
- package/dist/boot/stage-08-reapers.js +3 -3
- package/dist/boot/stage-09-leader.d.ts +14 -16
- package/dist/boot/stage-09-leader.js +12 -4
- package/dist/boot/stage-10-http-server.d.ts +14 -16
- package/dist/boot/stage-10-http-server.js +7 -4
- package/dist/boot/store-evidence.d.ts +20 -0
- package/dist/boot/store-evidence.js +13 -0
- package/dist/boot/stores.d.ts +6 -0
- package/dist/boot/stores.js +41 -27
- package/dist/boot/task-list-lane.d.ts +4 -4
- package/dist/boot/web-admin.d.ts +4 -2
- package/dist/boot/web-admin.js +55 -35
- package/dist/boot/webfetch-summarize-lane.d.ts +1 -1
- package/dist/boot-reclaim.d.ts +3 -1
- package/dist/boot-reclaim.js +1 -1
- package/dist/brain.d.ts +7 -18
- package/dist/brain.js +5 -17
- package/dist/budget.js +6 -6
- package/dist/capabilities/center-plugins.d.ts +7 -1
- package/dist/capabilities/center-plugins.js +32 -10
- package/dist/capabilities/center-wiring.js +1 -1
- package/dist/capabilities/composite-members.d.ts +2 -2
- package/dist/capabilities/composite-members.js +2 -2
- package/dist/capabilities/repo-tools.d.ts +2 -0
- package/dist/capabilities/repo-tools.js +14 -12
- package/dist/capabilities/scenarios.d.ts +6 -15
- package/dist/capabilities/scenarios.js +11 -16
- package/dist/capabilities/skills.d.ts +1 -1
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +39 -11
- package/dist/capability-facts.js +35 -7
- package/dist/card-settle-stored-scope.d.ts +56 -0
- package/dist/card-settle-stored-scope.js +27 -0
- package/dist/card-void.d.ts +8 -13
- package/dist/card-void.js +2 -7
- package/dist/center-credential-renewer.d.ts +6 -2
- package/dist/center-credential-renewer.js +7 -3
- package/dist/config-catalog.d.ts +28 -1
- package/dist/config-catalog.js +95 -85
- package/dist/config-dir-trust.d.ts +37 -4
- package/dist/config-dir-trust.js +88 -44
- package/dist/config-invariants.d.ts +43 -3
- package/dist/config-invariants.js +69 -5
- package/dist/config-lkg.d.ts +23 -1
- package/dist/config-lkg.js +17 -3
- package/dist/config-provider.d.ts +9 -9
- package/dist/config-provider.js +25 -110
- package/dist/config-pull-failure.d.ts +50 -0
- package/dist/config-pull-failure.js +48 -0
- package/dist/config-types.d.ts +62 -21
- package/dist/config.d.ts +14 -21
- package/dist/config.js +141 -64
- package/dist/context-window-notice.d.ts +31 -0
- package/dist/context-window-notice.js +28 -0
- package/dist/delegated-session-owner.d.ts +1 -1
- package/dist/deleted-session-ids.d.ts +3 -2
- package/dist/deployment-governance.d.ts +3 -3
- package/dist/deployment-shape.d.ts +46 -11
- package/dist/deployment-shape.js +8 -0
- package/dist/egress-redirect.d.ts +25 -7
- package/dist/egress-redirect.js +20 -2
- package/dist/elicitation.d.ts +6 -5
- package/dist/elicitation.js +23 -22
- package/dist/engine-identity.d.ts +28 -0
- package/dist/engine-identity.js +10 -0
- package/dist/entry-problems.d.ts +5 -7
- package/dist/entry-problems.js +1 -1
- package/dist/env-facts.js +2 -1
- package/dist/env-name-allowlist-knobs.d.ts +6 -5
- package/dist/env-name-allowlist-knobs.js +5 -0
- package/dist/env-witness.d.ts +7 -0
- package/dist/env-witness.js +16 -0
- package/dist/execution-lane-caps.d.ts +25 -23
- package/dist/execution-lane-caps.js +18 -26
- package/dist/execution-placement.d.ts +58 -18
- package/dist/execution-placement.js +41 -2
- package/dist/field-conflict.d.ts +7 -11
- package/dist/field-conflict.js +3 -3
- package/dist/file-history-capture.d.ts +3 -3
- package/dist/file-history-disclosure.js +1 -0
- package/dist/fleet/fleet-bus.d.ts +21 -3
- package/dist/fleet/fleet-bus.js +35 -25
- package/dist/fleet/fleet-reconciler.js +2 -2
- package/dist/fleet/serving-lease.js +3 -3
- package/dist/fleet-client.js +3 -3
- package/dist/fleet-lease.d.ts +0 -1
- package/dist/fleet-lease.js +4 -5
- package/dist/history-anchor.d.ts +23 -3
- package/dist/history-anchor.js +24 -4
- package/dist/hitl-delivery.d.ts +90 -0
- package/dist/hitl-delivery.js +98 -0
- package/dist/hooks/classic-stations.d.ts +8 -11
- package/dist/hooks/classic-stations.js +0 -7
- package/dist/hooks/command-spawn.d.ts +7 -2
- package/dist/hooks/command-spawn.js +13 -6
- package/dist/hooks/hook-llm.d.ts +5 -1
- package/dist/hooks/hook-llm.js +24 -15
- package/dist/hooks/hook-runner.d.ts +72 -57
- package/dist/hooks/hook-runner.js +271 -193
- package/dist/host-lsp-manager.d.ts +22 -8
- package/dist/host-lsp-manager.js +4 -1
- package/dist/http/active-run-conflict.d.ts +2 -43
- package/dist/http/active-run-conflict.js +3 -7
- package/dist/http/admission.d.ts +4 -18
- package/dist/http/admission.js +76 -79
- package/dist/http/approval-sweeps.d.ts +3 -3
- package/dist/http/approval-sweeps.js +56 -31
- package/dist/http/caller-trust.d.ts +8 -10
- package/dist/http/caller-trust.js +1 -2
- package/dist/http/claim-heartbeat.d.ts +49 -0
- package/dist/http/claim-heartbeat.js +46 -0
- package/dist/http/claimed-run.d.ts +16 -8
- package/dist/http/claimed-run.js +8 -0
- package/dist/http/dispatch.d.ts +8 -1
- package/dist/http/dispatch.js +78 -30
- package/dist/http/durable-run-leg.d.ts +11 -4
- package/dist/http/durable-run-leg.js +45 -21
- package/dist/http/execution-context.d.ts +122 -47
- package/dist/http/execution-context.js +135 -43
- package/dist/http/health-reader.d.ts +36 -0
- package/dist/http/health-reader.js +21 -0
- package/dist/http/health-self-report.d.ts +9 -9
- package/dist/http/health-self-report.js +4 -4
- package/dist/http/idempotency.d.ts +9 -5
- package/dist/http/idempotency.js +4 -4
- package/dist/http/memory-compliance-failure-reply.d.ts +15 -16
- package/dist/http/memory-compliance-failure-reply.js +4 -2
- package/dist/http/memory-face-fault-reply.d.ts +67 -0
- package/dist/http/memory-face-fault-reply.js +71 -0
- package/dist/http/memory-store-refusal-reply.d.ts +1 -1
- package/dist/http/memory-store-refusal-reply.js +3 -0
- package/dist/http/owner-access.d.ts +392 -67
- package/dist/http/owner-access.js +370 -35
- package/dist/http/principal-gate.d.ts +39 -89
- package/dist/http/principal-gate.js +26 -68
- package/dist/http/refusal-body.d.ts +35 -2
- package/dist/http/refusal-body.js +34 -0
- package/dist/http/request-guards.d.ts +9 -13
- package/dist/http/request-guards.js +34 -68
- package/dist/http/resume-composition.d.ts +37 -0
- package/dist/http/resume-composition.js +18 -0
- package/dist/http/resume-ctx-read.d.ts +46 -12
- package/dist/http/resume-ctx-read.js +31 -6
- package/dist/http/resume-legs.d.ts +54 -19
- package/dist/http/resume-legs.js +408 -196
- package/dist/http/retired-skill-manifest.d.ts +1 -1
- package/dist/http/route-ctx.d.ts +31 -32
- package/dist/http/routes/a2a-serve.d.ts +43 -5
- package/dist/http/routes/a2a-serve.js +60 -37
- package/dist/http/routes/admin-config-refresh.js +2 -2
- package/dist/http/routes/admin-drain.js +2 -2
- package/dist/http/routes/admin-memory-optout.js +4 -3
- package/dist/http/routes/adoption.d.ts +3 -0
- package/dist/http/routes/adoption.js +17 -10
- package/dist/http/routes/agents-roster.js +13 -7
- package/dist/http/routes/approvals-assistant.js +73 -67
- package/dist/http/routes/attachments.js +2 -2
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/background.js +9 -17
- package/dist/http/routes/capabilities.js +16 -19
- package/dist/http/routes/config-catalog.js +2 -2
- package/dist/http/routes/devices.d.ts +3 -3
- package/dist/http/routes/devices.js +4 -4
- package/dist/http/routes/diagnostics.d.ts +29 -3
- package/dist/http/routes/diagnostics.js +49 -18
- package/dist/http/routes/engine.js +2 -2
- package/dist/http/routes/fleet.js +5 -3
- package/dist/http/routes/images.js +10 -6
- package/dist/http/routes/leader.d.ts +7 -2
- package/dist/http/routes/leader.js +12 -3
- package/dist/http/routes/mcp-reconnect.d.ts +1 -1
- package/dist/http/routes/mcp-reconnect.js +7 -15
- package/dist/http/routes/memory-bundle.js +4 -7
- package/dist/http/routes/memory-compliance.js +4 -4
- package/dist/http/routes/memory-consolidation.js +6 -9
- package/dist/http/routes/memory-origin.d.ts +2 -0
- package/dist/http/routes/memory-origin.js +7 -8
- package/dist/http/routes/memory-policy.js +17 -12
- package/dist/http/routes/notify-wake.js +10 -19
- package/dist/http/routes/observability.js +3 -3
- package/dist/http/routes/principal-inbox.d.ts +4 -2
- package/dist/http/routes/principal-inbox.js +5 -4
- package/dist/http/routes/projects.d.ts +1 -1
- package/dist/http/routes/projects.js +3 -2
- package/dist/http/routes/retention-ops.js +6 -9
- package/dist/http/routes/rules.js +20 -5
- package/dist/http/routes/run-memory-capture.d.ts +2 -2
- package/dist/http/routes/run-memory-capture.js +6 -12
- package/dist/http/routes/run-permission-mode.d.ts +2 -2
- package/dist/http/routes/run-permission-mode.js +10 -17
- package/dist/http/routes/runs.js +155 -237
- package/dist/http/routes/session-memory-sync.d.ts +2 -2
- package/dist/http/routes/session-memory-sync.js +7 -13
- package/dist/http/routes/session-sync.d.ts +28 -7
- package/dist/http/routes/session-sync.js +63 -50
- package/dist/http/routes/sessions-list.d.ts +3 -3
- package/dist/http/routes/sessions-list.js +9 -9
- package/dist/http/routes/sessions.js +87 -124
- package/dist/http/routes/shared-memory.js +6 -6
- package/dist/http/routes/side-query.js +2 -2
- package/dist/http/routes/tasks.js +237 -187
- package/dist/http/routes/trace-usage.d.ts +0 -12
- package/dist/http/routes/trace-usage.js +40 -46
- package/dist/http/routes/workflows.d.ts +39 -4
- package/dist/http/routes/workflows.js +42 -14
- package/dist/http/run-concurrency-cap.d.ts +20 -12
- package/dist/http/run-concurrency-cap.js +39 -26
- package/dist/http/run-read-face.d.ts +3 -5
- package/dist/http/run-read-face.js +8 -13
- package/dist/http/send.d.ts +12 -3
- package/dist/http/send.js +42 -6
- package/dist/http/server.d.ts +43 -45
- package/dist/http/server.js +61 -11
- package/dist/http/sse-log.d.ts +17 -10
- package/dist/http/sse-log.js +7 -7
- package/dist/http/stored-body-replay.d.ts +12 -0
- package/dist/http/stored-body-replay.js +2 -2
- package/dist/http/submit-ctx.d.ts +17 -8
- package/dist/http/submit-ctx.js +8 -5
- package/dist/http/submit-replay.d.ts +19 -6
- package/dist/http/submit-replay.js +18 -6
- package/dist/http/sync-submit-body.d.ts +3 -4
- package/dist/http/sync-submit-body.js +4 -5
- package/dist/http/wire-types.d.ts +4 -3
- package/dist/identity-source.d.ts +36 -5
- package/dist/identity-source.js +27 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +2 -0
- package/dist/key-resolver.d.ts +32 -0
- package/dist/key-resolver.js +23 -9
- package/dist/leader/diffup.js +2 -1
- package/dist/leader/endpoint.d.ts +26 -5
- package/dist/leader/endpoint.js +154 -14
- package/dist/leader/fanout.d.ts +3 -0
- package/dist/leader/fanout.js +78 -63
- package/dist/leader/leader.d.ts +16 -0
- package/dist/leader/leader.js +43 -3
- package/dist/leader/merge.d.ts +9 -1
- package/dist/leader/merge.js +16 -1
- package/dist/leader/repair-wire.js +1 -1
- package/dist/leader/wire.d.ts +36 -3
- package/dist/leader/wire.js +59 -18
- package/dist/leg-facts.d.ts +7 -2
- package/dist/leg-facts.js +1 -0
- package/dist/local-store-declaration.d.ts +54 -0
- package/dist/local-store-declaration.js +59 -0
- package/dist/lsp-evict.d.ts +6 -4
- package/dist/lsp-evict.js +2 -3
- package/dist/mcp-assertion-header.d.ts +1 -1
- package/dist/mcp-assertion-header.js +1 -1
- package/dist/memory-operator-faces.d.ts +5 -4
- package/dist/memory-operator-faces.js +1 -1
- package/dist/memory-project-layer.js +1 -1
- package/dist/memory-scope.d.ts +33 -6
- package/dist/memory-scope.js +68 -19
- package/dist/memory-store-refusal.d.ts +5 -2
- package/dist/memory-sync-client.d.ts +3 -2
- package/dist/memory-sync-client.js +8 -5
- package/dist/model-compat.d.ts +17 -8
- package/dist/model-compat.js +6 -2
- package/dist/model-context-window.d.ts +57 -0
- package/dist/model-context-window.js +21 -0
- package/dist/model-entry-headers.d.ts +46 -4
- package/dist/model-entry-headers.js +2 -2
- package/dist/model-entry-refusal.d.ts +40 -20
- package/dist/model-entry-refusal.js +57 -30
- package/dist/model-plane-face.d.ts +19 -11
- package/dist/model-plane-face.js +9 -1
- package/dist/model-plane-probe.d.ts +2 -0
- package/dist/model-plane-probe.js +17 -0
- package/dist/model-provider.d.ts +3 -3
- package/dist/model-reach-scope.d.ts +2 -1
- package/dist/model-route-endpoint.d.ts +9 -5
- package/dist/model-route-endpoint.js +29 -7
- package/dist/model-select.d.ts +16 -0
- package/dist/model-select.js +4 -0
- package/dist/mountinfo.d.ts +37 -0
- package/dist/mountinfo.js +47 -0
- package/dist/namespaced-rule-name.d.ts +23 -14
- package/dist/namespaced-rule-name.js +8 -11
- package/dist/net-address.d.ts +1 -1
- package/dist/observability/corrupt-read-seat.d.ts +4 -4
- package/dist/observability/corrupt-read-seat.js +5 -3
- package/dist/observability/fail-open.d.ts +72 -40
- package/dist/observability/fail-open.js +74 -40
- package/dist/observability/logger.d.ts +22 -1
- package/dist/observability/logger.js +89 -12
- package/dist/observability/metrics.js +4 -5
- package/dist/observability/otel-exporter.js +2 -1
- package/dist/observability/principal-context.d.ts +14 -7
- package/dist/observability/principal-context.js +8 -3
- package/dist/observability/run-terminal.d.ts +7 -1
- package/dist/observability/run-terminal.js +6 -2
- package/dist/observability/secret-env-scrub.d.ts +1 -1
- package/dist/observability/secret-env-scrub.js +1 -1
- package/dist/orchestration/hardened-vm-runner.d.ts +1 -0
- package/dist/orchestration/hardened-vm-runner.js +11 -5
- package/dist/orchestration/hardened-vm-worker-runner.d.ts +0 -14
- package/dist/orchestration/hardened-vm-worker-runner.js +5 -0
- package/dist/orchestration/hardened-vm-worker.js +2 -1
- package/dist/orchestration/workflow-completion-inbox.d.ts +3 -3
- package/dist/orchestration/workflow-completion-inbox.js +3 -2
- package/dist/org-delivery-gate.d.ts +36 -10
- package/dist/org-delivery-gate.js +12 -8
- package/dist/outbound-dispatcher.d.ts +1 -1
- package/dist/outbound-dispatcher.js +6 -12
- package/dist/owner-brands.d.ts +81 -0
- package/dist/owner-brands.js +42 -0
- package/dist/owner-faces.d.ts +532 -0
- package/dist/owner-faces.js +126 -0
- package/dist/park-row-commit.d.ts +67 -0
- package/dist/park-row-commit.js +76 -0
- package/dist/parked-decide.d.ts +76 -12
- package/dist/parked-decide.js +152 -11
- package/dist/parked-revive-surface.d.ts +14 -4
- package/dist/parked-revive-surface.js +5 -4
- package/dist/peer-directory.d.ts +7 -9
- package/dist/peer-directory.js +3 -2
- package/dist/permission-rule-vocab.d.ts +53 -8
- package/dist/permission-rule-vocab.js +30 -2
- package/dist/plugins/adoption-log-sql.d.ts +3 -25
- package/dist/plugins/adoption-log-sql.js +23 -21
- package/dist/plugins/approval-ask-retired-delete-by-task-m50.d.ts +7 -0
- package/dist/plugins/approval-ask-retired-delete-by-task-m50.js +17 -0
- package/dist/plugins/approval-ask-store-file.d.ts +18 -7
- package/dist/plugins/approval-ask-store-file.js +37 -14
- package/dist/plugins/approval-ask-store-memory.d.ts +12 -4
- package/dist/plugins/approval-ask-store-memory.js +24 -10
- package/dist/plugins/approval-ask-store-sql.d.ts +40 -21
- package/dist/plugins/approval-ask-store-sql.js +44 -15
- package/dist/plugins/approval-exemption-skill-cutoff.d.ts +64 -0
- package/dist/plugins/approval-exemption-skill-cutoff.js +122 -0
- package/dist/plugins/approval-exemption-skill-m46.d.ts +14 -0
- package/dist/plugins/approval-exemption-skill-m46.js +21 -0
- package/dist/plugins/approval-exemption-store.d.ts +32 -2
- package/dist/plugins/approval-exemption-store.js +42 -19
- package/dist/plugins/approval-nonce-store.d.ts +39 -12
- package/dist/plugins/approval-nonce-store.js +72 -23
- package/dist/plugins/blob-backend.d.ts +2 -0
- package/dist/plugins/blob-backend.js +9 -6
- package/dist/plugins/caching-session-store.d.ts +13 -1
- package/dist/plugins/caching-session-store.js +43 -4
- package/dist/plugins/checkpoint-index-columns.d.ts +32 -5
- package/dist/plugins/checkpoint-index-columns.js +36 -1
- package/dist/plugins/checkpoint-store-face.d.ts +83 -10
- package/dist/plugins/checkpoint-store-face.js +18 -1
- package/dist/plugins/device-store-sql.js +1 -0
- package/dist/plugins/ensure-index.d.ts +13 -1
- package/dist/plugins/ensure-index.js +154 -21
- package/dist/plugins/ensure-schema-lock-policy.d.ts +36 -18
- package/dist/plugins/ensure-schema-lock-policy.js +76 -9
- package/dist/plugins/file-run-store.d.ts +85 -32
- package/dist/plugins/file-run-store.js +177 -94
- package/dist/plugins/host-platform.d.ts +24 -3
- package/dist/plugins/host-platform.js +15 -1
- package/dist/plugins/image-bake-store-sql.js +2 -0
- package/dist/plugins/imported-layer-root-retirement.d.ts +2 -2
- package/dist/plugins/k8s-pod-reaper.d.ts +1 -3
- package/dist/plugins/k8s-pod-reaper.js +0 -1
- package/dist/plugins/leader-run-store-sql.d.ts +22 -0
- package/dist/plugins/leader-run-store-sql.js +34 -4
- package/dist/plugins/local-checkpoint-store.d.ts +62 -23
- package/dist/plugins/local-checkpoint-store.js +197 -77
- package/dist/plugins/local-data-dir-modes-m39.js +2 -1
- package/dist/plugins/local-data-root-admission.d.ts +52 -0
- package/dist/plugins/local-data-root-admission.js +100 -0
- package/dist/plugins/local-docker-capacity.d.ts +93 -0
- package/dist/plugins/local-docker-capacity.js +194 -0
- package/dist/plugins/local-docker-reaper.d.ts +92 -0
- package/dist/plugins/local-docker-reaper.js +102 -0
- package/dist/plugins/local-engine-high-water.d.ts +29 -6
- package/dist/plugins/local-engine-high-water.js +27 -19
- package/dist/plugins/local-session-store.d.ts +458 -140
- package/dist/plugins/local-session-store.js +906 -292
- package/dist/plugins/local-session-window.d.ts +3 -2
- package/dist/plugins/local-session-window.js +3 -2
- package/dist/plugins/local-sidecar-quarantine.js +3 -2
- package/dist/plugins/local-task-attachment-store.d.ts +18 -1
- package/dist/plugins/local-task-attachment-store.js +22 -1
- package/dist/plugins/memory-embedder.js +9 -7
- package/dist/plugins/memory-engine-pg.d.ts +3 -2
- package/dist/plugins/memory-engine-pg.js +14 -5
- package/dist/plugins/memory-engine-sql-apply.d.ts +8 -4
- package/dist/plugins/memory-engine-sql-apply.js +6 -8
- package/dist/plugins/memory-engine-tidb.d.ts +4 -2
- package/dist/plugins/memory-engine-tidb.js +11 -2
- package/dist/plugins/memory-optout-grant-store-sql.d.ts +1 -1
- package/dist/plugins/memory-optout-grant-store-sql.js +3 -3
- package/dist/plugins/memory-run-store.d.ts +53 -36
- package/dist/plugins/memory-run-store.js +116 -88
- package/dist/plugins/one-time-migration-marker.d.ts +26 -0
- package/dist/plugins/one-time-migration-marker.js +13 -0
- package/dist/plugins/one-time-migrations.d.ts +214 -47
- package/dist/plugins/one-time-migrations.js +481 -135
- package/dist/plugins/org-delivery-quota-store.d.ts +34 -11
- package/dist/plugins/org-delivery-quota-store.js +31 -15
- package/dist/plugins/permission-rule-store-file.d.ts +3 -3
- package/dist/plugins/permission-rule-store-sql.d.ts +5 -64
- package/dist/plugins/permission-rule-store-sql.js +11 -95
- package/dist/plugins/pg-pool.d.ts +2 -32
- package/dist/plugins/pg-pool.js +24 -17
- package/dist/plugins/remote-env-device.d.ts +3 -2
- package/dist/plugins/remote-env-e2b.d.ts +8 -32
- package/dist/plugins/remote-env-e2b.js +44 -32
- package/dist/plugins/remote-env-host.d.ts +51 -17
- package/dist/plugins/remote-env-host.js +111 -42
- package/dist/plugins/remote-env-k8s.d.ts +40 -45
- package/dist/plugins/remote-env-k8s.js +111 -60
- package/dist/plugins/remote-env-local-docker.d.ts +152 -15
- package/dist/plugins/remote-env-local-docker.js +352 -72
- package/dist/plugins/remote-scratchpad.js +4 -0
- package/dist/plugins/retention-deployment.d.ts +49 -17
- package/dist/plugins/retention-deployment.js +39 -8
- package/dist/plugins/run-preview-m45.d.ts +11 -0
- package/dist/plugins/run-preview-m45.js +19 -0
- package/dist/plugins/run-store-sql.d.ts +82 -75
- package/dist/plugins/run-store-sql.js +164 -125
- package/dist/plugins/s3-answer.d.ts +2 -1
- package/dist/plugins/sandbox-reaper.d.ts +26 -0
- package/dist/plugins/sandbox-reaper.js +2 -0
- package/dist/plugins/scenario-prefix-switch-m42.d.ts +56 -0
- package/dist/plugins/scenario-prefix-switch-m42.js +56 -0
- package/dist/plugins/scheduler-support.d.ts +16 -1
- package/dist/plugins/scheduler-support.js +22 -2
- package/dist/plugins/schema-consistency.d.ts +131 -14
- package/dist/plugins/schema-consistency.js +388 -18
- package/dist/plugins/schema-drift-sentence.d.ts +10 -6
- package/dist/plugins/schema-drift-sentence.js +15 -7
- package/dist/plugins/schema-ensure-legs.d.ts +9 -0
- package/dist/plugins/schema-ensure-legs.js +1 -1
- package/dist/plugins/schema-indexes.js +3 -0
- package/dist/plugins/schema-live-columns.d.ts +14 -5
- package/dist/plugins/schema-live-columns.js +10 -10
- package/dist/plugins/send-user-file.js +2 -1
- package/dist/plugins/session-birth.d.ts +37 -0
- package/dist/plugins/session-birth.js +38 -0
- package/dist/plugins/session-epoch-anchor.d.ts +40 -12
- package/dist/plugins/session-epoch-anchor.js +33 -11
- package/dist/plugins/session-ext-table.d.ts +27 -3
- package/dist/plugins/session-ext-table.js +19 -6
- package/dist/plugins/session-fork.d.ts +15 -1
- package/dist/plugins/session-fork.js +3 -0
- package/dist/plugins/session-ownership.d.ts +1 -1
- package/dist/plugins/session-placement.d.ts +27 -20
- package/dist/plugins/session-placement.js +15 -12
- package/dist/plugins/session-row-sql.d.ts +12 -0
- package/dist/plugins/session-row-sql.js +3 -3
- package/dist/plugins/session-run-rollup.d.ts +29 -0
- package/dist/plugins/session-run-rollup.js +40 -0
- package/dist/plugins/session-store-sql.d.ts +38 -12
- package/dist/plugins/session-store-sql.js +130 -30
- package/dist/plugins/session-withdraw-sql.d.ts +36 -0
- package/dist/plugins/session-withdraw-sql.js +42 -0
- package/dist/plugins/shared-memory-store-sql.d.ts +0 -69
- package/dist/plugins/shared-memory-store-sql.js +2 -1
- package/dist/plugins/shell-sentinel-owner-m48.d.ts +42 -0
- package/dist/plugins/shell-sentinel-owner-m48.js +9 -0
- package/dist/plugins/snapshot-bucket-presence.d.ts +2 -1
- package/dist/plugins/sql-driver.d.ts +1 -1
- package/dist/plugins/sql-driver.js +2 -1
- package/dist/plugins/sql-errors.d.ts +32 -5
- package/dist/plugins/sql-errors.js +55 -7
- package/dist/plugins/sql-json-column.d.ts +8 -7
- package/dist/plugins/sql-json-column.js +10 -6
- package/dist/plugins/stop-then-start-sentence.d.ts +16 -0
- package/dist/plugins/stop-then-start-sentence.js +7 -0
- package/dist/plugins/store-backend.d.ts +99 -16
- package/dist/plugins/store-backend.js +230 -65
- package/dist/plugins/store-contracts.d.ts +123 -33
- package/dist/plugins/store-contracts.js +38 -1
- package/dist/plugins/store-fault.d.ts +28 -2
- package/dist/plugins/store-fault.js +20 -2
- package/dist/plugins/task-attachment-store.d.ts +15 -3
- package/dist/plugins/task-attachment-store.js +22 -9
- package/dist/plugins/tidb-pool.d.ts +11 -6
- package/dist/plugins/tidb-pool.js +39 -18
- package/dist/plugins/web-search.js +5 -3
- package/dist/plugins/workflow-run-store-sql.d.ts +6 -1
- package/dist/plugins/workflow-run-store-sql.js +11 -5
- package/dist/plugins/workspace-custody.d.ts +44 -0
- package/dist/plugins/workspace-custody.js +47 -0
- package/dist/principal-jwt.d.ts +4 -4
- package/dist/principal-jwt.js +20 -5
- package/dist/principal-shape.d.ts +41 -0
- package/dist/principal-shape.js +19 -0
- package/dist/project-identity.d.ts +8 -7
- package/dist/project-identity.js +40 -17
- package/dist/project-layer-key.d.ts +13 -2
- package/dist/project-layer-key.js +9 -1
- package/dist/question.d.ts +13 -23
- package/dist/question.js +21 -39
- package/dist/read-deny-floor-notice.d.ts +36 -0
- package/dist/read-deny-floor-notice.js +40 -0
- package/dist/{plain-string-record.d.ts → request-declaration-disposition.d.ts} +9 -23
- package/dist/request-declaration-disposition.js +39 -0
- package/dist/request-declaration-refusal.d.ts +35 -12
- package/dist/request-declaration-refusal.js +21 -9
- package/dist/request-form.d.ts +58 -0
- package/dist/request-form.js +72 -0
- package/dist/request-image-urls.d.ts +8 -2
- package/dist/request-image-urls.js +2 -1
- package/dist/request-images.d.ts +20 -0
- package/dist/request-images.js +59 -0
- package/dist/request-key-closure.d.ts +6 -7
- package/dist/request-key-closure.js +15 -2
- package/dist/resource-suspend.d.ts +7 -16
- package/dist/resource-suspend.js +1 -1
- package/dist/retired-name-host-notice.d.ts +21 -0
- package/dist/retired-name-host-notice.js +12 -0
- package/dist/rule-entry-list.d.ts +2 -2
- package/dist/rule-entry-list.js +3 -4
- package/dist/rule-issue-reading.d.ts +58 -0
- package/dist/rule-issue-reading.js +14 -0
- package/dist/rules-consent.d.ts +5 -3
- package/dist/rules-consent.js +1 -0
- package/dist/run-acceptance.d.ts +3 -1
- package/dist/run-acceptance.js +3 -0
- package/dist/run-cancel-card.d.ts +28 -0
- package/dist/run-cancel-card.js +19 -0
- package/dist/run-cancel-context.d.ts +10 -0
- package/dist/run-cancel-context.js +1 -0
- package/dist/run-local.d.ts +14 -6
- package/dist/run-local.js +117 -90
- package/dist/run-stale-default.d.ts +7 -0
- package/dist/run-stale-default.js +2 -0
- package/dist/runs.d.ts +56 -21
- package/dist/runs.js +73 -43
- package/dist/runtime-caps-resolver.d.ts +21 -6
- package/dist/runtime-caps-resolver.js +17 -4
- package/dist/runtime-governance.d.ts +2 -2
- package/dist/runtime-governance.js +5 -3
- package/dist/sealed-key-layout.d.ts +12 -5
- package/dist/sealed-key-layout.js +5 -0
- package/dist/sealed-key.d.ts +12 -2
- package/dist/sealed-key.js +115 -27
- package/dist/security.d.ts +128 -158
- package/dist/security.js +163 -59
- package/dist/sema-config-dir.d.ts +20 -0
- package/dist/sema-config-dir.js +25 -0
- package/dist/server-secret-env.d.ts +55 -25
- package/dist/server-secret-env.js +75 -22
- package/dist/session-agent.d.ts +3 -2
- package/dist/session-children-retire.d.ts +13 -8
- package/dist/session-children-retire.js +9 -7
- package/dist/session-deletion.d.ts +88 -0
- package/dist/session-deletion.js +8 -0
- package/dist/session-erase.d.ts +145 -0
- package/dist/session-erase.js +115 -0
- package/dist/session-error-wire.d.ts +5 -5
- package/dist/session-error-wire.js +1 -1
- package/dist/session-incarnation.d.ts +52 -5
- package/dist/session-incarnation.js +19 -2
- package/dist/session-policy-wire.d.ts +6 -3
- package/dist/session-policy-wire.js +11 -1
- package/dist/session-resident-background.d.ts +0 -71
- package/dist/session-resident-background.js +4 -3
- package/dist/session-row.d.ts +2 -1
- package/dist/session-rules-seat.d.ts +12 -0
- package/dist/session-rules-seat.js +19 -0
- package/dist/session-titler.d.ts +7 -15
- package/dist/session-titler.js +1 -1
- package/dist/session-workspace.d.ts +3 -3
- package/dist/spec-fields.d.ts +57 -3
- package/dist/spec-fields.js +72 -51
- package/dist/store-admission.d.ts +33 -0
- package/dist/store-admission.js +49 -0
- package/dist/store-posture.d.ts +141 -20
- package/dist/store-posture.js +205 -3
- package/dist/stored-request-hooks-m20.js +2 -2
- package/dist/stores-sql/background-agent-store-sql.d.ts +11 -2
- package/dist/stores-sql/background-agent-store-sql.js +73 -20
- package/dist/stores-sql/checkpoint-store-sql.d.ts +34 -29
- package/dist/stores-sql/checkpoint-store-sql.js +78 -49
- package/dist/stores-sql/file-history-store-sql.d.ts +1 -1
- package/dist/stores-sql/file-history-store-sql.js +3 -5
- package/dist/stores-sql/mailbox-store-sql.d.ts +7 -4
- package/dist/stores-sql/mailbox-store-sql.js +31 -32
- package/dist/stores-sql/pg-session-storage.d.ts +7 -5
- package/dist/stores-sql/pg-session-storage.js +54 -46
- package/dist/stores-sql/retention-store-sql.d.ts +87 -19
- package/dist/stores-sql/retention-store-sql.js +92 -27
- package/dist/stores-sql/session-policy-store-sql.d.ts +32 -10
- package/dist/stores-sql/session-policy-store-sql.js +44 -36
- package/dist/stores-sql/session-write-hooks.d.ts +12 -6
- package/dist/stores-sql/tidb-session-storage.d.ts +4 -4
- package/dist/stores-sql/tidb-session-storage.js +13 -8
- package/dist/stores-sql/tidb-session-store.d.ts +36 -17
- package/dist/stores-sql/tidb-session-store.js +69 -39
- package/dist/stores-sql/tool-result-store-sql.d.ts +1 -1
- package/dist/stores-sql/tool-result-store-sql.js +4 -6
- package/dist/stores-sql/windowed-session-storage.d.ts +5 -0
- package/dist/stores-sql/windowed-session-storage.js +9 -0
- package/dist/submission-exit.d.ts +50 -0
- package/dist/submission-exit.js +108 -0
- package/dist/task-a2a.d.ts +3 -8
- package/dist/task-a2a.js +28 -30
- package/dist/task-cwd.d.ts +43 -7
- package/dist/task-cwd.js +11 -0
- package/dist/task-mcp.d.ts +3 -3
- package/dist/task-mcp.js +4 -4
- package/dist/task-settings.d.ts +14 -10
- package/dist/task-settings.js +19 -7
- package/dist/terminal.d.ts +27 -43
- package/dist/terminal.js +49 -14
- package/dist/tool-approval.d.ts +173 -163
- package/dist/tool-approval.js +247 -232
- package/dist/trace/core-keyset-guard.d.ts +13 -6
- package/dist/trace/core-vocab-wire.d.ts +95 -0
- package/dist/trace/core-vocab-wire.js +15 -0
- package/dist/trace/engine-notice-wire.d.ts +24 -21
- package/dist/trace/engine-notice-wire.js +7 -3
- package/dist/trace/exit-seat.d.ts +30 -4
- package/dist/trace/exit-seat.js +40 -36
- package/dist/trace/extension-call-face.d.ts +3 -2
- package/dist/trace/extension-call-face.js +3 -1
- package/dist/trace/ledger-events.d.ts +4 -7
- package/dist/trace/ledger-sink.d.ts +4 -31
- package/dist/trace/ledger-sink.js +0 -11
- package/dist/trace/model-segment.d.ts +5 -5
- package/dist/trace/model-segment.js +5 -5
- package/dist/trace/project.d.ts +59 -44
- package/dist/trace/project.js +60 -26
- package/dist/trace/redact.d.ts +135 -27
- package/dist/trace/redact.js +884 -260
- package/dist/trace/self-minted-wire.d.ts +567 -20
- package/dist/trace/self-minted-wire.js +205 -24
- package/dist/trace/wire-projection-faces.d.ts +5 -6
- package/dist/trace/wire-projection-faces.js +2 -2
- package/dist/upstream-body.d.ts +23 -0
- package/dist/upstream-body.js +16 -0
- package/dist/url-refusal.d.ts +3 -3
- package/dist/url-refusal.js +11 -4
- package/dist/user-authored-text.d.ts +1 -1
- package/dist/user-input-ledger.d.ts +7 -8
- package/dist/user-input-ledger.js +1 -1
- package/dist/web-admin-client/apply-effective.d.ts +6 -3
- package/dist/web-admin-client/apply-effective.js +33 -23
- package/dist/web-admin-client/apply-ledger.d.ts +16 -7
- package/dist/web-admin-client/apply-ledger.js +5 -2
- package/dist/web-admin-client/center-request.d.ts +2 -2
- package/dist/web-admin-client/center-request.js +15 -15
- package/dist/web-admin-client/effective-keys.d.ts +1 -1
- package/dist/web-admin-client/effective-keys.js +1 -1
- package/dist/web-admin-client/entry-metadata.d.ts +8 -0
- package/dist/web-admin-client/entry-metadata.js +13 -0
- package/dist/web-admin-client/http-client.d.ts +1 -1
- package/dist/web-admin-client/http-client.js +23 -4
- package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
- package/dist/web-admin-client/mcp-revocation.js +2 -1
- package/dist/web-admin-client/read-warnings.d.ts +1 -0
- package/dist/web-admin-client/read-warnings.js +1 -0
- package/dist/web-admin-client/restart-signal.js +8 -4
- package/dist/web-admin-client/skills-mcp.d.ts +2 -2
- package/dist/web-admin-client/types.d.ts +1 -2
- package/dist/workspace-space.d.ts +3 -2
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +4 -4
- package/docs/error-text-lexicon.json +317 -0
- package/package.json +8 -3
- package/scripts/drain-check-local.mjs +118 -147
- package/scripts/drain-check.mysql.sql +22 -2
- package/scripts/drain-check.pg.sql +22 -2
- package/scripts/embed-minimal.mjs +183 -0
- package/wire-changes/server@7.148.0.json +1517 -0
- package/wire-changes/server@7.149.0.json +372 -0
- package/dist/http/memory-control-plane-corrupt-reply.d.ts +0 -25
- package/dist/http/memory-control-plane-corrupt-reply.js +0 -19
- package/dist/http/memory-layer-reply.d.ts +0 -30
- package/dist/http/memory-layer-reply.js +0 -24
- package/dist/lsp/e2b-bridge.d.ts +0 -57
- package/dist/lsp/e2b-bridge.js +0 -139
- package/dist/lsp/e2b-manager.d.ts +0 -93
- package/dist/lsp/e2b-manager.js +0 -178
- package/dist/lsp/lsp-frames.d.ts +0 -14
- package/dist/lsp/lsp-frames.js +0 -25
- package/dist/lsp/manager.d.ts +0 -129
- package/dist/lsp/manager.js +0 -127
- package/dist/lsp/types.d.ts +0 -12
- package/dist/lsp/types.js +0 -2
- package/dist/lsp/ws-transport.d.ts +0 -40
- package/dist/lsp/ws-transport.js +0 -210
- package/dist/plain-string-record.js +0 -70
|
@@ -12,7 +12,6 @@ export function executionLaneCaps(lane) {
|
|
|
12
12
|
callerCwd: NO,
|
|
13
13
|
backgroundShell: NO,
|
|
14
14
|
scheduler: NO,
|
|
15
|
-
lsp: NO,
|
|
16
15
|
sandboxSendUserFile: NO,
|
|
17
16
|
remoteScratchpad: NO,
|
|
18
17
|
worktreeIsolation: NO,
|
|
@@ -23,7 +22,6 @@ export function executionLaneCaps(lane) {
|
|
|
23
22
|
callerCwd: SU,
|
|
24
23
|
backgroundShell: SU,
|
|
25
24
|
scheduler: SU,
|
|
26
|
-
lsp: SU,
|
|
27
25
|
sandboxSendUserFile: NO,
|
|
28
26
|
remoteScratchpad: NO,
|
|
29
27
|
worktreeIsolation: YES,
|
|
@@ -34,7 +32,6 @@ export function executionLaneCaps(lane) {
|
|
|
34
32
|
callerCwd: NO,
|
|
35
33
|
backgroundShell: YES,
|
|
36
34
|
scheduler: NO,
|
|
37
|
-
lsp: NO,
|
|
38
35
|
sandboxSendUserFile: YES,
|
|
39
36
|
remoteScratchpad: YES,
|
|
40
37
|
worktreeIsolation: NO,
|
|
@@ -45,7 +42,6 @@ export function executionLaneCaps(lane) {
|
|
|
45
42
|
callerCwd: NO,
|
|
46
43
|
backgroundShell: YES,
|
|
47
44
|
scheduler: NO,
|
|
48
|
-
lsp: NO,
|
|
49
45
|
sandboxSendUserFile: YES,
|
|
50
46
|
remoteScratchpad: YES,
|
|
51
47
|
worktreeIsolation: NO,
|
|
@@ -56,7 +52,6 @@ export function executionLaneCaps(lane) {
|
|
|
56
52
|
callerCwd: NO,
|
|
57
53
|
backgroundShell: NO,
|
|
58
54
|
scheduler: NO,
|
|
59
|
-
lsp: NO,
|
|
60
55
|
sandboxSendUserFile: SU,
|
|
61
56
|
remoteScratchpad: YES,
|
|
62
57
|
worktreeIsolation: NO,
|
|
@@ -67,7 +62,6 @@ export function executionLaneCaps(lane) {
|
|
|
67
62
|
callerCwd: NO,
|
|
68
63
|
backgroundShell: NO,
|
|
69
64
|
scheduler: NO,
|
|
70
|
-
lsp: NO,
|
|
71
65
|
sandboxSendUserFile: NO,
|
|
72
66
|
remoteScratchpad: NO,
|
|
73
67
|
worktreeIsolation: NO,
|
|
@@ -78,7 +72,6 @@ export function executionLaneCaps(lane) {
|
|
|
78
72
|
callerCwd: NO,
|
|
79
73
|
backgroundShell: NO,
|
|
80
74
|
scheduler: NO,
|
|
81
|
-
lsp: NO,
|
|
82
75
|
sandboxSendUserFile: NO,
|
|
83
76
|
remoteScratchpad: YES,
|
|
84
77
|
worktreeIsolation: NO,
|
|
@@ -89,7 +82,6 @@ export function executionLaneCaps(lane) {
|
|
|
89
82
|
callerCwd: YES,
|
|
90
83
|
backgroundShell: NO,
|
|
91
84
|
scheduler: NO,
|
|
92
|
-
lsp: NO,
|
|
93
85
|
sandboxSendUserFile: NO,
|
|
94
86
|
remoteScratchpad: YES,
|
|
95
87
|
worktreeIsolation: NO,
|
|
@@ -263,20 +255,6 @@ export function handsOnWorkerFilePlane(lane) {
|
|
|
263
255
|
const block = laneBlock(lane, NO_SUB_KNOBS);
|
|
264
256
|
return block.io && block.hostLocalPaths;
|
|
265
257
|
}
|
|
266
|
-
export function laneBindsReads(lane) {
|
|
267
|
-
switch (lane) {
|
|
268
|
-
case "host":
|
|
269
|
-
return true;
|
|
270
|
-
case "none":
|
|
271
|
-
case "e2b":
|
|
272
|
-
case "k8s":
|
|
273
|
-
case "ssh":
|
|
274
|
-
case "adb":
|
|
275
|
-
case "device":
|
|
276
|
-
case "local-docker":
|
|
277
|
-
return false;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
258
|
export function laneMeasuresHome(lane) {
|
|
281
259
|
switch (lane) {
|
|
282
260
|
case "k8s":
|
|
@@ -349,14 +327,28 @@ export function buildLaneHomeBootNote(deployment) {
|
|
|
349
327
|
return { event: LANE_HOME_UNDECLARED_EVENT, note: buildHomeAbsentNote(homeLane, "REMOTE_EXEC_HOME_DIR is unset, and this lane cannot read its execution environment's home", DECLARE_HOME_REMEDY) };
|
|
350
328
|
return { event: LANE_HOME_UNMEASURED_EVENT, note: buildHomeUnmeasuredNote(homeLane, home) };
|
|
351
329
|
}
|
|
330
|
+
export function buildReadDenyFloorSentence(lane, outcome) {
|
|
331
|
+
const env = `the execution environment (REMOTE_EXEC=${lane}) does not keep the read-deny byte floor`;
|
|
332
|
+
switch (outcome) {
|
|
333
|
+
case "ran":
|
|
334
|
+
return (`This run's read-deny rules are not byte-enforced: ${env} — a path a rule refuses is refused when a command names it, ` +
|
|
335
|
+
`but a program a command runs can still open it (a recursive read under a directory reads the files below it, denied ones included), ` +
|
|
336
|
+
`and their bytes can reach the conversation. READ_DENY_FLOOR_REQUIRED is not set, so the run went ahead; set READ_DENY_FLOOR_REQUIRED=true to refuse such runs instead.`);
|
|
337
|
+
case "refused":
|
|
338
|
+
return (`READ_DENY_FLOOR_REQUIRED=true, and ${env} (a program a command runs could open a path a read-deny rule refuses): ` +
|
|
339
|
+
`a run with read-deny rules is refused before any command starts (config.read_deny_floor_unkept; a synchronous submit answers 409). ` +
|
|
340
|
+
`Run on an execution environment that keeps the floor, or unset READ_DENY_FLOOR_REQUIRED to let such runs go ahead with a notice.`);
|
|
341
|
+
default: {
|
|
342
|
+
const unhandled = outcome;
|
|
343
|
+
throw new Error(`unhandled read-deny floor outcome: ${String(unhandled)}`);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
352
347
|
export function buildReadDenyFloorUnkeptNote(deployment) {
|
|
353
348
|
if (!deployment.readDenyFloorRequired)
|
|
354
349
|
return undefined;
|
|
355
350
|
if (capabilitiesFor(deployment)?.keepsReadFloor === true)
|
|
356
351
|
return undefined;
|
|
357
|
-
return (
|
|
358
|
-
`the read-deny table refuses). Every run whose read-deny table has rows — the shipped default tiers put rows there unless READ_DENY_BUILTIN_TIERS=none — ` +
|
|
359
|
-
`is refused before any command starts (config.read_deny_floor_unkept; a synchronous submit answers 409). ` +
|
|
360
|
-
`Either run on a lane that keeps the floor, or unset READ_DENY_FLOOR_REQUIRED to run with one operator notice per run instead.`);
|
|
352
|
+
return buildReadDenyFloorSentence(deployment.remoteExec.provider, "refused");
|
|
361
353
|
}
|
|
362
354
|
//# sourceMappingURL=execution-lane-caps.js.map
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* 委派分区行读作「不在」。
|
|
10
10
|
* · **读只有一只**:会话店的执行席 {@link ExecutionPlacementSeat.read}(一次行读:住客 + 格;行不在 / 委派分区行 ⇒ `undefined`;读故障抛,不吞成 `absent`)。
|
|
11
11
|
* 跨行的聚合也只有一只:设备店的绑定数 `countDeviceBindings`(writer(device, D) 的格数 = {@link boundDeviceOf} 的聚合;只交数,不交根 id)。
|
|
12
|
-
* · **写只按住客谓词** `(root, incarnation, owner) ∧ placement_kind IS NULL`:住客换了(
|
|
12
|
+
* · **写只按住客谓词** `(root, incarnation, owner) ∧ placement_kind IS NULL`:住客换了(删后重建,哪怕同一属主)= 这一格不在 ⇒ 落空;
|
|
13
13
|
* 0 行一律按住客复读分类({@link settledPlaceOutcome} / {@link settledMirrorOutcome} / {@link settledDeviceBindOutcome}),**永不对现住客重试**。
|
|
14
14
|
* · **没有的转换**:writer ↔ mirror、writer(L) → writer(L')(device 车道的换绑 writer(device, D) → writer(device, D') 除外,它有自己的语句与门)。
|
|
15
15
|
* · **放置存在 ⇒ 住客存在**:放置是行的列 / 格,删会话即删放置;建行恒 absent(SQL 建行 INSERT 列名显式;local 新格整格新铸),导入新建的行同锁落 mirror。
|
|
@@ -22,6 +22,7 @@ import { type SessionHead } from "@sema-agent/core";
|
|
|
22
22
|
import type { DeviceOwner } from "./device-store.js";
|
|
23
23
|
import type { ExecutionLane } from "./execution-lane-caps.js";
|
|
24
24
|
import type { SessionFace } from "./session-incarnation.js";
|
|
25
|
+
import type { SessionWrite } from "./plugins/store-backend.js";
|
|
25
26
|
/** writer(device, D) 的 D:设备、绑定属主(= 设备属主)、换绑序号、放下时刻(ISO)。 */
|
|
26
27
|
export interface ExecutionDeviceCell {
|
|
27
28
|
readonly id: string;
|
|
@@ -108,13 +109,22 @@ export interface UnusableArchive {
|
|
|
108
109
|
readonly fault: unknown;
|
|
109
110
|
}
|
|
110
111
|
export declare function isUnusableArchive(x: object | undefined): x is UnusableArchive;
|
|
112
|
+
/** {@link LocalPlacementBackfillSeat.backfill} 的结局(随 M32):写成了 writer · 这一格此刻不归回填(行不在 / placed / 已有执行位 / forking)· 车道表不是一项而这一格要回填(不写)· 存档读不出(点名跳过)。 */
|
|
113
|
+
export type LocalPlacementBackfillOutcome = {
|
|
114
|
+
readonly outcome: "placed";
|
|
115
|
+
} | {
|
|
116
|
+
readonly outcome: "skipped";
|
|
117
|
+
} | {
|
|
118
|
+
readonly outcome: "ambiguous";
|
|
119
|
+
} | UnusableArchive;
|
|
111
120
|
/**
|
|
112
|
-
* 一次性迁移 M32 **local 腿**的席(随 M32 · 窗口见 `plugins/one-time-migrations.ts` 登记表;只 local 有:SQL 的行就是会话,没有「会话元数据格缺 ∧ 存档读不出」这一形)
|
|
113
|
-
*
|
|
114
|
-
*
|
|
121
|
+
* 一次性迁移 M32 **local 腿**的席(随 M32 · 窗口见 `plugins/one-time-migrations.ts` 登记表;只 local 有:SQL 的行就是会话,没有「会话元数据格缺 ∧ 存档读不出」这一形)。
|
|
122
|
+
* 唯一成员 `backfill(root, lanes)`:在这只会话的写锁里**观察一次**(与执行席的读同一只观察),absent 的那一格 ∧ 车道表只有一项 ⇒ **一笔**写成 writer(格缺就在同一笔里铸化身);
|
|
123
|
+
* 车道表不是一项 ⇒ `ambiguous`、不写;观察抛(这只会话的存档读不出)⇒ 答 {@link UnusableArchive} 而不抛 —— 开机回填不动存档、只补一格放置,读不出的会话由它点名跳过
|
|
124
|
+
* (该会话的请求照旧答存档的故障)。观察与写在同一节锁里:读与写之间没有别的写者。
|
|
115
125
|
*/
|
|
116
|
-
export interface LocalPlacementBackfillSeat
|
|
117
|
-
|
|
126
|
+
export interface LocalPlacementBackfillSeat {
|
|
127
|
+
backfill(root: string, lanes: readonly ExecutionLane[]): Promise<LocalPlacementBackfillOutcome>;
|
|
118
128
|
}
|
|
119
129
|
/** wire 投影(新读面 + 受理回声共用)。 */
|
|
120
130
|
export type ExecutionPlacementView = {
|
|
@@ -135,7 +145,7 @@ export type ExecutionPlacementView = {
|
|
|
135
145
|
export declare function executionPlacementView(cell: ExecutionPlacementCell): ExecutionPlacementView;
|
|
136
146
|
/**
|
|
137
147
|
* 住客谓词的 JS 读法(SQL `incarnation = ? AND owner <=> ?` 的对位)= core 的行期望判官 `sessionRowMatches`(会话行格写原语锁内判的也是它,
|
|
138
|
-
* `session-row.ts` 的 `judgeSessionRowWrite`):属主与化身两样都没变才是判过的那一位 —— 同一化身的属主会变(
|
|
148
|
+
* `session-row.ts` 的 `judgeSessionRowWrite`):属主与化身两样都没变才是判过的那一位 —— 同一化身的属主会变(identical 重戳、
|
|
139
149
|
* SQL 导入提交点改属主)。两侧收「属主 + 化身」那一读:活住客(`SessionFace`)与店的头(`SessionHead`,门判过的那一读)。三处调用方:
|
|
140
150
|
* · 执行格的写口判官(本模块)与执行上下文解析器步 ① 的 `judged` 复核(`http/execution-context.ts`)—— 一侧恒是执行席的读数(住客经 `sessionFaceFromRow` 解码,令牌非空);
|
|
141
151
|
* · 会话通知门投递前的住客复核(`session-notify-door.ts` 的 `recheck`)—— 两侧都是会话店的头读:不铸化身的店上**两侧都没有令牌**。
|
|
@@ -163,8 +173,8 @@ export declare class SessionForkInProgressError extends Error {
|
|
|
163
173
|
}
|
|
164
174
|
/**
|
|
165
175
|
* 写口在写事务 / 写锁内的认领读命中:SQL = 读写序律(`plugins/execution-placement-sql.ts` 的 `lockRootAndReadClaim`:改根住客 / 放置的写者在自己的事务里先锁根
|
|
166
|
-
* `session_meta` 行、再锁定读 `task_active(root)`,读到认领 ⇒ 回滚、一个字节不写、抛它);local =
|
|
167
|
-
*
|
|
176
|
+
* `session_meta` 行、再锁定读 `task_active(root)`,读到认领 ⇒ 回滚、一个字节不写、抛它);local = 这只会话的写锁(= 根行锁)内读 run 店的认领(`markMirror` 返回 `active` 臂;
|
|
177
|
+
* 三个导入写口、删除与 placed 行的终结经 {@link judgeSessionWrite} 抛它)—— device 首绑在写事务内的认领读只在 SQL 后端(local 没有 device 工厂)。
|
|
168
178
|
* 具名类型、**不带 wire 码**:各门按自己的既有码答(导入 409 `session_active`、删除 409 `conflict.session_active_run`),体带 `activeTaskId`。
|
|
169
179
|
*/
|
|
170
180
|
export declare class SessionActiveRunError extends Error {
|
|
@@ -182,21 +192,51 @@ export declare const WRITABLE: "writable";
|
|
|
182
192
|
export declare function settledPlaceOutcome(root: string, reading: ExecutionPlacementReading | undefined, occupant: SessionFace, wanted: ExecutionWriterCell): PlaceOutcome | typeof WRITABLE;
|
|
183
193
|
/** markMirror 的唯一判官(认领那一半在本判官之后,SQL 与 local 各在自己的写事务 / 写锁内判):行不在 / 住客不同 ⇒ `gone`;writer ⇒ `writer`;mirror ⇒ `mirrored`(幂等,零写);absent ⇒ {@link WRITABLE};forking ⇒ 抛。 */
|
|
184
194
|
export declare function settledMirrorOutcome(root: string, reading: ExecutionPlacementReading | undefined, occupant: SessionFace): MarkMirrorOutcome | typeof WRITABLE;
|
|
185
|
-
/**
|
|
186
|
-
|
|
187
|
-
|
|
195
|
+
/**
|
|
196
|
+
* 删净在删会话的执行体(写词 `erase`;`session-erase.ts`)在根行锁里读到:这一行此刻**不是**这一次删除的在删态 —— 另一次删除接管了它(换了令牌)、它已经删完(行不在 / 同 id 的新住客)。
|
|
197
|
+
* 一个字节不删。具名类型、不带 wire 码:协调器把它读作「这次尝试被接管」(路由 409 `conflict.session_deleting`)。
|
|
198
|
+
*/
|
|
199
|
+
export declare class SessionDeletionSupersededError extends Error {
|
|
200
|
+
readonly sessionId: string;
|
|
201
|
+
constructor(sessionId: string);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* 改动会话树根的写(导入三写口 / 撤回 / placed 行的终结 / 留存删除)在根行锁里读到这一行**在删**(会话三态,`src/session-deletion.ts`):一次删除独占着它,一个字节不写。
|
|
205
|
+
* 带 wire 码 `conflict.session_deleting`(全局兜底映射 409;导入路由的属主门读头 —— 在删读作不在 ⇒ 404 —— 只有门判过之后才落围栏的那一拍走到这里)。
|
|
206
|
+
* 留存删除读作「本轮跳过这棵树」(在删的行由删除协调器删完,留存不当第二个收尾者);撤回读作留(`claim`:一次删除持有这一行)。
|
|
207
|
+
*/
|
|
208
|
+
export declare class SessionDeletingError extends Error {
|
|
209
|
+
readonly sessionId: string;
|
|
210
|
+
readonly code = "conflict.session_deleting";
|
|
211
|
+
constructor(sessionId: string);
|
|
212
|
+
}
|
|
213
|
+
/** {@link judgeSessionWrite} 的判:放行,或拒(拒的载荷是写口抛的那只 typed 错;SQL 的事务内钩原样交给店,local 直接抛)。 */
|
|
214
|
+
export type SessionWriteJudgement = "proceed" | {
|
|
215
|
+
readonly refuse: SessionActiveRunError | SessionWriterPresentError | SessionForkInProgressError | SessionDeletionSupersededError | SessionDeletingError;
|
|
188
216
|
};
|
|
189
217
|
/**
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
|
|
193
|
-
|
|
218
|
+
* 一个写词碰不碰这一行的执行格(写词闭集的**唯一**分派,穷尽 —— 加一个词在这里编译红):`import` ⇒ 碰(判写者 / fork 中间态,放行后调用方落 mirror);
|
|
219
|
+
* `delete` / `retention-delete` ⇒ 不碰(删除不问执行格:格随这一行一起走)。判官 {@link judgeSessionWrite} 与 SQL 事务内钩的写派(放行后落不落 mirror)都读它。
|
|
220
|
+
*/
|
|
221
|
+
export declare function sessionWriteTouchesCell(op: SessionWrite["op"]): boolean;
|
|
222
|
+
/**
|
|
223
|
+
* 改动会话树根的写(闭集 = `SessionWrite.op`:`import` 导入三写口落定这一行 / `delete` 提交出口的条件撤回与 placed 行的终结 / `retention-delete` 留存删一棵树的根 /
|
|
224
|
+
* `erase` 删净在删会话的执行体)落定**之前**的唯一判官,**连序**在内(SQL 的事务内钩与 local 的写锁内同调,两店不各抄一份):
|
|
225
|
+
* 先读这一行的在删令牌:
|
|
226
|
+
* · `erase` —— 令牌等于 `write.token` ⇒ 放行,否则 {@link SessionDeletionSupersededError}(认领在围栏那一刻判过,在删期间认领落不下;不读认领、不读格);
|
|
227
|
+
* · 其余三个词 —— 在删 ⇒ {@link SessionDeletingError}(一次删除独占着这一行;任何别的写者 / 删除者都不碰它);
|
|
228
|
+
* 不在删 ⇒ 其余三个词再读认领 —— 在 ⇒ {@link SessionActiveRunError}(活 run 挂着的根不换内容、不删);认领不在 ⇒ 按词:
|
|
229
|
+
* · `import` 再读这一格 —— `writer` ⇒ {@link SessionWriterPresentError}(带车道)、`forking` ⇒ {@link SessionForkInProgressError};`absent` / `mirror` ⇒ 放行(落 mirror 由调用方写);
|
|
230
|
+
* · `delete` / `retention-delete` ⇒ 放行(删除不问执行格:格随这一行一起走)。
|
|
231
|
+
* 读口由调用方给、**按需读**:在删令牌每个词都读;认领在 ⇒ 不读格;删除三词从不读格(SQL:不发格那一句锁定读;local:不探存档)。
|
|
232
|
+
* 读与判必须在写者独占的同一刻里:SQL = 锁根行之后、同一连接;local = 这只会话的写锁(= 根行锁)内、第一笔写之前(取锁 → 读认领 → 判 → 写)。
|
|
194
233
|
* 返回判、不抛:拒之后一个字节不写由调用方保证(SQL 回滚,local 判在第一笔写之前)。
|
|
195
234
|
*/
|
|
196
|
-
export declare function
|
|
235
|
+
export declare function judgeSessionWrite(write: SessionWrite, read: {
|
|
197
236
|
readonly claim: () => Promise<string | null | undefined>;
|
|
198
237
|
readonly cell: () => Promise<ExecutionPlacementCell>;
|
|
199
|
-
|
|
238
|
+
readonly deleting: () => Promise<string | null>;
|
|
239
|
+
}): Promise<SessionWriteJudgement>;
|
|
200
240
|
/** device 车道首绑(absent → writer(device, D) 或 writer(device, ∅) → writer(device, D))的结果(设备店的事务 / 内存参照实现同调)。 */
|
|
201
241
|
export type DeviceBindOutcome = {
|
|
202
242
|
readonly outcome: "bound";
|
|
@@ -94,10 +94,49 @@ export function settledMirrorOutcome(root, reading, occupant) {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
export
|
|
97
|
+
export class SessionDeletionSupersededError extends Error {
|
|
98
|
+
sessionId;
|
|
99
|
+
constructor(sessionId) {
|
|
100
|
+
super(`session ${sessionId} is no longer held by this deletion attempt (another deletion took it over, or it is already gone) — nothing was deleted by this attempt`);
|
|
101
|
+
this.sessionId = sessionId;
|
|
102
|
+
this.name = "SessionDeletionSupersededError";
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export class SessionDeletingError extends Error {
|
|
106
|
+
sessionId;
|
|
107
|
+
code = "conflict.session_deleting";
|
|
108
|
+
constructor(sessionId) {
|
|
109
|
+
super(`session ${sessionId} is being deleted — this write was refused inside its transaction; nothing was written`);
|
|
110
|
+
this.sessionId = sessionId;
|
|
111
|
+
this.name = "SessionDeletingError";
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export function sessionWriteTouchesCell(op) {
|
|
115
|
+
switch (op) {
|
|
116
|
+
case "import":
|
|
117
|
+
return true;
|
|
118
|
+
case "delete":
|
|
119
|
+
case "retention-delete":
|
|
120
|
+
case "erase":
|
|
121
|
+
return false;
|
|
122
|
+
default: {
|
|
123
|
+
const unknownOp = op;
|
|
124
|
+
throw new Error(`sessionWriteTouchesCell: no write ${JSON.stringify(unknownOp)}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export async function judgeSessionWrite(write, read) {
|
|
129
|
+
const root = write.rootSessionId;
|
|
130
|
+
const deleting = await read.deleting();
|
|
131
|
+
if (write.op === "erase")
|
|
132
|
+
return deleting === write.token ? "proceed" : { refuse: new SessionDeletionSupersededError(root) };
|
|
133
|
+
if (deleting !== null)
|
|
134
|
+
return { refuse: new SessionDeletingError(root) };
|
|
98
135
|
const claim = await read.claim();
|
|
99
136
|
if (claim !== null && claim !== undefined)
|
|
100
137
|
return { refuse: new SessionActiveRunError(root, claim) };
|
|
138
|
+
if (!sessionWriteTouchesCell(write.op))
|
|
139
|
+
return "proceed";
|
|
101
140
|
const cell = await read.cell();
|
|
102
141
|
switch (cell.role) {
|
|
103
142
|
case "writer":
|
|
@@ -109,7 +148,7 @@ export async function judgeImportWrite(root, read) {
|
|
|
109
148
|
return "proceed";
|
|
110
149
|
default: {
|
|
111
150
|
const unknownRole = cell;
|
|
112
|
-
throw new Error(`
|
|
151
|
+
throw new Error(`judgeSessionWrite: no arm for ${JSON.stringify(unknownRole)}`);
|
|
113
152
|
}
|
|
114
153
|
}
|
|
115
154
|
}
|
package/dist/field-conflict.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** 冲突的类(
|
|
2
|
-
export declare const
|
|
1
|
+
/** 冲突的类(闭集;拒体根上的 `reason`)。同一个约束的几个拒点同一个词;新增一类见文件头。 */
|
|
2
|
+
export declare const FIELD_CONFLICT_REASONS: readonly ["cascade_verify", "image_profile", "resume_anchor", "system_prompt_fold", "file_history_restore", "skills_disabled", "existing_session", "fork_target", "scratchpad_root", "ask_answer", "policy_person_ask", "plan_edit", "plan_mode_after", "bound_call_door", "remember_decision", "approval_feedback"];
|
|
3
3
|
/** 冲突的类(闭集词)。 */
|
|
4
|
-
export type
|
|
4
|
+
export type FieldConflictReason = (typeof FIELD_CONFLICT_REASONS)[number];
|
|
5
5
|
/**
|
|
6
6
|
* 每一类允许点名的请求体坐标(铸点的 `fields` 按所属类的行检查)。键序无意义;值是该类可出现的坐标的联合。
|
|
7
7
|
* 动态下标的坐标用模板字面量型(`agents[1].skills`)。
|
|
@@ -29,17 +29,13 @@ export interface FieldConflictMeasure {
|
|
|
29
29
|
readonly count: number;
|
|
30
30
|
readonly cap: number;
|
|
31
31
|
}
|
|
32
|
-
/**
|
|
33
|
-
export type
|
|
34
|
-
readonly
|
|
32
|
+
/** 一处冲突的机读位(原样摊在拒体根上:`sendError` 的 extra / `HttpError.extra` / `refusalBody` 的 facts;型别名而不是接口 —— 要能直接当 `Record<string, unknown>` 用)。 */
|
|
33
|
+
export type FieldConflictFacts<K extends FieldConflictReason = FieldConflictReason> = {
|
|
34
|
+
readonly reason: K;
|
|
35
35
|
readonly fields: readonly FieldConflictCoordinates[K][];
|
|
36
36
|
} & Partial<FieldConflictMeasure>;
|
|
37
|
-
/** 一处冲突的机读位(原样进拒体:`sendError` 的 extra / `HttpError.extra` / 手拼体的展开;型别名而不是接口 —— 要能直接当 `Record<string, unknown>` 用)。 */
|
|
38
|
-
export type FieldConflictFacts<K extends FieldConflictKind = FieldConflictKind> = {
|
|
39
|
-
readonly detail: FieldConflictDetail<K>;
|
|
40
|
-
};
|
|
41
37
|
/**
|
|
42
38
|
* 铸一处冲突的机读位。`fields` 至少一个坐标、主语在前;`measure` 只有折叠上限那一类给。
|
|
43
39
|
*/
|
|
44
|
-
export declare function fieldConflictFacts<K extends
|
|
40
|
+
export declare function fieldConflictFacts<K extends FieldConflictReason>(reason: K, fields: readonly [FieldConflictCoordinates[K], ...FieldConflictCoordinates[K][]], measure?: FieldConflictMeasure): FieldConflictFacts<K>;
|
|
45
41
|
//# sourceMappingURL=field-conflict.d.ts.map
|
package/dist/field-conflict.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const FIELD_CONFLICT_REASONS = [
|
|
2
2
|
"cascade_verify",
|
|
3
3
|
"image_profile",
|
|
4
4
|
"resume_anchor",
|
|
@@ -16,7 +16,7 @@ export const FIELD_CONFLICT_KINDS = [
|
|
|
16
16
|
"remember_decision",
|
|
17
17
|
"approval_feedback",
|
|
18
18
|
];
|
|
19
|
-
export function fieldConflictFacts(
|
|
20
|
-
return {
|
|
19
|
+
export function fieldConflictFacts(reason, fields, measure) {
|
|
20
|
+
return { reason, fields: [...fields], ...(measure === undefined ? {} : { count: measure.count, cap: measure.cap }) };
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=field-conflict.js.map
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* ## 两件事,两个单点
|
|
14
14
|
* · 「这台部署有没有文件历史店」只在 {@link assembleFileHistory} 判一次(后端在即在,**与旋钮无关**),产出两张脸:
|
|
15
|
-
* **店** `store` 喂 core 的 `RunnerDeps.fileHistoryStore`(还原族)、rewind 族能力位(`
|
|
15
|
+
* **店** `store` 喂 core 的 `RunnerDeps.fileHistoryStore`(还原族)、rewind 族能力位(`restoreFiles` /
|
|
16
16
|
* `rewindFilesTo` / `sessionSync`)与 2c sync 路由族;**擦除脸** `erasure` = 店的**只有删除类动词**的收窄视图,喂 E21 在线删除
|
|
17
17
|
* (`boot/session-faces.ts`)与孤儿 blob GC(`boot/reapers.ts`)。旋钮从不管擦除:关掉捕获的部署照样要能删掉已捕获的文件字节。
|
|
18
18
|
* · 「捕不捕」只在 {@link fileHistoryCaptureOf} 判一次(纯函数,输入 = 店在不在 + 旋钮)。两个消费点喂它同一组输入:
|
|
@@ -58,8 +58,8 @@ export declare function assembleFileHistory(backend: StoreBackend | undefined):
|
|
|
58
58
|
* 「捕不捕」的**唯一**判定(纯函数):能力词。`store` = 装配出来的店(在不在),`knob` = 部署旋钮 `FILE_HISTORY_CAPTURE`
|
|
59
59
|
* (`config.fileHistoryCapture`)。从**装配结果**派生,不照旋钮字面回声:后端本来就没有这只店的部署同样是 `off`。
|
|
60
60
|
*
|
|
61
|
-
* 与 `
|
|
62
|
-
* `
|
|
61
|
+
* 与 `restoreFiles` 分叉([ref] 当时写下的分叉条件,自 [ref] 成真):本词答「这台部署捕不捕、能不能按 run 关掉」,
|
|
62
|
+
* `restoreFiles` 答「这台部署能不能还原」—— 旋钮关的部署本词 `off` 而 `restoreFiles` 仍为真。
|
|
63
63
|
*/
|
|
64
64
|
export declare function fileHistoryCaptureOf(store: object | undefined, knob: boolean): FileHistoryCapture;
|
|
65
65
|
/**
|
|
@@ -47,6 +47,19 @@ export interface FleetTaskRow {
|
|
|
47
47
|
* 改写成同一串;出生点校验过的字符集里也没有可脱敏的形。残余(已披露)= 有人把真凭据当队友名写进
|
|
48
48
|
* `Agent({name})`,那一串原样上 fleet 面。展示名 `name` 照旧脱敏。 */
|
|
49
49
|
agentName?: string;
|
|
50
|
+
/** 这一行**跑在哪个模型上** —— core `BackgroundChildEvent.model`(spawn / tick 帧述它)**逐字**过境:引擎在 spawn 判定点解析出的
|
|
51
|
+
* 模型(per-call / agent 定义 / 继承;能解析到服务目录的就是服务那个目录 id)。它**不是**同一子代 `task_progress.model`
|
|
52
|
+
* (那条腿自己 prepare 出的 id)—— 后者才是权威读数,本键是行级便利位:父 run 的活流结束后只剩 fleet 行的消费端,
|
|
53
|
+
* 从这里读得到,不必另存一份副本(一个事实一个源)。
|
|
54
|
+
* 🔴 **缺席是事实,不是缺口**:引擎没述(委派链上没有任何一处点名模型 ⇒ 子代跑 `subagent` 角色、具体 id 到它自己 prepare 才定;
|
|
55
|
+
* 留存账本的唤醒腿帧不带;老引擎)⇒ 键**不发** —— 不铸、不回落(不拿别处读到的值顶,空串也不补;**空串视同没述**)。
|
|
56
|
+
* 🔴 **一个事实一个源 = 帧本身 + 总线的 MERGE 底座**,发布方不私存副本:start 与 tick 帧述它;terminal 帧本身不述(core 7.66.0),
|
|
57
|
+
* finish 行带的是总线上这一行**已有**的值 —— 与 `name` / `agentType` 同一个底座,所以行已离场之后才到的终态帧(陈述级退场后)是稀疏底座,
|
|
58
|
+
* 三者同缺席。复活(同 id 再 spawn)是新的一代:行已随终态离场,新一代的值只来自这一代引擎说过的话。前代迟到的 tick 被总线的判代闸
|
|
59
|
+
* 整帧丢掉,连同它带的 `model`。
|
|
60
|
+
* 未署名行(无 `sessionId`)在 `?session=` 降权投影里被擦(别的会话的子代跑什么模型 = 会话内容,与 `agentType` 同判)。
|
|
61
|
+
* ADDITIVE / tolerate-absent。 */
|
|
62
|
+
model?: string;
|
|
50
63
|
/** Owning principal (= the run's scope). The `/v1/fleet/stream` route filters to the caller's scope (owner-gated)
|
|
51
64
|
* unless the caller is fleet-wide (operator / trace-token). NOT rendered — a tenant-isolation field. */
|
|
52
65
|
scope?: string;
|
|
@@ -134,8 +147,10 @@ export interface FleetTaskRow {
|
|
|
134
147
|
* (`${runId} ${childTaskId}`)。此形只在**没有 BCE 真行**的前台 delegation 上保留(同步腿委派的
|
|
135
148
|
* 子代不过 background-child registry ⇒ 不让位就没有行);tick 点名的是 BCE 真行(后台子代的 tick 带它的行 id;workflow agent 的
|
|
136
149
|
* tick 带会话 id、经让位登记簿换成行 id),本车道**让位不铸**(双生行退役)。
|
|
137
|
-
*
|
|
138
|
-
*
|
|
150
|
+
* 🔴 **这是契约形,不是过渡形**:引擎的契约是前台(同步)委派的子代 —— plain 与 fork 两腿 —— 不登 background-child registry、
|
|
151
|
+
* 没有 BCE 帧,它在舰队上的身份就是宿主由 `task_progress` 派生的这一行(`taskId` = 子会话 id)。一个子代恰一个行写者,由 id 形决定:
|
|
152
|
+
* 带 `sourceLane:"run-leg"` 的行与 a\* 行**不会**同时描述同一个 agent(偏离记录:引擎加「前台 → 后台移交」动词那一天,前台子代改登 registry 行,
|
|
153
|
+
* 本车道随之退役)。消费端不需要再自己发明「复合 id 首段==parentId 且撞 (parentId,name)」那类集合级判据(cli 侧的防御税)。
|
|
139
154
|
* ADDITIVE / tolerate-absent。 */
|
|
140
155
|
sourceLane?: "run-leg";
|
|
141
156
|
/**
|
|
@@ -713,7 +728,10 @@ export declare function fleetRunResiduals(result: {
|
|
|
713
728
|
toolCalls?: number;
|
|
714
729
|
costMicroUsd?: number;
|
|
715
730
|
};
|
|
716
|
-
} | null | undefined
|
|
731
|
+
} | null | undefined,
|
|
732
|
+
/** 这条 run 的失败码 —— 调用方手上的那一份:run 行喂入的 = 行的码列(`RunRecord.errorCode`,唯一读法;收割 / 判决行的 `result` 是空的,码只在列上),
|
|
733
|
+
* 活结果喂入的 = `failureCodeOf(result.terminal)`。本函数不再从 blob 读码。 */
|
|
734
|
+
errorCode: string | null | undefined): FleetRunResiduals;
|
|
717
735
|
/**
|
|
718
736
|
* [ref]-B (core 1.240.0) — the PROCESS-LEVEL background-child fleet publisher, wired once
|
|
719
737
|
* onto `RunnerDeps.onBackgroundChildEvent`. Unlike {@link fleetRunPublisher} (per-leg: dies at leg settle —
|
package/dist/fleet/fleet-bus.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from "node:events";
|
|
2
2
|
import { DURABLE_AGENT_HANDLE_RE, deriveAgentDisplayStatus, runParkedOf } from "@sema-agent/core";
|
|
3
|
-
import { persistedPlaneOf } from "../terminal.js";
|
|
4
3
|
import { takeWorkspaceSnapshotFailure } from "./workspace-snapshot-residual.js";
|
|
5
4
|
import { recordFailOpen } from "../observability/fail-open.js";
|
|
6
5
|
import { redactSecrets } from "../trace/redact.js";
|
|
@@ -280,6 +279,30 @@ export function fleetRunPublisher(bus, run) {
|
|
|
280
279
|
return u.totalTokens;
|
|
281
280
|
return (u.totalInputTokens ?? 0) + (u.outputTokens ?? 0);
|
|
282
281
|
};
|
|
282
|
+
const mintRunLegRow = (taskId, ev, parentId) => {
|
|
283
|
+
const cid = childId(taskId);
|
|
284
|
+
if (yieldToBackgroundChildLane(taskId, cid, ev.name))
|
|
285
|
+
return;
|
|
286
|
+
children.add(cid);
|
|
287
|
+
const childName = ev.name !== undefined ? redactSecrets(ev.name) : undefined;
|
|
288
|
+
if (!childStartedAt.has(cid))
|
|
289
|
+
childStartedAt.set(cid, Date.now());
|
|
290
|
+
const toolUses = toolUsesOf(ev.usage);
|
|
291
|
+
bus.publishTask({
|
|
292
|
+
id: cid,
|
|
293
|
+
sourceLane: "run-leg",
|
|
294
|
+
...(childName !== undefined ? { name: childName, agentType: childName } : {}),
|
|
295
|
+
parentId,
|
|
296
|
+
scope: run.scope,
|
|
297
|
+
...sessionField,
|
|
298
|
+
...workflowRunIdField(ev),
|
|
299
|
+
status: tickStatus(ev.status),
|
|
300
|
+
tokens: sumTokens(ev.usage),
|
|
301
|
+
...(typeof ev.seq === "number" ? { cycleSeq: ev.seq } : {}),
|
|
302
|
+
...(toolUses !== undefined ? { toolUses } : {}),
|
|
303
|
+
elapsedMs: Date.now() - childStartedAt.get(cid),
|
|
304
|
+
});
|
|
305
|
+
};
|
|
283
306
|
return {
|
|
284
307
|
onStart() {
|
|
285
308
|
bus.publishTask({ id: run.runId, ...(run.name !== undefined ? { name: run.name } : {}), ...(run.description ? { description: run.description } : {}), scope: run.scope, ...sessionField, status: "running", tokens: 0, elapsedMs: 0 });
|
|
@@ -299,14 +322,7 @@ export function fleetRunPublisher(bus, run) {
|
|
|
299
322
|
bus.publishTask({ id: run.runId, tokens, elapsedMs: Date.now() - startedAt });
|
|
300
323
|
}
|
|
301
324
|
else if (ev.type === "task_progress" && ev.taskId) {
|
|
302
|
-
|
|
303
|
-
if (yieldToBackgroundChildLane(ev.taskId, cid, ev.name))
|
|
304
|
-
return;
|
|
305
|
-
children.add(cid);
|
|
306
|
-
const childName = ev.name !== undefined ? redactSecrets(ev.name) : undefined;
|
|
307
|
-
if (!childStartedAt.has(cid))
|
|
308
|
-
childStartedAt.set(cid, Date.now());
|
|
309
|
-
bus.publishTask({ id: cid, sourceLane: "run-leg", ...(childName !== undefined ? { name: childName, agentType: childName } : {}), parentId: run.runId, scope: run.scope, ...sessionField, ...workflowRunIdField(ev), status: tickStatus(ev.status), tokens: sumTokens(ev.usage), ...(typeof ev.seq === "number" ? { cycleSeq: ev.seq } : {}), ...(() => { const t = toolUsesOf(ev.usage); return t !== undefined ? { toolUses: t } : {}; })(), elapsedMs: Date.now() - childStartedAt.get(cid) });
|
|
325
|
+
mintRunLegRow(ev.taskId, ev, run.runId);
|
|
310
326
|
}
|
|
311
327
|
else if (ev.type === "tool_start" && ev.toolName) {
|
|
312
328
|
bus.publishTask({ id: run.runId, description: ev.toolName });
|
|
@@ -317,15 +333,7 @@ export function fleetRunPublisher(bus, run) {
|
|
|
317
333
|
return;
|
|
318
334
|
if (ev.type !== "task_progress" || !ev.taskId)
|
|
319
335
|
return;
|
|
320
|
-
|
|
321
|
-
if (yieldToBackgroundChildLane(ev.taskId, cid, ev.name))
|
|
322
|
-
return;
|
|
323
|
-
children.add(cid);
|
|
324
|
-
const parentId = ev.parentTaskId && ev.parentTaskId !== run.rootTaskId ? (backgroundRowOf(ev.parentTaskId) ?? childId(ev.parentTaskId)) : run.runId;
|
|
325
|
-
const fwdName = ev.name !== undefined ? redactSecrets(ev.name) : undefined;
|
|
326
|
-
if (!childStartedAt.has(cid))
|
|
327
|
-
childStartedAt.set(cid, Date.now());
|
|
328
|
-
bus.publishTask({ id: cid, sourceLane: "run-leg", ...(fwdName !== undefined ? { name: fwdName, agentType: fwdName } : {}), parentId, scope: run.scope, ...sessionField, ...workflowRunIdField(ev), status: tickStatus(ev.status), tokens: sumTokens(ev.usage), ...(typeof ev.seq === "number" ? { cycleSeq: ev.seq } : {}), ...(() => { const t = toolUsesOf(ev.usage); return t !== undefined ? { toolUses: t } : {}; })(), elapsedMs: Date.now() - childStartedAt.get(cid) });
|
|
336
|
+
mintRunLegRow(ev.taskId, ev, ev.parentTaskId && ev.parentTaskId !== run.rootTaskId ? (backgroundRowOf(ev.parentTaskId) ?? childId(ev.parentTaskId)) : run.runId);
|
|
329
337
|
},
|
|
330
338
|
onTerminal(status, residuals) {
|
|
331
339
|
settledLeg = true;
|
|
@@ -350,9 +358,10 @@ export function fleetRunPublisher(bus, run) {
|
|
|
350
358
|
},
|
|
351
359
|
};
|
|
352
360
|
}
|
|
353
|
-
export function fleetRunResiduals(result) {
|
|
361
|
+
export function fleetRunResiduals(result, errorCode) {
|
|
362
|
+
const stoppedBy = errorCode === "cancelled" ? { stoppedBy: "user" } : {};
|
|
354
363
|
if (!result)
|
|
355
|
-
return
|
|
364
|
+
return stoppedBy;
|
|
356
365
|
const s = result.stats;
|
|
357
366
|
const usage = s
|
|
358
367
|
? {
|
|
@@ -364,7 +373,7 @@ export function fleetRunResiduals(result) {
|
|
|
364
373
|
: {};
|
|
365
374
|
return {
|
|
366
375
|
...(Object.keys(usage).length > 0 ? { usage } : {}),
|
|
367
|
-
...
|
|
376
|
+
...stoppedBy,
|
|
368
377
|
...(result.sessionId ? { transcriptId: result.sessionId } : {}),
|
|
369
378
|
...(takeWorkspaceSnapshotFailure(result.sessionId) ? { workspaceSnapshot: "failed" } : {}),
|
|
370
379
|
};
|
|
@@ -426,7 +435,7 @@ export function fleetBackgroundChildPublisher(bus, log) {
|
|
|
426
435
|
}
|
|
427
436
|
return match !== undefined ? { id: match, resolved: true } : { id: parentInput, resolved: false };
|
|
428
437
|
};
|
|
429
|
-
const rowTags = (m) => {
|
|
438
|
+
const rowTags = (m, e) => {
|
|
430
439
|
let parentId;
|
|
431
440
|
const parentInput = m.parentTaskId ?? m.parentSessionLink;
|
|
432
441
|
if (parentInput) {
|
|
@@ -447,6 +456,7 @@ export function fleetBackgroundChildPublisher(bus, log) {
|
|
|
447
456
|
...(parentId !== undefined ? { parentId } : {}),
|
|
448
457
|
...(m.workflowRunId !== undefined ? { workflowRunId: m.workflowRunId } : {}),
|
|
449
458
|
...(m.parentToolCallId !== undefined ? { parentToolCallId: m.parentToolCallId } : {}),
|
|
459
|
+
...(e.model ? { model: e.model } : {}),
|
|
450
460
|
...(m.spawnedAt !== undefined ? { startedAt: m.spawnedAt, elapsedMs: Date.now() - m.spawnedAt } : {}),
|
|
451
461
|
};
|
|
452
462
|
};
|
|
@@ -485,7 +495,7 @@ export function fleetBackgroundChildPublisher(bus, log) {
|
|
|
485
495
|
remember(e.taskId, m);
|
|
486
496
|
joinWorkflowAgentNames(e, m);
|
|
487
497
|
const displayName = e.description ?? e.name;
|
|
488
|
-
bus.publishTask({ id: e.taskId, ...(displayName !== undefined ? { name: redactSecrets(displayName) } : {}), ...(e.agentType ? { agentType: redactSecrets(e.agentType) } : {}), ...(e.spawnName ? { agentName: e.spawnName } : {}), ...rowTags(m), status: "running", tokens: 0, ...(typeof e.seq === "number" ? { cycleSeq: e.seq } : {}), ...(e.transcriptId ? { transcriptId: e.transcriptId } : {}) });
|
|
498
|
+
bus.publishTask({ id: e.taskId, ...(displayName !== undefined ? { name: redactSecrets(displayName) } : {}), ...(e.agentType ? { agentType: redactSecrets(e.agentType) } : {}), ...(e.spawnName ? { agentName: e.spawnName } : {}), ...rowTags(m, e), status: "running", tokens: 0, ...(typeof e.seq === "number" ? { cycleSeq: e.seq } : {}), ...(e.transcriptId ? { transcriptId: e.transcriptId } : {}) });
|
|
489
499
|
dlog("bg_child_event", { kind: "spawn", taskId: e.taskId, sessionScoped: e.sessionScoped, scope: m.tenantScope, hostSessionId: m.hostSessionId ?? null, parentTaskId: m.parentTaskId ?? null });
|
|
490
500
|
};
|
|
491
501
|
const handleTick = (e, m) => {
|
|
@@ -498,12 +508,12 @@ export function fleetBackgroundChildPublisher(bus, log) {
|
|
|
498
508
|
const currentTool = e.currentTool
|
|
499
509
|
? { toolName: e.currentTool.toolName, ...(e.currentTool.target !== undefined ? { target: redactSecrets(e.currentTool.target).slice(0, 300) } : {}) }
|
|
500
510
|
: undefined;
|
|
501
|
-
bus.publishTask({ id: e.taskId, ...rowTags(m), status: "running", ...(tokens !== undefined ? { tokens } : {}), ...(name ? { name } : {}), ...(agentType ? { agentType } : {}), ...(agentName ? { agentName } : {}), ...(currentAction ? { currentAction } : {}), ...(currentTool ? { currentTool } : {}), ...(typeof e.seq === "number" ? { cycleSeq: e.seq } : {}), ...(e.usage?.toolUses !== undefined ? { toolUses: e.usage.toolUses } : {}), ...(e.transcriptId ? { transcriptId: e.transcriptId } : {}) });
|
|
511
|
+
bus.publishTask({ id: e.taskId, ...rowTags(m, e), status: "running", ...(tokens !== undefined ? { tokens } : {}), ...(name ? { name } : {}), ...(agentType ? { agentType } : {}), ...(agentName ? { agentName } : {}), ...(currentAction ? { currentAction } : {}), ...(currentTool ? { currentTool } : {}), ...(typeof e.seq === "number" ? { cycleSeq: e.seq } : {}), ...(e.usage?.toolUses !== undefined ? { toolUses: e.usage.toolUses } : {}), ...(e.transcriptId ? { transcriptId: e.transcriptId } : {}) });
|
|
502
512
|
};
|
|
503
513
|
const handleTerminal = (e, m) => {
|
|
504
514
|
const status = e.status === "completed" ? "completed" : e.status === "killed" ? "killed" : "failed";
|
|
505
515
|
bus.publishTask({
|
|
506
|
-
id: e.taskId, ...rowTags(m), status,
|
|
516
|
+
id: e.taskId, ...rowTags(m, e), status,
|
|
507
517
|
...(e.spawnName ? { agentName: e.spawnName } : {}),
|
|
508
518
|
...(typeof e.seq === "number" ? { cycleSeq: e.seq } : {}),
|
|
509
519
|
...(e.stoppedBy ? { stoppedBy: e.stoppedBy } : {}),
|
|
@@ -48,7 +48,7 @@ export function createFleetReconciler(deps) {
|
|
|
48
48
|
const upgradeWatched = (id, w, rec, trigger) => {
|
|
49
49
|
if (!watch.delete(id))
|
|
50
50
|
return false;
|
|
51
|
-
deps.bus.publishTask({ ...w.row, status: runStatusToFleet(rec.status), retiredBy: "reconcile", ...fleetRunResiduals(rec.result) });
|
|
51
|
+
deps.bus.publishTask({ ...w.row, status: runStatusToFleet(rec.status), retiredBy: "reconcile", ...fleetRunResiduals(rec.result, rec.errorCode) });
|
|
52
52
|
deps.bus.removeTask(id, { ...(w.row.cycleSeq !== undefined ? { cycleSeq: w.row.cycleSeq } : {}) });
|
|
53
53
|
lastFrameAt.delete(id);
|
|
54
54
|
deps.metrics?.inc("fleet_rows_reconciled_total", { disposition: "retired_deferred", trigger });
|
|
@@ -159,7 +159,7 @@ export function createFleetReconciler(deps) {
|
|
|
159
159
|
id: row.id,
|
|
160
160
|
status: runStatusToFleet(rec.status),
|
|
161
161
|
retiredBy: "reconcile",
|
|
162
|
-
...fleetRunResiduals(rec.result),
|
|
162
|
+
...fleetRunResiduals(rec.result, rec.errorCode),
|
|
163
163
|
});
|
|
164
164
|
parentsOnBus.delete(row.id);
|
|
165
165
|
deps.bus.removeTask(row.id, { ...(row.cycleSeq !== undefined ? { cycleSeq: row.cycleSeq } : {}) });
|
|
@@ -5,6 +5,7 @@ import { SERVING_LEASE_TTL_DEFAULT_MS, readServingLeaseResponse } from "@sema-ag
|
|
|
5
5
|
import { centerFetch } from "../web-admin-client/center-request.js";
|
|
6
6
|
import { recordFailOpen } from "../observability/fail-open.js";
|
|
7
7
|
import { leaseDrainActionId } from "./drain-entry.js";
|
|
8
|
+
import { readUpstreamJson } from "../upstream-body.js";
|
|
8
9
|
export const SERVING_LEASE_FETCH_TIMEOUT_MS = 5_000;
|
|
9
10
|
export const SERVING_LEASE_DENIED_FILE = "fleet-serving-lease-denied.json";
|
|
10
11
|
const RENEW_MIN_INTERVAL_MS = 1_000;
|
|
@@ -38,7 +39,6 @@ function denialLeadOf(d) {
|
|
|
38
39
|
export function createServingLeaseClient(o) {
|
|
39
40
|
const mono = o.clock?.mono ?? (() => performance.now());
|
|
40
41
|
const epoch = o.clock?.epoch ?? Date.now;
|
|
41
|
-
const f = o.fetchImpl ?? fetch;
|
|
42
42
|
const stickyPath = o.dataRoot === undefined ? undefined : join(o.dataRoot, SERVING_LEASE_DENIED_FILE);
|
|
43
43
|
let capability;
|
|
44
44
|
const enabled = () => capability?.announced === true;
|
|
@@ -104,9 +104,9 @@ export function createServingLeaseClient(o) {
|
|
|
104
104
|
let reading;
|
|
105
105
|
let why = "";
|
|
106
106
|
try {
|
|
107
|
-
const { res } = await centerFetch(o.center, { kind: "fleet-serving-lease" }, { method: "POST", json: request, timeoutMs: SERVING_LEASE_FETCH_TIMEOUT_MS, fetchImpl:
|
|
107
|
+
const { res } = await centerFetch(o.center, { kind: "fleet-serving-lease" }, { method: "POST", json: request, timeoutMs: SERVING_LEASE_FETCH_TIMEOUT_MS, fetchImpl: o.fetchImpl });
|
|
108
108
|
if (res.ok) {
|
|
109
|
-
reading = readServingLeaseResponse(await res
|
|
109
|
+
reading = readServingLeaseResponse(await readUpstreamJson(res).catch(() => undefined));
|
|
110
110
|
if (reading === undefined)
|
|
111
111
|
why = "reply is not a serving-lease verdict";
|
|
112
112
|
}
|