@sema-agent/server 7.134.0 → 7.136.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 +197 -1
- package/USAGE.md +147 -42
- package/deploy/sema-up/README.md +1 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/values.yaml +1 -1
- package/dist/adoption/plan.d.ts +1 -1
- package/dist/approval-ask-audit-store.d.ts +24 -24
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +122 -154
- package/dist/approval-card.js +50 -51
- package/dist/approval-content-kind.d.ts +23 -5
- package/dist/approval-content-kind.js +8 -1
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-gate-currency.d.ts +22 -3
- package/dist/approval-gate-currency.js +44 -18
- package/dist/approval-hmac.d.ts +7 -7
- package/dist/approval-policy-settlement.d.ts +2 -2
- package/dist/approval-reconciler.d.ts +3 -3
- package/dist/approval.d.ts +8 -8
- package/dist/approval.js +4 -2
- package/dist/auth-bridge.d.ts +35 -6
- package/dist/auth-bridge.js +20 -3
- package/dist/auto-mode-face.d.ts +4 -4
- package/dist/background-session-reap.d.ts +2 -2
- package/dist/bake-runner/main.d.ts +2 -2
- package/dist/bake-runner/runner.d.ts +4 -4
- package/dist/bench/s1/live-deps.d.ts +1 -1
- package/dist/bench/s1/run-firm.d.ts +1 -1
- package/dist/boot/budget-tracing.d.ts +1 -2
- package/dist/boot/budget-tracing.js +2 -2
- package/dist/boot/coordinators.d.ts +2 -2
- package/dist/boot/coordinators.js +2 -2
- package/dist/boot/deferred-sandbox-path-env.d.ts +0 -6
- package/dist/boot/deferred-sandbox-path-env.js +0 -5
- package/dist/boot/engine-lease.d.ts +5 -5
- package/dist/boot/execution-env.d.ts +16 -15
- package/dist/boot/execution-env.js +19 -21
- package/dist/boot/fatal-exit.d.ts +2 -2
- package/dist/boot/late-binds.d.ts +1 -1
- package/dist/boot/leader.d.ts +1 -1
- package/dist/boot/memory-boundary.d.ts +2 -2
- package/dist/boot/memory-consolidation.d.ts +15 -15
- package/dist/boot/org-memory.js +1 -1
- package/dist/boot/parked-revive-gate.d.ts +3 -3
- package/dist/boot/parked-revive-gate.js +3 -2
- package/dist/boot/reapers.d.ts +4 -4
- package/dist/boot/resolve-spec.d.ts +1 -1
- package/dist/boot/resolve-spec.js +36 -29
- package/dist/boot/runner-deps.d.ts +11 -11
- package/dist/boot/runner-deps.js +7 -4
- package/dist/boot/session-faces.d.ts +3 -3
- package/dist/boot/session-faces.js +11 -30
- package/dist/boot/shutdown.d.ts +5 -5
- package/dist/boot/side-query-lane.d.ts +2 -2
- package/dist/boot/stage-04-stores.d.ts +1 -1
- package/dist/boot/stage-05-execution-env.d.ts +1 -1
- package/dist/boot/stage-05-execution-env.js +4 -4
- package/dist/boot/stage-06-runners.d.ts +1 -1
- package/dist/boot/stage-06-runners.js +0 -2
- package/dist/boot/stage-07-capability-layer.d.ts +1 -1
- package/dist/boot/stage-08-reapers.d.ts +1 -1
- package/dist/boot/stage-09-leader.d.ts +1 -1
- package/dist/boot/stage-10-http-server.d.ts +1 -1
- package/dist/boot/stores.js +4 -4
- package/dist/boot/web-admin.d.ts +17 -17
- package/dist/boot/web-admin.js +15 -27
- package/dist/boot/workflow-orchestration.js +2 -9
- package/dist/brain.d.ts +11 -11
- package/dist/brain.js +12 -3
- package/dist/budget.d.ts +7 -7
- package/dist/budget.js +4 -0
- package/dist/capabilities/approvals-push.d.ts +4 -4
- package/dist/capabilities/builtin-tools.d.ts +5 -5
- package/dist/capabilities/center-plugins.d.ts +5 -5
- package/dist/capabilities/center-plugins.js +1 -1
- package/dist/capabilities/center-prompts.d.ts +1 -1
- package/dist/capabilities/center-wiring.d.ts +1 -1
- package/dist/capabilities/composite-members.d.ts +1 -1
- package/dist/capabilities/execution-lane.d.ts +5 -5
- package/dist/capabilities/execution-lane.js +2 -2
- package/dist/capabilities/hands-lane.d.ts +5 -5
- package/dist/capabilities/mcp-probe.d.ts +11 -7
- package/dist/capabilities/sandbox-file-send.d.ts +1 -18
- package/dist/capabilities/sandbox-file-send.js +0 -7
- package/dist/capabilities/scenarios.d.ts +28 -10
- package/dist/capabilities/scenarios.js +15 -5
- package/dist/capabilities/send-user-file-tool.d.ts +1 -1
- package/dist/capabilities/skills.d.ts +31 -12
- package/dist/capabilities/skills.js +23 -17
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +29 -32
- package/dist/capability-facts.js +17 -21
- package/dist/center-config-tier.d.ts +1 -1
- package/dist/center-credential.d.ts +22 -8
- package/dist/center-credential.js +18 -3
- package/dist/checkpoint-identity.d.ts +5 -0
- package/dist/checkpoint-identity.js +14 -0
- package/dist/config-catalog.d.ts +12 -12
- package/dist/config-catalog.js +12 -10
- package/dist/config-d-migration.js +1 -1
- package/dist/config-invariants.d.ts +5 -5
- package/dist/config-invariants.js +11 -2
- package/dist/config-lkg.d.ts +1 -39
- package/dist/config-lkg.js +1 -83
- package/dist/config-provider.d.ts +13 -13
- package/dist/config-provider.js +2 -1
- package/dist/config-types.d.ts +95 -87
- package/dist/config.d.ts +26 -24
- package/dist/config.js +38 -18
- package/dist/cross-session-settings.d.ts +1 -1
- package/dist/delegated-session-owner.d.ts +16 -13
- package/dist/delegated-session-owner.js +9 -10
- package/dist/deployment-governance.d.ts +16 -16
- package/dist/deployment-shape.d.ts +127 -0
- package/dist/deployment-shape.js +72 -0
- package/dist/device-store.d.ts +1 -1
- package/dist/device-ws-hub.d.ts +1 -1
- package/dist/egress-redirect.d.ts +1 -1
- package/dist/elicitation.d.ts +8 -7
- package/dist/elicitation.js +9 -8
- package/dist/entry-mode-clamp-notice.d.ts +2 -2
- package/dist/env-facts.d.ts +10 -9
- package/dist/env-facts.js +1 -1
- package/dist/env-name-allowlist-knobs.d.ts +5 -5
- package/dist/exec-bounds.d.ts +2 -2
- package/dist/execution-lane-caps.d.ts +31 -43
- package/dist/execution-lane-caps.js +0 -13
- package/dist/file-history-capture.d.ts +9 -9
- package/dist/file-history-disclosure.d.ts +25 -11
- package/dist/file-history-disclosure.js +25 -14
- package/dist/fleet/drain-entry.d.ts +2 -2
- package/dist/fleet/fleet-bus.d.ts +22 -14
- package/dist/fleet/fleet-bus.js +5 -5
- package/dist/fleet/fleet-reconciler.d.ts +9 -9
- package/dist/fleet/subagent-tail-bus.d.ts +4 -4
- package/dist/fleet-client.d.ts +45 -14
- package/dist/fleet-client.js +24 -4
- package/dist/fleet-lease.d.ts +23 -19
- package/dist/fleet-lease.js +31 -23
- package/dist/governance-http-status.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +7 -7
- package/dist/hooks/hook-llm.js +14 -8
- package/dist/hooks/hook-runner.d.ts +58 -31
- package/dist/hooks/hook-runner.js +37 -19
- package/dist/host-decision.d.ts +5 -5
- package/dist/host-lsp-manager.d.ts +5 -5
- package/dist/hosted-posture.d.ts +23 -13
- package/dist/hosted-posture.js +4 -9
- package/dist/http/admission.d.ts +2 -2
- package/dist/http/admission.js +20 -5
- package/dist/http/approval-sweeps.d.ts +1 -1
- package/dist/http/approval-sweeps.js +2 -1
- package/dist/http/checkpoint-ctx.d.ts +62 -17
- package/dist/http/checkpoint-ctx.js +78 -35
- package/dist/http/dispatch.d.ts +3 -3
- package/dist/http/dispatch.js +9 -9
- package/dist/http/durable-run-leg.js +4 -3
- package/dist/http/idempotency.d.ts +2 -2
- package/dist/http/mcp-dial-deadline.d.ts +7 -5
- package/dist/http/memory-compliance-failure-reply.d.ts +4 -4
- package/dist/http/owner-access.d.ts +4 -6
- package/dist/http/owner-access.js +1 -1
- package/dist/http/principal-gate.d.ts +7 -7
- package/dist/http/principal-gate.js +3 -2
- package/dist/http/readiness.d.ts +1 -1
- package/dist/http/request-guards.d.ts +4 -4
- package/dist/http/request-guards.js +2 -1
- package/dist/http/resume-ctx-read.d.ts +9 -23
- package/dist/http/resume-ctx-read.js +2 -3
- package/dist/http/resume-legs.d.ts +3 -3
- package/dist/http/resume-legs.js +11 -8
- package/dist/http/route-ctx.d.ts +29 -29
- package/dist/http/route-table.d.ts +9 -9
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/approvals-assistant.d.ts +5 -7
- package/dist/http/routes/approvals-assistant.js +101 -26
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/background.js +2 -2
- package/dist/http/routes/capabilities.d.ts +1 -1
- package/dist/http/routes/capabilities.js +16 -8
- package/dist/http/routes/config-catalog.d.ts +1 -1
- package/dist/http/routes/devices.d.ts +1 -1
- package/dist/http/routes/diagnostics.d.ts +3 -3
- package/dist/http/routes/fleet.d.ts +1 -1
- package/dist/http/routes/fleet.js +2 -1
- package/dist/http/routes/mcp-reconnect.d.ts +4 -4
- package/dist/http/routes/mcp-reconnect.js +3 -3
- package/dist/http/routes/memory-consolidation.d.ts +1 -1
- package/dist/http/routes/notify-wake.d.ts +1 -1
- package/dist/http/routes/notify-wake.js +2 -2
- package/dist/http/routes/rules.d.ts +1 -1
- package/dist/http/routes/runs.js +23 -11
- package/dist/http/routes/session-sync.d.ts +1 -1
- package/dist/http/routes/session-sync.js +97 -46
- package/dist/http/routes/sessions-list.js +1 -1
- package/dist/http/routes/sessions.js +43 -53
- package/dist/http/routes/tasks.d.ts +1 -1
- package/dist/http/routes/trace-usage.d.ts +1 -1
- package/dist/http/routes/workflows.d.ts +3 -0
- package/dist/http/routes/workflows.js +31 -28
- package/dist/http/send.d.ts +5 -5
- package/dist/http/server.d.ts +34 -34
- package/dist/http/session-inherit-env.d.ts +3 -3
- package/dist/http/sse-lifecycle.d.ts +1 -1
- package/dist/http/sse-log.d.ts +2 -2
- package/dist/http/submit-ctx.js +1 -1
- package/dist/http/sync-submit-body.d.ts +1 -1
- package/dist/http/verify-rounds.d.ts +1 -1
- package/dist/http/wire-types.d.ts +33 -24
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/instruction-source-notice.d.ts +2 -2
- package/dist/key-resolver.d.ts +3 -3
- package/dist/lane-home-probe.d.ts +1 -1
- package/dist/leader/diffout.d.ts +1 -1
- package/dist/leader/diffup.d.ts +2 -2
- package/dist/leader/endpoint.d.ts +1 -1
- package/dist/leader/fanout.d.ts +1 -1
- package/dist/leader/leader.d.ts +4 -4
- package/dist/leader/merge.d.ts +3 -3
- package/dist/leader/repair-wire.d.ts +1 -1
- package/dist/leader/wire.d.ts +6 -6
- package/dist/list-entry-display.d.ts +1 -1
- package/dist/lsp-evict.d.ts +1 -1
- package/dist/mcp-assertion-header.d.ts +1 -1
- package/dist/memory-layer-legacy-lock.d.ts +1 -1
- package/dist/memory-operator-faces.d.ts +1 -1
- package/dist/memory-posture.js +4 -2
- package/dist/memory-project-layer.d.ts +1 -1
- package/dist/memory-scope.d.ts +19 -19
- package/dist/memory-store-refusal.d.ts +4 -4
- package/dist/model-entry-headers.d.ts +2 -2
- package/dist/model-entry-refusal.d.ts +17 -17
- package/dist/model-provider.d.ts +10 -10
- package/dist/model-reach-scope.d.ts +1 -1
- package/dist/model-route-endpoint.d.ts +6 -6
- package/dist/model-route-gap.d.ts +49 -4
- package/dist/model-route-gap.js +34 -1
- package/dist/model-route-url.d.ts +5 -5
- package/dist/model-select.d.ts +15 -6
- package/dist/model-select.js +5 -0
- package/dist/model-unreachable-notice.d.ts +3 -3
- package/dist/namespaced-rule-name.d.ts +15 -5
- package/dist/namespaced-rule-name.js +3 -2
- package/dist/object-store-buckets.d.ts +13 -0
- package/dist/object-store-buckets.js +3 -0
- package/dist/observability/corrupt-read-seat.d.ts +9 -9
- package/dist/observability/cost-taxonomy.d.ts +1 -1
- package/dist/observability/err-text.d.ts +1 -1
- package/dist/observability/fail-open.d.ts +17 -13
- package/dist/observability/fail-open.js +17 -13
- package/dist/observability/metrics.d.ts +3 -3
- package/dist/observability/metrics.js +1 -1
- package/dist/observability/principal-context.d.ts +4 -1
- package/dist/observability/principal-context.js +6 -1
- package/dist/observability/run-terminal.d.ts +36 -36
- package/dist/observability/secret-env-scrub.d.ts +3 -3
- package/dist/observability/tool-trace.d.ts +1 -1
- package/dist/operator-ask.d.ts +4 -4
- package/dist/orchestration/workflow-agent-session-index.d.ts +3 -3
- package/dist/orchestration/workflow-completion-inbox.d.ts +20 -5
- package/dist/orchestration/workflow-completion-inbox.js +29 -7
- package/dist/orchestration/workflow-notify-journal.d.ts +43 -19
- package/dist/orchestration/workflow-notify-journal.js +17 -0
- package/dist/outbound-dispatcher.d.ts +4 -4
- package/dist/parent-watch.d.ts +4 -4
- package/dist/parked-decide.d.ts +20 -18
- package/dist/parked-decide.js +31 -11
- package/dist/parked-revive-surface.d.ts +7 -7
- package/dist/parked-revive-surface.js +2 -3
- package/dist/peer-directory.d.ts +5 -4
- package/dist/peer-directory.js +6 -6
- package/dist/permission-rule-list.d.ts +10 -1
- package/dist/permission-rule-list.js +7 -5
- package/dist/permission-rule-vocab.d.ts +2 -2
- package/dist/plugins/adoption-log-sql.d.ts +1 -1
- package/dist/plugins/approval-ask-store-file.d.ts +8 -1
- package/dist/plugins/approval-ask-store-file.js +6 -3
- package/dist/plugins/approval-ask-store-memory.d.ts +11 -7
- package/dist/plugins/approval-ask-store-memory.js +11 -7
- package/dist/plugins/approval-ask-store-sql.d.ts +42 -15
- package/dist/plugins/approval-ask-store-sql.js +21 -5
- package/dist/plugins/approval-exemption-store.d.ts +3 -3
- package/dist/plugins/approval-nonce-store.d.ts +3 -3
- package/dist/plugins/background-agent-store-sql.d.ts +1 -1
- package/dist/plugins/background-shell-support.d.ts +2 -2
- package/dist/plugins/blob-backend.d.ts +1 -1
- package/dist/plugins/blob-backend.js +2 -1
- package/dist/plugins/caching-session-store.d.ts +23 -32
- package/dist/plugins/caching-session-store.js +5 -17
- package/dist/plugins/checkpoint-index-columns.d.ts +130 -0
- package/dist/plugins/checkpoint-index-columns.js +90 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +71 -69
- package/dist/plugins/checkpoint-store-sql.js +109 -127
- package/dist/plugins/device-store-sql.d.ts +7 -6
- package/dist/plugins/e2b-orphan-reclaim.d.ts +1 -1
- package/dist/plugins/ensure-schema-lock-policy.d.ts +1 -1
- package/dist/plugins/file-history-store-sql.d.ts +15 -7
- package/dist/plugins/file-history-store-sql.js +55 -36
- package/dist/plugins/file-run-store.d.ts +8 -8
- package/dist/plugins/fork-routing-session-store.d.ts +2 -2
- package/dist/plugins/fork-routing-session-store.js +1 -1
- package/dist/plugins/host-platform.d.ts +10 -10
- package/dist/plugins/image-bake-store-sql.d.ts +1 -1
- package/dist/plugins/image-index-sql.d.ts +1 -1
- package/dist/plugins/leader-run-store-sql.d.ts +1 -1
- package/dist/plugins/local-checkpoint-store.d.ts +10 -10
- package/dist/plugins/local-checkpoint-store.js +7 -7
- package/dist/plugins/local-session-store.d.ts +34 -38
- package/dist/plugins/local-session-store.js +20 -39
- package/dist/plugins/local-session-window.d.ts +1 -1
- package/dist/plugins/mailbox-store-sql.d.ts +2 -2
- package/dist/plugins/memory-engine-pg.d.ts +1 -1
- package/dist/plugins/memory-run-store.d.ts +4 -4
- package/dist/plugins/memory-sync-store-pg.d.ts +3 -3
- package/dist/plugins/one-time-migrations.d.ts +73 -54
- package/dist/plugins/one-time-migrations.js +131 -134
- package/dist/plugins/outcome-ledger-sql.d.ts +1 -1
- package/dist/plugins/park-commit-watch.d.ts +3 -3
- package/dist/plugins/permission-rule-store-file.d.ts +5 -5
- package/dist/plugins/permission-rule-store-file.js +12 -19
- package/dist/plugins/permission-rule-store-sql.d.ts +38 -4
- package/dist/plugins/permission-rule-store-sql.js +67 -24
- package/dist/plugins/pg-cost-quota.d.ts +1 -1
- package/dist/plugins/pg-pool.d.ts +2 -2
- package/dist/plugins/pg-pool.js +5 -2
- package/dist/plugins/pg-rate-limiter.d.ts +1 -1
- package/dist/plugins/pg-session-storage.d.ts +8 -20
- package/dist/plugins/pg-session-storage.js +14 -27
- package/dist/plugins/remote-env-adb.d.ts +10 -10
- package/dist/plugins/remote-env-device.d.ts +10 -9
- package/dist/plugins/remote-env-device.js +6 -2
- package/dist/plugins/remote-env-e2b.d.ts +3 -3
- package/dist/plugins/remote-env-host.d.ts +16 -16
- package/dist/plugins/remote-env-k8s.d.ts +26 -13
- package/dist/plugins/remote-env-k8s.js +24 -7
- package/dist/plugins/remote-env-local-docker.d.ts +2 -2
- package/dist/plugins/remote-env-ssh.d.ts +4 -4
- package/dist/plugins/remote-scratchpad.d.ts +2 -3
- package/dist/plugins/remote-scratchpad.js +0 -4
- package/dist/plugins/remote-shell.d.ts +6 -6
- package/dist/plugins/retention-lane-store-sql.d.ts +4 -4
- package/dist/plugins/retention-store-sql.d.ts +4 -4
- package/dist/plugins/roster-store-sql.d.ts +1 -1
- package/dist/plugins/run-store-sql.d.ts +8 -8
- package/dist/plugins/s3-answer.d.ts +15 -0
- package/dist/plugins/s3-answer.js +5 -0
- package/dist/plugins/schema-consistency.d.ts +2 -2
- package/dist/plugins/schema-ensure-legs.d.ts +3 -3
- package/dist/plugins/schema-indexes.d.ts +1 -1
- package/dist/plugins/schema-live-columns.d.ts +1 -1
- package/dist/plugins/session-event-payload.d.ts +4 -4
- package/dist/plugins/session-fork.d.ts +34 -0
- package/dist/plugins/session-fork.js +29 -0
- package/dist/plugins/session-ownership.js +1 -1
- package/dist/plugins/session-placement.d.ts +1 -1
- package/dist/plugins/session-policy-store-sql.d.ts +12 -12
- package/dist/plugins/session-store.d.ts +2 -2
- package/dist/plugins/session-store.js +2 -2
- package/dist/plugins/shared-memory-store-sql.d.ts +2 -2
- package/dist/plugins/snapshot-bucket-presence.d.ts +39 -4
- package/dist/plugins/snapshot-bucket-presence.js +35 -7
- package/dist/plugins/sql-driver.d.ts +8 -8
- package/dist/plugins/sql-errors.d.ts +40 -1
- package/dist/plugins/sql-errors.js +49 -1
- package/dist/plugins/sql-json-column.d.ts +21 -21
- package/dist/plugins/sql-row-helpers.d.ts +2 -2
- package/dist/plugins/store-backend.d.ts +17 -16
- package/dist/plugins/store-backend.js +3 -3
- package/dist/plugins/store-contracts.d.ts +21 -21
- package/dist/plugins/store-fault.d.ts +4 -0
- package/dist/plugins/store-fault.js +8 -0
- package/dist/plugins/task-attachment-store.d.ts +2 -2
- package/dist/plugins/task-list-store-sql.d.ts +1 -1
- package/dist/plugins/tidb-pool.d.ts +2 -2
- package/dist/plugins/tidb-pool.js +10 -3
- package/dist/plugins/tidb-session-store.d.ts +16 -26
- package/dist/plugins/tidb-session-store.js +15 -27
- package/dist/plugins/tool-result-store-sql.d.ts +1 -1
- package/dist/plugins/usage-window-store-sql.d.ts +3 -3
- package/dist/plugins/user-input-ledger-file.d.ts +1 -1
- package/dist/plugins/user-input-ledger-sql.d.ts +3 -3
- package/dist/plugins/web-search.d.ts +19 -5
- package/dist/plugins/web-search.js +20 -5
- package/dist/{orchestration/workflow-journal-entry.d.ts → plugins/workflow-journal-payload.d.ts} +23 -32
- package/dist/plugins/workflow-journal-payload.js +32 -0
- package/dist/plugins/workflow-journal-store-sql.d.ts +28 -14
- package/dist/plugins/workflow-journal-store-sql.js +34 -15
- package/dist/plugins/workflow-run-store-sql.d.ts +4 -4
- package/dist/posture-source.d.ts +11 -11
- package/dist/principal-jwt.d.ts +6 -6
- package/dist/project-identity.d.ts +3 -3
- package/dist/project-memory.d.ts +4 -4
- package/dist/read-face-posture.d.ts +7 -7
- package/dist/request-declaration-refusal.d.ts +94 -0
- package/dist/request-declaration-refusal.js +78 -0
- package/dist/request-image-urls.d.ts +6 -0
- package/dist/request-image-urls.js +27 -0
- package/dist/request-key-closure.d.ts +6 -1
- package/dist/request-key-closure.js +5 -2
- package/dist/request-value-closure.d.ts +15 -8
- package/dist/request-value-closure.js +2 -0
- package/dist/router/route-orchestration.d.ts +11 -16
- package/dist/router/route-orchestration.js +2 -12
- package/dist/rule-entry-list.d.ts +8 -7
- package/dist/rule-entry-list.js +2 -9
- package/dist/rules-consent.d.ts +6 -6
- package/dist/rules-consent.js +2 -0
- package/dist/run-cancel-context.d.ts +5 -5
- package/dist/run-local.d.ts +10 -10
- package/dist/runs.d.ts +13 -11
- package/dist/runs.js +15 -1
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-caps-resolver.js +1 -1
- package/dist/runtime-governance.d.ts +9 -9
- package/dist/sandbox-pkg-source.d.ts +17 -12
- package/dist/sandbox-pkg-source.js +14 -9
- package/dist/sealed-key.d.ts +22 -3
- package/dist/sealed-key.js +47 -4
- package/dist/security.d.ts +23 -26
- package/dist/security.js +12 -9
- package/dist/server-secret-env.d.ts +10 -10
- package/dist/session-children-retire.d.ts +1 -1
- package/dist/session-error-wire.d.ts +7 -7
- package/dist/session-incarnation.d.ts +65 -37
- package/dist/session-incarnation.js +30 -12
- package/dist/session-policy-wire.d.ts +27 -5
- package/dist/session-policy-wire.js +15 -1
- package/dist/session-records-skipped-notice.d.ts +1 -1
- package/dist/session-row.d.ts +3 -17
- package/dist/session-row.js +4 -0
- package/dist/session-sync-kernel.d.ts +4 -4
- package/dist/session-sync.d.ts +61 -6
- package/dist/session-sync.js +55 -10
- package/dist/session-titler.d.ts +7 -6
- package/dist/session-titler.js +8 -13
- package/dist/session-watch.d.ts +3 -3
- package/dist/session-watch.js +4 -4
- package/dist/sighup-idle.d.ts +2 -2
- package/dist/spec-fields.d.ts +4 -4
- package/dist/sql-engine-posture.d.ts +3 -3
- package/dist/store-posture.d.ts +2 -2
- package/dist/stored-request-tool-axes-m19.d.ts +1 -1
- package/dist/task-a2a.d.ts +52 -79
- package/dist/task-a2a.js +224 -62
- package/dist/task-cwd.d.ts +7 -88
- package/dist/task-cwd.js +2 -15
- package/dist/task-mcp.d.ts +13 -17
- package/dist/task-mcp.js +29 -49
- package/dist/task-settings.d.ts +30 -18
- package/dist/task-settings.js +33 -3
- package/dist/task-workflow.d.ts +0 -24
- package/dist/task-workflow.js +2 -1
- package/dist/terminal.d.ts +5 -5
- package/dist/tighten-only-seats.d.ts +7 -6
- package/dist/tighten-only-seats.js +1 -1
- package/dist/tool-approval.d.ts +166 -207
- package/dist/tool-approval.js +61 -61
- package/dist/tool-rule-names.d.ts +2 -2
- package/dist/trace/core-keyset-guard.d.ts +13 -8
- package/dist/trace/engine-notice-wire.d.ts +5 -5
- package/dist/trace/engine-notice-wire.js +1 -0
- package/dist/trace/exit-seat.d.ts +31 -4
- package/dist/trace/exit-seat.js +69 -67
- package/dist/trace/ledger-events.d.ts +3 -3
- package/dist/trace/ledger-sink.d.ts +1 -1
- package/dist/trace/model-segment.d.ts +3 -3
- package/dist/trace/project.d.ts +47 -45
- package/dist/trace/project.js +33 -1
- package/dist/trace/redact.d.ts +61 -31
- package/dist/trace/redact.js +394 -153
- package/dist/trace/self-minted-wire.d.ts +302 -14
- package/dist/trace/self-minted-wire.js +87 -0
- package/dist/trace/sema-provenance.d.ts +1 -1
- package/dist/trace/task-notification-facets.d.ts +4 -4
- package/dist/trace/wire-projection-faces.d.ts +3 -3
- package/dist/trace/wire-projection-faces.js +1 -1
- package/dist/unattended-permission-mode.d.ts +5 -5
- package/dist/url-credential-refusal.d.ts +52 -0
- package/dist/url-credential-refusal.js +14 -0
- package/dist/url-refusal.d.ts +16 -3
- package/dist/url-refusal.js +15 -2
- package/dist/usage-analytics.d.ts +2 -2
- package/dist/user-input-ledger.d.ts +23 -23
- package/dist/web-admin-client/apply-effective.d.ts +5 -5
- package/dist/web-admin-client/apply-effective.js +2 -1
- package/dist/web-admin-client/apply-ledger.d.ts +2 -2
- package/dist/web-admin-client/center-request.d.ts +2 -2
- package/dist/web-admin-client/facade.d.ts +5 -5
- package/dist/web-admin-client/facade.js +1 -1
- package/dist/web-admin-client/hot-keys-registry.d.ts +2 -2
- package/dist/web-admin-client/http-client.d.ts +4 -4
- package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
- package/dist/web-admin-client/pull-state.d.ts +1 -1
- package/dist/web-admin-client/read-face.d.ts +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +5 -5
- package/dist/web-admin-client/restart-signal.d.ts +6 -6
- package/dist/web-admin-client/skills-mcp.d.ts +28 -3
- package/dist/web-admin-client/skills-mcp.js +29 -1
- package/dist/web-admin-client/types.d.ts +16 -9
- package/dist/workspace-space.d.ts +32 -3
- package/dist/workspace-space.js +26 -0
- package/dist/write-protection.d.ts +2 -2
- package/package.json +5 -3
- package/scripts/drain-check-local.mjs +4 -2
- package/scripts/drain-check.mysql.sql +6 -2
- package/scripts/drain-check.pg.sql +6 -2
- package/skills/loop.md +1 -1
- package/skills/schedule.md +1 -1
- package/wire-changes/server@7.104.0.json +134 -0
- package/wire-changes/server@7.105.0.json +53 -0
- package/wire-changes/server@7.106.0.json +475 -0
- package/wire-changes/server@7.107.0.json +64 -0
- package/wire-changes/server@7.108.0.json +153 -0
- package/wire-changes/server@7.109.0.json +46 -0
- package/wire-changes/server@7.110.0.json +90 -0
- package/wire-changes/server@7.111.0.json +86 -0
- package/wire-changes/server@7.112.0.json +60 -0
- package/wire-changes/server@7.113.0.json +26 -0
- package/wire-changes/server@7.114.0.json +26 -0
- package/wire-changes/server@7.115.0.json +97 -0
- package/wire-changes/server@7.116.0.json +218 -0
- package/wire-changes/server@7.116.1.json +26 -0
- package/wire-changes/server@7.117.0.json +65 -0
- package/wire-changes/server@7.118.0.json +129 -0
- package/wire-changes/server@7.119.0.json +65 -0
- package/wire-changes/server@7.120.0.json +89 -0
- package/wire-changes/server@7.121.0.json +219 -0
- package/wire-changes/server@7.122.0.json +54 -0
- package/wire-changes/server@7.123.0.json +26 -0
- package/wire-changes/server@7.124.0.json +336 -0
- package/wire-changes/server@7.124.1.json +26 -0
- package/wire-changes/server@7.125.0.json +111 -0
- package/wire-changes/server@7.126.0.json +285 -0
- package/wire-changes/server@7.127.0.json +77 -0
- package/wire-changes/server@7.127.1.json +26 -0
- package/wire-changes/server@7.127.2.json +53 -0
- package/wire-changes/server@7.128.0.json +26 -0
- package/wire-changes/server@7.129.0.json +106 -0
- package/wire-changes/server@7.129.1.json +26 -0
- package/wire-changes/server@7.130.0.json +26 -0
- package/wire-changes/server@7.131.0.json +118 -0
- package/wire-changes/server@7.132.0.json +226 -0
- package/wire-changes/server@7.133.0.json +1155 -0
- package/wire-changes/server@7.134.0.json +107 -0
- package/wire-changes/server@7.135.0.json +174 -0
- package/wire-changes/server@7.136.0.json +448 -0
- package/dist/http/run-declared-families.d.ts +0 -16
- package/dist/http/run-declared-families.js +0 -12
- package/dist/orchestration/workflow-journal-entry.js +0 -27
package/dist/capability-facts.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { buildOperatorRosterWayOut, operatorRosterPresent } from "./http/principal-gate.js";
|
|
2
2
|
import { mcpInjectionHonored } from "./task-mcp.js";
|
|
3
|
-
import {
|
|
3
|
+
import { DEPLOYMENT_SHAPE_PREDICATES } from "./deployment-shape.js";
|
|
4
4
|
import { presentedApprovalFrameFamily, resolveStreamApprovalGate } from "./tool-approval.js";
|
|
5
5
|
import { selfOrchestrationDenial } from "./task-workflow.js";
|
|
6
6
|
import { centerEntitlementSourceWired } from "./runtime-caps-resolver.js";
|
|
7
|
-
import { overwriteWipeIncapable } from "./session-sync.js";
|
|
7
|
+
import { overwriteWipeIncapable, syncBlobFacesOf } from "./session-sync.js";
|
|
8
8
|
import { WORKSPACE_PERSIST_DEFAULT, WORKSPACE_SNAPSHOT_KEEP_DEFAULT, workspaceSnapshotTimeoutOf } from "./workspace-space.js";
|
|
9
|
+
import { headReadOf } from "./session-incarnation.js";
|
|
9
10
|
export const CAPABILITY_FACT_WHY = {
|
|
10
11
|
run_store_absent: "no durable run store is wired (DB_BACKEND=mysql|pg|local)",
|
|
11
12
|
subagent_registry_absent: "the sub-agent steer registry is not wired",
|
|
12
13
|
subagent_output_face_absent: "the background sub-agent output face is not wired",
|
|
13
14
|
task_handle_faces_absent: "the background task-handle output/stop faces are not wired",
|
|
14
|
-
|
|
15
|
+
session_head_face_absent: "the session store has no by-id head read (sessionStorage.headOf — owner, occupant and leaf of a session row in one read)",
|
|
15
16
|
checkpoint_store_absent: "no durable checkpoint store is wired (DURABLE_APPROVAL)",
|
|
16
17
|
session_audit_absent: "no session audit view is wired (needs a durable session store)",
|
|
17
18
|
session_watch_absent: "the session watch registry is not wired",
|
|
18
|
-
session_leaf_face_absent: "the session store has no leaf-read face (sessionStorage.getLeafId)",
|
|
19
19
|
session_lister_absent: "no session enumerator is wired (session store or run store listSessions)",
|
|
20
20
|
session_fork_face_absent: "the session store has no fork face",
|
|
21
|
-
session_row_faces_absent: "the session store has no session-row faces (
|
|
21
|
+
session_row_faces_absent: "the session store has no session-row faces (headOf / sessionSummaryOf / patchSessionMeta)",
|
|
22
22
|
session_purge_absent: "no session purge coordinator is wired",
|
|
23
23
|
session_policy_store_absent: "no session policy store is wired",
|
|
24
24
|
store_backend_absent: "no store backend is wired (DB_BACKEND=memory, multi-tenant bare boot, or half-configured SQL)",
|
|
@@ -96,7 +96,7 @@ export function taskHandles(d) {
|
|
|
96
96
|
}
|
|
97
97
|
export function sessionOwnership(d) {
|
|
98
98
|
const s = d.sessionStorage;
|
|
99
|
-
return s
|
|
99
|
+
return headReadOf(s) !== undefined ? yes({ sessionStorage: s }) : no("session_head_face_absent");
|
|
100
100
|
}
|
|
101
101
|
export function mcpReconnect(d) {
|
|
102
102
|
const runs = durableRuns(d);
|
|
@@ -113,12 +113,10 @@ export function sessionAuditView(d) {
|
|
|
113
113
|
export function sessionEventStream(d) {
|
|
114
114
|
if (d.sessionWatch === undefined)
|
|
115
115
|
return no("session_watch_absent");
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
return
|
|
119
|
-
|
|
120
|
-
return no("session_owner_face_absent");
|
|
121
|
-
return yes({ watch: d.sessionWatch, sessionStorage: s });
|
|
116
|
+
const owned = sessionOwnership(d);
|
|
117
|
+
if (!owned.available)
|
|
118
|
+
return owned;
|
|
119
|
+
return yes({ watch: d.sessionWatch, sessionStorage: owned.sessionStorage });
|
|
122
120
|
}
|
|
123
121
|
export function sessionList(d) {
|
|
124
122
|
const lister = d.sessionStorage?.listSessions?.bind(d.sessionStorage) ?? d.runStore?.listSessions?.bind(d.runStore);
|
|
@@ -128,13 +126,13 @@ export function sessionFork(d) {
|
|
|
128
126
|
const s = d.sessionStorage;
|
|
129
127
|
if (s?.fork === undefined)
|
|
130
128
|
return no("session_fork_face_absent");
|
|
131
|
-
if (s
|
|
132
|
-
return no("
|
|
129
|
+
if (headReadOf(s) === undefined)
|
|
130
|
+
return no("session_head_face_absent");
|
|
133
131
|
return yes({ sessionStorage: s });
|
|
134
132
|
}
|
|
135
133
|
export function sessionPatch(d) {
|
|
136
134
|
const s = d.sessionStorage;
|
|
137
|
-
if (s
|
|
135
|
+
if (headReadOf(s) === undefined || s?.patchSessionMeta === undefined)
|
|
138
136
|
return no("session_row_faces_absent");
|
|
139
137
|
return yes({ sessionStorage: s });
|
|
140
138
|
}
|
|
@@ -164,7 +162,7 @@ export function sessionSync(d) {
|
|
|
164
162
|
return no("session_export_absent");
|
|
165
163
|
if (s.beginImportStaging === undefined)
|
|
166
164
|
return no("session_import_staging_absent");
|
|
167
|
-
if (s
|
|
165
|
+
if (headReadOf(s) === undefined || s.sessionSummaryOf === undefined || s.patchSessionMeta === undefined)
|
|
168
166
|
return no("session_row_faces_absent");
|
|
169
167
|
if (overwriteWipeIncapable(d.sessionPolicyStore))
|
|
170
168
|
return no("policy_purge_absent");
|
|
@@ -174,10 +172,8 @@ export function sessionSyncFileHistory(d) {
|
|
|
174
172
|
const sync = sessionSync(d);
|
|
175
173
|
if (!sync.available)
|
|
176
174
|
return sync;
|
|
177
|
-
const
|
|
178
|
-
return
|
|
179
|
-
? yes({ historyStore: fs })
|
|
180
|
-
: no("sync_blob_faces_absent");
|
|
175
|
+
const faces = syncBlobFacesOf(sync.historyStore);
|
|
176
|
+
return faces !== undefined ? yes({ historyStore: faces }) : no("sync_blob_faces_absent");
|
|
181
177
|
}
|
|
182
178
|
export function checkpointPark(d) {
|
|
183
179
|
return d.checkpointStore !== undefined ? yes({ checkpointStore: d.checkpointStore }) : no("checkpoint_store_absent");
|
|
@@ -216,7 +212,7 @@ export function streamApproval(d) {
|
|
|
216
212
|
}
|
|
217
213
|
}
|
|
218
214
|
export function readRootGrant(d) {
|
|
219
|
-
return
|
|
215
|
+
return DEPLOYMENT_SHAPE_PREDICATES.callerOwnsWorkerDisk.holds(d.config) ? YES : no("read_root_grant_posture_refused");
|
|
220
216
|
}
|
|
221
217
|
export function approvalFrameFamilies(stream) {
|
|
222
218
|
if (stream.available)
|
|
@@ -69,7 +69,7 @@ export interface CenterCredentialSource {
|
|
|
69
69
|
read(): CenterCredentialRead;
|
|
70
70
|
health(): CenterCredentialHealth;
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* [ref]:每次取值之后**同步**回调一次(入参 = 这次的结果,已记进健康态)。续签器的唯一触发口(设计 §2「每次取值后,
|
|
73
73
|
* 读到 user-session 信封且在提前量内 ⇒ 排队一次续签」)。返回退订。回调不许抛(抛 = 这次取值跟着抛,响亮)。
|
|
74
74
|
*/
|
|
75
75
|
onRead(listener: (read: CenterCredentialRead) => void): () => void;
|
|
@@ -92,14 +92,11 @@ export type CenterCredentialSourceSpec = Exclude<WebAdminCredentialDeclaration,
|
|
|
92
92
|
readonly multiTenant: boolean;
|
|
93
93
|
};
|
|
94
94
|
/**
|
|
95
|
-
* 读两个声明键 —— 判定全交 settings-schema 的判官 `judgeWebAdminCredentialDeclaration`(
|
|
95
|
+
* 读两个声明键 —— 判定全交 settings-schema 的判官 `judgeWebAdminCredentialDeclaration`([ref]:二选一规则的**唯一**实现;空串 = 未设、
|
|
96
96
|
* 不 trim;两个都设 ⇒ throw,boot 拒启,拒句点名两个键、不回显值)。本仓只多读方自己的那一步:文件路径按本进程 cwd 解析成绝对
|
|
97
97
|
* 路径(之后 cwd 变了也读同一个文件 —— 纯契约不碰 `node:path`,这一步归读方)。
|
|
98
98
|
*/
|
|
99
99
|
export declare function readCenterCredentialDeclaration(env?: Readonly<Record<string, string | undefined>>): WebAdminCredentialDeclaration;
|
|
100
|
-
/** 拉取令牌形的身份 = worker(拉取令牌代表 worker,不是人)。种类判别与 formatVersion 1 LKG 的一次性迁移
|
|
101
|
-
* (`config-lkg.ts` `migrateV1Lkg`:v1 信封只记 worker,只有这一形的身份推得出来)共用这一只。 */
|
|
102
|
-
export declare function pullTokenIdentity(worker: string | undefined): string;
|
|
103
100
|
/**
|
|
104
101
|
* 凭证来源工厂(活对象:文件形每次取值读盘并记健康态)。`worker` = `SEMA_WEB_ADMIN_WORKER`(拉取令牌形的身份)。
|
|
105
102
|
* `readFile` / `now` 只为测试注入。
|
|
@@ -128,7 +125,7 @@ export declare const CENTER_CREDENTIAL_REFUSAL_CODES: {
|
|
|
128
125
|
};
|
|
129
126
|
export type CenterCredentialRefusalCode = (typeof CENTER_CREDENTIAL_REFUSAL_CODES)[keyof typeof CENTER_CREDENTIAL_REFUSAL_CODES];
|
|
130
127
|
/**
|
|
131
|
-
*
|
|
128
|
+
* [ref] —— boot 读到的凭证怎么处置(`boot/web-admin.ts` 执行,规则只在这里):
|
|
132
129
|
* · `missing` / `expired` ⇒ 响亮(error 级一行),照常起服 —— 前者是「此刻没有凭证」(登出形,文件出现即恢复),
|
|
133
130
|
* 后者续签器立刻续签;
|
|
134
131
|
* · `malformed` / `multi_tenant_session` ⇒ **拒启**,拒句带码、点名文件键,不回显内容(`reason` 由本模块铸,本来就不含内容)。
|
|
@@ -144,7 +141,7 @@ export declare function scopedTokenNeedsWorker(read: CenterCredentialRead, worke
|
|
|
144
141
|
*/
|
|
145
142
|
export declare function centerStateBin(worker: string | undefined, identity: string): string;
|
|
146
143
|
/** 此刻凭证的身份(每次现读);取不到凭证 ⇒ `undefined`(身份未知)—— 唯一例外是 `expired`:令牌不许出站,但信封还读得出
|
|
147
|
-
* 是谁(
|
|
144
|
+
* 是谁([ref]:过期不等于换了人,盘上 LKG / prompt 分箱照常对得上)。「我现在是谁」只有这一只读法。 */
|
|
148
145
|
export declare function credentialIdentityNow(source: CenterCredentialSource): string | undefined;
|
|
149
146
|
/**
|
|
150
147
|
* [ref] E-15 ② —— 一次中心往返的答复**仍属于此刻的凭证**:发出它所用的身份 = 此刻的身份。
|
|
@@ -161,6 +158,23 @@ export declare function answerStillCurrent(source: CenterCredentialSource, usedI
|
|
|
161
158
|
* 中心答复;缓存 / 在飞 / 条件请求的校验子全在箱里,换了人结构上够不着上一个人的。
|
|
162
159
|
* · 请求发出之后才换人:答复到达时由 {@link answerStillCurrent} 判丢弃(请求装配侧,见 http-client.ts)。
|
|
163
160
|
* 旧身份的箱不淘汰(量级 = 进程生命期内出现过的身份数):换回来的身份在 TTL 内照常命中它自己的缓存。
|
|
161
|
+
* 取箱口两只({@link IdentityBins}):`now`(此刻身份)与 `accounting`(记账身份:执行开始时钉下的那个,[ref])。
|
|
164
162
|
*/
|
|
165
|
-
export declare function createIdentityBins<T>(source: CenterCredentialSource, make: (pinned: CenterCredentialSource) => T):
|
|
163
|
+
export declare function createIdentityBins<T>(source: CenterCredentialSource, make: (pinned: CenterCredentialSource) => T): IdentityBins<T>;
|
|
164
|
+
/**
|
|
165
|
+
* 同一只分箱规则的两个取箱口(箱表、钉住的凭证、惰建都只有一份):
|
|
166
|
+
* · `now` —— 此刻凭证身份的箱(缓存 / 在飞去重 / 用量环上报这一类「此刻是谁就替谁办」的读者);
|
|
167
|
+
* · `accounting` —— **记账身份**的箱([ref]:花费扣减、用量记账):这次执行开始时钉下的身份({@link pinAccountingIdentity});不在执行里 / 没钉 ⇒ 同 `now`。
|
|
168
|
+
* 在飞调用完成时凭证换了人或暂时读不到,都不改它记在谁的箱里。
|
|
169
|
+
*/
|
|
170
|
+
export interface IdentityBins<T> {
|
|
171
|
+
now(): T;
|
|
172
|
+
accounting(): T;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* [ref] —— 把这次执行的**记账身份**钉在此刻(执行的第一帧 `task.start` 由 tracer 调;每个凭证来源每次执行至多钉一次,先到为准 ——
|
|
176
|
+
* 同一执行里子任务的 `task.start` 不改它)。此刻身份未知(凭证读不到)⇒ **不钉**:不把这次执行记到「身份未知」的无主箱,它的记账按记账那一刻的身份。
|
|
177
|
+
* 不在执行作用域里(`withPrincipal` 之外)⇒ 无动作。
|
|
178
|
+
*/
|
|
179
|
+
export declare function pinAccountingIdentity(source: CenterCredentialSource): void;
|
|
166
180
|
//# sourceMappingURL=center-credential.d.ts.map
|
|
@@ -2,6 +2,7 @@ import { readFileSync } from "node:fs";
|
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { resolve as resolvePath } from "node:path";
|
|
4
4
|
import { looksLikeJwt } from "@sema-agent/settings-schema/api/auth-bridge";
|
|
5
|
+
import { currentExecutionPins } from "./observability/principal-context.js";
|
|
5
6
|
import { WEB_ADMIN_ENV, judgeWebAdminCredentialDeclaration, parseWebAdminCredentialFile } from "@sema-agent/settings-schema";
|
|
6
7
|
export class CenterCredentialUnavailableError extends Error {
|
|
7
8
|
reason;
|
|
@@ -37,7 +38,7 @@ function classify(bearer, worker) {
|
|
|
37
38
|
return { ok: true, kind: "user-jwt", bearer, identity: userTokenIdentity(bearer) };
|
|
38
39
|
return { ok: true, kind: "pull-token", bearer, identity: pullTokenIdentity(worker), workerScoped: bearer.startsWith("wpt_") };
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
+
function pullTokenIdentity(worker) {
|
|
41
42
|
return `pull-token:${worker ?? "global"}`;
|
|
42
43
|
}
|
|
43
44
|
const NONE = { ok: true, kind: "none", identity: "none" };
|
|
@@ -178,14 +179,28 @@ export function answerStillCurrent(source, usedIdentity) {
|
|
|
178
179
|
}
|
|
179
180
|
export function createIdentityBins(source, make) {
|
|
180
181
|
const bins = new Map();
|
|
181
|
-
|
|
182
|
-
const identity = credentialIdentityNow(source);
|
|
182
|
+
const binOf = (identity) => {
|
|
183
183
|
if (bins.has(identity))
|
|
184
184
|
return bins.get(identity);
|
|
185
185
|
const made = make(pinCredential(source, identity));
|
|
186
186
|
bins.set(identity, made);
|
|
187
187
|
return made;
|
|
188
188
|
};
|
|
189
|
+
return {
|
|
190
|
+
now: () => binOf(credentialIdentityNow(source)),
|
|
191
|
+
accounting: () => binOf(accountingIdentityOf(source)),
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
export function pinAccountingIdentity(source) {
|
|
195
|
+
const pins = currentExecutionPins();
|
|
196
|
+
if (pins === undefined || pins.has(source))
|
|
197
|
+
return;
|
|
198
|
+
const identity = credentialIdentityNow(source);
|
|
199
|
+
if (identity !== undefined)
|
|
200
|
+
pins.set(source, identity);
|
|
201
|
+
}
|
|
202
|
+
function accountingIdentityOf(source) {
|
|
203
|
+
return currentExecutionPins()?.get(source) ?? credentialIdentityNow(source);
|
|
189
204
|
}
|
|
190
205
|
function pinCredential(source, identity) {
|
|
191
206
|
return {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/** `checkpointId` 的长度上界(见本文件头注第 2 条)。 */
|
|
2
2
|
export declare const MAX_CHECKPOINT_ID_CHARS = 128;
|
|
3
|
+
/**
|
|
4
|
+
* 一句要出店的话(日志 / 探针行)里**不许**含这一行的 token:大小写不敏感地把每一处换成记号 —— 与 {@link trustedCheckpointId} 同一条「包含关系 + 大小写不敏感」判据,
|
|
5
|
+
* 用在交不了值、只交得了一句话的出口(引擎铸的披露句按 checkpoint id 点名,而 id 可能被写成了 token)。token 为空 ⇒ 原句。
|
|
6
|
+
*/
|
|
7
|
+
export declare function withoutCheckpointToken(text: string, token: unknown): string;
|
|
3
8
|
/** 持久层读出的 `checkpointId` 过信任边界:是串、非空、不超长、不含 token(大小写不敏感)⇒ 原值;否则 `undefined`。判据全文见本文件头注。 */
|
|
4
9
|
export declare function trustedCheckpointId(raw: unknown, token: unknown): string | undefined;
|
|
5
10
|
/** 带 `checkpointId` 当 join 键的两类 durable 读面(计数 detail 的 `face`)。 */
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { recordFailOpen } from "./observability/fail-open.js";
|
|
2
2
|
export const MAX_CHECKPOINT_ID_CHARS = 128;
|
|
3
|
+
export function withoutCheckpointToken(text, token) {
|
|
4
|
+
const secret = token === undefined || token === null ? "" : String(token);
|
|
5
|
+
if (secret === "")
|
|
6
|
+
return text;
|
|
7
|
+
const lower = text.toLowerCase();
|
|
8
|
+
const needle = secret.toLowerCase();
|
|
9
|
+
let out = "";
|
|
10
|
+
let from = 0;
|
|
11
|
+
for (let at = lower.indexOf(needle); at !== -1; at = lower.indexOf(needle, from)) {
|
|
12
|
+
out += `${text.slice(from, at)}«checkpoint token»`;
|
|
13
|
+
from = at + needle.length;
|
|
14
|
+
}
|
|
15
|
+
return out + text.slice(from);
|
|
16
|
+
}
|
|
3
17
|
export function trustedCheckpointId(raw, token) {
|
|
4
18
|
if (typeof raw !== "string" || raw === "" || raw.length > MAX_CHECKPOINT_ID_CHARS)
|
|
5
19
|
return undefined;
|
package/dist/config-catalog.d.ts
CHANGED
|
@@ -36,12 +36,12 @@ export interface ConfigCatalogSpec {
|
|
|
36
36
|
readonly danger?: readonly CatalogDangerAxis[];
|
|
37
37
|
readonly enumValues?: readonly string[];
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* [ref]① —— 本行**回显**得出的词集(`enumValues` 的子集;缺席 ⇒ 与 `enumValues` 同集)。
|
|
40
40
|
*
|
|
41
41
|
* 🔴 `enumValues` 一直是**两义**的:它既是行对外宣告的「你可以写哪些词」([ref] 件⑤/⑧ 两条钉逐字锚
|
|
42
42
|
* 这一义:窄了=少宣告一档、宽了=宣告一个 boot 会拒的词),又被回显校验当成「实算值合不合法」的闭集。
|
|
43
43
|
* 两义在**多数**行上碰巧同集,于是差别只活在散文里 —— `MANUAL_MODE_SHELL_GATE` 的
|
|
44
|
-
* `derivedDefaultNote` 写着「真姿态只有 always 一个」(
|
|
44
|
+
* `derivedDefaultNote` 写着「真姿态只有 always 一个」([ref] 前是 always/classify 两个),`MODEL_DEFAULT_THINKING` 写着
|
|
45
45
|
* 「缺席/off ⇒ 不铸」,而**没有任何一条腿读那两句话**:`off` 照样留在回显闭集里,回显校验对它放行。
|
|
46
46
|
*
|
|
47
47
|
* ⇒ 把那半句散文变成一处**校验腿真读的声明**:`sanitizeEnumValue` 问 `echoWords ?? enumValues`,
|
|
@@ -53,7 +53,7 @@ export interface ConfigCatalogSpec {
|
|
|
53
53
|
*/
|
|
54
54
|
readonly echoWords?: readonly string[];
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* [ref] —— **底层布尔 ↔ 闭集词**的行内映射,只给「实算腿回布尔、而行对外说词」的 enum 行。
|
|
57
57
|
*
|
|
58
58
|
* 为什么写在行上而不是建第二张全局极性表:`config.ts` 的极性表(`ConfigKnobRecord`)记的是
|
|
59
59
|
* **布尔旋钮**的来源与默认方向,它压根不带词 —— 拿它当 `true→enumValues[0]` 的位置约定用,等于
|
|
@@ -73,7 +73,7 @@ export interface ConfigCatalogSpec {
|
|
|
73
73
|
*
|
|
74
74
|
* 🔴 第二参是**部署 env**,不是第五条供值腿:有几根旋钮的属主不在 `ServiceConfig` 上(它在装配点按
|
|
75
75
|
* env 现算,如 WebSearch 后端),而目录的纪律是「回显属主算出来的值」—— 只能把同一条实算腿的入参放宽,
|
|
76
|
-
* 不能在目录里再抄一遍属主的读法(
|
|
76
|
+
* 不能在目录里再抄一遍属主的读法([ref] / codex r1 F3 的成案:抄一遍就是第二个写者,当场分歧)。
|
|
77
77
|
*/
|
|
78
78
|
readonly resolve?: (config: ServiceConfig, env: NodeJS.ProcessEnv, boot: CatalogBootFacts) => CatalogValue | undefined;
|
|
79
79
|
readonly center?: CatalogCenterSeatSpec;
|
|
@@ -94,12 +94,12 @@ export interface ConfigCatalogRowCenter {
|
|
|
94
94
|
readonly effectiveNow: boolean;
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
|
-
* 行上**对 `effectiveValue` 的判词位**(闭集;
|
|
97
|
+
* 行上**对 `effectiveValue` 的判词位**(闭集;[ref] 收成一族)—— 每一位**只在为真时铸 `true`、恒不铸 `false`**,缺席 = 这一格没有这件事
|
|
98
98
|
* (不是「不知道」)。净化器({@link sanitizeValue})一次读出值与判词,行投影原样铺平 —— 判词位只有这一种形,第三个判词位加进本闭集即受同一条约束。
|
|
99
|
-
* · `effectiveValueInvalid`(
|
|
99
|
+
* · `effectiveValueInvalid`([ref],additive)—— 本行的实算值**落在它自己宣告的回显闭集之外**(`echoWords ?? enumValues`,[ref]①),
|
|
100
100
|
* 或它的实算腿回了一个本行没有声明映射的布尔。在场时 `effectiveValue` 恒 `null`:回显一个集外值等于目录在教消费方写一个写回去就非法的词,
|
|
101
101
|
* 而**静默丢**会让「配错了」与「真的没设」在 wire 上同形([ref] 响亮臂)。只服务闭集族(`type:"enum"`)。
|
|
102
|
-
* · `effectiveValueWithheld`(
|
|
102
|
+
* · `effectiveValueWithheld`([ref],additive)—— `type:"url"` 行:展示铸点对这一格(单值)或其中任一项(列表)判了扣下(`failedClosed`:
|
|
103
103
|
* 位置律本会显示的一段 —— 整段 query / 一个路径段 —— 因为里面有一条凭据形而不出门)。判决的属主是铸点,目录不另判;
|
|
104
104
|
* 标准位置律(userinfo 落地、query 每个值成记号)对每一行同样成立,不是扣下;值整只成占位 = 这一行的展示律显示不了这个值
|
|
105
105
|
* (通用 url 行:不是层级式 URL;两只出网代理行的展示律更窄 —— 只显示 `scheme://host[:port]`,形不干净整只占位,`outbound-dispatcher.ts` `displayProxyUrl`),也不是本位。
|
|
@@ -135,7 +135,7 @@ export interface ConfigCatalogRow extends CatalogValueVerdicts {
|
|
|
135
135
|
* 而不是回表态原词、未设回 `null`。入参对象本身**必填**(每个调用点都得表态这次有哪些装配事实)。
|
|
136
136
|
*/
|
|
137
137
|
export interface CatalogBootFacts {
|
|
138
|
-
/** 记忆整理阀门的生效值(boot 第 4 段 `createConsolidationValve` 的判决:显式词,或
|
|
138
|
+
/** 记忆整理阀门的生效值(boot 第 4 段 `createConsolidationValve` 的判决:显式词,或 [ref] / [ref] 的出厂缺省派生)。
|
|
139
139
|
* 缺席 = 这次装配没有这件事实(只有不经真装配的桩服务:`ServiceDeps` 平铺视图里组字段是可选的;真装配的分组形里它必填)
|
|
140
140
|
* ⇒ 实算腿答「不知道」(落 env 原文 / null),不猜。 */
|
|
141
141
|
readonly memoryConsolidationValve?: {
|
|
@@ -149,7 +149,7 @@ export interface ConfigCatalogInputs {
|
|
|
149
149
|
readonly boot: CatalogBootFacts;
|
|
150
150
|
readonly knobs: readonly ConfigKnobRecord[];
|
|
151
151
|
/** settings-schema 现行 DOMAINS(调用方传入,原样上 wire 的 `centerDomains` 列表)。🔴 7.106.0 起本注改真:本模块**不是**零包依赖 ——
|
|
152
|
-
* 它值级 import 了 core 与契约包(词表 / 中心凭证键名 /
|
|
152
|
+
* 它值级 import 了 core 与契约包(词表 / 中心凭证键名 / [ref] ⑤a 的 `DOMAIN_SCHEMAS` 座位门);这一格照旧由调用方传,
|
|
153
153
|
* 只因为它是 wire 上的一段列表、由路由决定取哪一份。 */
|
|
154
154
|
readonly centerDomains: readonly string[];
|
|
155
155
|
/** web-admin 当前在管的 ServiceConfig 键集(缺席 = 没有配置管道)。 */
|
|
@@ -168,7 +168,7 @@ export interface ConfigCatalogWire {
|
|
|
168
168
|
readonly centerManaged: number;
|
|
169
169
|
};
|
|
170
170
|
readonly rows: readonly ConfigCatalogRow[];
|
|
171
|
-
/**
|
|
171
|
+
/** [ref](7.106.0)—— 退役 env 墓碑表(settings-schema `RETIRED_ENVS`,本进程起服按它拒启)的投影 `buildRetiredEnvWire()`,**恒在场**
|
|
172
172
|
* (可为空数组)。与 `rows` 分开:rows 是「本进程会读的 env」,这里是「本进程会拒的旧名」—— 一个名字不会同时在两处(墓碑名没有读取点)。 */
|
|
173
173
|
readonly retired: readonly RetiredEnvWire[];
|
|
174
174
|
}
|
|
@@ -178,7 +178,7 @@ export interface ConfigCatalogWire {
|
|
|
178
178
|
*/
|
|
179
179
|
export declare const CONFIG_CATALOG: readonly ConfigCatalogSpec[];
|
|
180
180
|
/**
|
|
181
|
-
*
|
|
181
|
+
* [ref] ⑤a —— **目录座位加载期门**(类修:一次把「目录声称了契约里没有的中心写位」整类关掉)。
|
|
182
182
|
*
|
|
183
183
|
* 行上的 `center` 座位说的是「中心能发布这个键」。它必须对得上契约包 `@sema-agent/settings-schema` 的 `DOMAIN_SCHEMAS`:
|
|
184
184
|
* ① 域在场;② `path` 在该域的 zod 形里解析得出(`a.b` 逐段进对象;`xs[].c` = 进数组元素)。任一不成立 ⇒ **抛**(模块加载即抛:
|
|
@@ -188,7 +188,7 @@ export declare const CONFIG_CATALOG: readonly ConfigCatalogSpec[];
|
|
|
188
188
|
* 解析只认 zod 的结构外衣(optional / nullable / default / catch / readonly / effects·管道 / lazy)与对象 / 数组两种容器;认不出的节点 = 解析不出
|
|
189
189
|
* (fail-closed:宁可多拒一个座位,也不放过一个假座位)。
|
|
190
190
|
*
|
|
191
|
-
* 🔴
|
|
191
|
+
* 🔴 [ref](7.106.0 合并复审 opus 腿 L-1):**只走 zod 公开面**。契约包今天是 zod 3.25、本仓是 zod 4 —— 读 zod 私有定义字段(类型判别名 /
|
|
192
192
|
* 内层 schema / lazy getter)的旧写法在契约包升 zod 4 那天会让 `models[].…` 整族座位解析不出,模块 import 期整只抛。两大版没有一个能同时
|
|
193
193
|
* 公开读到的「这是什么节点」判别位(v4 的 `.def.type` 在 v3 上不存在),`instanceof` 也跨不了两份 zod 的类身份 ⇒ 按两大版**同名的公开访问器**
|
|
194
194
|
* 认形,规则三条(见 {@link zodObjectShapeOf} / {@link isZodArrayFace} / {@link ZOD_WRAPPER_FACES})。钉:`test/config-catalog-zod-public-face.test.ts`。
|
package/dist/config-catalog.js
CHANGED
|
@@ -4,7 +4,8 @@ import { WEB_ADMIN_ENV, DOMAIN_SCHEMAS, buildRetiredEnvWire } from "@sema-agent/
|
|
|
4
4
|
import { CENTER_CREDENTIAL_RENEW_LEAD_DEFAULT_MS, CENTER_CREDENTIAL_RENEW_LEAD_MAX_MS, CENTER_CREDENTIAL_RENEW_LEAD_MIN_MS } from "./center-credential-renewer.js";
|
|
5
5
|
import { SANDBOX_IPV6_DEFAULT, SANDBOX_IPV6_WORDS } from "./sandbox-egress-policy.js";
|
|
6
6
|
import { WORKSPACE_CACHE_DEFAULT, WORKSPACE_CACHE_MOUNT_DEFAULT, WORKSPACE_CACHE_SIZE_DEFAULT, WORKSPACE_CACHE_WORDS } from "./workspace-cache.js";
|
|
7
|
-
import {
|
|
7
|
+
import { SESSION_SNAPSHOT_BUCKET_DEFAULT, WORKSPACE_SNAPSHOT_BUCKET_DEFAULT } from "./object-store-buckets.js";
|
|
8
|
+
import { WORKSPACE_PERSIST_DEFAULT, WORKSPACE_PERSIST_WORDS, WORKSPACE_SNAPSHOT_KEEP_DEFAULT, WORKSPACE_SNAPSHOT_KEEP_RANGE, WORKSPACE_SNAPSHOT_PREFIX_DEFAULT, WORKSPACE_SNAPSHOT_TIMEOUT_MS_DEFAULT, WORKSPACE_SNAPSHOT_TIMEOUT_MS_RANGE } from "./workspace-space.js";
|
|
8
9
|
import { APPROVAL_ASK_RETENTION_DEFAULT_MS, APPROVAL_ASK_RETENTION_FLOOR_MS } from "./approval-ask-retention.js";
|
|
9
10
|
import { LIVENESS_MS_DEFAULT } from "./exec-bounds.js";
|
|
10
11
|
import { THINKING_FORMATS } from "./model-compat.js";
|
|
@@ -60,8 +61,8 @@ export const CONFIG_CATALOG = [
|
|
|
60
61
|
r("ADB_SERIAL", "orchestration", "string", "adb 车道目标设备 serial(REMOTE_EXEC=adb 的必需件,缺 ⇒ 拒启)"),
|
|
61
62
|
r("AGENT_DATA_DIR", "store", "path", "本机数据根回落链一环(LOCAL_DATA_ROOT → CONFIG_LOCAL_DIR → AGENT_DATA_DIR → ~/.ai-agent);记忆引擎缺省根同链", { danger: DATA, derivedDefaultNote: "缺席 ⇒ 链上下一环,最终 ~/.ai-agent" }),
|
|
62
63
|
r("ALLOW_UNAUTHED_WRITES", "auth", "boolean", "无 service token 时仍接受任务提交(本地开发逃生口;缺省 fail-closed 拒提交)", { staticDefault: "false", danger: SEC, configKey: "allowUnauthedWrites" }),
|
|
63
|
-
r("ANTHROPIC_API_KEY", "modelPlane", "secret", "Anthropic 协议路线的 x-api-key 凭据(
|
|
64
|
-
r("ANTHROPIC_AUTH_TOKEN", "modelPlane", "secret", "Anthropic 兼容生态的 Bearer 凭据(
|
|
64
|
+
r("ANTHROPIC_API_KEY", "modelPlane", "secret", "Anthropic 协议路线的 x-api-key 凭据(只发 x-api-key 头;与 ANTHROPIC_AUTH_TOKEN 互斥 —— 同设拒启,机读码 `config.anthropic_credential_conflict`;与 BASE_URL 同在时可推断 provider)", { danger: [...SEC, ...BILL] }),
|
|
65
|
+
r("ANTHROPIC_AUTH_TOKEN", "modelPlane", "secret", "Anthropic 兼容生态的 Bearer 凭据(只发 Authorization: Bearer 头;与 ANTHROPIC_API_KEY 互斥 —— 同设拒启,机读码 `config.anthropic_credential_conflict`)", { danger: [...SEC, ...BILL] }),
|
|
65
66
|
r("ANTHROPIC_BASE_URL", "modelPlane", "url", "Anthropic 协议路线 base URL(与凭据同在且 MODEL_PROVIDER 未设 ⇒ 推断 provider=anthropic 并 boot notice;S-475:带 userinfo 拒启,机读码 `config.gateway_url_userinfo`;S-483:解析不动/不透明形拒启,机读码 `config.model_route_url_invalid`;S-514:带 `#fragment` 拒启,机读码 `config.model_route_url_fragment` —— fragment 从不上线,后缀会落进被丢弃的那一半)"),
|
|
66
67
|
r("ANTHROPIC_CACHE_BREAKPOINTS", "modelPlane", "boolean", "Anthropic 路线 prompt-cache breakpoints 开关", { staticDefault: "true" }),
|
|
67
68
|
r("ANTHROPIC_MAX_RETRIES", "modelPlane", "number", "Anthropic 路线 SDK 每次调用重试上限", { derivedDefaultNote: "缺席 ⇒ 不传引擎,core/SDK 默认当家" }),
|
|
@@ -236,10 +237,10 @@ export const CONFIG_CATALOG = [
|
|
|
236
237
|
r("MAX_TASK_COST_USD", "limitsHttp", "number", "单任务成本天花板(0=关)", { staticDefault: "0", danger: BILL, configKey: "maxTaskCostUsd", center: cLimits("maxTaskCostUsd") }),
|
|
237
238
|
r("MAX_TASK_TOKENS", "limitsHttp", "number", "单任务 token 天花板(per-slice 窗;0=关)", { staticDefault: "0", danger: BILL, configKey: "maxTaskTokens", center: cLimits("maxTaskTokens") }),
|
|
238
239
|
r("MCP_ELICITATION_ENABLED", "approval", "boolean", "入站 MCP elicitation HITL(per-server opt-in 另有一道)", { staticDefault: "false", danger: SEC }),
|
|
239
|
-
r("MCP_ELICITATION_MAX_CONCURRENT", "approval", "number", "elicitation 每 run 并发帽", { derivedDefaultNote: "缺席 ⇒
|
|
240
|
-
r("MCP_ELICITATION_MAX_TOTAL", "approval", "number", "elicitation 每 run 总量帽", { derivedDefaultNote: "缺席 ⇒
|
|
241
|
-
r("MCP_ELICITATION_MIN_INTERVAL_MS", "approval", "number", "elicitation per-server 最小间隔(ms)", { derivedDefaultNote: "缺席 ⇒
|
|
242
|
-
r("MCP_ELICITATION_TTL_MS", "approval", "number", "elicitation 无人应答释放窗(ms)", { derivedDefaultNote: "缺席 ⇒
|
|
240
|
+
r("MCP_ELICITATION_MAX_CONCURRENT", "approval", "number", "elicitation 每 run 并发帽", { derivedDefaultNote: "缺席 ⇒ 本服务出厂窗(DEFAULT_ELICITATION_THROTTLE)" }),
|
|
241
|
+
r("MCP_ELICITATION_MAX_TOTAL", "approval", "number", "elicitation 每 run 总量帽", { derivedDefaultNote: "缺席 ⇒ 本服务出厂窗(DEFAULT_ELICITATION_THROTTLE)" }),
|
|
242
|
+
r("MCP_ELICITATION_MIN_INTERVAL_MS", "approval", "number", "elicitation per-server 最小间隔(ms)", { derivedDefaultNote: "缺席 ⇒ 本服务出厂窗(DEFAULT_ELICITATION_THROTTLE)" }),
|
|
243
|
+
r("MCP_ELICITATION_TTL_MS", "approval", "number", "elicitation 无人应答释放窗(ms)", { derivedDefaultNote: "缺席 ⇒ 本服务出厂窗(DEFAULT_ELICITATION_THROTTLE)" }),
|
|
243
244
|
r("MEMORY_AUTO_CONSOLIDATION", "memory", "enum", "记忆自动整理部署席(on=每个建议任务后整库整理跑,记忆内容自动外流到整理模型;off=显式关,胜过引擎缺省;未设=读引擎具名缺省)", { enumValues: ["on", "off"], derivedDefaultNote: "缺席 ⇒ 引擎具名缺省(**本版装的引擎是开**)——不配不等于关;前置=整理阀门开着(MEMORY_CONSOLIDATION_DRIVER=on,或未设而出厂缺省派生成开)", danger: SEC, resolve: (c) => c.memoryConsolidationDriver.autoRunOnRecommendation, booleanEnum: { true: "on", false: "off" } }),
|
|
244
245
|
r("MEMORY_CAPTURE_POLICY", "memory", "enum", "记忆 capture 姿态(open=声明按面值;governed=按 per-principal verdict;capture-required=恒采)", { enumValues: ["open", "governed", "capture-required"], staticDefault: "open", danger: SEC, configKey: "memoryCapturePolicy" }),
|
|
245
246
|
r("MEMORY_CONSOLIDATION_DRIVER", "memory", "enum", "记忆折叠阀门(off=零装配零探针,两 admin 口 404 族;on=座解析 + 两 admin 口 + 引擎面整理两席)", { enumValues: ["on", "off"], derivedDefaultNote: "缺席 ⇒ 起服时派生:整理座不落主模型(MODEL_CHEAP_ID 在场且异于 MODEL_ID,或目录给 consolidate / summarize / flash 档位绑了别的模型)⇒ on;落主模型 ⇒ off + 起服 warn memory_consolidation_default_off_no_cheap_model;结构上跑不起来(无记忆引擎 / pg·tidb 记忆后端 / MEMORY_PROVENANCE=off)⇒ 恒 off 零提示。显式 on 而落主模型 ⇒ 照开 + warn memory_consolidation_on_main_model(按主模型计费)", danger: BILL, resolve: (_c, _env, boot) => (boot.memoryConsolidationValve === undefined ? undefined : boot.memoryConsolidationValve.enabled ? "on" : "off") }),
|
|
@@ -416,6 +417,7 @@ export const CONFIG_CATALOG = [
|
|
|
416
417
|
r("SCHEDULER_SESSION_WAKEUP", "orchestration", "boolean", "session 唤醒 host-signal(无常驻 daemon 的壳注 false)", { staticDefault: "true", configKey: "schedulerSessionWakeup" }),
|
|
417
418
|
r("SCHEDULER_STORE_PATH", "orchestration", "path", "scheduler 共享店路径(server 写者与壳 daemon 读者必须一致)", { derivedDefaultNote: "缺席 ⇒ SEMA_CONFIG_DIR(~/.sema)/scheduled_tasks.json", configKey: "schedulerStorePath" }),
|
|
418
419
|
r("SCRATCHPAD_SWEEP_TTL_MS", "limitsHttp", "number", "per-session scratchpad 目录 sweep TTL(ms;≤0=关,<1m 夹到 1m 点名)", { staticDefault: String(7 * 24 * 60 * 60 * 1000), danger: DATA, configKey: "scratchpadSweepTtlMs" }),
|
|
420
|
+
r("SEALED_KEY_DIR", "store", "path", "模型钥匙保管目录(sealed 形的 X25519 钥匙对 `<publicKeyId>.json` 与停驻行封签子目录 `checkpoint-ctx-keys/`;文件 0600、目录 0700)。sealed 条目绑定钥匙身份(publicKeyId),共享同一份 config.d 的每台引擎都须持钥:数据根不同的多台引擎指向同一目录 ⇒ 同一把钥。绝对路径(相对路径拒启);设了 ⇒ 唯一保管目录,起服在它上面建不了保管店 ⇒ 拒启", { danger: [...SEC, ...DATA], derivedDefaultNote: "缺席 ⇒ <数据根>/sealed-key(建不了只告警,sealed 模型逐个 no_key_store)", configKey: "sealedKeyDir" }),
|
|
419
421
|
r("SELECT_ENVIRONMENT_TOOL", "orchestration", "boolean", "SelectEnvironment 工具挂载(另需 k8s+镜像目录活链)", { staticDefault: "true", configKey: "selectEnvironmentTool" }),
|
|
420
422
|
r("SELF_ORCHESTRATION_ENABLED", "orchestration", "boolean", "run_workflow 自编排(硬化 vm 沙箱)", { derivedDefaultNote: "posture 三态:缺席 = 单用户 ⇒ on / 多租户 ⇒ off", configKey: "selfOrchestrationEnabled" }),
|
|
421
423
|
r("SELF_ORCHESTRATION_MODELS", "orchestration", "csv", "workflow agent({modelName}) 显式词表(恒赢;缺席单用户=目录键全集/多租户 fail-closed)", { configKey: "selfOrchestrationModels" }),
|
|
@@ -449,7 +451,7 @@ export const CONFIG_CATALOG = [
|
|
|
449
451
|
r("SESSION_EVENTS_MAX_CONNS", "limitsHttp", "number", "session SSE 并发连接帽", { derivedDefaultNote: "缺席 ⇒ 256" }),
|
|
450
452
|
r("SESSION_EVENTS_MAX_PROBES", "limitsHttp", "number", "session SSE 共享探针数帽", { derivedDefaultNote: "缺席 ⇒ 512" }),
|
|
451
453
|
r("SESSION_EVENTS_WARM_MS", "limitsHttp", "number", "session SSE 温探针间隔(ms)", { derivedDefaultNote: "缺席 ⇒ 2000" }),
|
|
452
|
-
r("SESSION_SNAPSHOT_BUCKET", "store", "string", "快照 blob 桶(兼 SendUserFile 私桶)", { derivedDefaultNote:
|
|
454
|
+
r("SESSION_SNAPSHOT_BUCKET", "store", "string", "快照 blob 桶(兼 SendUserFile 私桶)", { derivedDefaultNote: `缺席 ⇒ ${SESSION_SNAPSHOT_BUCKET_DEFAULT}` }),
|
|
453
455
|
r("SESSION_SNAPSHOT_PREFIX", "store", "string", "快照 blob key 前缀", { derivedDefaultNote: "缺席 ⇒ blobs/(MinioBlobBackend 默认)" }),
|
|
454
456
|
r("SESSION_SNAPSHOT_TTL_SEC", "store", "number", "快照 presign TTL(秒;坏值省略走默认,绝不 NaN 签名)", { derivedDefaultNote: "缺席 ⇒ 3600(MinioBlobBackend 默认)" }),
|
|
455
457
|
r("SIGHUP_IDLE_GRACE_MS", "limitsHttp", "number", "SIGHUP 空闲关停窗(ms;共享引擎形防误杀)", { staticDefault: "120000", configKey: "sighupIdleGraceMs" }),
|
|
@@ -509,10 +511,10 @@ export const CONFIG_CATALOG = [
|
|
|
509
511
|
r("WORKSPACE_CACHE_SIZE", "orchestration", "string", "k8s 构建缓存卷的大小(PVC 申请量,k8s quantity 形如 20Gi / 500Mi;形不合拒启;只在 WORKSPACE_CACHE=volume 时读)", { staticDefault: WORKSPACE_CACHE_SIZE_DEFAULT }),
|
|
510
512
|
r("WORKSPACE_FILE_MAX_BYTES", "limitsHttp", "number", "已随 workspace 浏览面退役(S-15):值照常校验/落值,应用于空(重启也不生效)", { envTiming: "inert", configKey: "workspaceFileMaxBytes", center: cLimits("workspaceFileMaxBytes", { timing: "inert" }) }),
|
|
511
513
|
r("WORKSPACE_PERSIST", "orchestration", "enum", "k8s 工作区跨轮保留:space(缺省)= 每条 run 结束把 /workspace 快照进本会话住客的空间、下一条 run 开始恢复最近一份(上一条还在保存 ⇒ 下一条等它存完,最多等一个上传时限,见 USAGE §9.3b);off = 每轮新建。space(含缺省)却没配快照存储(MINIO_* 三键)⇒ 不生效,起服一行 workspace_persist_unavailable 点名缺键;前提:会话店读得出会话住客(local / SQL 会话店),内存会话店 × space(含缺省,且配了快照存储)⇒ 拒启(出路 WORKSPACE_PERSIST=off);词表外拒启", { enumValues: WORKSPACE_PERSIST_WORDS, staticDefault: WORKSPACE_PERSIST_DEFAULT, danger: DATA }),
|
|
512
|
-
r("WORKSPACE_SNAPSHOT_BUCKET", "orchestration", "string", "k8s 工作区快照桶", { derivedDefaultNote:
|
|
514
|
+
r("WORKSPACE_SNAPSHOT_BUCKET", "orchestration", "string", "k8s 工作区快照桶(server 不建桶:配了对象存储时起服核它在不在,缺〔404 + NoSuchBucket〕⇒ 窗内重试、到窗拒启并点名本旋钮;证明不了〔连不上 / 403 / 5xx〕不拒,走 fail-open 兜底口;运行期读 latest 得 NoSuchBucket ⇒ 该 run 连沙箱失败,不读成空间头一回)", { derivedDefaultNote: `缺席 ⇒ ${WORKSPACE_SNAPSHOT_BUCKET_DEFAULT}` }),
|
|
513
515
|
r("WORKSPACE_SNAPSHOT_EXCLUDE", "orchestration", "csv", "k8s 工作区快照的排除表(相对工作区根的 tar 排除模式,逗号分隔,如 build,.gradle,node_modules/.cache;每项一个 --exclude=./<项>,run 末快照与停驻挂起同一张表 —— 排除的目录恢复后不在,构建产物本就可再生;项形闭:相对路径段,不含 .. / 前导 / / 空白 / 引号,整体通配(只由 * / ? 组成的项,* 会让快照一个顶层项都不剩)也拒,坏项拒启并点名第几项;不读项目 .gitignore)", { derivedDefaultNote: "缺席 = 不排除(上传命令与旧版逐字同)" }),
|
|
514
516
|
r("WORKSPACE_SNAPSHOT_KEEP", "orchestration", "number", `k8s 工作区每个空间(会话住客)保留的快照份数(整数 [${WORKSPACE_SNAPSHOT_KEEP_RANGE.min}, ${WORKSPACE_SNAPSHOT_KEEP_RANGE.max}];写新快照后删最老的;域外拒启)`, { staticDefault: String(WORKSPACE_SNAPSHOT_KEEP_DEFAULT), danger: DATA }),
|
|
515
|
-
r("WORKSPACE_SNAPSHOT_PREFIX", "orchestration", "string", "k8s 工作区快照 key
|
|
517
|
+
r("WORKSPACE_SNAPSHOT_PREFIX", "orchestration", "string", "k8s 工作区快照 key 前缀:`/` 分隔的一段或多段普通 key 段(kata、libA/ws;每段以字母或数字开头,其后字母数字 . _ -);空段 / . / .. / 前导或尾随 / / 其它字符 ⇒ 拒启并点名第几段(config.workspace_snapshot_prefix_invalid)", { derivedDefaultNote: `缺席 ⇒ ${WORKSPACE_SNAPSHOT_PREFIX_DEFAULT}` }),
|
|
516
518
|
r("WORKSPACE_SNAPSHOT_TIMEOUT_MS", "orchestration", "number", `k8s 工作区快照的时限(毫秒,整数 [${WORKSPACE_SNAPSHOT_TIMEOUT_MS_RANGE.min}, ${WORKSPACE_SNAPSHOT_TIMEOUT_MS_RANGE.max}];域外拒启):一个数管四处 —— run 末上传与连沙箱时恢复的墙钟上界、空间结束时回收座一次调用的绝对截止(卷与对象都在内)、下一条 run 等上一条存完的最长等待(提交围栏的存活上界);大文件读写的墙钟也是它。大工作区(构建目录 GB 级)撞上界 ⇒ 调大它或配 WORKSPACE_SNAPSHOT_EXCLUDE`, { staticDefault: String(WORKSPACE_SNAPSHOT_TIMEOUT_MS_DEFAULT) }),
|
|
517
519
|
r("WORKSPACE_SNAPSHOT_TTL_SEC", "orchestration", "number", "k8s 工作区快照 presign TTL(秒)"),
|
|
518
520
|
r("WORKTREE_ALLOWED_ROOTS", "orchestration", "csv", "worktree 隔离纵深白名单(缺省 = [repoRoot])", { danger: SEC }),
|
|
@@ -19,7 +19,7 @@ export async function migrateLocalConfigDirectory(root) {
|
|
|
19
19
|
return { ...(await migrateConfigDirectory(dir, { documents: LOCAL_READER_DOCUMENTS, io: nodeConfigDirectoryIo })), dir };
|
|
20
20
|
}
|
|
21
21
|
catch (err) {
|
|
22
|
-
return { kind: "threw", dir, reason:
|
|
22
|
+
return { kind: "threw", dir, reason: err instanceof Error ? err.message : String(err) };
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
export function logConfigDirMigration(log, m) {
|
|
@@ -34,7 +34,7 @@ import type { ServiceConfigFlat } from "./config-types.js";
|
|
|
34
34
|
*/
|
|
35
35
|
export declare const LIVENESS_HEARTBEAT_MS = 30000;
|
|
36
36
|
/** 闭集:新增一条不变量必须在这里加词(拼错 = 编译红,而不是运行期悄悄不判)。 */
|
|
37
|
-
export type CrossInvariantId = "run-stale-heartbeat" | "bind-posture" | "bake-runner-credential" | "direct-door-anchors" | "operator-principals-required" | "operator-single-user" | "bake-operator-principals" | "sensitive-write-patterns" | "leader-host-lane" | "multi-tenant-shared-lane" | "leader-durable-store" | "device-durable-store" | "device-durable-approval" | "model-provider-word" | "gateway-url-userinfo" | "model-route-endpoint" | "default-model-resolvable" | "refused-names-not-minted" | "require-execution-lane" | "center-one-identity" | "workflow-park-decision-domain";
|
|
37
|
+
export type CrossInvariantId = "run-stale-heartbeat" | "bind-posture" | "bake-runner-credential" | "direct-door-anchors" | "operator-principals-required" | "operator-single-user" | "bake-operator-principals" | "sensitive-write-patterns" | "leader-host-lane" | "multi-tenant-shared-lane" | "leader-durable-store" | "device-durable-store" | "device-durable-approval" | "model-provider-word" | "gateway-url-userinfo" | "anthropic-credential-exclusive" | "model-route-endpoint" | "default-model-resolvable" | "refused-names-not-minted" | "require-execution-lane" | "center-one-identity" | "workflow-park-decision-domain";
|
|
38
38
|
/** 表读的键集(取自平铺配置型 ⇒ 键名/类型永不与真配置漂)。 */
|
|
39
39
|
export type CrossInvariantView = Readonly<Pick<ServiceConfigFlat, "runStaleSec" | "authToken" | "authTokens" | "allowUnauthedWrites" | "imageBakes" | "directApprovalDoor" | "durableApproval" | "approvalHmacKeys" | "principalJwtPubkeys" | "principalJwtIss" | "principalJwtAud" | "requirePrincipal" | "operatorPrincipals" | "operatorSingleUser" | "sensitiveWritePatterns" | "leaderEnabled" | "selfOrchestrationEnabled" | "workflowRunStoreBackend" | "remoteExec" | "requireExecutionLane" | "dbBackend" | "tidb" | "pg" | "envModel" | "gatewayBaseUrl" | "gatewayFallbackUrls" | "anthropic" | "models" | "modelRefusals" | "tiers" | "authBridgeIssuer" | "webAdmin">>;
|
|
40
40
|
export interface CrossInvariantInput {
|
|
@@ -58,7 +58,7 @@ export interface CrossInvariant {
|
|
|
58
58
|
check(input: CrossInvariantInput): string | undefined;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
* ──
|
|
61
|
+
* ── [ref] ① 推广(车 UZ 推广轮):**拒因句单铸点**是一类 —— 下面五只是 `config.ts` 区里五条跨域拒启的**判据 + 句子的唯一属主**
|
|
62
62
|
* (`executionLaneRequiredRefusal` / `modelProviderRefusal` 同形):boot 的 throw(`config.ts`,锚在那儿)与注册表条目的 `check` **都调它**,
|
|
63
63
|
* 没有第二份文本可漂。修前这五条逐条两份不同的句子(boot 手写一份、表里另写一份),boot 那份是运维在 stderr 读到的(`config-validation.test.ts`
|
|
64
64
|
* 钉着它的指纹),表那份只在热路径上被调 —— 而热键集带不上这些键 ⇒ 实际无读者。句子**取 boot 那份**(逐字不变);类钉 =
|
|
@@ -69,12 +69,12 @@ export interface CrossInvariant {
|
|
|
69
69
|
export declare function halfOpenDirectDoorRefusal(v: Pick<CrossInvariantView, "directApprovalDoor" | "durableApproval" | "approvalHmacKeys" | "principalJwtPubkeys" | "principalJwtIss" | "principalJwtAud" | "requirePrincipal" | "operatorPrincipals">): string | undefined;
|
|
70
70
|
/**
|
|
71
71
|
* `operator-principals-required`([ref]-① 普查候选 1/2):BFF 多租户 durable 形(DURABLE_APPROVAL ∧ REQUIRE_PRINCIPAL,直连门关)的空 operator 名单。
|
|
72
|
-
* 这条不变量生于审批四读面读「空名单 = 人人是」那条读法的年代(那时它防的是跨租户读待批队列);
|
|
72
|
+
* 这条不变量生于审批四读面读「空名单 = 人人是」那条读法的年代(那时它防的是跨租户读待批队列);[ref] 删了那条读法 —— 空名单在每一面都是「没人是」,
|
|
73
73
|
* 不再外泄任何东西 —— 剩下的事实是「这台多租 worker 的审批队列没有人能当运维」。本版只把句子改真、不改拒启集;删不删这一条是另一次表态。
|
|
74
74
|
*/
|
|
75
75
|
export declare function operatorPrincipalsRequiredRefusal(v: Pick<CrossInvariantView, "durableApproval" | "requirePrincipal" | "operatorPrincipals">): string | undefined;
|
|
76
76
|
/**
|
|
77
|
-
* `operator-single-user`(
|
|
77
|
+
* `operator-single-user`([ref],[ref] ① 裁 A):「谁是 operator」一个事实一个来源。`OPERATOR_SINGLE_USER=true`(单用户形的每个调用方都是运维)
|
|
78
78
|
* 只在单用户形、名单为空时成立:多租形没有「单一用户」(声明会把每个租户都变成运维);名单非空时两个来源答同一个问题。两形都拒,句子点名两根旋钮与出路。
|
|
79
79
|
*/
|
|
80
80
|
export declare function operatorSingleUserRefusal(v: Pick<CrossInvariantView, "operatorSingleUser" | "requirePrincipal" | "operatorPrincipals">): string | undefined;
|
|
@@ -109,7 +109,7 @@ export declare function workflowParkDecisionDomainRefusal(v: Pick<CrossInvariant
|
|
|
109
109
|
export declare function centerIdentityRefusal(v: Pick<CrossInvariantView, "authBridgeIssuer" | "webAdmin">): string | undefined;
|
|
110
110
|
export declare const CONFIG_CROSS_INVARIANTS: readonly CrossInvariant[];
|
|
111
111
|
/**
|
|
112
|
-
* 按 id 取**一条**(
|
|
112
|
+
* 按 id 取**一条**([ref]②:boot 面的单源化出口)。
|
|
113
113
|
*
|
|
114
114
|
* 为什么不是在 boot 期跑 `checkCrossInvariants` 全表:全表里有若干条的 boot 拒启点在 `config.ts` 的装配尾
|
|
115
115
|
* (各自有自己的锚),在这里再跑一遍全表等于给 boot 加上今天不存在的拒启臂 —— 那是行为改动,不是单源化。
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { assertGuardPatternsUsable } from "./deployment-governance.js";
|
|
2
2
|
import { modelProviderRefusal } from "./model-provider.js";
|
|
3
3
|
import { modelRouteUrlRefusal } from "./model-route-url.js";
|
|
4
|
+
import { anthropicCredentialRefusal } from "./model-route-gap.js";
|
|
4
5
|
import { modelRouteEndpointRefusal } from "./model-route-endpoint.js";
|
|
5
6
|
import { defaultModelRefusal, refusedNameMintedRefusal } from "./model-entry-refusal.js";
|
|
6
7
|
import { WEB_ADMIN_ENV, httpUrlFlaws } from "@sema-agent/settings-schema";
|
|
7
8
|
import { authBridgeIssuerOf } from "./auth-bridge.js";
|
|
8
9
|
import { buildDisplaySafeUrl } from "./trace/redact.js";
|
|
9
|
-
import { executionLaneCaps, executionLaneOf, executionLaneRequiredRefusal,
|
|
10
|
+
import { executionLaneCaps, executionLaneOf, executionLaneRequiredRefusal, REMOTE_EXEC_PROVIDER_WORDS } from "./execution-lane-caps.js";
|
|
11
|
+
import { DEPLOYMENT_SHAPE_PREDICATES } from "./deployment-shape.js";
|
|
10
12
|
export const LIVENESS_HEARTBEAT_MS = 30_000;
|
|
11
13
|
const anyServiceAuth = (v) => Boolean(v.authToken) || Object.keys(v.authTokens ?? {}).length > 0;
|
|
12
14
|
const mustNarrowBind = (v) => Boolean(v.allowUnauthedWrites) && !anyServiceAuth(v);
|
|
13
15
|
const directDoorConjuncts = (v) => Boolean(v.directApprovalDoor) && Boolean(v.durableApproval) && v.approvalHmacKeys.length > 0 && v.principalJwtPubkeys.length > 0 && Boolean(v.principalJwtIss) && Boolean(v.principalJwtAud);
|
|
14
16
|
function multiTenantSharedLaneRefusal(v) {
|
|
15
17
|
const lane = executionLaneOf(v.remoteExec?.provider);
|
|
16
|
-
if (
|
|
18
|
+
if (DEPLOYMENT_SHAPE_PREDICATES.laneSeparatesTenants.holds(v))
|
|
17
19
|
return undefined;
|
|
18
20
|
const outlets = REMOTE_EXEC_PROVIDER_WORDS.filter((w) => executionLaneCaps(w).tenantSeparation === "supported");
|
|
19
21
|
return (`REQUIRE_PRINCIPAL=true (multi-tenant posture) with the "${lane}" execution lane runs every tenant's Bash on one shared target — ` +
|
|
@@ -260,6 +262,13 @@ export const CONFIG_CROSS_INVARIANTS = [
|
|
|
260
262
|
.find((r) => r !== undefined) ??
|
|
261
263
|
modelRouteUrlRefusal("ANTHROPIC_BASE_URL", next.anthropic?.baseUrl ?? "", "ANTHROPIC_API_KEY"),
|
|
262
264
|
},
|
|
265
|
+
{
|
|
266
|
+
id: "anthropic-credential-exclusive",
|
|
267
|
+
keys: ["anthropic"],
|
|
268
|
+
restartReason: "anthropic-credential",
|
|
269
|
+
bootAnchor: { file: "src/config.ts", marker: "CROSS-INVARIANT:anthropic-credential-exclusive" },
|
|
270
|
+
check: ({ next }) => (next.anthropic === undefined ? undefined : anthropicCredentialRefusal(next.anthropic)),
|
|
271
|
+
},
|
|
263
272
|
{
|
|
264
273
|
id: "model-route-endpoint",
|
|
265
274
|
keys: ["gatewayBaseUrl", "gatewayFallbackUrls", "anthropic", "models"],
|
package/dist/config-lkg.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare function lkgPathOverrideOf(raw: string | undefined): string | und
|
|
|
34
34
|
* 根经链接时引擎连目标一起守)两处守它 ⇒ 不另加行(加了就是同一个文件两只判据,`READ_DENY_BUILTIN_EXCLUDE` 删那一行也删不掉它);
|
|
35
35
|
* · 覆写 ⇒ LKG 在配置根外,引擎那一行够不着 ⇒ 这里派生**一行** = 覆写的绝对路径(`/` 开头;`lkgPathOverrideOf` 已把相对值解成绝对)。大小写不敏感
|
|
36
36
|
* (与内建行同读法)。拒句与内建行同一句(`sensitive-path read deny list (pattern …)`)。
|
|
37
|
-
* **行的射程**(引擎读拒表的读法,core 7.48.0
|
|
37
|
+
* **行的射程**(引擎读拒表的读法,core 7.48.0 [ref]):`/` 开头的行**根锚定** —— 只守那一个绝对位置,用户仓里同尾的路径
|
|
38
38
|
* (`/app/config-lkg.json` 之于 `…/repo/app/config-lkg.json`)读得到、Grep 结果里也在;路径经符号链接的目录时,引擎在每次准备时把这一行
|
|
39
39
|
* **沿链放置**到它的字面头真正通向的地方(写进去的文件落在链接目标下,目标路径同样被拒)。
|
|
40
40
|
* 7.120.0–7.122.x 的两处旧读法随之退役:行是尾段任意深度匹配(挡掉用户仓里同尾的路径);本仓另派生一条 realpath 落点行(座席铸一次、
|
|
@@ -82,42 +82,4 @@ export declare function migrateLkgPayload(effective: Record<string, unknown>): {
|
|
|
82
82
|
} | {
|
|
83
83
|
refused: string;
|
|
84
84
|
};
|
|
85
|
-
/** 7.98.0 及以前的默认 LKG 路径(按当时的写法逐字保留 —— 这是盘上已有文件的名字,不是现行分箱规则)。 */
|
|
86
|
-
export declare function legacyV1LkgPath(config: {
|
|
87
|
-
readonly agentConfigDir?: string;
|
|
88
|
-
}, worker: string | undefined): string;
|
|
89
|
-
export type LegacyLkgMigration = {
|
|
90
|
-
readonly outcome: "none";
|
|
91
|
-
}
|
|
92
|
-
/** `retireError`:新箱已写好,只是旧文件没退役成(改名 / 留副本失败)—— 只响一行,不影响已写好的箱。 */
|
|
93
|
-
| {
|
|
94
|
-
readonly outcome: "migrated";
|
|
95
|
-
readonly from: string;
|
|
96
|
-
readonly retiredTo: string;
|
|
97
|
-
readonly retireError?: string;
|
|
98
|
-
} | {
|
|
99
|
-
readonly outcome: "not-migrated";
|
|
100
|
-
readonly path: string;
|
|
101
|
-
readonly reason: string;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* formatVersion 1 LKG 的一次性迁移(规则一句:**身份推得出来才迁,推不出来就响亮拒**)。判序:
|
|
105
|
-
* 1. `legacyPath` ≠ `binPath` 时**先看本身份的箱**:箱里已有文件 ⇒ `none`(箱自己说话,旧文件是好是坏都不再相关,
|
|
106
|
-
* 不许一个坏旧文件把有效的箱挡成 env 兜底 —— 7.99.0 修复验证 N4)。箱查不了(非 ENOENT)⇒ 响亮拒。
|
|
107
|
-
* 2. 旧文件没有(ENOENT / ENOTDIR)或不是 formatVersion 1 信封 ⇒ `none`。旧默认路径上却读不了 / 不是 JSON ⇒
|
|
108
|
-
* `not-migrated`(响亮,不当它不存在);`CONFIG_LKG_PATH` 同路径时这两形由 loadLkg 自己报(不重复打一行)。
|
|
109
|
-
* 3. v1 信封只记 worker:唯一推得出身份的形是拉取令牌(身份 = worker,`pullTokenIdentity`)。此刻身份正是它、worker
|
|
110
|
-
* 对得上、载荷过 {@link migrateLkgPayload}(迁成 11 的形;迁不动 ⇒ 响亮拒、不写箱)与 {@link lkgPayloadJudged} ⇒ **先写后退役**(修复验证 N9):先按新格式把它写进 `binPath`(原子写,
|
|
111
|
-
* 0600),写成了才把旧文件改名 `<legacyPath>.migrated-v1`。写失败 ⇒ `not-migrated`,旧文件原样留在原位,下一次
|
|
112
|
-
* 照常可迁;写成之后改名失败 ⇒ 仍是 `migrated`(`retireError` 响一行),箱已在 ⇒ 下一次按判序 1 不再看旧文件。
|
|
113
|
-
* 同路径(`CONFIG_LKG_PATH`)时新箱的写入会原子替换旧文件本身,所以旧字节在写之前留一份 `.migrated-v1` 副本
|
|
114
|
-
* (副本失败同样只进 `retireError`:载荷正要写进新箱,不是丢数据)。
|
|
115
|
-
* 4. 其余一律 `not-migrated`:拒因点名旧文件路径与出路(删掉它;中心下一份干净候选会写本身份自己的 LKG),不改名、不读回。
|
|
116
|
-
*/
|
|
117
|
-
export declare function migrateV1Lkg(o: {
|
|
118
|
-
legacyPath: string;
|
|
119
|
-
binPath: string;
|
|
120
|
-
worker: string | undefined;
|
|
121
|
-
identity: string;
|
|
122
|
-
}): Promise<LegacyLkgMigration>;
|
|
123
85
|
//# sourceMappingURL=config-lkg.d.ts.map
|