@sema-agent/server 7.150.0 → 7.152.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 +451 -0
- package/README.md +15 -3
- package/README.zh-CN.md +10 -2
- package/USAGE.md +144 -87
- package/deploy/sema-up/README.md +11 -4
- 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 +7 -6
- package/deploy/sema-up/kube-up.sh +6 -6
- package/deploy/sema-up/lib/flagshape.sh +36 -8
- package/deploy/sema-up/lib/helm-values-cluster.py +2 -0
- package/deploy/sema-up/lib/helm-values-kube.py +2 -0
- package/deploy/sema-up/machines.example.yaml +3 -1
- package/deploy/sema-up/sema-up.sh +22 -16
- package/dist/adoption/import.js +3 -3
- package/dist/approval-ask-audit-store.d.ts +1 -1
- package/dist/approval-ask-machine.d.ts +4 -10
- package/dist/approval-ask-retention.d.ts +1 -1
- package/dist/approval-card.d.ts +12 -14
- package/dist/approval-gate-currency.d.ts +9 -9
- package/dist/approval-gate-currency.js +3 -4
- package/dist/approval-hmac.d.ts +17 -1
- package/dist/approval-hmac.js +7 -1
- package/dist/approval-queue-kind.d.ts +1 -1
- package/dist/approval.d.ts +2 -2
- package/dist/approval.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 +1 -1
- package/dist/bake-runner/main.d.ts +4 -2
- package/dist/bind-host.d.ts +3 -6
- package/dist/bind-host.js +4 -7
- package/dist/boot/budget-tracing.js +1 -1
- package/dist/boot/coordinators.d.ts +1 -1
- package/dist/boot/coordinators.js +9 -10
- package/dist/boot/device-lane.js +2 -0
- package/dist/boot/engine-lease.d.ts +5 -0
- package/dist/boot/engine-lease.js +1 -0
- package/dist/boot/execution-env.d.ts +9 -14
- package/dist/boot/execution-env.js +85 -22
- 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/leader.d.ts +31 -30
- package/dist/boot/leader.js +38 -28
- package/dist/boot/leg-path-adjudication.d.ts +40 -0
- package/dist/boot/leg-path-adjudication.js +18 -0
- package/dist/boot/memory-consolidation.d.ts +3 -2
- package/dist/boot/memory-consolidation.js +6 -6
- package/dist/boot/parked-revive-gate.js +3 -15
- package/dist/boot/reapers.d.ts +6 -1
- package/dist/boot/reapers.js +13 -2
- package/dist/boot/resolve-spec.d.ts +3 -3
- package/dist/boot/resolve-spec.js +43 -48
- package/dist/boot/runner-deps.d.ts +46 -35
- package/dist/boot/runner-deps.js +94 -91
- 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 +9 -5
- package/dist/boot/shutdown.d.ts +6 -0
- package/dist/boot/shutdown.js +10 -4
- package/dist/boot/stage-01-config.js +2 -0
- package/dist/boot/stage-02-web-admin-pull.js +4 -5
- package/dist/boot/stage-05-execution-env.d.ts +5 -3
- package/dist/boot/stage-05-execution-env.js +3 -2
- package/dist/boot/stage-06-runners.d.ts +9 -4
- package/dist/boot/stage-06-runners.js +24 -9
- package/dist/boot/stage-07-capability-layer.d.ts +8 -4
- package/dist/boot/stage-07-capability-layer.js +3 -2
- package/dist/boot/stage-08-reapers.d.ts +8 -4
- package/dist/boot/stage-08-reapers.js +4 -2
- package/dist/boot/stage-09-leader.d.ts +12 -5
- package/dist/boot/stage-09-leader.js +14 -5
- package/dist/boot/stage-10-http-server.d.ts +19 -5
- package/dist/boot/stage-10-http-server.js +14 -21
- package/dist/boot/stores.js +7 -4
- package/dist/boot/web-admin.js +5 -8
- 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/capabilities/approvals-push.d.ts +3 -3
- package/dist/capabilities/scenarios.d.ts +28 -13
- package/dist/capabilities/scenarios.js +2 -2
- package/dist/capability-facts.d.ts +43 -32
- package/dist/capability-facts.js +45 -51
- package/dist/card-rule-offers.d.ts +32 -0
- package/dist/card-rule-offers.js +130 -0
- 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 +26 -22
- package/dist/config-dir-trust.js +4 -2
- package/dist/config-invariants.d.ts +20 -8
- package/dist/config-invariants.js +55 -12
- package/dist/config-lkg.d.ts +5 -19
- package/dist/config-lkg.js +8 -62
- package/dist/config-provider.d.ts +1 -1
- package/dist/config-root-migration.d.ts +2 -2
- package/dist/config-types.d.ts +38 -42
- package/dist/config.d.ts +58 -7
- package/dist/config.js +90 -40
- package/dist/control-socket.d.ts +51 -0
- package/dist/control-socket.js +115 -0
- package/dist/deployment-governance.d.ts +2 -1
- 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 +7 -0
- package/dist/device-ws-hub.js +10 -3
- package/dist/device-ws-protocol.d.ts +63 -10
- package/dist/device-ws-protocol.js +56 -25
- package/dist/elicitation.js +2 -2
- package/dist/engine-identity.d.ts +19 -7
- package/dist/engine-identity.js +10 -2
- package/dist/entry-mode-clamp-notice.d.ts +2 -1
- package/dist/entry-problems.d.ts +40 -3
- package/dist/entry-problems.js +3 -1
- package/dist/execution-env-refusal.d.ts +29 -0
- package/dist/execution-env-refusal.js +8 -0
- package/dist/execution-lane-caps.d.ts +3 -1
- package/dist/field-conflict.d.ts +1 -1
- 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 +12 -29
- package/dist/fleet/engine-signal.js +1 -7
- package/dist/fleet-client.js +2 -5
- package/dist/gate-settlement.d.ts +1 -8
- package/dist/gate-settlement.js +0 -4
- package/dist/history-anchor.js +1 -1
- package/dist/hitl-delivery.d.ts +2 -3
- package/dist/hitl-delivery.js +0 -2
- package/dist/hooks/hook-llm.js +4 -2
- package/dist/hooks/hook-runner.d.ts +3 -2
- package/dist/hooks/hook-runner.js +18 -3
- package/dist/host-decision.d.ts +11 -11
- package/dist/host-lsp-manager.d.ts +2 -2
- package/dist/http/active-run-conflict.d.ts +35 -2
- package/dist/http/active-run-conflict.js +48 -19
- package/dist/http/admission.js +17 -2
- package/dist/http/approval-sweeps.d.ts +1 -1
- package/dist/http/approval-sweeps.js +10 -7
- package/dist/http/checkpoint-ctx.d.ts +4 -0
- package/dist/http/checkpoint-ctx.js +2 -0
- package/dist/http/dispatch.d.ts +8 -3
- package/dist/http/dispatch.js +59 -32
- package/dist/http/durable-run-leg.js +16 -17
- package/dist/http/health-reader.d.ts +16 -9
- package/dist/http/health-reader.js +2 -1
- package/dist/http/health-self-report.d.ts +9 -1
- package/dist/http/health-self-report.js +3 -1
- package/dist/http/owner-access.d.ts +33 -14
- package/dist/http/owner-access.js +40 -10
- package/dist/http/principal-gate.d.ts +49 -21
- package/dist/http/principal-gate.js +61 -11
- package/dist/http/request-channel.d.ts +23 -0
- package/dist/http/request-channel.js +9 -0
- package/dist/http/request-guards.js +17 -2
- package/dist/http/resume-ctx-read.js +42 -3
- package/dist/http/resume-legs.d.ts +4 -3
- package/dist/http/resume-legs.js +367 -117
- package/dist/http/route-ctx.d.ts +91 -15
- package/dist/http/route-ctx.js +17 -0
- package/dist/http/route-table.d.ts +5 -1
- package/dist/http/route-table.js +4 -0
- package/dist/http/routes/admin-config-refresh.js +3 -3
- package/dist/http/routes/admin-drain.d.ts +3 -0
- package/dist/http/routes/admin-drain.js +7 -7
- package/dist/http/routes/admin-memory-optout.d.ts +1 -1
- package/dist/http/routes/admin-memory-optout.js +3 -3
- package/dist/http/routes/adoption.js +3 -5
- package/dist/http/routes/agents-roster.js +2 -3
- package/dist/http/routes/approvals-assistant.d.ts +2 -1
- package/dist/http/routes/approvals-assistant.js +99 -51
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/capabilities.d.ts +4 -0
- package/dist/http/routes/capabilities.js +38 -10
- package/dist/http/routes/config-catalog.js +2 -2
- package/dist/http/routes/devices.js +1 -1
- package/dist/http/routes/diagnostics.d.ts +3 -3
- package/dist/http/routes/diagnostics.js +19 -7
- package/dist/http/routes/fleet.js +10 -8
- package/dist/http/routes/images.js +10 -10
- package/dist/http/routes/memory-bundle.js +3 -3
- package/dist/http/routes/memory-compliance.js +3 -3
- package/dist/http/routes/memory-consolidation.js +2 -2
- package/dist/http/routes/memory-origin.js +3 -3
- package/dist/http/routes/memory-policy.js +2 -2
- package/dist/http/routes/observability.js +3 -3
- package/dist/http/routes/projects.d.ts +3 -2
- package/dist/http/routes/projects.js +4 -5
- package/dist/http/routes/retention-ops.js +3 -3
- package/dist/http/routes/rules.js +5 -5
- package/dist/http/routes/run-permission-mode.d.ts +2 -1
- package/dist/http/routes/run-permission-mode.js +2 -2
- package/dist/http/routes/runs.d.ts +4 -9
- package/dist/http/routes/runs.js +171 -65
- package/dist/http/routes/session-sync.d.ts +22 -9
- package/dist/http/routes/session-sync.js +204 -107
- package/dist/http/routes/sessions-list.js +13 -7
- package/dist/http/routes/sessions.js +30 -15
- package/dist/http/routes/tasks.js +46 -41
- package/dist/http/routes/trace-usage.js +2 -2
- package/dist/http/routes/workflows.js +1 -1
- package/dist/http/server.d.ts +30 -30
- package/dist/http/server.js +16 -4
- package/dist/http/submit-ctx.d.ts +1 -1
- package/dist/http/submit-ctx.js +7 -4
- package/dist/http/wire-types.d.ts +14 -4
- package/dist/human-facing-args.d.ts +33 -0
- package/dist/human-facing-args.js +33 -0
- package/dist/identity-source.d.ts +20 -3
- package/dist/identity-source.js +14 -0
- package/dist/index.d.ts +5 -1
- package/dist/k8s-api-credentials.d.ts +29 -0
- package/dist/k8s-api-credentials.js +25 -0
- package/dist/lane-home-probe.d.ts +3 -7
- package/dist/lane-home-probe.js +2 -2
- package/dist/leader/diffup.d.ts +19 -0
- package/dist/leader/diffup.js +7 -0
- package/dist/leader/leader.d.ts +116 -11
- package/dist/leader/leader.js +69 -5
- package/dist/leader/repair-wire.js +2 -2
- package/dist/leader/run-entry.d.ts +2 -1
- package/dist/leader/run-entry.js +1 -1
- package/dist/leader/wire.d.ts +42 -132
- package/dist/leader/wire.js +81 -67
- package/dist/leg-facts.d.ts +13 -5
- package/dist/leg-facts.js +2 -1
- package/dist/memory-scope.d.ts +23 -11
- package/dist/memory-scope.js +18 -6
- package/dist/memory-sync-client.d.ts +30 -2
- package/dist/memory-sync-client.js +16 -9
- package/dist/model-entry-headers.d.ts +9 -10
- package/dist/model-entry-headers.js +0 -4
- package/dist/model-entry-refusal.d.ts +7 -4
- package/dist/model-entry-refusal.js +11 -5
- package/dist/model-plane-face.d.ts +1 -1
- package/dist/model-plane-face.js +3 -1
- package/dist/model-route-endpoint.d.ts +13 -7
- package/dist/model-route-endpoint.js +14 -11
- package/dist/model-select.d.ts +22 -0
- package/dist/model-select.js +9 -0
- package/dist/model-unreachable-notice.d.ts +11 -0
- package/dist/model-unreachable-notice.js +4 -4
- package/dist/object-store-buckets.d.ts +640 -6
- package/dist/object-store-buckets.js +166 -0
- package/dist/observability/err-text.d.ts +7 -0
- package/dist/observability/err-text.js +5 -0
- package/dist/observability/fail-open.d.ts +25 -17
- package/dist/observability/fail-open.js +25 -17
- package/dist/observability/logger.js +3 -1
- package/dist/observability/metrics.js +1 -0
- package/dist/operator-roster.d.ts +68 -0
- package/dist/operator-roster.js +32 -0
- 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/outbound-dispatcher.d.ts +71 -8
- package/dist/outbound-dispatcher.js +48 -7
- package/dist/owner-faces.d.ts +2 -2
- package/dist/parked-decide.d.ts +106 -55
- 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/permission-mode-admission.d.ts +74 -5
- package/dist/permission-mode-admission.js +56 -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 +14 -2
- package/dist/plugins/approval-ask-store-file.js +11 -0
- package/dist/plugins/approval-ask-store-memory.d.ts +10 -1
- package/dist/plugins/approval-ask-store-memory.js +35 -10
- package/dist/plugins/approval-ask-store-sql.d.ts +69 -4
- package/dist/plugins/approval-ask-store-sql.js +45 -5
- package/dist/plugins/approval-exemption-store.js +3 -0
- package/dist/plugins/approval-nonce-store.js +2 -0
- package/dist/plugins/blob-backend.d.ts +83 -7
- package/dist/plugins/blob-backend.js +57 -6
- 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/checkpoint-index-columns.d.ts +20 -16
- package/dist/plugins/checkpoint-index-columns.js +3 -6
- package/dist/plugins/checkpoint-store-face.d.ts +119 -61
- package/dist/plugins/checkpoint-store-face.js +134 -55
- 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/execution-placement-sql.js +6 -6
- 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 +13 -3
- package/dist/plugins/local-checkpoint-store.js +38 -49
- 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-sync-store-pg.js +5 -0
- package/dist/plugins/memory-sync-store-tidb.js +5 -0
- package/dist/plugins/one-time-migrations.d.ts +104 -80
- package/dist/plugins/one-time-migrations.js +226 -132
- 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 +35 -10
- 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 +4 -1
- package/dist/plugins/remote-env-adb.d.ts +19 -15
- package/dist/plugins/remote-env-adb.js +41 -15
- 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 +106 -8
- package/dist/plugins/remote-env-e2b.d.ts +15 -6
- package/dist/plugins/remote-env-e2b.js +42 -32
- package/dist/plugins/remote-env-file-error.js +6 -2
- package/dist/plugins/remote-env-host.d.ts +46 -10
- package/dist/plugins/remote-env-host.js +124 -52
- package/dist/plugins/remote-env-k8s.d.ts +109 -41
- package/dist/plugins/remote-env-k8s.js +160 -54
- package/dist/plugins/remote-env-local-docker.d.ts +13 -8
- package/dist/plugins/remote-env-local-docker.js +34 -41
- package/dist/plugins/remote-env-ssh.d.ts +18 -12
- package/dist/plugins/remote-env-ssh.js +60 -59
- package/dist/plugins/remote-shell.d.ts +98 -1
- package/dist/plugins/remote-shell.js +218 -0
- package/dist/plugins/replica-registration.d.ts +1 -1
- package/dist/plugins/replica-registration.js +1 -1
- 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.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 +21 -2
- package/dist/plugins/run-store-sql.js +31 -7
- package/dist/plugins/s3-presign.d.ts +23 -0
- package/dist/plugins/s3-presign.js +37 -3
- package/dist/plugins/scenario-prefix-switch-m42.d.ts +1 -1
- package/dist/plugins/scenario-prefix-switch-m42.js +2 -2
- package/dist/plugins/scheduler-support.d.ts +2 -2
- package/dist/plugins/scheduler-support.js +0 -3
- package/dist/plugins/schema-consistency.d.ts +4 -2
- package/dist/plugins/schema-consistency.js +19 -2
- package/dist/plugins/schema-indexes.js +2 -0
- package/dist/plugins/send-file-ledger.d.ts +2 -2
- package/dist/plugins/send-file-ledger.js +5 -2
- package/dist/plugins/send-user-file.d.ts +3 -4
- package/dist/plugins/send-user-file.js +56 -52
- package/dist/plugins/serving-requirement.d.ts +26 -7
- package/dist/plugins/serving-requirement.js +11 -4
- package/dist/plugins/session-birth.d.ts +6 -2
- package/dist/plugins/session-blob-claim-token.d.ts +15 -0
- package/dist/plugins/session-blob-claim-token.js +20 -0
- package/dist/plugins/session-blob-namespace.d.ts +46 -0
- package/dist/plugins/session-blob-namespace.js +116 -0
- 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/snapshot-bucket-presence.d.ts +25 -2
- package/dist/plugins/snapshot-bucket-presence.js +8 -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/sql-json-column.d.ts +1 -1
- package/dist/plugins/stop-then-start-sentence.d.ts +10 -4
- package/dist/plugins/stop-then-start-sentence.js +14 -10
- 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 +84 -15
- package/dist/plugins/store-backend.js +236 -72
- package/dist/plugins/store-boundary.d.ts +57 -0
- package/dist/plugins/store-boundary.js +139 -0
- package/dist/plugins/store-contracts.d.ts +17 -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.d.ts +2 -1
- package/dist/plugins/task-attachment-store.js +14 -1
- 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 +21 -25
- 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-custody.d.ts +4 -3
- 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/project-context.d.ts +0 -2
- package/dist/project-context.js +4 -8
- package/dist/project-registry.d.ts +46 -0
- package/dist/project-registry.js +44 -0
- package/dist/question.d.ts +2 -1
- package/dist/question.js +5 -13
- package/dist/request-form.d.ts +6 -1
- package/dist/request-form.js +4 -1
- 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/rule-issue-reading.d.ts +1 -1
- package/dist/rules-consent.d.ts +1 -1
- package/dist/run-acceptance.d.ts +3 -2
- package/dist/run-acceptance.js +4 -6
- package/dist/run-local.js +9 -9
- package/dist/runs.d.ts +54 -16
- package/dist/runs.js +67 -13
- package/dist/runtime-governance.d.ts +5 -4
- package/dist/security.d.ts +30 -32
- package/dist/security.js +41 -7
- package/dist/sema-config-dir.d.ts +2 -1
- package/dist/server-secret-env.d.ts +12 -10
- package/dist/server-secret-env.js +24 -15
- 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 +10 -0
- package/dist/session-incarnation.js +10 -1
- package/dist/session-kind.d.ts +57 -0
- package/dist/session-kind.js +22 -0
- package/dist/session-row.d.ts +21 -1
- package/dist/session-row.js +7 -1
- package/dist/session-sync-kernel.d.ts +24 -14
- package/dist/session-sync-kernel.js +3 -6
- package/dist/session-sync.d.ts +25 -103
- package/dist/session-sync.js +14 -76
- 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/blob-index-sql.d.ts +30 -9
- package/dist/stores-sql/blob-index-sql.js +40 -21
- package/dist/stores-sql/checkpoint-store-sql.d.ts +54 -27
- package/dist/stores-sql/checkpoint-store-sql.js +70 -146
- package/dist/stores-sql/file-history-store-sql.d.ts +113 -15
- package/dist/stores-sql/file-history-store-sql.js +205 -95
- 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 +1 -9
- package/dist/stores-sql/retention-store-sql.js +5 -19
- 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 +2 -2
- package/dist/task-settings.d.ts +7 -5
- package/dist/task-settings.js +3 -3
- package/dist/terminal.d.ts +33 -2
- package/dist/terminal.js +139 -9
- package/dist/tool-approval.d.ts +465 -507
- package/dist/tool-approval.js +606 -1222
- package/dist/trace/core-keyset-guard.d.ts +1 -1
- package/dist/trace/ledger-events.d.ts +3 -3
- package/dist/trace/project.d.ts +2 -3
- package/dist/trace/redact.js +3 -2
- package/dist/trace/self-minted-wire.d.ts +571 -178
- package/dist/trace/self-minted-wire.js +189 -56
- package/dist/web-admin-client/apply-effective.js +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +2 -2
- package/dist/web-admin-client/read-warnings.js +1 -1
- package/dist/web-admin-client/types.d.ts +1 -1
- package/dist/workspace-space.d.ts +10 -4
- package/dist/workspace-space.js +4 -1
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +79 -28
- package/package.json +7 -3
- package/scripts/embed-minimal.mjs +3 -3
- package/wire-changes/server@7.151.0.json +762 -0
- package/wire-changes/server@7.152.0.json +900 -0
- package/dist/config-d-migration.d.ts +0 -37
- package/dist/config-d-migration.js +0 -60
- package/dist/http/session-inherit-env.d.ts +0 -36
- package/dist/http/session-inherit-env.js +0 -6
package/dist/capability-facts.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assembleFileHistory } from "./file-history-capture.js";
|
|
1
2
|
import { buildOperatorRosterWayOut, operatorRosterPresent } from "./http/principal-gate.js";
|
|
2
3
|
import { mcpInjectionHonored } from "./task-mcp.js";
|
|
3
4
|
import { DEPLOYMENT_SHAPE_PREDICATES } from "./deployment-shape.js";
|
|
@@ -5,8 +6,11 @@ import { presentedApprovalFrameFamily, resolveStreamApprovalGate } from "./tool-
|
|
|
5
6
|
import { selfOrchestrationDenial } from "./task-workflow.js";
|
|
6
7
|
import { centerEntitlementSourceWired } from "./runtime-caps-resolver.js";
|
|
7
8
|
import { WEB_ADMIN_ENV } from "@sema-agent/settings-schema";
|
|
8
|
-
import {
|
|
9
|
+
import { landingBlobFacesOf } from "./session-sync.js";
|
|
10
|
+
import { overwriteWipeIncapable } from "./plugins/landed-attendants.js";
|
|
9
11
|
import { WORKSPACE_PERSIST_DEFAULT, WORKSPACE_SNAPSHOT_KEEP_DEFAULT, workspaceSnapshotTimeoutOf } from "./workspace-space.js";
|
|
12
|
+
import { sessionKindFaceOf } from "./session-kind.js";
|
|
13
|
+
import { birthFaceOf } from "./plugins/session-birth.js";
|
|
10
14
|
import { headReadPresent } from "./session-incarnation.js";
|
|
11
15
|
import { laneWiresExecutionEnv } from "./execution-lane-caps.js";
|
|
12
16
|
export const CAPABILITY_FACT_WHY = {
|
|
@@ -23,7 +27,7 @@ export const CAPABILITY_FACT_WHY = {
|
|
|
23
27
|
session_fork_face_absent: "the session store has no fork face",
|
|
24
28
|
session_row_faces_absent: "the session store has no session-row faces (headOf / sessionSummaryOf / writeSessionRowCells)",
|
|
25
29
|
session_purge_absent: "no session purge coordinator is wired",
|
|
26
|
-
|
|
30
|
+
session_kind_faces_absent: "the session store cannot record a session kind (it needs the birth receipt face that takes a kind, sessionKindOf, listSessions and listIdleOfKind) or no session purge coordinator is wired to age such sessions out",
|
|
27
31
|
store_backend_absent: "no store backend is wired (DB_BACKEND=memory, multi-tenant bare boot, or half-configured SQL)",
|
|
28
32
|
file_history_store_absent: "no file-history store is wired",
|
|
29
33
|
resume_anchor_store_absent: "no rewind anchor map is wired (the handle → session-entry map a rewind target is read through, with the run store an unknown handle is checked against — both come from the store backend)",
|
|
@@ -34,7 +38,7 @@ export const CAPABILITY_FACT_WHY = {
|
|
|
34
38
|
session_export_absent: "the session store has no entry export faces (exportEntries / exportEntriesStream)",
|
|
35
39
|
session_import_staging_absent: "the session store has no staged-import face (beginImportStaging)",
|
|
36
40
|
policy_purge_absent: "the session policy store has no deleteBySession purge verb",
|
|
37
|
-
blob_exchange_absent: "the file-history store carries no blob exchange
|
|
41
|
+
blob_exchange_absent: "the file-history store carries no complete blob face (the blob exchange FileHistoryStore.blobExchange together with the per-landing provenance face blobLanding — SQL backends only)",
|
|
38
42
|
device_hub_absent: "the device lane hub is not wired",
|
|
39
43
|
device_store_absent: "the device store is not wired",
|
|
40
44
|
device_enrollment_absent: "device enrollment is not wired",
|
|
@@ -45,7 +49,7 @@ export const CAPABILITY_FACT_WHY = {
|
|
|
45
49
|
shared_memory_store_absent: "no shared memory store provider is wired",
|
|
46
50
|
org_memory_directory_absent: "no org memory directory (membership fold) is wired",
|
|
47
51
|
org_delivery_gate_absent: "no organization delivery gate is mounted (PRINCIPAL_INBOX_ASSISTANT is unset: the deployment declares no principal-inbox consumer)",
|
|
48
|
-
operator_principals_empty: `no operator roster (OPERATOR_PRINCIPALS is empty and OPERATOR_SINGLE_USER is not declared), so no caller can ever be an operator; ${buildOperatorRosterWayOut()}`,
|
|
52
|
+
operator_principals_empty: `no operator roster (OPERATOR_PRINCIPALS is empty and OPERATOR_SINGLE_USER is not declared), so no caller can ever be an operator; ${buildOperatorRosterWayOut("operate")}`,
|
|
49
53
|
adoption_store_absent: "no adoption log store is wired (SQL backends only)",
|
|
50
54
|
memory_bundle_faces_absent: "the memory engine's governance bundle faces are not wired",
|
|
51
55
|
memory_compliance_faces_absent: "the memory engine's provenance/erasure faces are not wired",
|
|
@@ -63,8 +67,7 @@ export const CAPABILITY_FACT_WHY = {
|
|
|
63
67
|
a2a_serve_off: "A2A_SERVE_ENABLED is off",
|
|
64
68
|
elicitation_disabled: "inbound MCP elicitation is off (MCP_ELICITATION_ENABLED)",
|
|
65
69
|
ask_question_disabled: "AskUserQuestion live HITL is off (ASK_QUESTION_ENABLED)",
|
|
66
|
-
tool_approval_disabled: "
|
|
67
|
-
stream_approval_disabled: "the stream approval protocol is off (STREAM_APPROVAL_ENABLED)",
|
|
70
|
+
tool_approval_disabled: "this worker presents no approval cards (needs TOOL_APPROVAL_ENABLED, a store backend (DB_BACKEND) and DURABLE_APPROVAL)",
|
|
68
71
|
read_root_grant_posture_refused: "this is not a single-user host-lane deployment (REMOTE_EXEC=host without REQUIRE_PRINCIPAL), the only posture that honors a read-directory grant",
|
|
69
72
|
background_agent_store_absent: "no background-agent store is wired",
|
|
70
73
|
sendfile_ledger_absent: "no SendUserFile ledger is wired",
|
|
@@ -156,6 +159,12 @@ export function sessionList(d) {
|
|
|
156
159
|
const lister = d.sessionStorage?.listSessions?.bind(d.sessionStorage);
|
|
157
160
|
return lister !== undefined ? yes({ lister }) : no("session_lister_absent");
|
|
158
161
|
}
|
|
162
|
+
export function sessionKinds(d) {
|
|
163
|
+
const s = d.sessionStorage;
|
|
164
|
+
return birthFaceOf(s) !== undefined && sessionKindFaceOf(s) !== undefined && typeof s?.listSessions === "function" && typeof s.listIdleOfKind === "function" && d.purgeSession !== undefined
|
|
165
|
+
? YES
|
|
166
|
+
: no("session_kind_faces_absent");
|
|
167
|
+
}
|
|
159
168
|
export function sessionFork(d) {
|
|
160
169
|
const s = d.sessionStorage;
|
|
161
170
|
if (s?.fork === undefined)
|
|
@@ -180,21 +189,18 @@ export function sessionDelete(d) {
|
|
|
180
189
|
return yes({ purge, sessionStorage: owned.sessionStorage });
|
|
181
190
|
}
|
|
182
191
|
export function sessionPolicy(d) {
|
|
183
|
-
const
|
|
184
|
-
if (
|
|
185
|
-
return no("
|
|
192
|
+
const backend = d.backend;
|
|
193
|
+
if (backend === undefined)
|
|
194
|
+
return no("store_backend_absent");
|
|
186
195
|
const owned = sessionOwnership(d);
|
|
187
196
|
if (!owned.available)
|
|
188
197
|
return owned;
|
|
189
|
-
return yes({
|
|
198
|
+
return yes({ sessionStorage: owned.sessionStorage, backend });
|
|
190
199
|
}
|
|
191
200
|
export function sessionSync(d) {
|
|
192
|
-
const { fileHistoryStore: historyStore, sessionPolicyStore } = d;
|
|
193
201
|
const backend = d.backend;
|
|
194
202
|
if (backend === undefined)
|
|
195
203
|
return no("store_backend_absent");
|
|
196
|
-
if (historyStore === undefined)
|
|
197
|
-
return no("file_history_store_absent");
|
|
198
204
|
const s = d.sessionStorage;
|
|
199
205
|
if (s?.exportEntries === undefined || s.exportEntriesStream === undefined)
|
|
200
206
|
return no("session_export_absent");
|
|
@@ -202,34 +208,34 @@ export function sessionSync(d) {
|
|
|
202
208
|
return no("session_import_staging_absent");
|
|
203
209
|
if (!headReadPresent(s) || s.sessionSummaryOf === undefined || s.writeSessionRowCells === undefined)
|
|
204
210
|
return no("session_row_faces_absent");
|
|
205
|
-
if (overwriteWipeIncapable(
|
|
211
|
+
if (overwriteWipeIncapable(backend.sessionPolicy()))
|
|
206
212
|
return no("policy_purge_absent");
|
|
207
|
-
return yes({ backend, sessionStorage: s, historyStore });
|
|
213
|
+
return yes({ backend, sessionStorage: s, historyStore: assembleFileHistory(backend).store });
|
|
208
214
|
}
|
|
209
215
|
export function sessionSyncFileHistory(d) {
|
|
210
216
|
const sync = sessionSync(d);
|
|
211
217
|
if (!sync.available)
|
|
212
218
|
return sync;
|
|
213
|
-
const
|
|
214
|
-
return
|
|
219
|
+
const blobs = landingBlobFacesOf(sync.historyStore);
|
|
220
|
+
return blobs !== undefined ? yes({ historyStore: sync.historyStore, blobs }) : no("blob_exchange_absent");
|
|
215
221
|
}
|
|
216
222
|
export function sessionRewindFiles(d) {
|
|
217
|
-
const {
|
|
218
|
-
if (
|
|
223
|
+
const { config, backend } = d;
|
|
224
|
+
if (backend === undefined)
|
|
219
225
|
return no("file_history_store_absent");
|
|
220
226
|
const owned = sessionOwnership(d);
|
|
221
227
|
if (!owned.available)
|
|
222
228
|
return owned;
|
|
223
229
|
const runs = durableRuns(d);
|
|
224
|
-
if (
|
|
230
|
+
if (!runs.available)
|
|
225
231
|
return no("resume_anchor_store_absent");
|
|
226
232
|
if (!laneWiresExecutionEnv(config.remoteExec.provider))
|
|
227
233
|
return no("execution_lane_handless");
|
|
228
234
|
if (!DEPLOYMENT_SHAPE_PREDICATES.rewindableWorkspace.holds(config))
|
|
229
235
|
return no("workspace_rebuilt_per_task");
|
|
230
|
-
if (backend
|
|
236
|
+
if (backend.kind !== "local")
|
|
231
237
|
return no("session_store_shared");
|
|
232
|
-
return yes({ historyStore, anchors: { anchors, runs: runs.runStore }, sessionStorage: owned.sessionStorage });
|
|
238
|
+
return yes({ historyStore: assembleFileHistory(backend).store, anchors: { anchors: backend.resumeAnchor(), runs: runs.runStore }, sessionStorage: owned.sessionStorage });
|
|
233
239
|
}
|
|
234
240
|
export function sessionRewindFilesPreview(d) {
|
|
235
241
|
const rewind = sessionRewindFiles(d);
|
|
@@ -250,19 +256,19 @@ export function toolApproval(d) {
|
|
|
250
256
|
return d.toolApproval !== undefined ? yes({ coordinator: d.toolApproval }) : no("tool_approval_disabled");
|
|
251
257
|
}
|
|
252
258
|
export function streamApproval(d) {
|
|
259
|
+
if (d.toolApproval === undefined)
|
|
260
|
+
return no("tool_approval_disabled");
|
|
261
|
+
const coordinator = d.toolApproval;
|
|
253
262
|
const gate = resolveStreamApprovalGate({
|
|
254
|
-
toolApprovalEnabled:
|
|
255
|
-
streamApprovalEnabled: d.config.streamApproval?.enabled === true,
|
|
263
|
+
toolApprovalEnabled: true,
|
|
256
264
|
backend: d.backend,
|
|
257
265
|
checkpointStore: d.checkpointStore,
|
|
258
266
|
});
|
|
259
267
|
if (gate.active)
|
|
260
|
-
return yes({ askStore: gate.askStore });
|
|
268
|
+
return yes({ askStore: gate.askStore, coordinator });
|
|
261
269
|
switch (gate.reason) {
|
|
262
270
|
case "no_tool_approval":
|
|
263
271
|
return no("tool_approval_disabled");
|
|
264
|
-
case "protocol_disabled":
|
|
265
|
-
return no("stream_approval_disabled");
|
|
266
272
|
case "no_backend":
|
|
267
273
|
return no("store_backend_absent");
|
|
268
274
|
case "no_park_facility":
|
|
@@ -277,20 +283,8 @@ export function readRootGrant(d) {
|
|
|
277
283
|
return DEPLOYMENT_SHAPE_PREDICATES.callerOwnsWorkerDisk.holds(d.config) ? YES : no("read_root_grant_posture_refused");
|
|
278
284
|
}
|
|
279
285
|
export function approvalFrameFamilies(stream) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
switch (stream.why) {
|
|
283
|
-
case "tool_approval_disabled":
|
|
284
|
-
return [];
|
|
285
|
-
case "stream_approval_disabled":
|
|
286
|
-
case "store_backend_absent":
|
|
287
|
-
case "checkpoint_store_absent":
|
|
288
|
-
return [presentedApprovalFrameFamily(false)];
|
|
289
|
-
default: {
|
|
290
|
-
const unhandled = stream.why;
|
|
291
|
-
throw new Error(`unhandled stream-approval why: ${JSON.stringify(unhandled)}`);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
286
|
+
const family = presentedApprovalFrameFamily(stream.available);
|
|
287
|
+
return family === undefined ? [] : [family];
|
|
294
288
|
}
|
|
295
289
|
export function deviceLane(d) {
|
|
296
290
|
return d.deviceHub !== undefined ? yes({ hub: d.deviceHub }) : no("device_hub_absent");
|
|
@@ -367,15 +361,15 @@ export function engineHandover(d) {
|
|
|
367
361
|
return no("engine_handover_lane_absent");
|
|
368
362
|
return door.observing ? yes({ door }) : no("engine_lease_stopped");
|
|
369
363
|
}
|
|
370
|
-
export function operatorLane(d) {
|
|
371
|
-
return operatorRosterPresent(d.config) ? YES : no("operator_principals_empty");
|
|
364
|
+
export function operatorLane(d, power) {
|
|
365
|
+
return operatorRosterPresent(d.config, power) ? YES : no("operator_principals_empty");
|
|
372
366
|
}
|
|
373
367
|
function adoptionLogStore(d) {
|
|
374
368
|
const b = d.backend;
|
|
375
369
|
return b !== undefined && typeof b.adoptionLog === "function" ? yes({ backend: b }) : no("adoption_store_absent");
|
|
376
370
|
}
|
|
377
371
|
export function adoption(d) {
|
|
378
|
-
const lane = operatorLane(d);
|
|
372
|
+
const lane = operatorLane(d, "operate");
|
|
379
373
|
if (!lane.available)
|
|
380
374
|
return lane;
|
|
381
375
|
return adoptionLogStore(d);
|
|
@@ -390,7 +384,7 @@ export function adoptionSessionImport(d) {
|
|
|
390
384
|
return yes({ backend: log.backend, sessionStorage: s });
|
|
391
385
|
}
|
|
392
386
|
export function memoryBundle(d) {
|
|
393
|
-
const lane = operatorLane(d);
|
|
387
|
+
const lane = operatorLane(d, "operate");
|
|
394
388
|
if (!lane.available)
|
|
395
389
|
return lane;
|
|
396
390
|
return d.memoryBundleExport !== undefined && d.memoryBundleImport !== undefined
|
|
@@ -398,13 +392,13 @@ export function memoryBundle(d) {
|
|
|
398
392
|
: no("memory_bundle_faces_absent");
|
|
399
393
|
}
|
|
400
394
|
export function memoryCompliance(d) {
|
|
401
|
-
const lane = operatorLane(d);
|
|
395
|
+
const lane = operatorLane(d, "operate");
|
|
402
396
|
if (!lane.available)
|
|
403
397
|
return lane;
|
|
404
398
|
return d.memoryCompliance !== undefined ? yes({ faces: d.memoryCompliance }) : no("memory_compliance_faces_absent");
|
|
405
399
|
}
|
|
406
400
|
export function memoryOrigin(d) {
|
|
407
|
-
const lane = operatorLane(d);
|
|
401
|
+
const lane = operatorLane(d, "operate");
|
|
408
402
|
if (!lane.available)
|
|
409
403
|
return lane;
|
|
410
404
|
return d.memoryOriginFace !== undefined ? yes({ faces: d.memoryOriginFace }) : no("memory_origin_faces_absent");
|
|
@@ -412,17 +406,17 @@ export function memoryOrigin(d) {
|
|
|
412
406
|
export function memoryConsolidation(d) {
|
|
413
407
|
if (d.memoryConsolidation === undefined)
|
|
414
408
|
return no("consolidation_valve_closed");
|
|
415
|
-
const lane = operatorLane(d);
|
|
409
|
+
const lane = operatorLane(d, "operate");
|
|
416
410
|
return lane.available ? yes({ valve: d.memoryConsolidation }) : lane;
|
|
417
411
|
}
|
|
418
412
|
export function memoryOptOutGrant(d) {
|
|
419
|
-
const lane = operatorLane(d);
|
|
413
|
+
const lane = operatorLane(d, "operate");
|
|
420
414
|
if (!lane.available)
|
|
421
415
|
return lane;
|
|
422
416
|
return d.memoryOptOutGrant !== undefined ? yes({ store: d.memoryOptOutGrant }) : no("memory_optout_grant_absent");
|
|
423
417
|
}
|
|
424
418
|
export function outcomeLedger(d) {
|
|
425
|
-
const lane = operatorLane(d);
|
|
419
|
+
const lane = operatorLane(d, "operate");
|
|
426
420
|
if (!lane.available)
|
|
427
421
|
return lane;
|
|
428
422
|
const sink = d.outcomeSink;
|
|
@@ -431,7 +425,7 @@ export function outcomeLedger(d) {
|
|
|
431
425
|
export function configCatalog(d) {
|
|
432
426
|
if (d.config.configCatalogEnabled !== true)
|
|
433
427
|
return no("config_catalog_disabled");
|
|
434
|
-
return operatorLane(d);
|
|
428
|
+
return operatorLane(d, "operate");
|
|
435
429
|
}
|
|
436
430
|
export function ruleLane(d) {
|
|
437
431
|
return d.ruleConsent !== undefined ? yes({ lane: d.ruleConsent }) : no("rule_store_absent");
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **一张审批卡的规则候选:唯一读者**(活卡铸点、两只 checkpoint 店的铸行与回读投影、停驻行的规则记录读者同调这一只)。
|
|
3
|
+
*
|
|
4
|
+
* 规则一句:每一张面上投出的候选,都是同一份记录过**这一只**读者得到的投影 —— 同一个下标空间。读法 = core `readRuleOffers` 的闭集词
|
|
5
|
+
* (经 `approval-card.ts` 的 `readRuleOfferList`)→ 基数前缀帽 {@link MAX_RULE_OFFERS}(扣在读之前:exact single 恒 0、batch 恒末,前缀截不动选择键)→
|
|
6
|
+
* 兑付座超尺整条撤回 → 派生事实一致性(自称的 kind / match / command / directory 座与共享校验器从 `rule` 文本派生的三元组逐字一致,且是这张卡的工具与卡形)。
|
|
7
|
+
* 此前店侧另有一只读者(超尺截长、不判派生事实):一只展示成目录授权、规则文本却是 Bash 放行的 offer 能在队列行上出现,同一张停驻卡的重放帧与队列行
|
|
8
|
+
* 下标对不上。展示变换(逐条脱敏 + 截长,1:1 保位、只改字)归各展示腿,不是读法(`checkpoint-store-face.ts` 的 `displayRuleOffers`)。
|
|
9
|
+
*/
|
|
10
|
+
import { type RuleOffer } from "@sema-agent/core";
|
|
11
|
+
/**
|
|
12
|
+
* 读一张卡的候选(唯一读者;头注)。`undefined` = 没有素材可投 / 可兑:原值不是非空列表(引擎没铸),或有兑付座超了不可截的尺(整条车道撤回)。
|
|
13
|
+
* `[]` = 原值有、全被丢光(闭集词不认 / 派生事实不一致):活卡铸点据它把绑定值回落到调用自己的命令(编辑臂兑的就是它),展示腿读作无供给。
|
|
14
|
+
*/
|
|
15
|
+
export declare function readCardRuleOffers(raw: unknown, cardTool: string): readonly RuleOffer[] | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* **已落盘投影的解码**(SQL 腿的 `checkpoint.rule_suggestions` 列:铸行那一刻 {@link readCardRuleOffers} 读出、经展示变换落下的那一份)。读者在铸行时已经跑过;
|
|
18
|
+
* 这里只认闭集词形 + 同一组界(扫描窗 / 成员前缀 / 基数),**不再判**派生事实与兑付座尺 —— 展示形是脱敏、截长过的字(截长之后的规则文本不再是一条可解析的规则),
|
|
19
|
+
* 再过一遍读者会把铸行时留下的候选丢掉,同一份素材两个后端两种卡面。手改过的列由这只解码落成丢弃(响亮,同一只 offer-dropped 计数)。
|
|
20
|
+
*/
|
|
21
|
+
export declare function decodeRuleOfferProjection(raw: unknown): readonly RuleOffer[];
|
|
22
|
+
/**
|
|
23
|
+
* 这张卡的**绑定值**(`prepareCardApproval` 的 `command`,也是耐久行的 `rule_command`)= **卡形的绑定值**(core `prepareCardApproval` 对 `command` 入参的逐形定义):
|
|
24
|
+
* · 值形(整工具 / 名字 / 主机:core 对这三形只铸**一只** single,它的 `command` 座就是那个值 —— 整工具 `""`、名字工具是调用带的名字、主机工具是调用到达的主机)
|
|
25
|
+
* ⇒ 那一只候选自己的 `command`;
|
|
26
|
+
* · 其余(命令形候选 / 批,或读者把候选丢光了)⇒ 被裁决的命令原字节 `args.command`(非空串;读不出 ⇒ 没有素材)。空候选表不说任何值形:
|
|
27
|
+
* 绑定值回到调用自己的命令(编辑面兑的就是它)。
|
|
28
|
+
* 候选走到这里之前已过 {@link singleOfferBelongsOnCard}:每只 single 都是这张卡的工具、这只工具的卡形 ⇒ 值形与命令形不会同卡。值形候选不止一只 = 不是 core 铸得出的卡
|
|
29
|
+
* ⇒ 没有素材(整条车道撤回,与本文件其余撤回臂同形)。`req.args` 窄读,禁裸 as-cast。
|
|
30
|
+
*/
|
|
31
|
+
export declare function cardBindingOf(args: unknown, offers: readonly RuleOffer[]): string | undefined;
|
|
32
|
+
//# sourceMappingURL=card-rule-offers.d.ts.map
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { MAX_RULE_TEXT_CHARS, parseRuleText } from "@sema-agent/core";
|
|
2
|
+
import { MAX_RULE_OFFERS, MAX_RULE_OFFER_BATCH_MEMBERS, readRuleOfferList } from "./approval-card.js";
|
|
3
|
+
import { CARD_RULE_FORM_OF_MATCH, cardRuleFormOf } from "./permission-rule-vocab.js";
|
|
4
|
+
import { createLogger } from "./observability/logger.js";
|
|
5
|
+
const defaultLogger = createLogger();
|
|
6
|
+
export function readCardRuleOffers(raw, cardTool) {
|
|
7
|
+
if (raw === undefined)
|
|
8
|
+
return undefined;
|
|
9
|
+
if (!Array.isArray(raw)) {
|
|
10
|
+
readRuleOfferList(raw);
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
if (raw.length === 0)
|
|
14
|
+
return undefined;
|
|
15
|
+
return boundRuleOfferTexts(raw.slice(0, MAX_RULE_OFFER_SCAN).map(preboundBatchMembers), cardTool);
|
|
16
|
+
}
|
|
17
|
+
export function decodeRuleOfferProjection(raw) {
|
|
18
|
+
return readRuleOfferList(Array.isArray(raw) ? raw.slice(0, MAX_RULE_OFFER_SCAN).map(preboundBatchMembers) : raw)
|
|
19
|
+
.map(({ offer }) => offer)
|
|
20
|
+
.slice(0, MAX_RULE_OFFERS);
|
|
21
|
+
}
|
|
22
|
+
const MAX_RULE_OFFER_SCAN = 32;
|
|
23
|
+
function preboundBatchMembers(item) {
|
|
24
|
+
if (typeof item !== "object" || item === null)
|
|
25
|
+
return item;
|
|
26
|
+
const candidate = item;
|
|
27
|
+
if (candidate.kind !== "batch" || !Array.isArray(candidate.rules) || candidate.rules.length <= MAX_RULE_OFFER_BATCH_MEMBERS)
|
|
28
|
+
return item;
|
|
29
|
+
return { ...candidate, rules: candidate.rules.slice(0, MAX_RULE_OFFER_BATCH_MEMBERS) };
|
|
30
|
+
}
|
|
31
|
+
function ruleOfferTextsOverSize(offer) {
|
|
32
|
+
const over = (s) => s.length > MAX_RULE_TEXT_CHARS;
|
|
33
|
+
if (offer.kind === "single")
|
|
34
|
+
return over(offer.rule) || over(offer.command);
|
|
35
|
+
return offer.rules.some((r) => {
|
|
36
|
+
switch (r.kind) {
|
|
37
|
+
case "command":
|
|
38
|
+
return over(r.rule) || over(r.command);
|
|
39
|
+
case "directoryRead":
|
|
40
|
+
return over(r.rule) || over(r.directory);
|
|
41
|
+
default:
|
|
42
|
+
throw new Error(`unknown rule-offer batch member kind: ${JSON.stringify(r)}`);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function ruleOfferDerivedFactsAgree(offer, cardTool) {
|
|
47
|
+
const derive = (rule) => {
|
|
48
|
+
const p = parseRuleText(rule, "allow");
|
|
49
|
+
return "rule" in p ? p.rule : undefined;
|
|
50
|
+
};
|
|
51
|
+
if (offer.kind === "single") {
|
|
52
|
+
const d = derive(offer.rule);
|
|
53
|
+
return d !== undefined && d.rule === offer.rule && d.match === offer.match && d.command === offer.command && singleOfferBelongsOnCard(d.match, d.tool, cardTool);
|
|
54
|
+
}
|
|
55
|
+
return offer.rules.every((m) => {
|
|
56
|
+
const d = derive(m.rule);
|
|
57
|
+
if (d === undefined || d.rule !== m.rule)
|
|
58
|
+
return false;
|
|
59
|
+
switch (m.kind) {
|
|
60
|
+
case "command":
|
|
61
|
+
return d.tool === "Bash" && d.match === m.match && d.command === m.command;
|
|
62
|
+
case "directoryRead":
|
|
63
|
+
return d.tool === "Read" && d.match === "subpath" && d.command === m.directory;
|
|
64
|
+
default:
|
|
65
|
+
throw new Error(`unknown rule-offer batch member kind: ${JSON.stringify(m)}`);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function singleOfferBelongsOnCard(match, ruleTool, cardTool) {
|
|
70
|
+
const form = CARD_RULE_FORM_OF_MATCH[match];
|
|
71
|
+
return ruleTool === cardTool && form !== undefined && form === cardRuleFormOf(cardTool);
|
|
72
|
+
}
|
|
73
|
+
function boundRuleOfferTexts(offers, cardTool) {
|
|
74
|
+
const over = (s) => s.length > MAX_RULE_TEXT_CHARS;
|
|
75
|
+
const clipSegment = (s) => (over(s) ? s.slice(0, MAX_RULE_TEXT_CHARS) : s);
|
|
76
|
+
const out = [];
|
|
77
|
+
for (const { offer } of readRuleOfferList(offers)) {
|
|
78
|
+
if (out.length >= MAX_RULE_OFFERS)
|
|
79
|
+
break;
|
|
80
|
+
if (ruleOfferTextsOverSize(offer))
|
|
81
|
+
return undefined;
|
|
82
|
+
if (!ruleOfferDerivedFactsAgree(offer, cardTool)) {
|
|
83
|
+
defaultLogger.warn("rule_offer_dropped_derived_facts_disagree", {
|
|
84
|
+
kind: offer.kind,
|
|
85
|
+
note: "an offer's kind/match/command/directory seats do not agree with what the shared validator derives from its rule text, or it is not this card's tool / card form — dropped whole so the card never shows one grant while redeeming another (core/dist skew or forged material?)",
|
|
86
|
+
});
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
switch (offer.kind) {
|
|
90
|
+
case "single":
|
|
91
|
+
out.push({ kind: "single", rule: offer.rule, match: offer.match, command: offer.command });
|
|
92
|
+
break;
|
|
93
|
+
case "batch": {
|
|
94
|
+
const rules = [];
|
|
95
|
+
for (const r of offer.rules) {
|
|
96
|
+
switch (r.kind) {
|
|
97
|
+
case "command":
|
|
98
|
+
rules.push({ kind: "command", rule: r.rule, match: r.match, command: r.command, segment: clipSegment(r.segment) });
|
|
99
|
+
break;
|
|
100
|
+
case "directoryRead":
|
|
101
|
+
rules.push({ kind: "directoryRead", rule: r.rule, directory: r.directory, segment: clipSegment(r.segment) });
|
|
102
|
+
break;
|
|
103
|
+
default:
|
|
104
|
+
throw new Error(`unknown rule-offer batch member kind: ${JSON.stringify(r)}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
out.push({
|
|
108
|
+
kind: "batch",
|
|
109
|
+
rules,
|
|
110
|
+
uncoveredSegments: offer.uncoveredSegments,
|
|
111
|
+
...(offer.uncoveredDetail !== undefined ? { uncoveredDetail: offer.uncoveredDetail.map((d) => ({ segment: clipSegment(d.segment), reason: d.reason })) } : {}),
|
|
112
|
+
});
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
default:
|
|
116
|
+
throw new Error(`unknown rule-offer kind: ${JSON.stringify(offer)}`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return out;
|
|
120
|
+
}
|
|
121
|
+
export function cardBindingOf(args, offers) {
|
|
122
|
+
const valueOffers = offers.filter((o) => o.kind === "single" && CARD_RULE_FORM_OF_MATCH[o.match] !== "command");
|
|
123
|
+
if (valueOffers.length > 0)
|
|
124
|
+
return valueOffers.length === 1 && offers.length === 1 ? valueOffers[0].command : undefined;
|
|
125
|
+
if (args === null || typeof args !== "object" || Array.isArray(args))
|
|
126
|
+
return undefined;
|
|
127
|
+
const command = args.command;
|
|
128
|
+
return typeof command === "string" && command !== "" ? command : undefined;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=card-rule-offers.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type WebAdminCredentialDeclaration } from "@sema-agent/settings-schema";
|
|
1
|
+
import { type WebAdminCredential, type WebAdminCredentialDeclaration } from "@sema-agent/settings-schema";
|
|
2
2
|
/** 凭证种类闭集。新增一个种类 = 本文件与 `web-admin-client/center-request.ts` 的穷举 switch 当场编译红。 */
|
|
3
3
|
export type CenterCredentialKind = "pull-token" | "user-jwt" | "user-session" | "none";
|
|
4
4
|
/** 一次取值失败的成因闭集(见模块头注「四个成因」;boot 判决 {@link judgeCenterCredentialAtBoot} 对它穷举)。 */
|
|
5
5
|
export type CenterCredentialFailure = "missing" | "malformed" | "multi_tenant_session" | "expired";
|
|
6
|
-
/** 声明形的**非秘密**投影(进日志 / 拒因 /
|
|
6
|
+
/** 声明形的**非秘密**投影(进日志 / 拒因 / 自报位):env 形不带值。唯一铸点 {@link credentialOriginOf}。 */
|
|
7
7
|
export type CenterCredentialOrigin = {
|
|
8
8
|
readonly from: "env";
|
|
9
9
|
} | {
|
|
@@ -12,6 +12,10 @@ export type CenterCredentialOrigin = {
|
|
|
12
12
|
} | {
|
|
13
13
|
readonly from: "absent";
|
|
14
14
|
};
|
|
15
|
+
/** 声明**在**的那两形(配置里 `webAdmin.assertionToken` 的型:没声明 ⇒ 那一格缺席,缺席只有一种读法)。 */
|
|
16
|
+
export type DeclaredCredentialOrigin = Exclude<CenterCredentialOrigin, {
|
|
17
|
+
readonly from: "absent";
|
|
18
|
+
}>;
|
|
15
19
|
/**
|
|
16
20
|
* 一次取值的结果。`ok:false` 只有文件形会出现(env / absent 形的取值恒成功)。
|
|
17
21
|
* `identity` 是「此刻的凭证是谁」—— 成功恒在;失败时只有 `expired` 知道(信封还读得出 `sub`,只是令牌不许再出站),
|
|
@@ -92,11 +96,26 @@ export type CenterCredentialSourceSpec = Exclude<WebAdminCredentialDeclaration,
|
|
|
92
96
|
readonly multiTenant: boolean;
|
|
93
97
|
};
|
|
94
98
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
99
|
+
* 读一份 web-admin 凭证(`credential` ∈ 契约闭集 `WEB_ADMIN_CREDENTIALS`)的那一对声明键 —— 两份凭证的**唯一**读口。判定全交 settings-schema 的判官
|
|
100
|
+
* `judgeWebAdminCredentialDeclaration`([ref]:二选一规则的**唯一**实现;空串 = 未设、不 trim;两个都设 ⇒ throw,boot 拒启,拒句点名那一对键、不回显值;
|
|
101
|
+
* 判哪一份由调用方说,判官没有缺省)。本仓只多读方自己的那一步:文件路径按本进程 cwd 解析成绝对路径(之后 cwd 变了也读同一个文件 —— 纯契约不碰
|
|
102
|
+
* `node:path`,这一步归读方)。
|
|
103
|
+
*/
|
|
104
|
+
export declare function readWebAdminCredentialDeclaration(credential: WebAdminCredential, env?: Readonly<Record<string, string | undefined>>): WebAdminCredentialDeclaration;
|
|
105
|
+
/** 声明 → 非秘密投影的**唯一**铸点(env 形丢掉值)。凭证来源的 `origin` 与断言令牌的配置读数都经它。 */
|
|
106
|
+
export declare function credentialOriginOf(declared: Readonly<{
|
|
107
|
+
from: "env";
|
|
108
|
+
} | {
|
|
109
|
+
from: "file";
|
|
110
|
+
path: string;
|
|
111
|
+
} | {
|
|
112
|
+
from: "absent";
|
|
113
|
+
}>): CenterCredentialOrigin;
|
|
114
|
+
/**
|
|
115
|
+
* [ref] —— 起服日志 `center_assertion_token` 的字段(`build*`:纯数据;`boot/web-admin.ts` 接了中心时打一次,info 级)。声明在 ⇒ 来源形(文件形另带
|
|
116
|
+
* 绝对路径;值形不带值);没声明 ⇒ 只有 `declared:false`。`effect` 如实说这一份凭证此刻的用途:只被读出声明,没有任何请求出示它。
|
|
98
117
|
*/
|
|
99
|
-
export declare function
|
|
118
|
+
export declare function buildAssertionTokenBootFields(declared: DeclaredCredentialOrigin | undefined): Readonly<Record<string, string | boolean>>;
|
|
100
119
|
/**
|
|
101
120
|
* 凭证来源工厂(活对象:文件形每次取值读盘并记健康态)。`worker` = `SEMA_WEB_ADMIN_WORKER`(拉取令牌形的身份)。
|
|
102
121
|
* `readFile` / `now` 只为测试注入。
|
|
@@ -12,10 +12,30 @@ export class CenterCredentialUnavailableError extends Error {
|
|
|
12
12
|
this.name = "CenterCredentialUnavailableError";
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
export function
|
|
16
|
-
const declared = judgeWebAdminCredentialDeclaration(env,
|
|
15
|
+
export function readWebAdminCredentialDeclaration(credential, env = process.env) {
|
|
16
|
+
const declared = judgeWebAdminCredentialDeclaration(env, credential);
|
|
17
17
|
return declared.from === "file" ? { from: "file", path: resolvePath(declared.path) } : declared;
|
|
18
18
|
}
|
|
19
|
+
export function credentialOriginOf(declared) {
|
|
20
|
+
switch (declared.from) {
|
|
21
|
+
case "env":
|
|
22
|
+
return { from: "env" };
|
|
23
|
+
case "file":
|
|
24
|
+
return { from: "file", path: declared.path };
|
|
25
|
+
case "absent":
|
|
26
|
+
return { from: "absent" };
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function buildAssertionTokenBootFields(declared) {
|
|
30
|
+
if (declared === undefined)
|
|
31
|
+
return { declared: false };
|
|
32
|
+
return {
|
|
33
|
+
declared: true,
|
|
34
|
+
from: declared.from,
|
|
35
|
+
...(declared.from === "file" ? { path: declared.path } : {}),
|
|
36
|
+
effect: "the declaration is read and reported only (GET /health center.assertionToken); no request from this engine presents the assertion token to the center",
|
|
37
|
+
};
|
|
38
|
+
}
|
|
19
39
|
const digest16 = (s) => createHash("sha256").update(s, "utf8").digest("hex").slice(0, 16);
|
|
20
40
|
function jwtSubject(bearer) {
|
|
21
41
|
let parsed;
|
|
@@ -90,10 +110,10 @@ export function createCenterCredentialSource(spec, worker, deps = {}) {
|
|
|
90
110
|
};
|
|
91
111
|
switch (spec.from) {
|
|
92
112
|
case "absent":
|
|
93
|
-
return { origin: spec, declared: false, read: () => observed(NONE), health: () => ({ state: "ok" }), onRead };
|
|
113
|
+
return { origin: credentialOriginOf(spec), declared: false, read: () => observed(NONE), health: () => ({ state: "ok" }), onRead };
|
|
94
114
|
case "env": {
|
|
95
115
|
const fixed = classify(spec.token, worker);
|
|
96
|
-
return { origin:
|
|
116
|
+
return { origin: credentialOriginOf(spec), declared: true, read: () => observed(fixed), health: () => ({ state: "ok" }), onRead };
|
|
97
117
|
}
|
|
98
118
|
case "file": {
|
|
99
119
|
const readFile = deps.readFile ?? ((p) => readFileSync(p, "utf8"));
|
|
@@ -111,7 +131,7 @@ export function createCenterCredentialSource(spec, worker, deps = {}) {
|
|
|
111
131
|
return readCredentialText(text, spec, worker, now());
|
|
112
132
|
};
|
|
113
133
|
return {
|
|
114
|
-
origin:
|
|
134
|
+
origin: credentialOriginOf(spec),
|
|
115
135
|
declared: true,
|
|
116
136
|
read() {
|
|
117
137
|
const r = readOnce();
|
package/dist/config-catalog.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type RetiredEnvWire } from "@sema-agent/settings-schema";
|
|
|
2
2
|
import type { ServiceConfig, ServiceConfigGroups } from "./config-types.js";
|
|
3
3
|
import type { ConfigKnobRecord } from "./config.js";
|
|
4
4
|
import type { RestartSlice } from "./web-admin-client/restart-signal.js";
|
|
5
|
+
import { type EnvNameAllowlistKnob } from "./env-name-allowlist-knobs.js";
|
|
5
6
|
export declare const CATALOG_VALUE_TYPES: readonly ["boolean", "number", "string", "enum", "csv", "json", "path", "url", "secret", "opaque"];
|
|
6
7
|
export type CatalogValueType = (typeof CATALOG_VALUE_TYPES)[number];
|
|
7
8
|
export declare const CATALOG_TIMINGS: readonly ["hot", "restart", "deploy", "inert"];
|
|
@@ -19,15 +20,33 @@ export type CatalogDangerAxis = (typeof CATALOG_DANGER_AXES)[number];
|
|
|
19
20
|
export declare const URL_CREDENTIAL_POLICIES: readonly ["refuse", "mask"];
|
|
20
21
|
export type UrlCredentialPolicy = (typeof URL_CREDENTIAL_POLICIES)[number];
|
|
21
22
|
/**
|
|
22
|
-
* secret
|
|
23
|
-
* · `whole` —— 整值是一枚(令牌 / 口令 / 私钥 /
|
|
23
|
+
* secret 行的值**装着几枚本服务凭据、按什么读出来**(闭集;只在 `type: "secret"` 的行上,其余行恒缺席)—— 本服务凭据的颗粒按本服务读这只变量的那一只解析器定:
|
|
24
|
+
* · `whole` —— 整值是一枚(令牌 / 口令 / 私钥 / 一只模型密钥);
|
|
24
25
|
* · `token-table` —— `tok=system` 逗号表,每个 `tok` 是一枚(`SERVICE_AUTH_TOKENS`;读法 = `auth-keys.ts` `parseServiceAuthTokens`,`loadConfig` 同读);
|
|
25
|
-
* · `key-set` —— `{kid,key,status}` JSON 数组,每个 `key` 是一枚(`APPROVAL_HMAC_KEYS`;读法 = `auth-keys.ts` `parseApprovalHmacKeys`,`loadConfig` 同读)
|
|
26
|
-
*
|
|
27
|
-
*
|
|
26
|
+
* · `key-set` —— `{kid,key,status}` JSON 数组,每个 `key` 是一枚(`APPROVAL_HMAC_KEYS`;读法 = `auth-keys.ts` `parseApprovalHmacKeys`,`loadConfig` 同读);
|
|
27
|
+
* · `name-list` —— 零枚:原文是一张环境变量名单(名单型旋钮;读法 = `config.ts` `parseEnvNameAllowlist`)。名单不是凭据,原文不交引擎比值;
|
|
28
|
+
* 旋钮变量本身照按名扣(它的原文可能夹着被错展开进来的令牌,所以是 secret 行:目录只回在场位、名进自有凭据声明、不进任何子进程)。
|
|
29
|
+
* 读者只有一个:自有凭据声明的值臂(`server-secret-env.ts`)—— 交给引擎的恰是颗粒读出来的那几枚(列表形另把每一枚交出去 ⇒ 一枚令牌换了个变量名放着,与原变量同扣)。
|
|
30
|
+
* 词加一个而读者不补 ⇒ 编译红(读者是穷举 switch);secret 行不写 ⇒ 编译红(`r()` 的 secret 重载要它);哪只行取 `name-list` 由行名定类({@link SecretRowForm}),写反 ⇒ 编译红。不上 wire。
|
|
28
31
|
*/
|
|
29
|
-
export declare const SECRET_CREDENTIAL_FORMS: readonly ["whole", "token-table", "key-set"];
|
|
32
|
+
export declare const SECRET_CREDENTIAL_FORMS: readonly ["whole", "token-table", "key-set", "name-list"];
|
|
30
33
|
export type SecretCredentialForm = (typeof SECRET_CREDENTIAL_FORMS)[number];
|
|
34
|
+
/** 装着本服务凭据值的颗粒(`name-list` 以外的词):名单型旋钮以外的每条 secret 行、bake-runner 的凭据行都取其一。 */
|
|
35
|
+
export type CredentialValueForm = Exclude<SecretCredentialForm, "name-list">;
|
|
36
|
+
/**
|
|
37
|
+
* secret 行的颗粒**按行名定类**:名单型旋钮(闭集 `EnvNameAllowlistKnob`,叶表 `env-name-allowlist-knobs.ts` —— 「哪只变量是名单」只在那里写一次)恒 `name-list`,
|
|
38
|
+
* 其余恒是装着凭据值的颗粒。目录行写反(旋钮写 `whole`、凭据写 `name-list`)⇒ `r()` 的 secret 重载当场编译红 —— 列与旋钮闭集不会说两样。
|
|
39
|
+
*/
|
|
40
|
+
export type SecretRowForm<N extends string> = N extends EnvNameAllowlistKnob ? "name-list" : CredentialValueForm;
|
|
41
|
+
/**
|
|
42
|
+
* 配置目录**之外**的本包凭据变量:bake-runner 进程(构建宿主守护进程)自己读的凭据 —— 目录只装服务进程读的 env(D1 对账门把 `bake-runner/` 整只排除),
|
|
43
|
+
* runner 的键不是目录行,却是本包的自有凭据。自有凭据声明(`server-secret-env.ts`)把目录 secret 行与本表并成**一张**「名 → 颗粒」,三个进程入口
|
|
44
|
+
* (stage-01 / run-local / bake-runner)同读这一份(不按「归谁消费」切):名全声明,值按颗粒逐枚交引擎 ⇒ 名单型旋钮点到它(名是或值是)拒启、任何宿主腿都不交它与它的副本。
|
|
45
|
+
* 读点 `bake-runner/main.ts` `loadEnv` 按本表的键读(键改名而读点不跟 ⇒ 编译红)。不上 wire,不进 `GET /v1/config/catalog`。
|
|
46
|
+
*/
|
|
47
|
+
export declare const BAKE_RUNNER_CREDENTIAL_ENV: {
|
|
48
|
+
readonly BAKE_RUNNER_TOKEN: "whole";
|
|
49
|
+
};
|
|
31
50
|
/** 域 = 配置九组(类型锁步:组集变了这里跟着红)。 */
|
|
32
51
|
export type CatalogDomain = keyof ServiceConfigGroups;
|
|
33
52
|
export declare const CATALOG_RESTART_SLICES: readonly RestartSlice[];
|
|
@@ -103,7 +122,7 @@ export interface ConfigCatalogSpec {
|
|
|
103
122
|
readonly scope?: "bootstrap-only";
|
|
104
123
|
/** url 行的凭据处置披露({@link UrlCredentialPolicy});url 行必填(`r()` 的 url 重载要它,缺 ⇒ 编译红),其余行写不进来。 */
|
|
105
124
|
readonly credentialPolicy?: UrlCredentialPolicy;
|
|
106
|
-
/** secret 行的凭据颗粒({@link SecretCredentialForm});secret 行必填(`r()` 的 secret 重载要它,缺 ⇒
|
|
125
|
+
/** secret 行的凭据颗粒({@link SecretCredentialForm});secret 行必填(`r()` 的 secret 重载要它,缺 ⇒ 编译红;取哪一类按行名定 —— {@link SecretRowForm}),其余行写不进来。 */
|
|
107
126
|
readonly credentialForm?: SecretCredentialForm;
|
|
108
127
|
}
|
|
109
128
|
export interface ConfigCatalogRowCenter {
|