@sema-agent/server 7.149.0 → 7.151.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 +307 -9
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/USAGE.md +92 -40
- package/deploy/sema-up/README.md +7 -1
- package/deploy/sema-up/chart/Chart.yaml +1 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +5 -0
- package/deploy/sema-up/chart/templates/_helpers.tpl +15 -16
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +5 -3
- package/deploy/sema-up/chart/templates/server.yaml +5 -3
- package/deploy/sema-up/chart/values-full-single.yaml +3 -1
- package/deploy/sema-up/chart/values.yaml +8 -1
- package/deploy/sema-up/cluster-up.sh +1 -0
- package/deploy/sema-up/kube-up.sh +1 -1
- package/deploy/sema-up/lib/flagshape.sh +1 -1
- package/deploy/sema-up/lib/helm-values-cluster.py +2 -0
- package/deploy/sema-up/lib/helm-values-kube.py +2 -0
- package/dist/adoption/import.js +3 -3
- package/dist/approval-ask-machine.d.ts +1 -1
- package/dist/approval-card.d.ts +3 -3
- package/dist/approval-gate-currency.d.ts +2 -2
- package/dist/audit.d.ts +1 -1
- package/dist/audit.js +2 -2
- package/dist/auth-bridge.d.ts +20 -0
- package/dist/auth-bridge.js +9 -0
- package/dist/background-session-reap.d.ts +2 -2
- package/dist/bake-runner/main.d.ts +4 -2
- package/dist/bind-host.d.ts +2 -3
- package/dist/bind-host.js +2 -4
- package/dist/boot/budget-tracing.js +1 -1
- package/dist/boot/deferred-sandbox-path-env.d.ts +5 -3
- package/dist/boot/deferred-sandbox-path-env.js +1 -2
- package/dist/boot/engine-lease.d.ts +5 -0
- package/dist/boot/engine-lease.js +1 -0
- package/dist/boot/execution-env.d.ts +8 -14
- package/dist/boot/execution-env.js +54 -17
- package/dist/boot/execution-lane.js +32 -5
- package/dist/boot/late-binds.d.ts +8 -4
- package/dist/boot/late-binds.js +7 -1
- package/dist/boot/memory-consolidation.d.ts +3 -2
- package/dist/boot/memory-consolidation.js +6 -6
- package/dist/boot/parked-revive-gate.d.ts +5 -5
- package/dist/boot/parked-revive-gate.js +2 -3
- package/dist/boot/reapers.d.ts +5 -0
- package/dist/boot/reapers.js +12 -1
- package/dist/boot/resolve-spec.d.ts +7 -8
- package/dist/boot/resolve-spec.js +80 -35
- package/dist/boot/retention-lane.d.ts +1 -1
- package/dist/boot/runner-deps.d.ts +9 -2
- package/dist/boot/runner-deps.js +3 -3
- package/dist/boot/session-age-out.d.ts +36 -0
- package/dist/boot/session-age-out.js +101 -0
- package/dist/boot/session-faces.d.ts +5 -14
- package/dist/boot/session-faces.js +28 -24
- package/dist/boot/stage-01-config.js +2 -0
- package/dist/boot/stage-03-store-backend.js +2 -2
- package/dist/boot/stage-05-execution-env.d.ts +5 -3
- package/dist/boot/stage-05-execution-env.js +2 -2
- package/dist/boot/stage-06-runners.d.ts +7 -4
- package/dist/boot/stage-06-runners.js +16 -8
- package/dist/boot/stage-07-capability-layer.d.ts +7 -4
- package/dist/boot/stage-07-capability-layer.js +3 -2
- package/dist/boot/stage-08-reapers.d.ts +7 -4
- package/dist/boot/stage-08-reapers.js +4 -2
- package/dist/boot/stage-09-leader.d.ts +11 -5
- package/dist/boot/stage-09-leader.js +12 -3
- package/dist/boot/stage-10-http-server.d.ts +44 -6
- package/dist/boot/stage-10-http-server.js +12 -10
- package/dist/boot/web-admin.d.ts +1 -1
- package/dist/boot/web-admin.js +3 -1
- package/dist/boot/workflow-orchestration.d.ts +7 -2
- package/dist/boot/workflow-orchestration.js +24 -7
- package/dist/bounded-rotation.d.ts +29 -0
- package/dist/bounded-rotation.js +24 -0
- package/dist/capability-facts.d.ts +84 -66
- package/dist/capability-facts.js +58 -41
- package/dist/center-credential.d.ts +25 -6
- package/dist/center-credential.js +25 -5
- package/dist/config-catalog.d.ts +26 -7
- package/dist/config-catalog.js +15 -12
- package/dist/config-invariants.d.ts +2 -1
- package/dist/config-invariants.js +4 -4
- package/dist/config-types.d.ts +22 -15
- package/dist/config.d.ts +51 -2
- package/dist/config.js +35 -24
- package/dist/deployment-governance.d.ts +7 -28
- package/dist/deployment-governance.js +1 -14
- package/dist/deployment-shape.d.ts +9 -1
- package/dist/deployment-shape.js +2 -1
- package/dist/device-protocol.d.ts +5 -4
- package/dist/device-protocol.js +1 -1
- package/dist/device-ws-hub.d.ts +1 -0
- package/dist/device-ws-hub.js +66 -29
- package/dist/device-ws-protocol.d.ts +79 -12
- package/dist/device-ws-protocol.js +64 -26
- package/dist/engine-identity.d.ts +23 -5
- package/dist/engine-identity.js +13 -0
- package/dist/entry-mode-clamp-notice.d.ts +2 -1
- package/dist/execution-env-refusal.d.ts +23 -0
- package/dist/execution-env-refusal.js +5 -0
- package/dist/execution-lane-caps.d.ts +3 -1
- package/dist/field-conflict.d.ts +3 -3
- package/dist/file-history-capture.d.ts +11 -4
- package/dist/file-history-capture.js +9 -6
- package/dist/file-history-disclosure.d.ts +7 -5
- package/dist/file-history-disclosure.js +7 -5
- package/dist/fleet/drain-entry.d.ts +4 -0
- package/dist/fleet/engine-signal.d.ts +14 -1
- package/dist/fleet/engine-signal.js +5 -1
- package/dist/fleet/fleet-reconciler.d.ts +1 -1
- package/dist/fleet/serving-lease.d.ts +18 -3
- package/dist/fleet/serving-lease.js +81 -35
- package/dist/fleet-client.d.ts +13 -11
- package/dist/fleet-client.js +53 -33
- package/dist/history-anchor.js +1 -1
- package/dist/hitl-delivery.d.ts +1 -3
- package/dist/hitl-delivery.js +1 -1
- package/dist/hooks/hook-runner.js +2 -2
- package/dist/host-lsp-manager.d.ts +2 -2
- package/dist/http/active-run-conflict.d.ts +3 -7
- package/dist/http/active-run-conflict.js +2 -2
- package/dist/http/admission.js +19 -4
- package/dist/http/approval-sweeps.js +7 -6
- package/dist/http/caller-trust.d.ts +2 -2
- package/dist/http/caller-trust.js +3 -3
- package/dist/http/checkpoint-ctx.d.ts +20 -63
- package/dist/http/checkpoint-ctx.js +2 -24
- package/dist/http/claim-heartbeat.d.ts +4 -4
- package/dist/http/claim-heartbeat.js +3 -3
- package/dist/http/dispatch.d.ts +2 -1
- package/dist/http/dispatch.js +36 -29
- package/dist/http/durable-run-leg.js +17 -17
- package/dist/http/health-self-report.d.ts +9 -1
- package/dist/http/health-self-report.js +2 -0
- package/dist/http/owner-access.d.ts +264 -20
- package/dist/http/owner-access.js +215 -5
- package/dist/http/readiness.d.ts +4 -2
- package/dist/http/resume-ctx-read.js +38 -1
- package/dist/http/resume-legs.d.ts +2 -1
- package/dist/http/resume-legs.js +273 -89
- package/dist/http/route-ctx.d.ts +41 -19
- package/dist/http/route-table.d.ts +1 -1
- package/dist/http/routes/a2a-serve.js +15 -14
- package/dist/http/routes/admin-memory-optout.d.ts +1 -1
- package/dist/http/routes/agents-roster.js +2 -3
- package/dist/http/routes/approvals-assistant.d.ts +3 -2
- package/dist/http/routes/approvals-assistant.js +12 -12
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/capabilities.js +10 -6
- package/dist/http/routes/config-catalog.d.ts +1 -1
- package/dist/http/routes/fleet.js +10 -8
- package/dist/http/routes/mcp-reconnect.js +2 -2
- package/dist/http/routes/memory-origin.d.ts +1 -1
- package/dist/http/routes/notify-wake.js +2 -3
- package/dist/http/routes/projects.d.ts +4 -2
- package/dist/http/routes/projects.js +7 -6
- package/dist/http/routes/retention-ops.d.ts +1 -1
- package/dist/http/routes/run-permission-mode.d.ts +1 -1
- package/dist/http/routes/run-permission-mode.js +2 -2
- package/dist/http/routes/runs.d.ts +1 -1
- package/dist/http/routes/runs.js +125 -66
- package/dist/http/routes/session-memory-sync.js +4 -5
- package/dist/http/routes/session-sync.d.ts +4 -3
- package/dist/http/routes/session-sync.js +174 -83
- package/dist/http/routes/sessions-list.js +13 -7
- package/dist/http/routes/sessions.d.ts +1 -1
- package/dist/http/routes/sessions.js +26 -48
- package/dist/http/routes/tasks.js +38 -23
- package/dist/http/routes/trace-usage.js +14 -14
- package/dist/http/routes/workflows.d.ts +1 -0
- package/dist/http/routes/workflows.js +20 -38
- package/dist/http/server.d.ts +28 -30
- package/dist/http/server.js +7 -3
- package/dist/http/stored-body-replay.d.ts +3 -24
- package/dist/http/stored-body-replay.js +2 -12
- package/dist/http/submit-ctx.d.ts +1 -2
- package/dist/http/submit-ctx.js +8 -6
- package/dist/http/submit-replay.d.ts +15 -2
- package/dist/http/submit-replay.js +10 -4
- package/dist/http/wire-types.d.ts +19 -6
- package/dist/identity-source.d.ts +20 -3
- package/dist/identity-source.js +14 -0
- package/dist/index.d.ts +4 -0
- package/dist/lane-home-probe.d.ts +3 -7
- package/dist/lane-home-probe.js +0 -1
- package/dist/leader/endpoint.js +9 -8
- package/dist/leader/leader.d.ts +2 -1
- package/dist/leg-facts.d.ts +19 -5
- package/dist/leg-facts.js +3 -1
- package/dist/mcp-authorization-face.d.ts +18 -14
- package/dist/mcp-authorization-face.js +3 -2
- package/dist/memory-scope.d.ts +5 -4
- package/dist/memory-scope.js +4 -4
- package/dist/memory-store-refusal.d.ts +1 -1
- package/dist/memory-sync-client.d.ts +30 -2
- package/dist/memory-sync-client.js +16 -9
- package/dist/observability/corrupt-read-seat.d.ts +1 -1
- package/dist/observability/err-text.d.ts +7 -0
- package/dist/observability/err-text.js +5 -0
- package/dist/observability/fail-open.d.ts +12 -8
- package/dist/observability/fail-open.js +12 -8
- package/dist/observability/logger.d.ts +7 -0
- package/dist/observability/logger.js +3 -1
- package/dist/observability/metrics.js +1 -0
- package/dist/observability/run-terminal.d.ts +1 -1
- package/dist/orchestration/workflow-notify-journal.d.ts +18 -1
- package/dist/orchestration/workflow-notify-journal.js +12 -1
- package/dist/orchestration/workflow-park-decision.d.ts +70 -18
- package/dist/orchestration/workflow-park-decision.js +49 -10
- package/dist/orchestration/workflow-park-holder.d.ts +65 -0
- package/dist/orchestration/workflow-park-holder.js +98 -0
- package/dist/orchestration/workflow-record-fence.d.ts +36 -0
- package/dist/orchestration/workflow-record-fence.js +42 -0
- package/dist/owner-faces.d.ts +28 -4
- package/dist/owner-faces.js +2 -0
- package/dist/parked-decide.d.ts +104 -53
- package/dist/parked-decide.js +153 -117
- package/dist/peer-directory.d.ts +2 -2
- package/dist/peer-inbound-face.d.ts +2 -6
- package/dist/peer-inbound-face.js +0 -3
- package/dist/peer-seat.d.ts +1 -1
- package/dist/peer-seat.js +52 -59
- package/dist/permission-mode-admission.d.ts +41 -5
- package/dist/permission-mode-admission.js +29 -3
- package/dist/plugins/adoption-log-sql.d.ts +3 -1
- package/dist/plugins/adoption-log-sql.js +7 -1
- package/dist/plugins/approval-ask-store-file.d.ts +10 -2
- package/dist/plugins/approval-ask-store-file.js +8 -0
- package/dist/plugins/approval-ask-store-memory.d.ts +6 -1
- package/dist/plugins/approval-ask-store-memory.js +28 -9
- package/dist/plugins/approval-ask-store-sql.d.ts +43 -2
- package/dist/plugins/approval-ask-store-sql.js +34 -5
- package/dist/plugins/approval-exemption-store.js +3 -0
- package/dist/plugins/approval-nonce-store.js +2 -0
- package/dist/plugins/breaker-state-sql.js +2 -0
- package/dist/plugins/caching-session-store.d.ts +9 -15
- package/dist/plugins/caching-session-store.js +6 -0
- package/dist/plugins/device-store-sql.js +6 -0
- package/dist/plugins/error-origin.d.ts +18 -0
- package/dist/plugins/error-origin.js +10 -0
- package/dist/plugins/exec-path-law.d.ts +34 -0
- package/dist/plugins/exec-path-law.js +13 -0
- package/dist/plugins/execution-placement-sql.js +6 -6
- package/dist/plugins/file-run-store.js +1 -1
- package/dist/plugins/image-bake-store-sql.js +6 -0
- package/dist/plugins/image-index-sql.js +4 -0
- package/dist/plugins/landed-attendants.d.ts +212 -0
- package/dist/plugins/landed-attendants.js +161 -0
- package/dist/plugins/leader-run-store-sql.js +4 -0
- package/dist/plugins/local-checkpoint-store.d.ts +4 -1
- package/dist/plugins/local-checkpoint-store.js +3 -0
- package/dist/plugins/local-session-live-reference.d.ts +40 -0
- package/dist/plugins/local-session-live-reference.js +39 -0
- package/dist/plugins/local-session-store.d.ts +71 -33
- package/dist/plugins/local-session-store.js +129 -27
- package/dist/plugins/memory-engine-pg.js +4 -0
- package/dist/plugins/memory-engine-sql-apply.js +5 -2
- package/dist/plugins/memory-engine-tidb.js +4 -0
- package/dist/plugins/memory-optout-grant-store-sql.js +4 -0
- package/dist/plugins/memory-run-store.js +1 -1
- package/dist/plugins/memory-sync-store-pg.js +5 -0
- package/dist/plugins/memory-sync-store-tidb.js +5 -0
- package/dist/plugins/one-time-migrations.d.ts +80 -61
- package/dist/plugins/one-time-migrations.js +241 -104
- package/dist/plugins/org-delivery-quota-store.js +4 -1
- package/dist/plugins/outcome-ledger-sql.js +2 -0
- package/dist/plugins/permission-rule-store-sql.js +11 -4
- package/dist/plugins/pg-cost-quota.js +4 -0
- package/dist/plugins/pg-pool.js +28 -1
- package/dist/plugins/pg-rate-limiter.js +2 -0
- package/dist/plugins/posix-shell-fs.d.ts +6 -1
- package/dist/plugins/posix-shell-fs.js +8 -3
- package/dist/plugins/remote-env-adb.d.ts +19 -15
- package/dist/plugins/remote-env-adb.js +44 -17
- package/dist/plugins/remote-env-connect-seat.d.ts +105 -0
- package/dist/plugins/remote-env-connect-seat.js +72 -0
- package/dist/plugins/remote-env-device.d.ts +22 -5
- package/dist/plugins/remote-env-device.js +114 -14
- package/dist/plugins/remote-env-e2b.d.ts +18 -7
- package/dist/plugins/remote-env-e2b.js +53 -40
- package/dist/plugins/remote-env-file-error.js +6 -2
- package/dist/plugins/remote-env-host.d.ts +18 -1
- package/dist/plugins/remote-env-host.js +48 -47
- package/dist/plugins/remote-env-k8s.d.ts +41 -39
- package/dist/plugins/remote-env-k8s.js +56 -32
- package/dist/plugins/remote-env-local-docker.d.ts +13 -8
- package/dist/plugins/remote-env-local-docker.js +37 -43
- package/dist/plugins/remote-env-ssh.d.ts +18 -12
- package/dist/plugins/remote-env-ssh.js +64 -62
- package/dist/plugins/remote-shell.d.ts +101 -2
- package/dist/plugins/remote-shell.js +221 -3
- package/dist/plugins/replica-registration.d.ts +35 -0
- package/dist/plugins/replica-registration.js +48 -0
- package/dist/plugins/resume-anchor-store-sql.d.ts +11 -2
- package/dist/plugins/resume-anchor-store-sql.js +12 -5
- package/dist/plugins/retention-lane-store-sql.d.ts +1 -1
- package/dist/plugins/retention-lane-store-sql.js +4 -0
- package/dist/plugins/retention-sql.d.ts +20 -2
- package/dist/plugins/retention-sql.js +11 -0
- package/dist/plugins/run-store-sql.d.ts +22 -3
- package/dist/plugins/run-store-sql.js +33 -9
- package/dist/plugins/scenario-prefix-switch-m42.d.ts +6 -12
- package/dist/plugins/scenario-prefix-switch-m42.js +7 -5
- package/dist/plugins/schema-consistency.d.ts +9 -5
- package/dist/plugins/schema-consistency.js +48 -18
- package/dist/plugins/schema-drift-sentence.js +1 -1
- package/dist/plugins/send-file-ledger.js +3 -0
- package/dist/plugins/serving-requirement.d.ts +68 -0
- package/dist/plugins/serving-requirement.js +60 -0
- package/dist/plugins/session-birth.d.ts +6 -2
- package/dist/plugins/session-capture-record-store-sql.js +2 -0
- package/dist/plugins/session-ext-table.d.ts +14 -1
- package/dist/plugins/session-ext-table.js +5 -1
- package/dist/plugins/session-row-sql.d.ts +49 -2
- package/dist/plugins/session-row-sql.js +56 -13
- package/dist/plugins/session-store-sql.d.ts +34 -18
- package/dist/plugins/session-store-sql.js +98 -17
- package/dist/plugins/shared-memory-store-sql.d.ts +1 -0
- package/dist/plugins/shared-memory-store-sql.js +6 -2
- package/dist/plugins/sql-driver.d.ts +2 -1
- package/dist/plugins/sql-driver.js +18 -3
- package/dist/plugins/sql-errors.d.ts +11 -6
- package/dist/plugins/sql-errors.js +5 -6
- package/dist/plugins/stop-then-start-sentence.d.ts +48 -3
- package/dist/plugins/stop-then-start-sentence.js +48 -0
- package/dist/plugins/stop-then-start.d.ts +109 -0
- package/dist/plugins/stop-then-start.js +104 -0
- package/dist/plugins/store-backend.d.ts +40 -13
- package/dist/plugins/store-backend.js +169 -27
- package/dist/plugins/store-boundary.d.ts +57 -0
- package/dist/plugins/store-boundary.js +139 -0
- package/dist/plugins/store-contracts.d.ts +29 -2
- package/dist/plugins/store-contracts.js +3 -0
- package/dist/plugins/store-fault-sentence-m53.d.ts +7 -0
- package/dist/plugins/store-fault-sentence-m53.js +25 -0
- package/dist/plugins/store-fault.d.ts +26 -7
- package/dist/plugins/store-fault.js +18 -2
- package/dist/plugins/task-attachment-store.js +9 -0
- package/dist/plugins/task-list-store-sql.d.ts +2 -2
- package/dist/plugins/task-list-store-sql.js +10 -8
- package/dist/plugins/tidb-cost-quota.js +4 -0
- package/dist/plugins/tidb-pool.js +6 -1
- package/dist/plugins/tidb-rate-limiter.js +4 -0
- package/dist/plugins/user-input-ledger-sql.js +4 -0
- package/dist/plugins/workflow-run-store-sql.d.ts +28 -10
- package/dist/plugins/workflow-run-store-sql.js +64 -4
- package/dist/plugins/workspace-fill.d.ts +4 -7
- package/dist/plugins/workspace-fill.js +2 -1
- package/dist/plugins/write-behind-counter.js +5 -0
- package/dist/process-instance.d.ts +3 -0
- package/dist/process-instance.js +7 -0
- package/dist/project-context.d.ts +64 -0
- package/dist/project-context.js +66 -0
- package/dist/project-registry.d.ts +46 -0
- package/dist/project-registry.js +44 -0
- package/dist/question.d.ts +9 -21
- package/dist/question.js +28 -19
- package/dist/request-key-closure.js +1 -1
- package/dist/request-value-closure.d.ts +4 -0
- package/dist/request-value-closure.js +10 -0
- package/dist/run-acceptance.d.ts +3 -2
- package/dist/run-acceptance.js +4 -6
- package/dist/run-cancel-card.d.ts +1 -1
- package/dist/run-cancel-card.js +2 -1
- package/dist/run-local.js +1 -0
- package/dist/runs.d.ts +37 -8
- package/dist/runs.js +53 -12
- package/dist/runtime-governance.d.ts +5 -4
- package/dist/security.d.ts +31 -33
- package/dist/security.js +41 -7
- package/dist/server-secret-env.d.ts +12 -10
- package/dist/server-secret-env.js +24 -15
- package/dist/session-agent.d.ts +1 -10
- package/dist/session-agent.js +0 -6
- package/dist/session-bindings.d.ts +82 -0
- package/dist/session-bindings.js +18 -0
- package/dist/session-children-retire.d.ts +2 -2
- package/dist/session-children-retire.js +2 -6
- package/dist/session-deletion.d.ts +16 -1
- package/dist/session-error-wire.d.ts +3 -3
- package/dist/session-error-wire.js +3 -3
- package/dist/session-incarnation.d.ts +28 -4
- package/dist/session-incarnation.js +14 -2
- package/dist/session-kind.d.ts +57 -0
- package/dist/session-kind.js +22 -0
- package/dist/session-notify-door.d.ts +4 -4
- package/dist/session-notify-door.js +5 -6
- package/dist/session-row.d.ts +21 -1
- package/dist/session-row.js +7 -1
- package/dist/session-rules-seat.d.ts +4 -3
- package/dist/session-rules-seat.js +3 -11
- package/dist/session-sync-kernel.d.ts +24 -14
- package/dist/session-sync-kernel.js +3 -6
- package/dist/session-sync.d.ts +4 -98
- package/dist/session-sync.js +4 -74
- package/dist/session-titler.d.ts +10 -3
- package/dist/session-titler.js +19 -6
- package/dist/ssh-host-key.d.ts +5 -0
- package/dist/ssh-host-key.js +3 -0
- package/dist/stores-sql/checkpoint-store-sql.d.ts +21 -2
- package/dist/stores-sql/checkpoint-store-sql.js +106 -18
- package/dist/stores-sql/file-history-store-sql.d.ts +52 -2
- package/dist/stores-sql/file-history-store-sql.js +108 -70
- package/dist/stores-sql/pg-session-storage.d.ts +34 -7
- package/dist/stores-sql/pg-session-storage.js +37 -13
- package/dist/stores-sql/retention-store-sql.d.ts +2 -10
- package/dist/stores-sql/retention-store-sql.js +2 -10
- package/dist/stores-sql/session-policy-store-sql.d.ts +30 -7
- package/dist/stores-sql/session-policy-store-sql.js +61 -44
- package/dist/stores-sql/session-write-hooks.d.ts +11 -0
- package/dist/stores-sql/tidb-session-store.d.ts +58 -7
- package/dist/stores-sql/tidb-session-store.js +37 -13
- package/dist/submission-exit.d.ts +3 -2
- package/dist/submission-exit.js +9 -1
- package/dist/task-cwd.d.ts +6 -5
- package/dist/task-settings.d.ts +19 -5
- package/dist/task-settings.js +13 -7
- package/dist/terminal.d.ts +33 -2
- package/dist/terminal.js +139 -9
- package/dist/tool-approval.d.ts +147 -12
- package/dist/tool-approval.js +206 -109
- package/dist/trace/engine-notice-wire.d.ts +14 -0
- package/dist/trace/engine-notice-wire.js +18 -1
- package/dist/trace/project.d.ts +4 -3
- package/dist/trace/project.js +3 -2
- package/dist/trace/projection-table.d.ts +33 -2
- package/dist/trace/self-minted-wire.d.ts +422 -26
- package/dist/trace/self-minted-wire.js +149 -23
- package/dist/trace/tool-card.d.ts +3 -0
- package/dist/trace/tool-card.js +24 -0
- package/dist/trace/tool-output-media.d.ts +2 -1
- package/dist/unattended-permission-mode.d.ts +1 -1
- package/dist/web-admin-client/apply-effective.d.ts +1 -1
- package/dist/web-admin-client/effective-keys.d.ts +1 -1
- package/dist/web-admin-client/skills-mcp.d.ts +1 -1
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +120 -41
- package/package.json +3 -3
- package/wire-changes/server@7.150.0.json +335 -0
- package/wire-changes/server@7.151.0.json +762 -0
- package/dist/http/session-inherit-env.d.ts +0 -36
- package/dist/http/session-inherit-env.js +0 -6
|
@@ -3,19 +3,22 @@ const FILE_HISTORY_CAPTURE_WORD_SET = {
|
|
|
3
3
|
"on-optional": true,
|
|
4
4
|
};
|
|
5
5
|
export const FILE_HISTORY_CAPTURE_WORDS = Object.keys(FILE_HISTORY_CAPTURE_WORD_SET);
|
|
6
|
+
export function fileHistoryWired(backend) {
|
|
7
|
+
return backend !== undefined;
|
|
8
|
+
}
|
|
6
9
|
export function assembleFileHistory(backend) {
|
|
7
|
-
if (backend
|
|
10
|
+
if (!fileHistoryWired(backend))
|
|
8
11
|
return { store: undefined, erasure: undefined };
|
|
9
12
|
const physical = backend.fileHistory();
|
|
10
13
|
return { store: physical, erasure: physical };
|
|
11
14
|
}
|
|
12
|
-
export function fileHistoryCaptureOf(
|
|
13
|
-
return
|
|
15
|
+
export function fileHistoryCaptureOf(wired, knob) {
|
|
16
|
+
return wired && knob ? "on-optional" : "off";
|
|
14
17
|
}
|
|
15
|
-
export function coreFileHistoryCaptureSeat(
|
|
16
|
-
if (
|
|
18
|
+
export function coreFileHistoryCaptureSeat(wired, knob) {
|
|
19
|
+
if (!wired)
|
|
17
20
|
return undefined;
|
|
18
|
-
const word = fileHistoryCaptureOf(
|
|
21
|
+
const word = fileHistoryCaptureOf(wired, knob);
|
|
19
22
|
switch (word) {
|
|
20
23
|
case "off":
|
|
21
24
|
return "off";
|
|
@@ -50,16 +50,18 @@ export interface CaughtFailure {
|
|
|
50
50
|
readonly fault: Pick<FileHistoryError, "permanence">;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* 把一个 caught error 折成店侧的散文 + 判断,**并**在它是一枚 typed
|
|
53
|
+
* 把一个 caught error 折成店侧的散文 + 判断,**并**在它是一枚 typed 永久失败时留痕。**先读店边界**(`storeBoundaryFault`,`site` = 折点所在的店方法):
|
|
54
|
+
* 文件历史店把失败**返回**成值(不抛),值里的文本取自这里 —— 驱动错(以及词法外的码:工作区 fs 的 `ENOENT` / `EACCES`、对象存储的码)在这里换成边界形
|
|
55
|
+
* (类别句 + 原码尾注,原句进运维日志 `at=store` 一行),返回值里不再带库的原话。
|
|
54
56
|
*
|
|
55
|
-
* `text` =
|
|
56
|
-
*
|
|
57
|
+
* `text` = 散文形:带本仓词法内 `code` 的(typed 失败:`blob_too_large_for_sql` 一类)前缀一个括号词(`(blob_too_large_for_sql) blob of … exceeds …`),
|
|
58
|
+
* 其余逐字是(过了边界的)message —— 边界句自带 `[original code: <码>]` 尾注,不再前缀第二遍码。
|
|
57
59
|
* `fault` = 判断形(core 7.55.0 `FileHistoryError.permanence`):永久码表里的码 ⇒ `{ permanence: "terminal" }`;连接类故障 ⇒ `{ permanence: "transient" }`
|
|
58
60
|
* (什么都不改稍后再试可能成);部署错配类故障 ⇒ `{ permanence: "terminal" }`(修表 / 授权之前重试注定失败);其余 ⇒ `{}`(店不知道 —— 认不出的驱动 / 库错是不是会自己好,不归本店判)。
|
|
59
|
-
* 永久码先于分类判(一只错不会两个都是);分类词只读判官 `storeFaultClassOf
|
|
61
|
+
* 永久码先于分类判(一只错不会两个都是);分类词只读判官 `storeFaultClassOf`(边界形带着它在原错上判的词),本文件不写码。
|
|
60
62
|
* 副作用 = 机器形:码取自错误对象,逐次计数 + 每进程每码一条 warn。观测绝不抛。
|
|
61
63
|
*/
|
|
62
|
-
export declare function foldCaughtFailure(err: unknown): CaughtFailure;
|
|
64
|
+
export declare function foldCaughtFailure(err: unknown, site: string): CaughtFailure;
|
|
63
65
|
/** 装配层把 logger/metrics 接上(main.ts,与 `installFailOpenRecorder` 同一处)。 */
|
|
64
66
|
export declare function installFileHistoryFailureRecorder(deps: Sink): void;
|
|
65
67
|
/** 本进程逐码累计(测试/诊断读面)。 */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FILE_HISTORY_ERROR_CODES, FileHistoryStoreError } from "@sema-agent/core";
|
|
2
2
|
import { storeFaultClassOf } from "./plugins/store-fault.js";
|
|
3
|
+
import { outwardFailureCode, storeBoundaryFault } from "./terminal.js";
|
|
3
4
|
const PERMANENT_STORE_FAILURE_CODES = {
|
|
4
5
|
blob_too_large_for_sql: {
|
|
5
6
|
note: "a blob is larger than this deployment's SQL snapshot-blob cap — the same file will fail every turn until the deployment changes",
|
|
@@ -30,16 +31,17 @@ function drainToMetrics() {
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
|
-
export function foldCaughtFailure(err) {
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
34
|
+
export function foldCaughtFailure(err, site) {
|
|
35
|
+
const seen = storeBoundaryFault(err, site);
|
|
36
|
+
const message = seen instanceof Error ? seen.message : String(seen);
|
|
37
|
+
const code = seen?.code;
|
|
38
|
+
const typedCode = typeof code === "string" && code !== "" && outwardFailureCode(code) === code ? code : undefined;
|
|
37
39
|
const permanentCode = typedCode !== undefined && isPermanentCode(typedCode) ? typedCode : undefined;
|
|
38
40
|
if (permanentCode !== undefined)
|
|
39
41
|
recordPermanent(permanentCode, message);
|
|
40
42
|
return {
|
|
41
43
|
text: typedCode !== undefined ? `(${typedCode}) ${message}` : message,
|
|
42
|
-
fault: permanentCode !== undefined ? { permanence: "terminal" } : faultOfClass(storeFaultClassOf(
|
|
44
|
+
fault: permanentCode !== undefined ? { permanence: "terminal" } : faultOfClass(storeFaultClassOf(seen)),
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
47
|
function faultOfClass(cls) {
|
|
@@ -87,6 +87,8 @@ export type DrainEntryAnswer = DrainReceipt | DrainDeadlineRefusal;
|
|
|
87
87
|
* `session-resident-background.ts` 头注)· retain 的后台 shell · 只读订阅流(只进 `attachedStreams`)。
|
|
88
88
|
* 四项在同一次读里求出(`http/server.ts` 的 `inflightBreakdown` 是唯一的分项函数,两个和都读它),`/health` 的 `inflight` 与 `inflightBreakdown` 因此永远自洽,
|
|
89
89
|
* 判停与 `/health` 也不会各有一份算法。只有这两个函数各写一次这两个和,没有第三张计法表。
|
|
90
|
+
* 第三个读数 `/health.engineLease.attached`(附着流条数,[ref])进的是**同一张**计法表(契约「附着」一列:每一类活进不进它),不是第二套计数:
|
|
91
|
+
* 它读 {@link DrainState.attachedStreams} —— 自退判据第一合取读的那一只(`http/dispatch.ts` 的开放响应集 × SSE 章,定义只此一处)。
|
|
90
92
|
*/
|
|
91
93
|
export interface InflightBreakdown {
|
|
92
94
|
readonly http: number;
|
|
@@ -128,6 +130,8 @@ export interface DrainState {
|
|
|
128
130
|
/** [ref]:首个**非探针**请求的单调时刻(`null` = 还没有过)。与 `lastActivityAt` 同一个写者(`http/server.ts` 的活性打点)、写一次就定;
|
|
129
131
|
* 读者 = 租约腿的候首触态(`boot/engine-lease.ts`)与 `/health.engineLease.firstAttach.attachedAt`。 */
|
|
130
132
|
firstActivityAt?: () => number | null;
|
|
133
|
+
/** 本副本此刻打开着的 SSE 流条数(`createHttpServer` 自赋;定义只此一处)。读者:附着租约自退判据的第一合取、`/health.engineLease.attached`(经租约腿的读数)—— 同一只读口,
|
|
134
|
+
* 不另数。语义是**附着流条数,不是活跃调用方**:订阅流与流式提交腿算,后台腿 / 无流同步腿不算(契约计法表「附着」列);纯轮询壳读到 0 合法。 */
|
|
131
135
|
attachedStreams?: () => number;
|
|
132
136
|
lastAttachEndedAt?: () => number;
|
|
133
137
|
/** [ref]:附着租约窗的读口(`/health.engineLease`)。收尾链在**装了租约腿**时才装它,读口现读租约腿的把手 —— 腿还在观察才有读数,未装配的盒子里根本没有这只口。 */
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
* 那一形的面只有每拍一行运维 warn + 计数)。「扣着」在两出口上只有这一种读法(7.120.x 的 `/health.modelPlaneDeferred` 本版删除)。
|
|
17
17
|
* 合成只在 {@link buildRestartSignal} 一处,`restartState()` 是它唯一的调用方 —— 两个出口读的是同一只取值口。
|
|
18
18
|
* 4. **代际**:`generation` = env `FLEET_GENERATION` 的回声(规范十进制串;非规范在 boot 拒启,见 `config.ts`);缺席 ⇔ 非 fleet 成员。
|
|
19
|
+
* **围栏只有成员身份一个开关**:租约读数只有一只读者 {@link memberLeaseOf}(铸点与准入三处同读)—— 非成员恒 {@link LEASE_NONE},
|
|
20
|
+
* 注入了读数也不读;所以「`/health` 不报 `leaseState` 而准入照按租约拒」这一形构造不出来。
|
|
19
21
|
* **身份不是引擎态**:`instanceId`(本进程起步自铸的那一只,`boot/stage-03` 的 uuidv7)是体的身份,只在两出口体的**顶层**说一次,
|
|
20
22
|
* 铸点不读它、契约形里不重复它。
|
|
21
23
|
* 5. **两形一读(展开 / 收缩)**:两出口今天各发两形 —— 嵌套键 {@link ENGINE_SIGNAL_KEY}(契约 `EngineSignal` 整只,{@link buildEngineSignal}),
|
|
@@ -52,8 +54,19 @@ export type ServingLeaseView = {
|
|
|
52
54
|
};
|
|
53
55
|
/** 心跳体上的 fleet 成员三键 —— 类型取自契约心跳形(拼法与值域只有契约一个写者)。 */
|
|
54
56
|
export type FleetMembershipKeys = Pick<InstanceAnnouncement, "generation" | "leaseState" | "leaseUntil">;
|
|
55
|
-
/** 非 fleet 成员 / 没装租约客户端时的读数(唯一拼法)
|
|
57
|
+
/** 非 fleet 成员 / 没装租约客户端时的读数(唯一拼法)。成员的推定围栏只住在租约客户端里,不进这只缺省值。 */
|
|
56
58
|
export declare const LEASE_NONE: ServingLeaseView;
|
|
59
|
+
/**
|
|
60
|
+
* 租约读数的**唯一读者**(规则 4;铸点 {@link mintEngineSignal} 与准入三处 —— 计费门 / a2a `message/send` / PARKED 赎回席 —— 都经它,不直读
|
|
61
|
+
* `deps.servingLease`):成员身份 = `config.fleetGeneration` 在场 ⇒ 租约客户端此刻的读数(没装 ⇒ {@link LEASE_NONE});非成员 ⇒ {@link LEASE_NONE}。
|
|
62
|
+
*/
|
|
63
|
+
export declare function memberLeaseOf(deps: Pick<EngineSignalInputs, "config" | "servingLease">): ServingLeaseView;
|
|
64
|
+
/**
|
|
65
|
+
* 装配判的拒句(`createHttpServer` 构造期,fail-closed):租约读数只属于 fleet 成员,而成员身份只有 `config.fleetGeneration` 一个开关 ——
|
|
66
|
+
* 注入了 `servingLease` 却没设代际,读数永远不会被 {@link memberLeaseOf} 读到、准入永远不按租约拒。两键都是可选的,所以这是一份能编译的
|
|
67
|
+
* 自相矛盾的装配:响亮拒,不静默丢掉读数(本服务自己的组合根只给成员装租约客户端,走不到这里)。
|
|
68
|
+
*/
|
|
69
|
+
export declare const SERVING_LEASE_MEMBERSHIP_REQUIRED = "servingLease is wired but config.fleetGeneration is not: a serving-lease reading belongs to a fleet member, and membership is config.fleetGeneration (FLEET_GENERATION) alone \u2014 without it the reading is never read and admission never refuses on the lease; set config.fleetGeneration to this instance's generation, or do not pass servingLease; refusing to start rather than ignore the lease reading";
|
|
57
70
|
/** 扣着的候选(web-admin 的 `planeDeferredNoHandoff` 投影):版本、起扣时刻、被扣的重启片。 */
|
|
58
71
|
export interface RetainedCandidate {
|
|
59
72
|
readonly version: number;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { readinessOf } from "../http/readiness.js";
|
|
2
2
|
import { drainingFactOf } from "./drain-entry.js";
|
|
3
3
|
export const LEASE_NONE = Object.freeze({ state: "none" });
|
|
4
|
+
export function memberLeaseOf(deps) {
|
|
5
|
+
return deps.config?.fleetGeneration === undefined ? LEASE_NONE : (deps.servingLease?.() ?? LEASE_NONE);
|
|
6
|
+
}
|
|
7
|
+
export const SERVING_LEASE_MEMBERSHIP_REQUIRED = "servingLease is wired but config.fleetGeneration is not: a serving-lease reading belongs to a fleet member, and membership is config.fleetGeneration (FLEET_GENERATION) alone — without it the reading is never read and admission never refuses on the lease; set config.fleetGeneration to this instance's generation, or do not pass servingLease; refusing to start rather than ignore the lease reading";
|
|
4
8
|
export function buildRestartSignal(published, retained) {
|
|
5
9
|
if (published !== undefined)
|
|
6
10
|
return published;
|
|
@@ -29,7 +33,7 @@ export function mintEngineSignal(deps) {
|
|
|
29
33
|
...(draining !== undefined ? { draining } : {}),
|
|
30
34
|
...(restart !== undefined ? { restart } : {}),
|
|
31
35
|
...(deps.config?.fleetGeneration !== undefined ? { generation: deps.config.fleetGeneration } : {}),
|
|
32
|
-
lease: deps
|
|
36
|
+
lease: memberLeaseOf(deps),
|
|
33
37
|
...(configApply !== undefined ? { configApply } : {}),
|
|
34
38
|
};
|
|
35
39
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* [ref](docs/
|
|
2
|
+
* [ref](docs/[ref]-fleet-liveness-reconcile.md v1.2,四方零驳定稿)—— fleet 总线**存活对账腿**。
|
|
3
3
|
*
|
|
4
4
|
* ## 它修什么(§0 病灶机制链)
|
|
5
5
|
* fleet 总线是进程内纯内存聚合(`fleet-bus.ts` 头注自陈 NOT durable / NOT cross-replica),行的**唯一**
|
|
@@ -32,11 +32,26 @@ export interface ServingLeaseClientOpts {
|
|
|
32
32
|
readonly epoch: () => number;
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* 一拍心跳听到了什么(`fleet-client.ts` 每一次公告尝试恰好交一只;读者在本模块)。
|
|
37
|
+
* · `reading` —— 中心的显式能力声明(契约 `declared`;位缺席 = 中心说不执行围栏);
|
|
38
|
+
* · `silent` —— 没有读数。`why` 的形是闭集:`HTTP <状态>`(非 2xx,不带中心体片段)/ 请求抛出的那句(不可达 / 超时 / 凭证读不出)/
|
|
39
|
+
* `reply-unreadable:<因>`(2xx 而不是声明,因 = `fleet-client.ts` `AnnounceReplyFlaw`)/ `not-sent:<那句>`(这一拍的引擎信号铸不出,没发)。
|
|
40
|
+
*/
|
|
41
|
+
export type HeartbeatHearing = {
|
|
42
|
+
readonly kind: "reading";
|
|
43
|
+
readonly capabilities: WebAdminCapabilities;
|
|
44
|
+
} | {
|
|
45
|
+
readonly kind: "silent";
|
|
46
|
+
readonly why: string;
|
|
47
|
+
};
|
|
35
48
|
export interface ServingLeaseClient {
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
/** 此刻的租约读数(铸点与准入判读它)。 */
|
|
49
|
+
/** 一拍心跳听到的东西(规则 1;每一次公告尝试恰好一次)。 */
|
|
50
|
+
noteHeartbeat(hearing: HeartbeatHearing): void;
|
|
51
|
+
/** 此刻的租约读数(铸点与准入判读它 —— 经 `engine-signal.ts` 的唯一读者 `memberLeaseOf`)。 */
|
|
39
52
|
view(): ServingLeaseView;
|
|
53
|
+
/** 订阅「租约态由事件翻转」(规则 2′;一只订阅者 = 装配层的 `announceNow`,晚绑:fleet 客户端在本客户端之后造)。 */
|
|
54
|
+
onViewChange(listener: () => void): void;
|
|
40
55
|
/** 起步读黏性拒(装配层在唯一排空入口装好之后调一次)。 */
|
|
41
56
|
resumeStickyDenial(): void;
|
|
42
57
|
/** 立刻续一次(测试 / 能力位刚出现时用;单飞)。 */
|
|
@@ -40,8 +40,9 @@ export function createServingLeaseClient(o) {
|
|
|
40
40
|
const mono = o.clock?.mono ?? (() => performance.now());
|
|
41
41
|
const epoch = o.clock?.epoch ?? Date.now;
|
|
42
42
|
const stickyPath = o.dataRoot === undefined ? undefined : join(o.dataRoot, SERVING_LEASE_DENIED_FILE);
|
|
43
|
-
let
|
|
44
|
-
const enabled = () =>
|
|
43
|
+
let fence = { kind: "presumed", since: mono() };
|
|
44
|
+
const enabled = () => fence.kind === "on";
|
|
45
|
+
let viewListener;
|
|
45
46
|
let denied = false;
|
|
46
47
|
let stopped = false;
|
|
47
48
|
let lease;
|
|
@@ -49,6 +50,37 @@ export function createServingLeaseClient(o) {
|
|
|
49
50
|
let timer;
|
|
50
51
|
let inFlight;
|
|
51
52
|
let failStreak = 0;
|
|
53
|
+
const view = () => {
|
|
54
|
+
if (denied)
|
|
55
|
+
return { state: "denied" };
|
|
56
|
+
if (fence.kind === "off")
|
|
57
|
+
return { state: "none" };
|
|
58
|
+
const now = mono();
|
|
59
|
+
if (lease !== undefined && now < lease.expiresAtMono)
|
|
60
|
+
return { state: "granted", leaseUntil: lease.leaseUntil };
|
|
61
|
+
return { state: "expired", pastOutageMax: now - (lease?.expiresAtMono ?? fence.since) >= o.outageMaxMs };
|
|
62
|
+
};
|
|
63
|
+
const changing = (change) => {
|
|
64
|
+
const before = view().state;
|
|
65
|
+
change();
|
|
66
|
+
if (view().state !== before)
|
|
67
|
+
viewListener?.();
|
|
68
|
+
};
|
|
69
|
+
const unconfirmed = (why) => {
|
|
70
|
+
recordFailOpen("server.fleet.serving-lease-unconfirmed", `worker=${o.center.worker} generation=${o.generation} why=${why}`);
|
|
71
|
+
failStreak += 1;
|
|
72
|
+
if (failStreak === 1) {
|
|
73
|
+
o.logger?.warn("fleet_serving_lease_unconfirmed", {
|
|
74
|
+
error: why,
|
|
75
|
+
note: "the fleet center has not confirmed this instance's serving lease (heartbeat or renewal unanswered, refused or unreadable, or the verdict was unknown) — this instance keeps serving until its last grant, or with no grant yet the moment the fence took effect (this process's start, for a member that has not heard the center), is FLEET_LEASE_OUTAGE_MAX_MS behind, then refuses new work (unconfirmed is never a denial)",
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const confirmed = (by) => {
|
|
80
|
+
if (failStreak > 0)
|
|
81
|
+
o.logger?.info("fleet_serving_lease_recovered", { after: failStreak, by });
|
|
82
|
+
failStreak = 0;
|
|
83
|
+
};
|
|
52
84
|
const clear = () => {
|
|
53
85
|
if (timer !== undefined)
|
|
54
86
|
clearTimeout(timer);
|
|
@@ -79,6 +111,9 @@ export function createServingLeaseClient(o) {
|
|
|
79
111
|
const enterDenied = (denial) => {
|
|
80
112
|
if (denied)
|
|
81
113
|
return;
|
|
114
|
+
changing(() => enterDeniedNow(denial));
|
|
115
|
+
};
|
|
116
|
+
const enterDeniedNow = (denial) => {
|
|
82
117
|
denied = true;
|
|
83
118
|
lease = undefined;
|
|
84
119
|
clear();
|
|
@@ -118,25 +153,22 @@ export function createServingLeaseClient(o) {
|
|
|
118
153
|
why = err instanceof Error ? err.message : String(err);
|
|
119
154
|
}
|
|
120
155
|
if (reading === undefined || reading.verdict === "unknown") {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
failStreak += 1;
|
|
124
|
-
if (failStreak === 1)
|
|
125
|
-
o.logger?.warn("fleet_serving_lease_unconfirmed", { error: unconfirmed, note: "the serving lease could not be renewed (the center is unreachable or did not confirm this instance) — this instance keeps serving until the lease expires and then for FLEET_LEASE_OUTAGE_MAX_MS more before it refuses new work (unconfirmed is never a denial)" });
|
|
156
|
+
if (fence.kind === "on")
|
|
157
|
+
unconfirmed(reading === undefined ? why : "verdict=unknown (the center holds no lifecycle object for this instance right now)");
|
|
126
158
|
schedule(nextInMs);
|
|
127
159
|
return;
|
|
128
160
|
}
|
|
129
|
-
|
|
130
|
-
o.logger?.info("fleet_serving_lease_recovered", { after: failStreak });
|
|
131
|
-
failStreak = 0;
|
|
161
|
+
confirmed("verdict");
|
|
132
162
|
switch (reading.verdict) {
|
|
133
|
-
case "granted":
|
|
163
|
+
case "granted": {
|
|
134
164
|
if (denied)
|
|
135
165
|
return;
|
|
136
|
-
|
|
166
|
+
const granted = { expiresAtMono: sendMono + reading.ttlMs, leaseUntil: sendEpoch + reading.ttlMs };
|
|
167
|
+
changing(() => (lease = granted));
|
|
137
168
|
nextInMs = reading.ttlMs / 3;
|
|
138
169
|
schedule(nextInMs);
|
|
139
170
|
return;
|
|
171
|
+
}
|
|
140
172
|
case "denied":
|
|
141
173
|
enterDenied({ from: "center", reason: reading.reason });
|
|
142
174
|
return;
|
|
@@ -154,34 +186,48 @@ export function createServingLeaseClient(o) {
|
|
|
154
186
|
});
|
|
155
187
|
return inFlight;
|
|
156
188
|
};
|
|
189
|
+
const noteDeclaration = (caps) => {
|
|
190
|
+
const on = caps.servingLease === true;
|
|
191
|
+
if (!on)
|
|
192
|
+
recordFailOpen("server.fleet.serving-lease-capability-absent", `worker=${o.center.worker} generation=${o.generation} was=${fence.kind}`);
|
|
193
|
+
if (on && fence.kind !== "on") {
|
|
194
|
+
fence = { kind: "on", since: fence.since ?? mono() };
|
|
195
|
+
o.logger?.info("fleet_serving_lease_enabled", { generation: o.generation, worker: o.center.worker });
|
|
196
|
+
void renewNow();
|
|
197
|
+
}
|
|
198
|
+
else if (!on && fence.kind !== "off") {
|
|
199
|
+
const was = fence.kind;
|
|
200
|
+
fence = { kind: "off", since: was === "on" ? fence.since : undefined };
|
|
201
|
+
clear();
|
|
202
|
+
confirmed("not-enforced");
|
|
203
|
+
if (was === "on")
|
|
204
|
+
o.logger?.warn("fleet_serving_lease_disabled", { note: "the fleet center no longer announces the servingLease capability — the lease is out of effect (leaseState none) until it does again; its outage clock is not reset (when the capability returns, the last grant and the moment the fence first took effect in this process still count)" });
|
|
205
|
+
}
|
|
206
|
+
};
|
|
157
207
|
return {
|
|
158
|
-
|
|
208
|
+
noteHeartbeat(hearing) {
|
|
159
209
|
if (stopped || denied)
|
|
160
210
|
return;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
211
|
+
switch (hearing.kind) {
|
|
212
|
+
case "silent":
|
|
213
|
+
if (fence.kind === "presumed")
|
|
214
|
+
unconfirmed(`heartbeat:${hearing.why}`);
|
|
215
|
+
return;
|
|
216
|
+
case "reading":
|
|
217
|
+
if (fence.kind === "presumed")
|
|
218
|
+
changing(() => noteDeclaration(hearing.capabilities));
|
|
219
|
+
else
|
|
220
|
+
noteDeclaration(hearing.capabilities);
|
|
221
|
+
return;
|
|
222
|
+
default: {
|
|
223
|
+
const unhandled = hearing;
|
|
224
|
+
throw new Error(`serving lease: unknown heartbeat hearing ${JSON.stringify(unhandled)}`);
|
|
225
|
+
}
|
|
173
226
|
}
|
|
174
227
|
},
|
|
175
|
-
view
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
if (capability === undefined || !capability.announced)
|
|
179
|
-
return { state: "none" };
|
|
180
|
-
const now = mono();
|
|
181
|
-
if (lease !== undefined && now < lease.expiresAtMono)
|
|
182
|
-
return { state: "granted", leaseUntil: lease.leaseUntil };
|
|
183
|
-
const expiredAt = lease?.expiresAtMono ?? capability.firstSeenAtMono;
|
|
184
|
-
return { state: "expired", pastOutageMax: now - expiredAt >= o.outageMaxMs };
|
|
228
|
+
view,
|
|
229
|
+
onViewChange(listener) {
|
|
230
|
+
viewListener = listener;
|
|
185
231
|
},
|
|
186
232
|
resumeStickyDenial() {
|
|
187
233
|
if (stickyPath === undefined || denied)
|
package/dist/fleet-client.d.ts
CHANGED
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
* - **`modelRefusals?`([ref])**:在场 ⇔ 本副本对最近一次被判的中心候选目录有可报的拒(逐条名 → 码 / 模型面组拒码)—— 取自
|
|
19
19
|
* `/health.modelRefusals` **同一只**取值口(装配层接 `deployment.modelRefusalsState`),同一个对象,形 = settings-schema
|
|
20
20
|
* `ModelRefusalsSignal`;缺席即键缺席(同 `restart`)。
|
|
21
|
-
* - **自报状态翻转即刻再 announce**(第一时间自摘流 / 自挂流 / 报重启 /
|
|
22
|
-
* `announceNow`;roster 落地、restart 信号与模型拒因变化由装配层把 web-admin 的 `onSelfReportChange` 接到 `announceNow
|
|
23
|
-
* (
|
|
21
|
+
* - **自报状态翻转即刻再 announce**(第一时间自摘流 / 自挂流 / 报重启 / 报拒因 / 报租约态,比任何观测都快):draining 翻转由收尾链直调
|
|
22
|
+
* `announceNow`;roster 落地、restart 信号与模型拒因变化由装配层把 web-admin 的 `onSelfReportChange` 接到 `announceNow`;租约态由事件引起的
|
|
23
|
+
* 翻转(推定的终结 / 续租判决 / 被拒 —— 不自激的那几样,见 `fleet/serving-lease.ts` 规则 2′)由装配层把服务租约客户端的 `onViewChange` 接到
|
|
24
|
+
* `announceNow`(三处 = 三类输入各自的唯一写者,触发都是 `announceNow`)。退出前 DELETE(显式注销,幂等)。
|
|
24
25
|
* - **usage 批报**:tracer 的 `brain.call` 已带 ALS principal —— FleetUsageAccumulator 按 principal×model
|
|
25
26
|
* 累计,每窗口(默认 60s,半开 [windowStartMs, windowEndMs))POST /api/fleet/usage。幂等键
|
|
26
27
|
* (worker,instanceId,windowStartMs) 重发安全;**发送失败 → merge 回累计器**,并入下一窗(失败窗从未入账,
|
|
@@ -30,8 +31,9 @@
|
|
|
30
31
|
* 不在下一个人的凭证下上报(不记到别人头上);它留在原箱,那个身份回来时照常报出去,收尾时还压着就响亮一行。
|
|
31
32
|
* - 全部 fire-and-forget + swallow-guarded:fleet 面是运维旁路,绝不影响任务面;网络错误只 warn 一次/连败类。
|
|
32
33
|
*/
|
|
33
|
-
import { UsageReport, type CapabilityReading, type
|
|
34
|
+
import { UsageReport, type CapabilityReading, type ModelRefusalsSignal } from "@sema-agent/settings-schema/fleet";
|
|
34
35
|
import { type EngineSignalFacts } from "./fleet/engine-signal.js";
|
|
36
|
+
import type { HeartbeatHearing } from "./fleet/serving-lease.js";
|
|
35
37
|
import { type CenterEndpoint } from "./web-admin-client/center-request.js";
|
|
36
38
|
import { type CenterCredentialSource } from "./center-credential.js";
|
|
37
39
|
/** Bound on distinct principal×model keys per window — a runaway/multi-tenant burst collapses into
|
|
@@ -118,10 +120,10 @@ export interface FleetClientOpts {
|
|
|
118
120
|
/** [ref]:模型拒因信号(装配层接 `/health` 同一只取值口 `deployment.modelRefusalsState`)。每条公告现读一次;`undefined` ⇒ 公告不带
|
|
119
121
|
* `modelRefusals` 键。必填:与 `restart` 同 —— 心跳面没有「不知道有没有拒」这一形(老引擎不发这个键,中心按 `version` 判「不可知」)。 */
|
|
120
122
|
modelRefusals: () => ModelRefusalsSignal | undefined;
|
|
121
|
-
/** 编排器片 2
|
|
122
|
-
*
|
|
123
|
-
* `
|
|
124
|
-
|
|
123
|
+
/** 编排器片 2:**每一次公告尝试恰好交一只**听到的东西(装配层接服务租约客户端的 `noteHeartbeat`;只有 fleet 成员接)。`reading` = 中心的显式
|
|
124
|
+
* 声明(规则见 {@link capabilityReadingOf});其余一律 `silent`(`why` 闭集:`HTTP <状态>` / 请求抛出的那句 / `reply-unreadable:<因>` /
|
|
125
|
+
* `not-sent:<那句>`)—— 没听到不是「没有」,租约客户端按沉默处置。没接这一只 ⇒ 不读答复体(非成员的心跳答复不进任何租约臂)。 */
|
|
126
|
+
onHeartbeat?: (hearing: HeartbeatHearing) => void;
|
|
125
127
|
/** [ref]:按凭证身份分箱的用量账(缺席 = 用量环不装)。 */
|
|
126
128
|
usage?: FleetUsageBins;
|
|
127
129
|
heartbeatMs?: number;
|
|
@@ -149,13 +151,13 @@ export interface FleetClient {
|
|
|
149
151
|
flushFinalUsage: () => Promise<void>;
|
|
150
152
|
}
|
|
151
153
|
/**
|
|
152
|
-
* 心跳 2xx 答复读不成能力读数的原因 —— 一张闭集:`body` = 答复体本身读不出(空体 / 截断 / 非 JSON)
|
|
153
|
-
* `readCapabilityReading` 的 `unreadable`
|
|
154
|
+
* 心跳 2xx 答复读不成能力读数的原因 —— 一张闭集:`body` = 答复体本身读不出(空体 / 截断 / 非 JSON),其余三词 = 契约读器
|
|
155
|
+
* `readCapabilityReading` 的 `unreadable` 三因(`not-an-object` / `capabilities-absent` / `invalid-capabilities`)。
|
|
154
156
|
*/
|
|
155
157
|
export type AnnounceReplyFlaw = "body" | Extract<CapabilityReading, {
|
|
156
158
|
kind: "unreadable";
|
|
157
159
|
}>["why"];
|
|
158
|
-
/**
|
|
160
|
+
/** 本仓对一次心跳答复的读法:契约两态,`unreadable` 的原因扩成 {@link AnnounceReplyFlaw}(`detail` = 读不出体时的那句错误,当数据交出)。 */
|
|
159
161
|
export type AnnounceReplyReading = Exclude<CapabilityReading, {
|
|
160
162
|
kind: "unreadable";
|
|
161
163
|
}> | {
|
package/dist/fleet-client.js
CHANGED
|
@@ -110,9 +110,40 @@ export function startFleetClient(opts) {
|
|
|
110
110
|
let failStreak = 0;
|
|
111
111
|
let unreadableStreak = 0;
|
|
112
112
|
const address = opts.advertiseAddress;
|
|
113
|
+
const announceFailed = (error) => {
|
|
114
|
+
failStreak += 1;
|
|
115
|
+
if (failStreak === 1)
|
|
116
|
+
opts.logger?.warn("fleet_announce_failed", { error });
|
|
117
|
+
};
|
|
118
|
+
const hearReply = async (res, leaseState) => {
|
|
119
|
+
const reading = await capabilityReadingOf(res);
|
|
120
|
+
switch (reading.kind) {
|
|
121
|
+
case "declared":
|
|
122
|
+
unreadableStreak = 0;
|
|
123
|
+
return { kind: "reading", capabilities: reading.capabilities };
|
|
124
|
+
case "unreadable":
|
|
125
|
+
recordFailOpen("server.fleet.announce-reply-unreadable", `why=${reading.why} leaseState=${leaseState}`);
|
|
126
|
+
unreadableStreak += 1;
|
|
127
|
+
if (unreadableStreak === 1) {
|
|
128
|
+
opts.logger?.warn("fleet_announce_reply_unreadable", {
|
|
129
|
+
status: res.status,
|
|
130
|
+
why: reading.why,
|
|
131
|
+
...(reading.detail !== undefined ? { error: reading.detail } : {}),
|
|
132
|
+
note: "the fleet center's heartbeat reply is not a capability declaration (unreadable body, not an object, no capabilities key, or a malformed capabilities value) — no reading taken; the serving lease keeps its state and outage clock (a member that has heard no declaration stays inside the presumed fence)",
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
return { kind: "silent", why: `reply-unreadable:${reading.why}` };
|
|
136
|
+
default: {
|
|
137
|
+
const unhandled = reading;
|
|
138
|
+
throw new Error(`heartbeat reply: unknown capability reading ${JSON.stringify(unhandled)}`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
113
142
|
const announceOnce = async () => {
|
|
114
143
|
if (stopped || address === undefined)
|
|
115
144
|
return;
|
|
145
|
+
let hearing;
|
|
146
|
+
let sending = false;
|
|
116
147
|
try {
|
|
117
148
|
const signal = opts.signal();
|
|
118
149
|
const engineSignal = buildEngineSignal(signal);
|
|
@@ -129,43 +160,32 @@ export function startFleetClient(opts) {
|
|
|
129
160
|
...fleetMembershipKeys(signal),
|
|
130
161
|
[ENGINE_SIGNAL_KEY]: engineSignal,
|
|
131
162
|
};
|
|
163
|
+
sending = true;
|
|
132
164
|
const { res } = await send("fleet-instances", "POST", body);
|
|
133
|
-
if (!res.ok)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const reading = await capabilityReadingOf(res);
|
|
137
|
-
switch (reading.kind) {
|
|
138
|
-
case "declared":
|
|
139
|
-
case "undeclared":
|
|
140
|
-
unreadableStreak = 0;
|
|
141
|
-
opts.onCenterCapabilities(reading.kind === "declared" ? reading.capabilities : undefined);
|
|
142
|
-
break;
|
|
143
|
-
case "unreadable":
|
|
144
|
-
recordFailOpen("server.fleet.announce-reply-unreadable", `why=${reading.why} leaseState=${signal.lease.state}`);
|
|
145
|
-
unreadableStreak += 1;
|
|
146
|
-
if (unreadableStreak === 1) {
|
|
147
|
-
opts.logger?.warn("fleet_announce_reply_unreadable", {
|
|
148
|
-
status: res.status,
|
|
149
|
-
why: reading.why,
|
|
150
|
-
...(reading.detail !== undefined ? { error: reading.detail } : {}),
|
|
151
|
-
note: "the fleet center's heartbeat reply is not a capability reading (unreadable body, not an object, or a malformed capabilities value) — no reading taken; the last one stands (the serving lease keeps its state and outage clock)",
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
break;
|
|
155
|
-
default: {
|
|
156
|
-
const unhandled = reading;
|
|
157
|
-
throw new Error(`heartbeat reply: unknown capability reading ${JSON.stringify(unhandled)}`);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
165
|
+
if (!res.ok) {
|
|
166
|
+
hearing = { kind: "silent", why: `HTTP ${res.status}` };
|
|
167
|
+
announceFailed(`announce ${res.status}${await rejectionSnippet(res)}`);
|
|
160
168
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
169
|
+
else {
|
|
170
|
+
if (failStreak > 0)
|
|
171
|
+
opts.logger?.info("fleet_announce_recovered", { after: failStreak });
|
|
172
|
+
failStreak = 0;
|
|
173
|
+
if (opts.onHeartbeat !== undefined)
|
|
174
|
+
hearing = await hearReply(res, signal.lease.state);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
catch (err) {
|
|
178
|
+
const error = err instanceof Error ? err.message : String(err);
|
|
179
|
+
hearing = { kind: "silent", why: sending ? error : `not-sent:${error}` };
|
|
180
|
+
announceFailed(error);
|
|
181
|
+
}
|
|
182
|
+
if (hearing === undefined || opts.onHeartbeat === undefined)
|
|
183
|
+
return;
|
|
184
|
+
try {
|
|
185
|
+
opts.onHeartbeat(hearing);
|
|
164
186
|
}
|
|
165
187
|
catch (err) {
|
|
166
|
-
|
|
167
|
-
if (failStreak === 1)
|
|
168
|
-
opts.logger?.warn("fleet_announce_failed", { error: err instanceof Error ? err.message : String(err) });
|
|
188
|
+
opts.logger?.warn("fleet_heartbeat_listener_failed", { error: err instanceof Error ? err.message : String(err), note: "the serving-lease client threw while taking this heartbeat's hearing — this beat did not reach the fence; the announce loop goes on" });
|
|
169
189
|
}
|
|
170
190
|
};
|
|
171
191
|
let inFlight;
|
package/dist/history-anchor.js
CHANGED
|
@@ -10,7 +10,7 @@ async function unknownAnchorCause(readers, reader, sessionId, handle) {
|
|
|
10
10
|
if (reader === undefined)
|
|
11
11
|
return NO_ANCHOR;
|
|
12
12
|
try {
|
|
13
|
-
const run = await readVisibleRun(reader, readers.runs, handle);
|
|
13
|
+
const run = (await readVisibleRun(reader, readers.runs, handle))?.row;
|
|
14
14
|
if (run === undefined || run.sessionId !== sessionId)
|
|
15
15
|
return NO_ANCHOR;
|
|
16
16
|
return (await readers.anchors.resolve(sessionId, handle, run.owner)) === undefined ? PROMPT_WITHOUT_ANCHOR : NO_ANCHOR;
|
package/dist/hitl-delivery.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export interface HitlSinks {
|
|
|
29
29
|
readonly live?: boolean;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* 一条腿的传输(无状态)。`deliver`
|
|
32
|
+
* 一条腿的传输(无状态)。`deliver` 是**属性**(不是方法签名)—— 帧型参数因此逆变。腿上装出的那一只是全族型(`HitlTransport<HitlFrame>`,
|
|
33
33
|
* 一腿一只、三族共用);**窄化发生在装进族上下文那一步**:审批上下文的判别联合把传输型钉到本族帧(呈卡族收不进旧族帧),竞速机的目标从族上下文取
|
|
34
34
|
* ⇒ 混族的 (transport, frame) 对编译不过。直接拿全族型传输喂竞速机的代码不受这道型约束(三只协调器都从族上下文取,`P14` 编译期钉)。
|
|
35
35
|
*/
|
|
@@ -39,8 +39,6 @@ export interface HitlTransport<F extends HitlFrame> {
|
|
|
39
39
|
* 写抛 / 已死 ⇒ 直写没接下(不碰死连接)。③ 交回每只涉及的 sink 接下与否。**永不 reject。**
|
|
40
40
|
*/
|
|
41
41
|
readonly deliver: (frame: F, onto?: HitlSinks) => Promise<HitlSinks>;
|
|
42
|
-
/** 判决面谓词:有直写 ⇒ 直写此刻活着;只有账本 ⇒ 恒真(账本 tail 随时可被接上)。谓词读不出 ⇒ 假(判决面 fail-closed 到停驻)。 */
|
|
43
|
-
readonly reachable: () => boolean;
|
|
44
42
|
}
|
|
45
43
|
/** 直写面:一个具名帧写 + 「此刻还活着吗」。 */
|
|
46
44
|
export interface HitlLiveSink<F extends HitlFrame> {
|
package/dist/hitl-delivery.js
CHANGED
|
@@ -66,7 +66,7 @@ export function createHitlTransport(sinks) {
|
|
|
66
66
|
}
|
|
67
67
|
return ledgerAccepted !== undefined ? { ledger: ledgerAccepted, live: liveAccepted } : { live: liveAccepted };
|
|
68
68
|
};
|
|
69
|
-
return { deliver
|
|
69
|
+
return { deliver };
|
|
70
70
|
}
|
|
71
71
|
export function createHitlOpenRace(args) {
|
|
72
72
|
const opens = args.targets.map((t) => t.transport.deliver(t.frame));
|
|
@@ -60,8 +60,8 @@ export const SETTINGS_HOOK_STATIONS = {
|
|
|
60
60
|
function chainsBelowTaskOn(patterns, station) {
|
|
61
61
|
return patterns.some((p) => p === station || (p.endsWith(".*") && station.startsWith(p.slice(0, -1))));
|
|
62
62
|
}
|
|
63
|
-
const REQUEST_HOOK_REWRITE_UNSHOWN_REASON = "a request PreToolUse hook rewrote this call's input, but
|
|
64
|
-
const REQUEST_HOOK_ALLOW_UNJUDGED_REASON = "a request PreToolUse hook allowed this call, but
|
|
63
|
+
const REQUEST_HOOK_REWRITE_UNSHOWN_REASON = "a request PreToolUse hook rewrote this call's input, but a deployment-seat handler is admitted at the PreToolUse site below the request's hooks (admission is per site; whether its matcher fits this call is not read), and such a handler never sees a rewrite made above it, so request-hook rewrites are refused at this site and the call was not executed";
|
|
64
|
+
const REQUEST_HOOK_ALLOW_UNJUDGED_REASON = "a request PreToolUse hook allowed this call, but a deployment-seat handler is admitted at the PreToolUse site below the request's hooks (admission is per site; whether its matcher fits this call is not read), and a request hook's allow does not stand in for that handler's judgment, so request-hook allows are refused at this site and the call was not executed";
|
|
65
65
|
function hangTranslator(on, event, translators) {
|
|
66
66
|
const translate = translators[event];
|
|
67
67
|
if (translate === undefined)
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* `LSP_HOST_ENABLED`。理由:core 的 `NodeLspManager` 在 worker 上起本机子进程、在 worker 盘上找根,问的正是「这块盘是不是调用方的」;
|
|
7
7
|
* 车道能力表不另存一位(同一个答案的第二个写者)。两个入口(服务装配 `boot/execution-env.ts`、纯本地 CLI `run-local.ts`)的 `lspManager`
|
|
8
8
|
* 就是本函数的返回值,不再有任何条件(结构钉 `test/secret-env-scrub-disclosure.test.ts` 的 P1,逐格钉 `test/lsp-host-manager.test.ts` 的 P2)。
|
|
9
|
-
* 「绑得住读」(`openBound`)
|
|
10
|
-
*
|
|
9
|
+
* 「绑得住读」(`openBound`)不是本铸点的判据:它是每条有手车道的结构前提(对拍钉 `test/host-env-open-bound.test.ts` P3;本版 ssh 缓装),
|
|
10
|
+
* 运行期的不可绑由那一答答(远端目标给不出那一次观测 ⇒ `not_supported`,引擎读作缺席)。
|
|
11
11
|
*
|
|
12
12
|
* ## 子进程 env:病([ref],core 7.30.1 [ref] 提货;DEBTS [ref] 同轴的第二条,7.99.0 修复验证 opus 腿普查带出)
|
|
13
13
|
* core 的 `NodeLspManager` 默认 spawn(`defaultLspSpawn`)在 7.30.1 之前**不带 env** ⇒ 语言服务器整份继承本进程的
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { type GovernancePosture } from "../runtime-governance.js";
|
|
17
17
|
import type { ShellGateDoctrine } from "@sema-agent/core";
|
|
18
|
-
import {
|
|
18
|
+
import type { RunStore } from "../plugins/store-backend.js";
|
|
19
19
|
import { type PendingRowBinding } from "../plugins/checkpoint-store-face.js";
|
|
20
20
|
/** 与 runs.ts/tasks.ts 三个 409 位共享的旧文案(byte-frozen:api-error-text-freeze 门认这句)。 */
|
|
21
21
|
export declare const ACTIVE_RUN_CONFLICT_BASE_TEXT = "session already has an active run \u2014 POST /v1/runs/{activeTaskId}/cancel stops it (same-instance interactive runs abort immediately)";
|
|
@@ -113,12 +113,8 @@ interface ConflictProbeDeps<TToken> {
|
|
|
113
113
|
/** 结构形入参,但 `status` 取 run 行的**闭词表**(合并码重扫):判 park 要走词表属主
|
|
114
114
|
* `isParkedRunStatus`,而它的入参是穷举联合 —— 这一格写成开放 `string` 就只能在调用点裸 cast,
|
|
115
115
|
* 绕开那道编译期执法(core 加一个 park 类成员时本文件不会红)。 */
|
|
116
|
-
/**
|
|
117
|
-
runStore?:
|
|
118
|
-
getRun?: (id: string) => Promise<{
|
|
119
|
-
status?: RunRecord["status"];
|
|
120
|
-
} | null | undefined>;
|
|
121
|
-
} | undefined;
|
|
116
|
+
/** 持有者那一行的状态(不带属主的一格事实,经属主存取器 `runFactsOf` 读;409 体只点名**活着**的持有者 —— 心跳过期的持有者在认领冲突处已被判死、认领已放,见 run 店 `createRun`)。 */
|
|
117
|
+
runStore?: Pick<RunStore, "getRun"> | undefined;
|
|
122
118
|
checkpointStore?: {
|
|
123
119
|
peekPendingScope?: (sessionId: string, binding?: PendingRowBinding) => Promise<string | null | undefined>;
|
|
124
120
|
findPendingTokenBySession?: (sessionId: string, scope?: string, binding?: PendingRowBinding) => Promise<TToken | null | undefined>;
|