@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
package/dist/config-types.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ import type { QuestionThrottle } from "./question.js";
|
|
|
19
19
|
import type { UnattendedApprovalPolicy } from "./tool-approval.js";
|
|
20
20
|
import type { InfraCostRates } from "./observability/cost-taxonomy.js";
|
|
21
21
|
import type { Autonomy, CommandRule } from "./runtime-governance.js";
|
|
22
|
-
import type { CenterCredentialSource } from "./center-credential.js";
|
|
22
|
+
import type { CenterCredentialSource, DeclaredCredentialOrigin } from "./center-credential.js";
|
|
23
23
|
import type { GitApiKind } from "./git-api-kind.js";
|
|
24
24
|
import type { CustomPkgSource } from "./sandbox-pkg-source.js";
|
|
25
25
|
import type { MemoryEngineBackend, StoreBackend as StoreBackendWord } from "@sema-agent/settings-schema/execution-lanes";
|
|
@@ -331,7 +331,7 @@ export interface CenterMcp {
|
|
|
331
331
|
servers: ScopedMcpServer[];
|
|
332
332
|
reservedNames: readonly string[];
|
|
333
333
|
}
|
|
334
|
-
/**
|
|
334
|
+
/** [ref] §2.1 —— an A2A PEER resolved to a core spec (header-NAME refs already read and registered on the peer desk
|
|
335
335
|
* under the roster lease: the spec carries the minted reference, never the values) plus
|
|
336
336
|
* the scenarios it applies to (empty = all). Exact sibling of {@link ScopedMcpServer}: `resolveSpec`
|
|
337
337
|
* filters by scenario (`a2aForScenario`) and passes `spec` to core as `TaskSpec.a2a`.
|
|
@@ -344,7 +344,7 @@ export interface ScopedA2aPeer {
|
|
|
344
344
|
spec: A2aServerSpec;
|
|
345
345
|
}
|
|
346
346
|
/**
|
|
347
|
-
*
|
|
347
|
+
* [ref] §3.1 车2 —— ONE declared skill on the agent card this deployment publishes when it acts as
|
|
348
348
|
* an A2A **peer** (server-as-peer half). v1 is a **static declaration**: the operator writes the list,
|
|
349
349
|
* the server never enumerates its own scenarios into it.
|
|
350
350
|
*
|
|
@@ -369,7 +369,7 @@ export interface A2aServeSkill {
|
|
|
369
369
|
audience?: readonly string[];
|
|
370
370
|
}
|
|
371
371
|
/**
|
|
372
|
-
*
|
|
372
|
+
* [ref] §3.3 车2 —— the server-as-peer block. **Absence IS the OFF state** (`A2A_SERVE_ENABLED`
|
|
373
373
|
* default OFF): with this field undefined both `/.well-known/agent-card.json` and `POST /v1/a2a` 404,
|
|
374
374
|
* i.e. "卡都不发=对外不存在" — not "publish a card but refuse the calls". Modelling OFF as absence
|
|
375
375
|
* (rather than an `enabled:false` member) makes the half-state structurally unrepresentable.
|
|
@@ -828,8 +828,9 @@ export interface ServiceConfigFlat {
|
|
|
828
828
|
* models/roles; mutateInPlace keeps the reference. */
|
|
829
829
|
tiers: Record<string, string>;
|
|
830
830
|
/** 项目登记簿(settings-schema `projects` 域):键 = projectId(小写规范 UUID),值 = settings-schema 的 `ProjectRegistration` **原样**
|
|
831
|
-
* (本仓不持第二份项目型、不挑键 —— 形与判官只在 settings-schema)
|
|
832
|
-
* `defaultScopes` 作 `TaskSpec.memory.scopes` 的种子(v2 scope 键串,OPEN 值域 —— 本表只登记不解释)
|
|
831
|
+
* (本仓不持第二份项目型、不挑键 —— 形与判官只在 settings-schema)。按调用方读(可见性判 + 按 id 取)只经 `project-registry.ts`:`GET /v1/projects` 读面
|
|
832
|
+
* (`http/routes/projects.ts`)、项目上下文继承、`defaultScopes` 作 `TaskSpec.memory.scopes` 的种子(v2 scope 键串,OPEN 值域 —— 本表只登记不解释);
|
|
833
|
+
* 部署级聚合(org 记忆准入的部署 scope 集,`boot/org-memory.ts`)整表读。
|
|
833
834
|
* NO env source —— 只由 applyEffective 经 settings-schema 的视图面读函数判过后填(mutateInPlace,boot + refresh 整表替换);
|
|
834
835
|
* 本地腿恒空(settings-schema 的本地读取集不收 `projects`)。 */
|
|
835
836
|
projects: Record<string, ProjectRegistration>;
|
|
@@ -1108,14 +1109,14 @@ export interface ServiceConfigFlat {
|
|
|
1108
1109
|
* present (restart-to-apply, like models/roles); undefined = no center MCP (scenarios use no MCP).
|
|
1109
1110
|
* Carries both the mounted list and the full declared-name set — see {@link CenterMcp}. */
|
|
1110
1111
|
mcpServers?: CenterMcp;
|
|
1111
|
-
/**
|
|
1112
|
+
/** [ref] §2.1 —— A2A peers from the web-admin (`/effective.a2a`), resolved at startup
|
|
1112
1113
|
* (header-NAME refs → values) and filtered per scenario in `resolveSpec` (`a2aForScenario`). Same
|
|
1113
1114
|
* posture as {@link mcpServers}: not env-derived (no A2A_* env leg — a peer is a structured record,
|
|
1114
1115
|
* not a scalar), populated by the web-admin adapter when present, restart-to-apply.
|
|
1115
1116
|
* undefined = no center peers ⇒ **the whole leg does not exist** for a task (`TaskSpec.a2a` stays
|
|
1116
1117
|
* absent unless a single-user caller injects `body.a2aPeers`). */
|
|
1117
1118
|
a2aPeers?: ScopedA2aPeer[];
|
|
1118
|
-
/**
|
|
1119
|
+
/** [ref] §3.3 车2 —— server-as-peer. **undefined = OFF** (the default), and OFF means both the
|
|
1119
1120
|
* card and the JSON-RPC endpoint 404. See {@link A2aServeConfig}. Env-derived (`A2A_SERVE_*`), unlike
|
|
1120
1121
|
* {@link a2aPeers}: the serve block is a handful of scalars an operator sets on the worker, not a
|
|
1121
1122
|
* center-distributed record. */
|
|
@@ -1371,7 +1372,7 @@ export interface ServiceConfigFlat {
|
|
|
1371
1372
|
*/
|
|
1372
1373
|
retentionPolicy?: RetentionPolicy;
|
|
1373
1374
|
/**
|
|
1374
|
-
* [ref] 车2 —— 托管留存 **sweep lane** 的两个旋钮(设计稿 `
|
|
1375
|
+
* [ref] 车2 —— 托管留存 **sweep lane** 的两个旋钮(设计稿 `[ref]-retention-lane.md` §3/§4)。
|
|
1375
1376
|
* `retentionPolicy` 说的是「保留多久」(一句声明),本格说的是「谁在什么节律上按那句话删」。
|
|
1376
1377
|
* **恒在场**(不是可选块):两根都有文档化的缺省,而缺省本身是一条要能被读出来的姿态 ——
|
|
1377
1378
|
* `{mode:"audit-only", intervalSec:0}` = 「lane 关着,真开起来也先只记账」。被要的车道必须齐(`intervalSec > 0` 或 `mode:"enforce"` ⇒
|
|
@@ -1401,7 +1402,7 @@ export interface ServiceConfigFlat {
|
|
|
1401
1402
|
*/
|
|
1402
1403
|
serviceTokenActsForDeployment: boolean;
|
|
1403
1404
|
/**
|
|
1404
|
-
*
|
|
1405
|
+
* [ref] §5 S2([ref])—— `GET /v1/config/catalog`(配置目录自描述端点)的显式旋钮。
|
|
1405
1406
|
* 默认 **ON**(设计稿 §0.5:合规部署可关)。端点本身已是 operator-only(`explicitOperatorOk`,
|
|
1406
1407
|
* 空名单=谁都不是),本键给的是「即便 operator 也不许从 wire 读部署事实」的合规姿态:关 ⇒ 路径
|
|
1407
1408
|
* 不存在(404 族,与 memory-consolidation 阀门同判:旋钮没开 ≠ 能力缺失)、能力位 `configCatalog`
|
|
@@ -2019,7 +2020,8 @@ export interface ServiceConfigFlat {
|
|
|
2019
2020
|
* ON; multi-tenant opt-in); `ASK_QUESTION_ENABLED=true/false` overrides. */
|
|
2020
2021
|
askQuestionEnabled: boolean;
|
|
2021
2022
|
/** [ref] 裁2:AskUserQuestion 的**裁量窗**——每 run 腿的并发帽 / 总量帽 / 无人应答的释放窗。窗用尽或到期
|
|
2022
|
-
* 不是拒绝、也不是替人作答:协调器报 `unavailable`,落点(durable park / 非 durable 合成续跑)归 core
|
|
2023
|
+
* 不是拒绝、也不是替人作答:协调器报 `unavailable`,落点(durable park / 非 durable 合成续跑)归 core;卡由活面呈出而窗到期 ⇒
|
|
2024
|
+
* 协调器抛(core 的投递失败臂,不改道)。
|
|
2023
2025
|
* `QUESTION_MAX_CONCURRENT_PER_RUN`(默认 2)/ `QUESTION_MAX_TOTAL_PER_RUN`(20)/ `QUESTION_TTL_MS`
|
|
2024
2026
|
* (300000),越界值启动期响亮拒(照 `MCP_ELICITATION_*` 同门,不静默夹取)。缺席 ⇒ 协调器出厂窗
|
|
2025
2027
|
* {@link import("./question.js").DEFAULT_QUESTION_THROTTLE}(与本旋钮族默认逐字同值)。 */
|
|
@@ -2339,12 +2341,17 @@ export interface ServiceConfigFlat {
|
|
|
2339
2341
|
* `liveBaseUrl`(编排器片 2,env `SEMA_WEB_ADMIN_LIVE_URL`):fleet 活性组(心跳 / 注销、服务租约 —— settings-schema `FLEET_LIVE_PATHS`)的基址,
|
|
2340
2342
|
* 给「管理面在就绪门后、活性面另走一条不看就绪的入口」的部署;缺席 ⇒ 活性组也打 `baseUrl`(这条缺省只在 `centerFetch` 读)。
|
|
2341
2343
|
* `webBaseUrl`(7.121.0,env `SEMA_WEB_ADMIN_WEB_URL`):这个中心的 **web 面固定基址**,运维声明、引擎原样转述到 `/health.center.webBaseUrl`
|
|
2342
|
-
* (壳按它拼会话深链;路径怎么拼归壳)。起服时判成「可拼路径的基址」:http(s)、不带凭据 / query / fragment,否则拒启;缺席即缺席,引擎不拼不猜。
|
|
2344
|
+
* (壳按它拼会话深链;路径怎么拼归壳)。起服时判成「可拼路径的基址」:http(s)、不带凭据 / query / fragment,否则拒启;缺席即缺席,引擎不拼不猜。
|
|
2345
|
+
* `assertionToken`([ref]):web-admin 断言令牌(`SEMA_WEB_ADMIN_ASSERTION_TOKEN` / `_FILE`,二选一,都设拒启)的**声明读数**,非秘密投影 ——
|
|
2346
|
+
* 声明在 ⇒ 来源两形之一(`env` / `file` + 绝对路径);没声明 ⇒ 这一格缺席(`loadConfig` 只在声明在时写它;缺席只有一种读法 = 没声明)。
|
|
2347
|
+
* 值不进配置:本版只读声明、不向中心出示;读者 = `/health.center.assertionToken` 与起服日志 `center_assertion_token`。读口与 `credential` 同一只
|
|
2348
|
+
* (`center-credential.ts` 的 `readWebAdminCredentialDeclaration`)。 */
|
|
2343
2349
|
webAdmin?: {
|
|
2344
2350
|
baseUrl: string;
|
|
2345
2351
|
liveBaseUrl?: string;
|
|
2346
2352
|
webBaseUrl?: string;
|
|
2347
2353
|
credential: CenterCredentialSource;
|
|
2354
|
+
assertionToken?: DeclaredCredentialOrigin;
|
|
2348
2355
|
dryRun: boolean;
|
|
2349
2356
|
worker?: string;
|
|
2350
2357
|
};
|
|
@@ -2368,9 +2375,9 @@ export interface ServiceConfigFlat {
|
|
|
2368
2375
|
fleetAdvertiseAddress?: string;
|
|
2369
2376
|
/** 编排器片 2:一台实例「活着而不服务」的最长时长 `T_max`(ms;env `FLEET_LEASE_OUTAGE_MAX_MS`)。缺省 86 400 000(24 h);地板 = 服务租约
|
|
2370
2377
|
* TTL 地板(settings-schema `SERVING_LEASE_TTL_FLOOR_MS`,60 s);不许 0 / 无穷,坏值拒启。`loadConfig` 无条件解析(成员与非成员同读)。两个读者:
|
|
2371
|
-
* ① 服务租约**中心不可达的容忍上限**(`fleet/serving-lease.ts`;只在 fleet 成员 ∧
|
|
2372
|
-
*
|
|
2373
|
-
*
|
|
2378
|
+
* ① 服务租约**中心不可达的容忍上限**(`fleet/serving-lease.ts`;只在 fleet 成员 ∧ 中心没有声明不执行租约时生效 —— 没听到中心的成员也算,
|
|
2379
|
+
* 起步即推定在围栏内):租约过期(中心不可达 / 答 unknown;从没被授予过的,从围栏生效那一刻 —— 一直没听到中心的成员从本进程起点)之后照常服务,
|
|
2380
|
+
* 直到满这么久 ⇒ 新计费提交 503 `state.lease_expired`(取消 / HITL 应答 / 续跑 / 读面照放行),在飞不动、不自停;中心恢复授予即恢复。② 排空口 `POST /v1/admin/drain` 的**期限准入上界**(`fleet/drain-entry.ts` 规则 2):`deadlineAt` 离此刻超过它 ⇒
|
|
2374
2381
|
* 400 `request.field_invalid`。 */
|
|
2375
2382
|
fleetLeaseOutageMaxMs: number;
|
|
2376
2383
|
/** [ref](design-325 §2):中心凭证**续签提前量**(ms)—— `SEMA_WEB_ADMIN_TOKEN_FILE` 指向人的登录会话信封
|
package/dist/config.d.ts
CHANGED
|
@@ -124,7 +124,10 @@ export declare function parseConfigProvider(): ConfigProviderWord | undefined;
|
|
|
124
124
|
/** F10 (codex audit): drain + log BOTH pre-logger diagnostic collectors (S20 soft-knob warnings + [ref]④ boot
|
|
125
125
|
* notices) in one place. EVERY entrypoint that calls loadConfig() then builds a logger must call this right
|
|
126
126
|
* after (main.ts, run-local.ts) — a new entry that forgets it would silently drop operator-facing diagnostics
|
|
127
|
-
* (run-local historically did exactly that), so the drain lives beside the collectors, not in one entrypoint.
|
|
127
|
+
* (run-local historically did exactly that), so the drain lives beside the collectors, not in one entrypoint.
|
|
128
|
+
* Draining is repeatable: a read made AFTER the boot drain (the execution-lane composition step reads the env of a lane the config file chose;
|
|
129
|
+
* `boot/execution-lane.ts`) calls it again right after, so its soft-knob rejects and knob registrations reach the log instead of piling up
|
|
130
|
+
* undrained — the polarity table (debug) is then printed again, now covering that read too. */
|
|
128
131
|
export declare function logConfigDiagnostics(logger: {
|
|
129
132
|
warn: (event: string, fields?: Record<string, unknown>) => void;
|
|
130
133
|
info?: (event: string, fields?: Record<string, unknown>) => void;
|
|
@@ -192,10 +195,56 @@ export declare function buildUnpricedCeilingNotice(models: Record<string, Model>
|
|
|
192
195
|
export type EntryDeclarableLane = Extract<ExecutionLane, "host" | "none">;
|
|
193
196
|
/**
|
|
194
197
|
* 这两条车道的配置形(唯一铸点):env 声明了它们时由 {@link loadConfig} 的车道链调,入口程序自身声明它们时由执行车道合成步调 —— 坐标 env 同一读法。
|
|
195
|
-
* DUAL-MODE §5:`host` = 在这台机器上跑、无容器(坐标 `HOST_WORKSPACE_BASE` / `HOST_COMMAND_TIMEOUT_MS` 可选,无必需 env)。
|
|
198
|
+
* DUAL-MODE §5:`host` = 在这台机器上跑、无容器(坐标 `HOST_WORKSPACE_BASE` / `HOST_COMMAND_TIMEOUT_MS` 可选,无必需 env;读数见 {@link parseHostLaneEnv})。
|
|
196
199
|
* 契约 18.0.0:`none` = 部署声明「智能体的工具没有执行环境」(零字段、无必需 env)。
|
|
197
200
|
*/
|
|
198
201
|
export declare function entryDeclarableRemoteExec(lane: EntryDeclarableLane): RemoteExecConfig;
|
|
202
|
+
/** `host` 车道的配置块(型从 {@link RemoteExecConfig} 判别联合取,不另写第二份字段表)。 */
|
|
203
|
+
type HostRemoteExec = Extract<RemoteExecConfig, {
|
|
204
|
+
provider: "host";
|
|
205
|
+
}>;
|
|
206
|
+
/** `local-docker` 车道的配置块(同上)。 */
|
|
207
|
+
type LocalDockerRemoteExec = Extract<RemoteExecConfig, {
|
|
208
|
+
provider: "local-docker";
|
|
209
|
+
}>;
|
|
210
|
+
/** env 一侧对 `host` 车道的读数(块去掉判别位)。 */
|
|
211
|
+
export type HostEnvReading = Omit<HostRemoteExec, "provider">;
|
|
212
|
+
/** env 一侧对 `local-docker` 车道的读数(块去掉判别位;`image` 改可选 —— `DOCKER_IMAGE` 是本车道的必需 env,读数本身不判必需,判官是车道必需 env 门)。 */
|
|
213
|
+
export type LocalDockerEnvReading = Omit<LocalDockerRemoteExec, "provider" | "image"> & {
|
|
214
|
+
image?: string;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* **`host` 车道的 env 读数**(唯一读者):`HOST_WORKSPACE_BASE` / `HOST_COMMAND_TIMEOUT_MS`。env 声明路径({@link entryDeclarableRemoteExec})、入口自身声明、
|
|
218
|
+
* 文件腿(`config.d/remote-exec.json` 选定 host 车道时,车道参数仍由 env 读)读的都是这一只。求值时点:`REMOTE_EXEC` 声明的车道在 `loadConfig` 里求值(早于文件);
|
|
219
|
+
* 文件选定而 env 没声明它 ⇒ 执行车道合成步现读;没被选中的车道不求值 —— 那里它们是无关配置。
|
|
220
|
+
*/
|
|
221
|
+
export declare function parseHostLaneEnv(): HostEnvReading;
|
|
222
|
+
/**
|
|
223
|
+
* **`local-docker` 车道的 env 读数**(唯一读者):`DOCKER_*` 的全部坐标与车道参数(含容器帽、pids 限额、丢 capability、带外 env 名单)。env 声明路径
|
|
224
|
+
* ({@link loadConfig} 的车道链)与文件腿(`config.d/remote-exec.json` 选定 local-docker 车道时)读的是这一只:文件只定「哪条车道」,车道参数仍只有 env 一处可写,
|
|
225
|
+
* 文件里有同名格的那几格由文件胜(`FILE_LANE_CELL_ENV` 列的五格)。只在本车道被选中(env 声明,或文件选定)时求值 —— 其它车道上它们是无关配置。
|
|
226
|
+
* `singleUserTurnkey` = 本部署是不是单用户姿态(`REQUIRE_PRINCIPAL !== "true"`;名单型旋钮 `DOCKER_SANDBOX_ENV` 的姿态判)。
|
|
227
|
+
*/
|
|
228
|
+
export declare function parseLocalDockerLaneEnv(singleUserTurnkey: boolean): LocalDockerEnvReading;
|
|
229
|
+
/**
|
|
230
|
+
* **文件格 ↔ env 键的对表**(`config.d/remote-exec.json` 与 env 对「同一件事」各有一个名字):文件选定车道后,块 = env 读数 ∪ 文件格,**同名格文件赢**;
|
|
231
|
+
* 两处在同一格上给了不同的值 ⇒ 文件赢并响亮点名那一格的 env 键(`remote_exec_file_overrides`,执行车道合成步)。表序 = 点名序。
|
|
232
|
+
* 格名取块的字段名(`satisfies` 钉住:块改名而表不跟 ⇒ 编译红);env 键须是车道表里这条车道的坐标键、且上面两只读者真的读它(`test/remote-exec-file-lane-env-params.test.ts` 钉)。
|
|
233
|
+
* 文件腿读不到 env 键字面 —— 键名只住在读者与这张表里。
|
|
234
|
+
*/
|
|
235
|
+
export declare const FILE_LANE_CELL_ENV: {
|
|
236
|
+
readonly host: {
|
|
237
|
+
readonly workspaceBase: "HOST_WORKSPACE_BASE";
|
|
238
|
+
readonly commandTimeoutMs: "HOST_COMMAND_TIMEOUT_MS";
|
|
239
|
+
};
|
|
240
|
+
readonly "local-docker": {
|
|
241
|
+
readonly image: "DOCKER_IMAGE";
|
|
242
|
+
readonly mountPath: "DOCKER_MOUNT_PATH";
|
|
243
|
+
readonly memory: "DOCKER_MEMORY";
|
|
244
|
+
readonly cpus: "DOCKER_CPUS";
|
|
245
|
+
readonly network: "DOCKER_NETWORK";
|
|
246
|
+
};
|
|
247
|
+
};
|
|
199
248
|
/** [ref] N8/N9 — the BOOLEAN member of this module's env-parser family (`env`/`env2`/`numEnv`/
|
|
200
249
|
* `numEnvBounded`/`optFinitePositiveEnv`/`enumEnv`/`headerNameEnv`). Until now booleans were the
|
|
201
250
|
* one type parsed by a hand-written literal comparison at every single site, and that is exactly why the same
|
package/dist/config.js
CHANGED
|
@@ -49,7 +49,7 @@ import { AUTONOMY_MODES } from "./runtime-governance.js";
|
|
|
49
49
|
import { deploymentRuleRefusal } from "./rule-issue-reading.js";
|
|
50
50
|
import { MAX_NAMED_INERT_ENTRIES, allowLayerEntryCountIssue, describeInertRuleEntries, inertRuleEntriesOf, inertRuleEntryGuidance, ruleEntryListShapeOk } from "./rule-entry-list.js";
|
|
51
51
|
import { readReadDenyEntry } from "./read-deny-entry.js";
|
|
52
|
-
import { createCenterCredentialSource,
|
|
52
|
+
import { createCenterCredentialSource, credentialOriginOf, readWebAdminCredentialDeclaration } from "./center-credential.js";
|
|
53
53
|
import { parseCenterCredentialRenewLeadMs } from "./center-credential-renewer.js";
|
|
54
54
|
import { catalogBrainLane, modelProviderRefusal } from "./model-provider.js";
|
|
55
55
|
import { modelRouteUrlRefusal } from "./model-route-url.js";
|
|
@@ -408,15 +408,39 @@ function parseDeviceRelayUrlEnv(raw) {
|
|
|
408
408
|
export function entryDeclarableRemoteExec(lane) {
|
|
409
409
|
switch (lane) {
|
|
410
410
|
case "host":
|
|
411
|
-
return {
|
|
412
|
-
provider: "host",
|
|
413
|
-
...(process.env.HOST_WORKSPACE_BASE ? { workspaceBase: process.env.HOST_WORKSPACE_BASE } : {}),
|
|
414
|
-
...((n) => (n !== undefined ? { commandTimeoutMs: n } : {}))(optNumEnvStrict("HOST_COMMAND_TIMEOUT_MS")),
|
|
415
|
-
};
|
|
411
|
+
return { provider: "host", ...parseHostLaneEnv() };
|
|
416
412
|
case "none":
|
|
417
413
|
return { provider: "none" };
|
|
418
414
|
}
|
|
419
415
|
}
|
|
416
|
+
export function parseHostLaneEnv() {
|
|
417
|
+
return {
|
|
418
|
+
...(process.env.HOST_WORKSPACE_BASE ? { workspaceBase: process.env.HOST_WORKSPACE_BASE } : {}),
|
|
419
|
+
...((n) => (n !== undefined ? { commandTimeoutMs: n } : {}))(optNumEnvStrict("HOST_COMMAND_TIMEOUT_MS")),
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
export function parseLocalDockerLaneEnv(singleUserTurnkey) {
|
|
423
|
+
return {
|
|
424
|
+
...(process.env.DOCKER_IMAGE ? { image: process.env.DOCKER_IMAGE } : {}),
|
|
425
|
+
...(process.env.DOCKER_MOUNT_PATH ? { mountPath: process.env.DOCKER_MOUNT_PATH } : {}),
|
|
426
|
+
...(process.env.DOCKER_PATH ? { dockerPath: process.env.DOCKER_PATH } : {}),
|
|
427
|
+
...(process.env.DOCKER_HOST ? { dockerHost: process.env.DOCKER_HOST } : {}),
|
|
428
|
+
...(process.env.DOCKER_MEMORY ? { memory: process.env.DOCKER_MEMORY } : {}),
|
|
429
|
+
...((n) => (n !== undefined ? { cpus: n } : {}))(optNumEnvStrict("DOCKER_CPUS")),
|
|
430
|
+
...((n) => (n !== undefined ? { pidsLimit: n } : {}))(optFinitePositiveEnv("DOCKER_PIDS_LIMIT")),
|
|
431
|
+
...(boolEnv("DOCKER_DROP_CAPS", false) ? { dropAllCaps: true } : {}),
|
|
432
|
+
...(process.env.DOCKER_NETWORK
|
|
433
|
+
? { network: enumEnv("DOCKER_NETWORK", "bridge", ["none", "bridge", "host"]) }
|
|
434
|
+
: {}),
|
|
435
|
+
...((n) => (n !== undefined ? { commandTimeoutMs: n } : {}))(optNumEnvStrict("DOCKER_COMMAND_TIMEOUT_MS")),
|
|
436
|
+
...((names) => (names !== undefined ? { env: allowlistedEnv(names, process.env) } : {}))(parseEnvNameAllowlist("DOCKER_SANDBOX_ENV", singleUserTurnkey)),
|
|
437
|
+
...((capacity) => (capacity !== undefined ? { capacity } : {}))(parseLocalDockerCapacityEnv()),
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
export const FILE_LANE_CELL_ENV = {
|
|
441
|
+
host: { workspaceBase: "HOST_WORKSPACE_BASE", commandTimeoutMs: "HOST_COMMAND_TIMEOUT_MS" },
|
|
442
|
+
"local-docker": { image: "DOCKER_IMAGE", mountPath: "DOCKER_MOUNT_PATH", memory: "DOCKER_MEMORY", cpus: "DOCKER_CPUS", network: "DOCKER_NETWORK" },
|
|
443
|
+
};
|
|
420
444
|
const envNamesNoLane = (raw) => raw === undefined || raw === "";
|
|
421
445
|
function declaredExecutionLane(raw) {
|
|
422
446
|
if (envNamesNoLane(raw))
|
|
@@ -2127,23 +2151,8 @@ function parseOrchestrationDomain(ctx) {
|
|
|
2127
2151
|
? entryDeclarableRemoteExec(declaredLane)
|
|
2128
2152
|
:
|
|
2129
2153
|
declaredLane === "local-docker" && process.env.DOCKER_IMAGE
|
|
2130
|
-
?
|
|
2131
|
-
provider: "local-docker",
|
|
2132
|
-
image: process.env.DOCKER_IMAGE,
|
|
2133
|
-
...(process.env.DOCKER_MOUNT_PATH ? { mountPath: process.env.DOCKER_MOUNT_PATH } : {}),
|
|
2134
|
-
...(process.env.DOCKER_PATH ? { dockerPath: process.env.DOCKER_PATH } : {}),
|
|
2135
|
-
...(process.env.DOCKER_HOST ? { dockerHost: process.env.DOCKER_HOST } : {}),
|
|
2136
|
-
...(process.env.DOCKER_MEMORY ? { memory: process.env.DOCKER_MEMORY } : {}),
|
|
2137
|
-
...((n) => (n !== undefined ? { cpus: n } : {}))(optNumEnvStrict("DOCKER_CPUS")),
|
|
2138
|
-
...((n) => (n !== undefined ? { pidsLimit: n } : {}))(optFinitePositiveEnv("DOCKER_PIDS_LIMIT")),
|
|
2139
|
-
...(boolEnv("DOCKER_DROP_CAPS", false) ? { dropAllCaps: true } : {}),
|
|
2140
|
-
...(process.env.DOCKER_NETWORK
|
|
2141
|
-
? { network: enumEnv("DOCKER_NETWORK", "bridge", ["none", "bridge", "host"]) }
|
|
2142
|
-
: {}),
|
|
2143
|
-
...((n) => (n !== undefined ? { commandTimeoutMs: n } : {}))(optNumEnvStrict("DOCKER_COMMAND_TIMEOUT_MS")),
|
|
2144
|
-
...((names) => (names !== undefined ? { env: allowlistedEnv(names, process.env) } : {}))(parseEnvNameAllowlist("DOCKER_SANDBOX_ENV", singleUserTurnkey)),
|
|
2145
|
-
...((capacity) => (capacity !== undefined ? { capacity } : {}))(parseLocalDockerCapacityEnv()),
|
|
2146
|
-
}
|
|
2154
|
+
?
|
|
2155
|
+
{ provider: "local-docker", ...parseLocalDockerLaneEnv(singleUserTurnkey), image: process.env.DOCKER_IMAGE }
|
|
2147
2156
|
:
|
|
2148
2157
|
declaredLane === "device"
|
|
2149
2158
|
? {
|
|
@@ -2488,12 +2497,14 @@ function parseCenterBaseUrl(name, raw, role) {
|
|
|
2488
2497
|
}
|
|
2489
2498
|
function parseWebAdmin(baseUrl, requirePrincipal, liveBaseUrl, webBaseUrl) {
|
|
2490
2499
|
const worker = process.env[WEB_ADMIN_ENV.worker] || undefined;
|
|
2491
|
-
const declared =
|
|
2500
|
+
const declared = readWebAdminCredentialDeclaration("access");
|
|
2501
|
+
const assertion = credentialOriginOf(readWebAdminCredentialDeclaration("assertion"));
|
|
2492
2502
|
return {
|
|
2493
2503
|
baseUrl,
|
|
2494
2504
|
...(liveBaseUrl !== undefined ? { liveBaseUrl } : {}),
|
|
2495
2505
|
...(webBaseUrl !== undefined ? { webBaseUrl } : {}),
|
|
2496
2506
|
credential: createCenterCredentialSource(declared.from === "file" ? { ...declared, multiTenant: requirePrincipal } : declared, worker),
|
|
2507
|
+
...(assertion.from !== "absent" ? { assertionToken: assertion } : {}),
|
|
2497
2508
|
dryRun: boolEnv(WEB_ADMIN_ENV.dryRun, false),
|
|
2498
2509
|
worker,
|
|
2499
2510
|
};
|
|
@@ -58,15 +58,12 @@ export interface PathAdjudication {
|
|
|
58
58
|
* `task-settings.ts` 的 `FsWriteGateWiring.taskHome`。 */
|
|
59
59
|
readonly taskHome?: string;
|
|
60
60
|
}
|
|
61
|
-
/** [ref]([ref] 案二):durable 部署上的 AskUserQuestion 门的活体面探针(QuestionCoordinator 的切面)。 */
|
|
62
|
-
export interface LiveQuestionFace {
|
|
63
|
-
hasLiveContext(): boolean;
|
|
64
|
-
}
|
|
65
61
|
/**
|
|
66
62
|
* [ref] —— 审批基线的**席**:这条腿上「一个名单产的 `ask` 由谁来服」。闭集三形,每条腿**显式**说出自己那一形
|
|
67
63
|
* ({@link createApprovalBaselinePolicy} 的席参数必填、按 `kind` 穷举 —— 闭集 +1 = 编译红):
|
|
68
|
-
* · `durable` —— checkpoint suspend/resume 服 ask(HTTP 腿 durable 开、park 赎回腿)。
|
|
69
|
-
*
|
|
64
|
+
* · `durable` —— checkpoint suspend/resume 服 ask(HTTP 腿 durable 开、park 赎回腿)。core 的问答策略
|
|
65
|
+
* (`createDurableQuestionPolicy()`,原形逐字)**只**叠在这一形上:它对引擎的问题工具答 `ask`,落点归 core 的同步优先
|
|
66
|
+
* (有问题席 ⇒ 先投卡、席在窗内拿到答即交答;没拿到 ⇒ 停驻 —— 卡由活面呈出而窗走完的那一问除外:席抛,引擎的投递失败臂不停驻)。
|
|
70
67
|
* · `live` —— Runner 的活 onAsk 席当场服 ask(run-local 的 `createLocalApprover`:TTY 问 y/N / 无 TTY 当场拒;
|
|
71
68
|
* core `isLiveApproverSeat(onAsk)` 为真时 `suspendAsk` 早退,ask 落回调)。三张名单与 durable 席**同一只**策略。
|
|
72
69
|
* · `absent` —— 没有谁服 ask ⇒ adjudicated allow-all;**只**服务零名单(HTTP 腿「durable 关 ∧ 单用户零意图」)。
|
|
@@ -79,11 +76,9 @@ export interface LiveQuestionFace {
|
|
|
79
76
|
export type ApprovalSeat = DurableApprovalSeat | LiveApprovalSeat | AbsentApprovalSeat;
|
|
80
77
|
/** 席的形名(补偿 warn 等只需要「哪一形」的读者读它,不必铸整只席)。 */
|
|
81
78
|
export type ApprovalSeatKind = ApprovalSeat["kind"];
|
|
82
|
-
/** durable 席:checkpoint suspend/resume 服 ask
|
|
79
|
+
/** durable 席:checkpoint suspend/resume 服 ask,core 的问答策略叠在名单策略上。 */
|
|
83
80
|
export interface DurableApprovalSeat {
|
|
84
81
|
readonly kind: "durable";
|
|
85
|
-
/** 活体问答面;`undefined` ⇒ 恒 durable park 的原形门。 */
|
|
86
|
-
readonly question: LiveQuestionFace | undefined;
|
|
87
82
|
/** 本会话的「本会话放行」读面(部署名单那一问的站着的答案;铸点 `approval.ts` 的 `createSessionExemptionRead`)。缺席 = 这条腿没有会话 / 没有豁免店 ⇒ 名单照问。 */
|
|
88
83
|
readonly exemption?: SessionExemptionRead;
|
|
89
84
|
}
|
|
@@ -95,23 +90,6 @@ export interface LiveApprovalSeat {
|
|
|
95
90
|
export interface AbsentApprovalSeat {
|
|
96
91
|
readonly kind: "absent";
|
|
97
92
|
}
|
|
98
|
-
/**
|
|
99
|
-
* [ref]([ref] 案二):durable 部署上的 AskUserQuestion 门。活体面(QuestionCoordinator)缺席 ⇒ 原形
|
|
100
|
-
* `createDurableQuestionPolicy()`(恒 ask ⇒ 恒 durable park)。在场 ⇒ **判决时**按活流上下文分腿:
|
|
101
|
-
* 活流腿(bg/SSE,coordinator.runWithContext 包裹且投递面此刻可达,ALS 判)allow——工具执行落到
|
|
102
|
-
* RunnerDeps.onQuestion 的 coordinator,问正在 tail 流的活人;无活流腿(sync /v1/tasks、verify/cascade、
|
|
103
|
-
* durable resume 驱动、断连后的 detach 腿)ask——durable park 原语义逐字保留([ref] 后无活流腿放行执行
|
|
104
|
-
* 也不会产出空答:coordinator 无 ALS ctx ⇒ 冻结 `{kind:"unavailable"}`(src/question.ts),永不悬挂;
|
|
105
|
-
* park 仍是把问题送到人面前的唯一那条腿,正当性不变、只是反事实前提换了)。
|
|
106
|
-
* 「是不是引擎的问题工具」不在本层判:core 7.56.0 [ref] 起本门**组合** core 原形的答(它读调用的脸 —— 引擎挂载点 + 目录契约 id,不读名字;
|
|
107
|
-
* 它答 `ask` ⇒ 是;本层只在那之上按活流分腿)。决断口的 pre-CAS 守卫(「批准问答必须带答」)仍按保留名读(core 同版「Not changed here」那一条)。
|
|
108
|
-
* ⚠️ **单一属主**(复审 A2):AskUserQuestion 的 durable 判决只有这一处。任何需要「同参重建」这条判决的
|
|
109
|
-
* 地方(main.ts 的 parkedReviveInheritedGate 父约束链)必须调本工厂,不得自折 core 原形——两份拷贝里
|
|
110
|
-
* 只改一份正是本条 finding 的成因。**登记豁免一处**:leader worker 腿(src/leader/wire.ts provisionWorker)
|
|
111
|
-
* 自折 core 原形——该腿无活体问答面可装且 leader 不 import boot 层(分层),core 原形+sentinel 即其完整
|
|
112
|
-
* 语义;豁免注在彼处互指,接活体面之日必须并回本工厂。
|
|
113
|
-
*/
|
|
114
|
-
export declare function createDurableQuestionGate(live: LiveQuestionFace | undefined): ToolPolicy;
|
|
115
93
|
/**
|
|
116
94
|
* 沙箱 lane 上**相对形**写目标的守卫补层用 env(codex 交叉复审 round1 finding 1,红先复现)。
|
|
117
95
|
*
|
|
@@ -266,8 +244,9 @@ export declare function buildApprovalGrantNotice(config: {
|
|
|
266
244
|
* `undefined`**:治理层是 tighten-only 的叠加层,没有基线可叠时它自己也产不出「门在场」这件事。
|
|
267
245
|
*
|
|
268
246
|
* 三形,按席穷举([ref],席的定义见 {@link ApprovalSeat}):
|
|
269
|
-
* · `durable` ⇒
|
|
270
|
-
* `createDurableAskPolicy` 里)。gated `ask` 由 core 变成 durable checkpoint suspend
|
|
247
|
+
* · `durable` ⇒ core 的问答策略(原形逐字,不包)+ 三张名单的审批门(deny/neverAuto/预算/本会话的豁免行全在
|
|
248
|
+
* `createDurableAskPolicy` 里)。gated `ask` 由 core 变成 durable checkpoint suspend;问题族的 `ask` 先过 core 的同步优先
|
|
249
|
+
* (问题席在窗内拿到答 ⇒ 交答;没拿到 ⇒ 停驻;活面呈出而窗走完 ⇒ 投递失败臂)—— 「有没有人」本口不预判,唯一判官是那一次投递的结局。
|
|
271
250
|
* · `live` ⇒ **同一只**三张名单审批门,不叠问答门。gated `ask` 由 core 交给 Runner 的活 onAsk 席
|
|
272
251
|
* (本口**不**做 ask→deny 映射:无人可问时的拒由那只席说,判据与文案都归它)。
|
|
273
252
|
* · `absent` ⇒ **adjudicated allow-all**(`createAllowDenyPolicy({})`):一条**在场的**、
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import { join, posix } from "node:path";
|
|
2
2
|
import { FileError, StubExecutionEnv, combinePolicies, createAllowDenyPolicy, createDurableQuestionPolicy, createSensitivePathPolicy, createTranscriptIntegrityPolicy, err, isAbsoluteForFamily, isProtectedWrite, ok, pathTargetValue, protectivePathTargetOf, } from "@sema-agent/core";
|
|
3
3
|
import { createDurableAskPolicy, hasApprovalListIntent } from "./approval.js";
|
|
4
|
-
export function createDurableQuestionGate(live) {
|
|
5
|
-
const durable = createDurableQuestionPolicy();
|
|
6
|
-
if (live === undefined)
|
|
7
|
-
return durable;
|
|
8
|
-
return {
|
|
9
|
-
async check(req) {
|
|
10
|
-
const answer = await durable.check(req);
|
|
11
|
-
if (answer.action !== "ask")
|
|
12
|
-
return answer;
|
|
13
|
-
return live.hasLiveContext() ? { action: "allow" } : answer;
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
4
|
export const SANDBOX_TREE_FAMILY = "posix";
|
|
18
5
|
function writeTargetFormOf(req) {
|
|
19
6
|
if (!isProtectedWrite(req))
|
|
@@ -125,7 +112,7 @@ export function buildApprovalGrantNotice(config) {
|
|
|
125
112
|
export function createApprovalBaselinePolicy(config, seat) {
|
|
126
113
|
switch (seat.kind) {
|
|
127
114
|
case "durable":
|
|
128
|
-
return combinePolicies(
|
|
115
|
+
return combinePolicies(createDurableQuestionPolicy(), createApprovalListPolicy(config, seat.exemption));
|
|
129
116
|
case "live":
|
|
130
117
|
return createApprovalListPolicy(config, undefined);
|
|
131
118
|
case "absent":
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* `holds` 的入参型 = 所声明轴读入形的交叉({@link DeploymentShapeInput}),所以调用方递完整 `ServiceConfig` 或只递那几键的窄形都行。
|
|
18
18
|
*
|
|
19
19
|
* ## 什么进表、什么不进
|
|
20
|
-
* 进表的是**形规则**:只由部署形事实决定的布尔(去重后
|
|
20
|
+
* 进表的是**形规则**:只由部署形事实决定的布尔(去重后 16 行;同一条规则的多个消费者读同一行,不各成一行)。
|
|
21
21
|
* 把一行与**非形事实**(锁键、合规档位、审批意图、请求身份、请求体)合取的能力判据是**消费者**,住在它自己的模块
|
|
22
22
|
* (`mcpInjectionHonored` = 锁 ∧ 合规 ∧ `!multiTenant`;`taskHooksHonored`;身份门 …),读行、不读原始键。
|
|
23
23
|
* 车道表(`execution-lane-caps.ts`)按车道词键控的布尔列(`laneIsolated` 等)是车道轴自己的事实表,不是「部署」的谓词;行读它们。
|
|
@@ -111,6 +111,14 @@ export declare const DEPLOYMENT_SHAPE_PREDICATES: Readonly<{
|
|
|
111
111
|
* 一次性迁移 M48 的输入(`plugins/store-backend.ts`:有边界 ⇒ 不改写哨兵属主)。
|
|
112
112
|
*/
|
|
113
113
|
identityBoundary: DeploymentShapePredicate<"principal" | "identity">;
|
|
114
|
+
/**
|
|
115
|
+
* 「这台部署接没接**过凭据门**的来源」的问法 —— 身份来源律 5(`identity-source.ts` 头注)在部署上的投影:配置接了的来源里有凭据门认的那一类
|
|
116
|
+
* (service 凭据,或鉴权桥 issuer —— 含中心回退;`passesCredentialGate` 那一列)。**不是** {@link DEPLOYMENT_SHAPE_PREDICATES.identityBoundary}:
|
|
117
|
+
* 那一行把 `REQUIRE_PRINCIPAL` / 只读 trace 凭据 / 直连门也算作边界(它们让主体头不再是 dev-open 的自报),本行只问「有没有一类凭据过得了门」——
|
|
118
|
+
* 三样都不过,所以只配其中之一的部署两行答案相反,这是两问,不是一问两答。没接 ⇒ 写门(问请求)对每一次请求都拒(`ALLOW_UNAUTHED_WRITES` 之外)。
|
|
119
|
+
* 读者:记忆整理阀门的启动期告警(`boot/stage-06-runners.ts`;「这台部署上 run 口对谁都开不了」)。请求面不读本行:写门问的是请求。
|
|
120
|
+
*/
|
|
121
|
+
credentialGateSource: DeploymentShapePredicate<"identity">;
|
|
114
122
|
/**
|
|
115
123
|
* 租户轴的问法。今天与 {@link DEPLOYMENT_SHAPE_PREDICATES.principalRequired} 读**同一个声明**([ref] ①:托管 / 多租 ⇔ `REQUIRE_PRINCIPAL=true`,
|
|
116
124
|
* 签发方配置是身份验签轴、不算租户证据)—— 两个问题、一根轴、一个读口;「鉴权必需」与「多租形」拆成两个声明时只改这一行的判官。
|
package/dist/deployment-shape.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { capabilitiesFor, executionLaneCaps, executionLaneOf, handsOnWorkerFilePlane, laneWiresExecutionEnv } from "./execution-lane-caps.js";
|
|
2
|
-
import { configuredIdentitySources } from "./identity-source.js";
|
|
2
|
+
import { configuredIdentitySources, passesCredentialGate } from "./identity-source.js";
|
|
3
3
|
function readPrincipalAxis(deployment) {
|
|
4
4
|
return { declared: deployment.requirePrincipal === true };
|
|
5
5
|
}
|
|
@@ -54,6 +54,7 @@ const VM_ISOLATION_RUNTIME_CLASSES = new Set(["kata", "kata-qemu", "kata-clh", "
|
|
|
54
54
|
export const DEPLOYMENT_SHAPE_PREDICATES = Object.freeze({
|
|
55
55
|
principalRequired: createPredicate(["principal"], "身份轴:运维声明了 REQUIRE_PRINCIPAL=true —— 每个调用方都必须带一个验过的主体。", ({ principal }) => principal.declared),
|
|
56
56
|
identityBoundary: createPredicate(["principal", "identity"], "身份轴:这台部署有身份边界 —— 声明了 REQUIRE_PRINCIPAL,或配置接了任一已验身份来源(service 凭据 / 鉴权桥 / 直连门),或声明了只读 trace 凭据。", ({ principal, identity }) => principal.declared || identity.sources.length > 0 || identity.traceTokenDeclared),
|
|
57
|
+
credentialGateSource: createPredicate(["identity"], "身份轴:这台部署接了一类过凭据门的来源 —— service 凭据,或鉴权桥(登录令牌);只开 REQUIRE_PRINCIPAL / 只配 trace 凭据 / 只开直连门都不算。", ({ identity }) => identity.sources.some(passesCredentialGate)),
|
|
57
58
|
multiTenant: createPredicate(["principal"], "租户轴:这台部署服务不止一个主人(托管 / 多租;C-R100 ① 由 REQUIRE_PRINCIPAL=true 声明)。", ({ principal }) => principal.declared),
|
|
58
59
|
callerCwd: createPredicate(["lane", "principal"], "车道 × 租户 / 设备归属:调用方送来的 cwd(与 settings.env)被尊重 —— host 车道且单主,或 device 车道。", ({ lane, principal }) => lane.caps !== undefined && capabilityHolds(lane.caps.callerCwd, principal)),
|
|
59
60
|
callerOwnsWorkerDisk: createPredicate(["lane", "principal"], "车道 × 租户:手就在本 worker 的盘上且部署只有一个主人 —— 这块盘上的路径就是调用方自己的。", ({ lane, principal }) => lane.lane !== undefined && handsOnWorkerFilePlane(lane.lane) && !principal.declared),
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
*
|
|
8
8
|
* 为什么是精选而不是把 `device-ws-protocol.ts` 整只暴露:那个模块里还有**服务端**自己的半场(帧解析与准入、
|
|
9
9
|
* 验签、各种铸 id)。把它们变成公开面,等于替实现细节背上 semver。这里只再导出 executor **会用到**的:
|
|
10
|
-
*
|
|
11
|
-
* (`DEVICE_OUTCOME_ERROR_CODES_BY_REVISION` + 取集函数 `deviceOutcomeErrorCodesAt`:executor 按自己声明的修订号裁剪会发的词)
|
|
10
|
+
* 闭集常量、两向帧型、构造握手签名字节所需的两只纯函数,以及三份「随协议修订号走」的事实:结局码按修订号分行的增量表
|
|
11
|
+
* (`DEVICE_OUTCOME_ERROR_CODES_BY_REVISION` + 取集函数 `deviceOutcomeErrorCodesAt`:executor 按自己声明的修订号裁剪会发的词)、指令 kind 按修订号分行的增量表
|
|
12
|
+
* (`DEVICE_INSTRUCTION_KINDS_BY_REVISION` + 取集函数 `deviceInstructionKindsAt`:executor 按自己声明的修订号裁剪 `hello.supports` —— 高于它的 kind 声明了也不会下发)与
|
|
12
13
|
* helloAck 数值位的界表(`DEVICE_HELLO_ACK_BOUNDS` + 判据 `deviceHelloAckNumberFlaw`:executor 读到越界值 ⇒ 协议违例)。要加名字 = 改这只文件 + 同批改
|
|
13
14
|
* `test/device-protocol-subpath.test.ts` 的闭集(新增公开面必须是一次有意的动作)。
|
|
14
15
|
*/
|
|
15
|
-
export { DEVICE_WS_PATH, DEVICE_PROTOCOL_VERSION, DEVICE_MIN_PROTOCOL_VERSION, DEVICE_HELLO_DOMAIN_TAG, DEVICE_WS_LIMITS, DEVICE_FRAME_TYPES, DEVICE_SERVER_FRAME_TYPES, DEVICE_HELLO_REJECT_CODES, DEVICE_BYE_REASONS, DEVICE_GOODBYE_REASONS, DEVICE_CHUNK_KINDS, DEVICE_CANCEL_STATES, DEVICE_INSTRUCTION_KINDS, DEVICE_OUTCOME_ERROR_CODES, DEVICE_OUTCOME_ERROR_CODES_BY_REVISION, DEVICE_HELLO_ACK_BOUNDS, buildHelloSignaturePayload, decodeUlid16, deviceOutcomeErrorCodesAt, deviceHelloAckNumberFlaw, } from "./device-ws-protocol.js";
|
|
16
|
-
export type { DeviceFrameType, DeviceServerFrameType, DeviceHelloRejectCode, DeviceByeReason, DeviceGoodbyeReason, DeviceChunkKind, DeviceCancelState, DeviceInstructionKind, DeviceOutcomeErrorCode, DeviceProtocolRevision, DeviceHelloAckNumericField, WireFileInfo, WireWriteExpectation, DeviceInstructionOutcome, DeviceInstructionArgsByKind, DeviceChallengeFrame, DeviceHelloAckFrame, DeviceHelloRejectFrame, DeviceInstructionFrame, DevicePayloadFrame, DeviceServerFrame, DeviceHelloFrame, DeviceFrame, DeviceResultFrame, DeviceChunkFrame, DeviceGoodbyeFrame, DeviceHeartbeatFrame, } from "./device-ws-protocol.js";
|
|
16
|
+
export { DEVICE_WS_PATH, DEVICE_PROTOCOL_VERSION, DEVICE_MIN_PROTOCOL_VERSION, DEVICE_HELLO_DOMAIN_TAG, DEVICE_WS_LIMITS, DEVICE_FRAME_TYPES, DEVICE_SERVER_FRAME_TYPES, DEVICE_HELLO_REJECT_CODES, DEVICE_BYE_REASONS, DEVICE_GOODBYE_REASONS, DEVICE_CHUNK_KINDS, DEVICE_CANCEL_STATES, DEVICE_INSTRUCTION_KINDS, DEVICE_INSTRUCTION_KINDS_BY_REVISION, DEVICE_BOUND_READ_OPS, DEVICE_OUTCOME_ERROR_CODES, DEVICE_OUTCOME_ERROR_CODES_BY_REVISION, DEVICE_HELLO_ACK_BOUNDS, buildHelloSignaturePayload, decodeUlid16, deviceOutcomeErrorCodesAt, deviceInstructionKindsAt, deviceHelloAckNumberFlaw, } from "./device-ws-protocol.js";
|
|
17
|
+
export type { DeviceFrameType, DeviceServerFrameType, DeviceHelloRejectCode, DeviceByeReason, DeviceGoodbyeReason, DeviceChunkKind, DeviceCancelState, DeviceInstructionKind, DeviceBoundReadOp, DeviceOutcomeErrorCode, DeviceProtocolRevision, DeviceHelloAckNumericField, WireFileInfo, WireWriteExpectation, DeviceInstructionOutcome, DeviceInstructionArgsByKind, DeviceChallengeFrame, DeviceHelloAckFrame, DeviceHelloRejectFrame, DeviceInstructionFrame, DevicePayloadFrame, DeviceServerFrame, DeviceHelloFrame, DeviceFrame, DeviceResultFrame, DeviceChunkFrame, DeviceGoodbyeFrame, DeviceHeartbeatFrame, } from "./device-ws-protocol.js";
|
|
17
18
|
//# sourceMappingURL=device-protocol.d.ts.map
|
package/dist/device-protocol.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DEVICE_WS_PATH, DEVICE_PROTOCOL_VERSION, DEVICE_MIN_PROTOCOL_VERSION, DEVICE_HELLO_DOMAIN_TAG, DEVICE_WS_LIMITS, DEVICE_FRAME_TYPES, DEVICE_SERVER_FRAME_TYPES, DEVICE_HELLO_REJECT_CODES, DEVICE_BYE_REASONS, DEVICE_GOODBYE_REASONS, DEVICE_CHUNK_KINDS, DEVICE_CANCEL_STATES, DEVICE_INSTRUCTION_KINDS, DEVICE_OUTCOME_ERROR_CODES, DEVICE_OUTCOME_ERROR_CODES_BY_REVISION, DEVICE_HELLO_ACK_BOUNDS, buildHelloSignaturePayload, decodeUlid16, deviceOutcomeErrorCodesAt, deviceHelloAckNumberFlaw, } from "./device-ws-protocol.js";
|
|
1
|
+
export { DEVICE_WS_PATH, DEVICE_PROTOCOL_VERSION, DEVICE_MIN_PROTOCOL_VERSION, DEVICE_HELLO_DOMAIN_TAG, DEVICE_WS_LIMITS, DEVICE_FRAME_TYPES, DEVICE_SERVER_FRAME_TYPES, DEVICE_HELLO_REJECT_CODES, DEVICE_BYE_REASONS, DEVICE_GOODBYE_REASONS, DEVICE_CHUNK_KINDS, DEVICE_CANCEL_STATES, DEVICE_INSTRUCTION_KINDS, DEVICE_INSTRUCTION_KINDS_BY_REVISION, DEVICE_BOUND_READ_OPS, DEVICE_OUTCOME_ERROR_CODES, DEVICE_OUTCOME_ERROR_CODES_BY_REVISION, DEVICE_HELLO_ACK_BOUNDS, buildHelloSignaturePayload, decodeUlid16, deviceOutcomeErrorCodesAt, deviceInstructionKindsAt, deviceHelloAckNumberFlaw, } from "./device-ws-protocol.js";
|
|
2
2
|
//# sourceMappingURL=device-protocol.js.map
|
package/dist/device-ws-hub.d.ts
CHANGED
|
@@ -209,6 +209,7 @@ export interface DeviceWsHub {
|
|
|
209
209
|
declaredSupports(deviceId: string): ReadonlySet<DeviceInstructionKind> | undefined;
|
|
210
210
|
close(): Promise<void>;
|
|
211
211
|
}
|
|
212
|
+
export declare const DEVICE_MAX_PAYLOAD_PART_BYTES: number;
|
|
212
213
|
/** per-remote 帽键的来源(闭集;指标 `device_preauth_key_total{source}` 与 cap-hit 行 `keySource` 同一张表)。 */
|
|
213
214
|
export declare const DEVICE_PREAUTH_KEY_SOURCES: readonly ["socket", "xff", "fallback"];
|
|
214
215
|
export type DevicePreAuthKeySource = (typeof DEVICE_PREAUTH_KEY_SOURCES)[number];
|