@sema-agent/server 7.131.0 → 7.133.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 +575 -0
- package/README.md +12 -9
- package/README.zh-CN.md +9 -6
- package/USAGE.md +326 -98
- package/deploy/sema-up/README.md +19 -1
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +5 -2
- package/deploy/sema-up/chart/templates/server.yaml +5 -2
- 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 +31 -13
- 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 +82 -20
- package/dist/approval-card.js +46 -16
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval.d.ts +9 -0
- package/dist/approval.js +24 -3
- package/dist/audit.d.ts +33 -19
- package/dist/audit.js +12 -16
- package/dist/auth-bridge.d.ts +4 -0
- package/dist/auth-bridge.js +10 -11
- package/dist/bake-runner/main.js +3 -2
- package/dist/boot/deferred-sandbox-path-env.js +1 -1
- package/dist/boot/deployment-mods.d.ts +31 -0
- package/dist/boot/deployment-mods.js +26 -0
- package/dist/boot/execution-env.d.ts +1 -1
- package/dist/boot/execution-env.js +27 -12
- package/dist/boot/execution-lane.js +11 -0
- package/dist/boot/leader.js +2 -0
- package/dist/boot/memory-boundary.d.ts +2 -2
- 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.d.ts +17 -0
- package/dist/boot/read-deny-anchor-audit.js +36 -0
- package/dist/boot/reapers.d.ts +3 -0
- package/dist/boot/reapers.js +21 -1
- package/dist/boot/resolve-spec.d.ts +4 -5
- package/dist/boot/resolve-spec.js +74 -123
- package/dist/boot/runner-deps.d.ts +19 -8
- package/dist/boot/runner-deps.js +15 -2
- package/dist/boot/session-faces.d.ts +2 -7
- package/dist/boot/session-faces.js +4 -2
- package/dist/boot/stage-02-web-admin-pull.js +4 -1
- package/dist/boot/stage-03-store-backend.d.ts +1 -1
- package/dist/boot/stage-03-store-backend.js +2 -2
- package/dist/boot/stage-04-stores.d.ts +1 -1
- package/dist/boot/stage-05-execution-env.d.ts +4 -4
- package/dist/boot/stage-05-execution-env.js +7 -10
- package/dist/boot/stage-06-runners.d.ts +4 -2
- package/dist/boot/stage-06-runners.js +11 -7
- package/dist/boot/stage-07-capability-layer.d.ts +4 -2
- package/dist/boot/stage-07-capability-layer.js +27 -6
- package/dist/boot/stage-08-reapers.d.ts +4 -2
- package/dist/boot/stage-08-reapers.js +2 -2
- package/dist/boot/stage-09-leader.d.ts +6 -9
- package/dist/boot/stage-10-http-server.d.ts +6 -9
- package/dist/boot/stage-10-http-server.js +7 -9
- package/dist/boot/stores.d.ts +1 -1
- package/dist/boot/stores.js +7 -8
- package/dist/boot/web-admin.d.ts +4 -3
- package/dist/boot/web-admin.js +186 -98
- package/dist/boot/workflow-orchestration.d.ts +2 -0
- package/dist/boot/workflow-orchestration.js +2 -1
- package/dist/brain.js +25 -25
- package/dist/breaker-key.d.ts +6 -0
- package/dist/breaker-key.js +29 -0
- package/dist/budget.js +5 -4
- package/dist/caller-text-echo.d.ts +23 -0
- package/dist/caller-text-echo.js +21 -0
- package/dist/capabilities/brand-identity.d.ts +26 -0
- package/dist/capabilities/brand-identity.js +27 -0
- package/dist/capabilities/center-plugins.d.ts +7 -0
- package/dist/capabilities/center-plugins.js +1 -1
- package/dist/capabilities/center-prompts.d.ts +32 -59
- package/dist/capabilities/center-prompts.js +18 -32
- package/dist/capabilities/composite-members.d.ts +1 -1
- package/dist/capabilities/composite-members.js +1 -1
- package/dist/capabilities/engine-capabilities.js +2 -1
- package/dist/capabilities/execution-lane.js +2 -2
- package/dist/capabilities/hands-lane.d.ts +30 -6
- package/dist/capabilities/hands-lane.js +11 -1
- package/dist/capabilities/mcp-probe.d.ts +48 -3
- package/dist/capabilities/mcp-probe.js +47 -135
- package/dist/capabilities/scenarios.d.ts +95 -45
- package/dist/capabilities/scenarios.js +53 -38
- package/dist/capabilities/skills.d.ts +19 -4
- package/dist/capabilities/skills.js +30 -10
- package/dist/capability-facts.d.ts +34 -4
- package/dist/capability-facts.js +28 -2
- package/dist/center-config-tier.d.ts +69 -0
- package/dist/center-config-tier.js +42 -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 +47 -32
- 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-lkg.d.ts +9 -9
- package/dist/config-lkg.js +20 -4
- package/dist/config-provider.d.ts +9 -2
- package/dist/config-provider.js +18 -6
- package/dist/config-types.d.ts +75 -20
- package/dist/config-types.js +8 -0
- package/dist/config.d.ts +13 -0
- package/dist/config.js +137 -62
- 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 -22
- package/dist/elicitation.js +3 -2
- package/dist/entry-problems.d.ts +34 -0
- package/dist/entry-problems.js +14 -0
- package/dist/env-name-allowlist-knobs.d.ts +12 -2
- package/dist/env-name-allowlist-knobs.js +5 -4
- package/dist/exec-bounds.d.ts +15 -3
- package/dist/exec-bounds.js +4 -0
- package/dist/execution-lane-caps.d.ts +56 -10
- package/dist/execution-lane-caps.js +50 -0
- package/dist/field-conflict.d.ts +43 -0
- package/dist/field-conflict.js +20 -0
- package/dist/fleet/fleet-bus.d.ts +80 -6
- package/dist/fleet/fleet-bus.js +41 -9
- package/dist/hooks/classic-stations.d.ts +91 -0
- package/dist/hooks/classic-stations.js +27 -0
- package/dist/hooks/command-spawn.d.ts +57 -0
- package/dist/hooks/command-spawn.js +139 -0
- package/dist/hooks/hook-llm.d.ts +8 -5
- package/dist/hooks/hook-llm.js +79 -36
- package/dist/hooks/hook-runner.d.ts +349 -95
- package/dist/hooks/hook-runner.js +855 -568
- 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.d.ts +8 -2
- package/dist/http/admission.js +188 -101
- package/dist/http/approval-sweeps.js +99 -21
- package/dist/http/caller-trust.d.ts +77 -0
- package/dist/http/caller-trust.js +143 -0
- package/dist/http/checkpoint-ctx.d.ts +41 -24
- package/dist/http/checkpoint-ctx.js +23 -16
- package/dist/http/claimed-run.d.ts +14 -0
- package/dist/http/claimed-run.js +15 -0
- package/dist/http/device-placement.d.ts +2 -4
- package/dist/http/device-placement.js +7 -11
- package/dist/http/dispatch.d.ts +0 -4
- package/dist/http/dispatch.js +15 -13
- package/dist/http/durable-run-leg.d.ts +6 -33
- package/dist/http/durable-run-leg.js +36 -10
- package/dist/http/health-self-report.d.ts +7 -5
- package/dist/http/health-self-report.js +4 -18
- package/dist/http/owner-access.d.ts +56 -0
- package/dist/http/owner-access.js +42 -0
- package/dist/http/principal-gate.d.ts +70 -28
- package/dist/http/principal-gate.js +61 -15
- package/dist/http/readiness.d.ts +11 -5
- package/dist/http/readiness.js +10 -3
- package/dist/http/refusal-body.d.ts +21 -0
- package/dist/http/refusal-body.js +4 -0
- package/dist/http/request-guards.d.ts +43 -23
- package/dist/http/request-guards.js +53 -17
- package/dist/http/resume-ctx-read.d.ts +2 -5
- package/dist/http/resume-ctx-read.js +7 -4
- package/dist/http/resume-legs.d.ts +28 -4
- package/dist/http/resume-legs.js +169 -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 -28
- 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/approvals-assistant.js +49 -48
- package/dist/http/routes/background.js +3 -2
- package/dist/http/routes/capabilities.js +21 -5
- 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.js +6 -2
- 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.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 +5 -18
- package/dist/http/routes/runs.d.ts +5 -0
- package/dist/http/routes/runs.js +34 -107
- package/dist/http/routes/session-sync.js +15 -26
- package/dist/http/routes/sessions.js +30 -40
- package/dist/http/routes/shared-memory.js +2 -13
- package/dist/http/routes/side-query.js +8 -7
- package/dist/http/routes/tasks.js +67 -21
- package/dist/http/routes/workflows.d.ts +351 -0
- package/dist/http/routes/workflows.js +153 -119
- package/dist/http/send.d.ts +33 -10
- package/dist/http/send.js +21 -4
- package/dist/http/server.d.ts +27 -18
- package/dist/http/server.js +34 -6
- package/dist/http/stored-body-replay.js +17 -4
- package/dist/http/submit-ctx.d.ts +25 -0
- package/dist/http/submit-ctx.js +40 -0
- package/dist/http/submit-replay.d.ts +4 -3
- package/dist/http/submit-replay.js +5 -4
- package/dist/http/wire-types.d.ts +11 -8
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -2
- package/dist/lane-home-probe.d.ts +112 -0
- package/dist/lane-home-probe.js +101 -0
- package/dist/leader/endpoint.d.ts +4 -1
- package/dist/leader/endpoint.js +11 -10
- package/dist/limit-refusal.d.ts +59 -0
- package/dist/limit-refusal.js +15 -0
- package/dist/main.js +1 -1
- package/dist/mcp-assertion-header.d.ts +32 -19
- package/dist/mcp-assertion-header.js +10 -9
- package/dist/mcp-tool-faces.d.ts +5 -0
- package/dist/mcp-tool-faces.js +6 -4
- package/dist/memory-project-layer.d.ts +37 -0
- package/dist/memory-project-layer.js +46 -0
- package/dist/memory-scope.d.ts +24 -17
- 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-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 +44 -12
- package/dist/model-provider.js +21 -2
- package/dist/model-route-endpoint.d.ts +9 -12
- package/dist/model-route-endpoint.js +8 -11
- 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/cost-taxonomy.d.ts +7 -7
- package/dist/observability/err-text.d.ts +6 -0
- package/dist/observability/err-text.js +18 -4
- package/dist/observability/fail-open.d.ts +76 -14
- package/dist/observability/fail-open.js +76 -14
- package/dist/observability/metrics.js +4 -1
- package/dist/observability/prompt-manifest.d.ts +33 -82
- package/dist/observability/prompt-manifest.js +122 -17
- package/dist/observability/run-terminal.js +14 -6
- package/dist/observability/secret-env-scrub.d.ts +13 -1
- package/dist/observability/secret-env-scrub.js +13 -1
- package/dist/observability/tool-trace.d.ts +16 -21
- package/dist/observability/tool-trace.js +58 -49
- 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 +118 -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 +39 -6
- package/dist/parked-decide.js +98 -51
- package/dist/parked-revive-surface.d.ts +9 -2
- package/dist/parked-revive-surface.js +11 -8
- package/dist/per-task-image.d.ts +7 -1
- package/dist/per-task-image.js +3 -3
- package/dist/permission-rule-list.d.ts +1 -1
- package/dist/permission-rule-list.js +2 -2
- package/dist/plain-string-record.d.ts +25 -0
- package/dist/plain-string-record.js +32 -0
- 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/blob-backend.d.ts +83 -15
- package/dist/plugins/blob-backend.js +68 -15
- 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 +3 -0
- package/dist/plugins/caching-session-store.js +3 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +28 -4
- package/dist/plugins/checkpoint-store-sql.js +59 -28
- 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/k8s-bg-scripts.d.ts +11 -0
- package/dist/plugins/k8s-bg-scripts.js +22 -0
- package/dist/plugins/local-checkpoint-store.d.ts +2 -0
- package/dist/plugins/local-checkpoint-store.js +11 -3
- package/dist/plugins/local-session-store.d.ts +1 -1
- package/dist/plugins/local-session-store.js +1 -1
- package/dist/plugins/local-session-window.d.ts +39 -0
- package/dist/plugins/local-session-window.js +54 -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 +245 -93
- package/dist/plugins/one-time-migrations.js +668 -207
- 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-sql.d.ts +13 -7
- package/dist/plugins/permission-rule-store-sql.js +4 -18
- package/dist/plugins/pg-pool.js +39 -7
- package/dist/plugins/pg-session-storage.d.ts +20 -8
- package/dist/plugins/pg-session-storage.js +34 -21
- package/dist/plugins/remote-env-adb.d.ts +12 -12
- package/dist/plugins/remote-env-adb.js +21 -6
- package/dist/plugins/remote-env-device.js +3 -0
- package/dist/plugins/remote-env-e2b.d.ts +1 -1
- package/dist/plugins/remote-env-e2b.js +21 -9
- package/dist/plugins/remote-env-host.d.ts +9 -9
- package/dist/plugins/remote-env-host.js +10 -32
- package/dist/plugins/remote-env-k8s.d.ts +103 -38
- package/dist/plugins/remote-env-k8s.js +288 -95
- package/dist/plugins/remote-env-local-docker.d.ts +27 -13
- package/dist/plugins/remote-env-local-docker.js +82 -11
- package/dist/plugins/remote-env-ssh.d.ts +21 -12
- package/dist/plugins/remote-env-ssh.js +117 -5
- package/dist/plugins/remote-shell.d.ts +0 -1
- package/dist/plugins/remote-shell.js +1 -2
- package/dist/plugins/retention-store-sql.js +6 -2
- package/dist/plugins/run-store-sql.d.ts +16 -14
- package/dist/plugins/run-store-sql.js +22 -2
- package/dist/plugins/schema-consistency.d.ts +54 -0
- package/dist/plugins/schema-consistency.js +52 -0
- 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 +39 -0
- package/dist/plugins/session-epoch-anchor.js +22 -0
- package/dist/plugins/session-store.d.ts +18 -8
- package/dist/plugins/session-store.js +15 -4
- package/dist/plugins/shared-memory-store-sql.d.ts +9 -3
- package/dist/plugins/shared-memory-store-sql.js +5 -16
- package/dist/plugins/sql-driver.d.ts +205 -1
- package/dist/plugins/sql-driver.js +325 -13
- package/dist/plugins/sql-errors.d.ts +64 -0
- package/dist/plugins/sql-errors.js +57 -0
- package/dist/plugins/store-backend.d.ts +36 -1
- package/dist/plugins/store-backend.js +42 -15
- 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 +8 -11
- package/dist/plugins/tidb-session-storage.js +6 -16
- package/dist/plugins/tidb-session-store.d.ts +24 -4
- package/dist/plugins/tidb-session-store.js +29 -5
- 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/prompts-domain-validate.d.ts +17 -61
- package/dist/prompts-domain-validate.js +9 -119
- 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 +9 -2
- package/dist/request-key-closure.js +11 -5
- package/dist/request-value-closure.d.ts +5 -0
- package/dist/request-value-closure.js +11 -3
- package/dist/rule-entry-list.d.ts +38 -11
- package/dist/rule-entry-list.js +106 -30
- 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 +54 -24
- package/dist/runs.d.ts +15 -8
- package/dist/runs.js +35 -1
- 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/security.d.ts +87 -9
- package/dist/security.js +52 -9
- package/dist/server-secret-env.d.ts +44 -18
- package/dist/server-secret-env.js +49 -8
- package/dist/session-error-wire.d.ts +19 -2
- package/dist/session-error-wire.js +5 -1
- package/dist/session-incarnation.d.ts +15 -5
- package/dist/session-incarnation.js +16 -9
- 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 +27 -6
- package/dist/spec-fields.d.ts +28 -16
- package/dist/spec-fields.js +66 -54
- package/dist/sql-engine-posture.d.ts +31 -4
- package/dist/sql-engine-posture.js +36 -1
- package/dist/stored-request-tool-axes-m19.d.ts +19 -4
- package/dist/stored-request-tool-axes-m19.js +30 -2
- package/dist/task-a2a.d.ts +9 -1
- package/dist/task-a2a.js +73 -47
- package/dist/task-cwd.d.ts +1 -1
- package/dist/task-mcp.d.ts +46 -58
- package/dist/task-mcp.js +82 -107
- package/dist/task-settings.d.ts +95 -108
- package/dist/task-settings.js +77 -98
- package/dist/text-bidi.d.ts +1 -48
- package/dist/text-bidi.js +3 -5
- package/dist/tighten-only-seats.d.ts +150 -0
- package/dist/tighten-only-seats.js +196 -0
- package/dist/tool-approval.d.ts +304 -88
- package/dist/tool-approval.js +623 -239
- package/dist/trace/core-keyset-guard.d.ts +122 -20
- package/dist/trace/engine-notice-wire.d.ts +11 -3
- package/dist/trace/engine-notice-wire.js +8 -1
- package/dist/trace/exit-seat.d.ts +28 -0
- package/dist/trace/exit-seat.js +76 -0
- package/dist/trace/ledger-events.d.ts +6 -3
- package/dist/trace/ledger-sink.js +4 -1
- package/dist/trace/model-segment.js +1 -1
- package/dist/trace/project.d.ts +98 -17
- package/dist/trace/project.js +98 -50
- package/dist/trace/projection-table.d.ts +100 -0
- package/dist/trace/projection-table.js +130 -0
- package/dist/trace/redact.d.ts +54 -0
- package/dist/trace/redact.js +778 -152
- package/dist/trace/self-minted-wire.d.ts +345 -1
- package/dist/trace/self-minted-wire.js +117 -1
- package/dist/trace/wire-projection-faces.d.ts +377 -3
- package/dist/trace/wire-projection-faces.js +164 -1
- 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/candidate-gate.d.ts +6 -6
- package/dist/web-admin-client/candidate-gate.js +3 -3
- package/dist/web-admin-client/facade.d.ts +1 -1
- package/dist/web-admin-client/facade.js +1 -1
- package/dist/web-admin-client/http-client.js +0 -6
- package/dist/web-admin-client/read-face.js +5 -9
- package/dist/web-admin-client/read-warnings.d.ts +13 -0
- package/dist/web-admin-client/read-warnings.js +10 -0
- package/dist/web-admin-client/skills-mcp.d.ts +3 -0
- package/dist/web-admin-client/skills-mcp.js +11 -9
- package/dist/web-admin-client/types.d.ts +2 -3
- package/dist/workspace-cache.d.ts +35 -0
- package/dist/workspace-cache.js +36 -0
- package/dist/workspace-space.d.ts +3 -2
- package/dist/workspace-space.js +2 -0
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +65 -10
- package/package.json +8 -4
- package/scripts/drain-check-local.mjs +34 -1
- package/scripts/drain-check.mysql.sql +30 -2
- package/scripts/drain-check.pg.sql +29 -2
- package/dist/capabilities/memory-notice.d.ts +0 -138
- package/dist/capabilities/memory-notice.js +0 -64
- package/dist/capabilities/prompt.d.ts +0 -17
- package/dist/capabilities/prompt.js +0 -6
- package/dist/mcp-content-origin.d.ts +0 -34
- package/dist/mcp-content-origin.js +0 -10
- package/dist/tool-axis-words.d.ts +0 -27
- package/dist/tool-axis-words.js +0 -9
- package/dist/wire-name-bound.d.ts +0 -14
- package/dist/wire-name-bound.js +0 -13
package/dist/boot/stores.d.ts
CHANGED
|
@@ -34,6 +34,6 @@ export declare function openStores(ctx: OpenStoresCtx): Promise<{
|
|
|
34
34
|
usageWindowStore: import("@sema-agent/core").UsageWindowStore | undefined;
|
|
35
35
|
memoryPosture: import("../memory-posture.js").MemoryPosture;
|
|
36
36
|
taskListLane: import("./task-list-lane.js").TaskListLane;
|
|
37
|
-
|
|
37
|
+
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
38
38
|
}>;
|
|
39
39
|
//# sourceMappingURL=stores.d.ts.map
|
package/dist/boot/stores.js
CHANGED
|
@@ -37,7 +37,7 @@ import { assertFileHistorySchema } from "../plugins/file-history-store-sql.js";
|
|
|
37
37
|
import { resolveStreamApprovalGate } from "../tool-approval.js";
|
|
38
38
|
import { buildMemoryBoundaryLaneFacts, buildMemoryWriteBoundaryAudit, effectiveMemoryPersistenceCapable } from "./memory-boundary.js";
|
|
39
39
|
import { buildMemoryPosture } from "../memory-posture.js";
|
|
40
|
-
import { establishSqlEnginePosture } from "../sql-engine-posture.js";
|
|
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";
|
|
43
43
|
const DARK_REASON_PROSE = {
|
|
@@ -377,7 +377,7 @@ export async function openStores(ctx) {
|
|
|
377
377
|
...(config.memorySync.maxPushEntries !== undefined ? { maxPushEntries: config.memorySync.maxPushEntries } : {}),
|
|
378
378
|
...(config.memorySync.maxPullEntries !== undefined ? { maxPullEntries: config.memorySync.maxPullEntries } : {}),
|
|
379
379
|
});
|
|
380
|
-
logger.info("memory_sync_enabled", { url: buildDisplaySafeUrl(config.memorySync.url), scope: config.memorySync.scope, cursorPath: memorySyncRunner.
|
|
380
|
+
logger.info("memory_sync_enabled", { url: buildDisplaySafeUrl(config.memorySync.url), scope: config.memorySync.scope, cursorPath: memorySyncRunner.cursorPathFor(config.memorySync.scope) });
|
|
381
381
|
memorySyncRunner.trigger("boot");
|
|
382
382
|
}
|
|
383
383
|
else {
|
|
@@ -393,11 +393,10 @@ export async function openStores(ctx) {
|
|
|
393
393
|
await ensureTiDBTaskListSchema(mysqlPool);
|
|
394
394
|
return createTaskListLane({ mysqlPool, pgPool, logger });
|
|
395
395
|
})();
|
|
396
|
-
let
|
|
396
|
+
let sqlEngine;
|
|
397
397
|
{
|
|
398
|
-
const mysqlPool = backend
|
|
399
|
-
|
|
400
|
-
sqlEngineFacts = await establishSqlEnginePosture({ mysqlPool, pgPool });
|
|
398
|
+
const { mysqlPool, pgPool } = sqlPoolsOf(backend);
|
|
399
|
+
sqlEngine = await establishSqlEnginePosture({ mysqlPool, pgPool });
|
|
401
400
|
if (pgPool)
|
|
402
401
|
await ensurePgDeviceSchema(async (text, params) => pgPool.query(text, params));
|
|
403
402
|
if (mysqlPool)
|
|
@@ -437,7 +436,7 @@ export async function openStores(ctx) {
|
|
|
437
436
|
const breakerState = backend?.breaker && config.resilience.circuitBreaker
|
|
438
437
|
? backend
|
|
439
438
|
.breaker((streak) => {
|
|
440
|
-
metrics.setGauge("counter_flush_fail_streak", streak, { table: "
|
|
439
|
+
metrics.setGauge("counter_flush_fail_streak", streak, { table: "breaker_state", kind: "write_through" });
|
|
441
440
|
if (streak > 0)
|
|
442
441
|
metrics.inc("breaker_writethrough_failed_total", { backend: backend.kind });
|
|
443
442
|
if (streak === 3)
|
|
@@ -450,7 +449,7 @@ export async function openStores(ctx) {
|
|
|
450
449
|
return {
|
|
451
450
|
backend, storePosture, memoryEngine, engineDataRoot, memorySyncCursors, rosterStore, backgroundAgentStore, mailboxRecipientLifecycle,
|
|
452
451
|
taskAttachmentStore, mailboxStore, memoryExportBackend, memorySyncRunner, sessionStore, breakerState,
|
|
453
|
-
usageWindowStore, memoryPosture, taskListLane,
|
|
452
|
+
usageWindowStore, memoryPosture, taskListLane, sqlEngine,
|
|
454
453
|
};
|
|
455
454
|
}
|
|
456
455
|
//# sourceMappingURL=stores.js.map
|
package/dist/boot/web-admin.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type ModelRefusalsSignal } from "@sema-agent/settings-schema";
|
|
2
2
|
import { CenterPromptSource, type SwappableDeps } from "@sema-agent/core";
|
|
3
3
|
import { buildPricing } from "../budget.js";
|
|
4
|
-
import { type PromptsDomainFaces } from "../prompts-domain-validate.js";
|
|
5
4
|
import { type Scenario, type ScenarioDeps, type ScenarioDetail } from "../capabilities/scenarios.js";
|
|
6
5
|
import type { LoadedSkill } from "../capabilities/skills.js";
|
|
7
6
|
import { type ServiceConfig } from "../config.js";
|
|
7
|
+
import { type CenterIdentityNotice } from "../center-config-tier.js";
|
|
8
8
|
import { type CenterCredentialHealthView } from "../center-credential-renewer.js";
|
|
9
9
|
import { type ModelKeyRef } from "../key-resolver.js";
|
|
10
10
|
import type { Logger } from "../observability/logger.js";
|
|
@@ -84,6 +84,9 @@ export interface WebAdminRuntime {
|
|
|
84
84
|
stopRefreshLoop(): void;
|
|
85
85
|
/** S-698:`/health.centerCredential` 的取值口 —— 凭证来源的健康态 + 续签器状态;都健康 / 没有中心 ⇒ `undefined`(键缺席)。 */
|
|
86
86
|
centerCredentialState(): CenterCredentialHealthView | undefined;
|
|
87
|
+
/** S-667:`/health.centerIdentityNotice` 的取值口 —— 中心凭证换人后的**最近一条**通告(`center_identity_demoted` 已降到无中心配置档 / `center_identity_landed`
|
|
88
|
+
* 新身份的配置已换上;码、冻结句与状态机见 `center-config-tier.ts`)。从未换过人 / 没有中心 ⇒ `undefined`(键缺席)。值形就是 wire 形 `{ code, message, at }`。 */
|
|
89
|
+
centerIdentityNoticeState(): CenterIdentityNotice | undefined;
|
|
87
90
|
/** [ref](core 5.50 [ref]):mid-turn MCP 撤销台账读口,喂 `RunnerDeps.mcpRevocations` 席。
|
|
88
91
|
* **取走即声明接线**——调用本方法后,restart 信号的 mcp 片对纯删除向豁免(台账即时承接);
|
|
89
92
|
* 不取 ⇒ 旧 restart 语义逐字保留(fail-closed)。 */
|
|
@@ -96,8 +99,6 @@ export interface WebAdminRuntime {
|
|
|
96
99
|
getKeyResolver(): ((model: ModelKeyRef) => Promise<{
|
|
97
100
|
apiKey: string;
|
|
98
101
|
} | undefined>) | undefined;
|
|
99
|
-
/** 晚绑取值:center 提示词面(热采用,新任务边界生效)。 */
|
|
100
|
-
getCenterPrompts(): PromptsDomainFaces | undefined;
|
|
101
102
|
/** boot ready 门:布防(`CONFIG_REQUIRE_ROSTER=true`,远程 registry 非 dryRun)且 roster 未落地 =
|
|
102
103
|
* 计费提交 503 + /health ready:false。缺省未布防 ⇒ 恒 true。 */
|
|
103
104
|
modelReady(): boolean;
|
package/dist/boot/web-admin.js
CHANGED
|
@@ -8,25 +8,28 @@ import { buildModelRefusalsSignal } from "../model-entry-refusal.js";
|
|
|
8
8
|
import { CenterPromptSource, FilePromptArtifactStore, FilePromptSourceStateStore, MemoryPromptArtifactStore, MemoryPromptSourceStateStore, } from "@sema-agent/core";
|
|
9
9
|
import { buildPricing } from "../budget.js";
|
|
10
10
|
import { applyCenterPlugins } from "../capabilities/center-plugins.js";
|
|
11
|
-
import {
|
|
12
|
-
import { CORE_ENGINE_VERSION } from "../prompts-domain-validate.js";
|
|
11
|
+
import { applyCenterArtifact, centerSourceOnError, withPromptArtifactBackfill } from "../capabilities/center-prompts.js";
|
|
13
12
|
import { centerScenarios, centerScenarioDetails } from "../capabilities/scenarios.js";
|
|
14
13
|
import { isRosterGateArmed } from "../config.js";
|
|
14
|
+
import { toolsRunOnThisHost } from "../task-cwd.js";
|
|
15
15
|
import { defaultLkgPath, defaultSkillCacheDir, saveLkg, loadLkg, legacyV1LkgPath, migrateV1Lkg } from "../config-lkg.js";
|
|
16
16
|
import { answerStillCurrent, centerStateBin, credentialIdentityNow, judgeCenterCredentialAtBoot } from "../center-credential.js";
|
|
17
|
+
import { createCenterConfigTier } from "../center-config-tier.js";
|
|
17
18
|
import { buildCenterCredentialHealthView, createCenterCredentialRenewer } from "../center-credential-renewer.js";
|
|
18
19
|
import { centerManagedConfigKeys } from "../web-admin-client/apply-effective.js";
|
|
19
20
|
import { createConfigProvider, raceBootFetch, serviceConfigSourceKind, BOOT_FETCH_DEFERRED } from "../config-provider.js";
|
|
21
|
+
import { ConfigDirUntrustedError } from "../config-dir-trust.js";
|
|
20
22
|
import { createKeyResolver } from "../key-resolver.js";
|
|
21
23
|
import { buildSealedKeyPublicFace, ensureSealedKeyStore, reportExecutionPublicKey } from "../sealed-key.js";
|
|
22
|
-
import { applyEffective, applyCenterReadFace, buildReadFaceBaseline, buildReadFaceSwapCandidate, restoreReadFaceBaseline, mutateInPlace, logEffectiveDiff, applySkillsManifest, resolveMcpServers, resolveA2aPeers, restartReasons, modelPlaneChanged, withModelPlaneOf, fullyLandedForLkg, fetchPromptArtifact } from "../web-admin-client/facade.js";
|
|
24
|
+
import { applyEffective, applyCenterReadFace, buildReadFaceBaseline, buildReadFaceSwapCandidate, restoreReadFaceBaseline, mutateInPlace, logEffectiveDiff, applySkillsManifest, resolveMcpServers, resolveA2aPeers, restartReasons, modelPlaneChanged, withModelPlaneOf, fullyLandedForLkg, NO_CENTER_EFFECTIVE, isNoCenterEffective, fetchPromptArtifact } from "../web-admin-client/facade.js";
|
|
23
25
|
import { buildConfigHandoff, buildRestartSignal, configHandoffMissing } from "../fleet/engine-signal.js";
|
|
24
26
|
import { createMcpRevocationLedger, enabledMcpEntries } from "../web-admin-client/mcp-revocation.js";
|
|
25
|
-
import { buildUnreadConfigFileFields } from "../web-admin-client/read-warnings.js";
|
|
27
|
+
import { buildUnreadConfigFileFields, buildUnreadConfigKeyFields } from "../web-admin-client/read-warnings.js";
|
|
26
28
|
import { CONFIG_DOMAIN_INVALID_NOTE, buildCandidateRejectedFields, candidateRejectionOf, judgeConfigCandidate } from "../web-admin-client/candidate-gate.js";
|
|
27
29
|
import { SHA256_HEX_RE } from "../digest-form.js";
|
|
28
30
|
import { BOOT_REJUDGE_OF_REFUSED_GROUP, createConfigApplyLedger, modelPlaneCommitted, refusedGroups } from "../web-admin-client/apply-ledger.js";
|
|
29
|
-
import { buildDeploymentPostureSeats } from "./runner-deps.js";
|
|
31
|
+
import { announceReadDenyRows, buildDeploymentPostureSeats } from "./runner-deps.js";
|
|
32
|
+
import { echoCallerText } from "../caller-text-echo.js";
|
|
30
33
|
function lkgReadNote(scope) {
|
|
31
34
|
switch (scope) {
|
|
32
35
|
case "whole":
|
|
@@ -87,6 +90,21 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
87
90
|
? createCenterCredentialRenewer({ source: cc.credential, centerUrl: cc.baseUrl, leadMs: config.centerCredentialRenewLeadMs, logger })
|
|
88
91
|
: undefined;
|
|
89
92
|
const currentIdentity = () => (cc === undefined ? undefined : credentialIdentityNow(cc.credential));
|
|
93
|
+
const tier = createCenterConfigTier();
|
|
94
|
+
const announceTier = (n) => {
|
|
95
|
+
switch (n.code) {
|
|
96
|
+
case "center_identity_demoted":
|
|
97
|
+
logger.warn(n.code, { at: n.at, message: n.message, ...(n.retained !== undefined ? { retained: n.retained } : {}), note: "the credential identity changed: the previous account's center configuration is dropped (every center-supplied hot face is back on its env base, the center prompt layer is withdrawn, the Runners run the env model table) and a pull for the new identity is under way; skills / MCP / A2A / scenarios are baked at boot and stay the previous account's until a restart (see /health.restart)" });
|
|
98
|
+
return;
|
|
99
|
+
case "center_identity_landed":
|
|
100
|
+
logger.info(n.code, { at: n.at, message: n.message });
|
|
101
|
+
return;
|
|
102
|
+
default: {
|
|
103
|
+
const unknownCode = n.code;
|
|
104
|
+
throw new Error(`announceTier: unknown notice code ${JSON.stringify(unknownCode)}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
90
108
|
const candidateIdentity = new WeakMap();
|
|
91
109
|
const candidateIdentityOf = (eff) => candidateIdentity.get(eff);
|
|
92
110
|
const validatorIdentity = new Map();
|
|
@@ -134,6 +152,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
134
152
|
...(config.configProvider ? { provider: config.configProvider } : {}),
|
|
135
153
|
...(cc ? { webAdmin: { baseUrl: cc.baseUrl, credential: cc.credential, worker: cc.worker, dryRun: cc.dryRun } } : {}),
|
|
136
154
|
localDir: localRoot,
|
|
155
|
+
localOwnerUid: config.configLocalOwnerUid,
|
|
137
156
|
...(config.configLkgEnabled ? { skillBodyCacheDir: defaultSkillCacheDir(config) } : {}),
|
|
138
157
|
})
|
|
139
158
|
: undefined;
|
|
@@ -143,6 +162,8 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
143
162
|
const warnReadNotices = (r, phase) => {
|
|
144
163
|
for (const f of r.unreadFiles ?? [])
|
|
145
164
|
logger.warn("config_unread_file", buildUnreadConfigFileFields(f, localDirField.dir));
|
|
165
|
+
for (const k of r.unreadKeys ?? [])
|
|
166
|
+
logger.warn("config_unread_key", buildUnreadConfigKeyFields(k, localDirField.dir));
|
|
146
167
|
for (const d of r.droppedEntries ?? []) {
|
|
147
168
|
logger.warn("config_entry_dropped", {
|
|
148
169
|
domain: d.domain,
|
|
@@ -202,15 +223,15 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
202
223
|
applyLedger.recordApply(rep);
|
|
203
224
|
publishModelRefusals(buildModelRefusalsSignal(rep.modelRefusals));
|
|
204
225
|
};
|
|
205
|
-
let
|
|
206
|
-
let
|
|
226
|
+
let adoptedArtifact;
|
|
227
|
+
let pendingCenterTarget;
|
|
207
228
|
const retryPendingCatalog = async (phase) => {
|
|
208
|
-
if (!
|
|
229
|
+
if (!pendingCenterTarget)
|
|
209
230
|
return;
|
|
210
|
-
const { target } =
|
|
211
|
-
if (await
|
|
212
|
-
|
|
213
|
-
|
|
231
|
+
const { target } = pendingCenterTarget;
|
|
232
|
+
if (await applyCenterArtifact(catalogSource, target, adoptedArtifact, logger, phase)) {
|
|
233
|
+
adoptedArtifact = target;
|
|
234
|
+
pendingCenterTarget = undefined;
|
|
214
235
|
}
|
|
215
236
|
};
|
|
216
237
|
const promptEpochDir = join(config.localDataRoot ?? localRoot, "prompt-epoch");
|
|
@@ -253,6 +274,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
253
274
|
},
|
|
254
275
|
});
|
|
255
276
|
const withByDigestBackfill = (inner) => cc?.baseUrl ? withPromptArtifactBackfill(inner, (d) => fetchPromptArtifact(cc, d), logger) : inner;
|
|
277
|
+
const sourceOnError = centerSourceOnError(logger);
|
|
256
278
|
const promptSource = (() => {
|
|
257
279
|
try {
|
|
258
280
|
const bootBin = promptStateBin();
|
|
@@ -261,15 +283,15 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
261
283
|
return new CenterPromptSource({
|
|
262
284
|
store: withByDigestBackfill(new FilePromptArtifactStore(promptEpochDir)),
|
|
263
285
|
stateStore: recordingStateStore(binnedPromptStateStore(fileStateStoreFor)),
|
|
264
|
-
|
|
286
|
+
onError: sourceOnError,
|
|
265
287
|
});
|
|
266
288
|
}
|
|
267
289
|
catch (e) {
|
|
268
|
-
logger.warn("center_prompts_store_unwritable", { dir: promptEpochDir, err: String(e), note: "file-backed prompt-epoch store unavailable — memory fallback (
|
|
290
|
+
logger.warn("center_prompts_store_unwritable", { dir: promptEpochDir, err: String(e), note: "file-backed prompt-epoch store unavailable — memory fallback (the center candidate is not restart-durable); built-ins unaffected" });
|
|
269
291
|
return new CenterPromptSource({
|
|
270
292
|
store: withByDigestBackfill(new MemoryPromptArtifactStore()),
|
|
271
293
|
stateStore: recordingStateStore(binnedPromptStateStore(storePerBin(() => new MemoryPromptSourceStateStore()))),
|
|
272
|
-
|
|
294
|
+
onError: sourceOnError,
|
|
273
295
|
});
|
|
274
296
|
}
|
|
275
297
|
})();
|
|
@@ -281,14 +303,14 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
281
303
|
};
|
|
282
304
|
const rebasePromptState = async (identity, phase) => {
|
|
283
305
|
promptStateIdentity = identity;
|
|
284
|
-
|
|
285
|
-
|
|
306
|
+
adoptedArtifact = undefined;
|
|
307
|
+
pendingCenterTarget = undefined;
|
|
286
308
|
promptPersisted = undefined;
|
|
287
309
|
try {
|
|
288
310
|
await promptSource.restore();
|
|
289
311
|
}
|
|
290
312
|
catch (e) {
|
|
291
|
-
logger.warn("center_prompts_catalog_restore_failed", { phase, err: String(e), note: "the persisted
|
|
313
|
+
logger.warn("center_prompts_catalog_restore_failed", { phase, err: String(e), note: "the persisted center-layer state for this credential identity could not be loaded — the center candidate is absent until the next adopt; built-ins unaffected" });
|
|
292
314
|
}
|
|
293
315
|
if (cc !== undefined && identity !== undefined && currentIdentity() !== identity) {
|
|
294
316
|
promptStateIdentity = undefined;
|
|
@@ -299,41 +321,42 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
299
321
|
if (configProvider && !cc?.dryRun)
|
|
300
322
|
await rebasePromptState(promptStateIdentity, "boot");
|
|
301
323
|
const adoptCenterPrompts = async (eff, prompts, phase) => {
|
|
324
|
+
if (isNoCenterEffective(eff)) {
|
|
325
|
+
await rebasePromptState(undefined, phase);
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
302
328
|
const adoptedIdentity = candidateIdentityOf(eff);
|
|
303
329
|
if (adoptedIdentity !== undefined && adoptedIdentity !== promptStateIdentity) {
|
|
304
330
|
await rebasePromptState(adoptedIdentity, phase);
|
|
305
331
|
}
|
|
306
332
|
if (prompts === undefined) {
|
|
307
|
-
if (
|
|
308
|
-
logger.info("center_prompts_cleared", { phase, note: "effective carries no prompts key (publish gate off) — built-in
|
|
309
|
-
const cleared = await
|
|
333
|
+
if (adoptedArtifact)
|
|
334
|
+
logger.info("center_prompts_cleared", { phase, note: "effective carries no prompts key (publish gate off / nothing published) — the built-in prompt serves new tasks" });
|
|
335
|
+
const cleared = await applyCenterArtifact(catalogSource, undefined, adoptedArtifact, logger, phase);
|
|
310
336
|
if (cleared) {
|
|
311
|
-
|
|
312
|
-
|
|
337
|
+
adoptedArtifact = undefined;
|
|
338
|
+
pendingCenterTarget = undefined;
|
|
313
339
|
}
|
|
314
340
|
else {
|
|
315
|
-
|
|
341
|
+
pendingCenterTarget = { target: undefined };
|
|
316
342
|
}
|
|
317
343
|
return;
|
|
318
344
|
}
|
|
319
|
-
if (
|
|
345
|
+
if (adoptedArtifact?.artifactDigest !== prompts.artifactDigest) {
|
|
320
346
|
logger.info("center_prompts_adopted", {
|
|
321
347
|
phase,
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
: {}),
|
|
326
|
-
...(prompts.catalog ? { artifactDigest: prompts.catalog.artifact.artifactDigest, catalogDigest: prompts.catalog.artifact.payload.catalogDigest, sourceRevision: prompts.catalog.sourceRevision } : {}),
|
|
327
|
-
note: "new tasks assemble the new pack (epoch re-pins at the next task boundary); in-flight sessions stay pinned",
|
|
348
|
+
artifactDigest: prompts.artifactDigest,
|
|
349
|
+
sourceRevision: prompts.sourceRevision,
|
|
350
|
+
note: "new sessions adopt this center layer (a session pins it at its first run); in-flight sessions stay pinned",
|
|
328
351
|
});
|
|
329
352
|
}
|
|
330
|
-
const transitioned = await
|
|
353
|
+
const transitioned = await applyCenterArtifact(catalogSource, prompts, adoptedArtifact, logger, phase);
|
|
331
354
|
if (transitioned) {
|
|
332
|
-
|
|
333
|
-
|
|
355
|
+
adoptedArtifact = prompts;
|
|
356
|
+
pendingCenterTarget = undefined;
|
|
334
357
|
}
|
|
335
358
|
else {
|
|
336
|
-
|
|
359
|
+
pendingCenterTarget = { target: prompts };
|
|
337
360
|
}
|
|
338
361
|
};
|
|
339
362
|
let bootConfigPending;
|
|
@@ -349,14 +372,20 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
349
372
|
return ledger;
|
|
350
373
|
};
|
|
351
374
|
const noteHandoff = (next) => {
|
|
352
|
-
const applied = next.applied ?? handoff.applied;
|
|
375
|
+
const applied = next.noneApplied === true ? undefined : (next.applied ?? handoff.applied);
|
|
353
376
|
const durable = next.durable ?? handoff.durable;
|
|
354
377
|
handoff = { ...(applied !== undefined ? { applied } : {}), ...(durable !== undefined ? { durable } : {}) };
|
|
355
378
|
latchHandoff();
|
|
356
379
|
};
|
|
357
|
-
const markApplied = (gen,
|
|
358
|
-
applyLedger.applied(gen, version);
|
|
359
|
-
|
|
380
|
+
const markApplied = (gen, eff) => {
|
|
381
|
+
applyLedger.applied(gen, eff.version);
|
|
382
|
+
if (isNoCenterEffective(eff))
|
|
383
|
+
noteHandoff({ noneApplied: true });
|
|
384
|
+
else
|
|
385
|
+
noteHandoff({ applied: eff.version });
|
|
386
|
+
const landed = tier.committed(candidateIdentityOf(eff));
|
|
387
|
+
if (landed !== undefined)
|
|
388
|
+
announceTier(landed);
|
|
360
389
|
};
|
|
361
390
|
let lkgBooted = false;
|
|
362
391
|
let bootLkgCandidate;
|
|
@@ -481,7 +510,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
481
510
|
const lkgIdentity = candidateIdentityOf(lkgR.effective);
|
|
482
511
|
if (lkgSurvivesRestart && lkgIdentity !== undefined)
|
|
483
512
|
noteHandoff({ durable: { version: lkgR.effective.version, identity: lkgIdentity } });
|
|
484
|
-
markApplied(lkgGen, lkgR.effective
|
|
513
|
+
markApplied(lkgGen, lkgR.effective);
|
|
485
514
|
await adoptCenterPrompts(lkgR.effective, lkgR.prompts, "boot-lkg");
|
|
486
515
|
const lkgPlane = modelPlaneCommitted(lkgReport);
|
|
487
516
|
if (lkgPlane)
|
|
@@ -586,7 +615,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
586
615
|
recordApply(rep);
|
|
587
616
|
},
|
|
588
617
|
});
|
|
589
|
-
markApplied(bootGen, r.effective
|
|
618
|
+
markApplied(bootGen, r.effective);
|
|
590
619
|
const bootClean = fullyLandedForLkg(r, bootReport);
|
|
591
620
|
if (bootClean)
|
|
592
621
|
ccEtag = r.etag;
|
|
@@ -623,11 +652,13 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
623
652
|
}
|
|
624
653
|
}
|
|
625
654
|
catch (err) {
|
|
655
|
+
if (err instanceof ConfigDirUntrustedError)
|
|
656
|
+
throw err;
|
|
626
657
|
if (bootApplyPhase)
|
|
627
658
|
logger.warn("config_apply_refused", { source: configProvider.kind, err: String(err), note: "the pulled candidate failed to apply at boot — falling back to the LKG / env; this is not a reachability failure" });
|
|
628
659
|
else
|
|
629
660
|
logger.warn("config_source_unreachable_using_env", { source: configProvider.kind, err: String(err) });
|
|
630
|
-
await bootFallBackWhole(`${bootApplyPhase ? "boot apply refused" : "boot fetch failed"}: ${String(err)
|
|
661
|
+
await bootFallBackWhole(`${bootApplyPhase ? "boot apply refused" : "boot fetch failed"}: ${echoCallerText(String(err), { maxChars: 120 })}`);
|
|
631
662
|
}
|
|
632
663
|
if (!dryRun && cc !== undefined && currentIdentity() !== promptStateIdentity)
|
|
633
664
|
await rebasePromptState(currentIdentity(), "boot-end");
|
|
@@ -666,8 +697,11 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
666
697
|
restoreReadFaceBaseline(config, before);
|
|
667
698
|
throw err;
|
|
668
699
|
}
|
|
700
|
+
if (changedSeats.includes("readDenyPatterns"))
|
|
701
|
+
announceReadDenyRows(config, logger);
|
|
669
702
|
};
|
|
670
703
|
let ccTimer;
|
|
704
|
+
let unwatchCredential;
|
|
671
705
|
return {
|
|
672
706
|
providerKind: configProvider?.kind,
|
|
673
707
|
sealedKeyPublic: sealedKeys === undefined ? undefined : buildSealedKeyPublicFace(sealedKeys),
|
|
@@ -678,7 +712,6 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
678
712
|
},
|
|
679
713
|
mcpRevocationState: () => (configProvider ? mcpRevocations.view() : undefined),
|
|
680
714
|
getKeyResolver: () => keyResolver,
|
|
681
|
-
getCenterPrompts: () => centerPrompts,
|
|
682
715
|
modelReady: () => modelReadyState.ready,
|
|
683
716
|
onSelfReportChange: (listener) => {
|
|
684
717
|
selfReportListeners.push(listener);
|
|
@@ -707,6 +740,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
707
740
|
const pluginOut = await applyCenterPlugins(skills, effective, {
|
|
708
741
|
cacheRoot: join(config.localDataRoot ?? join(homedir(), ".ai-agent"), "plugin-cache"),
|
|
709
742
|
allowHosts: config.pluginsAllowHosts,
|
|
743
|
+
toolsShareThisFilesystem: toolsRunOnThisHost(config),
|
|
710
744
|
logger,
|
|
711
745
|
}).catch((err) => {
|
|
712
746
|
logger.warn("center_plugins_apply_failed", { error: err instanceof Error ? err.message : String(err) });
|
|
@@ -839,6 +873,69 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
839
873
|
if (configProvider) {
|
|
840
874
|
const ccRef = config.webAdmin;
|
|
841
875
|
let refreshInFlight = false;
|
|
876
|
+
let followUp = false;
|
|
877
|
+
let ownRead = false;
|
|
878
|
+
const commitHot = async (c) => {
|
|
879
|
+
const { eff, prompts, gen, phase } = c;
|
|
880
|
+
const noCenter = isNoCenterEffective(eff);
|
|
881
|
+
const planeChanged = noCenter || modelPlaneChanged(appliedPlaneEff, eff);
|
|
882
|
+
let report;
|
|
883
|
+
const committed = applyEffective(config, eff, logger, {
|
|
884
|
+
leg: "hot",
|
|
885
|
+
checkpointStorePresent,
|
|
886
|
+
sealedKeys,
|
|
887
|
+
generation: gen,
|
|
888
|
+
report: (rep) => {
|
|
889
|
+
report = rep;
|
|
890
|
+
recordApply(rep);
|
|
891
|
+
},
|
|
892
|
+
...(planeChanged ? { swapPlane: swapRunnerDeps } : {}),
|
|
893
|
+
});
|
|
894
|
+
if (!committed)
|
|
895
|
+
return { committed: false, report, planeCommitted: false };
|
|
896
|
+
mutateInPlace(pricing, buildPricing(config.models));
|
|
897
|
+
keyResolver = createKeyResolver(config.modelApiKeyEnv, process.env, config.modelApiKeys);
|
|
898
|
+
limitSync?.sync();
|
|
899
|
+
ceilingVerdict?.judge();
|
|
900
|
+
if (phase !== "boot-deferred")
|
|
901
|
+
mcpRevocations.applyEnabledEntries(enabledMcpEntries(eff.mcp));
|
|
902
|
+
applyLiveReadFace(eff, swapRunnerDeps, phase);
|
|
903
|
+
markApplied(gen, eff);
|
|
904
|
+
const planeCommitted = modelPlaneCommitted(report);
|
|
905
|
+
if (planeCommitted)
|
|
906
|
+
appliedPlaneEff = noCenter ? undefined : eff;
|
|
907
|
+
planeDeferredNoHandoff = undefined;
|
|
908
|
+
await adoptCenterPrompts(eff, prompts, phase);
|
|
909
|
+
if (planeCommitted)
|
|
910
|
+
markRosterLanded(eff);
|
|
911
|
+
if (tier.drifted(currentIdentity()))
|
|
912
|
+
requestTick();
|
|
913
|
+
return { committed: true, report, planeCommitted };
|
|
914
|
+
};
|
|
915
|
+
const demoteToNoCenter = async (awaiting) => {
|
|
916
|
+
const gen = reserveArrivalGeneration();
|
|
917
|
+
applyLedger.seenTarget(gen, NO_CENTER_EFFECTIVE.version);
|
|
918
|
+
const hot = await commitHot({ eff: NO_CENTER_EFFECTIVE, prompts: undefined, gen, phase: "no-center" });
|
|
919
|
+
if (!hot.committed) {
|
|
920
|
+
throw new Error("the no-center tier was refused (the Runners did not accept the env model table) — the previous account's center configuration is still in force; retried next tick");
|
|
921
|
+
}
|
|
922
|
+
if (hot.report !== undefined && !hot.report.fullyApplied) {
|
|
923
|
+
logger.warn("center_identity_demotion_partial", { groups: refusedGroups(hot.report).map((g) => g.group), note: "a group of the no-center tier was refused — that group keeps its previous values (loud; the env base for that group could not be applied)" });
|
|
924
|
+
}
|
|
925
|
+
noteCandidateVerdict(gen, undefined);
|
|
926
|
+
latestEffective = undefined;
|
|
927
|
+
ccEtag = undefined;
|
|
928
|
+
announceTier(tier.demote(awaiting, hot.report !== undefined ? refusedGroups(hot.report).map((g) => g.group) : []));
|
|
929
|
+
};
|
|
930
|
+
const reconcileCenterIdentity = async (identity) => {
|
|
931
|
+
if (identity === undefined || !tier.drifted(identity))
|
|
932
|
+
return;
|
|
933
|
+
if (tier.isDemoted()) {
|
|
934
|
+
tier.retarget(identity);
|
|
935
|
+
return;
|
|
936
|
+
}
|
|
937
|
+
await demoteToNoCenter(identity);
|
|
938
|
+
};
|
|
842
939
|
const refreshTick = async (arrival) => {
|
|
843
940
|
if (refreshInFlight)
|
|
844
941
|
return "ok";
|
|
@@ -850,6 +947,15 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
850
947
|
const refreshTickRan = async (arrival) => {
|
|
851
948
|
refreshInFlight = true;
|
|
852
949
|
try {
|
|
950
|
+
let ownIdentity;
|
|
951
|
+
ownRead = true;
|
|
952
|
+
try {
|
|
953
|
+
ownIdentity = currentIdentity();
|
|
954
|
+
}
|
|
955
|
+
finally {
|
|
956
|
+
ownRead = false;
|
|
957
|
+
}
|
|
958
|
+
await reconcileCenterIdentity(ownIdentity);
|
|
853
959
|
await retryPendingCatalog("refresh-retry");
|
|
854
960
|
if (planeDeferredNoHandoff) {
|
|
855
961
|
metrics.inc("models_tiers_plane_deferred_stuck_total");
|
|
@@ -875,6 +981,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
875
981
|
}
|
|
876
982
|
}
|
|
877
983
|
if (r) {
|
|
984
|
+
await reconcileCenterIdentity(candidateIdentityOf(r.effective));
|
|
878
985
|
const tickGen = arrival !== undefined ? useArrivalGeneration(r.effective.version, arrival.ordinal) : generationOf(r.effective.version);
|
|
879
986
|
applyLedger.seenTarget(tickGen, r.effective.version);
|
|
880
987
|
const verdict = judgeConfigCandidate(r);
|
|
@@ -889,35 +996,10 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
889
996
|
ccEtag = r.etag;
|
|
890
997
|
}
|
|
891
998
|
else {
|
|
892
|
-
const
|
|
893
|
-
|
|
894
|
-
const committed = applyEffective(config, r.effective, logger, {
|
|
895
|
-
leg: "hot",
|
|
896
|
-
checkpointStorePresent,
|
|
897
|
-
sealedKeys,
|
|
898
|
-
generation: tickGen,
|
|
899
|
-
report: (rep) => {
|
|
900
|
-
applyReport = rep;
|
|
901
|
-
recordApply(rep);
|
|
902
|
-
},
|
|
903
|
-
...(planeChanged ? { swapPlane: swapRunnerDeps } : {}),
|
|
904
|
-
});
|
|
905
|
-
if (!committed)
|
|
999
|
+
const hot = await commitHot({ eff: r.effective, prompts: verdict.prompts, gen: tickGen, phase: "refresh" });
|
|
1000
|
+
if (!hot.committed)
|
|
906
1001
|
return "ok";
|
|
907
|
-
|
|
908
|
-
keyResolver = createKeyResolver(config.modelApiKeyEnv, process.env, config.modelApiKeys);
|
|
909
|
-
limitSync?.sync();
|
|
910
|
-
ceilingVerdict?.judge();
|
|
911
|
-
mcpRevocations.applyEnabledEntries(enabledMcpEntries(r.effective.mcp));
|
|
912
|
-
applyLiveReadFace(r.effective, swapRunnerDeps, "refresh");
|
|
913
|
-
markApplied(tickGen, r.effective.version);
|
|
914
|
-
const tickPlane = modelPlaneCommitted(applyReport);
|
|
915
|
-
if (tickPlane)
|
|
916
|
-
appliedPlaneEff = r.effective;
|
|
917
|
-
planeDeferredNoHandoff = undefined;
|
|
918
|
-
await adoptCenterPrompts(r.effective, verdict.prompts, "refresh");
|
|
919
|
-
if (tickPlane)
|
|
920
|
-
markRosterLanded(r.effective);
|
|
1002
|
+
const applyReport = hot.report;
|
|
921
1003
|
if (!fullyLandedForLkg(r, applyReport)) {
|
|
922
1004
|
ccEtag = undefined;
|
|
923
1005
|
const refused = applyReport ? refusedGroups(applyReport) : [];
|
|
@@ -962,13 +1044,39 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
962
1044
|
return inFlight;
|
|
963
1045
|
const p = refreshTick(arrival).finally(() => {
|
|
964
1046
|
inFlight = undefined;
|
|
1047
|
+
afterLane();
|
|
965
1048
|
});
|
|
966
1049
|
inFlight = p;
|
|
967
1050
|
return p;
|
|
968
1051
|
};
|
|
1052
|
+
const requestTick = () => {
|
|
1053
|
+
if (ccTimer === undefined || ownRead)
|
|
1054
|
+
return;
|
|
1055
|
+
if (inFlight !== undefined || refreshInFlight) {
|
|
1056
|
+
followUp = true;
|
|
1057
|
+
return;
|
|
1058
|
+
}
|
|
1059
|
+
queueMicrotask(() => void runTick());
|
|
1060
|
+
};
|
|
1061
|
+
const afterLane = () => {
|
|
1062
|
+
if (!followUp)
|
|
1063
|
+
return;
|
|
1064
|
+
followUp = false;
|
|
1065
|
+
if (tier.drifted(currentIdentity()))
|
|
1066
|
+
requestTick();
|
|
1067
|
+
};
|
|
1068
|
+
unwatchCredential =
|
|
1069
|
+
ccRef !== undefined && !ccRef.dryRun && configProvider.kind === "remote"
|
|
1070
|
+
? ccRef.credential.onRead((read) => {
|
|
1071
|
+
if (tier.drifted(read.identity))
|
|
1072
|
+
requestTick();
|
|
1073
|
+
})
|
|
1074
|
+
: undefined;
|
|
969
1075
|
manualRefresh = runTick;
|
|
970
1076
|
ccTimer = setInterval(() => void runTick(), 60_000);
|
|
971
1077
|
ccTimer.unref?.();
|
|
1078
|
+
if (tier.drifted(currentIdentity()))
|
|
1079
|
+
requestTick();
|
|
972
1080
|
const deferredBootApply = async (r, arrivalGen) => {
|
|
973
1081
|
if (!r)
|
|
974
1082
|
return;
|
|
@@ -985,6 +1093,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
985
1093
|
}
|
|
986
1094
|
finally {
|
|
987
1095
|
refreshInFlight = false;
|
|
1096
|
+
afterLane();
|
|
988
1097
|
}
|
|
989
1098
|
};
|
|
990
1099
|
const deferredBootApplyInner = async (r, lateGen) => {
|
|
@@ -1001,34 +1110,10 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
1001
1110
|
ccEtag = r.etag;
|
|
1002
1111
|
return;
|
|
1003
1112
|
}
|
|
1004
|
-
const
|
|
1005
|
-
|
|
1006
|
-
const committedLate = applyEffective(config, r.effective, logger, {
|
|
1007
|
-
leg: "hot",
|
|
1008
|
-
checkpointStorePresent,
|
|
1009
|
-
sealedKeys,
|
|
1010
|
-
generation: lateGen,
|
|
1011
|
-
report: (rep) => {
|
|
1012
|
-
applyReportLate = rep;
|
|
1013
|
-
recordApply(rep);
|
|
1014
|
-
},
|
|
1015
|
-
...(planeChangedLate ? { swapPlane: swapRunnerDeps } : {}),
|
|
1016
|
-
});
|
|
1017
|
-
if (!committedLate)
|
|
1113
|
+
const hotLate = await commitHot({ eff: r.effective, prompts: lateVerdict.prompts, gen: lateGen, phase: "boot-deferred" });
|
|
1114
|
+
if (!hotLate.committed)
|
|
1018
1115
|
return;
|
|
1019
|
-
|
|
1020
|
-
keyResolver = createKeyResolver(config.modelApiKeyEnv, process.env, config.modelApiKeys);
|
|
1021
|
-
limitSync?.sync();
|
|
1022
|
-
ceilingVerdict?.judge();
|
|
1023
|
-
applyLiveReadFace(r.effective, swapRunnerDeps, "boot-deferred");
|
|
1024
|
-
markApplied(lateGen, r.effective.version);
|
|
1025
|
-
const latePlane = modelPlaneCommitted(applyReportLate);
|
|
1026
|
-
if (latePlane)
|
|
1027
|
-
appliedPlaneEff = r.effective;
|
|
1028
|
-
planeDeferredNoHandoff = undefined;
|
|
1029
|
-
await adoptCenterPrompts(r.effective, lateVerdict.prompts, "boot-deferred");
|
|
1030
|
-
if (latePlane)
|
|
1031
|
-
markRosterLanded(r.effective);
|
|
1116
|
+
const applyReportLate = hotLate.report;
|
|
1032
1117
|
if (!fullyLandedForLkg(r, applyReportLate)) {
|
|
1033
1118
|
ccEtag = undefined;
|
|
1034
1119
|
const refusedLate = applyReportLate ? refusedGroups(applyReportLate) : [];
|
|
@@ -1069,10 +1154,13 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
1069
1154
|
ccTimer = undefined;
|
|
1070
1155
|
}
|
|
1071
1156
|
credentialRenewer?.stop();
|
|
1157
|
+
unwatchCredential?.();
|
|
1158
|
+
unwatchCredential = undefined;
|
|
1072
1159
|
},
|
|
1073
1160
|
centerCredentialState() {
|
|
1074
1161
|
return cc === undefined ? undefined : buildCenterCredentialHealthView(cc.credential.health(), credentialRenewer);
|
|
1075
1162
|
},
|
|
1163
|
+
centerIdentityNoticeState: () => tier.notice(),
|
|
1076
1164
|
};
|
|
1077
1165
|
}
|
|
1078
1166
|
//# sourceMappingURL=web-admin.js.map
|
|
@@ -15,6 +15,7 @@ import { type WorkflowRun, type WorkflowRunStore } from "@sema-agent/core";
|
|
|
15
15
|
import type { ServiceConfig } from "../config.js";
|
|
16
16
|
import { FleetEventBus } from "../fleet/fleet-bus.js";
|
|
17
17
|
import { type WorkflowAgentSessionIndex } from "../orchestration/workflow-agent-session-index.js";
|
|
18
|
+
import type { WorkflowParkDecisionStore } from "../orchestration/workflow-park-decision.js";
|
|
18
19
|
import type { Logger } from "../observability/logger.js";
|
|
19
20
|
import type { Metrics } from "../observability/metrics.js";
|
|
20
21
|
import { type WorkflowCompletionInbox } from "../orchestration/workflow-completion-inbox.js";
|
|
@@ -49,5 +50,6 @@ export declare function createWorkflowOrchestration(ctx: WorkflowOrchestrationCt
|
|
|
49
50
|
publishTerminalFleetRow?: (id: string, run: WorkflowRun) => void;
|
|
50
51
|
};
|
|
51
52
|
workflowAgentSessionIndex: WorkflowAgentSessionIndex | undefined;
|
|
53
|
+
workflowParkDecisions: WorkflowParkDecisionStore | undefined;
|
|
52
54
|
};
|
|
53
55
|
//# sourceMappingURL=workflow-orchestration.d.ts.map
|
|
@@ -66,6 +66,7 @@ export function createWorkflowOrchestration(ctx) {
|
|
|
66
66
|
? backend.workflowAgentSessionIndex()
|
|
67
67
|
: new LocalWorkflowAgentSessionIndex(join(config.localDataRoot ?? localRoot, "workflows"), undefined))
|
|
68
68
|
: undefined;
|
|
69
|
+
const workflowParkDecisions = config.selfOrchestrationEnabled && backend !== undefined && (sqlWorkflowRunStore !== undefined || backend.kind === "local") ? backend.workflowParkDecisions?.() : undefined;
|
|
69
70
|
const workflowRunStore = baseWorkflowRunStore
|
|
70
71
|
? new JournalingWorkflowRunStore(baseWorkflowRunStore, workflowNotifyGate, fleetBus, workflowAgentSessionIndex)
|
|
71
72
|
: undefined;
|
|
@@ -82,7 +83,7 @@ export function createWorkflowOrchestration(ctx) {
|
|
|
82
83
|
return {
|
|
83
84
|
sqlWorkflowRunStore, workflowNotifyJournal, workflowCompletionInbox, deliverWorkflowCompletion,
|
|
84
85
|
workflowNotifyGate, fleetBus, workflowRunStore, workflowJournalStore, outcomeSink,
|
|
85
|
-
workflowAgentRegistry, subagentSteerRegistry, workflowRecoverOpts, workflowAgentSessionIndex,
|
|
86
|
+
workflowAgentRegistry, subagentSteerRegistry, workflowRecoverOpts, workflowAgentSessionIndex, workflowParkDecisions,
|
|
86
87
|
};
|
|
87
88
|
}
|
|
88
89
|
//# sourceMappingURL=workflow-orchestration.js.map
|