@sema-agent/server 7.146.0 → 7.148.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 +1423 -24
- package/README.md +21 -8
- package/README.zh-CN.md +15 -9
- package/USAGE.md +537 -216
- package/deploy/facts/lanes.json +7 -0
- package/deploy/sema-up/README.md +18 -7
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/templates/_helpers.tpl +42 -4
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +5 -4
- package/deploy/sema-up/chart/templates/server.yaml +5 -4
- package/deploy/sema-up/chart/values.yaml +4 -3
- package/deploy/sema-up/cluster-up.sh +75 -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/flagshape.sh +4 -0
- 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/lanes.json +2 -5
- 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 +26 -48
- 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 +18 -5
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +25 -3
- 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/adoption/wire.d.ts +3 -3
- package/dist/approval-card.d.ts +32 -34
- package/dist/approval-gate-currency.js +3 -2
- package/dist/approval-reconciler.d.ts +4 -13
- package/dist/approval-reconciler.js +2 -2
- package/dist/approval.d.ts +16 -14
- package/dist/approval.js +3 -3
- package/dist/audit.d.ts +10 -3
- package/dist/audit.js +17 -9
- package/dist/auth-bridge.d.ts +0 -14
- package/dist/auth-bridge.js +0 -7
- 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 +8 -3
- 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/crash-last.js +2 -1
- package/dist/boot/deployment-mods.d.ts +1 -1
- package/dist/boot/device-lane.js +5 -5
- package/dist/boot/engine-lease.d.ts +12 -11
- package/dist/boot/execution-env.d.ts +19 -8
- package/dist/boot/execution-env.js +80 -62
- package/dist/boot/execution-lane.d.ts +37 -9
- package/dist/boot/execution-lane.js +74 -20
- package/dist/boot/exit-boundary.d.ts +3 -3
- package/dist/boot/exit-boundary.js +6 -5
- package/dist/boot/exit-last.js +2 -1
- package/dist/boot/fatal-exit.d.ts +3 -5
- package/dist/boot/fatal-exit.js +2 -2
- package/dist/boot/governance-seams.d.ts +2 -2
- package/dist/boot/leader.d.ts +15 -0
- package/dist/boot/leader.js +18 -16
- package/dist/boot/memory-boundary.d.ts +11 -11
- package/dist/boot/memory-boundary.js +3 -3
- package/dist/boot/memory-consolidation.d.ts +50 -53
- package/dist/boot/memory-consolidation.js +11 -18
- package/dist/boot/org-memory.js +4 -3
- package/dist/boot/parked-revive-gate.d.ts +1 -1
- package/dist/boot/parked-revive-gate.js +3 -3
- package/dist/boot/reapers.d.ts +4 -3
- package/dist/boot/reapers.js +20 -17
- package/dist/boot/resolve-spec.d.ts +5 -3
- package/dist/boot/resolve-spec.js +133 -165
- package/dist/boot/retention-lane.d.ts +7 -45
- package/dist/boot/retention-lane.js +2 -2
- package/dist/boot/runner-deps.d.ts +28 -7
- package/dist/boot/runner-deps.js +11 -4
- package/dist/boot/runtime-caps.d.ts +2 -2
- package/dist/boot/runtime-caps.js +16 -2
- package/dist/boot/session-faces.d.ts +17 -7
- package/dist/boot/session-faces.js +122 -96
- package/dist/boot/shutdown.d.ts +5 -4
- package/dist/boot/shutdown.js +6 -4
- package/dist/boot/stage-01-config.d.ts +1 -1
- package/dist/boot/stage-01-config.js +14 -2
- package/dist/boot/stage-02-web-admin-pull.d.ts +2 -1
- package/dist/boot/stage-02-web-admin-pull.js +15 -8
- package/dist/boot/stage-03-store-backend.d.ts +4 -1
- package/dist/boot/stage-03-store-backend.js +4 -3
- package/dist/boot/stage-04-stores.d.ts +3 -1
- package/dist/boot/stage-04-stores.js +2 -2
- package/dist/boot/stage-05-execution-env.d.ts +9 -5
- package/dist/boot/stage-05-execution-env.js +5 -5
- package/dist/boot/stage-06-runners.d.ts +13 -15
- package/dist/boot/stage-06-runners.js +24 -18
- package/dist/boot/stage-07-capability-layer.d.ts +14 -11
- package/dist/boot/stage-07-capability-layer.js +9 -12
- package/dist/boot/stage-08-reapers.d.ts +14 -11
- package/dist/boot/stage-08-reapers.js +3 -3
- package/dist/boot/stage-09-leader.d.ts +16 -18
- package/dist/boot/stage-09-leader.js +12 -4
- package/dist/boot/stage-10-http-server.d.ts +16 -18
- package/dist/boot/stage-10-http-server.js +9 -5
- package/dist/boot/store-evidence.d.ts +20 -0
- package/dist/boot/store-evidence.js +13 -0
- package/dist/boot/stores.d.ts +12 -0
- package/dist/boot/stores.js +39 -17
- 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 +58 -38
- 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 +9 -1
- package/dist/capabilities/center-plugins.js +37 -11
- package/dist/capabilities/center-wiring.js +1 -1
- package/dist/capabilities/composite-members.d.ts +3 -2
- package/dist/capabilities/composite-members.js +3 -2
- package/dist/capabilities/execution-lane.d.ts +7 -7
- package/dist/capabilities/execution-lane.js +2 -2
- package/dist/capabilities/hands-lane.d.ts +1 -1
- package/dist/capabilities/repo-tools.d.ts +2 -0
- package/dist/capabilities/repo-tools.js +14 -12
- package/dist/capabilities/scenarios.d.ts +38 -33
- package/dist/capabilities/scenarios.js +24 -25
- package/dist/capabilities/settings-contract.d.ts +29 -0
- package/dist/capabilities/settings-contract.js +14 -0
- package/dist/capabilities/skills.d.ts +6 -6
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +69 -4
- package/dist/capability-facts.js +77 -5
- package/dist/card-void.d.ts +4 -4
- package/dist/card-void.js +1 -1
- package/dist/center-credential-renewer.d.ts +6 -2
- package/dist/center-credential-renewer.js +10 -5
- package/dist/config-catalog.d.ts +16 -1
- package/dist/config-catalog.js +68 -61
- package/dist/config-dir-trust.d.ts +37 -4
- package/dist/config-dir-trust.js +88 -44
- package/dist/config-invariants.d.ts +58 -4
- package/dist/config-invariants.js +104 -23
- package/dist/config-lkg.d.ts +24 -2
- package/dist/config-lkg.js +22 -9
- package/dist/config-provider.d.ts +9 -9
- package/dist/config-provider.js +25 -108
- package/dist/config-pull-failure.d.ts +50 -0
- package/dist/config-pull-failure.js +48 -0
- package/dist/config-types.d.ts +215 -202
- package/dist/config.d.ts +69 -14
- package/dist/config.js +188 -96
- package/dist/degenerate-instrument.js +1 -1
- package/dist/delegated-session-owner.d.ts +1 -1
- package/dist/deleted-session-ids.d.ts +3 -2
- package/dist/deploy-facts.js +3 -2
- package/dist/deployment-governance.d.ts +3 -3
- package/dist/deployment-shape.d.ts +51 -16
- package/dist/deployment-shape.js +31 -6
- 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.d.ts +7 -5
- package/dist/env-facts.js +12 -7
- package/dist/env-witness.d.ts +7 -0
- package/dist/env-witness.js +16 -0
- package/dist/execution-config-root.d.ts +5 -5
- package/dist/execution-config-root.js +5 -5
- package/dist/execution-env-purpose.d.ts +14 -0
- package/dist/execution-env-purpose.js +29 -0
- package/dist/execution-lane-caps.d.ts +53 -103
- package/dist/execution-lane-caps.js +51 -83
- package/dist/execution-placement.d.ts +65 -9
- package/dist/execution-placement.js +58 -0
- 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.d.ts +2 -2
- package/dist/file-history-disclosure.js +1 -0
- package/dist/fleet/drain-entry.d.ts +17 -10
- package/dist/fleet/drain-entry.js +1 -1
- 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 +6 -7
- 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 +42 -0
- package/dist/history-anchor.js +34 -0
- 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 +1 -4
- package/dist/hooks/command-spawn.js +0 -11
- package/dist/hooks/hook-llm.d.ts +5 -1
- package/dist/hooks/hook-llm.js +24 -15
- package/dist/hooks/hook-runner.d.ts +119 -65
- package/dist/hooks/hook-runner.js +415 -217
- 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 +75 -78
- package/dist/http/approval-sweeps.d.ts +5 -8
- package/dist/http/approval-sweeps.js +55 -30
- package/dist/http/caller-trust.d.ts +8 -10
- package/dist/http/caller-trust.js +1 -2
- package/dist/http/checkpoint-ctx.d.ts +17 -0
- package/dist/http/checkpoint-ctx.js +6 -0
- package/dist/http/claim-heartbeat.d.ts +49 -0
- package/dist/http/claim-heartbeat.js +46 -0
- package/dist/http/claim-latency.d.ts +10 -0
- package/dist/http/claim-latency.js +12 -0
- package/dist/http/claimed-run.d.ts +4 -3
- package/dist/http/dispatch.d.ts +8 -1
- package/dist/http/dispatch.js +77 -31
- package/dist/http/durable-run-leg.d.ts +3 -3
- package/dist/http/durable-run-leg.js +18 -12
- package/dist/http/execution-context.d.ts +18 -42
- package/dist/http/execution-context.js +11 -5
- 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 +7 -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 +3 -3
- package/dist/http/memory-store-refusal-reply.js +6 -0
- package/dist/http/owner-access.d.ts +391 -56
- package/dist/http/owner-access.js +372 -33
- package/dist/http/principal-gate.d.ts +26 -94
- package/dist/http/principal-gate.js +24 -81
- package/dist/http/refusal-body.d.ts +35 -2
- package/dist/http/refusal-body.js +34 -0
- package/dist/http/request-guards.d.ts +10 -14
- 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 +35 -12
- package/dist/http/resume-ctx-read.js +25 -6
- package/dist/http/resume-legs.d.ts +24 -24
- package/dist/http/resume-legs.js +260 -171
- package/dist/http/retired-skill-manifest.d.ts +1 -1
- package/dist/http/rewind-files-reply.d.ts +34 -0
- package/dist/http/rewind-files-reply.js +36 -0
- package/dist/http/route-ctx.d.ts +56 -47
- package/dist/http/route-table.js +2 -0
- package/dist/http/routes/a2a-serve.d.ts +43 -5
- package/dist/http/routes/a2a-serve.js +58 -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 -88
- 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 +23 -20
- package/dist/http/routes/config-catalog.js +2 -2
- package/dist/http/routes/devices.d.ts +3 -3
- package/dist/http/routes/devices.js +5 -5
- package/dist/http/routes/diagnostics.d.ts +27 -3
- package/dist/http/routes/diagnostics.js +27 -21
- 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 +3 -1
- 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 +12 -20
- package/dist/http/routes/observability.js +3 -3
- package/dist/http/routes/principal-inbox.d.ts +1 -1
- package/dist/http/routes/principal-inbox.js +2 -2
- package/dist/http/routes/projects.d.ts +70 -0
- package/dist/http/routes/projects.js +87 -0
- package/dist/http/routes/retention-ops.js +6 -9
- package/dist/http/routes/rules.js +50 -7
- 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 +148 -233
- 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 +4 -2
- package/dist/http/routes/session-sync.js +48 -30
- package/dist/http/routes/sessions-list.d.ts +3 -3
- package/dist/http/routes/sessions-list.js +9 -9
- package/dist/http/routes/sessions.d.ts +7 -1
- package/dist/http/routes/sessions.js +177 -112
- package/dist/http/routes/shared-memory.js +6 -6
- package/dist/http/routes/side-query.js +2 -2
- package/dist/http/routes/tasks.js +144 -122
- 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 +63 -50
- package/dist/http/server.js +52 -16
- 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 +17 -3
- package/dist/http/stored-body-replay.js +11 -2
- package/dist/http/submit-ctx.d.ts +16 -8
- package/dist/http/submit-ctx.js +6 -2
- 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 +23 -13
- package/dist/identity-source.d.ts +36 -5
- package/dist/identity-source.js +27 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/instruction-source-notice.d.ts +1 -1
- 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/lsp-evict.d.ts +6 -4
- package/dist/lsp-evict.js +2 -3
- package/dist/memory-embedder-reembed.d.ts +38 -0
- package/dist/memory-embedder-reembed.js +20 -0
- package/dist/memory-incident-sink.d.ts +0 -28
- package/dist/memory-incident-sink.js +5 -0
- package/dist/memory-operator-faces.d.ts +5 -4
- package/dist/memory-operator-faces.js +1 -1
- package/dist/memory-scope.d.ts +31 -4
- package/dist/memory-scope.js +65 -16
- package/dist/memory-store-refusal.d.ts +20 -4
- package/dist/memory-store-refusal.js +1 -1
- package/dist/memory-sync-client.d.ts +5 -2
- package/dist/memory-sync-client.js +19 -14
- package/dist/memory-sync.js +1 -1
- package/dist/model-compat.d.ts +51 -28
- package/dist/model-compat.js +55 -23
- package/dist/model-context-window.d.ts +18 -0
- package/dist/model-context-window.js +2 -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 +46 -17
- package/dist/model-entry-refusal.js +47 -27
- 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-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 +28 -2
- package/dist/namespaced-rule-name.js +10 -1
- 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 +75 -47
- package/dist/observability/fail-open.js +77 -47
- package/dist/observability/logger.d.ts +22 -1
- package/dist/observability/logger.js +89 -12
- package/dist/observability/metrics.d.ts +2 -0
- package/dist/observability/metrics.js +5 -4
- 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 +5 -2
- package/dist/observability/secret-env-scrub.d.ts +30 -4
- package/dist/observability/secret-env-scrub.js +15 -3
- 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-agent-session-index.d.ts +7 -12
- package/dist/orchestration/workflow-agent-session-index.js +1 -6
- package/dist/orchestration/workflow-completion-inbox.d.ts +29 -9
- package/dist/orchestration/workflow-completion-inbox.js +65 -46
- package/dist/org-delivery-gate.d.ts +5 -4
- package/dist/org-delivery-gate.js +7 -6
- package/dist/org-memory-admission.d.ts +5 -2
- package/dist/org-memory-admission.js +25 -10
- 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 +531 -0
- package/dist/owner-faces.js +126 -0
- package/dist/parked-decide.d.ts +100 -31
- package/dist/parked-decide.js +162 -48
- package/dist/parked-revive-surface.d.ts +14 -4
- package/dist/parked-revive-surface.js +5 -4
- package/dist/peer-directory.d.ts +6 -8
- 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 +0 -22
- package/dist/plugins/adoption-log-sql.js +5 -3
- 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 +28 -9
- package/dist/plugins/approval-ask-store-file.js +74 -18
- package/dist/plugins/approval-ask-store-memory.d.ts +17 -7
- package/dist/plugins/approval-ask-store-memory.js +35 -12
- package/dist/plugins/approval-ask-store-sql.d.ts +42 -20
- package/dist/plugins/approval-ask-store-sql.js +44 -11
- package/dist/plugins/approval-exemption-skill-m46.d.ts +20 -0
- package/dist/plugins/approval-exemption-skill-m46.js +25 -0
- package/dist/plugins/approval-exemption-store.d.ts +6 -1
- package/dist/plugins/approval-exemption-store.js +14 -0
- 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 +40 -195
- package/dist/plugins/blob-backend.js +41 -234
- package/dist/plugins/caching-session-store.d.ts +22 -5
- package/dist/plugins/caching-session-store.js +43 -4
- package/dist/plugins/checkpoint-index-columns.d.ts +33 -6
- package/dist/plugins/checkpoint-index-columns.js +39 -3
- package/dist/plugins/checkpoint-store-face.d.ts +84 -11
- package/dist/plugins/checkpoint-store-face.js +18 -1
- package/dist/plugins/device-store-sql.d.ts +2 -2
- package/dist/plugins/device-store-sql.js +6 -10
- 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 +0 -15
- package/dist/plugins/ensure-schema-lock-policy.js +3 -2
- package/dist/plugins/execution-lane-rename-m40.d.ts +20 -0
- package/dist/plugins/execution-lane-rename-m40.js +10 -0
- package/dist/plugins/execution-placement-sql.d.ts +63 -88
- package/dist/plugins/execution-placement-sql.js +94 -54
- package/dist/plugins/file-run-store.d.ts +89 -35
- package/dist/plugins/file-run-store.js +197 -142
- 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 +19 -10
- package/dist/plugins/imported-layer-root-retirement.js +4 -8
- package/dist/plugins/inbox-payload-column.d.ts +14 -0
- package/dist/plugins/inbox-payload-column.js +13 -0
- 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 +63 -23
- package/dist/plugins/local-checkpoint-store.js +204 -81
- package/dist/plugins/local-data-dir-modes-m39.d.ts +48 -0
- package/dist/plugins/local-data-dir-modes-m39.js +183 -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 +13 -0
- package/dist/plugins/local-engine-high-water.js +62 -0
- package/dist/plugins/local-session-store.d.ts +442 -143
- package/dist/plugins/local-session-store.js +941 -289
- 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 +20 -1
- package/dist/plugins/local-task-attachment-store.js +32 -12
- package/dist/plugins/memory-embedder-fingerprint.d.ts +33 -10
- package/dist/plugins/memory-embedder-fingerprint.js +52 -12
- package/dist/plugins/memory-embedder.d.ts +1 -1
- package/dist/plugins/memory-embedder.js +11 -9
- package/dist/plugins/memory-engine-pg.d.ts +7 -5
- package/dist/plugins/memory-engine-pg.js +18 -9
- package/dist/plugins/memory-engine-sql-apply.d.ts +21 -8
- package/dist/plugins/memory-engine-sql-apply.js +7 -9
- package/dist/plugins/memory-engine-tidb.d.ts +12 -7
- package/dist/plugins/memory-engine-tidb.js +18 -10
- 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 +39 -27
- package/dist/plugins/memory-run-store.js +72 -70
- package/dist/plugins/one-time-migration-marker.d.ts +10 -0
- package/dist/plugins/one-time-migration-marker.js +7 -0
- package/dist/plugins/one-time-migrations.d.ts +325 -74
- package/dist/plugins/one-time-migrations.js +705 -230
- package/dist/plugins/org-delivery-quota-store.js +2 -1
- package/dist/plugins/owner-only-file-mode.d.ts +29 -0
- package/dist/plugins/owner-only-file-mode.js +141 -0
- package/dist/plugins/permission-rule-store-file.d.ts +11 -11
- package/dist/plugins/permission-rule-store-file.js +14 -2
- package/dist/plugins/permission-rule-store-sql.d.ts +4 -63
- package/dist/plugins/permission-rule-store-sql.js +6 -86
- package/dist/plugins/pg-pool.d.ts +3 -32
- package/dist/plugins/pg-pool.js +27 -11
- package/dist/plugins/release-version.d.ts +20 -0
- package/dist/plugins/release-version.js +28 -0
- package/dist/plugins/remote-env-adb.d.ts +20 -4
- package/dist/plugins/remote-env-adb.js +39 -11
- package/dist/plugins/remote-env-e2b.d.ts +19 -28
- package/dist/plugins/remote-env-e2b.js +40 -29
- package/dist/plugins/remote-env-host.d.ts +11 -10
- package/dist/plugins/remote-env-host.js +40 -27
- package/dist/plugins/remote-env-k8s.d.ts +45 -47
- package/dist/plugins/remote-env-k8s.js +122 -62
- package/dist/plugins/remote-env-local-docker.d.ts +152 -15
- package/dist/plugins/remote-env-local-docker.js +370 -75
- package/dist/plugins/remote-env-ssh.d.ts +8 -2
- package/dist/plugins/remote-env-ssh.js +26 -24
- package/dist/plugins/remote-scratchpad.js +4 -0
- package/dist/plugins/remote-shell.d.ts +59 -30
- package/dist/plugins/remote-shell.js +175 -62
- package/dist/plugins/retention-declaration.d.ts +37 -0
- package/dist/plugins/retention-declaration.js +9 -0
- package/dist/plugins/retention-deployment.d.ts +158 -0
- package/dist/plugins/retention-deployment.js +119 -0
- package/dist/plugins/retention-lane-store-sql.d.ts +74 -4
- package/dist/plugins/retention-lane-store-sql.js +103 -1
- package/dist/plugins/retention-sql.d.ts +29 -0
- package/dist/plugins/retention-sql.js +8 -0
- 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 +56 -68
- package/dist/plugins/run-store-sql.js +127 -116
- 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 +54 -0
- package/dist/plugins/scenario-prefix-switch-m42.js +55 -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 +42 -15
- package/dist/plugins/schema-consistency.js +213 -13
- package/dist/plugins/schema-drift-sentence.d.ts +4 -1
- package/dist/plugins/schema-drift-sentence.js +4 -4
- package/dist/plugins/schema-ensure-legs.d.ts +10 -1
- package/dist/plugins/schema-ensure-legs.js +12 -2
- 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 +98 -0
- package/dist/plugins/session-ext-table.js +134 -0
- package/dist/plugins/session-fork.d.ts +16 -2
- package/dist/plugins/session-fork.js +3 -0
- package/dist/plugins/session-ownership.d.ts +1 -1
- package/dist/plugins/session-placement.d.ts +22 -16
- package/dist/plugins/session-placement.js +15 -12
- package/dist/plugins/session-row-sql.d.ts +20 -7
- package/dist/plugins/session-row-sql.js +16 -8
- 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 +157 -0
- package/dist/plugins/session-store-sql.js +398 -0
- package/dist/plugins/session-withdraw-sql.d.ts +36 -0
- package/dist/plugins/session-withdraw-sql.js +42 -0
- package/dist/plugins/session-workspace-cell.d.ts +2 -2
- package/dist/plugins/session-workspace-cell.js +2 -2
- package/dist/plugins/shared-memory-store-sql.d.ts +10 -69
- package/dist/plugins/shared-memory-store-sql.js +15 -14
- package/dist/plugins/shell-sentinel-owner-m48.d.ts +20 -0
- package/dist/plugins/shell-sentinel-owner-m48.js +3 -0
- package/dist/plugins/snapshot-bucket-presence.d.ts +2 -1
- package/dist/plugins/snapshot-bucket-presence.js +1 -1
- package/dist/plugins/sql-driver.d.ts +24 -8
- package/dist/plugins/sql-driver.js +43 -9
- package/dist/plugins/sql-errors.d.ts +35 -5
- package/dist/plugins/sql-errors.js +55 -3
- package/dist/plugins/sql-json-column.d.ts +8 -7
- package/dist/plugins/sql-json-column.js +10 -6
- package/dist/plugins/store-backend.d.ts +114 -18
- package/dist/plugins/store-backend.js +340 -87
- package/dist/plugins/store-contracts.d.ts +97 -30
- package/dist/plugins/store-contracts.js +23 -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 +21 -11
- package/dist/plugins/task-attachment-store.js +37 -19
- package/dist/plugins/task-list-store-sql.d.ts +1 -1
- package/dist/plugins/text-column-capacity.d.ts +21 -0
- package/dist/plugins/text-column-capacity.js +5 -0
- package/dist/plugins/tidb-pool.d.ts +3 -2
- package/dist/plugins/tidb-pool.js +42 -39
- package/dist/plugins/user-input-ledger-sql.d.ts +1 -1
- 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/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/question.d.ts +13 -23
- package/dist/question.js +21 -39
- package/dist/read-face-posture.d.ts +6 -6
- package/dist/read-face-posture.js +2 -2
- 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/request-value-closure.d.ts +5 -5
- package/dist/request-value-closure.js +1 -1
- 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 +46 -16
- package/dist/rules-consent.js +102 -53
- package/dist/run-acceptance.d.ts +3 -1
- package/dist/run-acceptance.js +3 -0
- package/dist/run-local.d.ts +14 -6
- package/dist/run-local.js +109 -93
- package/dist/run-stale-default.d.ts +7 -0
- package/dist/run-stale-default.js +2 -0
- package/dist/runs.d.ts +73 -44
- package/dist/runs.js +65 -43
- package/dist/runtime-caps-resolver.d.ts +36 -14
- package/dist/runtime-caps-resolver.js +31 -14
- package/dist/runtime-governance.d.ts +2 -2
- package/dist/runtime-governance.js +5 -3
- package/dist/sealed-key-layout.d.ts +12 -6
- package/dist/sealed-key-layout.js +5 -1
- package/dist/sealed-key.d.ts +12 -2
- package/dist/sealed-key.js +116 -26
- package/dist/security.d.ts +133 -161
- package/dist/security.js +163 -59
- package/dist/sema-config-dir.d.ts +20 -0
- package/dist/sema-config-dir.js +27 -2
- package/dist/server-secret-env.d.ts +23 -5
- package/dist/server-secret-env.js +14 -4
- package/dist/service-version.d.ts +2 -1
- package/dist/service-version.js +2 -2
- package/dist/session-children-retire.d.ts +7 -5
- package/dist/session-children-retire.js +7 -2
- 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 +6 -6
- package/dist/session-error-wire.js +1 -1
- package/dist/session-incarnation.d.ts +60 -10
- 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 +29 -47
- package/dist/session-resident-background.js +77 -8
- package/dist/session-row.d.ts +3 -2
- package/dist/session-rules-seat.d.ts +12 -0
- package/dist/session-rules-seat.js +19 -0
- package/dist/session-sync-kernel.d.ts +1 -1
- package/dist/session-titler.d.ts +7 -15
- package/dist/session-titler.js +1 -1
- package/dist/session-workspace.d.ts +11 -2
- package/dist/session-workspace.js +5 -0
- package/dist/sighup-idle.d.ts +1 -1
- package/dist/spec-fields.d.ts +57 -3
- package/dist/spec-fields.js +72 -51
- package/dist/store-posture.d.ts +138 -21
- package/dist/store-posture.js +188 -3
- package/dist/stored-request-hooks-m20.d.ts +3 -2
- package/dist/stored-request-hooks-m20.js +21 -16
- 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/blob-index-sql.d.ts +148 -0
- package/dist/stores-sql/blob-index-sql.js +154 -0
- package/dist/stores-sql/checkpoint-store-sql.d.ts +34 -29
- package/dist/stores-sql/checkpoint-store-sql.js +86 -71
- package/dist/{plugins → stores-sql}/file-history-store-sql.d.ts +23 -11
- package/dist/{plugins → stores-sql}/file-history-store-sql.js +23 -18
- package/dist/stores-sql/mailbox-store-sql.d.ts +7 -4
- package/dist/stores-sql/mailbox-store-sql.js +31 -32
- package/dist/{plugins → stores-sql}/pg-session-storage.d.ts +30 -81
- package/dist/{plugins → stores-sql}/pg-session-storage.js +123 -244
- package/dist/{plugins → stores-sql}/retention-store-sql.d.ts +197 -223
- package/dist/{plugins → stores-sql}/retention-store-sql.js +148 -207
- package/dist/{plugins → stores-sql}/session-event-payload.d.ts +1 -1
- package/dist/{plugins → stores-sql}/session-event-payload.js +1 -1
- package/dist/stores-sql/session-policy-store-sql.d.ts +33 -11
- package/dist/stores-sql/session-policy-store-sql.js +44 -36
- package/dist/stores-sql/session-write-hooks.d.ts +65 -0
- package/dist/stores-sql/session-write-hooks.js +2 -0
- package/dist/{plugins → stores-sql}/tidb-session-storage.d.ts +14 -15
- package/dist/{plugins → stores-sql}/tidb-session-storage.js +22 -28
- package/dist/{plugins → stores-sql}/tidb-session-store.d.ts +67 -138
- package/dist/{plugins → stores-sql}/tidb-session-store.js +130 -200
- package/dist/stores-sql/tool-result-store-sql.d.ts +1 -1
- package/dist/stores-sql/tool-result-store-sql.js +1 -1
- package/dist/stores-sql/windowed-session-storage.d.ts +61 -0
- package/dist/stores-sql/windowed-session-storage.js +70 -0
- package/dist/submission-exit.d.ts +50 -0
- package/dist/submission-exit.js +108 -0
- package/dist/task-a2a.d.ts +7 -1
- package/dist/task-a2a.js +18 -17
- package/dist/task-cwd.d.ts +31 -3
- package/dist/task-cwd.js +25 -1
- package/dist/task-mcp.d.ts +11 -3
- package/dist/task-mcp.js +16 -19
- package/dist/task-settings.d.ts +23 -14
- package/dist/task-settings.js +35 -13
- package/dist/terminal.d.ts +25 -43
- package/dist/terminal.js +31 -11
- package/dist/tool-approval.d.ts +152 -137
- package/dist/tool-approval.js +199 -199
- package/dist/trace/core-keyset-guard.d.ts +22 -9
- 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 +1 -1
- package/dist/trace/engine-notice-wire.js +2 -0
- package/dist/trace/exit-seat.d.ts +52 -4
- package/dist/trace/exit-seat.js +43 -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 +1 -30
- 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 +88 -58
- package/dist/trace/project.js +64 -28
- package/dist/trace/redact.d.ts +124 -28
- package/dist/trace/redact.js +936 -328
- package/dist/trace/self-minted-wire.d.ts +750 -29
- package/dist/trace/self-minted-wire.js +262 -25
- package/dist/trace/sema-provenance.d.ts +45 -41
- package/dist/trace/sema-provenance.js +81 -10
- package/dist/trace/task-notification-facets.d.ts +70 -2
- package/dist/trace/task-notification-facets.js +71 -1
- package/dist/trace/wire-projection-faces.d.ts +43 -8
- package/dist/trace/wire-projection-faces.js +28 -3
- package/dist/unread-request-members.d.ts +66 -0
- package/dist/unread-request-members.js +41 -0
- 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 -40
- 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/candidate-gate.d.ts +35 -3
- package/dist/web-admin-client/candidate-gate.js +53 -5
- package/dist/web-admin-client/center-request.d.ts +6 -3
- package/dist/web-admin-client/center-request.js +17 -16
- package/dist/web-admin-client/effective-keys.d.ts +1 -1
- package/dist/web-admin-client/effective-keys.js +1 -2
- 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/facade.d.ts +1 -1
- package/dist/web-admin-client/http-client.d.ts +2 -1
- package/dist/web-admin-client/http-client.js +40 -13
- 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 +13 -6
- package/dist/web-admin-client/skills-mcp.d.ts +22 -8
- package/dist/web-admin-client/skills-mcp.js +26 -21
- package/dist/web-admin-client/types.d.ts +35 -51
- package/dist/workspace-space.d.ts +3 -2
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +4 -4
- package/package.json +16 -12
- package/scripts/drain-check-local.mjs +118 -173
- package/scripts/drain-check.mysql.sql +20 -16
- package/scripts/drain-check.pg.sql +20 -16
- package/wire-changes/server@7.147.0.json +813 -0
- package/wire-changes/server@7.148.0.json +1517 -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
|
@@ -1,29 +1,15 @@
|
|
|
1
1
|
import { isExecutionLane } from "../execution-lane-caps.js";
|
|
2
|
+
import { retiredExecutionLaneHintM40 } from "./execution-lane-rename-m40.js";
|
|
2
3
|
import { sessionFaceFromRow } from "../session-incarnation.js";
|
|
3
4
|
import { toIso } from "./sql-row-helpers.js";
|
|
5
|
+
import { SESSION_EXT_TABLE, ensureSessionExtRowStatement, ensureSessionExtRowsStatement } from "./session-ext-table.js";
|
|
4
6
|
import { WRITABLE, assertPlaceableLane, boundDeviceOf, settledMirrorOutcome, settledPlaceOutcome, } from "../execution-placement.js";
|
|
5
|
-
export const SESSION_META_PLACEMENT_COLUMNS = [
|
|
6
|
-
{ name: "execution_role", mysql: "execution_role VARCHAR(16) NULL", pg: `execution_role VARCHAR(16) COLLATE "C"` },
|
|
7
|
-
{ name: "execution_lane", mysql: "execution_lane VARCHAR(32) NULL", pg: `execution_lane VARCHAR(32) COLLATE "C"` },
|
|
8
|
-
{ name: "execution_device_id", mysql: "execution_device_id VARCHAR(64) NULL", pg: `execution_device_id VARCHAR(64) COLLATE "C"` },
|
|
9
|
-
{ name: "execution_device_owner_tenant", mysql: "execution_device_owner_tenant VARCHAR(190) NULL", pg: `execution_device_owner_tenant VARCHAR(190) COLLATE "C"` },
|
|
10
|
-
{ name: "execution_device_owner_subject", mysql: "execution_device_owner_subject VARCHAR(190) NULL", pg: `execution_device_owner_subject VARCHAR(190) COLLATE "C"` },
|
|
11
|
-
{ name: "execution_placed_at", mysql: "execution_placed_at DATETIME(3) NULL", pg: "execution_placed_at TIMESTAMPTZ(3)" },
|
|
12
|
-
{ name: "execution_rev", mysql: "execution_rev BIGINT NULL", pg: "execution_rev BIGINT" },
|
|
13
|
-
{ name: "fork_key", mysql: "fork_key VARCHAR(255) NULL", pg: `fork_key VARCHAR(255) COLLATE "C"` },
|
|
14
|
-
];
|
|
15
|
-
export function sessionMetaPlacementColumnsDdl(dialect) {
|
|
16
|
-
return SESSION_META_PLACEMENT_COLUMNS.map((c) => c[dialect]).join(",\n ");
|
|
17
|
-
}
|
|
18
7
|
const WRITER = "writer";
|
|
19
8
|
const MIRROR = "mirror";
|
|
20
9
|
const NOT_WRITER = "(execution_role IS NULL OR execution_role <> 'writer')";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return { columns: "fork_key, execution_role", values: [forkKey, MIRROR] };
|
|
25
|
-
}
|
|
26
|
-
export const SESSION_META_PLACEMENT_READ_COLUMNS = "owner, incarnation, placement_kind, execution_role, execution_lane, execution_device_id, execution_device_owner_tenant, execution_device_owner_subject, execution_placed_at, execution_rev";
|
|
10
|
+
const EXECUTION_CELL_COLUMNS = "execution_role, execution_lane, execution_device_id, execution_device_owner_tenant, execution_device_owner_subject, execution_placed_at, execution_rev";
|
|
11
|
+
const OCCUPANT_COLUMNS = "owner, incarnation, placement_kind";
|
|
12
|
+
const READING_COLUMNS = `sm.owner, sm.incarnation, sm.placement_kind, ${EXECUTION_CELL_COLUMNS.split(", ").map((c) => `se.${c}`).join(", ")}`;
|
|
27
13
|
function binder(dialect) {
|
|
28
14
|
const values = [];
|
|
29
15
|
return {
|
|
@@ -34,38 +20,37 @@ function binder(dialect) {
|
|
|
34
20
|
},
|
|
35
21
|
};
|
|
36
22
|
}
|
|
37
|
-
function
|
|
38
|
-
const nullSafeEq = dialect === "pg" ? "IS NOT DISTINCT FROM" : "<=>";
|
|
39
|
-
return `session_id = ${p(root)} AND incarnation = ${p(occupant.incarnation)} AND owner ${nullSafeEq} ${p(occupant.owner)} AND placement_kind IS NULL`;
|
|
40
|
-
}
|
|
41
|
-
export function readPlacementRowStatement(dialect, root, opts) {
|
|
23
|
+
export function readPlacementRowStatement(dialect, root) {
|
|
42
24
|
const b = binder(dialect);
|
|
43
|
-
return { text: `SELECT ${
|
|
25
|
+
return { text: `SELECT ${READING_COLUMNS} FROM session_meta sm LEFT JOIN ${SESSION_EXT_TABLE} se ON se.session_id = sm.session_id WHERE sm.session_id = ${b.p(root)}`, values: b.values };
|
|
44
26
|
}
|
|
45
|
-
export function placeWriterStatement(dialect, root,
|
|
27
|
+
export function placeWriterStatement(dialect, root, cell, now) {
|
|
46
28
|
const b = binder(dialect);
|
|
47
29
|
const set = `execution_role = '${WRITER}', execution_lane = ${b.p(cell.lane)}, execution_device_id = ${b.p(cell.device?.id ?? null)}, ` +
|
|
48
30
|
`execution_device_owner_tenant = ${b.p(cell.device?.owner.tenant ?? null)}, execution_device_owner_subject = ${b.p(cell.device?.owner.subject ?? null)}, ` +
|
|
49
31
|
`execution_placed_at = ${b.p(now)}, execution_rev = 0`;
|
|
50
|
-
return { text: `UPDATE
|
|
32
|
+
return { text: `UPDATE ${SESSION_EXT_TABLE} SET ${set} WHERE session_id = ${b.p(root)} AND execution_role IS NULL`, values: b.values };
|
|
51
33
|
}
|
|
52
|
-
export function bindDeviceStatement(dialect, root,
|
|
34
|
+
export function bindDeviceStatement(dialect, root, device, now) {
|
|
53
35
|
const b = binder(dialect);
|
|
54
36
|
const set = `execution_device_id = ${b.p(device.id)}, execution_device_owner_tenant = ${b.p(device.owner.tenant)}, execution_device_owner_subject = ${b.p(device.owner.subject)}, execution_placed_at = ${b.p(now)}, execution_rev = 0`;
|
|
55
37
|
return {
|
|
56
|
-
text: `UPDATE
|
|
38
|
+
text: `UPDATE ${SESSION_EXT_TABLE} SET ${set} WHERE session_id = ${b.p(root)} AND execution_role = '${WRITER}' AND execution_lane = 'device' AND execution_device_id IS NULL`,
|
|
57
39
|
values: b.values,
|
|
58
40
|
};
|
|
59
41
|
}
|
|
60
|
-
export function rebindDeviceStatement(dialect, root,
|
|
42
|
+
export function rebindDeviceStatement(dialect, root, owner, expectedRev, targetDeviceId, now) {
|
|
61
43
|
const b = binder(dialect);
|
|
62
44
|
const set = `execution_device_id = ${b.p(targetDeviceId)}, execution_placed_at = ${b.p(now)}, execution_rev = execution_rev + 1`;
|
|
63
|
-
const where =
|
|
45
|
+
const where = `session_id = ${b.p(root)} AND execution_role = '${WRITER}' AND execution_lane = 'device' ` +
|
|
64
46
|
`AND execution_device_owner_tenant = ${b.p(owner.tenant)} AND execution_device_owner_subject = ${b.p(owner.subject)} AND execution_rev = ${b.p(expectedRev)}`;
|
|
65
|
-
return { text: `UPDATE
|
|
47
|
+
return { text: `UPDATE ${SESSION_EXT_TABLE} SET ${set} WHERE ${where}`, values: b.values };
|
|
66
48
|
}
|
|
67
49
|
export function deviceCellRowsStatement() {
|
|
68
|
-
return {
|
|
50
|
+
return {
|
|
51
|
+
text: `SELECT se.session_id, ${EXECUTION_CELL_COLUMNS.split(", ").map((c) => `se.${c}`).join(", ")} FROM ${SESSION_EXT_TABLE} se JOIN session_meta sm ON sm.session_id = se.session_id WHERE se.execution_device_id IS NOT NULL AND sm.placement_kind IS NULL`,
|
|
52
|
+
values: [],
|
|
53
|
+
};
|
|
69
54
|
}
|
|
70
55
|
export async function countDeviceBindingsOn(conn) {
|
|
71
56
|
const s = deviceCellRowsStatement();
|
|
@@ -75,9 +60,9 @@ export async function countDeviceBindingsOn(conn) {
|
|
|
75
60
|
bindings += 1;
|
|
76
61
|
return bindings;
|
|
77
62
|
}
|
|
78
|
-
export function markMirrorStatement(dialect, root
|
|
63
|
+
export function markMirrorStatement(dialect, root) {
|
|
79
64
|
const b = binder(dialect);
|
|
80
|
-
return { text: `UPDATE
|
|
65
|
+
return { text: `UPDATE ${SESSION_EXT_TABLE} SET execution_role = '${MIRROR}' WHERE session_id = ${b.p(root)} AND ${NOT_WRITER}`, values: b.values };
|
|
81
66
|
}
|
|
82
67
|
export function backfillWriterStatement(dialect, lane, now) {
|
|
83
68
|
const b = binder(dialect);
|
|
@@ -105,6 +90,31 @@ export function migrateDeviceBindingsStatement(dialect, sourceTable) {
|
|
|
105
90
|
values: [],
|
|
106
91
|
};
|
|
107
92
|
}
|
|
93
|
+
export function migrateDeviceBindingsOntoSideTableStatements(dialect, sourceTable) {
|
|
94
|
+
if (dialect === "pg") {
|
|
95
|
+
return [
|
|
96
|
+
ensureSessionExtRowsStatement(dialect, `SELECT sm.session_id FROM ${sourceTable} ds JOIN session_meta sm ON sm.session_id = ds.root_session_id WHERE sm.placement_kind IS NULL`),
|
|
97
|
+
{
|
|
98
|
+
text: `UPDATE ${SESSION_EXT_TABLE} SET execution_role = '${WRITER}', execution_lane = 'device', execution_device_id = ds.device_id, ` +
|
|
99
|
+
"execution_device_owner_tenant = ds.owner_tenant, execution_device_owner_subject = ds.owner_subject, execution_placed_at = ds.bound_at, execution_rev = ds.rev " +
|
|
100
|
+
`FROM ${sourceTable} ds, session_meta sm WHERE ds.root_session_id = ${SESSION_EXT_TABLE}.session_id AND sm.session_id = ${SESSION_EXT_TABLE}.session_id AND sm.placement_kind IS NULL`,
|
|
101
|
+
values: [],
|
|
102
|
+
},
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
const str = (col) => `CONVERT(ds.${col} USING utf8mb4)`;
|
|
106
|
+
const rootKey = `${str("root_session_id")} COLLATE utf8mb4_bin`;
|
|
107
|
+
return [
|
|
108
|
+
ensureSessionExtRowsStatement(dialect, `SELECT sm.session_id FROM ${sourceTable} ds JOIN session_meta sm ON ${rootKey} = sm.session_id WHERE sm.placement_kind IS NULL`),
|
|
109
|
+
{
|
|
110
|
+
text: `UPDATE ${SESSION_EXT_TABLE} se JOIN session_meta sm ON sm.session_id = se.session_id JOIN ${sourceTable} ds ON ${rootKey} = se.session_id ` +
|
|
111
|
+
`SET se.execution_role = '${WRITER}', se.execution_lane = 'device', se.execution_device_id = ${str("device_id")}, ` +
|
|
112
|
+
`se.execution_device_owner_tenant = ${str("owner_tenant")}, se.execution_device_owner_subject = ${str("owner_subject")}, se.execution_placed_at = ds.bound_at, se.execution_rev = ds.rev ` +
|
|
113
|
+
"WHERE sm.placement_kind IS NULL",
|
|
114
|
+
values: [],
|
|
115
|
+
},
|
|
116
|
+
];
|
|
117
|
+
}
|
|
108
118
|
export function countOrphanBindingsStatement(dialect, sourceTable) {
|
|
109
119
|
const rootKey = dialect === "pg" ? "ds.root_session_id" : "CONVERT(ds.root_session_id USING utf8mb4) COLLATE utf8mb4_bin";
|
|
110
120
|
return {
|
|
@@ -135,7 +145,7 @@ export function placementCellFromRow(root, row) {
|
|
|
135
145
|
throw new ExecutionPlacementRowError(root, `role ${JSON.stringify(text(role))} is not writer / mirror / NULL`);
|
|
136
146
|
const lane = isNull(row.execution_lane) ? "" : text(row.execution_lane);
|
|
137
147
|
if (!isExecutionLane(lane))
|
|
138
|
-
throw new ExecutionPlacementRowError(root, `writer lane ${JSON.stringify(lane)} is not an execution lane`);
|
|
148
|
+
throw new ExecutionPlacementRowError(root, `writer lane ${JSON.stringify(lane)} is not an execution lane${retiredExecutionLaneHintM40(lane)}`);
|
|
139
149
|
if (isNull(row.execution_device_id)) {
|
|
140
150
|
if (deviceCols.some((v) => !isNull(v)))
|
|
141
151
|
throw new ExecutionPlacementRowError(root, "device owner without a device");
|
|
@@ -164,37 +174,69 @@ export function placementReadingFromRow(root, row) {
|
|
|
164
174
|
export function rowsOnSqlExec(exec) {
|
|
165
175
|
return async (sql, values) => (await exec.query(sql, [...values])).rows;
|
|
166
176
|
}
|
|
167
|
-
|
|
177
|
+
async function lockRootOn(conn, dialect, root) {
|
|
178
|
+
const ph = dialect === "pg" ? "$1" : "?";
|
|
179
|
+
return (await conn(`SELECT ${OCCUPANT_COLUMNS} FROM session_meta WHERE session_id = ${ph} FOR UPDATE`, [root]))[0];
|
|
180
|
+
}
|
|
181
|
+
export async function readClaimOn(conn, dialect, root) {
|
|
168
182
|
const ph = dialect === "pg" ? "$1" : "?";
|
|
169
|
-
const row = await conn(`SELECT session_id FROM session_meta WHERE session_id = ${ph} FOR UPDATE`, [root]);
|
|
170
|
-
if (row.length === 0)
|
|
171
|
-
return { rowPresent: false, activeTaskId: null };
|
|
172
183
|
const claim = await conn(`SELECT task_id FROM task_active WHERE session_id = ${ph} FOR UPDATE`, [root]);
|
|
173
|
-
return
|
|
184
|
+
return claim[0] === undefined ? null : text(claim[0].task_id);
|
|
185
|
+
}
|
|
186
|
+
export async function lockRootAndReadClaim(conn, dialect, root) {
|
|
187
|
+
if ((await lockRootOn(conn, dialect, root)) === undefined)
|
|
188
|
+
return { rowPresent: false, activeTaskId: null };
|
|
189
|
+
return { rowPresent: true, activeTaskId: await readClaimOn(conn, dialect, root) };
|
|
190
|
+
}
|
|
191
|
+
export async function readCellOn(conn, dialect, root) {
|
|
192
|
+
const ph = dialect === "pg" ? "$1" : "?";
|
|
193
|
+
const ensure = ensureSessionExtRowStatement(dialect, root);
|
|
194
|
+
await conn(ensure.text, ensure.values);
|
|
195
|
+
const row = (await conn(`SELECT ${EXECUTION_CELL_COLUMNS} FROM ${SESSION_EXT_TABLE} WHERE session_id = ${ph} FOR UPDATE`, [root]))[0];
|
|
196
|
+
return placementCellFromRow(root, row ?? {});
|
|
174
197
|
}
|
|
175
198
|
export async function readPlacementOn(conn, dialect, root) {
|
|
176
|
-
const
|
|
177
|
-
|
|
199
|
+
const occupant = await lockRootOn(conn, dialect, root);
|
|
200
|
+
if (occupant === undefined || !isNull(occupant.placement_kind))
|
|
201
|
+
return undefined;
|
|
202
|
+
return { occupant: sessionFaceFromRow(root, isNull(occupant.owner) ? null : text(occupant.owner), occupant.incarnation), cell: await readCellOn(conn, dialect, root) };
|
|
203
|
+
}
|
|
204
|
+
export async function writeCellOn(exec, dialect, root, statement) {
|
|
205
|
+
const res = await exec.query(statement.text, [...statement.values]);
|
|
206
|
+
if (res.affected !== 1)
|
|
207
|
+
throw placementInvariant(root, `a cell write (${statement.text.slice(0, 48)}…)`);
|
|
178
208
|
}
|
|
179
209
|
function placementInvariant(root, what) {
|
|
180
|
-
return new Error(`execution placement of session ${root}: ${what} matched no row
|
|
210
|
+
return new Error(`execution placement of session ${root}: ${what} matched no row under a held root-row lock after the judge found the cell writable — engine/driver anomaly, refusing to guess`);
|
|
181
211
|
}
|
|
182
212
|
export function createSqlExecutionPlacementSeat(db) {
|
|
183
213
|
const read = async (root) => {
|
|
184
|
-
const s = readPlacementRowStatement(db.dialect, root
|
|
214
|
+
const s = readPlacementRowStatement(db.dialect, root);
|
|
185
215
|
return placementReadingFromRow(root, (await db.query(s.text, [...s.values])).rows[0]);
|
|
186
216
|
};
|
|
187
217
|
return {
|
|
188
218
|
read,
|
|
189
219
|
async place(root, occupant, cell) {
|
|
190
220
|
assertPlaceableLane(root, cell);
|
|
191
|
-
const
|
|
192
|
-
|
|
221
|
+
const conn = await db.connect();
|
|
222
|
+
try {
|
|
223
|
+
await conn.begin();
|
|
224
|
+
const settled = settledPlaceOutcome(root, await readPlacementOn(rowsOnSqlExec(conn), db.dialect, root), occupant, cell);
|
|
225
|
+
if (settled !== WRITABLE) {
|
|
226
|
+
await conn.rollback();
|
|
227
|
+
return settled;
|
|
228
|
+
}
|
|
229
|
+
await writeCellOn(conn, db.dialect, root, placeWriterStatement(db.dialect, root, { lane: cell.lane }, new Date()));
|
|
230
|
+
await conn.commit();
|
|
193
231
|
return { outcome: "placed" };
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
232
|
+
}
|
|
233
|
+
catch (err) {
|
|
234
|
+
await conn.rollback().catch(() => undefined);
|
|
235
|
+
throw err;
|
|
236
|
+
}
|
|
237
|
+
finally {
|
|
238
|
+
conn.release();
|
|
239
|
+
}
|
|
198
240
|
},
|
|
199
241
|
async markMirror(root, occupant) {
|
|
200
242
|
const conn = await db.connect();
|
|
@@ -215,9 +257,7 @@ export function createSqlExecutionPlacementSeat(db) {
|
|
|
215
257
|
await conn.rollback();
|
|
216
258
|
return { outcome: "active", activeTaskId: claim.activeTaskId };
|
|
217
259
|
}
|
|
218
|
-
|
|
219
|
-
if ((await conn.query(s.text, [...s.values])).affected !== 1)
|
|
220
|
-
throw placementInvariant(root, "markMirror under a held row lock");
|
|
260
|
+
await writeCellOn(conn, db.dialect, root, markMirrorStatement(db.dialect, root));
|
|
221
261
|
await conn.commit();
|
|
222
262
|
return { outcome: "mirrored" };
|
|
223
263
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type UsageRow } from "../usage-analytics.js";
|
|
2
2
|
import type { TaskStatus } from "@sema-agent/core";
|
|
3
|
-
import { StoreBootRefusalError, type FenceLanded, type FencedRun, type InProcessClaimFence, type CreateRunOutcome, type NewRunMeta, type RunIdemBinding, type RunListQuery, type RunRecord, type
|
|
3
|
+
import { StoreBootRefusalError, type RunStallWiring, type SessionRootRows, type FenceLanded, type FencedRun, type InProcessClaimFence, type CreateRunOutcome, type NewRunMeta, type RunIdemBinding, type RunListQuery, type RunRecord, type SessionRunRollup, type RunEvent, type PersistedTaskResult, type LatestRunRef, type SettledLegMemoryObservation } from "./store-contracts.js";
|
|
4
4
|
import type { RunStoreCheckpointProbe } from "./memory-run-store.js";
|
|
5
5
|
import type { LedgerEventType } from "../trace/ledger-events.js";
|
|
6
6
|
import { type SpaceCommitClaim, type SpaceCommitReading, type SpaceCommitState } from "../workspace-space-commit.js";
|
|
@@ -8,8 +8,8 @@ import { type SpaceCommitClaim, type SpaceCommitReading, type SpaceCommitState }
|
|
|
8
8
|
* `RUN_STORE_STRICT_HYDRATE=on` 下 hydrate 列不出 `runs/` 时的**拒启**类型([ref] 件B;codex 对抗复审
|
|
9
9
|
* R1-[high] 验真后从裸 `Error` 升成具名类型)。
|
|
10
10
|
*
|
|
11
|
-
* 🔴
|
|
12
|
-
* (`DB_BACKEND` 未设)
|
|
11
|
+
* 🔴 **为什么必须是一个类型而不是一句文案**(修前形;降级臂改按数据根状态判之后,`runs/` 在场的根已不会降级,类型仍是拒句的属主):`openStoreBackendWithFallback` 对**默认推导**的 local
|
|
12
|
+
* (`DB_BACKEND` 未设)曾有一条按错误种类判的降级臂 —— mkdir / 只读盘那类「这台机器存不了盘」的失败降级到内存继续起。
|
|
13
13
|
* 本拒启从 `new LocalBackend(...)` 里冒出来,长得和它们一模一样,不给它一个可判别的身份就会被同一个
|
|
14
14
|
* catch 吞掉:operator 明确要的 **fail-closed 反而变成 fail-open**,而且丢的正是持久 run 账本(这根旋钮
|
|
15
15
|
* 存在的全部理由)。判据锚在**类型**上,不在文案上 —— 文案会改,类型不会(同文件族先例:`AdoptionError`
|
|
@@ -22,6 +22,13 @@ import { type SpaceCommitClaim, type SpaceCommitReading, type SpaceCommitState }
|
|
|
22
22
|
export declare class RunStoreStrictHydrateError extends StoreBootRefusalError {
|
|
23
23
|
readonly name = "RunStoreStrictHydrateError";
|
|
24
24
|
}
|
|
25
|
+
/** run 店在数据根下自己铸的目录(构造器与一次性迁移 M39 的名册同读这一只:名册的路径 = 店真实铸的路径)。 */
|
|
26
|
+
export declare function fileRunStoreDirsFor(root: string): {
|
|
27
|
+
readonly runs: string;
|
|
28
|
+
readonly active: string;
|
|
29
|
+
readonly tmp: string;
|
|
30
|
+
readonly spaceCommits: string;
|
|
31
|
+
};
|
|
25
32
|
export declare class FileRunStore implements InProcessClaimFence {
|
|
26
33
|
private readonly runsDir;
|
|
27
34
|
private readonly activeDir;
|
|
@@ -58,12 +65,22 @@ export declare class FileRunStore implements InProcessClaimFence {
|
|
|
58
65
|
private readonly claimLocks;
|
|
59
66
|
/** 件6(#43 案 [ref]):启动期告警座(可选)。既有调用方不传 ⇒ 只走 fail-open 遥测那一半,不炸。 */
|
|
60
67
|
private readonly logger;
|
|
68
|
+
/**
|
|
69
|
+
* 规则 L 的根行面({@link SessionRootRows}):`createRun` 先在它的锁里判根行在不在,再取认领锁。**必填**、惰性取(会话店构造时要本店,
|
|
70
|
+
* 所以装配方交一只取法:`LocalBackend` = `() => this.sessionStore`)。没有可选形、没有 setter、没有缺省:缺它的 run 店答不出 `sessionAbsent`,
|
|
71
|
+
* 删除 / 导入 / markMirror 读到的认领就又能被超车。
|
|
72
|
+
*/
|
|
73
|
+
private readonly rootRows;
|
|
61
74
|
/** [ref] 件B(census 第 29 行终局):`RUN_STORE_STRICT_HYDRATE` 的**部署级**表态。
|
|
62
75
|
* `true` ⇒ hydrate 的 readdir 失败拒启;缺席/`false` ⇒ 件6 的记债腿,行为字节不变。 */
|
|
63
76
|
private readonly strictHydrate;
|
|
64
|
-
|
|
77
|
+
/** 落死亡判决的窗与计数(构造时拿到;SQL 孪生同注,见 {@link RunStallWiring})。 */
|
|
78
|
+
private readonly stall;
|
|
79
|
+
constructor(root: string, opts: {
|
|
80
|
+
readonly rootRows: () => SessionRootRows;
|
|
65
81
|
error?(msg: string, fields?: Record<string, unknown>): void;
|
|
66
82
|
strictHydrate?: boolean;
|
|
83
|
+
readonly stall?: RunStallWiring;
|
|
67
84
|
});
|
|
68
85
|
private runDir;
|
|
69
86
|
private runJsonPath;
|
|
@@ -96,7 +113,7 @@ export declare class FileRunStore implements InProcessClaimFence {
|
|
|
96
113
|
*
|
|
97
114
|
* `readJsonlRecords` 对 ENOENT 答 `[]`、对其余读错(EACCES / EIO / EISDIR / ENOTDIR)**抛普通 Error**
|
|
98
115
|
* (亲验 core `dist/stores/file/fs-atomic.js`)。那个普通 Error 从构造器冒出去之后,在**默认
|
|
99
|
-
* 推导**的 local
|
|
116
|
+
* 推导**的 local 后端上修前会被 `openStoreBackendWithFallback` 的降级臂吞成 memory —— 也就是说 strict 开着
|
|
100
117
|
* 也照样带着残缺账本(或直接换成内存)起动,两处 readdir 门白守。
|
|
101
118
|
*
|
|
102
119
|
* ⇒ strict 档:非 ENOENT 的读盘失败一律转成 {@link RunStoreStrictHydrateError}(带路径 + 原文),由
|
|
@@ -118,13 +135,21 @@ export declare class FileRunStore implements InProcessClaimFence {
|
|
|
118
135
|
*/
|
|
119
136
|
private refuseIfUnreadable;
|
|
120
137
|
private hydrate;
|
|
121
|
-
/** run.json 的整文件原子替换 —— {@link persist}
|
|
138
|
+
/** run.json 的整文件原子替换 —— {@link persist} 的落盘那一半,不碰索引(只有 `persist` 调它)。 */
|
|
122
139
|
private writeRunFile;
|
|
123
|
-
/**
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
140
|
+
/**
|
|
141
|
+
* 索引里的行**只有这一条写律**,每个写口(建行 / 状态迁移 / 心跳 / 取消位 / 幂等绑定 / 接管 / 预览补写)都走它:
|
|
142
|
+
* **对副本判改 → 落盘成功 → 把改动合进索引里的同一只行对象**(索引里没有这一行才 `set` —— 建行)。
|
|
143
|
+
* 写口的形状恒为「在入口守卫读到的行上判,`{ ...r, 改动 }` 铸一份副本,交给本口」;`RunRow` 字段全 `readonly`,原地改一只行编不过。
|
|
144
|
+
*
|
|
145
|
+
* 三条后果都从这一条律拿到,不另设规则:
|
|
146
|
+
* · 落盘抛 ⇒ 索引里的行一字未动 —— 内存与盘同值,入口守卫读到的还是旧状态,重试照常补回。原地先改再落盘的写法,抛的那一拍把内存和盘劈成两半,
|
|
147
|
+
* 而改过的 `status` 还会让「首个终局写者赢」一类守卫把重试挡回 —— 盘上永远落不下那一笔(终局结果丢失,重启后被当孤儿记成 failed);
|
|
148
|
+
* · 落成之后索引里还是**同一只**行对象 —— 跨 await 持着行的收割腿(`reapSuspended` / `failSuspendedWithExpiredCheckpoint` / `reclaimOrphanedAtBoot`)
|
|
149
|
+
* await 之后的复核读的就是手上这只对象,换成副本它们就看不见期间的认领 / 取消 / 接管(再写一遍,把已被别腿落定的行盖掉);
|
|
150
|
+
* · 落盘与合回之间没有让出点(本口同步、体内无 await)⇒ 别的写者与收割腿读到的要么是落成前的行、要么是落成后的行,没有「盘已新、索引未合」的中间态。
|
|
151
|
+
* 在落盘与合回之间插 await 或别的事,就回到了收割写者会撞中间态的形(`test/file-run-store-persist-law.test.ts` 的结构钉守这一格)。
|
|
152
|
+
*/
|
|
128
153
|
private persist;
|
|
129
154
|
private eventLogFor;
|
|
130
155
|
/** Create a run iff the session has no active run (the task_active unique-key claim) AND no submission key of this
|
|
@@ -143,16 +168,16 @@ export declare class FileRunStore implements InProcessClaimFence {
|
|
|
143
168
|
* different claim locks) cannot both pass the check: the loser observes the winner's row. */
|
|
144
169
|
private commitNewRun;
|
|
145
170
|
/** run 行预览的写一次补写(SQL 孪生同义:列仍是 null 才写,建行写过 / 已补过的不动;行不在 ⇒ 无事)。
|
|
146
|
-
*
|
|
147
|
-
* 落成之后再把预览合回索引里的**同一只**行对象(不换对象:跨 await 持着行的收割腿复核读的是手上这只对象)。
|
|
171
|
+
* 走 {@link persist} 的写律:落盘抛 ⇒ 内存里的行一字未动(预览仍是 null)、盘上也原样,下一次补写照常再试 ——
|
|
148
172
|
* 原地先改再落盘,抛的那一拍就把内存和盘劈成两半(内存带预览、盘上 null),且「列已有值」的早退让这一分叉再也补不回来。
|
|
149
|
-
*
|
|
173
|
+
* 预览补写不碰 `updatedAt`(一次预览补写不是一次活性刷新)。 */
|
|
150
174
|
fillObjectivePreview(taskId: string, preview: string): Promise<void>;
|
|
151
175
|
requestCancel(taskId: string, owner: string | null): Promise<boolean>;
|
|
152
176
|
isCancelRequested(taskId: string, owner: string | null): Promise<boolean>;
|
|
153
177
|
requestPreempt(taskId: string, owner: string | null): Promise<boolean>;
|
|
154
178
|
isPreemptRequested(taskId: string, owner: string | null): Promise<boolean>;
|
|
155
|
-
|
|
179
|
+
/** 心跳:刷新并交回「行还在 running 吗」(持有者据它停腿;SQL 孪生同注)。 */
|
|
180
|
+
heartbeat(taskId: string, owner: string | null): Promise<boolean>;
|
|
156
181
|
appendEvent(taskId: string, seq: number, type: LedgerEventType, data: unknown): Promise<void>;
|
|
157
182
|
/**
|
|
158
183
|
* 写口里第四个盘面的那一段(与事件行的追加在**同一同步调用**里,块在前):帧经编解码拆成引用形 + 段体,本会话块账本里还没有的段体先追加
|
|
@@ -207,7 +232,7 @@ export declare class FileRunStore implements InProcessClaimFence {
|
|
|
207
232
|
listRuns(opts: RunListQuery): Promise<RunRecord[]>;
|
|
208
233
|
/**
|
|
209
234
|
* [ref] —— 这个会话**最近一条腿**的窄指针({@link SqlRunStore.latestRunForSession} 的孪生:同一个排序口径
|
|
210
|
-
* `createdAt DESC, taskId DESC
|
|
235
|
+
* `createdAt DESC, taskId DESC`,与本店窄读面 {@link FileRunStore.sessionRunRollups} 挑最新一条的比较器同一口径 —— `session-run-rollup.ts` 的 `newer`)。
|
|
211
236
|
*/
|
|
212
237
|
latestRunForSession(sessionId: string): Promise<LatestRunRef | undefined>;
|
|
213
238
|
/**
|
|
@@ -215,25 +240,16 @@ export declare class FileRunStore implements InProcessClaimFence {
|
|
|
215
240
|
* {@link SqlRunStore.latestMemoryObservationForSession} 的孪生:同一只已结谓词(`isTerminalRunStatus`)、同一个排序口径 —— 与本店 {@link FileRunStore.latestRunForSession} 的比较器逐字同一份)。
|
|
216
241
|
*/
|
|
217
242
|
latestMemoryObservationForSession(sessionId: string): Promise<SettledLegMemoryObservation | undefined>;
|
|
218
|
-
/**
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
cursor?: {
|
|
223
|
-
lastActivityAt: string;
|
|
224
|
-
sessionId: string;
|
|
225
|
-
};
|
|
226
|
-
limit: number;
|
|
227
|
-
q?: string;
|
|
228
|
-
}): Promise<SessionSummary[]>;
|
|
243
|
+
/** 会话枚举面读 run 账的窄读面(`SessionRunRollupSource`;规则 = 共用纯函数 {@link buildSessionRunRollups},与内存孪生、SQL 会话店的列表子查询同读)。 */
|
|
244
|
+
sessionRunRollups(opts?: {
|
|
245
|
+
readonly q?: string;
|
|
246
|
+
}): Promise<ReadonlyMap<string, SessionRunRollup>>;
|
|
229
247
|
/** E21 (§0.5 delete) — purge the runs ledger for one session, scoped by `session_id` ALONE (per-row owner is the
|
|
230
|
-
* submitting principal and diverges from the session owner — full 判据 see the SQL twin's head-note, F-A)
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
deleteBySession(sessionId: string
|
|
248
|
+
* submitting principal and diverges from the session owner — full 判据 see the SQL twin's head-note, F-A)。
|
|
249
|
+
* **不判认领**(会话三态,`src/session-deletion.ts`):唯一的生产调用点是删除协调器的账本腿,它在围栏(根行锁里判过「没有认领」、写下在删令牌)之后才调,
|
|
250
|
+
* 在删期间规则 L 不让认领落下 —— 这里没有可判的东西。 */
|
|
251
|
+
deleteBySession(sessionId: string): Promise<{
|
|
234
252
|
removed: number;
|
|
235
|
-
} | {
|
|
236
|
-
active: string;
|
|
237
253
|
}>;
|
|
238
254
|
/** 用量扫窗——in-memory 腿:遍历窗内行,投影同 usage-analytics 纯函数(SQL 孪生 parity)。 */
|
|
239
255
|
usageScan(fromMs: number, toMs: number, opts?: {
|
|
@@ -254,7 +270,13 @@ export declare class FileRunStore implements InProcessClaimFence {
|
|
|
254
270
|
private sweepClaims;
|
|
255
271
|
/** Flip every `running` row matching `pred` → failed (with the death sentence `reason` + its machine `code`), then sweep terminal claims. */
|
|
256
272
|
private reapRunning;
|
|
257
|
-
|
|
273
|
+
/** 收割器(全表形;SQL 孪生同注):判决 `due` 的 `running` 行判死 + 放终局认领。窗读构造时拿到的 getter。 */
|
|
274
|
+
reapStale(): Promise<number>;
|
|
275
|
+
/**
|
|
276
|
+
* 观察口(落判决的三处之一;SQL 孪生同注):属主门之后的那条行 —— `due` ⇒ 单行判死(与收割器同一只 {@link reapRunning})+ 放认领、交回当前行;否则原样、零 I/O。
|
|
277
|
+
* 落盘失败 ⇒ F 类留痕 + 行原样交回(收割器下一拍补;副本写律保证索引里的行一字未动)。
|
|
278
|
+
*/
|
|
279
|
+
observeRun(row: RunRecord): Promise<RunRecord>;
|
|
258
280
|
/** TOC integration ask③ (INTEGRATION-DESIGN §11): a host-lane engine restart leaves the PREVIOUS process's
|
|
259
281
|
* `running` rows orphaned — their in-process driver (runInBackground, in the dead process's memory) is gone, but the
|
|
260
282
|
* `active/<sessionId>` claim persists on disk and EEXIST-blocks a re-submit (the shell reads the session as stuck).
|
|
@@ -370,13 +392,45 @@ export declare class FileRunStore implements InProcessClaimFence {
|
|
|
370
392
|
private takeOverClaim;
|
|
371
393
|
/** Release a session's single-active claim: unlink the claim file + drop the index entry (idempotent). */
|
|
372
394
|
private releaseClaim;
|
|
373
|
-
/**
|
|
395
|
+
/**
|
|
396
|
+
* 删一条 run 的**唯一删法**(删会话 {@link deleteBySession} 与提交出口的撤回 {@link withdrawRunsOf} 同一形)—— **严格**:盘先、索引后。
|
|
397
|
+
* 先关这条 run 的事件 fd(开着的文件在 win32 上删不掉;fd 只是缓存,下一次追加按需重开)→ 删 run 目录(删不掉 ⇒ **抛**,索引一个字节不动:这条 run 仍完整可读,
|
|
398
|
+
* 重试从同一状态开始)→ fsync `runs` 目录(删掉的目录项在盘上;win32 不 fsync 目录,与原子写同一条平台律)→ 才拆内存索引(事件、幂等键、行)。
|
|
399
|
+
* 修前是「先拆索引、删目录失败静默」:删不掉的目录在重启后 hydrate 回一条僵尸 run,而调用方已答「删了」。
|
|
400
|
+
*/
|
|
374
401
|
private dropRun;
|
|
402
|
+
/**
|
|
403
|
+
* 提交出口条件撤回的 run 半(`local-session-store.ts` 的 {@link SessionRunWithdrawSource};local 会话店在这只会话的写锁 = 根行锁里调 —— 本方法不取根行锁、不让出事件循环):
|
|
404
|
+
* 本会话有 `ownTaskId` 之外的 run 行 ⇒ `{ keep: "runs" }`,一个字节不删;否则与 {@link deleteBySession} 同序删:块账本先、本次 run 后(严格删法 {@link dropRun})。
|
|
405
|
+
* `ownTaskId` 那一行不属于这只会话 ⇒ 响亮抛(调用方交错了 id,不猜)。认领由调用方的判官先判过(在 ⇒ 不会走到这里)。
|
|
406
|
+
*/
|
|
407
|
+
withdrawRunsOf(sessionId: string, ownTaskId: string | undefined): "proceed" | {
|
|
408
|
+
readonly keep: "runs";
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* 一次性迁移 **M44 的 local 腿**(窗、删法与删后谁接住:窗口见 `plugins/one-time-migrations.ts` 登记表):`errorCode` 只读列 —— 列建立之前 / 停驻写口不写列时写下的行,
|
|
412
|
+
* 列改写成「这条行在稳定、非到期时修前 `GET` 会答的码」= 结果投影的码(读盘面认两代形并折码)?? 列的原值;`running` 行的列置空(续跑认领清列)。盘上与内存同改(副本写律)。
|
|
413
|
+
* 起服时调(`LocalBackend.runOneTimeMigrations`,任何读者之前);数据根独占 ⇒ 本车道没有混跑窗,不需要读侧半场。幂等:第二跑零命中零写盘。
|
|
414
|
+
*/
|
|
415
|
+
migrateRunErrorCodeColumnM44(): number;
|
|
416
|
+
/**
|
|
417
|
+
* 一次性迁移 **M45 的 local 腿**(窗、删法与删后谁接住:窗口见 `plugins/one-time-migrations.ts` 登记表):预览列以闭集注入块开标签起头的行(7.124.0 之前写下的形)
|
|
418
|
+
* 剥到不动点 —— 判据与新值同 SQL 腿(`run-preview-m45.ts` 唯一一份)。盘上与内存同改(副本写律)。
|
|
419
|
+
* 起服时调(`LocalBackend.runOneTimeMigrations`,任何读者之前);数据根独占 ⇒ 没有混跑窗。幂等:写后的值不再以开标签起头 ⇒ 第二跑零命中零写盘。
|
|
420
|
+
*/
|
|
421
|
+
migrateRunObjectivePreviewM45(): number;
|
|
422
|
+
/**
|
|
423
|
+
* 一次性迁移 **M48 的 local 腿**(run 行半场;窗、删法与删后谁接住:窗口见 `plugins/one-time-migrations.ts` 登记表):属主恰为 cli 哨兵(`shell-sentinel-owner-m48.ts`)的 run 行
|
|
424
|
+
* 改写成无主。盘上与内存同改(副本写律)。起服时调(`LocalBackend.runOneTimeMigrations`,任何读者之前);数据根独占 ⇒ 没有混跑窗。幂等:第二跑零命中零写盘。
|
|
425
|
+
*/
|
|
426
|
+
clearShellSentinelOwnersM48(): number;
|
|
375
427
|
/**
|
|
376
428
|
* 一次性迁移 **M32 的 local 腿**(执行放置回填;窗、删法与删后谁接住:窗口见 `plugins/one-time-migrations.ts` 登记表):有 run 行的会话 id(去重)。
|
|
377
429
|
* 起服时调(`LocalBackend.runOneTimeMigrations`,任何读者之前);读内存索引(构造时已从盘上 hydrate),零写。
|
|
378
430
|
*/
|
|
379
431
|
sessionIdsWithRuns(): ReadonlySet<string>;
|
|
432
|
+
/** 一次性迁移 **M42 的 local 腿**(场景前缀的切换检查;窗口见 `plugins/one-time-migrations.ts` 登记表):属主以保留前缀开头的 run 行数。读内存索引(构造时已 hydrate),零写。 */
|
|
433
|
+
scenarioPrefixOwnerRowsM42(): number;
|
|
380
434
|
/** Release every open event-log fd (called by LocalBackend.close so a graceful restart can re-open the data dir). */
|
|
381
435
|
dispose(): void;
|
|
382
436
|
}
|