@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/boot/runner-deps.js
CHANGED
|
@@ -18,7 +18,10 @@ import { buildCrossSessionInboundLayers, crossSessionDialogExpiryOf } from "../c
|
|
|
18
18
|
import { createPeerDirectory } from "../peer-directory.js";
|
|
19
19
|
import { storeFormRefusalInIncident } from "../memory-store-refusal.js";
|
|
20
20
|
import { coreFileHistoryCaptureSeat } from "../file-history-capture.js";
|
|
21
|
+
import { DEPLOYMENT_SHAPE_PREDICATES } from "../deployment-shape.js";
|
|
21
22
|
import { rewindFailureCode } from "../file-history-disclosure.js";
|
|
23
|
+
import { errorKindOf } from "../observability/err-text.js";
|
|
24
|
+
import { buildShownUrlsInText } from "../url-refusal.js";
|
|
22
25
|
export function createRunnerDepsOnAsk(toolApproval) {
|
|
23
26
|
if (!toolApproval)
|
|
24
27
|
return undefined;
|
|
@@ -235,10 +238,10 @@ export function createRunnerDeps(ctx) {
|
|
|
235
238
|
fileHistoryCapture: coreFileHistoryCaptureSeat(fileHistoryStore, config.fileHistoryCapture),
|
|
236
239
|
permissionRuleStore: permissionRuleStore ? permissionRuleStore : undefined,
|
|
237
240
|
onBackgroundChildEvent: fleetBackgroundChildPublisher(fleetBus, (msg, fields) => logger.info(msg, fields)),
|
|
238
|
-
loadProjectMemory: config
|
|
241
|
+
loadProjectMemory: !DEPLOYMENT_SHAPE_PREDICATES.multiTenant.holds(config) && config.projectMemoryEnabled
|
|
239
242
|
? makeLoadProjectMemory({ logger, instructionSource: createInstructionSourceSeat(sessionStore, sharedRunnerDeps.onNotice) })
|
|
240
243
|
: undefined,
|
|
241
|
-
probeInstructionSources:
|
|
244
|
+
probeInstructionSources: DEPLOYMENT_SHAPE_PREDICATES.callerOwnsWorkerDisk.holds(config) && config.projectMemoryEnabled
|
|
242
245
|
? makeProbeInstructionSources()
|
|
243
246
|
: undefined,
|
|
244
247
|
...selfOrchestrationDeps,
|
|
@@ -262,12 +265,12 @@ export function createRunnerDeps(ctx) {
|
|
|
262
265
|
return;
|
|
263
266
|
}
|
|
264
267
|
if (ctx.phase === "mcp") {
|
|
265
|
-
logger.warn("mcp_server_unavailable", { sessionId: ctx.sessionId, info: String(err) });
|
|
268
|
+
logger.warn("mcp_server_unavailable", { sessionId: ctx.sessionId, kind: errorKindOf(err), info: buildShownUrlsInText(String(err)) });
|
|
266
269
|
metrics.inc("mcp_server_unavailable_total");
|
|
267
270
|
return;
|
|
268
271
|
}
|
|
269
272
|
if (ctx.phase === "a2a") {
|
|
270
|
-
logger.warn("a2a_peer_unavailable", { sessionId: ctx.sessionId, info: String(err) });
|
|
273
|
+
logger.warn("a2a_peer_unavailable", { sessionId: ctx.sessionId, kind: errorKindOf(err), info: buildShownUrlsInText(String(err)) });
|
|
271
274
|
metrics.inc("a2a_peer_unavailable_total");
|
|
272
275
|
return;
|
|
273
276
|
}
|
|
@@ -42,7 +42,7 @@ export interface SessionFacesCtx {
|
|
|
42
42
|
approvalExemptionStore: ReturnType<StoreBackend["approvalExemption"]> | undefined;
|
|
43
43
|
sessionPolicyStore: ReturnType<StoreBackend["sessionPolicy"]> | undefined;
|
|
44
44
|
taskAttachmentStore: TaskAttachmentStore | undefined;
|
|
45
|
-
/**
|
|
45
|
+
/** [ref]:文件历史的**擦除脸**(后端在即在,与 `FILE_HISTORY_CAPTURE` 无关;只有删除类动词)。E21 删除读它,
|
|
46
46
|
* 不读捕获脸 —— 关掉捕获的部署照样要删得掉已捕获的文件字节(旋钮只管写入,从不管擦除)。 */
|
|
47
47
|
fileHistoryErasure: FileHistoryErasureFace | undefined;
|
|
48
48
|
workflowCompletionInbox: WorkflowCompletionInbox | undefined;
|
|
@@ -56,10 +56,10 @@ export interface SessionFacesCtx {
|
|
|
56
56
|
* (`boot/stores.ts` 同段铸);缺席 = 本部署无耐久 mailbox ⇒ 无箱可退役。 */
|
|
57
57
|
mailboxStore: RunnerDeps["mailboxStore"];
|
|
58
58
|
mailboxRecipientLifecycle: MailboxRecipientLifecycle | undefined;
|
|
59
|
-
/**
|
|
59
|
+
/** [ref] 件B:后台子代的耐久店(与 `RunnerDeps.backgroundAgentStore` 同实例)—— 删除协调器据它枚举以本会话为根的子代并结束
|
|
60
60
|
* 它们(E21 级联的一条腿,做完才删元数据)。缺席 = 本部署没有耐久后台子代(纯内存 dev);那一形只剩本进程登记表里的活行,照样停。 */
|
|
61
61
|
backgroundAgentStore: RunnerDeps["backgroundAgentStore"];
|
|
62
|
-
/**
|
|
62
|
+
/** [ref]:用户输入受理账本的**店**(E21 级联的一条腿:该会话的受理行随会话删)。与受理 / 收敛 / 告知读的是同一只(stage-07 取一次)。
|
|
63
63
|
* 缺席 = 本部署没装账本(env-only:没有 backend / run 店)⇒ 无行可删。 */
|
|
64
64
|
userInputLedgerStore: UserInputLedgerStore | undefined;
|
|
65
65
|
/** k8s 车道工作区空间的回收座(配了构建缓存卷或快照存储时在场;与托管留存 sweep 同一只)—— E21 级联的一条腿:会话删了 =
|
|
@@ -7,7 +7,7 @@ import { SessionWatchRegistry, posIntEnv } from "../session-watch.js";
|
|
|
7
7
|
import { defaultTaskRegistry, peerSessionBoxHandle } from "@sema-agent/core";
|
|
8
8
|
import { reapSessionBackgroundHard } from "../background-session-reap.js";
|
|
9
9
|
import { probeSessionChildren, retireSessionChildren, SessionChildrenStopIncompleteError } from "../session-children-retire.js";
|
|
10
|
-
import {
|
|
10
|
+
import { headReadOf, redactIncarnations } from "../session-incarnation.js";
|
|
11
11
|
import { recordFailOpen } from "../observability/fail-open.js";
|
|
12
12
|
export function createSessionFaces(ctx) {
|
|
13
13
|
const { config, logger, metrics, localRoot, backend, sessionStore, runStore, checkpointStore, toolResultStore, resumeAnchorStore, approvalExemptionStore, sessionPolicyStore, taskAttachmentStore, fileHistoryErasure, workflowCompletionInbox, taskListLane, deviceStore, dropSessionScoped, mailboxStore, mailboxRecipientLifecycle, backgroundAgentStore, userInputLedgerStore, spaceReclaimer, } = ctx;
|
|
@@ -15,6 +15,7 @@ export function createSessionFaces(ctx) {
|
|
|
15
15
|
const auditPgPool = backend?.pgPool();
|
|
16
16
|
const auditLocalRoot = backend?.kind === "local" ? (config.localDataRoot ?? localRoot) : undefined;
|
|
17
17
|
const ownerAware = sessionStore;
|
|
18
|
+
const headOf = headReadOf(sessionStore);
|
|
18
19
|
const sessionAudit = mysqlPool || auditPgPool || auditLocalRoot
|
|
19
20
|
? async (sessionId, opts) => {
|
|
20
21
|
const handles = opts !== undefined && resumeAnchorStore !== undefined ? buildRewindHandles(await resumeAnchorStore.listBySession(sessionId), opts.reader) : undefined;
|
|
@@ -25,49 +26,29 @@ export function createSessionFaces(ctx) {
|
|
|
25
26
|
: await buildSessionAuditLocal(auditLocalRoot, sessionId, handles);
|
|
26
27
|
if (!audit)
|
|
27
28
|
return undefined;
|
|
28
|
-
const [
|
|
29
|
+
const [head, placement] = await Promise.all([headOf?.(sessionId), opts !== undefined ? ownerAware.placementOf?.(sessionId) : undefined]);
|
|
30
|
+
const owner = head?.owner;
|
|
29
31
|
const agent = sessionAgentOf(placement);
|
|
30
32
|
return { ...audit, owner: owner ?? null, ...(agent !== undefined ? { agent } : {}) };
|
|
31
33
|
}
|
|
32
34
|
: undefined;
|
|
33
|
-
const sessionWatchRegistry =
|
|
34
|
-
? new SessionWatchRegistry(async (sid) => (await
|
|
35
|
+
const sessionWatchRegistry = headOf
|
|
36
|
+
? new SessionWatchRegistry(async (sid) => (await headOf(sid)) ?? { owner: undefined, leafId: null }, {
|
|
35
37
|
hotMs: posIntEnv(process.env.SESSION_EVENTS_HOT_MS, 200),
|
|
36
38
|
warmMs: posIntEnv(process.env.SESSION_EVENTS_WARM_MS, 2000),
|
|
37
39
|
maxWatchedSessions: posIntEnv(process.env.SESSION_EVENTS_MAX_PROBES, 512, 100_000),
|
|
38
40
|
})
|
|
39
41
|
: undefined;
|
|
40
42
|
setLeafAdvanceListener(sessionWatchRegistry ? (sid, leaf, owner, seq) => sessionWatchRegistry.notifyLocal(sid, leaf, owner, seq) : undefined);
|
|
41
|
-
const readSessionFace = sessionFaceReadOf(sessionStore);
|
|
42
|
-
const occupantSpaceKeyOf = async (sessionId, owner) => {
|
|
43
|
-
if (readSessionFace === undefined)
|
|
44
|
-
return undefined;
|
|
45
|
-
try {
|
|
46
|
-
const face = await readSessionFace(sessionId);
|
|
47
|
-
return face !== undefined && face.owner === owner ? face.incarnation : undefined;
|
|
48
|
-
}
|
|
49
|
-
catch (err) {
|
|
50
|
-
if (err instanceof SessionIncarnationMissingError)
|
|
51
|
-
return undefined;
|
|
52
|
-
const reason = "occupant_unreadable";
|
|
53
|
-
recordFailOpen("server.workspace-cache.reclaim-failed", `reason=${reason}`);
|
|
54
|
-
logger.warn("workspace_cache_reclaim_failed", {
|
|
55
|
-
sessionId,
|
|
56
|
-
reason,
|
|
57
|
-
error: redactIncarnations(String(err)),
|
|
58
|
-
effect: "the deleted session's space could not be read, so its build-cache volume and snapshot objects are not reclaimed (the session delete went ahead) — delete the volume by label sema.space; the objects fall to the bucket's lifecycle rule",
|
|
59
|
-
});
|
|
60
|
-
return undefined;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
43
|
const purgeSession = ownerAware.deleteSession
|
|
64
44
|
? async (sessionId, owner) => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
45
|
+
let spaceKey;
|
|
46
|
+
if (headOf) {
|
|
47
|
+
const head = await headOf(sessionId);
|
|
48
|
+
if (head?.owner !== owner)
|
|
68
49
|
return { deleted: false };
|
|
50
|
+
spaceKey = spaceReclaimer !== undefined ? head.incarnation : undefined;
|
|
69
51
|
}
|
|
70
|
-
const spaceKey = spaceReclaimer !== undefined ? await occupantSpaceKeyOf(sessionId, owner) : undefined;
|
|
71
52
|
const childScope = owner ?? "default";
|
|
72
53
|
const reach = await probeSessionChildren({ agentStore: backgroundAgentStore, checkpointStore, registry: defaultTaskRegistry }, sessionId, childScope);
|
|
73
54
|
if (!reach.reachable) {
|
package/dist/boot/shutdown.d.ts
CHANGED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
* 时点即"从此刻起信号可被优雅处理";提前注册会让一个尚未 listen 的进程走 drain 分支。
|
|
10
10
|
* 2. 三个 `process.on` 的**相对次序**保持 SIGTERM → SIGINT → SIGHUP(与原文件逐字一致);
|
|
11
11
|
* 它们互不覆盖,但 handler 之间共享 `closing`/`draining` 两个 latch,次序变化会改变
|
|
12
|
-
* "第二个信号"的语义读数。
|
|
12
|
+
* "第二个信号"的语义读数。[ref] 起「排空期的第二发」只有**一条**判据({@link installShutdownHandlers}
|
|
13
13
|
* 内 `onStopSignalWhileDraining`:与排空起点相隔 ≥ `drainSecondSignalMinGapMs` 才硬停),SIGTERM / SIGINT 共用。
|
|
14
14
|
* 3. `clearInterval(reaper)` 必须是 hardShutdown 的第一件事(在 `server.close()` 之前),否则
|
|
15
15
|
* 收尾期还会有 reaper tick 打向正在关闭的池。
|
|
16
|
-
* 4. **进程级监听一律成对**([ref] 二轮件4):本函数装的六只(三信号 + [ref]① 双钩 +
|
|
17
|
-
* ——
|
|
16
|
+
* 4. **进程级监听一律成对**([ref] 二轮件4):本函数装的六只(三信号 + [ref]① 双钩 + [ref] 退出边界钩
|
|
17
|
+
* —— [ref] 起后者由 {@link installProcessExitBoundary} 代装,摘除仍并进同一把手)只能经返回的
|
|
18
18
|
* {@link ShutdownHandle} 摘 —— 调用方手写「摘三信号」的收尾会把双钩漏在进程上,而陈旧的那只
|
|
19
19
|
* rejection 钩仍握着 `process.exit(1)`,会对后续无关的 rejection 把进程打掉。
|
|
20
20
|
*/
|
|
@@ -84,10 +84,10 @@ export interface ShutdownCtx {
|
|
|
84
84
|
webAdmin: {
|
|
85
85
|
stopRefreshLoop(): void;
|
|
86
86
|
} | undefined;
|
|
87
|
-
/**
|
|
87
|
+
/** [ref]:活体审批协调器(`TOOL_APPROVAL_ENABLED` 关 ⇒ 缺席)。hardShutdown 起点调它的 `drainForShutdown`:本进程握着的活卡
|
|
88
88
|
* 按断连同路收场、审计留有序关停记号 —— 否则下一次 boot 把有序重启读成崩溃(`crashed_before_park`)。 */
|
|
89
89
|
toolApproval: ToolApprovalCoordinator | undefined;
|
|
90
|
-
/**
|
|
90
|
+
/** [ref] F1:checkpoint 店的 park 提交观察层(`plugins/park-commit-watch.ts`;在场 ⇔ 本部署有 checkpoint 店)。hardShutdown 在
|
|
91
91
|
* `backend.close()` 之前等它 quiesce —— 在飞的 `put`(审批 park / 资源挂起…,与审批协调器在不在场无关)不许被抽掉连接池。 */
|
|
92
92
|
parkCommits: ParkCommitWatch | undefined;
|
|
93
93
|
/** 编排器片 2 件 3:服务租约客户端(在场 ⇔ fleet 成员 ∧ 中心车道配齐)。hardShutdown 起点停它的续租定时器(文件头契约 3 同族)。 */
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* 都经 core 的座位供给 per-model 凭据,本仓不再在任何一面包 brain。
|
|
33
33
|
*
|
|
34
34
|
* 🔴 **poison(声明的钥匙拿不到)上抛,绝不静默回落网关 key** —— `resolveModelApiKey` 抛
|
|
35
|
-
* `ModelKeyPoisonedError` 是「这个模型配了自己的钥匙(托管密钥解不开 /
|
|
35
|
+
* `ModelKeyPoisonedError` 是「这个模型配了自己的钥匙(托管密钥解不开 / [ref] 起 `apiKeyEnv` 变量缺席)却拿不到」的响亮态;吞成 undefined 等于用共享
|
|
36
36
|
* 网关账号去打这只模型的上游,正是毒丸机制存在的理由(CLAUDE.md [ref] 安全轴 fail-closed)。换装后
|
|
37
37
|
* 这条语义由 core 承载得更彻底:座位抛 ⇒ `runSideQuery` 的 `await` 直接上抛,brain 一个字节都没发。
|
|
38
38
|
*
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
* 复判 —— 部署声明了 `config.baseUrl` 而 entry URL 不在那个根上、凭据又只有部署级那一份 ⇒
|
|
49
49
|
* `route.credential_mismatch` 响亮拒;连部署级凭据都没有 ⇒ `route.credential_missing`。**三面同批**
|
|
50
50
|
* (主推理链 / side-query / WebFetch 摘要走的是同一只 brain 栈),旋钮 = 给模型自己的凭据(当年还有第二条:不声明
|
|
51
|
-
* `config.baseUrl`,走 core 的 `"unpinned"` 快速起步姿态 —— core 7.51.0
|
|
51
|
+
* `config.baseUrl`,走 core 的 `"unpinned"` 快速起步姿态 —— core 7.51.0 [ref] 起该姿态退役,一份部署凭据只配一个根)。
|
|
52
52
|
* ⇒ [ref] 要的「三面同批 + 旋钮」由上游一次交齐。
|
|
53
53
|
*
|
|
54
54
|
* 于是本席的 `isOffRouteBaseUrl` + `recordFailOpen("server.model-key.off-route-model-uses-gateway-key")`
|
|
@@ -15,7 +15,7 @@ export declare function runStage04(ctx: Awaited<ReturnType<typeof runStage03>>):
|
|
|
15
15
|
fileHistoryErasure: import("../file-history-capture.js").FileHistoryErasureFace | undefined;
|
|
16
16
|
fileHistoryStore: import("../plugins/store-backend.js").ServiceFileHistoryStore | undefined;
|
|
17
17
|
fleetLease: import("../fleet-lease.js").FleetLeaseManager | undefined;
|
|
18
|
-
fleetUsage: import("../fleet-client.js").
|
|
18
|
+
fleetUsage: import("../fleet-client.js").FleetUsageBins | undefined;
|
|
19
19
|
memoryBundleFaces: import("../memory-bundle-engine.js").MemoryBundleFaces | undefined;
|
|
20
20
|
memoryComplianceFaces: import("../memory-operator-faces.js").MemoryComplianceFaces | undefined;
|
|
21
21
|
memoryOriginFaces: import("../memory-operator-faces.js").MemoryOriginFaces | undefined;
|
|
@@ -30,7 +30,7 @@ export declare function runStage05(ctx: Awaited<ReturnType<typeof runStage04>>):
|
|
|
30
30
|
fileHistoryErasure: import("../file-history-capture.js").FileHistoryErasureFace | undefined;
|
|
31
31
|
fileHistoryStore: import("../plugins/store-backend.js").ServiceFileHistoryStore | undefined;
|
|
32
32
|
fleetLease: import("../fleet-lease.js").FleetLeaseManager | undefined;
|
|
33
|
-
fleetUsage: import("../fleet-client.js").
|
|
33
|
+
fleetUsage: import("../fleet-client.js").FleetUsageBins | undefined;
|
|
34
34
|
memoryBundleFaces: import("../memory-bundle-engine.js").MemoryBundleFaces | undefined;
|
|
35
35
|
memoryComplianceFaces: import("../memory-operator-faces.js").MemoryComplianceFaces | undefined;
|
|
36
36
|
memoryOriginFaces: import("../memory-operator-faces.js").MemoryOriginFaces | undefined;
|
|
@@ -2,18 +2,18 @@ import { assertDeploymentModsAdmitted, createDeploymentMods } from "./deployment
|
|
|
2
2
|
import { isBrandedDeployment } from "../capabilities/brand-identity.js";
|
|
3
3
|
import { assertDeviceLaneWired, createDeviceLane } from "./device-lane.js";
|
|
4
4
|
import { assertWorkspaceSpaceReadable, createExecutionEnv } from "./execution-env.js";
|
|
5
|
-
import {
|
|
5
|
+
import { headReadOf } from "../session-incarnation.js";
|
|
6
6
|
import * as facts from "../capability-facts.js";
|
|
7
7
|
import { sessionStoreLabelOf } from "../store-posture.js";
|
|
8
8
|
import { runStore } from "./late-binds.js";
|
|
9
9
|
export async function runStage05(ctx) {
|
|
10
10
|
const { backend, config, instanceId, logger, metrics, sessionStore, taskAttachmentStore } = ctx;
|
|
11
11
|
const deviceLane = config.remoteExec?.provider === "device" ? createDeviceLane({ config, logger, metrics, backend, replicaId: instanceId }) : undefined;
|
|
12
|
-
const
|
|
12
|
+
const headOf = headReadOf(sessionStore);
|
|
13
13
|
const spaceCommits = backend !== undefined ? () => runStore : undefined;
|
|
14
|
-
const { perTaskImage, sessionEnvSelection, perSessionCwd, setSessionCwd, setSessionShellEnv, setSessionInheritEnv, fenceSessionOwner, dropSessionScoped, executionEnvFactory, worktreeReap, sendUserFileTaskEnvs, lspManager, spaceReclaimer, } = createExecutionEnv({ config, logger, metrics, taskAttachmentStore, ...(deviceLane ? { deviceLane } : {}), ...(spaceCommits !== undefined ? { spaceCommits } : {}), ...(
|
|
14
|
+
const { perTaskImage, sessionEnvSelection, perSessionCwd, setSessionCwd, setSessionShellEnv, setSessionInheritEnv, fenceSessionOwner, dropSessionScoped, executionEnvFactory, worktreeReap, sendUserFileTaskEnvs, lspManager, spaceReclaimer, } = createExecutionEnv({ config, logger, metrics, taskAttachmentStore, ...(deviceLane ? { deviceLane } : {}), ...(spaceCommits !== undefined ? { spaceCommits } : {}), ...(headOf !== undefined ? { headOf } : {}) });
|
|
15
15
|
assertDeviceLaneWired(config.remoteExec?.provider === "device", deviceLane, executionEnvFactory !== undefined);
|
|
16
|
-
assertWorkspaceSpaceReadable(facts.workspaceSpace(config), {
|
|
16
|
+
assertWorkspaceSpaceReadable(facts.workspaceSpace(config), { headOf, spaceCommits }, facts.workspaceCache(config), sessionStoreLabelOf(config.sessionBackend, backend?.kind));
|
|
17
17
|
const deploymentMods = createDeploymentMods({ metrics, ...(config.toolTrace ? { traceLogger: logger } : {}), brandIdentity: isBrandedDeployment(config) });
|
|
18
18
|
if (config.toolTrace)
|
|
19
19
|
logger.info("tool_trace_enabled", {});
|
|
@@ -93,7 +93,7 @@ export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>):
|
|
|
93
93
|
fileHistoryErasure: import("../file-history-capture.js").FileHistoryErasureFace | undefined;
|
|
94
94
|
fileHistoryStore: import("../plugins/store-backend.js").ServiceFileHistoryStore | undefined;
|
|
95
95
|
fleetLease: import("../fleet-lease.js").FleetLeaseManager | undefined;
|
|
96
|
-
fleetUsage: import("../fleet-client.js").
|
|
96
|
+
fleetUsage: import("../fleet-client.js").FleetUsageBins | undefined;
|
|
97
97
|
memoryBundleFaces: import("../memory-bundle-engine.js").MemoryBundleFaces | undefined;
|
|
98
98
|
memoryComplianceFaces: import("../memory-operator-faces.js").MemoryComplianceFaces | undefined;
|
|
99
99
|
memoryOriginFaces: import("../memory-operator-faces.js").MemoryOriginFaces | undefined;
|
|
@@ -5,7 +5,6 @@ import { cardRuleScopeRoot } from "../task-cwd.js";
|
|
|
5
5
|
import { ForkRoutingSessionStore } from "../plugins/fork-routing-session-store.js";
|
|
6
6
|
import { withoutHands } from "../capabilities/hands-lane.js";
|
|
7
7
|
import { isBrandedDeployment } from "../capabilities/brand-identity.js";
|
|
8
|
-
import { redactSecrets } from "../trace/redact.js";
|
|
9
8
|
import { hasServiceAuth } from "../http/server.js";
|
|
10
9
|
import { operatorRosterPresent } from "../http/principal-gate.js";
|
|
11
10
|
import { workflowModelAllowlistFor } from "../task-workflow.js";
|
|
@@ -183,7 +182,6 @@ export async function runStage06(ctx) {
|
|
|
183
182
|
? createSessionTitler({
|
|
184
183
|
setTitleIfNull: titleCapable.setTitleIfNull.bind(sessionStore),
|
|
185
184
|
probeTitle: titleCapable.probeTitle.bind(sessionStore),
|
|
186
|
-
redact: redactSecrets,
|
|
187
185
|
llm: (o) => hookLlm({ prompt: o.prompt, timeoutMs: o.timeoutMs, model: o.model }),
|
|
188
186
|
logger,
|
|
189
187
|
metrics,
|
|
@@ -108,7 +108,7 @@ export declare function runStage07(ctx: Awaited<ReturnType<typeof runStage06>>):
|
|
|
108
108
|
fileHistoryErasure: import("../file-history-capture.js").FileHistoryErasureFace | undefined;
|
|
109
109
|
fileHistoryStore: import("../plugins/store-backend.js").ServiceFileHistoryStore | undefined;
|
|
110
110
|
fleetLease: import("../fleet-lease.js").FleetLeaseManager | undefined;
|
|
111
|
-
fleetUsage: import("../fleet-client.js").
|
|
111
|
+
fleetUsage: import("../fleet-client.js").FleetUsageBins | undefined;
|
|
112
112
|
memoryBundleFaces: import("../memory-bundle-engine.js").MemoryBundleFaces | undefined;
|
|
113
113
|
memoryComplianceFaces: import("../memory-operator-faces.js").MemoryComplianceFaces | undefined;
|
|
114
114
|
memoryOriginFaces: import("../memory-operator-faces.js").MemoryOriginFaces | undefined;
|
|
@@ -121,7 +121,7 @@ export declare function runStage08(ctx: Awaited<ReturnType<typeof runStage07>>):
|
|
|
121
121
|
fileHistoryErasure: import("../file-history-capture.js").FileHistoryErasureFace | undefined;
|
|
122
122
|
fileHistoryStore: import("../plugins/store-backend.js").ServiceFileHistoryStore | undefined;
|
|
123
123
|
fleetLease: import("../fleet-lease.js").FleetLeaseManager | undefined;
|
|
124
|
-
fleetUsage: import("../fleet-client.js").
|
|
124
|
+
fleetUsage: import("../fleet-client.js").FleetUsageBins | undefined;
|
|
125
125
|
memoryBundleFaces: import("../memory-bundle-engine.js").MemoryBundleFaces | undefined;
|
|
126
126
|
memoryComplianceFaces: import("../memory-operator-faces.js").MemoryComplianceFaces | undefined;
|
|
127
127
|
memoryOriginFaces: import("../memory-operator-faces.js").MemoryOriginFaces | undefined;
|
|
@@ -145,7 +145,7 @@ export declare function runStage09(ctx: Awaited<ReturnType<typeof runStage08>>):
|
|
|
145
145
|
fileHistoryErasure: import("../file-history-capture.js").FileHistoryErasureFace | undefined;
|
|
146
146
|
fileHistoryStore: import("../plugins/store-backend.js").ServiceFileHistoryStore | undefined;
|
|
147
147
|
fleetLease: import("../fleet-lease.js").FleetLeaseManager | undefined;
|
|
148
|
-
fleetUsage: import("../fleet-client.js").
|
|
148
|
+
fleetUsage: import("../fleet-client.js").FleetUsageBins | undefined;
|
|
149
149
|
memoryBundleFaces: import("../memory-bundle-engine.js").MemoryBundleFaces | undefined;
|
|
150
150
|
memoryComplianceFaces: import("../memory-operator-faces.js").MemoryComplianceFaces | undefined;
|
|
151
151
|
memoryOriginFaces: import("../memory-operator-faces.js").MemoryOriginFaces | undefined;
|
|
@@ -144,7 +144,7 @@ export declare function runStage10(ctx: Awaited<ReturnType<typeof runStage09>>):
|
|
|
144
144
|
fileHistoryErasure: import("../file-history-capture.js").FileHistoryErasureFace | undefined;
|
|
145
145
|
fileHistoryStore: import("../plugins/store-backend.js").ServiceFileHistoryStore | undefined;
|
|
146
146
|
fleetLease: import("../fleet-lease.js").FleetLeaseManager | undefined;
|
|
147
|
-
fleetUsage: import("../fleet-client.js").
|
|
147
|
+
fleetUsage: import("../fleet-client.js").FleetUsageBins | undefined;
|
|
148
148
|
memoryBundleFaces: import("../memory-bundle-engine.js").MemoryBundleFaces | undefined;
|
|
149
149
|
memoryComplianceFaces: import("../memory-operator-faces.js").MemoryComplianceFaces | undefined;
|
|
150
150
|
memoryOriginFaces: import("../memory-operator-faces.js").MemoryOriginFaces | undefined;
|
package/dist/boot/stores.js
CHANGED
|
@@ -9,7 +9,7 @@ import { TiDBMemoryEngineBackend, ensureTiDBMemoryEngineSchema } from "../plugin
|
|
|
9
9
|
import { PgMemoryHistoryStore, PgMemorySyncStore, ensurePgMemoryHistorySchema, ensurePgMemorySyncSchema } from "../plugins/memory-sync-store-pg.js";
|
|
10
10
|
import { TiDBMemoryHistoryStore, TiDBMemorySyncStore, ensureTiDBMemoryHistorySchema, ensureTiDBMemorySyncSchema } from "../plugins/memory-sync-store-tidb.js";
|
|
11
11
|
import { MinioBlobBackend } from "../plugins/blob-backend.js";
|
|
12
|
-
import {
|
|
12
|
+
import { ensureSnapshotBuckets } from "../plugins/snapshot-bucket-presence.js";
|
|
13
13
|
import { PgBackgroundAgentStore, TiDBBackgroundAgentStore, ensurePgBackgroundAgentSchema, ensureTiDBBackgroundAgentSchema } from "../plugins/background-agent-store-sql.js";
|
|
14
14
|
import { PgMailboxStore, TiDBMailboxStore, ensurePgMailboxSchema, ensureTiDBMailboxSchema } from "../plugins/mailbox-store-sql.js";
|
|
15
15
|
import { createDropOnlyRecipientLifecycle } from "../plugins/mailbox-recipient-lifecycle.js";
|
|
@@ -36,6 +36,7 @@ import { assertCheckpointColumnSchema } from "../plugins/checkpoint-store-sql.js
|
|
|
36
36
|
import { assertFileHistorySchema } from "../plugins/file-history-store-sql.js";
|
|
37
37
|
import { buildMemoryBoundaryLaneFacts, buildMemoryWriteBoundaryAudit, effectiveMemoryPersistenceCapable } from "./memory-boundary.js";
|
|
38
38
|
import { buildMemoryPosture } from "../memory-posture.js";
|
|
39
|
+
import { headReadOf } from "../session-incarnation.js";
|
|
39
40
|
import { establishSqlEnginePosture, sqlPoolsOf } from "../sql-engine-posture.js";
|
|
40
41
|
import { buildStorePosture } from "../store-posture.js";
|
|
41
42
|
import { buildDisplaySafeUrl } from "../trace/redact.js";
|
|
@@ -57,8 +58,7 @@ export async function openStores(ctx) {
|
|
|
57
58
|
let backend;
|
|
58
59
|
let storeDegradedReason;
|
|
59
60
|
const dsnConfigured = !!(config.tidb || config.pg);
|
|
60
|
-
|
|
61
|
-
await ensureSnapshotBucket(config.snapshotBlobStore, config.storeLockWaitMs, logger);
|
|
61
|
+
await ensureSnapshotBuckets(config, logger);
|
|
62
62
|
const wantDb = config.sessionBackend === "tidb" ||
|
|
63
63
|
config.dbBackend === "local" ||
|
|
64
64
|
(config.sessionBackend === "auto" && dsnConfigured);
|
|
@@ -423,7 +423,7 @@ export async function openStores(ctx) {
|
|
|
423
423
|
}
|
|
424
424
|
if (backend)
|
|
425
425
|
assertCloudSnapshotBlobPosture(backend.kind, config);
|
|
426
|
-
if (!config.requirePrincipal && sessionStore
|
|
426
|
+
if (!config.requirePrincipal && headReadOf(sessionStore) !== undefined) {
|
|
427
427
|
logger.warn("principal_optional", {
|
|
428
428
|
note: "owner-aware session store with REQUIRE_PRINCIPAL=false — owned sessions are protected, but headerless callers can create/share anonymous sessions; set REQUIRE_PRINCIPAL=true for multi-tenant",
|
|
429
429
|
});
|
package/dist/boot/web-admin.d.ts
CHANGED
|
@@ -35,21 +35,21 @@ export interface CenterScenarioOverlayTargets {
|
|
|
35
35
|
/** overlay 前捕获的六内建名(centerScenarioDetails 的 shadow 判据)。 */
|
|
36
36
|
builtinScenarioNames: string[];
|
|
37
37
|
}
|
|
38
|
-
/**
|
|
38
|
+
/** [ref] / [ref] / [ref]:web-admin 持有的三样自报状态(fleet 心跳读它们)—— 闭集:加一样 = 写口与订阅方一起表态。 */
|
|
39
39
|
export type SelfReportChange = "roster_landed" | "restart_signal" | "model_refusals";
|
|
40
40
|
/** 跨段可变状态的**唯一**对外读口 + 三个原位动作。字段语义见各方法上的注释。 */
|
|
41
41
|
export interface WebAdminRuntime {
|
|
42
42
|
/** 配置源形态;`undefined` = 纯 env 部署(本运行时的所有分支不存在)。 */
|
|
43
43
|
readonly providerKind: "remote" | "local" | undefined;
|
|
44
|
-
/**
|
|
44
|
+
/** [ref]:本进程模型钥匙保管店的**公钥面**(只有最新那把公钥;私钥 / 持有 id 列表 / 开箱口结构上够不着,见
|
|
45
45
|
* `sealed-key.ts` `SealedKeyPublicFace`)。present-iff boot 期建店成功 —— 建店与配置源形态无关(纯 env / 本地 / 远程
|
|
46
46
|
* 三形都建),失败 ⇒ `undefined`(`sealed_key_store_unavailable` 那一行已响亮告警)。店只在 boot 建一次、进程内不换钥匙,
|
|
47
47
|
* 所以这是一个值,不是 getter。唯一读者 = `GET /v1/capabilities` 的 `sealedKey` 段(stage-10 经 deps 交过去)。 */
|
|
48
48
|
readonly sealedKeyPublic: SealedKeyPublicFace | undefined;
|
|
49
|
-
/**
|
|
49
|
+
/** [ref]:**停驻行凭据封签器**(`sealed-key.ts` `ensureCheckpointCtxSealing`:这一域自己的保管店 `<数据根>/sealed-key/checkpoint-ctx-keys/` —— 一个域一对钥匙,
|
|
50
50
|
* 与模型钥匙那只店不共用;封 = 最新公钥;开 = 按封签上的 id 精确选私钥、只认绑着本行会话的停驻行信封)。present-iff 这一域建店并自检成功(与模型钥匙店各自成败)。
|
|
51
51
|
* 读者:HTTP 面(`ServiceDeps.checkpointCtxSealing`,stage-10)、leader worker 的续跑上下文(stage-09)与一次性迁移 M28(stage-06);起服第 6 段对
|
|
52
|
-
* 「checkpoint 店在、它不在」拒启。私钥、保管目录、持有 id 列表照旧够不着(
|
|
52
|
+
* 「checkpoint 店在、它不在」拒启。私钥、保管目录、持有 id 列表照旧够不着([ref] 的结构性那一半不变)。 */
|
|
53
53
|
readonly checkpointCtxSealing: CheckpointCtxSealing | undefined;
|
|
54
54
|
/** core `CenterPromptSource`(RunnerDeps / subRunner 必须同实例)。 */
|
|
55
55
|
readonly promptSource: CenterPromptSource;
|
|
@@ -63,18 +63,18 @@ export interface WebAdminRuntime {
|
|
|
63
63
|
* `limitSync`([ref] 批1)= 恒构造的两只限额座的换代口:commit 之后**零 await 内**推一把,与 pricing /
|
|
64
64
|
* keyResolver 那两件派生重建同族(缺席 = 这条腿本部署没装配,例如 run-local)。
|
|
65
65
|
* `swapRunnerDeps`(core 7.10.0 `Runner.swapDeps` 一扇门)= **可换席**的换装口,**必填**:模型面 plane
|
|
66
|
-
* 变更候选在 commit 前喂给全部 boot Runner 原子换代;
|
|
67
|
-
* 拍里的 `applyLiveReadFace`)。
|
|
66
|
+
* 变更候选在 commit 前喂给全部 boot Runner 原子换代;[ref] 起 read **face** 席也走同一只函数(见 refresh
|
|
67
|
+
* 拍里的 `applyLiveReadFace`)。[ref] 波 0 起必填 —— 它缺席的那一形(模型面整面 defer 到重启 + `models-tiers`
|
|
68
68
|
* 重启片)在生产上从来到不了(stage-08 唯一调用点恒传),随片一起退役;要刷新环就要有 Runner 可换。
|
|
69
|
-
* `ceilingVerdict`(
|
|
69
|
+
* `ceilingVerdict`([ref])= 「配了 $ 天花板但目录未定价」这条判决的活载体,与 `limitSync` **同族同序**
|
|
70
70
|
* (commit 之后、零 await 内重判一次;判决不翻转就静默)。缺席 = 这条腿本部署没装配(run-local 一次性
|
|
71
71
|
* CLI 之后不再有刷新拍,它继续用纯判据判一次)。
|
|
72
|
-
* `consolidationSeat`(
|
|
72
|
+
* `consolidationSeat`([ref] 波 0,过渡)= 整理驱动席的两侧读数口,喂 `memory-consolidation` 重启片;
|
|
73
73
|
* 缺席 = 阀门关着(没有 boot 烤死的席)。
|
|
74
|
-
* `degradeRoute`(
|
|
74
|
+
* `degradeRoute`([ref],**必填**)= 反应式降级壳的两侧读数口(brain.ts `createBrainAssembly` 的产物 `degradeRoute`,`baked` 在焊壳处
|
|
75
75
|
* 算好随装配交出),喂 `degrade-route` 重启片。必填而不是可选:车道没开 / 没焊壳由席自己答「两侧同为 null」,缺席没有合法含义 ——
|
|
76
76
|
* 可选就是一条「接线漏了 ⇒ 片永远不签」的静默路([ref])。
|
|
77
|
-
* `checkpointStorePresent`(
|
|
77
|
+
* `checkpointStorePresent`([ref] 波 2,**必填**)= 部署事实「本进程建没建出 checkpoint 店」(stage-06 的产物,
|
|
78
78
|
* 不在 ServiceConfig 里)。审批名单转热之后,热腿要用它判 ④「门意图不可服务」(与 boot 拒启同一只判据);
|
|
79
79
|
* 必填 = 刷新环不可能在不知道这件事的情况下热应用审批名单。 */
|
|
80
80
|
startRefreshLoop(a: {
|
|
@@ -86,11 +86,11 @@ export interface WebAdminRuntime {
|
|
|
86
86
|
degradeRoute: DegradeRouteWatch;
|
|
87
87
|
checkpointStorePresent: boolean;
|
|
88
88
|
}): void;
|
|
89
|
-
/** [ref]-2:停刷新环(hardShutdown 收尾链;幂等,未起环时 no-op)。
|
|
89
|
+
/** [ref]-2:停刷新环(hardShutdown 收尾链;幂等,未起环时 no-op)。[ref]:中心凭证续签器的定时器同停(同一条收尾链)。 */
|
|
90
90
|
stopRefreshLoop(): void;
|
|
91
|
-
/**
|
|
91
|
+
/** [ref]:`/health.centerCredential` 的取值口 —— 凭证来源的健康态 + 续签器状态;都健康 / 没有中心 ⇒ `undefined`(键缺席)。 */
|
|
92
92
|
centerCredentialState(): CenterCredentialHealthView | undefined;
|
|
93
|
-
/**
|
|
93
|
+
/** [ref]:`/health.centerIdentityNotice` 的取值口 —— 中心凭证换人后的**最近一条**通告(`center_identity_demoted` 已降到无中心配置档 / `center_identity_landed`
|
|
94
94
|
* 新身份的配置已换上;码、冻结句与状态机见 `center-config-tier.ts`)。从未换过人 / 没有中心 ⇒ `undefined`(键缺席)。值形就是 wire 形 `{ code, message, at }`。 */
|
|
95
95
|
centerIdentityNoticeState(): CenterIdentityNotice | undefined;
|
|
96
96
|
/** [ref](core 5.50 [ref]):mid-turn MCP 撤销台账读口,喂 `RunnerDeps.mcpRevocations` 席。
|
|
@@ -108,7 +108,7 @@ export interface WebAdminRuntime {
|
|
|
108
108
|
/** boot ready 门:布防(`CONFIG_REQUIRE_ROSTER=true`,远程 registry 非 dryRun)且 roster 未落地 =
|
|
109
109
|
* 计费提交 503 + /health ready:false。缺省未布防 ⇒ 恒 true。 */
|
|
110
110
|
modelReady(): boolean;
|
|
111
|
-
/**
|
|
111
|
+
/** [ref] / [ref]:本副本**自报状态**里由 web-admin 持有的那两样 —— roster 落地(`modelReady` 翻真,one-way latch)与
|
|
112
112
|
* restart 信号(`restartState()` 出现 / 消失 / 变)—— 任一翻转的那一拍通知订阅者。装配层接 fleet 心跳的 `announceNow`,
|
|
113
113
|
* 让中心在翻转当刻就知道本副本可路由 / 要重启(不等下一拍心跳;draining 那一样由收尾链直调 `announceNow`,同一个触发)。
|
|
114
114
|
* 在状态**写定之后**调用,同步、逐个,入参 = 这一次翻的是哪一样(闭集 {@link SelfReportChange});不回放(订阅方在订阅前已读过
|
|
@@ -121,18 +121,18 @@ export interface WebAdminRuntime {
|
|
|
121
121
|
* 同一只谓词)∧ 应用着的那一代 ≠ 最后确认耐久接力的那一代(接力账;合成律 `buildConfigHandoff`)。非耐久部署 / 本地腿 / 没有配置管道 ⇒ 缺席。
|
|
122
122
|
* 两个事实两张脸:「要重启但扣着」归 `restart.withheld`,「声明了耐久接力而这一代没确认」归本键。 */
|
|
123
123
|
configHandoffState(): ConfigHandoff | undefined;
|
|
124
|
-
/**
|
|
124
|
+
/** [ref]:`/health.modelRefusals` 与 fleet 心跳 `modelRefusals` 的**同一只**取值口(settings-schema 6.2.0 `ModelRefusalsSignal` 形:
|
|
125
125
|
* 名 → 码 + 组拒码)。描述**最近一次被判的那份中心候选目录**(每次候选 apply 的报告 `ApplyReport.modelRefusals` 投影;组拒时就是被拒
|
|
126
126
|
* 的那份 —— 引擎自己的拒因表不换代)。没有可报的拒 / 没有配置管道 / 还没判过候选 ⇒ `undefined`(键缺席)。值变了 ⇒ 通知自报订阅者。 */
|
|
127
127
|
modelRefusalsState(): ModelRefusalsSignal | undefined;
|
|
128
|
-
/**
|
|
128
|
+
/** [ref]:`GET /v1/models.candidateRejected` 的取值口 —— 最近一次候选被判官整拒的结论(`candidateRejection` 座;域集就是判官交出的 `rejected.domains`)。
|
|
129
129
|
* present-iff 当前生效的配置是因判官整拒了最近一份候选而回落的那一份:后来的候选被判 clean 即撤下;还没判过候选 / 没有配置管道 ⇒ `undefined`(键缺席)。
|
|
130
130
|
* dry-run 姿势(`webAdmin.dryRun`,compare-only)恒 `undefined`:候选从不被应用,生效配置恒是 env,拒判是预演读数(日志行照响),不是配置没换的原因。 */
|
|
131
131
|
candidateRejectionState(): CandidateRejection | undefined;
|
|
132
132
|
/** [ref] 世代账:/health 的 target/applied/失败持续时长三键 + 诊断端点的 configApply 段(同一份读数)。
|
|
133
133
|
* `undefined` = 本部署没有配置管道(纯 env worker)⇒ 两个读面的形状**逐字不变**(additive 纪律)。 */
|
|
134
134
|
configApplyState(): ConfigApplyLedgerView | undefined;
|
|
135
|
-
/**
|
|
135
|
+
/** [ref] ②:caps `centerWiring.effectivePull` / `effectiveRevision` 的取值口 —— `lastPull`(新状态,只此一枚:boot 实拉 / 迟到 boot 到货 /
|
|
136
136
|
* refresh 拍收尾写)+ 与 `configApplyState()` **同一只** ledger 视图的已应用修订号。形与词表见 `web-admin-client/pull-state.ts`。 */
|
|
137
137
|
centerPullState(): CenterPullView;
|
|
138
138
|
/** DESIGN-278 §5 S2([ref]):center **当前在管**的 ServiceConfig 键集 —— `GET /v1/config/catalog` 判
|
package/dist/boot/web-admin.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { readFile as fsReadFile } from "node:fs/promises";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
-
import { WEB_ADMIN_ENV, formatConfigPath
|
|
5
|
+
import { WEB_ADMIN_ENV, formatConfigPath } from "@sema-agent/settings-schema";
|
|
6
6
|
import { stableStringify } from "@sema-agent/settings-schema/hash";
|
|
7
7
|
import { buildModelRefusalsSignal } from "../model-entry-refusal.js";
|
|
8
8
|
import { CenterPromptSource, FilePromptArtifactStore, FilePromptSourceStateStore, MemoryPromptArtifactStore, MemoryPromptSourceStateStore, } from "@sema-agent/core";
|
|
@@ -11,8 +11,8 @@ import { applyCenterPlugins } from "../capabilities/center-plugins.js";
|
|
|
11
11
|
import { applyCenterArtifact, centerSourceOnError, withPromptArtifactBackfill } from "../capabilities/center-prompts.js";
|
|
12
12
|
import { centerScenarios, centerScenarioDetails } from "../capabilities/scenarios.js";
|
|
13
13
|
import { isRosterGateArmed } from "../config.js";
|
|
14
|
-
import {
|
|
15
|
-
import { defaultLkgPath, defaultSkillCacheDir, saveLkg, loadLkg
|
|
14
|
+
import { DEPLOYMENT_SHAPE_PREDICATES } from "../deployment-shape.js";
|
|
15
|
+
import { defaultLkgPath, defaultSkillCacheDir, saveLkg, loadLkg } from "../config-lkg.js";
|
|
16
16
|
import { answerStillCurrent, centerStateBin, credentialIdentityNow, judgeCenterCredentialAtBoot } from "../center-credential.js";
|
|
17
17
|
import { createCenterConfigTier } from "../center-config-tier.js";
|
|
18
18
|
import { buildCenterCredentialHealthView, createCenterCredentialRenewer } from "../center-credential-renewer.js";
|
|
@@ -21,7 +21,8 @@ import { createConfigProvider, raceBootFetch, serviceConfigSourceKind, BOOT_FETC
|
|
|
21
21
|
import { ConfigDirUntrustedError } from "../config-dir-trust.js";
|
|
22
22
|
import { createKeyResolver } from "../key-resolver.js";
|
|
23
23
|
import { buildSealedKeyPublicFace, ensureCheckpointCtxSealing, ensureSealedKeyStore, reportExecutionPublicKey } from "../sealed-key.js";
|
|
24
|
-
import {
|
|
24
|
+
import { anthropicLaneCredentialOf } from "../model-route-gap.js";
|
|
25
|
+
import { applyEffective, applyCenterReadFace, buildReadFaceBaseline, buildReadFaceSwapCandidate, restoreReadFaceBaseline, mutateInPlace, logEffectiveDiff, applySkillsManifest, skillManifestEntriesNotInstalled, resolveMcpServers, resolveA2aPeers, restartReasons, modelPlaneChanged, withModelPlaneOf, fullyLandedForLkg, NO_CENTER_EFFECTIVE, isNoCenterEffective, fetchPromptArtifact } from "../web-admin-client/facade.js";
|
|
25
26
|
import { buildConfigHandoff, buildRestartSignal, configHandoffMissing } from "../fleet/engine-signal.js";
|
|
26
27
|
import { createMcpRevocationLedger, enabledMcpEntries } from "../web-admin-client/mcp-revocation.js";
|
|
27
28
|
import { buildUnreadConfigFileFields, buildUnreadConfigKeyFields } from "../web-admin-client/read-warnings.js";
|
|
@@ -133,7 +134,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
133
134
|
}
|
|
134
135
|
return r;
|
|
135
136
|
};
|
|
136
|
-
const sealedKeyDir = join(config.localDataRoot ?? localRoot, "sealed-key");
|
|
137
|
+
const sealedKeyDir = config.sealedKeyDir ?? join(config.localDataRoot ?? localRoot, "sealed-key");
|
|
137
138
|
let sealedKeys;
|
|
138
139
|
try {
|
|
139
140
|
sealedKeys = await ensureSealedKeyStore(sealedKeyDir, logger);
|
|
@@ -146,6 +147,11 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
146
147
|
});
|
|
147
148
|
}
|
|
148
149
|
catch (err) {
|
|
150
|
+
if (config.sealedKeyDir !== undefined) {
|
|
151
|
+
throw new Error(`SEALED_KEY_DIR=${config.sealedKeyDir}: the declared model-key custody directory cannot hold a sealed-key store (${String(err)}) — ` +
|
|
152
|
+
`refusing to start rather than run with every sealed model unusable (no_key_store). Make that directory creatable, owned by ` +
|
|
153
|
+
`the service user and chmod-able to 0700 on a writable filesystem, or unset SEALED_KEY_DIR to use <data root>/sealed-key.`);
|
|
154
|
+
}
|
|
149
155
|
logger.warn("sealed_key_store_unavailable", { err: String(err), note: "sealed api keys cannot be unsealed on this host — models carrying sealedApiKey will fail loud per-model" });
|
|
150
156
|
}
|
|
151
157
|
let checkpointCtxSealing;
|
|
@@ -153,7 +159,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
153
159
|
checkpointCtxSealing = await ensureCheckpointCtxSealing(sealedKeyDir, logger);
|
|
154
160
|
}
|
|
155
161
|
catch (err) {
|
|
156
|
-
logger.warn("checkpoint_ctx_sealing_unavailable", { err: err instanceof Error ? err.message : String(err), note: "suspended tasks' request credentials cannot be sealed on this host; with durable approvals on the boot refuses — make <data root>/sealed-key
|
|
162
|
+
logger.warn("checkpoint_ctx_sealing_unavailable", { err: err instanceof Error ? err.message : String(err), dir: join(sealedKeyDir, "checkpoint-ctx-keys"), note: "suspended tasks' request credentials cannot be sealed on this host; with durable approvals on the boot refuses — make that directory (under the sealed-key custody directory: SEALED_KEY_DIR, default <data root>/sealed-key) creatable and chmod-able by the service, or repair / remove a key file there whose public and private halves do not belong together" });
|
|
157
163
|
}
|
|
158
164
|
const configProvider = serviceConfigSourceKind(config) !== undefined
|
|
159
165
|
? createConfigProvider({
|
|
@@ -458,19 +464,6 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
458
464
|
return null;
|
|
459
465
|
}
|
|
460
466
|
const lkgPath = lkgPathFor(identity);
|
|
461
|
-
const legacy = await migrateV1Lkg({ legacyPath: config.configLkgPath ?? legacyV1LkgPath(config, cc?.worker), binPath: lkgPath, worker: cc?.worker, identity });
|
|
462
|
-
switch (legacy.outcome) {
|
|
463
|
-
case "none":
|
|
464
|
-
break;
|
|
465
|
-
case "migrated":
|
|
466
|
-
logger.info("config_lkg_migrated", { from: legacy.from, retiredTo: legacy.retiredTo, to: lkgPath, note: "formatVersion 1 LKG (pull-token identity = this worker) migrated once into this credential identity's bin; the old file was renamed, not deleted" });
|
|
467
|
-
if (legacy.retireError !== undefined)
|
|
468
|
-
logger.warn("config_lkg_legacy_not_retired", { path: legacy.from, reason: legacy.retireError, note: "the bin was written and is used; only the old file's rename / copy failed" });
|
|
469
|
-
break;
|
|
470
|
-
case "not-migrated":
|
|
471
|
-
logger.warn("config_lkg_unusable", { path: legacy.path, reason: legacy.reason, note: "env fallback serves; the cache rewrites on the next clean candidate" });
|
|
472
|
-
return null;
|
|
473
|
-
}
|
|
474
467
|
const read = await loadLkg(lkgPath, cc?.worker, identity);
|
|
475
468
|
if (!read.lkg) {
|
|
476
469
|
if (read.reason !== "absent")
|
|
@@ -749,7 +742,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
749
742
|
const pluginOut = await applyCenterPlugins(skills, effective, {
|
|
750
743
|
cacheRoot: join(config.localDataRoot ?? join(homedir(), ".ai-agent"), "plugin-cache"),
|
|
751
744
|
allowHosts: config.pluginsAllowHosts,
|
|
752
|
-
toolsShareThisFilesystem:
|
|
745
|
+
toolsShareThisFilesystem: DEPLOYMENT_SHAPE_PREDICATES.toolsOnThisHost.holds(config),
|
|
753
746
|
logger,
|
|
754
747
|
}).catch((err) => {
|
|
755
748
|
logger.warn("center_plugins_apply_failed", { error: err instanceof Error ? err.message : String(err) });
|
|
@@ -768,12 +761,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
768
761
|
return false;
|
|
769
762
|
});
|
|
770
763
|
{
|
|
771
|
-
const
|
|
772
|
-
const canonScenarios = (a) => [...(a ?? [])].sort().join("\u0000");
|
|
773
|
-
const liveSkillMiss = enabledManifest.some((m) => !skills.some((sk) => sk.spec.name === m.name &&
|
|
774
|
-
skillContentHash(sk.spec.content) === m.contentHash &&
|
|
775
|
-
sk.spec.description === m.description &&
|
|
776
|
-
canonScenarios(sk.scenarios) === canonScenarios(m.scenarios)));
|
|
764
|
+
const liveSkillMiss = skillManifestEntriesNotInstalled(skills, bootLkgCandidate.effective.skills?.skills ?? []).length > 0;
|
|
777
765
|
if (liveSkillMiss)
|
|
778
766
|
bootSkillStale = true;
|
|
779
767
|
if (liveSkillMiss && (bootPublished || (!lkgSurvivesRestart && lastPrewarmBodiesVerified))) {
|
|
@@ -805,7 +793,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
805
793
|
},
|
|
806
794
|
initKeyResolver() {
|
|
807
795
|
keyResolver = createKeyResolver(config.modelApiKeyEnv, process.env, config.modelApiKeys);
|
|
808
|
-
if (
|
|
796
|
+
if (anthropicLaneCredentialOf(config.anthropic ?? {})?.kind === "bearer" && (Object.keys(config.modelApiKeys).length > 0 || Object.keys(config.modelApiKeyEnv).length > 0)) {
|
|
809
797
|
logger.warn("per_model_key_bearer_gateway_combo", {
|
|
810
798
|
perModelKeys: Object.keys(config.modelApiKeys).length + Object.keys(config.modelApiKeyEnv).length,
|
|
811
799
|
note: "ANTHROPIC_AUTH_TOKEN (Bearer) deployment with per-model keys: core's per-call auth REPLACES the Authorization header with x-api-key for those models — a Bearer-only gateway will 401 them. Remove the per-model key for such models, or use a gateway accepting x-api-key.",
|
|
@@ -3,7 +3,7 @@ import { join } from "node:path";
|
|
|
3
3
|
import { FleetEventBus } from "../fleet/fleet-bus.js";
|
|
4
4
|
import { LocalWorkflowAgentSessionIndex } from "../orchestration/workflow-agent-session-index.js";
|
|
5
5
|
import { createCorruptReadFailOpenSeat } from "../observability/corrupt-read-seat.js";
|
|
6
|
-
import { FileWorkflowCompletionInbox, InMemoryWorkflowCompletionInbox, resolveCompletionRoute } from "../orchestration/workflow-completion-inbox.js";
|
|
6
|
+
import { FileWorkflowCompletionInbox, InMemoryWorkflowCompletionInbox, buildWorkflowCompleteInboxEntry, resolveCompletionRoute } from "../orchestration/workflow-completion-inbox.js";
|
|
7
7
|
import { FileWorkflowNotifyJournalStore, JournalingWorkflowRunStore, WorkflowNotifyGate } from "../orchestration/workflow-notify-journal.js";
|
|
8
8
|
import { SubagentSteerRegistry } from "../orchestration/subagent-steer.js";
|
|
9
9
|
import { WorkflowAgentRegistry } from "../orchestration/workflow-agent-steer.js";
|
|
@@ -40,14 +40,7 @@ export function createWorkflowOrchestration(ctx) {
|
|
|
40
40
|
const route = await resolveCompletionRoute(p, getRunStore() ? (id) => getRunStore().getRun(id) : undefined, config.requirePrincipal === true);
|
|
41
41
|
if (!route)
|
|
42
42
|
return;
|
|
43
|
-
await workflowCompletionInbox.enqueue(
|
|
44
|
-
sessionId: route.sessionId,
|
|
45
|
-
owner: route.owner,
|
|
46
|
-
runId: p.runId,
|
|
47
|
-
status: p.status,
|
|
48
|
-
summary: p.summary,
|
|
49
|
-
enqueuedAt: Date.now(),
|
|
50
|
-
});
|
|
43
|
+
await workflowCompletionInbox.enqueue(buildWorkflowCompleteInboxEntry(route, p, Date.now()));
|
|
51
44
|
}
|
|
52
45
|
catch (err) {
|
|
53
46
|
logger.warn("workflow_completion_enqueue_failed", { runId: p.runId, err: String(err) });
|