@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,27 @@
|
|
|
1
1
|
import { homedir } from "node:os";
|
|
2
2
|
import { StubExecutionEnv } from "@sema-agent/core";
|
|
3
|
-
import { EXECUTION_LANE_WORDS as DECLARABLE_LANE_WORDS, EXECUTION_LANES, isBlankCoordinate, retiredLaneWordRefusal } from "@sema-agent/settings-schema/execution-lanes";
|
|
3
|
+
import { EXECUTION_LANE_WORDS as DECLARABLE_LANE_WORDS, EXECUTION_LANES, LANE_SET_RULE, isBlankCoordinate, laneSetFlaws, retiredLaneWordRefusal } from "@sema-agent/settings-schema/execution-lanes";
|
|
4
4
|
import { DECLARE_HOME_REMEDY, LANE_HOME_UNDECLARED_EVENT, LANE_HOME_UNMEASURED_EVENT, buildHomeAbsentNote, buildHomeUnmeasuredNote } from "./lane-home-probe.js";
|
|
5
5
|
const NO = "unsupported";
|
|
6
6
|
const YES = "supported";
|
|
7
7
|
const SU = "single-user-only";
|
|
8
8
|
export function executionLaneCaps(lane) {
|
|
9
9
|
switch (lane) {
|
|
10
|
-
case "
|
|
10
|
+
case "none":
|
|
11
11
|
return {
|
|
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,
|
|
19
|
-
tenantSeparation:
|
|
18
|
+
tenantSeparation: executionLaneRow(lane).tenantSeparation,
|
|
20
19
|
};
|
|
21
20
|
case "host":
|
|
22
21
|
return {
|
|
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,
|
|
@@ -119,7 +111,7 @@ export function sandboxReadFloorState(lane, knob) {
|
|
|
119
111
|
return readFloorStateOf(k, false);
|
|
120
112
|
}
|
|
121
113
|
}
|
|
122
|
-
const
|
|
114
|
+
const NONE_BLOCK = new StubExecutionEnv().capabilities;
|
|
123
115
|
const HOST_BLOCK = Object.freeze({ isolation: false, suspendable: false, sharesProcessTable: true, canonicalPathAuthoritative: true, hostLocalPaths: true, externalContentTarget: false, io: true, keepsReadFloor: false });
|
|
124
116
|
const E2B_SHAPE = Object.freeze({ isolation: true, suspendable: true, sharesProcessTable: false, canonicalPathAuthoritative: true, hostLocalPaths: false, externalContentTarget: false, io: true });
|
|
125
117
|
const K8S_SHAPE = Object.freeze({ isolation: true, suspendable: false, sharesProcessTable: false, canonicalPathAuthoritative: true, hostLocalPaths: false, externalContentTarget: false, io: true });
|
|
@@ -144,8 +136,8 @@ const DEVICE_BLOCK = Object.freeze({ isolation: false, suspendable: false, share
|
|
|
144
136
|
const NO_SUB_KNOBS = Object.freeze({ snapshotStore: false, sandboxReadFloor: undefined });
|
|
145
137
|
function laneBlock(lane, sub) {
|
|
146
138
|
switch (lane) {
|
|
147
|
-
case "
|
|
148
|
-
return
|
|
139
|
+
case "none":
|
|
140
|
+
return NONE_BLOCK;
|
|
149
141
|
case "host":
|
|
150
142
|
return HOST_BLOCK;
|
|
151
143
|
case "e2b":
|
|
@@ -161,13 +153,13 @@ function laneBlock(lane, sub) {
|
|
|
161
153
|
}
|
|
162
154
|
}
|
|
163
155
|
export function capabilitiesFor(deployment) {
|
|
164
|
-
const lane = executionLaneOf(deployment.remoteExec
|
|
156
|
+
const lane = executionLaneOf(deployment.remoteExec.provider);
|
|
165
157
|
if (lane === undefined)
|
|
166
158
|
return undefined;
|
|
167
|
-
return laneBlock(lane, { snapshotStore: lane === "k8s" && Boolean(deployment.remoteExec
|
|
159
|
+
return laneBlock(lane, { snapshotStore: lane === "k8s" && Boolean(deployment.remoteExec.s3Snapshot), sandboxReadFloor: deployment.sandboxReadFloor });
|
|
168
160
|
}
|
|
169
161
|
export function laneSandboxReadFloorState(deployment) {
|
|
170
|
-
const lane = executionLaneOf(deployment.remoteExec
|
|
162
|
+
const lane = executionLaneOf(deployment.remoteExec.provider);
|
|
171
163
|
if (lane === undefined)
|
|
172
164
|
return undefined;
|
|
173
165
|
switch (lane) {
|
|
@@ -175,7 +167,7 @@ export function laneSandboxReadFloorState(deployment) {
|
|
|
175
167
|
case "k8s":
|
|
176
168
|
case "local-docker":
|
|
177
169
|
return sandboxReadFloorState(lane, deployment.sandboxReadFloor);
|
|
178
|
-
case "
|
|
170
|
+
case "none":
|
|
179
171
|
case "host":
|
|
180
172
|
case "ssh":
|
|
181
173
|
case "adb":
|
|
@@ -183,12 +175,11 @@ export function laneSandboxReadFloorState(deployment) {
|
|
|
183
175
|
return undefined;
|
|
184
176
|
}
|
|
185
177
|
}
|
|
186
|
-
export const ALL_EXECUTION_LANES = Object.freeze([
|
|
178
|
+
export const ALL_EXECUTION_LANES = Object.freeze([...DECLARABLE_LANE_WORDS]);
|
|
187
179
|
const EXECUTION_LANE_SET = new Set(ALL_EXECUTION_LANES);
|
|
188
180
|
export function isExecutionLane(word) {
|
|
189
181
|
return EXECUTION_LANE_SET.has(word);
|
|
190
182
|
}
|
|
191
|
-
export const REMOTE_EXEC_PROVIDER_WORDS = Object.freeze([...DECLARABLE_LANE_WORDS]);
|
|
192
183
|
const LANE_ROWS = (() => {
|
|
193
184
|
const rows = new Map();
|
|
194
185
|
for (const row of EXECUTION_LANES) {
|
|
@@ -217,72 +208,53 @@ export function isBlankRequiredEnvValue(value) {
|
|
|
217
208
|
export function laneMissingEnv(lane, env) {
|
|
218
209
|
return laneRequiredEnv(lane).filter((name) => isBlankRequiredEnvValue(env[name]));
|
|
219
210
|
}
|
|
211
|
+
const LANE_ROW_OF_WORD = LANE_ROWS;
|
|
212
|
+
function laneSetFlawPhrase(flaw) {
|
|
213
|
+
switch (flaw.kind) {
|
|
214
|
+
case "empty_set":
|
|
215
|
+
return "it has no entries";
|
|
216
|
+
case "blank_entry":
|
|
217
|
+
return `entry ${flaw.at + 1} is empty or whitespace-only`;
|
|
218
|
+
case "unknown":
|
|
219
|
+
return `"${String(flaw.word)}" (entry ${flaw.at + 1}) is not an execution lane`;
|
|
220
|
+
case "retired":
|
|
221
|
+
return retiredLaneWordRefusal(flaw.word) ?? `"${flaw.word}" (entry ${flaw.at + 1}) is a retired execution lane`;
|
|
222
|
+
case "duplicate":
|
|
223
|
+
return `"${flaw.lane}" is listed twice (again at entry ${flaw.at + 1})`;
|
|
224
|
+
case "not_alone":
|
|
225
|
+
return `"${flaw.lane}" (no execution environment for the agent's tools) must be the only entry`;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
220
228
|
export function readDeclaredLaneTable(raw) {
|
|
221
229
|
const segments = raw.split(",");
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
const retired = lane === undefined ? retiredLaneWordRefusal(segment) : undefined;
|
|
229
|
-
if (retired !== undefined)
|
|
230
|
-
return { refusal: `REMOTE_EXEC="${raw}": ${retired}.` };
|
|
231
|
-
if (lane === undefined) {
|
|
232
|
-
return {
|
|
233
|
-
refusal: `REMOTE_EXEC="${raw}"${segments.length > 1 ? ` lists "${segment}", which` : ""} is not an execution lane — valid: ${REMOTE_EXEC_PROVIDER_WORDS.join(" | ")}. ` +
|
|
234
|
-
`An unrecognized value used to fall through to the host/in-process lane silently; refusing to start instead (#157).`,
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
if (lanes.includes(lane))
|
|
238
|
-
return { refusal: `REMOTE_EXEC="${raw}" lists "${lane}" twice — each execution lane appears once (the first one is the default).` };
|
|
239
|
-
lanes.push(lane);
|
|
230
|
+
const flaws = laneSetFlaws(segments);
|
|
231
|
+
if (flaws.length > 0) {
|
|
232
|
+
return {
|
|
233
|
+
refusal: `REMOTE_EXEC="${raw}" is not a valid execution lane set: ${flaws.map(laneSetFlawPhrase).join("; ")}. ` +
|
|
234
|
+
`REMOTE_EXEC (the lane set, comma-separated) ${LANE_SET_RULE}. Refusing to start rather than guessing a lane (#157).`,
|
|
235
|
+
};
|
|
240
236
|
}
|
|
237
|
+
const lanes = segments.map((segment) => {
|
|
238
|
+
const row = LANE_ROW_OF_WORD.get(segment);
|
|
239
|
+
if (row === undefined)
|
|
240
|
+
throw new Error(`readDeclaredLaneTable: the lane-set judge accepted "${segment}" but the lane table has no row for it`);
|
|
241
|
+
return row.lane;
|
|
242
|
+
});
|
|
241
243
|
const [first, ...rest] = lanes;
|
|
242
244
|
if (first === undefined)
|
|
243
245
|
throw new Error(`readDeclaredLaneTable: "${raw}" split into no segments`);
|
|
244
246
|
return { lanes: [first, ...rest] };
|
|
245
247
|
}
|
|
246
|
-
export function executionLaneRequiredRefusal(deployment) {
|
|
247
|
-
if (!deployment.requireExecutionLane || executionLaneOf(deployment.remoteExec?.provider) !== "in-process")
|
|
248
|
-
return undefined;
|
|
249
|
-
return (`REQUIRE_EXECUTION_LANE=true but NO execution lane is named on this deployment — refusing to start. ` +
|
|
250
|
-
`With no lane the engine falls back to its in-process stub environment: the hands band (the roster entries whose ` +
|
|
251
|
-
`wiring_manifest mountedBy is "hands", Bash among them) is not mounted, while the rest of the roster still executes, ` +
|
|
252
|
-
`and every task still returns status=completed — for any request that needs a hand, indistinguishable from "the model ` +
|
|
253
|
-
`chose not to use its tools". (How much of the roster is mounted is a per-run fact: read the wiring_manifest event and ` +
|
|
254
|
-
`count entries whose mountedBy is "hands" — never judge by tool names.) ` +
|
|
255
|
-
`Cause: REMOTE_EXEC is unset/empty AND CONFIG_PROVIDER is not "local". ` +
|
|
256
|
-
`Fix: set REMOTE_EXEC to one of ${REMOTE_EXEC_PROVIDER_WORDS.join(" | ")} (and that lane's required env), ` +
|
|
257
|
-
`or set CONFIG_PROVIDER=local to take the single-machine \`host\` default, ` +
|
|
258
|
-
`or unset REQUIRE_EXECUTION_LANE to keep running without hands on purpose.`);
|
|
259
|
-
}
|
|
260
248
|
export function executionLaneOf(provider) {
|
|
261
|
-
if (provider === undefined)
|
|
262
|
-
return "in-process";
|
|
263
249
|
return isExecutionLane(provider) ? provider : undefined;
|
|
264
250
|
}
|
|
265
251
|
export function deployedExecutionLanes(config) {
|
|
266
|
-
return [
|
|
252
|
+
return [config.remoteExec.provider];
|
|
267
253
|
}
|
|
268
254
|
export function handsOnWorkerFilePlane(lane) {
|
|
269
255
|
const block = laneBlock(lane, NO_SUB_KNOBS);
|
|
270
256
|
return block.io && block.hostLocalPaths;
|
|
271
257
|
}
|
|
272
|
-
export function laneBindsReads(lane) {
|
|
273
|
-
switch (lane) {
|
|
274
|
-
case "host":
|
|
275
|
-
return true;
|
|
276
|
-
case "in-process":
|
|
277
|
-
case "e2b":
|
|
278
|
-
case "k8s":
|
|
279
|
-
case "ssh":
|
|
280
|
-
case "adb":
|
|
281
|
-
case "device":
|
|
282
|
-
case "local-docker":
|
|
283
|
-
return false;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
258
|
export function laneMeasuresHome(lane) {
|
|
287
259
|
switch (lane) {
|
|
288
260
|
case "k8s":
|
|
@@ -293,7 +265,7 @@ export function laneMeasuresHome(lane) {
|
|
|
293
265
|
case "host":
|
|
294
266
|
return true;
|
|
295
267
|
case "device":
|
|
296
|
-
case "
|
|
268
|
+
case "none":
|
|
297
269
|
return false;
|
|
298
270
|
}
|
|
299
271
|
}
|
|
@@ -304,7 +276,7 @@ export function laneReadFaceDefault(lane) {
|
|
|
304
276
|
case "local-docker":
|
|
305
277
|
return "open";
|
|
306
278
|
case "host":
|
|
307
|
-
case "
|
|
279
|
+
case "none":
|
|
308
280
|
case "ssh":
|
|
309
281
|
case "adb":
|
|
310
282
|
case "device":
|
|
@@ -324,11 +296,8 @@ export function executionLaneHomeDir(deployment) {
|
|
|
324
296
|
const declared = deployment.remoteExecHomeDir;
|
|
325
297
|
if (declared !== undefined)
|
|
326
298
|
return declared;
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
return undefined;
|
|
330
|
-
switch (lane) {
|
|
331
|
-
case "in-process":
|
|
299
|
+
switch (deployment.remoteExec.provider) {
|
|
300
|
+
case "none":
|
|
332
301
|
case "host":
|
|
333
302
|
return homedir();
|
|
334
303
|
case "e2b":
|
|
@@ -348,23 +317,22 @@ export function buildLaneHomeClaim(deployment) {
|
|
|
348
317
|
return { homeDir: home, homeDirSource: deployment.remoteExecHomeDir !== undefined ? "declared" : "lane" };
|
|
349
318
|
}
|
|
350
319
|
export function buildLaneHomeBootNote(deployment) {
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
320
|
+
const homeLane = deployment.remoteExec.provider;
|
|
321
|
+
if (!laneWiresExecutionEnv(homeLane))
|
|
353
322
|
return undefined;
|
|
354
|
-
if (laneMeasuresHome(
|
|
323
|
+
if (laneMeasuresHome(homeLane))
|
|
355
324
|
return undefined;
|
|
356
325
|
const home = executionLaneHomeDir(deployment);
|
|
357
326
|
if (home === undefined)
|
|
358
|
-
return { event: LANE_HOME_UNDECLARED_EVENT, note: buildHomeAbsentNote(
|
|
359
|
-
return { event: LANE_HOME_UNMEASURED_EVENT, note: buildHomeUnmeasuredNote(
|
|
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) };
|
|
328
|
+
return { event: LANE_HOME_UNMEASURED_EVENT, note: buildHomeUnmeasuredNote(homeLane, home) };
|
|
360
329
|
}
|
|
361
330
|
export function buildReadDenyFloorUnkeptNote(deployment) {
|
|
362
331
|
if (!deployment.readDenyFloorRequired)
|
|
363
332
|
return undefined;
|
|
364
333
|
if (capabilitiesFor(deployment)?.keepsReadFloor === true)
|
|
365
334
|
return undefined;
|
|
366
|
-
|
|
367
|
-
return (`READ_DENY_FLOOR_REQUIRED=true, but the "${lane}" execution lane does not keep the read-deny byte floor (a program its commands run can open a path ` +
|
|
335
|
+
return (`READ_DENY_FLOOR_REQUIRED=true, but the "${deployment.remoteExec.provider}" execution lane does not keep the read-deny byte floor (a program its commands run can open a path ` +
|
|
368
336
|
`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 — ` +
|
|
369
337
|
`is refused before any command starts (config.read_deny_floor_unkept; a synchronous submit answers 409). ` +
|
|
370
338
|
`Either run on a lane that keeps the floor, or unset READ_DENY_FLOOR_REQUIRED to run with one operator notice per run instead.`);
|
|
@@ -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`)—— 两侧都是会话店的头读:不铸化身的店上**两侧都没有令牌**。
|
|
@@ -162,8 +172,9 @@ export declare class SessionForkInProgressError extends Error {
|
|
|
162
172
|
constructor(sessionId: string);
|
|
163
173
|
}
|
|
164
174
|
/**
|
|
165
|
-
*
|
|
166
|
-
* `session_meta` 行、再锁定读 `task_active(root)`,读到认领 ⇒
|
|
175
|
+
* 写口在写事务 / 写锁内的认领读命中:SQL = 读写序律(`plugins/execution-placement-sql.ts` 的 `lockRootAndReadClaim`:改根住客 / 放置的写者在自己的事务里先锁根
|
|
176
|
+
* `session_meta` 行、再锁定读 `task_active(root)`,读到认领 ⇒ 回滚、一个字节不写、抛它);local = 这只会话的写锁(= 根行锁)内读 run 店的认领(`markMirror` 返回 `active` 臂;
|
|
177
|
+
* 三个导入写口、删除与 placed 行的终结经 {@link judgeSessionWrite} 抛它)—— device 首绑在写事务内的认领读只在 SQL 后端(local 没有 device 工厂)。
|
|
167
178
|
* 具名类型、**不带 wire 码**:各门按自己的既有码答(导入 409 `session_active`、删除 409 `conflict.session_active_run`),体带 `activeTaskId`。
|
|
168
179
|
*/
|
|
169
180
|
export declare class SessionActiveRunError extends Error {
|
|
@@ -181,6 +192,51 @@ export declare const WRITABLE: "writable";
|
|
|
181
192
|
export declare function settledPlaceOutcome(root: string, reading: ExecutionPlacementReading | undefined, occupant: SessionFace, wanted: ExecutionWriterCell): PlaceOutcome | typeof WRITABLE;
|
|
182
193
|
/** markMirror 的唯一判官(认领那一半在本判官之后,SQL 与 local 各在自己的写事务 / 写锁内判):行不在 / 住客不同 ⇒ `gone`;writer ⇒ `writer`;mirror ⇒ `mirrored`(幂等,零写);absent ⇒ {@link WRITABLE};forking ⇒ 抛。 */
|
|
183
194
|
export declare function settledMirrorOutcome(root: string, reading: ExecutionPlacementReading | undefined, occupant: SessionFace): MarkMirrorOutcome | typeof WRITABLE;
|
|
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;
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
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 = 这只会话的写锁(= 根行锁)内、第一笔写之前(取锁 → 读认领 → 判 → 写)。
|
|
233
|
+
* 返回判、不抛:拒之后一个字节不写由调用方保证(SQL 回滚,local 判在第一笔写之前)。
|
|
234
|
+
*/
|
|
235
|
+
export declare function judgeSessionWrite(write: SessionWrite, read: {
|
|
236
|
+
readonly claim: () => Promise<string | null | undefined>;
|
|
237
|
+
readonly cell: () => Promise<ExecutionPlacementCell>;
|
|
238
|
+
readonly deleting: () => Promise<string | null>;
|
|
239
|
+
}): Promise<SessionWriteJudgement>;
|
|
184
240
|
/** device 车道首绑(absent → writer(device, D) 或 writer(device, ∅) → writer(device, D))的结果(设备店的事务 / 内存参照实现同调)。 */
|
|
185
241
|
export type DeviceBindOutcome = {
|
|
186
242
|
readonly outcome: "bound";
|
|
@@ -94,6 +94,64 @@ export function settledMirrorOutcome(root, reading, occupant) {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}
|
|
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) };
|
|
135
|
+
const claim = await read.claim();
|
|
136
|
+
if (claim !== null && claim !== undefined)
|
|
137
|
+
return { refuse: new SessionActiveRunError(root, claim) };
|
|
138
|
+
if (!sessionWriteTouchesCell(write.op))
|
|
139
|
+
return "proceed";
|
|
140
|
+
const cell = await read.cell();
|
|
141
|
+
switch (cell.role) {
|
|
142
|
+
case "writer":
|
|
143
|
+
return { refuse: new SessionWriterPresentError(root, cell.lane) };
|
|
144
|
+
case "forking":
|
|
145
|
+
return { refuse: new SessionForkInProgressError(root) };
|
|
146
|
+
case "absent":
|
|
147
|
+
case "mirror":
|
|
148
|
+
return "proceed";
|
|
149
|
+
default: {
|
|
150
|
+
const unknownRole = cell;
|
|
151
|
+
throw new Error(`judgeSessionWrite: no arm for ${JSON.stringify(unknownRole)}`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
97
155
|
export function settledDeviceBindOutcome(root, reading, occupant, deviceId) {
|
|
98
156
|
if (reading === undefined || !sameOccupant(reading.occupant, occupant))
|
|
99
157
|
return { outcome: "gone" };
|
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
|
/**
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* [ref]④ —— SQL file-history 店的 **typed 永久失败**披露座:散文一个铸点 + 机器面一只 sink。
|
|
3
3
|
*
|
|
4
4
|
* ## 病(基线 v7.79.0 逐行亲核 + 亲跑)
|
|
5
|
-
* `
|
|
5
|
+
* `stores-sql/blob-index-sql.ts` 的 `BlobTooLargeError` 带 typed 判别码 `blob_too_large_for_sql`,头注
|
|
6
6
|
* 原话「绝不能与 transient 写失败混在一类(那类是可重试的 502;这类重试永远不会成功)」。可它一旦被
|
|
7
|
-
* `
|
|
7
|
+
* `stores-sql/file-history-store-sql.ts` 的任何一条 `catch` 折进 `FileHistoryResult.error.message`,判别码
|
|
8
8
|
* 就只剩散文,**机器一位都读不到**。两条腿各自的后果:
|
|
9
9
|
*
|
|
10
10
|
* · **snapshot(边界捕获)腿**:引擎把失败包成一句散文交给 `RunnerDeps.onError({phase:"rewind"})`
|
|
@@ -69,27 +69,34 @@ export interface DrainDeadlineRefusal {
|
|
|
69
69
|
/** 入口的答:契约回执(进入 / 已在排空),或期限越界的拒(只在调用方声明了上界时出现)。按 `state` 穷举。 */
|
|
70
70
|
export type DrainEntryAnswer = DrainReceipt | DrainDeadlineRefusal;
|
|
71
71
|
/**
|
|
72
|
-
* 在飞数的**分项**(`GET /health` 的 `inflightBreakdown`)——
|
|
73
|
-
* · **总数**(可观测事实,{@link inflightTotal} = `/health.inflight`):这台引擎此刻托管着多少活 = `http + leader + sessionResident`;
|
|
74
|
-
* · **阻断集**(判据,{@link blockingInflightOf} = `drainState.blockingInflight`):还有没有**必须等完**的活 = `http + leader`。
|
|
72
|
+
* 在飞数的**分项**(`GET /health` 的 `inflightBreakdown`)—— 同一份分项派生**两个事实**,不是两份计数(计法表全文 = 契约 `docs/ASSISTANT-WIRE-CONTRACT.md` 的 `/health` 节):
|
|
73
|
+
* · **总数**(可观测事实,{@link inflightTotal} = `/health.inflight`):这台引擎此刻托管着多少活 = `http + leader + backgroundAgents + sessionResident`;
|
|
74
|
+
* · **阻断集**(判据,{@link blockingInflightOf} = `drainState.blockingInflight`):还有没有**必须等完**的活 = `http + leader + backgroundAgents`。
|
|
75
75
|
* 排空等的、孤儿窗 / 附着租约自退 / SIGHUP 空闲窗判「可以停了吗」读它。`sessionResident` 不在其内。
|
|
76
|
-
*
|
|
76
|
+
* 四项:
|
|
77
77
|
* · `http` —— 本副本的 HTTP 腿:在飞 run 集(`inflightRuns ∪ steerableRuns`)+ 没有登记身份的同步计费腿(`/v1/tasks` 的同步腿)+ admission 期的非探针请求;
|
|
78
78
|
* · `leader` —— leader 口的后台 run(`leaderEndpoint.inflight()`);
|
|
79
|
-
* · `
|
|
79
|
+
* · `backgroundAgents` —— 活过起它的那一条腿、仍在跑的后台子代理(core `backgroundScope:"session"`;`session-resident-background.ts` 的读法:停驻的不计)。
|
|
80
|
+
* 它进阻断集:它是一条在干活的模型腿,干完自己收尾(在审批 / 问答卡上等人时行仍是 `running`、照计;窗满转成耐久停驻后不再计);不等 = 受控退把还在干活的子代理中断。
|
|
81
|
+
* 上界 = 停滞收割窗 `BG_AGENT_STALL_MS`:读口每读一次先让引擎收掉静默满窗的子代理(挂死的,或收尾时 core 等的那次账本写挂住的)再数 —— 判停窗不再被一只僵尸无界地撑着;
|
|
82
|
+
* SIGTERM 排空另以期限为界;
|
|
83
|
+
* · `sessionResident` —— 会话驻留的后台 shell / monitor(同一读法:不含 retain 行)。
|
|
80
84
|
* 它只进总数、不进阻断集:一只不退出的驻留 shell(`while true`)若阻断,崩溃孤儿引擎就永生、排空每次等满窗;窗到 / 排空完成即由退出边界的后台收割收掉
|
|
81
85
|
* (retain 行按 retain 既有语义,活过受控退)。
|
|
82
|
-
*
|
|
83
|
-
*
|
|
86
|
+
* 不进任何一项的(计法表成文的行):停驻待赎回的 run 与停驻的后台子代理(耐久,不占执行座)· 活过起它的腿的 workflow(任务表分不出它在干活还是在等人,见
|
|
87
|
+
* `session-resident-background.ts` 头注)· retain 的后台 shell · 只读订阅流(只进 `attachedStreams`)。
|
|
88
|
+
* 四项在同一次读里求出(`http/server.ts` 的 `inflightBreakdown` 是唯一的分项函数,两个和都读它),`/health` 的 `inflight` 与 `inflightBreakdown` 因此永远自洽,
|
|
89
|
+
* 判停与 `/health` 也不会各有一份算法。只有这两个函数各写一次这两个和,没有第三张计法表。
|
|
84
90
|
*/
|
|
85
91
|
export interface InflightBreakdown {
|
|
86
92
|
readonly http: number;
|
|
87
93
|
readonly leader: number;
|
|
94
|
+
readonly backgroundAgents: number;
|
|
88
95
|
readonly sessionResident: number;
|
|
89
96
|
}
|
|
90
97
|
/** 阻断集 = 必须等完的活 = `drainState.blockingInflight()`(`sessionResident` 不在内)。 */
|
|
91
|
-
export declare function blockingInflightOf(b:
|
|
92
|
-
/** 总数 = 引擎此刻托管的全部活 = `/health.inflight`(= 阻断集 +
|
|
98
|
+
export declare function blockingInflightOf(b: InflightBreakdown): number;
|
|
99
|
+
/** 总数 = 引擎此刻托管的全部活 = `/health.inflight`(= 阻断集 + 会话驻留的 shell / monitor 项)。 */
|
|
93
100
|
export declare function inflightTotal(b: InflightBreakdown): number;
|
|
94
101
|
/**
|
|
95
102
|
* 引擎与 HTTP 面共享的排空盒子(装配层建一只,`createHttpServer` 与收尾链各自往上装读口 / 入口)。
|
|
@@ -114,7 +121,7 @@ export interface DrainState {
|
|
|
114
121
|
inflight?: () => number;
|
|
115
122
|
/** 分项读口(`createHttpServer` 装,与 `inflight` / `blockingInflight` 同一次装、同一份求值)。`/health` 读它一次,同时出 `inflight` 与 `inflightBreakdown` 两键。 */
|
|
116
123
|
inflightBreakdown?: () => InflightBreakdown;
|
|
117
|
-
/** **阻断集**读口(`createHttpServer` 装):还有没有必须等完的活 = `blockingInflightOf(inflightBreakdown())` = `http + leader`。排空等的(`boot/shutdown.ts` 的排空驱动表)、
|
|
124
|
+
/** **阻断集**读口(`createHttpServer` 装):还有没有必须等完的活 = `blockingInflightOf(inflightBreakdown())` = `http + leader + backgroundAgents`。排空等的(`boot/shutdown.ts` 的排空驱动表)、
|
|
118
125
|
* 孤儿窗 / 附着租约自退(`boot/engine-lease.ts`)、SIGHUP 空闲窗(`sighup-idle.ts`)的「可以停了吗」都读它;会话驻留的后台 shell / monitor 不在内。 */
|
|
119
126
|
blockingInflight?: () => number;
|
|
120
127
|
lastActivityAt?: () => number;
|