@sema-agent/server 7.133.0 → 7.135.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 +221 -0
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/USAGE.md +222 -36
- package/deploy/sema-up/README.md +16 -0
- package/deploy/sema-up/chart/Chart.yaml +1 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +15 -0
- package/deploy/sema-up/chart/templates/_helpers.tpl +129 -0
- package/deploy/sema-up/chart/templates/sealed-key.yaml +24 -0
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +14 -0
- package/deploy/sema-up/chart/templates/server.yaml +14 -0
- package/deploy/sema-up/chart/values-full-single.yaml +5 -1
- package/deploy/sema-up/chart/values.yaml +34 -0
- package/dist/adoption/plan.d.ts +1 -1
- package/dist/approval-ask-audit-store.d.ts +25 -25
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +66 -154
- package/dist/approval-card.js +33 -52
- package/dist/approval-content-kind.d.ts +26 -6
- package/dist/approval-content-kind.js +23 -3
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-gate-currency.d.ts +91 -0
- package/dist/approval-gate-currency.js +120 -0
- 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 +14 -8
- package/dist/approval.js +35 -16
- package/dist/auth-bridge.d.ts +1 -1
- 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/coordinators.d.ts +7 -2
- package/dist/boot/coordinators.js +8 -5
- 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 +2 -0
- package/dist/boot/leader.js +2 -1
- package/dist/boot/memory-boundary.d.ts +2 -2
- package/dist/boot/memory-consolidation.d.ts +15 -15
- package/dist/boot/parked-revive-gate.d.ts +3 -3
- package/dist/boot/parked-revive-gate.js +3 -2
- package/dist/boot/read-deny-anchor-audit.js +2 -2
- package/dist/boot/reapers.d.ts +4 -4
- package/dist/boot/resolve-spec.d.ts +1 -1
- package/dist/boot/resolve-spec.js +28 -24
- package/dist/boot/runner-deps.d.ts +29 -16
- package/dist/boot/runner-deps.js +12 -2
- 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-05-execution-env.js +4 -4
- package/dist/boot/stage-06-runners.d.ts +4 -3
- package/dist/boot/stage-06-runners.js +15 -4
- package/dist/boot/stage-07-capability-layer.d.ts +2 -1
- package/dist/boot/stage-08-reapers.d.ts +2 -1
- package/dist/boot/stage-09-leader.d.ts +2 -1
- package/dist/boot/stage-09-leader.js +2 -2
- package/dist/boot/stage-10-http-server.d.ts +2 -1
- package/dist/boot/stage-10-http-server.js +2 -1
- package/dist/boot/stores.d.ts +8 -0
- package/dist/boot/stores.js +10 -13
- package/dist/boot/web-admin.d.ts +21 -15
- package/dist/boot/web-admin.js +16 -12
- package/dist/boot/workflow-orchestration.js +2 -9
- package/dist/brain.d.ts +11 -11
- package/dist/budget.d.ts +4 -4
- package/dist/budget.js +5 -1
- package/dist/caller-text-echo.d.ts +2 -0
- package/dist/caller-text-echo.js +2 -1
- package/dist/canonical-json.d.ts +2 -41
- package/dist/canonical-json.js +2 -13
- 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 +2 -2
- package/dist/capabilities/composite-members.js +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 +10 -7
- package/dist/capabilities/mcp-probe.js +2 -2
- 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 +27 -24
- package/dist/capability-facts.js +18 -20
- package/dist/center-config-tier.d.ts +1 -1
- package/dist/center-credential.d.ts +4 -4
- package/dist/checkpoint-ctx-seal-m28.d.ts +42 -0
- package/dist/checkpoint-ctx-seal-m28.js +19 -0
- 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-invariants.d.ts +4 -4
- package/dist/config-invariants.js +3 -2
- package/dist/config-lkg.d.ts +1 -1
- package/dist/config-provider.d.ts +13 -13
- package/dist/config-provider.js +2 -1
- package/dist/config-types.d.ts +83 -83
- package/dist/config.d.ts +26 -24
- package/dist/config.js +12 -10
- 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/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/field-conflict.d.ts +2 -1
- package/dist/field-conflict.js +1 -0
- package/dist/file-history-capture.d.ts +9 -9
- package/dist/file-history-disclosure.d.ts +50 -9
- package/dist/file-history-disclosure.js +8 -13
- package/dist/fleet/drain-entry.d.ts +2 -2
- package/dist/fleet/fleet-bus.d.ts +26 -14
- package/dist/fleet/fleet-bus.js +6 -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 +13 -13
- package/dist/fleet-lease.d.ts +16 -16
- package/dist/governance-http-status.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +7 -7
- package/dist/hooks/hook-runner.d.ts +57 -30
- package/dist/hooks/hook-runner.js +38 -20
- 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 +28 -5
- package/dist/http/approval-sweeps.d.ts +1 -1
- package/dist/http/approval-sweeps.js +5 -2
- package/dist/http/checkpoint-ctx.d.ts +183 -2
- package/dist/http/checkpoint-ctx.js +197 -2
- package/dist/http/dispatch.d.ts +3 -3
- package/dist/http/dispatch.js +3 -3
- package/dist/http/durable-run-leg.js +7 -5
- package/dist/http/idempotency.d.ts +4 -4
- package/dist/http/idempotency.js +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 +39 -13
- package/dist/http/principal-gate.js +30 -6
- package/dist/http/readiness.d.ts +1 -1
- package/dist/http/refusal-body.d.ts +12 -0
- package/dist/http/refusal-body.js +11 -0
- package/dist/http/request-guards.d.ts +4 -13
- package/dist/http/request-guards.js +4 -17
- package/dist/http/resume-ctx-read.d.ts +53 -6
- package/dist/http/resume-ctx-read.js +26 -3
- package/dist/http/resume-legs.d.ts +5 -4
- package/dist/http/resume-legs.js +47 -29
- package/dist/http/route-ctx.d.ts +29 -38
- package/dist/http/route-table.d.ts +9 -9
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/agents-roster.js +2 -3
- package/dist/http/routes/approvals-assistant.d.ts +5 -5
- package/dist/http/routes/approvals-assistant.js +91 -17
- 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 +6 -6
- package/dist/http/routes/diagnostics.js +1 -1
- package/dist/http/routes/fleet.d.ts +1 -1
- package/dist/http/routes/fleet.js +5 -4
- 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/memory-origin.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/rules.js +4 -4
- package/dist/http/routes/runs.js +44 -11
- package/dist/http/routes/session-sync.d.ts +3 -2
- package/dist/http/routes/session-sync.js +109 -62
- package/dist/http/routes/sessions-list.d.ts +1 -1
- package/dist/http/routes/sessions-list.js +4 -5
- package/dist/http/routes/sessions.js +34 -48
- package/dist/http/routes/tasks.d.ts +1 -1
- package/dist/http/routes/tasks.js +21 -16
- package/dist/http/routes/trace-usage.d.ts +1 -1
- package/dist/http/routes/trace-usage.js +7 -9
- 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 +39 -33
- package/dist/http/server.js +5 -2
- 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.d.ts +4 -3
- package/dist/http/submit-ctx.js +19 -3
- 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 +35 -24
- package/dist/index.d.ts +2 -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 +9 -5
- package/dist/leader/wire.js +8 -7
- package/dist/list-entry-display.d.ts +1 -1
- package/dist/lsp-evict.d.ts +1 -1
- package/dist/main.js +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-origin-fence.js +2 -2
- 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-compat.d.ts +1 -1
- 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-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/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 +12 -8
- package/dist/observability/fail-open.js +12 -8
- package/dist/observability/metrics.d.ts +3 -3
- package/dist/observability/prompt-manifest.d.ts +19 -8
- package/dist/observability/prompt-manifest.js +9 -8
- 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/observability/tool-trace.js +8 -9
- 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/orchestration/workflow-park-decision.d.ts +1 -1
- package/dist/orchestration/workflow-park-decision.js +1 -0
- package/dist/outbound-dispatcher.d.ts +4 -4
- package/dist/parent-watch.d.ts +4 -4
- package/dist/parked-decide.d.ts +20 -20
- package/dist/parked-decide.js +8 -5
- package/dist/parked-revive-surface.d.ts +7 -7
- package/dist/parked-revive-surface.js +2 -3
- package/dist/peer-directory.d.ts +3 -3
- package/dist/peer-directory.js +1 -1
- package/dist/permission-rule-list.d.ts +10 -1
- package/dist/permission-rule-list.js +7 -5
- package/dist/permission-rule-vocab.d.ts +3 -25
- package/dist/permission-rule-vocab.js +0 -13
- 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 +34 -15
- package/dist/plugins/approval-ask-store-sql.js +18 -5
- package/dist/plugins/approval-exemption-store.d.ts +3 -3
- package/dist/plugins/approval-nonce-store.d.ts +3 -3
- package/dist/plugins/approval-payload-fingerprint.d.ts +14 -6
- package/dist/plugins/approval-payload-fingerprint.js +1 -1
- 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/caching-session-store.d.ts +24 -33
- package/dist/plugins/caching-session-store.js +8 -19
- package/dist/plugins/checkpoint-index-columns.d.ts +81 -0
- package/dist/plugins/checkpoint-index-columns.js +62 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +66 -67
- package/dist/plugins/checkpoint-store-sql.js +100 -103
- 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 +9 -7
- package/dist/plugins/file-history-store-sql.js +27 -15
- 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 +23 -12
- package/dist/plugins/local-checkpoint-store.js +29 -4
- package/dist/plugins/local-session-store.d.ts +44 -45
- package/dist/plugins/local-session-store.js +42 -52
- package/dist/plugins/local-session-window.d.ts +12 -6
- package/dist/plugins/local-session-window.js +1 -17
- 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 +76 -39
- package/dist/plugins/one-time-migrations.js +127 -34
- 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 +16 -19
- package/dist/plugins/permission-rule-store-sql.d.ts +38 -4
- package/dist/plugins/permission-rule-store-sql.js +74 -31
- 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 +9 -21
- package/dist/plugins/pg-session-storage.js +51 -42
- package/dist/plugins/remote-env-adb.d.ts +10 -10
- package/dist/plugins/remote-env-device.d.ts +22 -14
- package/dist/plugins/remote-env-device.js +28 -16
- 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 +8 -8
- 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/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.d.ts +11 -0
- package/dist/plugins/session-ownership.js +11 -0
- package/dist/plugins/session-placement.d.ts +12 -14
- package/dist/plugins/session-placement.js +2 -15
- 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/sql-driver.d.ts +8 -8
- package/dist/plugins/sql-errors.d.ts +1 -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/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 +9 -2
- package/dist/plugins/tidb-session-store.d.ts +17 -27
- package/dist/plugins/tidb-session-store.js +52 -42
- 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 +19 -4
- 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-key-closure.d.ts +1 -1
- package/dist/request-key-closure.js +1 -1
- package/dist/request-tool-axes.d.ts +12 -0
- package/dist/request-tool-axes.js +20 -0
- 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/run-local.js +1 -0
- package/dist/runs.d.ts +15 -12
- package/dist/runs.js +19 -4
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-governance.d.ts +9 -9
- package/dist/sandbox-pkg-source.d.ts +9 -31
- package/dist/sandbox-pkg-source.js +14 -8
- package/dist/sealed-key.d.ts +34 -2
- package/dist/sealed-key.js +55 -1
- package/dist/security.d.ts +31 -32
- 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 +19 -12
- package/dist/session-error-wire.js +4 -1
- package/dist/session-incarnation.d.ts +52 -35
- package/dist/session-incarnation.js +23 -8
- 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-sync-kernel.d.ts +38 -11
- package/dist/session-sync-kernel.js +10 -0
- package/dist/session-sync.d.ts +49 -6
- package/dist/session-sync.js +52 -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 +3 -1
- package/dist/task-a2a.js +38 -5
- package/dist/task-cwd.d.ts +7 -88
- package/dist/task-cwd.js +2 -15
- package/dist/task-mcp.d.ts +14 -10
- package/dist/task-mcp.js +39 -12
- package/dist/task-settings.d.ts +34 -18
- package/dist/task-settings.js +34 -4
- 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 +273 -228
- package/dist/tool-approval.js +125 -47
- package/dist/tool-rule-names.d.ts +7 -1
- package/dist/trace/core-keyset-guard.d.ts +15 -9
- 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 +40 -1
- package/dist/trace/exit-seat.js +46 -14
- package/dist/trace/ledger-events.d.ts +6 -4
- package/dist/trace/ledger-sink.d.ts +1 -1
- package/dist/trace/model-segment.d.ts +3 -3
- package/dist/trace/project.d.ts +65 -46
- package/dist/trace/project.js +49 -5
- package/dist/trace/redact.d.ts +44 -27
- package/dist/trace/redact.js +343 -73
- package/dist/trace/self-minted-wire.d.ts +39 -14
- package/dist/trace/self-minted-wire.js +9 -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 +9 -3
- package/dist/trace/wire-projection-faces.js +7 -1
- package/dist/unattended-permission-mode.d.ts +5 -5
- package/dist/url-credential.d.ts +52 -0
- package/dist/url-credential.js +49 -0
- package/dist/url-refusal.d.ts +6 -2
- package/dist/url-refusal.js +8 -1
- 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 +29 -4
- package/dist/web-admin-client/skills-mcp.js +31 -4
- package/dist/web-admin-client/types.d.ts +17 -10
- package/dist/workspace-space.d.ts +5 -3
- package/dist/write-protection.d.ts +2 -2
- package/package.json +4 -3
- package/scripts/drain-check-local.mjs +35 -2
- package/scripts/drain-check.mysql.sql +22 -2
- package/scripts/drain-check.pg.sql +22 -2
- package/skills/loop.md +1 -1
- package/dist/mcp-tool-faces.d.ts +0 -69
- package/dist/mcp-tool-faces.js +0 -104
- package/dist/orchestration/workflow-journal-entry.js +0 -27
|
@@ -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")`
|
|
@@ -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", {});
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
import { Runner } from "@sema-agent/core";
|
|
10
10
|
import { ForkRoutingSessionStore } from "../plugins/fork-routing-session-store.js";
|
|
11
11
|
import type { runStage05 } from "./stage-05-execution-env.js";
|
|
12
|
-
export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>): {
|
|
12
|
+
export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>): Promise<{
|
|
13
13
|
approvalAskAudit: import("../approval-ask-audit-store.js").FileApprovalAskAuditStore | undefined;
|
|
14
14
|
approvalExemptionStore: import("../plugins/approval-exemption-store.js").ApprovalExemptionStore | undefined;
|
|
15
15
|
centerRuntimeCapsResolver: ((principal: string | undefined) => Promise<import("@sema-agent/core").RuntimeCaps | undefined>) | undefined;
|
|
16
16
|
checkpointStore: import("../plugins/store-backend.js").CheckpointStoreFull | undefined;
|
|
17
|
+
checkpointCtxSealing: import("../http/checkpoint-ctx.js").CheckpointCtxSealing | undefined;
|
|
17
18
|
parkCommits: import("../plugins/park-commit-watch.js").ParkCommitWatch | undefined;
|
|
18
19
|
durableEnabled: boolean;
|
|
19
20
|
elicitation: import("../elicitation.js").ElicitationCoordinator | undefined;
|
|
@@ -41,7 +42,7 @@ export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>):
|
|
|
41
42
|
sessionTitler: import("../session-titler.js").SessionTitler | undefined;
|
|
42
43
|
sharedMemoryStore: import("../plugins/shared-memory-store-sql.js").SqlSharedMemoryStore | undefined;
|
|
43
44
|
sqlWorkflowRunStore: import("@sema-agent/core").WorkflowRunStore | undefined;
|
|
44
|
-
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate
|
|
45
|
+
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate<import("../approval-gate-currency.js").GateCurrencyStore>;
|
|
45
46
|
subRunner: Runner;
|
|
46
47
|
subRunnerSessions: ForkRoutingSessionStore;
|
|
47
48
|
subagentSteerRegistry: import("../orchestration/subagent-steer.js").SubagentSteerRegistry;
|
|
@@ -148,5 +149,5 @@ export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>):
|
|
|
148
149
|
localRoot: string;
|
|
149
150
|
logger: import("../index.js").Logger;
|
|
150
151
|
metrics: import("../index.js").Metrics;
|
|
151
|
-
}
|
|
152
|
+
}>;
|
|
152
153
|
//# sourceMappingURL=stage-06-runners.d.ts.map
|
|
@@ -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";
|
|
@@ -15,7 +14,10 @@ import { buildConsolidationValveAudit, createMemoryConsolidationFaces, createOpe
|
|
|
15
14
|
import { createPerModelAuthSeat } from "./side-query-lane.js";
|
|
16
15
|
import { createWorkflowOrchestration } from "./workflow-orchestration.js";
|
|
17
16
|
import { createLiveCoordinators } from "./coordinators.js";
|
|
17
|
+
import { assertApprovalAskRuleMaterialOnBackend } from "./stores.js";
|
|
18
18
|
import { createParkCommitWatch } from "../plugins/park-commit-watch.js";
|
|
19
|
+
import { CHECKPOINT_CTX_SEALING_REQUIRED } from "../http/checkpoint-ctx.js";
|
|
20
|
+
import { sealCheckpointCtxCredentialsM28 } from "../checkpoint-ctx-seal-m28.js";
|
|
19
21
|
import { createRuntimeCaps } from "./runtime-caps.js";
|
|
20
22
|
import { createEngineNoticeForwarder, createRunnerDeps, createSharedRunnerDeps } from "./runner-deps.js";
|
|
21
23
|
import { defaultEngineNoticeRouter } from "../trace/engine-notice-wire.js";
|
|
@@ -25,17 +27,27 @@ import { createSharedMemoryScopeAuthorizer } from "../shared-memory-scope-author
|
|
|
25
27
|
import { mountOrgDeliveryGate } from "./org-delivery.js";
|
|
26
28
|
import { parkedAskRedeem, runStore } from "./late-binds.js";
|
|
27
29
|
import { withInternalRunEnvs } from "../internal-run-env.js";
|
|
28
|
-
export function runStage06(ctx) {
|
|
30
|
+
export async function runStage06(ctx) {
|
|
29
31
|
const { backend, backgroundAgentStore, brain, engineDataRoot, config, webAdmin, consolidationValve, deploymentMods, executionEnvFactory, fileHistoryStore, localRoot, logger, lspManager, mailboxRecipientLifecycle, mailboxStore, memoryEngine, memorySyncRunner, metrics, perSessionCwd, permissionRuleProvider, pricing, rosterStore, ruleConsent, sendUserFileTaskEnvs, sessionCaptureRecordStore, sessionCaptureRecords, sessionPolicyStore, sessionStore, taskAttachmentStore, taskListLane, toolResultStore, tracer, usageWindowStore } = ctx;
|
|
30
32
|
const { sqlWorkflowRunStore, workflowNotifyJournal, workflowCompletionInbox, deliverWorkflowCompletion, workflowNotifyGate, fleetBus, workflowRunStore, workflowJournalStore, outcomeSink, workflowRecoverOpts, workflowAgentRegistry, subagentSteerRegistry, workflowAgentSessionIndex, workflowParkDecisions, } = createWorkflowOrchestration({ config, logger, metrics, localRoot, backend, getRunStore: () => runStore });
|
|
31
33
|
const parkCommitted = backend?.checkpoint && config.durableApproval ? createParkCommitWatch(backend.checkpoint(logger)) : undefined;
|
|
32
34
|
const checkpointStore = parkCommitted?.store;
|
|
33
35
|
const parkCommits = parkCommitted?.watch;
|
|
36
|
+
const checkpointCtxSealing = webAdmin.checkpointCtxSealing;
|
|
37
|
+
if (checkpointStore !== undefined) {
|
|
38
|
+
if (checkpointCtxSealing === undefined)
|
|
39
|
+
throw new Error(CHECKPOINT_CTX_SEALING_REQUIRED);
|
|
40
|
+
const m28 = await sealCheckpointCtxCredentialsM28(checkpointStore, checkpointCtxSealing, { today: new Date().toISOString().slice(0, 10) });
|
|
41
|
+
logger.info("checkpoint_ctx_credentials_sealed", { ...m28, note: "one-time migration M28: plaintext request credentials in suspended tasks' resume contexts sealed in place" });
|
|
42
|
+
}
|
|
34
43
|
const { elicitation, question, toolApproval, durableEnabled, streamApprovalGate, approvalAskAudit, approvalExemptionStore, sendUserFileEmitter, sendFileLedger, sendUserFileToolSpec } = createLiveCoordinators({
|
|
35
44
|
config, logger, backend, sendUserFileTaskEnvs, ruleConsent, parkCommits,
|
|
45
|
+
...(checkpointStore !== undefined ? { checkpointStore } : {}),
|
|
36
46
|
getParkedRedeem: () => parkedAskRedeem,
|
|
37
47
|
ruleScopeRootFor: (sessionId) => cardRuleScopeRoot(sessionId !== undefined ? perSessionCwd.get(sessionId) : undefined, config),
|
|
38
48
|
});
|
|
49
|
+
if (streamApprovalGate.active)
|
|
50
|
+
await assertApprovalAskRuleMaterialOnBackend(backend);
|
|
39
51
|
const memoryOptOutGrantStore = backend?.memoryOptOutGrant();
|
|
40
52
|
const { principalCaps, centerRuntimeCapsResolver, runtimeCapsResolver, runtimeCapsPeekResolver } = createRuntimeCaps({ config, logger, memoryOptOutGrant: memoryOptOutGrantStore });
|
|
41
53
|
const orgMemoryAdmission = createOrgMemoryAdmissionWiring({ config, logger, metrics });
|
|
@@ -170,7 +182,6 @@ export function runStage06(ctx) {
|
|
|
170
182
|
? createSessionTitler({
|
|
171
183
|
setTitleIfNull: titleCapable.setTitleIfNull.bind(sessionStore),
|
|
172
184
|
probeTitle: titleCapable.probeTitle.bind(sessionStore),
|
|
173
|
-
redact: redactSecrets,
|
|
174
185
|
llm: (o) => hookLlm({ prompt: o.prompt, timeoutMs: o.timeoutMs, model: o.model }),
|
|
175
186
|
logger,
|
|
176
187
|
metrics,
|
|
@@ -213,6 +224,6 @@ export function runStage06(ctx) {
|
|
|
213
224
|
onError: runnerDeps.onError ? runnerDeps.onError : undefined,
|
|
214
225
|
};
|
|
215
226
|
const subRunner = new Runner(subRunnerDeps);
|
|
216
|
-
return { ...ctx, approvalAskAudit, approvalExemptionStore, centerRuntimeCapsResolver, checkpointStore, parkCommits, durableEnabled, elicitation, fleetBus, governanceSeams, handslessRunner, hookAgent, hookAgentRunner, hookLlm, mcpRevocations, memoryConsolidationFaces, memoryOptOutGrantStore, orgMemoryAdmission, outcomeSink, principalCaps, question, retentionExecutor, retentionLaneStore, runner, runnerDeps, runtimeCapsPeekResolver, sendFileLedger, sendUserFileEmitter, sendUserFileToolSpec, sessionTitler, sharedMemoryStore, sqlWorkflowRunStore, streamApprovalGate, subRunner, subRunnerSessions, subagentSteerRegistry, toolApproval, workflowAgentRegistry, workflowAgentSessionIndex, workflowCompletionInbox, workflowJournalStore, workflowModelAllowlistSnapshot, workflowParkDecisions, workflowNotifyGate, workflowNotifyJournal, workflowRecoverOpts, workflowRunStore, workflowsCapable, orgDeliveryGate };
|
|
227
|
+
return { ...ctx, approvalAskAudit, approvalExemptionStore, centerRuntimeCapsResolver, checkpointStore, checkpointCtxSealing, parkCommits, durableEnabled, elicitation, fleetBus, governanceSeams, handslessRunner, hookAgent, hookAgentRunner, hookLlm, mcpRevocations, memoryConsolidationFaces, memoryOptOutGrantStore, orgMemoryAdmission, outcomeSink, principalCaps, question, retentionExecutor, retentionLaneStore, runner, runnerDeps, runtimeCapsPeekResolver, sendFileLedger, sendUserFileEmitter, sendUserFileToolSpec, sessionTitler, sharedMemoryStore, sqlWorkflowRunStore, streamApprovalGate, subRunner, subRunnerSessions, subagentSteerRegistry, toolApproval, workflowAgentRegistry, workflowAgentSessionIndex, workflowCompletionInbox, workflowJournalStore, workflowModelAllowlistSnapshot, workflowParkDecisions, workflowNotifyGate, workflowNotifyJournal, workflowRecoverOpts, workflowRunStore, workflowsCapable, orgDeliveryGate };
|
|
217
228
|
}
|
|
218
229
|
//# sourceMappingURL=stage-06-runners.js.map
|
|
@@ -29,6 +29,7 @@ export declare function runStage07(ctx: Awaited<ReturnType<typeof runStage06>>):
|
|
|
29
29
|
approvalAskAudit: import("../approval-ask-audit-store.js").FileApprovalAskAuditStore | undefined;
|
|
30
30
|
centerRuntimeCapsResolver: ((principal: string | undefined) => Promise<import("@sema-agent/core").RuntimeCaps | undefined>) | undefined;
|
|
31
31
|
checkpointStore: import("../plugins/store-backend.js").CheckpointStoreFull | undefined;
|
|
32
|
+
checkpointCtxSealing: import("../index.js").CheckpointCtxSealing | undefined;
|
|
32
33
|
parkCommits: import("../plugins/park-commit-watch.js").ParkCommitWatch | undefined;
|
|
33
34
|
durableEnabled: boolean;
|
|
34
35
|
elicitation: import("../elicitation.js").ElicitationCoordinator | undefined;
|
|
@@ -56,7 +57,7 @@ export declare function runStage07(ctx: Awaited<ReturnType<typeof runStage06>>):
|
|
|
56
57
|
sessionTitler: import("../session-titler.js").SessionTitler | undefined;
|
|
57
58
|
sharedMemoryStore: import("../plugins/shared-memory-store-sql.js").SqlSharedMemoryStore | undefined;
|
|
58
59
|
sqlWorkflowRunStore: import("@sema-agent/core").WorkflowRunStore | undefined;
|
|
59
|
-
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate
|
|
60
|
+
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate<import("../approval-gate-currency.js").GateCurrencyStore>;
|
|
60
61
|
subRunner: import("@sema-agent/core").Runner;
|
|
61
62
|
subRunnerSessions: import("../plugins/fork-routing-session-store.js").ForkRoutingSessionStore;
|
|
62
63
|
subagentSteerRegistry: import("../orchestration/subagent-steer.js").SubagentSteerRegistry;
|
|
@@ -42,6 +42,7 @@ export declare function runStage08(ctx: Awaited<ReturnType<typeof runStage07>>):
|
|
|
42
42
|
approvalAskAudit: import("../approval-ask-audit-store.js").FileApprovalAskAuditStore | undefined;
|
|
43
43
|
centerRuntimeCapsResolver: ((principal: string | undefined) => Promise<import("@sema-agent/core").RuntimeCaps | undefined>) | undefined;
|
|
44
44
|
checkpointStore: import("../plugins/store-backend.js").CheckpointStoreFull | undefined;
|
|
45
|
+
checkpointCtxSealing: import("../index.js").CheckpointCtxSealing | undefined;
|
|
45
46
|
parkCommits: import("../plugins/park-commit-watch.js").ParkCommitWatch | undefined;
|
|
46
47
|
durableEnabled: boolean;
|
|
47
48
|
elicitation: import("../elicitation.js").ElicitationCoordinator | undefined;
|
|
@@ -69,7 +70,7 @@ export declare function runStage08(ctx: Awaited<ReturnType<typeof runStage07>>):
|
|
|
69
70
|
sessionTitler: import("../session-titler.js").SessionTitler | undefined;
|
|
70
71
|
sharedMemoryStore: import("../plugins/shared-memory-store-sql.js").SqlSharedMemoryStore | undefined;
|
|
71
72
|
sqlWorkflowRunStore: import("@sema-agent/core").WorkflowRunStore | undefined;
|
|
72
|
-
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate
|
|
73
|
+
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate<import("../approval-gate-currency.js").GateCurrencyStore>;
|
|
73
74
|
subRunner: Runner;
|
|
74
75
|
subRunnerSessions: import("../plugins/fork-routing-session-store.js").ForkRoutingSessionStore;
|
|
75
76
|
subagentSteerRegistry: import("../orchestration/subagent-steer.js").SubagentSteerRegistry;
|
|
@@ -66,6 +66,7 @@ export declare function runStage09(ctx: Awaited<ReturnType<typeof runStage08>>):
|
|
|
66
66
|
approvalAskAudit: import("../approval-ask-audit-store.js").FileApprovalAskAuditStore | undefined;
|
|
67
67
|
centerRuntimeCapsResolver: ((principal: string | undefined) => Promise<import("@sema-agent/core").RuntimeCaps | undefined>) | undefined;
|
|
68
68
|
checkpointStore: import("../plugins/store-backend.js").CheckpointStoreFull | undefined;
|
|
69
|
+
checkpointCtxSealing: import("../index.js").CheckpointCtxSealing | undefined;
|
|
69
70
|
parkCommits: import("../plugins/park-commit-watch.js").ParkCommitWatch | undefined;
|
|
70
71
|
durableEnabled: boolean;
|
|
71
72
|
elicitation: import("../elicitation.js").ElicitationCoordinator | undefined;
|
|
@@ -93,7 +94,7 @@ export declare function runStage09(ctx: Awaited<ReturnType<typeof runStage08>>):
|
|
|
93
94
|
sessionTitler: import("../session-titler.js").SessionTitler | undefined;
|
|
94
95
|
sharedMemoryStore: import("../plugins/shared-memory-store-sql.js").SqlSharedMemoryStore | undefined;
|
|
95
96
|
sqlWorkflowRunStore: import("@sema-agent/core").WorkflowRunStore | undefined;
|
|
96
|
-
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate
|
|
97
|
+
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate<import("../approval-gate-currency.js").GateCurrencyStore>;
|
|
97
98
|
subRunner: import("@sema-agent/core").Runner;
|
|
98
99
|
subRunnerSessions: import("../plugins/fork-routing-session-store.js").ForkRoutingSessionStore;
|
|
99
100
|
subagentSteerRegistry: import("../orchestration/subagent-steer.js").SubagentSteerRegistry;
|
|
@@ -6,7 +6,7 @@ import { createLeaderFace } from "./leader.js";
|
|
|
6
6
|
import { assertStaticWiringConsistent } from "../http/routes/diagnostics.js";
|
|
7
7
|
import { buildDisplaySafeUrl } from "../trace/redact.js";
|
|
8
8
|
export function runStage09(ctx) {
|
|
9
|
-
const { approvalExemptionStore, backend, backgroundAgentStore, brain, checkpointStore, config, webAdmin, deviceLane, dropSessionScoped, durableEnabled, executionEnvFactory, fileHistoryErasure, governanceSeams, localRoot, logger, mailboxRecipientLifecycle, mailboxStore, metrics, pricing, resumeAnchorStore, runStore, runnerDeps, sessionPolicyStore, sessionStore, streamApprovalGate, taskAttachmentStore, spaceReclaimer, taskListLane, toolResultStore, tracer, usageWindowStore, userInputLedgerStore, workflowCompletionInbox } = ctx;
|
|
9
|
+
const { approvalExemptionStore, backend, backgroundAgentStore, brain, checkpointStore, checkpointCtxSealing, config, webAdmin, deviceLane, dropSessionScoped, durableEnabled, executionEnvFactory, fileHistoryErasure, governanceSeams, localRoot, logger, mailboxRecipientLifecycle, mailboxStore, metrics, pricing, resumeAnchorStore, runStore, runnerDeps, sessionPolicyStore, sessionStore, streamApprovalGate, taskAttachmentStore, spaceReclaimer, taskListLane, toolResultStore, tracer, usageWindowStore, userInputLedgerStore, workflowCompletionInbox } = ctx;
|
|
10
10
|
const { ownerAware, sessionAudit, sessionWatchRegistry, purgeSession, instrumentDegenerate, planCacheProbe } = createSessionFaces({
|
|
11
11
|
deviceStore: deviceLane?.store,
|
|
12
12
|
dropSessionScoped,
|
|
@@ -17,7 +17,7 @@ export function runStage09(ctx) {
|
|
|
17
17
|
userInputLedgerStore,
|
|
18
18
|
...(spaceReclaimer !== undefined ? { spaceReclaimer } : {}),
|
|
19
19
|
});
|
|
20
|
-
const leaderEndpoint = createLeaderFace({ config, logger, brain, pricing, executionEnvFactory, toolResultStore, sessionStore, checkpointStore, governanceSeams, backend, tracer, usageWindowStore, promptSource: webAdmin.promptSource, onError: runnerDeps.onError });
|
|
20
|
+
const leaderEndpoint = createLeaderFace({ config, logger, brain, pricing, executionEnvFactory, toolResultStore, sessionStore, checkpointStore, checkpointCtxSealing, governanceSeams, backend, tracer, usageWindowStore, promptSource: webAdmin.promptSource, onError: runnerDeps.onError });
|
|
21
21
|
const drainState = { draining: false };
|
|
22
22
|
const authBridgeIssuer = authBridgeIssuerOf(config)?.issuer;
|
|
23
23
|
const webAdminJwtVerifier = authBridgeIssuer
|
|
@@ -65,6 +65,7 @@ export declare function runStage10(ctx: Awaited<ReturnType<typeof runStage09>>):
|
|
|
65
65
|
approvalAskAudit: import("../approval-ask-audit-store.js").FileApprovalAskAuditStore | undefined;
|
|
66
66
|
centerRuntimeCapsResolver: ((principal: string | undefined) => Promise<import("@sema-agent/core").RuntimeCaps | undefined>) | undefined;
|
|
67
67
|
checkpointStore: import("../plugins/store-backend.js").CheckpointStoreFull | undefined;
|
|
68
|
+
checkpointCtxSealing: import("../index.js").CheckpointCtxSealing | undefined;
|
|
68
69
|
parkCommits: import("../plugins/park-commit-watch.js").ParkCommitWatch | undefined;
|
|
69
70
|
durableEnabled: boolean;
|
|
70
71
|
elicitation: import("../elicitation.js").ElicitationCoordinator | undefined;
|
|
@@ -92,7 +93,7 @@ export declare function runStage10(ctx: Awaited<ReturnType<typeof runStage09>>):
|
|
|
92
93
|
sessionTitler: import("../session-titler.js").SessionTitler | undefined;
|
|
93
94
|
sharedMemoryStore: import("../plugins/shared-memory-store-sql.js").SqlSharedMemoryStore | undefined;
|
|
94
95
|
sqlWorkflowRunStore: import("@sema-agent/core").WorkflowRunStore | undefined;
|
|
95
|
-
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate
|
|
96
|
+
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate<import("../approval-gate-currency.js").GateCurrencyStore>;
|
|
96
97
|
subRunner: import("@sema-agent/core").Runner;
|
|
97
98
|
subRunnerSessions: import("../plugins/fork-routing-session-store.js").ForkRoutingSessionStore;
|
|
98
99
|
subagentSteerRegistry: import("../orchestration/subagent-steer.js").SubagentSteerRegistry;
|
|
@@ -29,13 +29,14 @@ import { bindServerLateSeats } from "./late-binds.js";
|
|
|
29
29
|
import { serviceVersion } from "../service-version.js";
|
|
30
30
|
import { buildDisplaySafeUrl } from "../trace/redact.js";
|
|
31
31
|
export async function runStage10(ctx) {
|
|
32
|
-
const { approvalAskAudit, approvalExemptionStore, approvalNonceStore, authorize, backend, backgroundAgentStore, brain, breakerState, centerRuntimeCapsResolver, checkpointStore, parkCommits, config, webAdmin, consolidationValve, costQuota, deviceLane, drainState, durableEnabled, elicitation, fenceSessionOwner, fileHistoryStore, fleetBus, fleetLease, fleetUsage, governanceSeams, handslessRunner, hookAgent, hookLlm, hookWakeBus, imageBakes, imageIndex, instanceId, instrumentDegenerate, leaderEndpoint, localRoot, logger, lspManager, mcpRevocations, memoryBundleFaces, memoryComplianceFaces, memoryConsolidationFaces, memoryEngine, memoryExportBackend, memoryOptOutGrantStore, memoryOriginFaces, memoryPosture, memorySyncCursors, memorySyncRunner, metrics, modelUsageTracker, orgMemoryAdmission, otelExporter, outcomeSink, ownerAware, parkedReviveInheritedGate, parkedReviveSurface, perSessionCwd, perTaskImage, planCacheProbe, pricing, principalCaps, promptManifestTracker, purgeSession, question, rateLimiter, reaper, webAdminJwtVerifier, resumeAnchorStore, retentionLaneStarted, retentionLaneStore, ruleConsent, runStore, runner, runnerDeps, runtimeCapsPeekResolver, scenarioDetails, scenarios, selectEnvTool, sendFileLedger, sendUserFileEmitter, sendUserFileToolSpec, sessionAudit, sessionEnvSelection, sessionMemoryStatusFace, sessionPolicyStore, sessionTitler, sessionWatchRegistry, setSessionCwd, setSessionInheritEnv, setSessionShellEnv, sharedMemoryStore, sideQueryAccounting, sqlEngine, sqlWorkflowRunStore, staticWiring, storePosture, subRunner, subagentSteerRegistry, taskAttachmentStore, taskLimitCaps, taskTimeoutSec, toolApproval, toolResultStore, usageWindowStore, userInputLedger, webSearchProvider, workflowAgentRegistry, workflowAgentSessionIndex, workflowParkDecisions, workflowCompletionInbox, workflowJournalStore, workflowModelAllowlistSnapshot, workflowNotifyGate, workflowNotifyJournal, workflowRecoverOpts, workflowRunStore, workflowsCapable, orgDeliveryGate } = ctx;
|
|
32
|
+
const { approvalAskAudit, approvalExemptionStore, approvalNonceStore, authorize, backend, backgroundAgentStore, brain, breakerState, centerRuntimeCapsResolver, checkpointStore, checkpointCtxSealing, parkCommits, config, webAdmin, consolidationValve, costQuota, deviceLane, drainState, durableEnabled, elicitation, fenceSessionOwner, fileHistoryStore, fleetBus, fleetLease, fleetUsage, governanceSeams, handslessRunner, hookAgent, hookLlm, hookWakeBus, imageBakes, imageIndex, instanceId, instrumentDegenerate, leaderEndpoint, localRoot, logger, lspManager, mcpRevocations, memoryBundleFaces, memoryComplianceFaces, memoryConsolidationFaces, memoryEngine, memoryExportBackend, memoryOptOutGrantStore, memoryOriginFaces, memoryPosture, memorySyncCursors, memorySyncRunner, metrics, modelUsageTracker, orgMemoryAdmission, otelExporter, outcomeSink, ownerAware, parkedReviveInheritedGate, parkedReviveSurface, perSessionCwd, perTaskImage, planCacheProbe, pricing, principalCaps, promptManifestTracker, purgeSession, question, rateLimiter, reaper, webAdminJwtVerifier, resumeAnchorStore, retentionLaneStarted, retentionLaneStore, ruleConsent, runStore, runner, runnerDeps, runtimeCapsPeekResolver, scenarioDetails, scenarios, selectEnvTool, sendFileLedger, sendUserFileEmitter, sendUserFileToolSpec, sessionAudit, sessionEnvSelection, sessionMemoryStatusFace, sessionPolicyStore, sessionTitler, sessionWatchRegistry, setSessionCwd, setSessionInheritEnv, setSessionShellEnv, sharedMemoryStore, sideQueryAccounting, sqlEngine, sqlWorkflowRunStore, staticWiring, storePosture, subRunner, subagentSteerRegistry, taskAttachmentStore, taskLimitCaps, taskTimeoutSec, toolApproval, toolResultStore, usageWindowStore, userInputLedger, webSearchProvider, workflowAgentRegistry, workflowAgentSessionIndex, workflowParkDecisions, workflowCompletionInbox, workflowJournalStore, workflowModelAllowlistSnapshot, workflowNotifyGate, workflowNotifyJournal, workflowRecoverOpts, workflowRunStore, workflowsCapable, orgDeliveryGate } = ctx;
|
|
33
33
|
const stores = {
|
|
34
34
|
runStore,
|
|
35
35
|
resumeAnchorStore: resumeAnchorStore ? resumeAnchorStore : undefined,
|
|
36
36
|
approvalExemptionStore: approvalExemptionStore ? approvalExemptionStore : undefined,
|
|
37
37
|
approvalNonceStore: approvalNonceStore ? approvalNonceStore : undefined,
|
|
38
38
|
checkpointStore,
|
|
39
|
+
checkpointCtxSealing,
|
|
39
40
|
sessionPolicyStore: sessionPolicyStore ? sessionPolicyStore : undefined,
|
|
40
41
|
ruleConsent,
|
|
41
42
|
fileHistoryStore: fileHistoryStore ? fileHistoryStore : undefined,
|
package/dist/boot/stores.d.ts
CHANGED
|
@@ -13,6 +13,14 @@ export interface OpenStoresCtx {
|
|
|
13
13
|
metrics: Metrics;
|
|
14
14
|
localRoot: string;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* durable 回决腿的规则位给 `approval_ask` 加了 `rule_command`/`rule_scope_root` 两列,而 `ensureAsk` 的 INSERT 与每一条读**无条件**引用它们 ⇒ 存量表上整条流内审批协议
|
|
18
|
+
* 静默塌掉(卡不落库、重放面恒空、迟到决议恒 404),而 `/v1/capabilities` 仍报 streamApproval active。判据与恢复动作见 `assertApprovalAskRuleMaterialSchema` 的头注。
|
|
19
|
+
*
|
|
20
|
+
* 🔴 **只在协议真会上场时探**(与卡编辑面那道探针同一条纪律),调用方只在 `streamApprovalGate.active` 为真时调本函数 —— 谓词是**协调器装配点那一次求值**的结果(`resolveStreamApprovalGate`),
|
|
21
|
+
* 不在这里手抄一份,也不在别处再求一遍(手抄的判据会漂,漂的方向要么是拒启误伤、要么是该拒不拒;再求一遍的 park 设施位手上没有那只店)。本函数只做探:有 SQL 池就探,local 后端无池则无事。
|
|
22
|
+
*/
|
|
23
|
+
export declare function assertApprovalAskRuleMaterialOnBackend(backend: StoreBackend | undefined): Promise<void>;
|
|
16
24
|
export declare function openStores(ctx: OpenStoresCtx): Promise<{
|
|
17
25
|
backend: StoreBackend | undefined;
|
|
18
26
|
storePosture: import("../store-posture.js").StorePosture;
|
package/dist/boot/stores.js
CHANGED
|
@@ -34,9 +34,9 @@ import { assertApprovalAskRuleMaterialSchema } from "../plugins/approval-ask-sto
|
|
|
34
34
|
import { assertSchemaMatchesCode } from "../plugins/schema-consistency.js";
|
|
35
35
|
import { assertCheckpointColumnSchema } from "../plugins/checkpoint-store-sql.js";
|
|
36
36
|
import { assertFileHistorySchema } from "../plugins/file-history-store-sql.js";
|
|
37
|
-
import { resolveStreamApprovalGate } from "../tool-approval.js";
|
|
38
37
|
import { buildMemoryBoundaryLaneFacts, buildMemoryWriteBoundaryAudit, effectiveMemoryPersistenceCapable } from "./memory-boundary.js";
|
|
39
38
|
import { buildMemoryPosture } from "../memory-posture.js";
|
|
39
|
+
import { headReadOf } from "../session-incarnation.js";
|
|
40
40
|
import { establishSqlEnginePosture, sqlPoolsOf } from "../sql-engine-posture.js";
|
|
41
41
|
import { buildStorePosture } from "../store-posture.js";
|
|
42
42
|
import { buildDisplaySafeUrl } from "../trace/redact.js";
|
|
@@ -45,6 +45,14 @@ const DARK_REASON_PROSE = {
|
|
|
45
45
|
multi_tenant_file_backend: () => "multi-tenant on the FILE backend (no tenant isolation; set MEMORY_ENGINE_BACKEND=pg|tidb to light up)",
|
|
46
46
|
remote_lane_split: (lane) => `remote exec lane "${lane}" (worker/sandbox file planes split; MEMORY_ENGINE_REMOTE_LANE=allow overrides)`,
|
|
47
47
|
};
|
|
48
|
+
export async function assertApprovalAskRuleMaterialOnBackend(backend) {
|
|
49
|
+
const mysqlPool = backend?.mysqlPool?.();
|
|
50
|
+
const pgPool = backend?.pgPool?.();
|
|
51
|
+
if (pgPool)
|
|
52
|
+
await assertApprovalAskRuleMaterialSchema(async (sql) => ({ rows: (await pgPool.query(sql)).rows }), "pg");
|
|
53
|
+
else if (mysqlPool)
|
|
54
|
+
await assertApprovalAskRuleMaterialSchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "tidb");
|
|
55
|
+
}
|
|
48
56
|
export async function openStores(ctx) {
|
|
49
57
|
const { config, logger, metrics, localRoot } = ctx;
|
|
50
58
|
let backend;
|
|
@@ -83,17 +91,6 @@ export async function openStores(ctx) {
|
|
|
83
91
|
else if (mysqlPool)
|
|
84
92
|
await assertPermissionRuleTicketSchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "tidb");
|
|
85
93
|
}
|
|
86
|
-
if (resolveStreamApprovalGate({
|
|
87
|
-
toolApprovalEnabled: config.toolApprovalEnabled === true,
|
|
88
|
-
streamApprovalEnabled: config.streamApproval.enabled,
|
|
89
|
-
backend,
|
|
90
|
-
parkFacility: backend?.checkpoint !== undefined && config.durableApproval === true,
|
|
91
|
-
}).active) {
|
|
92
|
-
if (pgPool)
|
|
93
|
-
await assertApprovalAskRuleMaterialSchema(async (sql) => ({ rows: (await pgPool.query(sql)).rows }), "pg");
|
|
94
|
-
else if (mysqlPool)
|
|
95
|
-
await assertApprovalAskRuleMaterialSchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "tidb");
|
|
96
|
-
}
|
|
97
94
|
if (pgPool)
|
|
98
95
|
await assertFileHistorySchema(async (sql) => ({ rows: (await pgPool.query(sql)).rows }), "pg");
|
|
99
96
|
else if (mysqlPool)
|
|
@@ -427,7 +424,7 @@ export async function openStores(ctx) {
|
|
|
427
424
|
}
|
|
428
425
|
if (backend)
|
|
429
426
|
assertCloudSnapshotBlobPosture(backend.kind, config);
|
|
430
|
-
if (!config.requirePrincipal && sessionStore
|
|
427
|
+
if (!config.requirePrincipal && headReadOf(sessionStore) !== undefined) {
|
|
431
428
|
logger.warn("principal_optional", {
|
|
432
429
|
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",
|
|
433
430
|
});
|
package/dist/boot/web-admin.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { type ModelKeyRef } from "../key-resolver.js";
|
|
|
10
10
|
import type { Logger } from "../observability/logger.js";
|
|
11
11
|
import type { Metrics } from "../observability/metrics.js";
|
|
12
12
|
import { type SealedKeyPublicFace } from "../sealed-key.js";
|
|
13
|
+
import type { CheckpointCtxSealing } from "../http/checkpoint-ctx.js";
|
|
13
14
|
import type { UnpricedCeilingVerdict } from "./unpriced-ceiling-verdict.js";
|
|
14
15
|
import type { ConsolidationSeatWatch } from "./memory-consolidation.js";
|
|
15
16
|
import type { DegradeRouteWatch } from "../brain.js";
|
|
@@ -34,17 +35,22 @@ export interface CenterScenarioOverlayTargets {
|
|
|
34
35
|
/** overlay 前捕获的六内建名(centerScenarioDetails 的 shadow 判据)。 */
|
|
35
36
|
builtinScenarioNames: string[];
|
|
36
37
|
}
|
|
37
|
-
/**
|
|
38
|
+
/** [ref] / [ref] / [ref]:web-admin 持有的三样自报状态(fleet 心跳读它们)—— 闭集:加一样 = 写口与订阅方一起表态。 */
|
|
38
39
|
export type SelfReportChange = "roster_landed" | "restart_signal" | "model_refusals";
|
|
39
40
|
/** 跨段可变状态的**唯一**对外读口 + 三个原位动作。字段语义见各方法上的注释。 */
|
|
40
41
|
export interface WebAdminRuntime {
|
|
41
42
|
/** 配置源形态;`undefined` = 纯 env 部署(本运行时的所有分支不存在)。 */
|
|
42
43
|
readonly providerKind: "remote" | "local" | undefined;
|
|
43
|
-
/**
|
|
44
|
+
/** [ref]:本进程模型钥匙保管店的**公钥面**(只有最新那把公钥;私钥 / 持有 id 列表 / 开箱口结构上够不着,见
|
|
44
45
|
* `sealed-key.ts` `SealedKeyPublicFace`)。present-iff boot 期建店成功 —— 建店与配置源形态无关(纯 env / 本地 / 远程
|
|
45
46
|
* 三形都建),失败 ⇒ `undefined`(`sealed_key_store_unavailable` 那一行已响亮告警)。店只在 boot 建一次、进程内不换钥匙,
|
|
46
47
|
* 所以这是一个值,不是 getter。唯一读者 = `GET /v1/capabilities` 的 `sealedKey` 段(stage-10 经 deps 交过去)。 */
|
|
47
48
|
readonly sealedKeyPublic: SealedKeyPublicFace | undefined;
|
|
49
|
+
/** [ref]:**停驻行凭据封签器**(`sealed-key.ts` `ensureCheckpointCtxSealing`:这一域自己的保管店 `<数据根>/sealed-key/checkpoint-ctx-keys/` —— 一个域一对钥匙,
|
|
50
|
+
* 与模型钥匙那只店不共用;封 = 最新公钥;开 = 按封签上的 id 精确选私钥、只认绑着本行会话的停驻行信封)。present-iff 这一域建店并自检成功(与模型钥匙店各自成败)。
|
|
51
|
+
* 读者:HTTP 面(`ServiceDeps.checkpointCtxSealing`,stage-10)、leader worker 的续跑上下文(stage-09)与一次性迁移 M28(stage-06);起服第 6 段对
|
|
52
|
+
* 「checkpoint 店在、它不在」拒启。私钥、保管目录、持有 id 列表照旧够不着([ref] 的结构性那一半不变)。 */
|
|
53
|
+
readonly checkpointCtxSealing: CheckpointCtxSealing | undefined;
|
|
48
54
|
/** core `CenterPromptSource`(RunnerDeps / subRunner 必须同实例)。 */
|
|
49
55
|
readonly promptSource: CenterPromptSource;
|
|
50
56
|
/** center skills overlay → plugins 消费 → boot LKG 落盘/skill-stale 判定 → mcp 解析。返回新的 skills 表。 */
|
|
@@ -57,18 +63,18 @@ export interface WebAdminRuntime {
|
|
|
57
63
|
* `limitSync`([ref] 批1)= 恒构造的两只限额座的换代口:commit 之后**零 await 内**推一把,与 pricing /
|
|
58
64
|
* keyResolver 那两件派生重建同族(缺席 = 这条腿本部署没装配,例如 run-local)。
|
|
59
65
|
* `swapRunnerDeps`(core 7.10.0 `Runner.swapDeps` 一扇门)= **可换席**的换装口,**必填**:模型面 plane
|
|
60
|
-
* 变更候选在 commit 前喂给全部 boot Runner 原子换代;
|
|
61
|
-
* 拍里的 `applyLiveReadFace`)。
|
|
66
|
+
* 变更候选在 commit 前喂给全部 boot Runner 原子换代;[ref] 起 read **face** 席也走同一只函数(见 refresh
|
|
67
|
+
* 拍里的 `applyLiveReadFace`)。[ref] 波 0 起必填 —— 它缺席的那一形(模型面整面 defer 到重启 + `models-tiers`
|
|
62
68
|
* 重启片)在生产上从来到不了(stage-08 唯一调用点恒传),随片一起退役;要刷新环就要有 Runner 可换。
|
|
63
|
-
* `ceilingVerdict`(
|
|
69
|
+
* `ceilingVerdict`([ref])= 「配了 $ 天花板但目录未定价」这条判决的活载体,与 `limitSync` **同族同序**
|
|
64
70
|
* (commit 之后、零 await 内重判一次;判决不翻转就静默)。缺席 = 这条腿本部署没装配(run-local 一次性
|
|
65
71
|
* CLI 之后不再有刷新拍,它继续用纯判据判一次)。
|
|
66
|
-
* `consolidationSeat`(
|
|
72
|
+
* `consolidationSeat`([ref] 波 0,过渡)= 整理驱动席的两侧读数口,喂 `memory-consolidation` 重启片;
|
|
67
73
|
* 缺席 = 阀门关着(没有 boot 烤死的席)。
|
|
68
|
-
* `degradeRoute`(
|
|
74
|
+
* `degradeRoute`([ref],**必填**)= 反应式降级壳的两侧读数口(brain.ts `createBrainAssembly` 的产物 `degradeRoute`,`baked` 在焊壳处
|
|
69
75
|
* 算好随装配交出),喂 `degrade-route` 重启片。必填而不是可选:车道没开 / 没焊壳由席自己答「两侧同为 null」,缺席没有合法含义 ——
|
|
70
76
|
* 可选就是一条「接线漏了 ⇒ 片永远不签」的静默路([ref])。
|
|
71
|
-
* `checkpointStorePresent`(
|
|
77
|
+
* `checkpointStorePresent`([ref] 波 2,**必填**)= 部署事实「本进程建没建出 checkpoint 店」(stage-06 的产物,
|
|
72
78
|
* 不在 ServiceConfig 里)。审批名单转热之后,热腿要用它判 ④「门意图不可服务」(与 boot 拒启同一只判据);
|
|
73
79
|
* 必填 = 刷新环不可能在不知道这件事的情况下热应用审批名单。 */
|
|
74
80
|
startRefreshLoop(a: {
|
|
@@ -80,11 +86,11 @@ export interface WebAdminRuntime {
|
|
|
80
86
|
degradeRoute: DegradeRouteWatch;
|
|
81
87
|
checkpointStorePresent: boolean;
|
|
82
88
|
}): void;
|
|
83
|
-
/** [ref]-2:停刷新环(hardShutdown 收尾链;幂等,未起环时 no-op)。
|
|
89
|
+
/** [ref]-2:停刷新环(hardShutdown 收尾链;幂等,未起环时 no-op)。[ref]:中心凭证续签器的定时器同停(同一条收尾链)。 */
|
|
84
90
|
stopRefreshLoop(): void;
|
|
85
|
-
/**
|
|
91
|
+
/** [ref]:`/health.centerCredential` 的取值口 —— 凭证来源的健康态 + 续签器状态;都健康 / 没有中心 ⇒ `undefined`(键缺席)。 */
|
|
86
92
|
centerCredentialState(): CenterCredentialHealthView | undefined;
|
|
87
|
-
/**
|
|
93
|
+
/** [ref]:`/health.centerIdentityNotice` 的取值口 —— 中心凭证换人后的**最近一条**通告(`center_identity_demoted` 已降到无中心配置档 / `center_identity_landed`
|
|
88
94
|
* 新身份的配置已换上;码、冻结句与状态机见 `center-config-tier.ts`)。从未换过人 / 没有中心 ⇒ `undefined`(键缺席)。值形就是 wire 形 `{ code, message, at }`。 */
|
|
89
95
|
centerIdentityNoticeState(): CenterIdentityNotice | undefined;
|
|
90
96
|
/** [ref](core 5.50 [ref]):mid-turn MCP 撤销台账读口,喂 `RunnerDeps.mcpRevocations` 席。
|
|
@@ -102,7 +108,7 @@ export interface WebAdminRuntime {
|
|
|
102
108
|
/** boot ready 门:布防(`CONFIG_REQUIRE_ROSTER=true`,远程 registry 非 dryRun)且 roster 未落地 =
|
|
103
109
|
* 计费提交 503 + /health ready:false。缺省未布防 ⇒ 恒 true。 */
|
|
104
110
|
modelReady(): boolean;
|
|
105
|
-
/**
|
|
111
|
+
/** [ref] / [ref]:本副本**自报状态**里由 web-admin 持有的那两样 —— roster 落地(`modelReady` 翻真,one-way latch)与
|
|
106
112
|
* restart 信号(`restartState()` 出现 / 消失 / 变)—— 任一翻转的那一拍通知订阅者。装配层接 fleet 心跳的 `announceNow`,
|
|
107
113
|
* 让中心在翻转当刻就知道本副本可路由 / 要重启(不等下一拍心跳;draining 那一样由收尾链直调 `announceNow`,同一个触发)。
|
|
108
114
|
* 在状态**写定之后**调用,同步、逐个,入参 = 这一次翻的是哪一样(闭集 {@link SelfReportChange});不回放(订阅方在订阅前已读过
|
|
@@ -115,18 +121,18 @@ export interface WebAdminRuntime {
|
|
|
115
121
|
* 同一只谓词)∧ 应用着的那一代 ≠ 最后确认耐久接力的那一代(接力账;合成律 `buildConfigHandoff`)。非耐久部署 / 本地腿 / 没有配置管道 ⇒ 缺席。
|
|
116
122
|
* 两个事实两张脸:「要重启但扣着」归 `restart.withheld`,「声明了耐久接力而这一代没确认」归本键。 */
|
|
117
123
|
configHandoffState(): ConfigHandoff | undefined;
|
|
118
|
-
/**
|
|
124
|
+
/** [ref]:`/health.modelRefusals` 与 fleet 心跳 `modelRefusals` 的**同一只**取值口(settings-schema 6.2.0 `ModelRefusalsSignal` 形:
|
|
119
125
|
* 名 → 码 + 组拒码)。描述**最近一次被判的那份中心候选目录**(每次候选 apply 的报告 `ApplyReport.modelRefusals` 投影;组拒时就是被拒
|
|
120
126
|
* 的那份 —— 引擎自己的拒因表不换代)。没有可报的拒 / 没有配置管道 / 还没判过候选 ⇒ `undefined`(键缺席)。值变了 ⇒ 通知自报订阅者。 */
|
|
121
127
|
modelRefusalsState(): ModelRefusalsSignal | undefined;
|
|
122
|
-
/**
|
|
128
|
+
/** [ref]:`GET /v1/models.candidateRejected` 的取值口 —— 最近一次候选被判官整拒的结论(`candidateRejection` 座;域集就是判官交出的 `rejected.domains`)。
|
|
123
129
|
* present-iff 当前生效的配置是因判官整拒了最近一份候选而回落的那一份:后来的候选被判 clean 即撤下;还没判过候选 / 没有配置管道 ⇒ `undefined`(键缺席)。
|
|
124
130
|
* dry-run 姿势(`webAdmin.dryRun`,compare-only)恒 `undefined`:候选从不被应用,生效配置恒是 env,拒判是预演读数(日志行照响),不是配置没换的原因。 */
|
|
125
131
|
candidateRejectionState(): CandidateRejection | undefined;
|
|
126
132
|
/** [ref] 世代账:/health 的 target/applied/失败持续时长三键 + 诊断端点的 configApply 段(同一份读数)。
|
|
127
133
|
* `undefined` = 本部署没有配置管道(纯 env worker)⇒ 两个读面的形状**逐字不变**(additive 纪律)。 */
|
|
128
134
|
configApplyState(): ConfigApplyLedgerView | undefined;
|
|
129
|
-
/**
|
|
135
|
+
/** [ref] ②:caps `centerWiring.effectivePull` / `effectiveRevision` 的取值口 —— `lastPull`(新状态,只此一枚:boot 实拉 / 迟到 boot 到货 /
|
|
130
136
|
* refresh 拍收尾写)+ 与 `configApplyState()` **同一只** ledger 视图的已应用修订号。形与词表见 `web-admin-client/pull-state.ts`。 */
|
|
131
137
|
centerPullState(): CenterPullView;
|
|
132
138
|
/** DESIGN-278 §5 S2([ref]):center **当前在管**的 ServiceConfig 键集 —— `GET /v1/config/catalog` 判
|