@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
|
@@ -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;
|
|
@@ -79,13 +80,7 @@ export declare function createSessionFaces(ctx: SessionFacesCtx): {
|
|
|
79
80
|
modelId: string;
|
|
80
81
|
} | null;
|
|
81
82
|
messages: unknown[];
|
|
82
|
-
promptEpoch?:
|
|
83
|
-
epoch: number;
|
|
84
|
-
artifactDigest: string;
|
|
85
|
-
packId: string;
|
|
86
|
-
assemblyApi: number;
|
|
87
|
-
activatedBy: "session_start" | "compaction" | "legacy_migration";
|
|
88
|
-
};
|
|
83
|
+
promptEpoch?: import("@sema-agent/core").StoredPromptEpoch;
|
|
89
84
|
} | undefined>) | undefined;
|
|
90
85
|
sessionWatchRegistry: SessionWatchRegistry | undefined;
|
|
91
86
|
purgeSession: ((sessionId: string, owner: string | null) => Promise<{
|
|
@@ -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);
|
|
@@ -19,7 +19,7 @@ export declare function runStage03(ctx: Awaited<ReturnType<typeof runStage02>>):
|
|
|
19
19
|
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
20
20
|
sessionCaptureRecords: import("../index.js").SessionCaptureRecordSource | undefined;
|
|
21
21
|
sessionStore: import("@sema-agent/core").SessionStore;
|
|
22
|
-
|
|
22
|
+
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
23
23
|
storePosture: import("../store-posture.js").StorePosture;
|
|
24
24
|
taskAttachmentStore: import("../plugins/task-attachment-store.js").TaskAttachmentStore | undefined;
|
|
25
25
|
taskListLane: import("./task-list-lane.js").TaskListLane;
|
|
@@ -2,10 +2,10 @@ import { uuidv7 } from "@sema-agent/core";
|
|
|
2
2
|
import { openStores } from "./stores.js";
|
|
3
3
|
export async function runStage03(ctx) {
|
|
4
4
|
const { config, localRoot, logger, metrics } = ctx;
|
|
5
|
-
const { backend, storePosture, memoryEngine, engineDataRoot, memorySyncCursors, rosterStore, backgroundAgentStore, taskAttachmentStore, mailboxStore, mailboxRecipientLifecycle, memoryExportBackend, memorySyncRunner, sessionStore, breakerState, usageWindowStore, memoryPosture, taskListLane,
|
|
5
|
+
const { backend, storePosture, memoryEngine, engineDataRoot, memorySyncCursors, rosterStore, backgroundAgentStore, taskAttachmentStore, mailboxStore, mailboxRecipientLifecycle, memoryExportBackend, memorySyncRunner, sessionStore, breakerState, usageWindowStore, memoryPosture, taskListLane, sqlEngine, } = await openStores({ config, logger, metrics, localRoot });
|
|
6
6
|
const instanceId = uuidv7();
|
|
7
7
|
const sessionCaptureRecords = backend?.sessionCaptureRecords();
|
|
8
8
|
const sessionCaptureRecordStore = sessionCaptureRecords?.();
|
|
9
|
-
return { ...ctx, backend, backgroundAgentStore, breakerState, engineDataRoot, instanceId, mailboxRecipientLifecycle, mailboxStore, memoryEngine, memoryExportBackend, memoryPosture, memorySyncCursors, memorySyncRunner, rosterStore, sessionCaptureRecordStore, sessionCaptureRecords, sessionStore,
|
|
9
|
+
return { ...ctx, backend, backgroundAgentStore, breakerState, engineDataRoot, instanceId, mailboxRecipientLifecycle, mailboxStore, memoryEngine, memoryExportBackend, memoryPosture, memorySyncCursors, memorySyncRunner, rosterStore, sessionCaptureRecordStore, sessionCaptureRecords, sessionStore, sqlEngine, storePosture, taskAttachmentStore, taskListLane, usageWindowStore };
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=stage-03-store-backend.js.map
|
|
@@ -60,7 +60,7 @@ export declare function runStage04(ctx: Awaited<ReturnType<typeof runStage03>>):
|
|
|
60
60
|
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
61
61
|
sessionCaptureRecords: import("../index.js").SessionCaptureRecordSource | undefined;
|
|
62
62
|
sessionStore: import("@sema-agent/core").SessionStore;
|
|
63
|
-
|
|
63
|
+
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
64
64
|
storePosture: import("../store-posture.js").StorePosture;
|
|
65
65
|
taskAttachmentStore: import("../plugins/task-attachment-store.js").TaskAttachmentStore | undefined;
|
|
66
66
|
taskListLane: import("./task-list-lane.js").TaskListLane;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { runStage04 } from "./stage-04-stores.js";
|
|
2
|
-
export declare function runStage05(ctx: Awaited<ReturnType<typeof runStage04>>): {
|
|
3
|
-
|
|
2
|
+
export declare function runStage05(ctx: Awaited<ReturnType<typeof runStage04>>): Promise<{
|
|
3
|
+
deploymentMods: readonly import("@sema-agent/core").ModRegistration<import("@sema-agent/core").EngineDollar>[];
|
|
4
4
|
deviceLane: import("./device-lane.js").DeviceLane | undefined;
|
|
5
5
|
dropSessionScoped: (sid: string) => void;
|
|
6
6
|
executionEnvFactory: import("@sema-agent/core").ExecutionEnvFactory | undefined;
|
|
@@ -75,7 +75,7 @@ export declare function runStage05(ctx: Awaited<ReturnType<typeof runStage04>>):
|
|
|
75
75
|
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
76
76
|
sessionCaptureRecords: import("../index.js").SessionCaptureRecordSource | undefined;
|
|
77
77
|
sessionStore: import("@sema-agent/core").SessionStore;
|
|
78
|
-
|
|
78
|
+
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
79
79
|
storePosture: import("../store-posture.js").StorePosture;
|
|
80
80
|
taskAttachmentStore: import("../plugins/task-attachment-store.js").TaskAttachmentStore | undefined;
|
|
81
81
|
taskListLane: import("./task-list-lane.js").TaskListLane;
|
|
@@ -86,5 +86,5 @@ export declare function runStage05(ctx: Awaited<ReturnType<typeof runStage04>>):
|
|
|
86
86
|
localRoot: string;
|
|
87
87
|
logger: import("../index.js").Logger;
|
|
88
88
|
metrics: import("../index.js").Metrics;
|
|
89
|
-
}
|
|
89
|
+
}>;
|
|
90
90
|
//# sourceMappingURL=stage-05-execution-env.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { assertDeploymentModsAdmitted, createDeploymentMods } from "./deployment-mods.js";
|
|
2
|
+
import { isBrandedDeployment } from "../capabilities/brand-identity.js";
|
|
3
3
|
import { assertDeviceLaneWired, createDeviceLane } from "./device-lane.js";
|
|
4
4
|
import { assertWorkspaceSpaceReadable, createExecutionEnv } from "./execution-env.js";
|
|
5
5
|
import { incarnationReadOf } from "../session-incarnation.js";
|
|
6
6
|
import * as facts from "../capability-facts.js";
|
|
7
7
|
import { sessionStoreLabelOf } from "../store-posture.js";
|
|
8
8
|
import { runStore } from "./late-binds.js";
|
|
9
|
-
export function runStage05(ctx) {
|
|
9
|
+
export async function runStage05(ctx) {
|
|
10
10
|
const { backend, config, instanceId, logger, metrics, sessionStore, taskAttachmentStore } = ctx;
|
|
11
11
|
const deviceLane = config.remoteExec?.provider === "device" ? createDeviceLane({ config, logger, metrics, backend, replicaId: instanceId }) : undefined;
|
|
12
12
|
const incarnationOf = incarnationReadOf(sessionStore);
|
|
@@ -14,13 +14,10 @@ export function runStage05(ctx) {
|
|
|
14
14
|
const { perTaskImage, sessionEnvSelection, perSessionCwd, setSessionCwd, setSessionShellEnv, setSessionInheritEnv, fenceSessionOwner, dropSessionScoped, executionEnvFactory, worktreeReap, sendUserFileTaskEnvs, lspManager, spaceReclaimer, } = createExecutionEnv({ config, logger, metrics, taskAttachmentStore, ...(deviceLane ? { deviceLane } : {}), ...(spaceCommits !== undefined ? { spaceCommits } : {}), ...(incarnationOf !== undefined ? { incarnationOf } : {}) });
|
|
15
15
|
assertDeviceLaneWired(config.remoteExec?.provider === "device", deviceLane, executionEnvFactory !== undefined);
|
|
16
16
|
assertWorkspaceSpaceReadable(facts.workspaceSpace(config), { incarnationOf, spaceCommits }, facts.workspaceCache(config), sessionStoreLabelOf(config.sessionBackend, backend?.kind));
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
17
|
+
const deploymentMods = createDeploymentMods({ metrics, ...(config.toolTrace ? { traceLogger: logger } : {}), brandIdentity: isBrandedDeployment(config) });
|
|
18
|
+
if (config.toolTrace)
|
|
19
19
|
logger.info("tool_trace_enabled", {});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
...(config.hooksTimeoutMs !== undefined ? { timeoutMs: config.hooksTimeoutMs } : {}),
|
|
23
|
-
};
|
|
24
|
-
return { ...ctx, deploymentHooks, deviceLane, dropSessionScoped, executionEnvFactory, fenceSessionOwner, lspManager, spaceReclaimer, perSessionCwd, perTaskImage, sendUserFileTaskEnvs, sessionEnvSelection, setSessionCwd, setSessionInheritEnv, setSessionShellEnv, worktreeReap };
|
|
20
|
+
await assertDeploymentModsAdmitted(deploymentMods);
|
|
21
|
+
return { ...ctx, deploymentMods, deviceLane, dropSessionScoped, executionEnvFactory, fenceSessionOwner, lspManager, spaceReclaimer, perSessionCwd, perTaskImage, sendUserFileTaskEnvs, sessionEnvSelection, setSessionCwd, setSessionInheritEnv, setSessionShellEnv, worktreeReap };
|
|
25
22
|
}
|
|
26
23
|
//# sourceMappingURL=stage-05-execution-env.js.map
|
|
@@ -51,6 +51,7 @@ export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>):
|
|
|
51
51
|
workflowCompletionInbox: import("../orchestration/workflow-completion-inbox.js").WorkflowCompletionInbox | undefined;
|
|
52
52
|
workflowJournalStore: import("../plugins/store-backend.js").ServiceWorkflowJournalStore | undefined;
|
|
53
53
|
workflowModelAllowlistSnapshot: readonly string[];
|
|
54
|
+
workflowParkDecisions: import("../orchestration/workflow-park-decision.js").WorkflowParkDecisionStore | undefined;
|
|
54
55
|
workflowNotifyGate: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyGate | undefined;
|
|
55
56
|
workflowNotifyJournal: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyJournalStore | undefined;
|
|
56
57
|
workflowRecoverOpts: {
|
|
@@ -60,7 +61,8 @@ export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>):
|
|
|
60
61
|
};
|
|
61
62
|
workflowRunStore: import("../orchestration/workflow-notify-journal.js").JournalingWorkflowRunStore | undefined;
|
|
62
63
|
workflowsCapable: boolean;
|
|
63
|
-
|
|
64
|
+
orgDeliveryGate: import("@sema-agent/core").OrgDeliveryGate | undefined;
|
|
65
|
+
deploymentMods: readonly import("@sema-agent/core").ModRegistration<import("@sema-agent/core").EngineDollar>[];
|
|
64
66
|
deviceLane: import("./device-lane.js").DeviceLane | undefined;
|
|
65
67
|
dropSessionScoped: (sid: string) => void;
|
|
66
68
|
executionEnvFactory: import("@sema-agent/core").ExecutionEnvFactory | undefined;
|
|
@@ -135,7 +137,7 @@ export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>):
|
|
|
135
137
|
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
136
138
|
sessionCaptureRecords: import("../index.js").SessionCaptureRecordSource | undefined;
|
|
137
139
|
sessionStore: import("@sema-agent/core").SessionStore;
|
|
138
|
-
|
|
140
|
+
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
139
141
|
storePosture: import("../store-posture.js").StorePosture;
|
|
140
142
|
taskAttachmentStore: import("../plugins/task-attachment-store.js").TaskAttachmentStore | undefined;
|
|
141
143
|
taskListLane: import("./task-list-lane.js").TaskListLane;
|
|
@@ -4,8 +4,10 @@ import { createSessionTitler } from "../session-titler.js";
|
|
|
4
4
|
import { cardRuleScopeRoot } from "../task-cwd.js";
|
|
5
5
|
import { ForkRoutingSessionStore } from "../plugins/fork-routing-session-store.js";
|
|
6
6
|
import { withoutHands } from "../capabilities/hands-lane.js";
|
|
7
|
+
import { isBrandedDeployment } from "../capabilities/brand-identity.js";
|
|
7
8
|
import { redactSecrets } from "../trace/redact.js";
|
|
8
9
|
import { hasServiceAuth } from "../http/server.js";
|
|
10
|
+
import { operatorRosterPresent } from "../http/principal-gate.js";
|
|
9
11
|
import { workflowModelAllowlistFor } from "../task-workflow.js";
|
|
10
12
|
import { createHookLlm, buildHookFailureText } from "../hooks/hook-llm.js";
|
|
11
13
|
import { assertRetentionLaneWirable } from "./retention-lane.js";
|
|
@@ -20,11 +22,12 @@ import { defaultEngineNoticeRouter } from "../trace/engine-notice-wire.js";
|
|
|
20
22
|
import { createOrgMemoryAdmissionWiring } from "./org-memory.js";
|
|
21
23
|
import { createGovernanceSeams } from "./governance-seams.js";
|
|
22
24
|
import { createSharedMemoryScopeAuthorizer } from "../shared-memory-scope-authorizer.js";
|
|
25
|
+
import { mountOrgDeliveryGate } from "./org-delivery.js";
|
|
23
26
|
import { parkedAskRedeem, runStore } from "./late-binds.js";
|
|
24
27
|
import { withInternalRunEnvs } from "../internal-run-env.js";
|
|
25
28
|
export function runStage06(ctx) {
|
|
26
|
-
const { backend, backgroundAgentStore, brain, engineDataRoot, config, webAdmin, consolidationValve,
|
|
27
|
-
const { sqlWorkflowRunStore, workflowNotifyJournal, workflowCompletionInbox, deliverWorkflowCompletion, workflowNotifyGate, fleetBus, workflowRunStore, workflowJournalStore, outcomeSink, workflowRecoverOpts, workflowAgentRegistry, subagentSteerRegistry, workflowAgentSessionIndex, } = createWorkflowOrchestration({ config, logger, metrics, localRoot, backend, getRunStore: () => runStore });
|
|
29
|
+
const { backend, backgroundAgentStore, brain, engineDataRoot, config, webAdmin, consolidationValve, deploymentMods, executionEnvFactory, fileHistoryStore, localRoot, logger, lspManager, mailboxRecipientLifecycle, mailboxStore, memoryEngine, memorySyncRunner, metrics, perSessionCwd, permissionRuleProvider, pricing, rosterStore, ruleConsent, sendUserFileTaskEnvs, sessionCaptureRecordStore, sessionCaptureRecords, sessionPolicyStore, sessionStore, taskAttachmentStore, taskListLane, toolResultStore, tracer, usageWindowStore } = ctx;
|
|
30
|
+
const { sqlWorkflowRunStore, workflowNotifyJournal, workflowCompletionInbox, deliverWorkflowCompletion, workflowNotifyGate, fleetBus, workflowRunStore, workflowJournalStore, outcomeSink, workflowRecoverOpts, workflowAgentRegistry, subagentSteerRegistry, workflowAgentSessionIndex, workflowParkDecisions, } = createWorkflowOrchestration({ config, logger, metrics, localRoot, backend, getRunStore: () => runStore });
|
|
28
31
|
const parkCommitted = backend?.checkpoint && config.durableApproval ? createParkCommitWatch(backend.checkpoint(logger)) : undefined;
|
|
29
32
|
const checkpointStore = parkCommitted?.store;
|
|
30
33
|
const parkCommits = parkCommitted?.watch;
|
|
@@ -45,7 +48,7 @@ export function runStage06(ctx) {
|
|
|
45
48
|
if (sharedMemoryStore)
|
|
46
49
|
logger.info("shared_memory_stores_enabled", { backend: backend?.kind });
|
|
47
50
|
const runnerOffloadStore = toolResultStore ?? new InMemoryToolResultStore({ maxTotalChars: 64_000_000 });
|
|
48
|
-
const commitHands = config
|
|
51
|
+
const commitHands = isBrandedDeployment(config) ? { commitCoAuthor: "Sema <noreply@vivi-ai.com>" } : undefined;
|
|
49
52
|
const retentionExecutor = backend?.retention?.({ taskAttachmentTable: taskAttachmentStore !== undefined, taskListTables: taskListLane.backend !== "memory", logger });
|
|
50
53
|
const retentionLaneStore = backend?.retentionLane?.();
|
|
51
54
|
assertRetentionLaneWirable({
|
|
@@ -82,7 +85,7 @@ export function runStage06(ctx) {
|
|
|
82
85
|
: undefined;
|
|
83
86
|
for (const w of buildConsolidationValveAudit({
|
|
84
87
|
valve: consolidationValve,
|
|
85
|
-
|
|
88
|
+
operatorRosterPresent: operatorRosterPresent(config),
|
|
86
89
|
hasServiceAuth: hasServiceAuth(config),
|
|
87
90
|
allowUnauthedWrites: config.allowUnauthedWrites ?? false,
|
|
88
91
|
}).warnings) {
|
|
@@ -120,12 +123,13 @@ export function runStage06(ctx) {
|
|
|
120
123
|
sessionCaptureRecords,
|
|
121
124
|
memorySyncRunner, toolResultStore: runnerOffloadStore, checkpointStore, sessionPolicyStore, runtimeCapsResolver, fileHistoryStore,
|
|
122
125
|
permissionRuleStore: permissionRuleProvider,
|
|
123
|
-
executionEnvFactory, lspManager, fleetBus,
|
|
126
|
+
executionEnvFactory, lspManager, fleetBus, deploymentMods, workflowRunStore, workflowJournalStore,
|
|
124
127
|
workflowAgentRegistry, workflowNotifyGate, workflowCompletionInbox, deliverWorkflowCompletion, orgMemoryAdmission,
|
|
125
128
|
governanceSeams,
|
|
126
129
|
sharedMemoryStores: sharedMemoryStore ? sharedMemoryStore : undefined,
|
|
127
130
|
getRunStore: () => runStore,
|
|
128
131
|
});
|
|
132
|
+
const orgDeliveryGate = mountOrgDeliveryGate({ runnerDeps, directory: orgMemoryAdmission.directory, mailboxStore, backend, logger });
|
|
129
133
|
const runner = new Runner(runnerDeps);
|
|
130
134
|
const handslessRunner = new Runner(withoutHands(runnerDeps));
|
|
131
135
|
const { hookModelFor, hookLlm } = createHookLlm({ config, getKeyResolver: () => webAdmin.getKeyResolver(), metrics });
|
|
@@ -192,7 +196,7 @@ export function runStage06(ctx) {
|
|
|
192
196
|
backgroundAgentStore,
|
|
193
197
|
mailboxStore,
|
|
194
198
|
rosterStore,
|
|
195
|
-
|
|
199
|
+
deploymentMods,
|
|
196
200
|
toolResultStore: runnerOffloadStore,
|
|
197
201
|
checkpointStore,
|
|
198
202
|
sessionPolicyStore,
|
|
@@ -209,6 +213,6 @@ export function runStage06(ctx) {
|
|
|
209
213
|
onError: runnerDeps.onError ? runnerDeps.onError : undefined,
|
|
210
214
|
};
|
|
211
215
|
const subRunner = new Runner(subRunnerDeps);
|
|
212
|
-
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 };
|
|
216
|
+
return { ...ctx, approvalAskAudit, approvalExemptionStore, centerRuntimeCapsResolver, checkpointStore, parkCommits, durableEnabled, elicitation, fleetBus, governanceSeams, handslessRunner, hookAgent, hookAgentRunner, hookLlm, mcpRevocations, memoryConsolidationFaces, memoryOptOutGrantStore, orgMemoryAdmission, outcomeSink, principalCaps, question, retentionExecutor, retentionLaneStore, runner, runnerDeps, runtimeCapsPeekResolver, sendFileLedger, sendUserFileEmitter, sendUserFileToolSpec, sessionTitler, sharedMemoryStore, sqlWorkflowRunStore, streamApprovalGate, subRunner, subRunnerSessions, subagentSteerRegistry, toolApproval, workflowAgentRegistry, workflowAgentSessionIndex, workflowCompletionInbox, workflowJournalStore, workflowModelAllowlistSnapshot, workflowParkDecisions, workflowNotifyGate, workflowNotifyJournal, workflowRecoverOpts, workflowRunStore, workflowsCapable, orgDeliveryGate };
|
|
213
217
|
}
|
|
214
218
|
//# sourceMappingURL=stage-06-runners.js.map
|
|
@@ -66,6 +66,7 @@ export declare function runStage07(ctx: Awaited<ReturnType<typeof runStage06>>):
|
|
|
66
66
|
workflowCompletionInbox: import("../orchestration/workflow-completion-inbox.js").WorkflowCompletionInbox | undefined;
|
|
67
67
|
workflowJournalStore: import("../plugins/store-backend.js").ServiceWorkflowJournalStore | undefined;
|
|
68
68
|
workflowModelAllowlistSnapshot: readonly string[];
|
|
69
|
+
workflowParkDecisions: import("../orchestration/workflow-park-decision.js").WorkflowParkDecisionStore | undefined;
|
|
69
70
|
workflowNotifyGate: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyGate | undefined;
|
|
70
71
|
workflowNotifyJournal: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyJournalStore | undefined;
|
|
71
72
|
workflowRecoverOpts: {
|
|
@@ -75,7 +76,8 @@ export declare function runStage07(ctx: Awaited<ReturnType<typeof runStage06>>):
|
|
|
75
76
|
};
|
|
76
77
|
workflowRunStore: import("../orchestration/workflow-notify-journal.js").JournalingWorkflowRunStore | undefined;
|
|
77
78
|
workflowsCapable: boolean;
|
|
78
|
-
|
|
79
|
+
orgDeliveryGate: import("@sema-agent/core").OrgDeliveryGate | undefined;
|
|
80
|
+
deploymentMods: readonly import("@sema-agent/core").ModRegistration<import("@sema-agent/core").EngineDollar>[];
|
|
79
81
|
deviceLane: import("./device-lane.js").DeviceLane | undefined;
|
|
80
82
|
dropSessionScoped: (sid: string) => void;
|
|
81
83
|
executionEnvFactory: import("@sema-agent/core").ExecutionEnvFactory | undefined;
|
|
@@ -150,7 +152,7 @@ export declare function runStage07(ctx: Awaited<ReturnType<typeof runStage06>>):
|
|
|
150
152
|
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
151
153
|
sessionCaptureRecords: import("../index.js").SessionCaptureRecordSource | undefined;
|
|
152
154
|
sessionStore: import("@sema-agent/core").SessionStore;
|
|
153
|
-
|
|
155
|
+
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
154
156
|
storePosture: import("../store-posture.js").StorePosture;
|
|
155
157
|
taskAttachmentStore: import("../plugins/task-attachment-store.js").TaskAttachmentStore | undefined;
|
|
156
158
|
taskListLane: import("./task-list-lane.js").TaskListLane;
|
|
@@ -7,12 +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
|
+
import { isBrandedDeployment } from "../capabilities/brand-identity.js";
|
|
14
15
|
import { RateLimiter } from "../observability/rate-limit.js";
|
|
15
16
|
import { explicitOperatorOk } from "../http/server.js";
|
|
17
|
+
import { buildOperatorUndeclaredNotice } from "../http/principal-gate.js";
|
|
16
18
|
import { selfOrchestrationDenial } from "../task-workflow.js";
|
|
17
19
|
import { centerEntitlementSourceWired } from "../runtime-caps-resolver.js";
|
|
18
20
|
import { reclaimOrphansAtBoot } from "../boot-reclaim.js";
|
|
@@ -55,6 +57,18 @@ export async function runStage07(ctx) {
|
|
|
55
57
|
throw new Error(gateRefusal);
|
|
56
58
|
await reclaimOrphansAtBoot(runStore, checkpointStore, logger);
|
|
57
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
|
+
}
|
|
58
72
|
const userInputLedgerStore = backend && runStore ? backend.userInputLedger() : undefined;
|
|
59
73
|
const userInputLedger = backend && runStore && userInputLedgerStore
|
|
60
74
|
? await (async () => {
|
|
@@ -74,7 +88,7 @@ export async function runStage07(ctx) {
|
|
|
74
88
|
? selectEnvironmentTool({
|
|
75
89
|
catalog: imageIndex,
|
|
76
90
|
selection: sessionEnvSelection,
|
|
77
|
-
viewerFor: (principal) => ({ operator: explicitOperatorOk(principal, config
|
|
91
|
+
viewerFor: (principal) => ({ operator: explicitOperatorOk(principal, config), tenantId: principal ?? null }),
|
|
78
92
|
})
|
|
79
93
|
: undefined;
|
|
80
94
|
const imageBakes = backend?.imageBake && config.imageBakes.enabled ? backend.imageBake() : undefined;
|
|
@@ -82,6 +96,11 @@ export async function runStage07(ctx) {
|
|
|
82
96
|
logger.info("image_bakes_enabled", { operators: config.operatorPrincipals.length, runner: config.imageBakes.runnerPrincipal });
|
|
83
97
|
if (durableEnabled)
|
|
84
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
|
+
}
|
|
85
104
|
if (config.a2aServe) {
|
|
86
105
|
const peer = facts.a2aServe({ config, runStore });
|
|
87
106
|
if (peer.available) {
|
|
@@ -133,7 +152,7 @@ export async function runStage07(ctx) {
|
|
|
133
152
|
? backend.rateLimiter(config.rateLimitPerMin, counterDegradeHook).startRefresh()
|
|
134
153
|
: new RateLimiter(config.rateLimitPerMin);
|
|
135
154
|
bindRateLimiter(rateLimiter);
|
|
136
|
-
let skills = loadDeploymentSkills(config);
|
|
155
|
+
let skills = loadDeploymentSkills(config, logger);
|
|
137
156
|
skills = await webAdmin.applyCenterCapabilities(skills);
|
|
138
157
|
const repoClient = config.gitApiBaseUrl ? createRepoClient(config.gitApiKind, config.gitApiBaseUrl, config.gitApiToken) : undefined;
|
|
139
158
|
const webSearchCfg = webSearchConfigFromEnv();
|
|
@@ -150,16 +169,18 @@ export async function runStage07(ctx) {
|
|
|
150
169
|
})
|
|
151
170
|
.catch((e) => logger.warn("web_search_probe_failed", { provider: webSearchCfg.provider, error: e instanceof Error ? e.message : String(e) }));
|
|
152
171
|
}
|
|
153
|
-
const ensureChildSessionDurable = checkpointStore && config.sessionBackend === "tidb"
|
|
172
|
+
const ensureChildSessionDurable = checkpointStore && config.sessionBackend === "tidb"
|
|
173
|
+
? (sessionId, root) => ensureChildSessionDurableWithPromotion(sessionStore, subRunnerSessions, sessionId, root, logger)
|
|
174
|
+
: undefined;
|
|
154
175
|
const webFetchSummarize = createWebFetchSummarizeLane({ brain, config, getKeyResolver: () => webAdmin.getKeyResolver(), logger });
|
|
155
176
|
const scenarioDeps = {
|
|
156
177
|
runner, subRunner, model: DEFAULT_MODEL_REF, skills, repoClient, requirePrincipal: config.requirePrincipal,
|
|
178
|
+
handsLane: laneWiresExecutionEnv(executionLaneOf(config.remoteExec?.provider)),
|
|
157
179
|
webSearch: webSearch ? webSearch : undefined, logger, webFetchSummarize,
|
|
158
180
|
backgroundAgentStore: backgroundAgentStore ? backgroundAgentStore : undefined,
|
|
159
181
|
checkpointStore: checkpointStore ? checkpointStore : undefined,
|
|
160
182
|
ensureChildSessionDurable: ensureChildSessionDurable ? ensureChildSessionDurable : undefined,
|
|
161
183
|
taskListStoreFor: taskListLane.storeFor,
|
|
162
|
-
brandIdentity: config.configProvider === "local",
|
|
163
184
|
subagentExtraTools: sendUserFileToolSpec ? subagentSendUserFileExtraTools({ spec: sendUserFileToolSpec }) : undefined,
|
|
164
185
|
};
|
|
165
186
|
const scenarios = buildScenarios(scenarioDeps);
|
|
@@ -174,7 +195,7 @@ export async function runStage07(ctx) {
|
|
|
174
195
|
autoModeSeatMounted: runnerDeps.autoMode !== undefined,
|
|
175
196
|
})
|
|
176
197
|
: undefined;
|
|
177
|
-
const scenarioDetails = builtinScenarioDetails(scenarios, scenarioDeps);
|
|
198
|
+
const scenarioDetails = builtinScenarioDetails(scenarios, scenarioDeps, isBrandedDeployment(config));
|
|
178
199
|
const builtinScenarioNames = Object.keys(scenarioDetails);
|
|
179
200
|
webAdmin.applyCenterScenarios({ scenarioDeps, scenarios, scenarioDetails, builtinScenarioNames });
|
|
180
201
|
const defaultScenarioRefusal = danglingScenarioRefusal(config.defaultScenario, "deployment", Object.keys(scenarios));
|
|
@@ -79,6 +79,7 @@ export declare function runStage08(ctx: Awaited<ReturnType<typeof runStage07>>):
|
|
|
79
79
|
workflowCompletionInbox: import("../orchestration/workflow-completion-inbox.js").WorkflowCompletionInbox | undefined;
|
|
80
80
|
workflowJournalStore: import("../plugins/store-backend.js").ServiceWorkflowJournalStore | undefined;
|
|
81
81
|
workflowModelAllowlistSnapshot: readonly string[];
|
|
82
|
+
workflowParkDecisions: import("../orchestration/workflow-park-decision.js").WorkflowParkDecisionStore | undefined;
|
|
82
83
|
workflowNotifyGate: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyGate | undefined;
|
|
83
84
|
workflowNotifyJournal: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyJournalStore | undefined;
|
|
84
85
|
workflowRecoverOpts: {
|
|
@@ -88,7 +89,8 @@ export declare function runStage08(ctx: Awaited<ReturnType<typeof runStage07>>):
|
|
|
88
89
|
};
|
|
89
90
|
workflowRunStore: import("../orchestration/workflow-notify-journal.js").JournalingWorkflowRunStore | undefined;
|
|
90
91
|
workflowsCapable: boolean;
|
|
91
|
-
|
|
92
|
+
orgDeliveryGate: import("@sema-agent/core").OrgDeliveryGate | undefined;
|
|
93
|
+
deploymentMods: readonly import("@sema-agent/core").ModRegistration<import("@sema-agent/core").EngineDollar>[];
|
|
92
94
|
deviceLane: import("./device-lane.js").DeviceLane | undefined;
|
|
93
95
|
dropSessionScoped: (sid: string) => void;
|
|
94
96
|
executionEnvFactory: import("@sema-agent/core").ExecutionEnvFactory | undefined;
|
|
@@ -163,7 +165,7 @@ export declare function runStage08(ctx: Awaited<ReturnType<typeof runStage07>>):
|
|
|
163
165
|
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
164
166
|
sessionCaptureRecords: import("../index.js").SessionCaptureRecordSource | undefined;
|
|
165
167
|
sessionStore: import("@sema-agent/core").SessionStore;
|
|
166
|
-
|
|
168
|
+
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
167
169
|
storePosture: import("../store-posture.js").StorePosture;
|
|
168
170
|
taskAttachmentStore: import("../plugins/task-attachment-store.js").TaskAttachmentStore | undefined;
|
|
169
171
|
taskListLane: import("./task-list-lane.js").TaskListLane;
|
|
@@ -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;
|
|
@@ -28,13 +29,7 @@ export declare function runStage09(ctx: Awaited<ReturnType<typeof runStage08>>):
|
|
|
28
29
|
modelId: string;
|
|
29
30
|
} | null;
|
|
30
31
|
messages: unknown[];
|
|
31
|
-
promptEpoch?:
|
|
32
|
-
epoch: number;
|
|
33
|
-
artifactDigest: string;
|
|
34
|
-
packId: string;
|
|
35
|
-
assemblyApi: number;
|
|
36
|
-
activatedBy: "session_start" | "compaction" | "legacy_migration";
|
|
37
|
-
};
|
|
32
|
+
promptEpoch?: import("@sema-agent/core").StoredPromptEpoch;
|
|
38
33
|
} | undefined>) | undefined;
|
|
39
34
|
sessionWatchRegistry: import("../session-watch.js").SessionWatchRegistry | undefined;
|
|
40
35
|
staticWiring: import("@sema-agent/core").WiringManifest;
|
|
@@ -108,6 +103,7 @@ export declare function runStage09(ctx: Awaited<ReturnType<typeof runStage08>>):
|
|
|
108
103
|
workflowCompletionInbox: import("../orchestration/workflow-completion-inbox.js").WorkflowCompletionInbox | undefined;
|
|
109
104
|
workflowJournalStore: import("../plugins/store-backend.js").ServiceWorkflowJournalStore | undefined;
|
|
110
105
|
workflowModelAllowlistSnapshot: readonly string[];
|
|
106
|
+
workflowParkDecisions: import("../orchestration/workflow-park-decision.js").WorkflowParkDecisionStore | undefined;
|
|
111
107
|
workflowNotifyGate: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyGate | undefined;
|
|
112
108
|
workflowNotifyJournal: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyJournalStore | undefined;
|
|
113
109
|
workflowRecoverOpts: {
|
|
@@ -117,7 +113,8 @@ export declare function runStage09(ctx: Awaited<ReturnType<typeof runStage08>>):
|
|
|
117
113
|
};
|
|
118
114
|
workflowRunStore: import("../orchestration/workflow-notify-journal.js").JournalingWorkflowRunStore | undefined;
|
|
119
115
|
workflowsCapable: boolean;
|
|
120
|
-
|
|
116
|
+
orgDeliveryGate: import("@sema-agent/core").OrgDeliveryGate | undefined;
|
|
117
|
+
deploymentMods: readonly import("@sema-agent/core").ModRegistration<import("@sema-agent/core").EngineDollar>[];
|
|
121
118
|
deviceLane: import("./device-lane.js").DeviceLane | undefined;
|
|
122
119
|
dropSessionScoped: (sid: string) => void;
|
|
123
120
|
executionEnvFactory: import("@sema-agent/core").ExecutionEnvFactory | undefined;
|
|
@@ -192,7 +189,7 @@ export declare function runStage09(ctx: Awaited<ReturnType<typeof runStage08>>):
|
|
|
192
189
|
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
193
190
|
sessionCaptureRecords: import("../index.js").SessionCaptureRecordSource | undefined;
|
|
194
191
|
sessionStore: import("@sema-agent/core").SessionStore;
|
|
195
|
-
|
|
192
|
+
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
196
193
|
storePosture: import("../store-posture.js").StorePosture;
|
|
197
194
|
taskAttachmentStore: import("../plugins/task-attachment-store.js").TaskAttachmentStore | undefined;
|
|
198
195
|
taskListLane: import("./task-list-lane.js").TaskListLane;
|
|
@@ -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;
|
|
@@ -27,13 +28,7 @@ export declare function runStage10(ctx: Awaited<ReturnType<typeof runStage09>>):
|
|
|
27
28
|
modelId: string;
|
|
28
29
|
} | null;
|
|
29
30
|
messages: unknown[];
|
|
30
|
-
promptEpoch?:
|
|
31
|
-
epoch: number;
|
|
32
|
-
artifactDigest: string;
|
|
33
|
-
packId: string;
|
|
34
|
-
assemblyApi: number;
|
|
35
|
-
activatedBy: "session_start" | "compaction" | "legacy_migration";
|
|
36
|
-
};
|
|
31
|
+
promptEpoch?: import("@sema-agent/core").StoredPromptEpoch;
|
|
37
32
|
} | undefined>) | undefined;
|
|
38
33
|
sessionWatchRegistry: import("../session-watch.js").SessionWatchRegistry | undefined;
|
|
39
34
|
staticWiring: import("@sema-agent/core").WiringManifest;
|
|
@@ -107,6 +102,7 @@ export declare function runStage10(ctx: Awaited<ReturnType<typeof runStage09>>):
|
|
|
107
102
|
workflowCompletionInbox: import("../orchestration/workflow-completion-inbox.js").WorkflowCompletionInbox | undefined;
|
|
108
103
|
workflowJournalStore: import("../plugins/store-backend.js").ServiceWorkflowJournalStore | undefined;
|
|
109
104
|
workflowModelAllowlistSnapshot: readonly string[];
|
|
105
|
+
workflowParkDecisions: import("../orchestration/workflow-park-decision.js").WorkflowParkDecisionStore | undefined;
|
|
110
106
|
workflowNotifyGate: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyGate | undefined;
|
|
111
107
|
workflowNotifyJournal: import("../orchestration/workflow-notify-journal.js").WorkflowNotifyJournalStore | undefined;
|
|
112
108
|
workflowRecoverOpts: {
|
|
@@ -116,7 +112,8 @@ export declare function runStage10(ctx: Awaited<ReturnType<typeof runStage09>>):
|
|
|
116
112
|
};
|
|
117
113
|
workflowRunStore: import("../orchestration/workflow-notify-journal.js").JournalingWorkflowRunStore | undefined;
|
|
118
114
|
workflowsCapable: boolean;
|
|
119
|
-
|
|
115
|
+
orgDeliveryGate: import("@sema-agent/core").OrgDeliveryGate | undefined;
|
|
116
|
+
deploymentMods: readonly import("@sema-agent/core").ModRegistration<import("@sema-agent/core").EngineDollar>[];
|
|
120
117
|
deviceLane: import("./device-lane.js").DeviceLane | undefined;
|
|
121
118
|
dropSessionScoped: (sid: string) => void;
|
|
122
119
|
executionEnvFactory: import("@sema-agent/core").ExecutionEnvFactory | undefined;
|
|
@@ -191,7 +188,7 @@ export declare function runStage10(ctx: Awaited<ReturnType<typeof runStage09>>):
|
|
|
191
188
|
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
192
189
|
sessionCaptureRecords: import("../plugins/store-backend.js").SessionCaptureRecordSource | undefined;
|
|
193
190
|
sessionStore: import("@sema-agent/core").SessionStore;
|
|
194
|
-
|
|
191
|
+
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
195
192
|
storePosture: import("../store-posture.js").StorePosture;
|
|
196
193
|
taskAttachmentStore: import("../plugins/task-attachment-store.js").TaskAttachmentStore | undefined;
|
|
197
194
|
taskListLane: import("./task-list-lane.js").TaskListLane;
|
|
@@ -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 { SQL_BLOB_DEFAULT_MAX_BYTES } 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,7 +29,7 @@ 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,
|
|
32
|
+
const { approvalAskAudit, approvalExemptionStore, approvalNonceStore, authorize, backend, backgroundAgentStore, brain, breakerState, centerRuntimeCapsResolver, checkpointStore, parkCommits, config, webAdmin, consolidationValve, costQuota, deviceLane, drainState, durableEnabled, elicitation, fenceSessionOwner, fileHistoryStore, fleetBus, fleetLease, fleetUsage, governanceSeams, handslessRunner, hookAgent, hookLlm, hookWakeBus, imageBakes, imageIndex, instanceId, instrumentDegenerate, leaderEndpoint, localRoot, logger, lspManager, mcpRevocations, memoryBundleFaces, memoryComplianceFaces, memoryConsolidationFaces, memoryEngine, memoryExportBackend, memoryOptOutGrantStore, memoryOriginFaces, memoryPosture, memorySyncCursors, memorySyncRunner, metrics, modelUsageTracker, orgMemoryAdmission, otelExporter, outcomeSink, ownerAware, parkedReviveInheritedGate, parkedReviveSurface, perSessionCwd, perTaskImage, planCacheProbe, pricing, principalCaps, promptManifestTracker, purgeSession, question, rateLimiter, reaper, webAdminJwtVerifier, resumeAnchorStore, retentionLaneStarted, retentionLaneStore, ruleConsent, runStore, runner, runnerDeps, runtimeCapsPeekResolver, scenarioDetails, scenarios, selectEnvTool, sendFileLedger, sendUserFileEmitter, sendUserFileToolSpec, sessionAudit, sessionEnvSelection, sessionMemoryStatusFace, sessionPolicyStore, sessionTitler, sessionWatchRegistry, setSessionCwd, setSessionInheritEnv, setSessionShellEnv, sharedMemoryStore, sideQueryAccounting, sqlEngine, sqlWorkflowRunStore, staticWiring, storePosture, subRunner, subagentSteerRegistry, taskAttachmentStore, taskLimitCaps, taskTimeoutSec, toolApproval, toolResultStore, usageWindowStore, userInputLedger, webSearchProvider, workflowAgentRegistry, workflowAgentSessionIndex, workflowParkDecisions, workflowCompletionInbox, workflowJournalStore, workflowModelAllowlistSnapshot, workflowNotifyGate, workflowNotifyJournal, workflowRecoverOpts, workflowRunStore, workflowsCapable, orgDeliveryGate } = ctx;
|
|
34
33
|
const stores = {
|
|
35
34
|
runStore,
|
|
36
35
|
resumeAnchorStore: resumeAnchorStore ? resumeAnchorStore : undefined,
|
|
@@ -47,6 +46,7 @@ export async function runStage10(ctx) {
|
|
|
47
46
|
peerDirectory: runnerDeps.peerDirectory,
|
|
48
47
|
workflowRunStore: workflowRunStore ? workflowRunStore : undefined,
|
|
49
48
|
workflowAgentSessionIndex: workflowAgentSessionIndex ? workflowAgentSessionIndex : undefined,
|
|
49
|
+
workflowParkDecisions: workflowParkDecisions ? workflowParkDecisions : undefined,
|
|
50
50
|
workflowJournalStore: workflowJournalStore ? workflowJournalStore : undefined,
|
|
51
51
|
imageIndex,
|
|
52
52
|
imageBakes,
|
|
@@ -99,6 +99,7 @@ export async function runStage10(ctx) {
|
|
|
99
99
|
memoryConsolidation: memoryConsolidationFaces,
|
|
100
100
|
memoryOptOutGrant: memoryOptOutGrantStore,
|
|
101
101
|
orgMemoryDirectory: orgMemoryAdmission.directory,
|
|
102
|
+
orgDeliveryGate,
|
|
102
103
|
sharedMemoryStore: sharedMemoryStore ? sharedMemoryStore : undefined,
|
|
103
104
|
sessionMirrorRuling: principalCaps
|
|
104
105
|
? async (p) => (await principalCaps.executionRuling(p))?.sessionMirror
|
|
@@ -162,7 +163,7 @@ export async function runStage10(ctx) {
|
|
|
162
163
|
workflowModelAllowlist: workflowModelAllowlistSnapshot,
|
|
163
164
|
staticWiring,
|
|
164
165
|
memoryPosture,
|
|
165
|
-
|
|
166
|
+
sqlEngine,
|
|
166
167
|
writeProtection: buildWriteProtectionPosture(config),
|
|
167
168
|
webSearchProvider,
|
|
168
169
|
sealedKeyPublic: webAdmin.sealedKeyPublic,
|
|
@@ -177,6 +178,7 @@ export async function runStage10(ctx) {
|
|
|
177
178
|
restartState: () => webAdmin.restartState(),
|
|
178
179
|
configApplyState: () => webAdmin.configApplyState(),
|
|
179
180
|
centerCredentialState: () => webAdmin.centerCredentialState(),
|
|
181
|
+
centerIdentityNoticeState: () => webAdmin.centerIdentityNoticeState(),
|
|
180
182
|
modelRefusalsState: () => webAdmin.modelRefusalsState(),
|
|
181
183
|
candidateRejectionState: () => webAdmin.candidateRejectionState(),
|
|
182
184
|
configHandoffState: () => webAdmin.configHandoffState(),
|
|
@@ -191,19 +193,15 @@ export async function runStage10(ctx) {
|
|
|
191
193
|
storeLiveState: storeLiveProbe ? () => storeLiveProbe.state() : undefined,
|
|
192
194
|
};
|
|
193
195
|
const knobs = {
|
|
194
|
-
snapshotBlobSqlCapBytes: backend && backend.kind !== "local" && !config.snapshotBlobStore
|
|
195
|
-
? (config.snapshotBlobSqlMaxBytes ?? (backend.kind === "mysql" ? SQL_BLOB_DEFAULT_MAX_BYTES : undefined))
|
|
196
|
-
: undefined,
|
|
197
196
|
sessionEventsMaxConnections: sessionWatchRegistry ? posIntEnv(process.env.SESSION_EVENTS_MAX_CONNS, 256, 100_000) : undefined,
|
|
198
197
|
};
|
|
199
198
|
const resolveSpec = createResolveSpec({
|
|
200
199
|
config, logger, metrics, localRoot, scenarios, principalCaps, centerRuntimeCapsResolver,
|
|
201
|
-
getCenterPrompts: () => webAdmin.getCenterPrompts(),
|
|
202
200
|
getKeyResolver: () => webAdmin.getKeyResolver(),
|
|
203
201
|
taskAttachmentStore, perSessionCwd, setSessionCwd, setSessionShellEnv, fenceSessionOwner,
|
|
204
202
|
hookLlm, hookAgent, fleetBus, hookWakeBus, resumeAnchorStore, ownerAware, taskLimitCaps, taskTimeoutSec,
|
|
205
|
-
selectEnvTool, sendUserFileToolSpec, memoryEngine, durableEnabled, approvalExemptionStore,
|
|
206
|
-
checkpointStore,
|
|
203
|
+
selectEnvTool, sendUserFileToolSpec, memoryEngine, memorySyncRunner, durableEnabled, approvalExemptionStore,
|
|
204
|
+
checkpointStore, imageIndex, perTaskImage,
|
|
207
205
|
sessionEnvSelection,
|
|
208
206
|
lockedKeys: governanceSeams.lockedKeys,
|
|
209
207
|
liveQuestionFace: question,
|