@sema-agent/server 7.132.0 → 7.134.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 +353 -0
- package/README.md +8 -9
- package/README.zh-CN.md +7 -6
- package/USAGE.md +301 -64
- package/deploy/sema-up/README.md +35 -1
- 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 +19 -2
- package/deploy/sema-up/chart/templates/server.yaml +19 -2
- package/deploy/sema-up/chart/values-full-single.yaml +5 -1
- package/deploy/sema-up/chart/values.yaml +34 -0
- package/deploy/sema-up/stack/compose.yaml +3 -0
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +4 -2
- package/dist/adoption/plan.d.ts +3 -2
- package/dist/adoption/plan.js +7 -5
- package/dist/adoption/runner.js +3 -10
- package/dist/adoption/sql.d.ts +3 -2
- package/dist/adoption/sql.js +3 -5
- package/dist/adoption/wire.d.ts +4 -1
- package/dist/adoption/wire.js +1 -0
- package/dist/approval-ask-audit-store.d.ts +32 -14
- package/dist/approval-ask-audit-store.js +272 -74
- package/dist/approval-ask-machine.d.ts +15 -0
- package/dist/approval-ask-machine.js +6 -0
- package/dist/approval-ask-retention.d.ts +136 -0
- package/dist/approval-ask-retention.js +102 -0
- package/dist/approval-card.d.ts +83 -23
- package/dist/approval-card.js +45 -15
- package/dist/approval-content-kind.d.ts +5 -2
- package/dist/approval-content-kind.js +16 -3
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-gate-currency.d.ts +72 -0
- package/dist/approval-gate-currency.js +94 -0
- package/dist/approval.d.ts +15 -0
- package/dist/approval.js +55 -17
- package/dist/audit.d.ts +27 -10
- package/dist/audit.js +12 -16
- package/dist/bake-runner/main.js +3 -2
- package/dist/boot/coordinators.d.ts +6 -1
- package/dist/boot/coordinators.js +6 -3
- package/dist/boot/deferred-sandbox-path-env.js +1 -1
- package/dist/boot/execution-env.js +9 -7
- package/dist/boot/execution-lane.js +11 -0
- package/dist/boot/leader.d.ts +2 -0
- package/dist/boot/leader.js +4 -1
- package/dist/boot/memory-boundary.js +2 -2
- package/dist/boot/memory-consolidation.d.ts +5 -4
- package/dist/boot/memory-consolidation.js +7 -6
- package/dist/boot/org-delivery.d.ts +28 -0
- package/dist/boot/org-delivery.js +20 -0
- package/dist/boot/read-deny-anchor-audit.js +2 -2
- package/dist/boot/reapers.d.ts +3 -0
- package/dist/boot/reapers.js +21 -1
- package/dist/boot/resolve-spec.d.ts +3 -0
- package/dist/boot/resolve-spec.js +60 -81
- package/dist/boot/runner-deps.d.ts +18 -5
- package/dist/boot/runner-deps.js +10 -0
- package/dist/boot/session-faces.d.ts +1 -0
- package/dist/boot/session-faces.js +4 -2
- package/dist/boot/stage-02-web-admin-pull.js +4 -1
- package/dist/boot/stage-06-runners.d.ts +6 -3
- package/dist/boot/stage-06-runners.js +20 -4
- package/dist/boot/stage-07-capability-layer.d.ts +4 -1
- package/dist/boot/stage-07-capability-layer.js +24 -3
- package/dist/boot/stage-08-reapers.d.ts +4 -1
- package/dist/boot/stage-08-reapers.js +2 -2
- package/dist/boot/stage-09-leader.d.ts +5 -1
- package/dist/boot/stage-09-leader.js +2 -2
- package/dist/boot/stage-10-http-server.d.ts +5 -1
- package/dist/boot/stage-10-http-server.js +6 -6
- package/dist/boot/stores.d.ts +8 -0
- package/dist/boot/stores.js +10 -14
- package/dist/boot/web-admin.d.ts +10 -0
- package/dist/boot/web-admin.js +162 -65
- package/dist/boot/workflow-orchestration.d.ts +2 -0
- package/dist/boot/workflow-orchestration.js +2 -1
- package/dist/brain.js +8 -3
- package/dist/breaker-key.d.ts +6 -0
- package/dist/breaker-key.js +29 -0
- package/dist/budget.js +5 -1
- package/dist/caller-text-echo.d.ts +11 -6
- package/dist/caller-text-echo.js +10 -12
- package/dist/canonical-json.d.ts +2 -41
- package/dist/canonical-json.js +2 -13
- package/dist/capabilities/center-plugins.d.ts +7 -0
- package/dist/capabilities/center-plugins.js +1 -1
- package/dist/capabilities/composite-members.d.ts +1 -1
- package/dist/capabilities/composite-members.js +1 -1
- package/dist/capabilities/execution-lane.js +2 -2
- package/dist/capabilities/hands-lane.d.ts +21 -0
- package/dist/capabilities/hands-lane.js +10 -0
- package/dist/capabilities/mcp-probe.d.ts +36 -4
- package/dist/capabilities/mcp-probe.js +29 -6
- package/dist/capabilities/scenarios.d.ts +63 -7
- package/dist/capabilities/scenarios.js +39 -7
- package/dist/capability-facts.d.ts +36 -4
- package/dist/capability-facts.js +30 -4
- package/dist/center-config-tier.d.ts +69 -0
- package/dist/center-config-tier.js +42 -0
- 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 +16 -0
- package/dist/checkpoint-identity.js +19 -0
- package/dist/config-catalog.d.ts +17 -10
- package/dist/config-catalog.js +43 -28
- package/dist/config-d-migration.d.ts +3 -1
- package/dist/config-d-migration.js +2 -2
- package/dist/config-dir-trust.d.ts +114 -0
- package/dist/config-dir-trust.js +388 -0
- package/dist/config-invariants.d.ts +18 -5
- package/dist/config-invariants.js +35 -3
- package/dist/config-provider.d.ts +6 -1
- package/dist/config-provider.js +6 -2
- package/dist/config-types.d.ts +71 -14
- package/dist/config-types.js +8 -0
- package/dist/config.d.ts +13 -0
- package/dist/config.js +121 -59
- package/dist/delegated-session-owner.d.ts +185 -0
- package/dist/delegated-session-owner.js +119 -0
- package/dist/device-protocol.d.ts +5 -3
- package/dist/device-protocol.js +1 -1
- package/dist/device-ws-hub.js +21 -2
- package/dist/device-ws-protocol.d.ts +70 -6
- package/dist/device-ws-protocol.js +50 -23
- package/dist/elicitation.js +3 -2
- package/dist/entry-problems.d.ts +34 -0
- package/dist/entry-problems.js +14 -0
- package/dist/execution-lane-caps.d.ts +49 -10
- package/dist/execution-lane-caps.js +43 -4
- package/dist/field-conflict.d.ts +44 -0
- package/dist/field-conflict.js +21 -0
- package/dist/file-history-disclosure.d.ts +34 -5
- package/dist/file-history-disclosure.js +2 -2
- package/dist/fleet/fleet-bus.d.ts +84 -6
- package/dist/fleet/fleet-bus.js +42 -9
- package/dist/hooks/classic-stations.d.ts +10 -5
- package/dist/hooks/classic-stations.js +4 -4
- package/dist/hooks/command-spawn.d.ts +57 -0
- package/dist/hooks/command-spawn.js +139 -0
- package/dist/hooks/hook-llm.js +2 -2
- package/dist/hooks/hook-runner.d.ts +127 -25
- package/dist/hooks/hook-runner.js +668 -287
- package/dist/hooks/hook-source.d.ts +44 -0
- package/dist/hooks/hook-source.js +40 -0
- package/dist/http/active-run-conflict.d.ts +5 -13
- package/dist/http/active-run-conflict.js +17 -27
- package/dist/http/admission.js +111 -60
- package/dist/http/approval-sweeps.js +58 -19
- package/dist/http/caller-trust.d.ts +77 -0
- package/dist/http/caller-trust.js +143 -0
- package/dist/http/checkpoint-ctx.d.ts +173 -18
- package/dist/http/checkpoint-ctx.js +171 -12
- package/dist/http/claimed-run.d.ts +4 -3
- package/dist/http/device-placement.d.ts +2 -4
- package/dist/http/device-placement.js +2 -1
- package/dist/http/dispatch.js +13 -7
- package/dist/http/durable-run-leg.d.ts +4 -32
- package/dist/http/durable-run-leg.js +37 -12
- package/dist/http/idempotency.d.ts +2 -2
- package/dist/http/idempotency.js +2 -2
- package/dist/http/owner-access.d.ts +56 -0
- package/dist/http/owner-access.js +42 -0
- package/dist/http/principal-gate.d.ts +78 -27
- package/dist/http/principal-gate.js +64 -14
- package/dist/http/readiness.d.ts +11 -5
- package/dist/http/readiness.js +10 -3
- package/dist/http/refusal-body.d.ts +12 -0
- package/dist/http/refusal-body.js +11 -0
- package/dist/http/request-guards.d.ts +16 -32
- package/dist/http/request-guards.js +31 -30
- package/dist/http/resume-ctx-read.d.ts +50 -6
- package/dist/http/resume-ctx-read.js +33 -7
- package/dist/http/resume-legs.d.ts +5 -5
- package/dist/http/resume-legs.js +163 -91
- package/dist/http/retired-service-deps.d.ts +43 -0
- package/dist/http/retired-service-deps.js +18 -0
- package/dist/http/route-ctx.d.ts +44 -37
- package/dist/http/route-ctx.js +4 -0
- package/dist/http/route-table.js +2 -0
- package/dist/http/routes/a2a-serve.js +3 -4
- package/dist/http/routes/admin-config-refresh.js +1 -1
- package/dist/http/routes/admin-drain.js +1 -1
- package/dist/http/routes/admin-memory-optout.js +5 -1
- package/dist/http/routes/adoption.js +2 -9
- package/dist/http/routes/agents-roster.js +2 -3
- package/dist/http/routes/approvals-assistant.js +91 -56
- package/dist/http/routes/background.js +3 -2
- package/dist/http/routes/capabilities.js +20 -4
- package/dist/http/routes/config-catalog.d.ts +3 -3
- package/dist/http/routes/config-catalog.js +1 -1
- package/dist/http/routes/devices.js +3 -17
- package/dist/http/routes/diagnostics.d.ts +3 -3
- package/dist/http/routes/diagnostics.js +6 -2
- package/dist/http/routes/fleet.js +4 -4
- package/dist/http/routes/images.js +6 -7
- package/dist/http/routes/leader.js +1 -8
- package/dist/http/routes/mcp-reconnect.d.ts +1 -1
- package/dist/http/routes/mcp-reconnect.js +3 -2
- package/dist/http/routes/memory-bundle.js +1 -1
- package/dist/http/routes/memory-compliance.js +1 -1
- package/dist/http/routes/memory-consolidation.js +1 -1
- package/dist/http/routes/memory-origin.d.ts +1 -1
- package/dist/http/routes/memory-origin.js +1 -1
- package/dist/http/routes/memory-policy.d.ts +1 -1
- package/dist/http/routes/memory-policy.js +3 -2
- package/dist/http/routes/notify-wake.js +8 -21
- package/dist/http/routes/observability.js +2 -2
- package/dist/http/routes/principal-inbox.d.ts +39 -0
- package/dist/http/routes/principal-inbox.js +76 -0
- package/dist/http/routes/retention-ops.js +2 -9
- package/dist/http/routes/rules.js +9 -22
- package/dist/http/routes/runs.d.ts +5 -0
- package/dist/http/routes/runs.js +63 -115
- package/dist/http/routes/session-sync.d.ts +3 -2
- package/dist/http/routes/session-sync.js +53 -48
- package/dist/http/routes/sessions-list.d.ts +1 -1
- package/dist/http/routes/sessions-list.js +3 -4
- package/dist/http/routes/sessions.js +33 -43
- package/dist/http/routes/side-query.js +6 -4
- package/dist/http/routes/tasks.js +71 -30
- package/dist/http/routes/trace-usage.js +7 -9
- package/dist/http/routes/workflows.d.ts +351 -0
- package/dist/http/routes/workflows.js +153 -119
- package/dist/http/run-declared-families.d.ts +16 -0
- package/dist/http/run-declared-families.js +12 -0
- package/dist/http/send.d.ts +24 -3
- package/dist/http/send.js +14 -2
- package/dist/http/server.d.ts +23 -18
- package/dist/http/server.js +20 -15
- package/dist/http/stored-body-replay.js +17 -4
- package/dist/http/submit-ctx.d.ts +4 -3
- package/dist/http/submit-ctx.js +23 -6
- package/dist/http/submit-replay.d.ts +4 -3
- package/dist/http/submit-replay.js +5 -4
- package/dist/http/wire-types.d.ts +17 -10
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/lane-home-probe.d.ts +78 -9
- package/dist/lane-home-probe.js +78 -12
- package/dist/leader/endpoint.d.ts +4 -1
- package/dist/leader/endpoint.js +11 -10
- package/dist/leader/wire.d.ts +4 -0
- package/dist/leader/wire.js +8 -7
- package/dist/limit-refusal.d.ts +17 -5
- package/dist/limit-refusal.js +4 -1
- package/dist/main.js +1 -1
- package/dist/mcp-assertion-header.d.ts +31 -10
- package/dist/mcp-assertion-header.js +10 -3
- package/dist/memory-origin-fence.js +2 -2
- package/dist/memory-project-layer.d.ts +37 -0
- package/dist/memory-project-layer.js +46 -0
- package/dist/memory-scope.d.ts +23 -16
- package/dist/memory-scope.js +24 -8
- package/dist/memory-sync-client.d.ts +27 -13
- package/dist/memory-sync-client.js +107 -18
- package/dist/model-compat.d.ts +1 -1
- package/dist/model-entry-refusal.d.ts +9 -1
- package/dist/model-entry-refusal.js +6 -1
- package/dist/model-plane-face.d.ts +51 -0
- package/dist/model-plane-face.js +24 -0
- package/dist/model-provider.d.ts +5 -0
- package/dist/model-provider.js +4 -2
- package/dist/model-route-endpoint.d.ts +8 -11
- package/dist/model-route-endpoint.js +4 -7
- package/dist/model-route-env.d.ts +22 -0
- package/dist/model-route-env.js +2 -0
- package/dist/model-route-gap.d.ts +60 -30
- package/dist/model-route-gap.js +21 -15
- package/dist/observability/corrupt-read-seat.d.ts +7 -0
- package/dist/observability/corrupt-read-seat.js +9 -0
- package/dist/observability/err-text.d.ts +6 -0
- package/dist/observability/err-text.js +18 -4
- package/dist/observability/fail-open.d.ts +35 -9
- package/dist/observability/fail-open.js +35 -9
- package/dist/observability/metrics.js +1 -0
- package/dist/observability/prompt-manifest.d.ts +22 -25
- package/dist/observability/prompt-manifest.js +54 -50
- package/dist/observability/tool-trace.js +9 -10
- package/dist/operator-ask.d.ts +10 -0
- package/dist/operator-ask.js +3 -0
- package/dist/orchestration/workflow-agent-session-index.d.ts +12 -12
- package/dist/orchestration/workflow-agent-session-index.js +9 -13
- package/dist/orchestration/workflow-completion-inbox.d.ts +42 -15
- package/dist/orchestration/workflow-completion-inbox.js +13 -0
- package/dist/orchestration/workflow-notify-journal.d.ts +13 -32
- package/dist/orchestration/workflow-notify-journal.js +27 -34
- package/dist/orchestration/workflow-park-decision.d.ts +89 -0
- package/dist/orchestration/workflow-park-decision.js +119 -0
- package/dist/org-delivery-gate.d.ts +81 -0
- package/dist/org-delivery-gate.js +59 -0
- package/dist/panel-tool-names.d.ts +23 -0
- package/dist/panel-tool-names.js +8 -0
- package/dist/parked-decide.d.ts +43 -11
- package/dist/parked-decide.js +100 -51
- package/dist/parked-revive-surface.d.ts +9 -2
- package/dist/parked-revive-surface.js +11 -8
- package/dist/permission-rule-list.d.ts +1 -1
- package/dist/permission-rule-list.js +2 -2
- package/dist/permission-rule-vocab.d.ts +1 -23
- package/dist/permission-rule-vocab.js +0 -13
- package/dist/plugins/approval-ask-store-file.d.ts +16 -1
- package/dist/plugins/approval-ask-store-file.js +21 -0
- package/dist/plugins/approval-ask-store-memory.d.ts +18 -1
- package/dist/plugins/approval-ask-store-memory.js +34 -2
- package/dist/plugins/approval-ask-store-sql.d.ts +25 -0
- package/dist/plugins/approval-ask-store-sql.js +37 -1
- package/dist/plugins/approval-payload-fingerprint.d.ts +14 -6
- package/dist/plugins/approval-payload-fingerprint.js +1 -1
- package/dist/plugins/blob-backend.d.ts +38 -25
- package/dist/plugins/blob-backend.js +29 -19
- package/dist/plugins/breaker-state-sql.d.ts +2 -2
- package/dist/plugins/breaker-state-sql.js +4 -4
- package/dist/plugins/caching-session-store.d.ts +4 -1
- package/dist/plugins/caching-session-store.js +7 -3
- package/dist/plugins/checkpoint-store-sql.d.ts +36 -1
- package/dist/plugins/checkpoint-store-sql.js +65 -3
- package/dist/plugins/file-history-store-sql.d.ts +5 -2
- package/dist/plugins/file-history-store-sql.js +3 -1
- package/dist/plugins/file-run-store.d.ts +5 -13
- package/dist/plugins/file-run-store.js +9 -0
- package/dist/plugins/fork-routing-session-store.d.ts +9 -1
- package/dist/plugins/fork-routing-session-store.js +12 -1
- package/dist/plugins/host-platform.d.ts +2 -0
- package/dist/plugins/host-platform.js +2 -1
- package/dist/plugins/local-checkpoint-store.d.ts +15 -2
- package/dist/plugins/local-checkpoint-store.js +32 -1
- package/dist/plugins/local-session-store.d.ts +13 -10
- package/dist/plugins/local-session-store.js +23 -14
- package/dist/plugins/local-session-window.d.ts +45 -0
- package/dist/plugins/local-session-window.js +38 -0
- package/dist/plugins/mailbox-recipient-lifecycle.d.ts +3 -2
- package/dist/plugins/mailbox-store-sql.d.ts +30 -48
- package/dist/plugins/mailbox-store-sql.js +77 -52
- package/dist/plugins/memory-embedder-fingerprint.js +2 -1
- package/dist/plugins/memory-run-store.d.ts +5 -13
- package/dist/plugins/memory-run-store.js +8 -0
- package/dist/plugins/one-time-migrations.d.ts +121 -5
- package/dist/plugins/one-time-migrations.js +332 -8
- package/dist/plugins/org-delivery-quota-store.d.ts +123 -0
- package/dist/plugins/org-delivery-quota-store.js +228 -0
- package/dist/plugins/permission-rule-store-file.js +10 -6
- package/dist/plugins/permission-rule-store-sql.js +8 -8
- package/dist/plugins/pg-pool.js +39 -7
- package/dist/plugins/pg-session-storage.d.ts +18 -5
- package/dist/plugins/pg-session-storage.js +68 -23
- package/dist/plugins/remote-env-adb.d.ts +6 -12
- package/dist/plugins/remote-env-adb.js +12 -2
- package/dist/plugins/remote-env-device.d.ts +14 -7
- package/dist/plugins/remote-env-device.js +23 -15
- package/dist/plugins/remote-env-k8s.d.ts +8 -12
- package/dist/plugins/remote-env-k8s.js +23 -5
- package/dist/plugins/remote-env-local-docker.d.ts +10 -15
- package/dist/plugins/remote-env-local-docker.js +12 -9
- package/dist/plugins/remote-env-ssh.d.ts +10 -16
- package/dist/plugins/remote-env-ssh.js +17 -11
- package/dist/plugins/run-store-sql.d.ts +16 -14
- package/dist/plugins/run-store-sql.js +22 -2
- package/dist/plugins/schema-indexes.js +2 -0
- package/dist/plugins/send-user-file.js +2 -2
- package/dist/plugins/session-epoch-anchor.d.ts +32 -6
- package/dist/plugins/session-epoch-anchor.js +2 -3
- 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-store.d.ts +18 -8
- package/dist/plugins/session-store.js +15 -4
- package/dist/plugins/sql-driver.d.ts +74 -11
- package/dist/plugins/sql-driver.js +210 -12
- package/dist/plugins/sql-errors.d.ts +23 -0
- package/dist/plugins/sql-errors.js +21 -0
- package/dist/plugins/store-backend.d.ts +36 -1
- package/dist/plugins/store-backend.js +40 -14
- package/dist/plugins/store-contracts.d.ts +42 -0
- package/dist/plugins/store-contracts.js +1 -0
- package/dist/plugins/tidb-pool.d.ts +6 -1
- package/dist/plugins/tidb-pool.js +44 -10
- package/dist/plugins/tidb-session-storage.d.ts +3 -2
- package/dist/plugins/tidb-session-storage.js +2 -2
- package/dist/plugins/tidb-session-store.d.ts +25 -5
- package/dist/plugins/tidb-session-store.js +67 -21
- package/dist/plugins/workflow-journal-store-sql.d.ts +73 -19
- package/dist/plugins/workflow-journal-store-sql.js +19 -6
- package/dist/plugins/workflow-run-store-sql.d.ts +30 -8
- package/dist/plugins/workflow-run-store-sql.js +50 -9
- package/dist/posture-source.d.ts +18 -10
- package/dist/posture-source.js +4 -1
- package/dist/project-identity.d.ts +45 -6
- package/dist/project-identity.js +162 -8
- package/dist/project-layer-key.d.ts +28 -0
- package/dist/project-layer-key.js +29 -0
- package/dist/question.js +3 -2
- package/dist/read-deny-entry.d.ts +25 -0
- package/dist/read-deny-entry.js +12 -0
- package/dist/read-face-posture.d.ts +37 -11
- package/dist/read-face-posture.js +32 -3
- package/dist/request-key-closure.d.ts +7 -0
- package/dist/request-key-closure.js +9 -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 +5 -0
- package/dist/request-value-closure.js +11 -3
- package/dist/rule-entry-list.d.ts +26 -2
- package/dist/rule-entry-list.js +72 -12
- package/dist/rules-consent.js +3 -4
- package/dist/run-acceptance.d.ts +19 -3
- package/dist/run-acceptance.js +13 -1
- package/dist/run-local.js +37 -6
- package/dist/runs.d.ts +12 -10
- package/dist/runs.js +25 -6
- package/dist/runtime-caps-resolver.d.ts +16 -6
- package/dist/runtime-caps-resolver.js +18 -5
- package/dist/sandbox-pkg-source.d.ts +19 -1
- package/dist/sandbox-pkg-source.js +29 -7
- package/dist/sealed-key.d.ts +32 -0
- package/dist/sealed-key.js +55 -1
- package/dist/security.d.ts +95 -15
- package/dist/security.js +52 -9
- package/dist/session-error-wire.d.ts +31 -7
- package/dist/session-error-wire.js +9 -2
- package/dist/session-sync-kernel.d.ts +37 -10
- package/dist/session-sync-kernel.js +10 -0
- package/dist/session-titled-frame.d.ts +33 -0
- package/dist/session-titled-frame.js +4 -0
- package/dist/session-titler.d.ts +9 -1
- package/dist/session-titler.js +15 -4
- package/dist/spec-fields.js +21 -2
- package/dist/sql-engine-posture.d.ts +3 -1
- package/dist/task-a2a.js +4 -3
- package/dist/task-cwd.d.ts +1 -1
- package/dist/task-mcp.d.ts +5 -5
- package/dist/task-mcp.js +27 -74
- package/dist/task-settings.d.ts +93 -88
- package/dist/task-settings.js +71 -63
- package/dist/text-bidi.d.ts +0 -4
- package/dist/text-bidi.js +1 -3
- package/dist/tighten-only-seats.d.ts +150 -0
- package/dist/tighten-only-seats.js +196 -0
- package/dist/tool-approval.d.ts +451 -136
- package/dist/tool-approval.js +733 -256
- package/dist/tool-rule-names.d.ts +6 -0
- package/dist/trace/core-keyset-guard.d.ts +108 -25
- package/dist/trace/exit-seat.d.ts +40 -0
- package/dist/trace/exit-seat.js +130 -0
- package/dist/trace/ledger-events.d.ts +6 -3
- package/dist/trace/project.d.ts +98 -13
- package/dist/trace/project.js +57 -32
- package/dist/trace/projection-table.d.ts +100 -0
- package/dist/trace/projection-table.js +130 -0
- package/dist/trace/redact.d.ts +57 -0
- package/dist/trace/redact.js +962 -168
- package/dist/trace/self-minted-wire.d.ts +349 -1
- package/dist/trace/self-minted-wire.js +118 -1
- package/dist/trace/wire-projection-faces.d.ts +304 -2
- package/dist/trace/wire-projection-faces.js +160 -13
- package/dist/url-refusal.js +2 -0
- package/dist/web-admin-client/apply-effective.d.ts +12 -0
- package/dist/web-admin-client/apply-effective.js +56 -5
- package/dist/web-admin-client/facade.d.ts +1 -1
- package/dist/web-admin-client/facade.js +1 -1
- package/dist/web-admin-client/read-face.js +5 -9
- package/dist/web-admin-client/skills-mcp.d.ts +1 -1
- package/dist/web-admin-client/skills-mcp.js +6 -8
- package/dist/web-admin-client/types.d.ts +1 -1
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +57 -9
- package/package.json +8 -4
- package/scripts/drain-check-local.mjs +34 -2
- package/scripts/drain-check.mysql.sql +20 -2
- package/scripts/drain-check.pg.sql +20 -2
- package/dist/mcp-tool-faces.d.ts +0 -69
- package/dist/mcp-tool-faces.js +0 -106
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* `Runner.swapDeps` 换进,见 boot/stage-08-reapers.ts)。
|
|
10
10
|
* `getRunStore()` 是唯一的晚绑取值(runStore 在本段之后才构造),原文靠同作用域前向引用。
|
|
11
11
|
*/
|
|
12
|
-
import { type CacheBreakFinding, type RunnerDeps, type WorkflowRunStore, type AskOutcome } from "@sema-agent/core";
|
|
12
|
+
import { type CacheBreakFinding, type CrossBoundaryPosture, type RunnerDeps, type WorkflowRunStore, type AskOutcome } from "@sema-agent/core";
|
|
13
13
|
import type { createBrain } from "../brain.js";
|
|
14
14
|
import type { buildPricing, createTracer } from "../budget.js";
|
|
15
15
|
import type { ServiceConfig } from "../config.js";
|
|
@@ -241,7 +241,7 @@ export interface RunnerDepsCtx {
|
|
|
241
241
|
}
|
|
242
242
|
/** [ref] A10 留档发现②:main runner `RunnerDeps` 与 main.ts subRunner 字面量之间此前手工重复
|
|
243
243
|
* 的 ~15 个键,类型标注见 {@link createSharedRunnerDeps} 头注。 */
|
|
244
|
-
export type SharedRunnerDeps = Pick<RunnerDeps, "brain" | "readFace" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "memoryDelegationEvidence" | "memoryProvenance" | "memoryCapturePolicy" | "delegationEntryCaps" | "crossSessionInbound" | "crossSessionDialogExpiry" | "writeProtectedPaths" | "memoryEngineDir" | "allowedTools" | "models" | "roles" | "tiers" | "pricing" | "tracer" | "promptSource" | "executionEnvFactory" | "lspManager" | "backgroundAgentStore" | "mailboxStore" | "rosterStore" | "mods" | "toolResultStore" | "checkpointStore" | "hands" | "sessionPolicyStore" | "usageWindows" | "usageWindowStore" | "memoryScopeAdmission" | "deploymentMemoryScopes" | "sharedMemoryStores" | "compliancePostureResolver" | "lockedConfig" | "retentionPolicy" | "onNotice" | "mcpRevocations">;
|
|
244
|
+
export type SharedRunnerDeps = Pick<RunnerDeps, "brain" | "readFace" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "memoryDelegationEvidence" | "memoryProvenance" | "memoryCapturePolicy" | "delegationEntryCaps" | "crossSessionInbound" | "crossSessionDialogExpiry" | "writeProtectedPaths" | "memoryEngineDir" | "allowedTools" | "crossBoundaryPosture" | "models" | "roles" | "tiers" | "pricing" | "tracer" | "promptSource" | "executionEnvFactory" | "lspManager" | "backgroundAgentStore" | "mailboxStore" | "rosterStore" | "mods" | "toolResultStore" | "checkpointStore" | "hands" | "sessionPolicyStore" | "usageWindows" | "usageWindowStore" | "memoryScopeAdmission" | "deploymentMemoryScopes" | "sharedMemoryStores" | "compliancePostureResolver" | "lockedConfig" | "retentionPolicy" | "onNotice" | "mcpRevocations">;
|
|
245
245
|
/**
|
|
246
246
|
* [ref] A10 留档发现②(review 2026-07-29,[ref]§三族A 同源修补的延续):main runner 的
|
|
247
247
|
* `RunnerDeps` 字面量(下方 `createRunnerDeps`)与 `main.ts` 里 subRunner 的 `new Runner({...})`
|
|
@@ -316,10 +316,23 @@ export declare function createEngineNoticeSeat(logger: {
|
|
|
316
316
|
* 「键为 undefined」与「键缺席」对引擎逐字等价)。**不复制引擎缺省**(`roots`/`static-face`/`carry`/`open`/
|
|
317
317
|
* CC parity 20/200 一个都不抄):上游改缺省之日起本仓不会成为第二份真源。
|
|
318
318
|
*/
|
|
319
|
-
export type DeploymentPostureSeats = Pick<RunnerDeps, "readFace" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "memoryDelegationEvidence" | "memoryProvenance" | "memoryCapturePolicy" | "delegationEntryCaps" | "crossSessionInbound" | "crossSessionDialogExpiry" | "writeProtectedPaths" | "allowedTools" | "agentConfigDir">;
|
|
319
|
+
export type DeploymentPostureSeats = Pick<RunnerDeps, "readFace" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "memoryDelegationEvidence" | "memoryProvenance" | "memoryCapturePolicy" | "delegationEntryCaps" | "crossSessionInbound" | "crossSessionDialogExpiry" | "writeProtectedPaths" | "allowedTools" | "agentConfigDir" | "crossBoundaryPosture">;
|
|
320
320
|
/** 本族读的配置切面:席名与 config 键同名的那几席 + 运维 allow 表(席 `allowedTools` ← config `approvalGrant`,env 名 `APPROVAL_GRANT` 不改)
|
|
321
|
-
* + LKG 覆写路径(`readDenyPatterns` 席并入它派生的读拒行,`lkgReadDenyRows`)。 */
|
|
322
|
-
export type DeploymentPostureConfig = Pick<ServiceConfig, Exclude<keyof DeploymentPostureSeats, "allowedTools"> | "approvalGrant" | "configLkgPath">;
|
|
321
|
+
* + LKG 覆写路径(`readDenyPatterns` 席并入它派生的读拒行,`lkgReadDenyRows`)+ 主体门(席 `crossBoundaryPosture` ← config `requirePrincipal`)。 */
|
|
322
|
+
export type DeploymentPostureConfig = Pick<ServiceConfig, Exclude<keyof DeploymentPostureSeats, "allowedTools" | "crossBoundaryPosture"> | "approvalGrant" | "configLkgPath" | "requirePrincipal">;
|
|
323
|
+
/**
|
|
324
|
+
* 设备车道发射闸的**部署姿态**(core 7.54.0 [ref] O9b:`RunnerDeps.crossBoundaryPosture`)—— 由主体门派生,不是第二根旋钮:
|
|
325
|
+
* `REQUIRE_PRINCIPAL=true`(每个请求带一个经认证的主体 = 多个租户共用这台 worker)⇒ `"multi_tenant"`;否则 ⇒ `"single_user"`。
|
|
326
|
+
* 映射是一张以 core 闭集为键的表 {@link CROSS_BOUNDARY_POSTURE_REQUIRES_PRINCIPAL}(`satisfies Record<CrossBoundaryPosture, boolean>`):core 给姿态加第三个词 ⇒ 表缺键、编译红,
|
|
327
|
+
* 由人判它对应哪种部署 —— 不会被一个 `? :` 静默吞掉。
|
|
328
|
+
* 律:**每一台 worker 显式声明、同一舰队同值**(主体门本就是舰队级配置)—— 缺席时 core 对宿主父腿不启站,并在每条武装腿铸 operator 通告
|
|
329
|
+
* `config.cross_boundary_posture_undeclared`;本仓因此从不留空。取值点只有 {@link buildDeploymentPostureSeats} 一处。
|
|
330
|
+
*/
|
|
331
|
+
export declare const CROSS_BOUNDARY_POSTURE_REQUIRES_PRINCIPAL: {
|
|
332
|
+
readonly multi_tenant: true;
|
|
333
|
+
readonly single_user: false;
|
|
334
|
+
};
|
|
335
|
+
export declare function crossBoundaryPostureOf(requirePrincipal: boolean): CrossBoundaryPosture;
|
|
323
336
|
export declare function buildDeploymentPostureSeats(config: DeploymentPostureConfig): DeploymentPostureSeats;
|
|
324
337
|
/**
|
|
325
338
|
* 部署读拒行**进场**的唯一告知点(非锚定行一行 `read_deny_unanchored_rows`;判据与行形在 `read-deny-anchor-audit.ts`)。律:**一份读拒行的值第一次装进 Runner 席时点名一次** ——
|
package/dist/boot/runner-deps.js
CHANGED
|
@@ -58,6 +58,14 @@ export function createEngineNoticeSeat(logger, router = defaultEngineNoticeRoute
|
|
|
58
58
|
const warn = logger?.warn?.bind(logger);
|
|
59
59
|
return warn ? { onNotice: createEngineNoticeForwarder({ warn }, router) } : {};
|
|
60
60
|
}
|
|
61
|
+
export const CROSS_BOUNDARY_POSTURE_REQUIRES_PRINCIPAL = { multi_tenant: true, single_user: false };
|
|
62
|
+
export function crossBoundaryPostureOf(requirePrincipal) {
|
|
63
|
+
for (const w of Object.keys(CROSS_BOUNDARY_POSTURE_REQUIRES_PRINCIPAL)) {
|
|
64
|
+
if (CROSS_BOUNDARY_POSTURE_REQUIRES_PRINCIPAL[w] === requirePrincipal)
|
|
65
|
+
return w;
|
|
66
|
+
}
|
|
67
|
+
throw new Error(`cross-boundary posture table has no word for requirePrincipal=${requirePrincipal} (the table must map both values)`);
|
|
68
|
+
}
|
|
61
69
|
export function buildDeploymentPostureSeats(config) {
|
|
62
70
|
const crossSessionLayers = buildCrossSessionInboundLayers(config);
|
|
63
71
|
const lkgRows = lkgReadDenyRows(config.configLkgPath);
|
|
@@ -76,6 +84,7 @@ export function buildDeploymentPostureSeats(config) {
|
|
|
76
84
|
crossSessionDialogExpiry: crossSessionDialogExpiryOf(config),
|
|
77
85
|
writeProtectedPaths: config.writeProtectedPaths?.entries,
|
|
78
86
|
allowedTools: config.approvalGrant.length > 0 ? config.approvalGrant : undefined,
|
|
87
|
+
crossBoundaryPosture: crossBoundaryPostureOf(config.requirePrincipal),
|
|
79
88
|
};
|
|
80
89
|
return seats;
|
|
81
90
|
}
|
|
@@ -180,6 +189,7 @@ export function createRunnerDeps(ctx) {
|
|
|
180
189
|
logger,
|
|
181
190
|
})
|
|
182
191
|
: undefined,
|
|
192
|
+
principalInboxConsumer: config.principalInboxAssistant !== undefined ? { assistant: config.principalInboxAssistant } : undefined,
|
|
183
193
|
onTaskOutcome: outcomeSink
|
|
184
194
|
? (o) => {
|
|
185
195
|
metrics.inc("task_outcomes_total", { status: o.status, green: String(o.oracle?.green ?? "unknown") });
|
|
@@ -69,6 +69,7 @@ export interface SessionFacesCtx {
|
|
|
69
69
|
export declare function createSessionFaces(ctx: SessionFacesCtx): {
|
|
70
70
|
ownerAware: OwnerAwareSessionStore;
|
|
71
71
|
sessionAudit: ((sessionId: string, opts?: SessionAuditReadOpts) => Promise<{
|
|
72
|
+
agent?: import("../audit.js").SessionAgent | undefined;
|
|
72
73
|
owner: string | null;
|
|
73
74
|
sessionId: string;
|
|
74
75
|
createdAt: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildRewindHandles, buildSessionAudit, buildSessionAuditLocal, buildSessionAuditPg } from "../audit.js";
|
|
1
|
+
import { buildRewindHandles, buildSessionAudit, buildSessionAuditLocal, buildSessionAuditPg, sessionAgentOf } from "../audit.js";
|
|
2
2
|
import { makeDegenerateInstrument } from "../degenerate-instrument.js";
|
|
3
3
|
import { PlanCacheProbe } from "../plan-cache-probe.js";
|
|
4
4
|
import { purgeScratchpadDir } from "../env-facts.js";
|
|
@@ -25,7 +25,9 @@ export function createSessionFaces(ctx) {
|
|
|
25
25
|
: await buildSessionAuditLocal(auditLocalRoot, sessionId, handles);
|
|
26
26
|
if (!audit)
|
|
27
27
|
return undefined;
|
|
28
|
-
|
|
28
|
+
const [owner, placement] = await Promise.all([ownerAware.ownerOf?.(sessionId), opts !== undefined ? ownerAware.placementOf?.(sessionId) : undefined]);
|
|
29
|
+
const agent = sessionAgentOf(placement);
|
|
30
|
+
return { ...audit, owner: owner ?? null, ...(agent !== undefined ? { agent } : {}) };
|
|
29
31
|
}
|
|
30
32
|
: undefined;
|
|
31
33
|
const sessionWatchRegistry = ownerAware.getHead && ownerAware.ownerOf
|
|
@@ -3,6 +3,7 @@ import { createWebAdminRuntime } from "./web-admin.js";
|
|
|
3
3
|
import { composeExecutionLane, FILE_SOURCED_LANES } from "./execution-lane.js";
|
|
4
4
|
import { serviceConfigSourceKind } from "../config-provider.js";
|
|
5
5
|
import { logConfigDirMigration, migrateLocalConfigDirectory } from "../config-d-migration.js";
|
|
6
|
+
import { assertLocalConfigDirTrusted } from "../config-dir-trust.js";
|
|
6
7
|
import { defaultModelRefusal, refusedNameMintedRefusal } from "../model-entry-refusal.js";
|
|
7
8
|
import { isRosterGateArmed } from "../config.js";
|
|
8
9
|
import { judgeServedModelRoute } from "../model-route-endpoint.js";
|
|
@@ -10,8 +11,10 @@ import { servedModelTableLeg } from "../model-select.js";
|
|
|
10
11
|
export async function runStage02(ctx) {
|
|
11
12
|
const { config, localRoot, logger, metrics } = ctx;
|
|
12
13
|
const configSource = serviceConfigSourceKind(config);
|
|
13
|
-
if (configSource === "local")
|
|
14
|
+
if (configSource === "local") {
|
|
15
|
+
await assertLocalConfigDirTrusted({ root: localRoot, declaredOwnerUid: config.configLocalOwnerUid });
|
|
14
16
|
logConfigDirMigration(logger, await migrateLocalConfigDirectory(localRoot));
|
|
17
|
+
}
|
|
15
18
|
await composeExecutionLane(config, { configSource, localRoot, logger, drivesFromFile: FILE_SOURCED_LANES });
|
|
16
19
|
const webAdmin = await createWebAdminRuntime({ config, logger, metrics, localRoot });
|
|
17
20
|
const servedLeg = servedModelTableLeg(config);
|
|
@@ -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;
|
|
@@ -51,6 +52,7 @@ export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>):
|
|
|
51
52
|
workflowCompletionInbox: import("../orchestration/workflow-completion-inbox.js").WorkflowCompletionInbox | undefined;
|
|
52
53
|
workflowJournalStore: import("../plugins/store-backend.js").ServiceWorkflowJournalStore | undefined;
|
|
53
54
|
workflowModelAllowlistSnapshot: readonly string[];
|
|
55
|
+
workflowParkDecisions: import("../orchestration/workflow-park-decision.js").WorkflowParkDecisionStore | undefined;
|
|
54
56
|
workflowNotifyGate: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyGate | undefined;
|
|
55
57
|
workflowNotifyJournal: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyJournalStore | undefined;
|
|
56
58
|
workflowRecoverOpts: {
|
|
@@ -60,6 +62,7 @@ export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>):
|
|
|
60
62
|
};
|
|
61
63
|
workflowRunStore: import("../orchestration/workflow-notify-journal.js").JournalingWorkflowRunStore | undefined;
|
|
62
64
|
workflowsCapable: boolean;
|
|
65
|
+
orgDeliveryGate: import("@sema-agent/core").OrgDeliveryGate | undefined;
|
|
63
66
|
deploymentMods: readonly import("@sema-agent/core").ModRegistration<import("@sema-agent/core").EngineDollar>[];
|
|
64
67
|
deviceLane: import("./device-lane.js").DeviceLane | undefined;
|
|
65
68
|
dropSessionScoped: (sid: string) => void;
|
|
@@ -146,5 +149,5 @@ export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>):
|
|
|
146
149
|
localRoot: string;
|
|
147
150
|
logger: import("../index.js").Logger;
|
|
148
151
|
metrics: import("../index.js").Metrics;
|
|
149
|
-
}
|
|
152
|
+
}>;
|
|
150
153
|
//# sourceMappingURL=stage-06-runners.d.ts.map
|
|
@@ -7,6 +7,7 @@ import { withoutHands } from "../capabilities/hands-lane.js";
|
|
|
7
7
|
import { isBrandedDeployment } from "../capabilities/brand-identity.js";
|
|
8
8
|
import { redactSecrets } from "../trace/redact.js";
|
|
9
9
|
import { hasServiceAuth } from "../http/server.js";
|
|
10
|
+
import { operatorRosterPresent } from "../http/principal-gate.js";
|
|
10
11
|
import { workflowModelAllowlistFor } from "../task-workflow.js";
|
|
11
12
|
import { createHookLlm, buildHookFailureText } from "../hooks/hook-llm.js";
|
|
12
13
|
import { assertRetentionLaneWirable } from "./retention-lane.js";
|
|
@@ -14,26 +15,40 @@ import { buildConsolidationValveAudit, createMemoryConsolidationFaces, createOpe
|
|
|
14
15
|
import { createPerModelAuthSeat } from "./side-query-lane.js";
|
|
15
16
|
import { createWorkflowOrchestration } from "./workflow-orchestration.js";
|
|
16
17
|
import { createLiveCoordinators } from "./coordinators.js";
|
|
18
|
+
import { assertApprovalAskRuleMaterialOnBackend } from "./stores.js";
|
|
17
19
|
import { createParkCommitWatch } from "../plugins/park-commit-watch.js";
|
|
20
|
+
import { CHECKPOINT_CTX_SEALING_REQUIRED } from "../http/checkpoint-ctx.js";
|
|
21
|
+
import { sealCheckpointCtxCredentialsM28 } from "../checkpoint-ctx-seal-m28.js";
|
|
18
22
|
import { createRuntimeCaps } from "./runtime-caps.js";
|
|
19
23
|
import { createEngineNoticeForwarder, createRunnerDeps, createSharedRunnerDeps } from "./runner-deps.js";
|
|
20
24
|
import { defaultEngineNoticeRouter } from "../trace/engine-notice-wire.js";
|
|
21
25
|
import { createOrgMemoryAdmissionWiring } from "./org-memory.js";
|
|
22
26
|
import { createGovernanceSeams } from "./governance-seams.js";
|
|
23
27
|
import { createSharedMemoryScopeAuthorizer } from "../shared-memory-scope-authorizer.js";
|
|
28
|
+
import { mountOrgDeliveryGate } from "./org-delivery.js";
|
|
24
29
|
import { parkedAskRedeem, runStore } from "./late-binds.js";
|
|
25
30
|
import { withInternalRunEnvs } from "../internal-run-env.js";
|
|
26
|
-
export function runStage06(ctx) {
|
|
31
|
+
export async function runStage06(ctx) {
|
|
27
32
|
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;
|
|
28
|
-
const { sqlWorkflowRunStore, workflowNotifyJournal, workflowCompletionInbox, deliverWorkflowCompletion, workflowNotifyGate, fleetBus, workflowRunStore, workflowJournalStore, outcomeSink, workflowRecoverOpts, workflowAgentRegistry, subagentSteerRegistry, workflowAgentSessionIndex, } = createWorkflowOrchestration({ config, logger, metrics, localRoot, backend, getRunStore: () => runStore });
|
|
33
|
+
const { sqlWorkflowRunStore, workflowNotifyJournal, workflowCompletionInbox, deliverWorkflowCompletion, workflowNotifyGate, fleetBus, workflowRunStore, workflowJournalStore, outcomeSink, workflowRecoverOpts, workflowAgentRegistry, subagentSteerRegistry, workflowAgentSessionIndex, workflowParkDecisions, } = createWorkflowOrchestration({ config, logger, metrics, localRoot, backend, getRunStore: () => runStore });
|
|
29
34
|
const parkCommitted = backend?.checkpoint && config.durableApproval ? createParkCommitWatch(backend.checkpoint(logger)) : undefined;
|
|
30
35
|
const checkpointStore = parkCommitted?.store;
|
|
31
36
|
const parkCommits = parkCommitted?.watch;
|
|
37
|
+
const checkpointCtxSealing = webAdmin.checkpointCtxSealing;
|
|
38
|
+
if (checkpointStore !== undefined) {
|
|
39
|
+
if (checkpointCtxSealing === undefined)
|
|
40
|
+
throw new Error(CHECKPOINT_CTX_SEALING_REQUIRED);
|
|
41
|
+
const m28 = await sealCheckpointCtxCredentialsM28(checkpointStore, checkpointCtxSealing, { today: new Date().toISOString().slice(0, 10) });
|
|
42
|
+
logger.info("checkpoint_ctx_credentials_sealed", { ...m28, note: "one-time migration M28: plaintext request credentials in suspended tasks' resume contexts sealed in place" });
|
|
43
|
+
}
|
|
32
44
|
const { elicitation, question, toolApproval, durableEnabled, streamApprovalGate, approvalAskAudit, approvalExemptionStore, sendUserFileEmitter, sendFileLedger, sendUserFileToolSpec } = createLiveCoordinators({
|
|
33
45
|
config, logger, backend, sendUserFileTaskEnvs, ruleConsent, parkCommits,
|
|
46
|
+
...(checkpointStore !== undefined ? { checkpointStore } : {}),
|
|
34
47
|
getParkedRedeem: () => parkedAskRedeem,
|
|
35
48
|
ruleScopeRootFor: (sessionId) => cardRuleScopeRoot(sessionId !== undefined ? perSessionCwd.get(sessionId) : undefined, config),
|
|
36
49
|
});
|
|
50
|
+
if (streamApprovalGate.active)
|
|
51
|
+
await assertApprovalAskRuleMaterialOnBackend(backend);
|
|
37
52
|
const memoryOptOutGrantStore = backend?.memoryOptOutGrant();
|
|
38
53
|
const { principalCaps, centerRuntimeCapsResolver, runtimeCapsResolver, runtimeCapsPeekResolver } = createRuntimeCaps({ config, logger, memoryOptOutGrant: memoryOptOutGrantStore });
|
|
39
54
|
const orgMemoryAdmission = createOrgMemoryAdmissionWiring({ config, logger, metrics });
|
|
@@ -83,7 +98,7 @@ export function runStage06(ctx) {
|
|
|
83
98
|
: undefined;
|
|
84
99
|
for (const w of buildConsolidationValveAudit({
|
|
85
100
|
valve: consolidationValve,
|
|
86
|
-
|
|
101
|
+
operatorRosterPresent: operatorRosterPresent(config),
|
|
87
102
|
hasServiceAuth: hasServiceAuth(config),
|
|
88
103
|
allowUnauthedWrites: config.allowUnauthedWrites ?? false,
|
|
89
104
|
}).warnings) {
|
|
@@ -127,6 +142,7 @@ export function runStage06(ctx) {
|
|
|
127
142
|
sharedMemoryStores: sharedMemoryStore ? sharedMemoryStore : undefined,
|
|
128
143
|
getRunStore: () => runStore,
|
|
129
144
|
});
|
|
145
|
+
const orgDeliveryGate = mountOrgDeliveryGate({ runnerDeps, directory: orgMemoryAdmission.directory, mailboxStore, backend, logger });
|
|
130
146
|
const runner = new Runner(runnerDeps);
|
|
131
147
|
const handslessRunner = new Runner(withoutHands(runnerDeps));
|
|
132
148
|
const { hookModelFor, hookLlm } = createHookLlm({ config, getKeyResolver: () => webAdmin.getKeyResolver(), metrics });
|
|
@@ -210,6 +226,6 @@ export function runStage06(ctx) {
|
|
|
210
226
|
onError: runnerDeps.onError ? runnerDeps.onError : undefined,
|
|
211
227
|
};
|
|
212
228
|
const subRunner = new Runner(subRunnerDeps);
|
|
213
|
-
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, workflowNotifyGate, workflowNotifyJournal, workflowRecoverOpts, workflowRunStore, workflowsCapable };
|
|
229
|
+
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 };
|
|
214
230
|
}
|
|
215
231
|
//# 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;
|
|
@@ -66,6 +67,7 @@ export declare function runStage07(ctx: Awaited<ReturnType<typeof runStage06>>):
|
|
|
66
67
|
workflowCompletionInbox: import("../orchestration/workflow-completion-inbox.js").WorkflowCompletionInbox | undefined;
|
|
67
68
|
workflowJournalStore: import("../plugins/store-backend.js").ServiceWorkflowJournalStore | undefined;
|
|
68
69
|
workflowModelAllowlistSnapshot: readonly string[];
|
|
70
|
+
workflowParkDecisions: import("../orchestration/workflow-park-decision.js").WorkflowParkDecisionStore | undefined;
|
|
69
71
|
workflowNotifyGate: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyGate | undefined;
|
|
70
72
|
workflowNotifyJournal: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyJournalStore | undefined;
|
|
71
73
|
workflowRecoverOpts: {
|
|
@@ -75,6 +77,7 @@ export declare function runStage07(ctx: Awaited<ReturnType<typeof runStage06>>):
|
|
|
75
77
|
};
|
|
76
78
|
workflowRunStore: import("../orchestration/workflow-notify-journal.js").JournalingWorkflowRunStore | undefined;
|
|
77
79
|
workflowsCapable: boolean;
|
|
80
|
+
orgDeliveryGate: import("@sema-agent/core").OrgDeliveryGate | undefined;
|
|
78
81
|
deploymentMods: readonly import("@sema-agent/core").ModRegistration<import("@sema-agent/core").EngineDollar>[];
|
|
79
82
|
deviceLane: import("./device-lane.js").DeviceLane | undefined;
|
|
80
83
|
dropSessionScoped: (sid: string) => void;
|
|
@@ -7,13 +7,14 @@ import { ensureChildSessionDurableWithPromotion } from "../plugins/session-store
|
|
|
7
7
|
import { webSearchConfigFromEnv, createWebSearchBackend, shouldProbeWebSearchOnBoot } from "../plugins/web-search.js";
|
|
8
8
|
import { createAuthorizer } from "../security.js";
|
|
9
9
|
import { buildForceDurableGateInertNotice, buildNoResponderBootWarns, gateIntentUnserviceableReason, singleUserAutoAcceptBaselineApplies } from "../approval.js";
|
|
10
|
-
import { executionLaneOf } from "../execution-lane-caps.js";
|
|
10
|
+
import { executionLaneOf, laneWiresExecutionEnv } from "../execution-lane-caps.js";
|
|
11
11
|
import { loadDeploymentSkills } from "../capabilities/skills.js";
|
|
12
12
|
import { createRepoClient } from "../capabilities/repo-tools.js";
|
|
13
13
|
import { buildScenarios, builtinScenarioDetails, danglingScenarioRefusal } from "../capabilities/scenarios.js";
|
|
14
14
|
import { isBrandedDeployment } from "../capabilities/brand-identity.js";
|
|
15
15
|
import { RateLimiter } from "../observability/rate-limit.js";
|
|
16
16
|
import { explicitOperatorOk } from "../http/server.js";
|
|
17
|
+
import { buildOperatorUndeclaredNotice } from "../http/principal-gate.js";
|
|
17
18
|
import { selfOrchestrationDenial } from "../task-workflow.js";
|
|
18
19
|
import { centerEntitlementSourceWired } from "../runtime-caps-resolver.js";
|
|
19
20
|
import { reclaimOrphansAtBoot } from "../boot-reclaim.js";
|
|
@@ -56,6 +57,18 @@ export async function runStage07(ctx) {
|
|
|
56
57
|
throw new Error(gateRefusal);
|
|
57
58
|
await reclaimOrphansAtBoot(runStore, checkpointStore, logger);
|
|
58
59
|
await runBootCrashConvergence({ backend, runStore, liveAudit: approvalAskAudit, localDataRoot: config.localDataRoot, logger });
|
|
60
|
+
const adoption = await toolApproval?.adoptOpenAsks();
|
|
61
|
+
if (adoption !== undefined && (adoption.capped || adoption.cardUnreadable > 0)) {
|
|
62
|
+
logger.warn("approval_ask_adopted_partially", {
|
|
63
|
+
adopted: adoption.adopted,
|
|
64
|
+
cardUnreadable: adoption.cardUnreadable,
|
|
65
|
+
capped: adoption.capped,
|
|
66
|
+
note: "some approval asks still pending in the ask ledger were not taken into this replica's live list: unreadable card envelopes are skipped, and only the oldest pending rows up to the adoption cap are taken. The skipped asks stay answerable through POST /v1/tasks/:taskId/asks/:askId/decision and are expired by the reconciler on their own window.",
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
else if (adoption !== undefined && adoption.adopted > 0) {
|
|
70
|
+
logger.info("approval_ask_adopted", { adopted: adoption.adopted, alreadyLive: adoption.alreadyLive });
|
|
71
|
+
}
|
|
59
72
|
const userInputLedgerStore = backend && runStore ? backend.userInputLedger() : undefined;
|
|
60
73
|
const userInputLedger = backend && runStore && userInputLedgerStore
|
|
61
74
|
? await (async () => {
|
|
@@ -75,7 +88,7 @@ export async function runStage07(ctx) {
|
|
|
75
88
|
? selectEnvironmentTool({
|
|
76
89
|
catalog: imageIndex,
|
|
77
90
|
selection: sessionEnvSelection,
|
|
78
|
-
viewerFor: (principal) => ({ operator: explicitOperatorOk(principal, config
|
|
91
|
+
viewerFor: (principal) => ({ operator: explicitOperatorOk(principal, config), tenantId: principal ?? null }),
|
|
79
92
|
})
|
|
80
93
|
: undefined;
|
|
81
94
|
const imageBakes = backend?.imageBake && config.imageBakes.enabled ? backend.imageBake() : undefined;
|
|
@@ -83,6 +96,11 @@ export async function runStage07(ctx) {
|
|
|
83
96
|
logger.info("image_bakes_enabled", { operators: config.operatorPrincipals.length, runner: config.imageBakes.runnerPrincipal });
|
|
84
97
|
if (durableEnabled)
|
|
85
98
|
logger.info("durable_approval_enabled", { toolApprovalGate: config.approvalRequire.length });
|
|
99
|
+
{
|
|
100
|
+
const undeclared = buildOperatorUndeclaredNotice(config, durableEnabled);
|
|
101
|
+
if (undeclared)
|
|
102
|
+
logger.warn(undeclared.event, undeclared.fields);
|
|
103
|
+
}
|
|
86
104
|
if (config.a2aServe) {
|
|
87
105
|
const peer = facts.a2aServe({ config, runStore });
|
|
88
106
|
if (peer.available) {
|
|
@@ -151,10 +169,13 @@ export async function runStage07(ctx) {
|
|
|
151
169
|
})
|
|
152
170
|
.catch((e) => logger.warn("web_search_probe_failed", { provider: webSearchCfg.provider, error: e instanceof Error ? e.message : String(e) }));
|
|
153
171
|
}
|
|
154
|
-
const ensureChildSessionDurable = checkpointStore && config.sessionBackend === "tidb"
|
|
172
|
+
const ensureChildSessionDurable = checkpointStore && config.sessionBackend === "tidb"
|
|
173
|
+
? (sessionId, root) => ensureChildSessionDurableWithPromotion(sessionStore, subRunnerSessions, sessionId, root, logger)
|
|
174
|
+
: undefined;
|
|
155
175
|
const webFetchSummarize = createWebFetchSummarizeLane({ brain, config, getKeyResolver: () => webAdmin.getKeyResolver(), logger });
|
|
156
176
|
const scenarioDeps = {
|
|
157
177
|
runner, subRunner, model: DEFAULT_MODEL_REF, skills, repoClient, requirePrincipal: config.requirePrincipal,
|
|
178
|
+
handsLane: laneWiresExecutionEnv(executionLaneOf(config.remoteExec?.provider)),
|
|
158
179
|
webSearch: webSearch ? webSearch : undefined, logger, webFetchSummarize,
|
|
159
180
|
backgroundAgentStore: backgroundAgentStore ? backgroundAgentStore : undefined,
|
|
160
181
|
checkpointStore: checkpointStore ? checkpointStore : undefined,
|
|
@@ -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;
|
|
@@ -79,6 +80,7 @@ export declare function runStage08(ctx: Awaited<ReturnType<typeof runStage07>>):
|
|
|
79
80
|
workflowCompletionInbox: import("../orchestration/workflow-completion-inbox.js").WorkflowCompletionInbox | undefined;
|
|
80
81
|
workflowJournalStore: import("../plugins/store-backend.js").ServiceWorkflowJournalStore | undefined;
|
|
81
82
|
workflowModelAllowlistSnapshot: readonly string[];
|
|
83
|
+
workflowParkDecisions: import("../orchestration/workflow-park-decision.js").WorkflowParkDecisionStore | undefined;
|
|
82
84
|
workflowNotifyGate: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyGate | undefined;
|
|
83
85
|
workflowNotifyJournal: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyJournalStore | undefined;
|
|
84
86
|
workflowRecoverOpts: {
|
|
@@ -88,6 +90,7 @@ export declare function runStage08(ctx: Awaited<ReturnType<typeof runStage07>>):
|
|
|
88
90
|
};
|
|
89
91
|
workflowRunStore: import("../orchestration/workflow-notify-journal.js").JournalingWorkflowRunStore | undefined;
|
|
90
92
|
workflowsCapable: boolean;
|
|
93
|
+
orgDeliveryGate: import("@sema-agent/core").OrgDeliveryGate | undefined;
|
|
91
94
|
deploymentMods: readonly import("@sema-agent/core").ModRegistration<import("@sema-agent/core").EngineDollar>[];
|
|
92
95
|
deviceLane: import("./device-lane.js").DeviceLane | undefined;
|
|
93
96
|
dropSessionScoped: (sid: string) => void;
|
|
@@ -5,12 +5,12 @@ import { startRetentionLane, RETENTION_LEASE_TTL_FACTOR } from "./retention-lane
|
|
|
5
5
|
import { createLimitSync } from "./limit-sync.js";
|
|
6
6
|
import { runDenySweep } from "./late-binds.js";
|
|
7
7
|
export function runStage08(ctx) {
|
|
8
|
-
const { approvalNonceStore, backend, backgroundAgentStore, ceilingVerdict, checkpointStore, parkCommits, config, webAdmin, consolidationSeatWatch, costQuota, degradeRouteWatch, fileHistoryErasure, spaceReclaimer, handslessRunner, hookAgentRunner, imageBakes, instanceId, localRoot, logger, mailboxStore, metrics, permissionRuleStores, pricing, rateLimiter, retentionExecutor, retentionLaneStore, rosterStore, runStore, runner, sqlWorkflowRunStore, subRunner, taskAttachmentStore, toolApproval, toolResultStore, userInputLedger, workflowJournalStore, workflowNotifyGate, workflowNotifyJournal, workflowRecoverOpts, worktreeReap } = ctx;
|
|
8
|
+
const { approvalAskAudit, approvalNonceStore, backend, backgroundAgentStore, ceilingVerdict, checkpointStore, parkCommits, config, webAdmin, consolidationSeatWatch, costQuota, degradeRouteWatch, fileHistoryErasure, spaceReclaimer, handslessRunner, hookAgentRunner, imageBakes, instanceId, localRoot, logger, mailboxStore, metrics, permissionRuleStores, pricing, rateLimiter, retentionExecutor, retentionLaneStore, rosterStore, runStore, runner, sqlWorkflowRunStore, subRunner, taskAttachmentStore, toolApproval, toolResultStore, userInputLedger, workflowJournalStore, workflowNotifyGate, workflowNotifyJournal, workflowRecoverOpts, worktreeReap } = ctx;
|
|
9
9
|
const reaper = startReapers({
|
|
10
10
|
config, logger, metrics, localRoot, backend, subRunner, runStore, checkpointStore, parkCommits,
|
|
11
11
|
rateLimiter, costQuota, toolResultStore, fileHistoryErasure, taskAttachmentStore, imageBakes, worktreeReap,
|
|
12
12
|
workflowNotifyGate, workflowRecoverOpts, workflowJournalStore, sqlWorkflowRunStore, workflowNotifyJournal, rosterStore,
|
|
13
|
-
backgroundAgentStore, mailboxStore, toolApproval, permissionRuleStores, approvalNonceStore, userInputLedger,
|
|
13
|
+
backgroundAgentStore, mailboxStore, toolApproval, permissionRuleStores, approvalNonceStore, userInputLedger, approvalAskAudit,
|
|
14
14
|
getRunDenySweep: () => runDenySweep,
|
|
15
15
|
});
|
|
16
16
|
const ttlMs = config.retentionSweep.intervalSec * 1000 * RETENTION_LEASE_TTL_FACTOR;
|
|
@@ -18,6 +18,7 @@ export declare function runStage09(ctx: Awaited<ReturnType<typeof runStage08>>):
|
|
|
18
18
|
}>) | undefined;
|
|
19
19
|
webAdminJwtVerifier: import("../auth-bridge.js").WebAdminJwtVerifier | undefined;
|
|
20
20
|
sessionAudit: ((sessionId: string, opts?: import("../audit.js").SessionAuditReadOpts) => Promise<{
|
|
21
|
+
agent?: import("../audit.js").SessionAgent | undefined;
|
|
21
22
|
owner: string | null;
|
|
22
23
|
sessionId: string;
|
|
23
24
|
createdAt: string;
|
|
@@ -65,6 +66,7 @@ export declare function runStage09(ctx: Awaited<ReturnType<typeof runStage08>>):
|
|
|
65
66
|
approvalAskAudit: import("../approval-ask-audit-store.js").FileApprovalAskAuditStore | undefined;
|
|
66
67
|
centerRuntimeCapsResolver: ((principal: string | undefined) => Promise<import("@sema-agent/core").RuntimeCaps | undefined>) | undefined;
|
|
67
68
|
checkpointStore: import("../plugins/store-backend.js").CheckpointStoreFull | undefined;
|
|
69
|
+
checkpointCtxSealing: import("../index.js").CheckpointCtxSealing | undefined;
|
|
68
70
|
parkCommits: import("../plugins/park-commit-watch.js").ParkCommitWatch | undefined;
|
|
69
71
|
durableEnabled: boolean;
|
|
70
72
|
elicitation: import("../elicitation.js").ElicitationCoordinator | undefined;
|
|
@@ -92,7 +94,7 @@ export declare function runStage09(ctx: Awaited<ReturnType<typeof runStage08>>):
|
|
|
92
94
|
sessionTitler: import("../session-titler.js").SessionTitler | undefined;
|
|
93
95
|
sharedMemoryStore: import("../plugins/shared-memory-store-sql.js").SqlSharedMemoryStore | undefined;
|
|
94
96
|
sqlWorkflowRunStore: import("@sema-agent/core").WorkflowRunStore | undefined;
|
|
95
|
-
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate
|
|
97
|
+
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate<import("../approval-gate-currency.js").GateCurrencyStore>;
|
|
96
98
|
subRunner: import("@sema-agent/core").Runner;
|
|
97
99
|
subRunnerSessions: import("../plugins/fork-routing-session-store.js").ForkRoutingSessionStore;
|
|
98
100
|
subagentSteerRegistry: import("../orchestration/subagent-steer.js").SubagentSteerRegistry;
|
|
@@ -102,6 +104,7 @@ export declare function runStage09(ctx: Awaited<ReturnType<typeof runStage08>>):
|
|
|
102
104
|
workflowCompletionInbox: import("../orchestration/workflow-completion-inbox.js").WorkflowCompletionInbox | undefined;
|
|
103
105
|
workflowJournalStore: import("../plugins/store-backend.js").ServiceWorkflowJournalStore | undefined;
|
|
104
106
|
workflowModelAllowlistSnapshot: readonly string[];
|
|
107
|
+
workflowParkDecisions: import("../orchestration/workflow-park-decision.js").WorkflowParkDecisionStore | undefined;
|
|
105
108
|
workflowNotifyGate: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyGate | undefined;
|
|
106
109
|
workflowNotifyJournal: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyJournalStore | undefined;
|
|
107
110
|
workflowRecoverOpts: {
|
|
@@ -111,6 +114,7 @@ export declare function runStage09(ctx: Awaited<ReturnType<typeof runStage08>>):
|
|
|
111
114
|
};
|
|
112
115
|
workflowRunStore: import("../orchestration/workflow-notify-journal.js").JournalingWorkflowRunStore | undefined;
|
|
113
116
|
workflowsCapable: boolean;
|
|
117
|
+
orgDeliveryGate: import("@sema-agent/core").OrgDeliveryGate | undefined;
|
|
114
118
|
deploymentMods: readonly import("@sema-agent/core").ModRegistration<import("@sema-agent/core").EngineDollar>[];
|
|
115
119
|
deviceLane: import("./device-lane.js").DeviceLane | undefined;
|
|
116
120
|
dropSessionScoped: (sid: string) => void;
|
|
@@ -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
|
|
@@ -17,6 +17,7 @@ export declare function runStage10(ctx: Awaited<ReturnType<typeof runStage09>>):
|
|
|
17
17
|
}>) | undefined;
|
|
18
18
|
webAdminJwtVerifier: import("../auth-bridge.js").WebAdminJwtVerifier | undefined;
|
|
19
19
|
sessionAudit: ((sessionId: string, opts?: import("../audit.js").SessionAuditReadOpts) => Promise<{
|
|
20
|
+
agent?: import("../audit.js").SessionAgent | undefined;
|
|
20
21
|
owner: string | null;
|
|
21
22
|
sessionId: string;
|
|
22
23
|
createdAt: string;
|
|
@@ -64,6 +65,7 @@ export declare function runStage10(ctx: Awaited<ReturnType<typeof runStage09>>):
|
|
|
64
65
|
approvalAskAudit: import("../approval-ask-audit-store.js").FileApprovalAskAuditStore | undefined;
|
|
65
66
|
centerRuntimeCapsResolver: ((principal: string | undefined) => Promise<import("@sema-agent/core").RuntimeCaps | undefined>) | undefined;
|
|
66
67
|
checkpointStore: import("../plugins/store-backend.js").CheckpointStoreFull | undefined;
|
|
68
|
+
checkpointCtxSealing: import("../index.js").CheckpointCtxSealing | undefined;
|
|
67
69
|
parkCommits: import("../plugins/park-commit-watch.js").ParkCommitWatch | undefined;
|
|
68
70
|
durableEnabled: boolean;
|
|
69
71
|
elicitation: import("../elicitation.js").ElicitationCoordinator | undefined;
|
|
@@ -91,7 +93,7 @@ export declare function runStage10(ctx: Awaited<ReturnType<typeof runStage09>>):
|
|
|
91
93
|
sessionTitler: import("../session-titler.js").SessionTitler | undefined;
|
|
92
94
|
sharedMemoryStore: import("../plugins/shared-memory-store-sql.js").SqlSharedMemoryStore | undefined;
|
|
93
95
|
sqlWorkflowRunStore: import("@sema-agent/core").WorkflowRunStore | undefined;
|
|
94
|
-
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate
|
|
96
|
+
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate<import("../approval-gate-currency.js").GateCurrencyStore>;
|
|
95
97
|
subRunner: import("@sema-agent/core").Runner;
|
|
96
98
|
subRunnerSessions: import("../plugins/fork-routing-session-store.js").ForkRoutingSessionStore;
|
|
97
99
|
subagentSteerRegistry: import("../orchestration/subagent-steer.js").SubagentSteerRegistry;
|
|
@@ -101,6 +103,7 @@ export declare function runStage10(ctx: Awaited<ReturnType<typeof runStage09>>):
|
|
|
101
103
|
workflowCompletionInbox: import("../orchestration/workflow-completion-inbox.js").WorkflowCompletionInbox | undefined;
|
|
102
104
|
workflowJournalStore: import("../plugins/store-backend.js").ServiceWorkflowJournalStore | undefined;
|
|
103
105
|
workflowModelAllowlistSnapshot: readonly string[];
|
|
106
|
+
workflowParkDecisions: import("../orchestration/workflow-park-decision.js").WorkflowParkDecisionStore | undefined;
|
|
104
107
|
workflowNotifyGate: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyGate | undefined;
|
|
105
108
|
workflowNotifyJournal: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyJournalStore | undefined;
|
|
106
109
|
workflowRecoverOpts: {
|
|
@@ -110,6 +113,7 @@ export declare function runStage10(ctx: Awaited<ReturnType<typeof runStage09>>):
|
|
|
110
113
|
};
|
|
111
114
|
workflowRunStore: import("../orchestration/workflow-notify-journal.js").JournalingWorkflowRunStore | undefined;
|
|
112
115
|
workflowsCapable: boolean;
|
|
116
|
+
orgDeliveryGate: import("@sema-agent/core").OrgDeliveryGate | undefined;
|
|
113
117
|
deploymentMods: readonly import("@sema-agent/core").ModRegistration<import("@sema-agent/core").EngineDollar>[];
|
|
114
118
|
deviceLane: import("./device-lane.js").DeviceLane | undefined;
|
|
115
119
|
dropSessionScoped: (sid: string) => void;
|
|
@@ -9,7 +9,6 @@ import { createHttpServer } from "../http/server.js";
|
|
|
9
9
|
import { exportMemoryScope } from "../memory-export.js";
|
|
10
10
|
import { performMemorySync } from "../memory-sync.js";
|
|
11
11
|
import { backgroundAgentOutput, taskHandleOutput, taskHandleStop } from "../runs.js";
|
|
12
|
-
import { sqlBlobCapOf } from "../plugins/blob-backend.js";
|
|
13
12
|
import { createStoreLiveProbe } from "../store-live-probe.js";
|
|
14
13
|
import { counterStoreLabel } from "../plugins/store-backend.js";
|
|
15
14
|
import { sessionStoreLabelOf } from "../store-posture.js";
|
|
@@ -30,13 +29,14 @@ import { bindServerLateSeats } from "./late-binds.js";
|
|
|
30
29
|
import { serviceVersion } from "../service-version.js";
|
|
31
30
|
import { buildDisplaySafeUrl } from "../trace/redact.js";
|
|
32
31
|
export async function runStage10(ctx) {
|
|
33
|
-
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, 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, workflowCompletionInbox, workflowJournalStore, workflowModelAllowlistSnapshot, workflowNotifyGate, workflowNotifyJournal, workflowRecoverOpts, workflowRunStore, workflowsCapable } = 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;
|
|
34
33
|
const stores = {
|
|
35
34
|
runStore,
|
|
36
35
|
resumeAnchorStore: resumeAnchorStore ? resumeAnchorStore : undefined,
|
|
37
36
|
approvalExemptionStore: approvalExemptionStore ? approvalExemptionStore : undefined,
|
|
38
37
|
approvalNonceStore: approvalNonceStore ? approvalNonceStore : undefined,
|
|
39
38
|
checkpointStore,
|
|
39
|
+
checkpointCtxSealing,
|
|
40
40
|
sessionPolicyStore: sessionPolicyStore ? sessionPolicyStore : undefined,
|
|
41
41
|
ruleConsent,
|
|
42
42
|
fileHistoryStore: fileHistoryStore ? fileHistoryStore : undefined,
|
|
@@ -47,6 +47,7 @@ export async function runStage10(ctx) {
|
|
|
47
47
|
peerDirectory: runnerDeps.peerDirectory,
|
|
48
48
|
workflowRunStore: workflowRunStore ? workflowRunStore : undefined,
|
|
49
49
|
workflowAgentSessionIndex: workflowAgentSessionIndex ? workflowAgentSessionIndex : undefined,
|
|
50
|
+
workflowParkDecisions: workflowParkDecisions ? workflowParkDecisions : undefined,
|
|
50
51
|
workflowJournalStore: workflowJournalStore ? workflowJournalStore : undefined,
|
|
51
52
|
imageIndex,
|
|
52
53
|
imageBakes,
|
|
@@ -99,6 +100,7 @@ export async function runStage10(ctx) {
|
|
|
99
100
|
memoryConsolidation: memoryConsolidationFaces,
|
|
100
101
|
memoryOptOutGrant: memoryOptOutGrantStore,
|
|
101
102
|
orgMemoryDirectory: orgMemoryAdmission.directory,
|
|
103
|
+
orgDeliveryGate,
|
|
102
104
|
sharedMemoryStore: sharedMemoryStore ? sharedMemoryStore : undefined,
|
|
103
105
|
sessionMirrorRuling: principalCaps
|
|
104
106
|
? async (p) => (await principalCaps.executionRuling(p))?.sessionMirror
|
|
@@ -177,6 +179,7 @@ export async function runStage10(ctx) {
|
|
|
177
179
|
restartState: () => webAdmin.restartState(),
|
|
178
180
|
configApplyState: () => webAdmin.configApplyState(),
|
|
179
181
|
centerCredentialState: () => webAdmin.centerCredentialState(),
|
|
182
|
+
centerIdentityNoticeState: () => webAdmin.centerIdentityNoticeState(),
|
|
180
183
|
modelRefusalsState: () => webAdmin.modelRefusalsState(),
|
|
181
184
|
candidateRejectionState: () => webAdmin.candidateRejectionState(),
|
|
182
185
|
configHandoffState: () => webAdmin.configHandoffState(),
|
|
@@ -191,9 +194,6 @@ export async function runStage10(ctx) {
|
|
|
191
194
|
storeLiveState: storeLiveProbe ? () => storeLiveProbe.state() : undefined,
|
|
192
195
|
};
|
|
193
196
|
const knobs = {
|
|
194
|
-
snapshotBlobSqlCap: sqlEngine !== undefined && !config.snapshotBlobStore
|
|
195
|
-
? () => sqlBlobCapOf(config.snapshotBlobSqlMaxBytes, sqlEngine)
|
|
196
|
-
: undefined,
|
|
197
197
|
sessionEventsMaxConnections: sessionWatchRegistry ? posIntEnv(process.env.SESSION_EVENTS_MAX_CONNS, 256, 100_000) : undefined,
|
|
198
198
|
};
|
|
199
199
|
const resolveSpec = createResolveSpec({
|
|
@@ -201,7 +201,7 @@ export async function runStage10(ctx) {
|
|
|
201
201
|
getKeyResolver: () => webAdmin.getKeyResolver(),
|
|
202
202
|
taskAttachmentStore, perSessionCwd, setSessionCwd, setSessionShellEnv, fenceSessionOwner,
|
|
203
203
|
hookLlm, hookAgent, fleetBus, hookWakeBus, resumeAnchorStore, ownerAware, taskLimitCaps, taskTimeoutSec,
|
|
204
|
-
selectEnvTool, sendUserFileToolSpec, memoryEngine, durableEnabled, approvalExemptionStore,
|
|
204
|
+
selectEnvTool, sendUserFileToolSpec, memoryEngine, memorySyncRunner, durableEnabled, approvalExemptionStore,
|
|
205
205
|
checkpointStore, imageIndex, perTaskImage,
|
|
206
206
|
sessionEnvSelection,
|
|
207
207
|
lockedKeys: governanceSeams.lockedKeys,
|
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;
|