@sema-agent/server 7.139.0 → 7.141.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 +471 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/USAGE.md +94 -26
- package/dist/adoption/runner.js +1 -1
- package/dist/adoption/sql.js +1 -1
- package/dist/approval-batch-census.d.ts +27 -0
- package/dist/approval-batch-census.js +27 -0
- package/dist/approval-card.d.ts +37 -22
- package/dist/approval-card.js +6 -3
- package/dist/approval.d.ts +15 -0
- package/dist/approval.js +10 -0
- package/dist/audit.d.ts +4 -2
- package/dist/audit.js +2 -2
- package/dist/bench/s1/live-deps.js +3 -2
- package/dist/bench/s1/row.d.ts +5 -2
- package/dist/bench/s1/row.js +2 -22
- package/dist/boot/adoption.js +1 -1
- package/dist/boot/device-lane.d.ts +11 -0
- package/dist/boot/device-lane.js +16 -0
- package/dist/boot/engine-lease.d.ts +24 -3
- package/dist/boot/engine-lease.js +9 -2
- package/dist/boot/execution-env.js +18 -12
- package/dist/boot/execution-lane.d.ts +8 -0
- package/dist/boot/execution-lane.js +6 -1
- package/dist/boot/memory-boundary.d.ts +16 -53
- package/dist/boot/memory-boundary.js +10 -20
- package/dist/boot/memory-consolidation.d.ts +16 -12
- package/dist/boot/memory-consolidation.js +24 -13
- package/dist/boot/reapers.d.ts +2 -2
- package/dist/boot/resolve-spec.d.ts +3 -5
- package/dist/boot/resolve-spec.js +9 -8
- package/dist/boot/runner-deps.d.ts +3 -3
- package/dist/boot/runner-deps.js +1 -0
- package/dist/boot/session-faces.d.ts +1 -1
- package/dist/boot/session-faces.js +4 -3
- package/dist/boot/shutdown.js +5 -0
- package/dist/boot/stage-03-store-backend.d.ts +2 -6
- package/dist/boot/stage-03-store-backend.js +2 -3
- package/dist/boot/stage-04-stores.d.ts +2 -6
- package/dist/boot/stage-04-stores.js +5 -5
- package/dist/boot/stage-05-execution-env.d.ts +2 -6
- package/dist/boot/stage-05-execution-env.js +3 -1
- package/dist/boot/stage-06-runners.d.ts +2 -8
- package/dist/boot/stage-06-runners.js +3 -3
- package/dist/boot/stage-07-capability-layer.d.ts +2 -7
- package/dist/boot/stage-07-capability-layer.js +8 -10
- package/dist/boot/stage-08-reapers.d.ts +2 -7
- package/dist/boot/stage-09-leader.d.ts +2 -7
- package/dist/boot/stage-10-http-server.d.ts +2 -7
- package/dist/boot/stage-10-http-server.js +6 -4
- package/dist/boot/stores.d.ts +3 -6
- package/dist/boot/stores.js +37 -44
- package/dist/boot/task-list-lane.d.ts +1 -1
- package/dist/boot/task-list-lane.js +1 -1
- package/dist/boot/web-admin.js +36 -9
- package/dist/capabilities/execution-lane.d.ts +2 -2
- package/dist/capabilities/scenarios.d.ts +1 -1
- package/dist/capability-facts.d.ts +9 -0
- package/dist/capability-facts.js +9 -0
- package/dist/card-void.d.ts +38 -0
- package/dist/card-void.js +23 -0
- package/dist/config-catalog.js +12 -8
- package/dist/config-provider.d.ts +18 -17
- package/dist/config-provider.js +28 -36
- package/dist/config-types.d.ts +36 -9
- package/dist/config.js +56 -46
- package/dist/delegated-session-owner.d.ts +23 -20
- package/dist/delegated-session-owner.js +2 -2
- package/dist/deployment-shape.d.ts +9 -8
- package/dist/deployment-shape.js +4 -4
- package/dist/device-store.d.ts +7 -0
- package/dist/device-store.js +3 -0
- package/dist/execution-config-root.d.ts +22 -0
- package/dist/execution-config-root.js +35 -0
- package/dist/execution-lane-caps.d.ts +145 -107
- package/dist/execution-lane-caps.js +144 -83
- package/dist/execution-placement.d.ts +3 -0
- package/dist/execution-placement.js +7 -0
- package/dist/fleet/drain-entry.d.ts +3 -0
- package/dist/hosted-posture.d.ts +8 -0
- package/dist/hosted-posture.js +4 -0
- package/dist/http/admission.js +3 -3
- package/dist/http/caller-trust.d.ts +3 -2
- package/dist/http/caller-trust.js +2 -1
- package/dist/http/dispatch.js +4 -0
- package/dist/http/live-frame.d.ts +24 -0
- package/dist/http/live-frame.js +16 -0
- package/dist/http/memory-compliance-failure-reply.d.ts +3 -1
- package/dist/http/memory-compliance-failure-reply.js +5 -0
- package/dist/http/memory-layer-reply.d.ts +30 -0
- package/dist/http/memory-layer-reply.js +24 -0
- package/dist/http/resume-legs.js +49 -35
- package/dist/http/retired-service-deps.d.ts +1 -1
- package/dist/http/retired-service-deps.js +1 -1
- package/dist/http/route-table.js +2 -0
- package/dist/http/routes/adoption.js +1 -1
- package/dist/http/routes/approvals-assistant.js +1 -0
- package/dist/http/routes/capabilities.js +5 -4
- package/dist/http/routes/diagnostics.d.ts +0 -19
- package/dist/http/routes/diagnostics.js +16 -2
- package/dist/http/routes/memory-bundle.d.ts +2 -2
- package/dist/http/routes/memory-bundle.js +4 -1
- package/dist/http/routes/memory-compliance.js +9 -2
- package/dist/http/routes/memory-consolidation.js +12 -1
- package/dist/http/routes/memory-origin.js +14 -2
- package/dist/http/routes/memory-policy.js +7 -2
- package/dist/http/routes/run-permission-mode.d.ts +75 -0
- package/dist/http/routes/run-permission-mode.js +170 -0
- package/dist/http/routes/session-sync.d.ts +3 -6
- package/dist/http/routes/session-sync.js +7 -2
- package/dist/http/routes/sessions.js +33 -15
- package/dist/http/routes/tasks.js +67 -68
- package/dist/http/run-read-face.js +3 -3
- package/dist/http/send.d.ts +1 -1
- package/dist/http/send.js +2 -2
- package/dist/http/server.d.ts +14 -27
- package/dist/http/server.js +2 -2
- package/dist/http/sse-log.d.ts +3 -8
- package/dist/http/stored-body-replay.d.ts +3 -3
- package/dist/http/stored-body-replay.js +3 -1
- package/dist/identity-source.d.ts +1 -1
- package/dist/identity-source.js +1 -1
- package/dist/instruction-source-notice.d.ts +7 -0
- package/dist/instruction-source-notice.js +6 -6
- package/dist/lane-home-probe.d.ts +68 -42
- package/dist/lane-home-probe.js +53 -30
- package/dist/leader/wire.js +5 -4
- package/dist/mcp-assertion-header.d.ts +4 -0
- package/dist/mcp-assertion-header.js +5 -0
- package/dist/memory-bundle-engine.d.ts +16 -9
- package/dist/memory-bundle-engine.js +29 -6
- package/dist/memory-operator-faces.d.ts +85 -30
- package/dist/memory-operator-faces.js +136 -30
- package/dist/memory-posture.d.ts +1 -1
- package/dist/memory-project-layer.d.ts +3 -21
- package/dist/memory-project-layer.js +11 -8
- package/dist/memory-scope-stores.d.ts +73 -0
- package/dist/memory-scope-stores.js +86 -0
- package/dist/memory-scope.d.ts +33 -9
- package/dist/memory-scope.js +17 -5
- package/dist/memory-sync-client.d.ts +34 -9
- package/dist/memory-sync-client.js +108 -28
- package/dist/observability/fail-open.d.ts +30 -2
- package/dist/observability/fail-open.js +30 -2
- package/dist/observability/metrics.js +0 -1
- package/dist/observability/run-terminal.d.ts +6 -2
- package/dist/observability/run-terminal.js +25 -26
- package/dist/observability/secret-env-scrub.d.ts +20 -1
- package/dist/observability/secret-env-scrub.js +14 -0
- package/dist/orchestration/workflow-completion-inbox.d.ts +5 -2
- package/dist/orchestration/workflow-completion-inbox.js +13 -5
- package/dist/orchestration/workflow-notify-journal.d.ts +5 -3
- package/dist/orchestration/workflow-notify-journal.js +2 -1
- package/dist/permission-mode-admission.d.ts +68 -0
- package/dist/permission-mode-admission.js +23 -0
- package/dist/permission-rule-list.d.ts +55 -6
- package/dist/permission-rule-list.js +52 -5
- package/dist/plugins/adoption-log-sql.js +4 -4
- package/dist/plugins/approval-ask-store-sql.js +14 -14
- package/dist/plugins/approval-nonce-store.js +4 -4
- package/dist/plugins/blob-backend.d.ts +4 -4
- package/dist/plugins/blob-backend.js +7 -7
- package/dist/plugins/breaker-state-sql.js +2 -2
- package/dist/plugins/caching-session-store.d.ts +6 -0
- package/dist/plugins/caching-session-store.js +3 -0
- package/dist/plugins/checkpoint-index-columns.js +2 -2
- package/dist/plugins/checkpoint-store-sql.d.ts +65 -17
- package/dist/plugins/checkpoint-store-sql.js +90 -19
- package/dist/plugins/device-store-sql.d.ts +5 -2
- package/dist/plugins/device-store-sql.js +23 -20
- package/dist/plugins/ensure-index.d.ts +1 -2
- package/dist/plugins/execution-placement-sql.d.ts +19 -9
- package/dist/plugins/execution-placement-sql.js +20 -9
- package/dist/plugins/file-history-store-sql.d.ts +2 -2
- package/dist/plugins/file-history-store-sql.js +4 -4
- package/dist/plugins/file-run-store.d.ts +2 -2
- package/dist/plugins/file-run-store.js +1 -1
- package/dist/plugins/fork-routing-session-store.d.ts +10 -32
- package/dist/plugins/fork-routing-session-store.js +2 -61
- package/dist/plugins/image-bake-store-sql.js +9 -9
- package/dist/plugins/image-index-sql.js +11 -11
- package/dist/plugins/k8s-exec-protocol.d.ts +4 -1
- package/dist/plugins/k8s-exec-protocol.js +6 -1
- package/dist/plugins/leader-run-store-sql.js +4 -4
- package/dist/plugins/local-checkpoint-store.d.ts +10 -1
- package/dist/plugins/local-checkpoint-store.js +22 -0
- package/dist/plugins/local-session-store.d.ts +227 -35
- package/dist/plugins/local-session-store.js +518 -37
- package/dist/plugins/local-session-window.d.ts +17 -3
- package/dist/plugins/local-session-window.js +7 -13
- package/dist/plugins/mailbox-store-sql.d.ts +2 -1
- package/dist/plugins/mailbox-store-sql.js +4 -4
- package/dist/plugins/memory-engine-tidb.js +5 -5
- package/dist/plugins/memory-optout-grant-store-sql.js +1 -1
- package/dist/plugins/memory-run-store.d.ts +2 -2
- package/dist/plugins/memory-run-store.js +1 -1
- package/dist/plugins/memory-sync-store-tidb.js +3 -3
- package/dist/plugins/one-time-migrations.d.ts +52 -11
- package/dist/plugins/one-time-migrations.js +101 -39
- package/dist/plugins/org-delivery-quota-store.js +2 -2
- package/dist/plugins/outcome-ledger-sql.js +2 -2
- package/dist/plugins/permission-rule-store-sql.d.ts +4 -4
- package/dist/plugins/permission-rule-store-sql.js +16 -16
- package/dist/plugins/pg-pool.js +3 -2
- package/dist/plugins/pg-session-storage.d.ts +2 -0
- package/dist/plugins/pg-session-storage.js +3 -2
- package/dist/plugins/remote-env-adb.d.ts +7 -24
- package/dist/plugins/remote-env-adb.js +22 -5
- package/dist/plugins/remote-env-device.d.ts +2 -28
- package/dist/plugins/remote-env-device.js +2 -1
- package/dist/plugins/remote-env-e2b.d.ts +40 -27
- package/dist/plugins/remote-env-e2b.js +180 -20
- package/dist/plugins/remote-env-file-error.d.ts +1 -1
- package/dist/plugins/remote-env-file-error.js +8 -2
- package/dist/plugins/remote-env-host.d.ts +19 -35
- package/dist/plugins/remote-env-host.js +26 -3
- package/dist/plugins/remote-env-k8s.d.ts +22 -14
- package/dist/plugins/remote-env-k8s.js +150 -26
- package/dist/plugins/remote-env-local-docker.d.ts +27 -24
- package/dist/plugins/remote-env-local-docker.js +91 -24
- package/dist/plugins/remote-env-ssh.d.ts +4 -24
- package/dist/plugins/remote-env-ssh.js +4 -3
- package/dist/plugins/resume-anchor-store-sql.js +2 -2
- package/dist/plugins/retention-lane-store-sql.d.ts +1 -1
- package/dist/plugins/retention-lane-store-sql.js +2 -2
- package/dist/plugins/retention-store-sql.d.ts +1 -1
- package/dist/plugins/retention-store-sql.js +6 -6
- package/dist/plugins/run-store-sql.d.ts +3 -3
- package/dist/plugins/run-store-sql.js +19 -18
- package/dist/plugins/sandbox-read-floor.d.ts +273 -0
- package/dist/plugins/sandbox-read-floor.js +608 -0
- package/dist/plugins/schema-consistency.d.ts +6 -6
- package/dist/plugins/schema-consistency.js +1 -1
- package/dist/plugins/schema-ensure-legs.d.ts +2 -3
- package/dist/plugins/schema-ensure-legs.js +2 -2
- package/dist/plugins/schema-live-columns.d.ts +1 -1
- package/dist/plugins/session-capture-record-store-sql.js +1 -1
- package/dist/plugins/session-ownership.d.ts +2 -1
- package/dist/plugins/session-placement.d.ts +17 -4
- package/dist/plugins/session-placement.js +2 -1
- package/dist/plugins/session-rules-column.d.ts +1 -1
- package/dist/plugins/session-rules-column.js +1 -1
- package/dist/plugins/session-store.d.ts +18 -20
- package/dist/plugins/session-store.js +4 -12
- package/dist/plugins/session-workspace-cell.d.ts +1 -1
- package/dist/plugins/session-workspace-cell.js +1 -1
- package/dist/plugins/shared-memory-store-sql.js +2 -2
- package/dist/plugins/sql-driver.d.ts +10 -5
- package/dist/plugins/sql-driver.js +6 -6
- package/dist/plugins/sql-errors.js +1 -1
- package/dist/plugins/store-backend.d.ts +35 -6
- package/dist/plugins/store-backend.js +27 -10
- package/dist/plugins/store-contracts.d.ts +9 -2
- package/dist/plugins/task-list-store-sql.js +11 -11
- package/dist/plugins/tidb-pool.js +7 -6
- package/dist/plugins/tidb-session-storage.js +4 -4
- package/dist/plugins/tidb-session-store.d.ts +4 -1
- package/dist/plugins/tidb-session-store.js +16 -15
- package/dist/plugins/tool-result-store-sql.d.ts +2 -2
- package/dist/plugins/tool-result-store-sql.js +3 -3
- package/dist/plugins/user-input-ledger-sql.js +2 -2
- package/dist/plugins/workflow-journal-store-sql.js +5 -5
- package/dist/plugins/workflow-run-store-sql.js +19 -19
- package/dist/plugins/write-behind-counter.d.ts +2 -3
- package/dist/plugins/write-behind-counter.js +5 -5
- package/dist/resource-suspend.d.ts +14 -12
- package/dist/resource-suspend.js +1 -1
- package/dist/resource-window.d.ts +4 -3
- package/dist/run-cancel-context.d.ts +34 -0
- package/dist/run-cancel-context.js +7 -0
- package/dist/run-local.js +14 -19
- package/dist/runs.d.ts +47 -16
- package/dist/runs.js +112 -113
- package/dist/security.d.ts +2 -2
- package/dist/server-secret-env.d.ts +2 -1
- package/dist/server-secret-env.js +2 -4
- package/dist/session-error-wire.d.ts +22 -4
- package/dist/session-error-wire.js +16 -0
- package/dist/session-incarnation.d.ts +10 -4
- package/dist/session-incarnation.js +1 -1
- package/dist/session-policy-wire.d.ts +1 -1
- package/dist/session-sync-kernel.d.ts +42 -1
- package/dist/session-sync-kernel.js +17 -0
- package/dist/session-sync.js +16 -4
- package/dist/sql-engine-coordinates.d.ts +49 -0
- package/dist/sql-engine-coordinates.js +27 -0
- package/dist/sql-engine-posture.d.ts +1 -1
- package/dist/sql-engine-posture.js +1 -1
- package/dist/standing-answer-grant.d.ts +31 -2
- package/dist/standing-answer-grant.js +14 -2
- package/dist/store-posture.d.ts +1 -1
- package/dist/{plugins → stores-sql}/background-agent-store-sql.d.ts +2 -2
- package/dist/{plugins → stores-sql}/background-agent-store-sql.js +8 -8
- package/dist/{plugins → stores-sql}/session-policy-store-sql.d.ts +7 -5
- package/dist/{plugins → stores-sql}/session-policy-store-sql.js +12 -12
- package/dist/{plugins → stores-sql}/usage-window-store-sql.d.ts +1 -1
- package/dist/{plugins → stores-sql}/usage-window-store-sql.js +3 -3
- package/dist/task-a2a.d.ts +1 -1
- package/dist/task-a2a.js +5 -6
- package/dist/task-mcp.d.ts +21 -8
- package/dist/task-mcp.js +17 -9
- package/dist/task-settings.d.ts +52 -25
- package/dist/task-settings.js +91 -28
- package/dist/terminal.d.ts +103 -19
- package/dist/terminal.js +72 -20
- package/dist/trace/core-keyset-guard.d.ts +79 -2
- package/dist/trace/exit-seat.d.ts +7 -0
- package/dist/trace/exit-seat.js +1 -0
- package/dist/trace/model-segment.d.ts +2 -2
- package/dist/trace/redact.d.ts +3 -1
- package/dist/trace/redact.js +395 -110
- package/dist/trace/self-minted-wire.d.ts +226 -2
- package/dist/trace/self-minted-wire.js +79 -0
- package/dist/verifier-pause-card.d.ts +8 -0
- package/dist/verifier-pause-card.js +19 -0
- package/dist/web-admin-client/apply-effective.d.ts +5 -7
- package/dist/web-admin-client/apply-effective.js +2 -2
- package/dist/web-admin-client/candidate-gate.d.ts +11 -7
- package/dist/web-admin-client/candidate-gate.js +1 -1
- package/dist/web-admin-client/http-client.d.ts +5 -4
- package/dist/web-admin-client/http-client.js +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +7 -17
- package/dist/web-admin-client/read-warnings.js +5 -9
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +3 -2
- package/package.json +2 -2
- package/wire-changes/server@7.140.0.json +184 -0
- package/wire-changes/server@7.141.0.json +367 -0
|
@@ -7,22 +7,22 @@ import { createBudgetAndTracing } from "./budget-tracing.js";
|
|
|
7
7
|
import { createRuleConsentLane } from "../rules-consent.js";
|
|
8
8
|
import { createConsolidationValve } from "./memory-consolidation.js";
|
|
9
9
|
export async function runStage04(ctx) {
|
|
10
|
-
const { backend, breakerState, config, logger, memoryEngine, metrics,
|
|
11
|
-
const memoryBundleFaces = memoryEngine ? createMemoryBundleFaces(memoryEngine, { ...(
|
|
10
|
+
const { backend, breakerState, config, logger, memoryEngine, metrics, sessionCaptureRecords } = ctx;
|
|
11
|
+
const memoryBundleFaces = memoryEngine ? createMemoryBundleFaces(memoryEngine, { ...(sessionCaptureRecords !== undefined ? { captureRecords: sessionCaptureRecords } : {}) }) : undefined;
|
|
12
12
|
const memoryComplianceFaces = memoryEngine
|
|
13
13
|
? createMemoryComplianceFaces(memoryEngine, {
|
|
14
14
|
onIncident: (err) => logger.warn("memory_compliance_incident", { code: err.code ?? null, detail: err.message }),
|
|
15
|
-
...(
|
|
15
|
+
...(sessionCaptureRecords !== undefined ? { captureRecords: sessionCaptureRecords } : {}),
|
|
16
16
|
})
|
|
17
17
|
: undefined;
|
|
18
18
|
const memoryOriginFaces = memoryEngine
|
|
19
19
|
? createMemoryOriginFaces(memoryEngine, {
|
|
20
20
|
onIncident: (err) => logger.warn("memory_origin_incident", { code: err.code ?? null, detail: err.message }),
|
|
21
|
-
...(
|
|
21
|
+
...(sessionCaptureRecords !== undefined ? { captureRecords: sessionCaptureRecords } : {}),
|
|
22
22
|
})
|
|
23
23
|
: undefined;
|
|
24
24
|
const sessionMemoryStatusFace = memoryEngine
|
|
25
|
-
? createSessionMemoryStatusFace(memoryEngine, { ...(
|
|
25
|
+
? createSessionMemoryStatusFace(memoryEngine, { ...(sessionCaptureRecords !== undefined ? { captureRecords: sessionCaptureRecords } : {}) })
|
|
26
26
|
: undefined;
|
|
27
27
|
const { valve: consolidationValve, watch: consolidationSeatWatch } = createConsolidationValve({ config, memoryEngine, logger });
|
|
28
28
|
const adoptionBoot = await runAdoptionBootScan({ backend, logger });
|
|
@@ -56,16 +56,12 @@ export declare function runStage05(ctx: Awaited<ReturnType<typeof runStage04>>):
|
|
|
56
56
|
instanceId: string;
|
|
57
57
|
mailboxRecipientLifecycle: import("../plugins/mailbox-recipient-lifecycle.js").MailboxRecipientLifecycle | undefined;
|
|
58
58
|
mailboxStore: import("@sema-agent/core").MailboxStore | undefined;
|
|
59
|
-
memoryEngine:
|
|
60
|
-
|
|
61
|
-
root: string;
|
|
62
|
-
} | undefined;
|
|
63
|
-
memoryExportBackend: import("@sema-agent/core").MemoryBackend | undefined;
|
|
59
|
+
memoryEngine: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
60
|
+
memoryExportStores: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
64
61
|
memoryPosture: import("../memory-posture.js").MemoryPosture;
|
|
65
62
|
memorySyncCursors: import("../plugins/memory-sync-store-pg.js").MemorySyncStore | undefined;
|
|
66
63
|
memorySyncRunner: import("../memory-sync-client.js").MemorySyncRunner | undefined;
|
|
67
64
|
rosterStore: import("@sema-agent/core").RosterStore | undefined;
|
|
68
|
-
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
69
65
|
sessionCaptureRecords: import("../index.js").SessionCaptureRecordSource | undefined;
|
|
70
66
|
sessionStore: import("@sema-agent/core").SessionStore<import("@sema-agent/core").SessionStoreSummary, import("@sema-agent/core").SessionListQuery>;
|
|
71
67
|
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assembleDeploymentMods } from "./deployment-mods.js";
|
|
2
2
|
import { isBrandedDeployment } from "../capabilities/brand-identity.js";
|
|
3
|
-
import { assertDeviceLaneWired, createDeviceLane } from "./device-lane.js";
|
|
3
|
+
import { assertDeviceLaneWired, createDeviceLane, noteDeviceRelayBindings } from "./device-lane.js";
|
|
4
4
|
import { assertWorkspaceSpaceReadable, createExecutionEnv } from "./execution-env.js";
|
|
5
5
|
import { headReadOf } from "../session-incarnation.js";
|
|
6
6
|
import * as facts from "../capability-facts.js";
|
|
@@ -15,6 +15,8 @@ export async function runStage05(ctx) {
|
|
|
15
15
|
const spaceCommits = backend !== undefined ? () => runStore : undefined;
|
|
16
16
|
const { perTaskImage, sessionEnvSelection, perSessionCwd, setSessionCwd, setSessionShellEnv, setSessionInheritEnv, fenceSessionOwner, dropSessionScoped, executionEnvFactory, worktreeReap, sendUserFileTaskEnvs, lspManager, spaceReclaimer, sandboxSecretSeatGate, sandboxPodReaper, readSandboxGitPlane, } = createExecutionEnv({ config, logger, metrics, taskAttachmentStore, ...(deviceLane ? { deviceLane } : {}), ...(spaceCommits !== undefined ? { spaceCommits } : {}), ...(headOf !== undefined ? { headOf } : {}), ...(backend !== undefined ? { runRows: () => runStore } : {}) });
|
|
17
17
|
assertDeviceLaneWired(config.remoteExec?.provider === "device", deviceLane, executionEnvFactory !== undefined);
|
|
18
|
+
if (deviceLane !== undefined && config.remoteExec?.provider === "device")
|
|
19
|
+
await noteDeviceRelayBindings(config.remoteExec.relay, deviceLane.store, logger);
|
|
18
20
|
assertWorkspaceSpaceReadable(facts.workspaceSpace(config), { headOf, spaceCommits }, facts.workspaceCache(config), sessionStoreLabelOf(config.sessionBackend, backend?.kind));
|
|
19
21
|
if (sandboxSecretSeatGate !== undefined)
|
|
20
22
|
await sandboxSecretSeatGate();
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* 🔴 `runStore` / `parkedAskRedeem` 经 `late-binds.ts` 的晚绑 cell 读(原文同作用域前向引用/晚绑 holder)。
|
|
8
8
|
*/
|
|
9
9
|
import { Runner } from "@sema-agent/core";
|
|
10
|
-
import { ForkRoutingSessionStore } from "../plugins/fork-routing-session-store.js";
|
|
11
10
|
import type { runStage05 } from "./stage-05-execution-env.js";
|
|
12
11
|
export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>): Promise<{
|
|
13
12
|
approvalAskAudit: import("../approval-ask-audit-store.js").FileApprovalAskAuditStore | undefined;
|
|
@@ -44,7 +43,6 @@ export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>):
|
|
|
44
43
|
sqlWorkflowRunStore: import("@sema-agent/core").WorkflowRunStore | undefined;
|
|
45
44
|
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate<import("../approval-gate-currency.js").GateCurrencyStore>;
|
|
46
45
|
subRunner: Runner;
|
|
47
|
-
subRunnerSessions: ForkRoutingSessionStore;
|
|
48
46
|
subagentSteerRegistry: import("../orchestration/subagent-steer.js").SubagentSteerRegistry;
|
|
49
47
|
toolApproval: import("../tool-approval.js").ToolApprovalCoordinator | undefined;
|
|
50
48
|
workflowAgentRegistry: import("../orchestration/workflow-agent-steer.js").WorkflowAgentRegistry | undefined;
|
|
@@ -119,16 +117,12 @@ export declare function runStage06(ctx: Awaited<ReturnType<typeof runStage05>>):
|
|
|
119
117
|
instanceId: string;
|
|
120
118
|
mailboxRecipientLifecycle: import("../plugins/mailbox-recipient-lifecycle.js").MailboxRecipientLifecycle | undefined;
|
|
121
119
|
mailboxStore: import("@sema-agent/core").MailboxStore | undefined;
|
|
122
|
-
memoryEngine:
|
|
123
|
-
|
|
124
|
-
root: string;
|
|
125
|
-
} | undefined;
|
|
126
|
-
memoryExportBackend: import("@sema-agent/core").MemoryBackend | undefined;
|
|
120
|
+
memoryEngine: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
121
|
+
memoryExportStores: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
127
122
|
memoryPosture: import("../memory-posture.js").MemoryPosture;
|
|
128
123
|
memorySyncCursors: import("../plugins/memory-sync-store-pg.js").MemorySyncStore | undefined;
|
|
129
124
|
memorySyncRunner: import("../memory-sync-client.js").MemorySyncRunner | undefined;
|
|
130
125
|
rosterStore: import("@sema-agent/core").RosterStore | undefined;
|
|
131
|
-
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
132
126
|
sessionCaptureRecords: import("../index.js").SessionCaptureRecordSource | undefined;
|
|
133
127
|
sessionStore: import("@sema-agent/core").SessionStore<import("@sema-agent/core").SessionStoreSummary, import("@sema-agent/core").SessionListQuery>;
|
|
134
128
|
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
@@ -30,7 +30,7 @@ import { parkedAskRedeem, runStore } from "./late-binds.js";
|
|
|
30
30
|
import { withInternalRunEnvs } from "../internal-run-env.js";
|
|
31
31
|
import { retentionSweepRuns } from "../plugins/retention-store-sql.js";
|
|
32
32
|
export async function runStage06(ctx) {
|
|
33
|
-
const { backend, backgroundAgentStore, brain, engineDataRoot, peerDesk, config, webAdmin, consolidationValve, deploymentMods, executionEnvFactory, fileHistoryStore, localRoot, logger, lspManager, mailboxRecipientLifecycle, mailboxStore, memoryEngine, memorySyncRunner, metrics, perSessionCwd, permissionRuleProvider, pricing, rosterStore, ruleConsent, sendUserFileTaskEnvs,
|
|
33
|
+
const { backend, backgroundAgentStore, brain, engineDataRoot, peerDesk, config, webAdmin, consolidationValve, deploymentMods, executionEnvFactory, fileHistoryStore, localRoot, logger, lspManager, mailboxRecipientLifecycle, mailboxStore, memoryEngine, memorySyncRunner, metrics, perSessionCwd, permissionRuleProvider, pricing, rosterStore, ruleConsent, sendUserFileTaskEnvs, sessionCaptureRecords, sessionPolicyStore, sessionStore, taskAttachmentStore, taskListLane, toolResultStore, tracer, usageWindowStore } = ctx;
|
|
34
34
|
const { sqlWorkflowRunStore, workflowNotifyJournal, workflowCompletionInbox, deliverWorkflowCompletion, workflowNotifyGate, fleetBus, workflowRunStore, workflowJournalStore, outcomeSink, workflowRecoverOpts, workflowAgentRegistry, subagentSteerRegistry, workflowAgentSessionIndex, workflowParkDecisions, } = createWorkflowOrchestration({ config, logger, metrics, localRoot, backend, getRunStore: () => runStore });
|
|
35
35
|
const parkCommitted = backend?.checkpoint && config.durableApproval ? createParkCommitWatch(backend.checkpoint(logger)) : undefined;
|
|
36
36
|
const checkpointStore = parkCommitted?.store;
|
|
@@ -94,7 +94,7 @@ export async function runStage06(ctx) {
|
|
|
94
94
|
...(config.memoryProvenance !== undefined ? { provenance: config.memoryProvenance } : {}),
|
|
95
95
|
onIncident: (err) => logger.warn("memory_consolidation_incident", { code: err.code ?? null, detail: err.message }),
|
|
96
96
|
onStopDetail: (audit) => logger.warn("memory_consolidation_stop_detail", audit),
|
|
97
|
-
...(
|
|
97
|
+
...(sessionCaptureRecords !== undefined ? { captureRecords: sessionCaptureRecords } : {}),
|
|
98
98
|
writeJudge: createOperatorValveWriteJudge({ ruleStoreProvider: permissionRuleProvider, config }),
|
|
99
99
|
onNotice: createEngineNoticeForwarder(logger, defaultEngineNoticeRouter, metrics),
|
|
100
100
|
})
|
|
@@ -230,6 +230,6 @@ export async function runStage06(ctx) {
|
|
|
230
230
|
onError: runnerDeps.onError ? runnerDeps.onError : undefined,
|
|
231
231
|
};
|
|
232
232
|
const subRunner = new Runner(subRunnerDeps);
|
|
233
|
-
return { ...ctx, approvalAskAudit, approvalExemptionStore, centerRuntimeCapsResolver, checkpointStore, checkpointCtxSealing, parkCommits, durableEnabled, elicitation, fleetBus, governanceSeams, handslessRunner, hookAgent, hookAgentRunner, hookLlm, mcpRevocations, memoryConsolidationFaces, memoryOptOutGrantStore, orgMemoryAdmission, outcomeSink, principalCaps, question, retentionExecutor, retentionLaneStore, runner, runnerDeps, runtimeCapsPeekResolver, sendFileLedger, sendUserFileEmitter, sendUserFileToolSpec, sessionTitler, sharedMemoryStore, sqlWorkflowRunStore, streamApprovalGate, subRunner,
|
|
233
|
+
return { ...ctx, approvalAskAudit, approvalExemptionStore, centerRuntimeCapsResolver, checkpointStore, checkpointCtxSealing, parkCommits, durableEnabled, elicitation, fleetBus, governanceSeams, handslessRunner, hookAgent, hookAgentRunner, hookLlm, mcpRevocations, memoryConsolidationFaces, memoryOptOutGrantStore, orgMemoryAdmission, outcomeSink, principalCaps, question, retentionExecutor, retentionLaneStore, runner, runnerDeps, runtimeCapsPeekResolver, sendFileLedger, sendUserFileEmitter, sendUserFileToolSpec, sessionTitler, sharedMemoryStore, sqlWorkflowRunStore, streamApprovalGate, subRunner, subagentSteerRegistry, toolApproval, workflowAgentRegistry, workflowAgentSessionIndex, workflowCompletionInbox, workflowJournalStore, workflowModelAllowlistSnapshot, workflowParkDecisions, workflowNotifyGate, workflowNotifyJournal, workflowRecoverOpts, workflowRunStore, workflowsCapable, orgDeliveryGate };
|
|
234
234
|
}
|
|
235
235
|
//# sourceMappingURL=stage-06-runners.js.map
|
|
@@ -60,7 +60,6 @@ export declare function runStage07(ctx: Awaited<ReturnType<typeof runStage06>>):
|
|
|
60
60
|
sqlWorkflowRunStore: import("@sema-agent/core").WorkflowRunStore | undefined;
|
|
61
61
|
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate<import("../approval-gate-currency.js").GateCurrencyStore>;
|
|
62
62
|
subRunner: import("@sema-agent/core").Runner;
|
|
63
|
-
subRunnerSessions: import("../plugins/fork-routing-session-store.js").ForkRoutingSessionStore;
|
|
64
63
|
subagentSteerRegistry: import("../orchestration/subagent-steer.js").SubagentSteerRegistry;
|
|
65
64
|
toolApproval: import("../tool-approval.js").ToolApprovalCoordinator | undefined;
|
|
66
65
|
workflowAgentRegistry: import("../orchestration/workflow-agent-steer.js").WorkflowAgentRegistry | undefined;
|
|
@@ -135,16 +134,12 @@ export declare function runStage07(ctx: Awaited<ReturnType<typeof runStage06>>):
|
|
|
135
134
|
instanceId: string;
|
|
136
135
|
mailboxRecipientLifecycle: import("../plugins/mailbox-recipient-lifecycle.js").MailboxRecipientLifecycle | undefined;
|
|
137
136
|
mailboxStore: import("@sema-agent/core").MailboxStore | undefined;
|
|
138
|
-
memoryEngine:
|
|
139
|
-
|
|
140
|
-
root: string;
|
|
141
|
-
} | undefined;
|
|
142
|
-
memoryExportBackend: import("@sema-agent/core").MemoryBackend | undefined;
|
|
137
|
+
memoryEngine: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
138
|
+
memoryExportStores: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
143
139
|
memoryPosture: import("../memory-posture.js").MemoryPosture;
|
|
144
140
|
memorySyncCursors: import("../plugins/memory-sync-store-pg.js").MemorySyncStore | undefined;
|
|
145
141
|
memorySyncRunner: import("../memory-sync-client.js").MemorySyncRunner | undefined;
|
|
146
142
|
rosterStore: import("@sema-agent/core").RosterStore | undefined;
|
|
147
|
-
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
148
143
|
sessionCaptureRecords: import("../index.js").SessionCaptureRecordSource | undefined;
|
|
149
144
|
sessionStore: import("@sema-agent/core").SessionStore<import("@sema-agent/core").SessionStoreSummary, import("@sema-agent/core").SessionListQuery>;
|
|
150
145
|
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DEFAULT_MODEL_REF } from "../model-select.js";
|
|
2
|
-
import { probeSearchBackend, uuidv7 } from "@sema-agent/core";
|
|
2
|
+
import { probeSearchBackend, resolveSubagentTranscriptTier, uuidv7 } from "@sema-agent/core";
|
|
3
3
|
import { selectEnvironmentTool } from "../capabilities/select-environment-tool.js";
|
|
4
4
|
import { subagentSendUserFileExtraTools } from "../capabilities/send-user-file-tool.js";
|
|
5
5
|
import { parseCapEnv, parseNumOrFailNonNegative } from "../config.js";
|
|
6
|
-
import {
|
|
6
|
+
import { attestChildSessionDurable } from "../plugins/session-store.js";
|
|
7
7
|
import { webSearchConfigFromEnv, createWebSearchBackend, shouldProbeWebSearchOnBoot } from "../plugins/web-search.js";
|
|
8
8
|
import { createAuthorizer } from "../security.js";
|
|
9
|
-
import { buildForceDurableGateInertNotice, buildNoResponderBootWarns, gateIntentUnserviceableReason, singleUserAutoAcceptBaselineApplies } from "../approval.js";
|
|
9
|
+
import { buildForceDurableGateInertNotice, buildNoResponderBootWarns, buildSingleUserDefaultPostureNotice, gateIntentUnserviceableReason, singleUserAutoAcceptBaselineApplies } from "../approval.js";
|
|
10
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";
|
|
@@ -29,7 +29,7 @@ import { buildDisplaySafeUrl } from "../trace/redact.js";
|
|
|
29
29
|
import * as facts from "../capability-facts.js";
|
|
30
30
|
import { WEB_ADMIN_ENV } from "@sema-agent/settings-schema";
|
|
31
31
|
export async function runStage07(ctx) {
|
|
32
|
-
const { approvalAskAudit, approvalExemptionStore, backend, backgroundAgentStore, brain, checkpointStore, config, webAdmin, counterDegradeHook, peerDesk, durableEnabled, instanceId, localRoot, logger, question, runner, runnerDeps, sendUserFileToolSpec, sessionEnvSelection, sessionStore, subRunner,
|
|
32
|
+
const { approvalAskAudit, approvalExemptionStore, backend, backgroundAgentStore, brain, checkpointStore, config, webAdmin, counterDegradeHook, peerDesk, durableEnabled, instanceId, localRoot, logger, question, runner, runnerDeps, sendUserFileToolSpec, sessionEnvSelection, sessionStore, subRunner, taskListLane, toolApproval } = ctx;
|
|
33
33
|
const authorize = createAuthorizer(config, sessionStore);
|
|
34
34
|
const runStore = backend ? backend.run() : undefined;
|
|
35
35
|
bindRunStore(runStore);
|
|
@@ -126,10 +126,8 @@ export async function runStage07(ctx) {
|
|
|
126
126
|
}))
|
|
127
127
|
logger.warn(w.event, w.fields);
|
|
128
128
|
if (singleUserAutoAcceptBaselineApplies(config)) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
tighten: "APPROVAL_REQUIRE / AUTONOMY / commandPolicy (re-surfaces + gates specific surfaces)",
|
|
132
|
-
});
|
|
129
|
+
const posture = buildSingleUserDefaultPostureNotice();
|
|
130
|
+
logger.info(posture.event, posture.fields);
|
|
133
131
|
}
|
|
134
132
|
if (config.directDoorActive)
|
|
135
133
|
logger.info("direct_door_active", { iss: config.principalJwtIss, aud: config.principalJwtAud, operators: config.operatorPrincipals.length });
|
|
@@ -169,8 +167,8 @@ export async function runStage07(ctx) {
|
|
|
169
167
|
})
|
|
170
168
|
.catch((e) => logger.warn("web_search_probe_failed", { provider: webSearchCfg.provider, error: e instanceof Error ? e.message : String(e) }));
|
|
171
169
|
}
|
|
172
|
-
const ensureChildSessionDurable = checkpointStore &&
|
|
173
|
-
? (sessionId, root) =>
|
|
170
|
+
const ensureChildSessionDurable = checkpointStore && resolveSubagentTranscriptTier(backgroundAgentStore !== undefined, sessionStore) === "full"
|
|
171
|
+
? (sessionId, root) => attestChildSessionDurable(sessionStore, sessionId, root, logger)
|
|
174
172
|
: undefined;
|
|
175
173
|
const webFetchSummarize = createWebFetchSummarizeLane({ brain, config, getKeyResolver: () => webAdmin.getKeyResolver(), logger });
|
|
176
174
|
const scenarioDeps = {
|
|
@@ -73,7 +73,6 @@ export declare function runStage08(ctx: Awaited<ReturnType<typeof runStage07>>):
|
|
|
73
73
|
sqlWorkflowRunStore: import("@sema-agent/core").WorkflowRunStore | undefined;
|
|
74
74
|
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate<import("../approval-gate-currency.js").GateCurrencyStore>;
|
|
75
75
|
subRunner: Runner;
|
|
76
|
-
subRunnerSessions: import("../plugins/fork-routing-session-store.js").ForkRoutingSessionStore;
|
|
77
76
|
subagentSteerRegistry: import("../orchestration/subagent-steer.js").SubagentSteerRegistry;
|
|
78
77
|
toolApproval: import("../tool-approval.js").ToolApprovalCoordinator | undefined;
|
|
79
78
|
workflowAgentRegistry: import("../orchestration/workflow-agent-steer.js").WorkflowAgentRegistry | undefined;
|
|
@@ -148,16 +147,12 @@ export declare function runStage08(ctx: Awaited<ReturnType<typeof runStage07>>):
|
|
|
148
147
|
instanceId: string;
|
|
149
148
|
mailboxRecipientLifecycle: import("../plugins/mailbox-recipient-lifecycle.js").MailboxRecipientLifecycle | undefined;
|
|
150
149
|
mailboxStore: import("@sema-agent/core").MailboxStore | undefined;
|
|
151
|
-
memoryEngine:
|
|
152
|
-
|
|
153
|
-
root: string;
|
|
154
|
-
} | undefined;
|
|
155
|
-
memoryExportBackend: import("@sema-agent/core").MemoryBackend | undefined;
|
|
150
|
+
memoryEngine: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
151
|
+
memoryExportStores: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
156
152
|
memoryPosture: import("../memory-posture.js").MemoryPosture;
|
|
157
153
|
memorySyncCursors: import("../plugins/memory-sync-store-pg.js").MemorySyncStore | undefined;
|
|
158
154
|
memorySyncRunner: import("../memory-sync-client.js").MemorySyncRunner | undefined;
|
|
159
155
|
rosterStore: import("@sema-agent/core").RosterStore | undefined;
|
|
160
|
-
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
161
156
|
sessionCaptureRecords: import("../index.js").SessionCaptureRecordSource | undefined;
|
|
162
157
|
sessionStore: import("@sema-agent/core").SessionStore<import("@sema-agent/core").SessionStoreSummary, import("@sema-agent/core").SessionListQuery>;
|
|
163
158
|
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
@@ -97,7 +97,6 @@ export declare function runStage09(ctx: Awaited<ReturnType<typeof runStage08>>):
|
|
|
97
97
|
sqlWorkflowRunStore: import("@sema-agent/core").WorkflowRunStore | undefined;
|
|
98
98
|
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate<import("../approval-gate-currency.js").GateCurrencyStore>;
|
|
99
99
|
subRunner: import("@sema-agent/core").Runner;
|
|
100
|
-
subRunnerSessions: import("../plugins/fork-routing-session-store.js").ForkRoutingSessionStore;
|
|
101
100
|
subagentSteerRegistry: import("../orchestration/subagent-steer.js").SubagentSteerRegistry;
|
|
102
101
|
toolApproval: import("../tool-approval.js").ToolApprovalCoordinator | undefined;
|
|
103
102
|
workflowAgentRegistry: import("../orchestration/workflow-agent-steer.js").WorkflowAgentRegistry | undefined;
|
|
@@ -172,16 +171,12 @@ export declare function runStage09(ctx: Awaited<ReturnType<typeof runStage08>>):
|
|
|
172
171
|
instanceId: string;
|
|
173
172
|
mailboxRecipientLifecycle: import("../plugins/mailbox-recipient-lifecycle.js").MailboxRecipientLifecycle | undefined;
|
|
174
173
|
mailboxStore: import("@sema-agent/core").MailboxStore | undefined;
|
|
175
|
-
memoryEngine:
|
|
176
|
-
|
|
177
|
-
root: string;
|
|
178
|
-
} | undefined;
|
|
179
|
-
memoryExportBackend: import("@sema-agent/core").MemoryBackend | undefined;
|
|
174
|
+
memoryEngine: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
175
|
+
memoryExportStores: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
180
176
|
memoryPosture: import("../memory-posture.js").MemoryPosture;
|
|
181
177
|
memorySyncCursors: import("../plugins/memory-sync-store-pg.js").MemorySyncStore | undefined;
|
|
182
178
|
memorySyncRunner: import("../memory-sync-client.js").MemorySyncRunner | undefined;
|
|
183
179
|
rosterStore: import("@sema-agent/core").RosterStore | undefined;
|
|
184
|
-
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
185
180
|
sessionCaptureRecords: import("../index.js").SessionCaptureRecordSource | undefined;
|
|
186
181
|
sessionStore: import("@sema-agent/core").SessionStore<import("@sema-agent/core").SessionStoreSummary, import("@sema-agent/core").SessionListQuery>;
|
|
187
182
|
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
@@ -96,7 +96,6 @@ export declare function runStage10(ctx: Awaited<ReturnType<typeof runStage09>>):
|
|
|
96
96
|
sqlWorkflowRunStore: import("@sema-agent/core").WorkflowRunStore | undefined;
|
|
97
97
|
streamApprovalGate: import("../tool-approval.js").StreamApprovalGate<import("../approval-gate-currency.js").GateCurrencyStore>;
|
|
98
98
|
subRunner: import("@sema-agent/core").Runner;
|
|
99
|
-
subRunnerSessions: import("../plugins/fork-routing-session-store.js").ForkRoutingSessionStore;
|
|
100
99
|
subagentSteerRegistry: import("../orchestration/subagent-steer.js").SubagentSteerRegistry;
|
|
101
100
|
toolApproval: import("../tool-approval.js").ToolApprovalCoordinator | undefined;
|
|
102
101
|
workflowAgentRegistry: import("../orchestration/workflow-agent-steer.js").WorkflowAgentRegistry | undefined;
|
|
@@ -171,16 +170,12 @@ export declare function runStage10(ctx: Awaited<ReturnType<typeof runStage09>>):
|
|
|
171
170
|
instanceId: string;
|
|
172
171
|
mailboxRecipientLifecycle: import("../plugins/mailbox-recipient-lifecycle.js").MailboxRecipientLifecycle | undefined;
|
|
173
172
|
mailboxStore: import("@sema-agent/core").MailboxStore | undefined;
|
|
174
|
-
memoryEngine:
|
|
175
|
-
|
|
176
|
-
root: string;
|
|
177
|
-
} | undefined;
|
|
178
|
-
memoryExportBackend: import("@sema-agent/core").MemoryBackend | undefined;
|
|
173
|
+
memoryEngine: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
174
|
+
memoryExportStores: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
179
175
|
memoryPosture: import("../memory-posture.js").MemoryPosture;
|
|
180
176
|
memorySyncCursors: import("../plugins/memory-sync-store-pg.js").MemorySyncStore | undefined;
|
|
181
177
|
memorySyncRunner: import("../memory-sync-client.js").MemorySyncRunner | undefined;
|
|
182
178
|
rosterStore: import("@sema-agent/core").RosterStore | undefined;
|
|
183
|
-
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
184
179
|
sessionCaptureRecords: import("../plugins/store-backend.js").SessionCaptureRecordSource | undefined;
|
|
185
180
|
sessionStore: import("@sema-agent/core").SessionStore<import("@sema-agent/core").SessionStoreSummary, import("@sema-agent/core").SessionListQuery>;
|
|
186
181
|
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
@@ -7,6 +7,7 @@ import { isPricingConfigured } from "../budget.js";
|
|
|
7
7
|
import { createHandsRunnerSelector } from "../capabilities/hands-lane.js";
|
|
8
8
|
import { createHttpServer } from "../http/server.js";
|
|
9
9
|
import { exportMemoryScope } from "../memory-export.js";
|
|
10
|
+
import { memoryStoreForRequest } from "../memory-scope-stores.js";
|
|
10
11
|
import { performMemorySync } from "../memory-sync.js";
|
|
11
12
|
import { backgroundAgentOutput, taskHandleOutput, taskHandleStop } from "../runs.js";
|
|
12
13
|
import { createStoreLiveProbe } from "../store-live-probe.js";
|
|
@@ -29,7 +30,7 @@ import { bindServerLateSeats } from "./late-binds.js";
|
|
|
29
30
|
import { serviceVersion } from "../service-version.js";
|
|
30
31
|
import { buildDisplaySafeUrl } from "../trace/redact.js";
|
|
31
32
|
export async function runStage10(ctx) {
|
|
32
|
-
const { peerDesk, approvalAskAudit, approvalExemptionStore, approvalNonceStore, authorize, backend, backgroundAgentStore, brain, breakerState, centerRuntimeCapsResolver, checkpointStore, checkpointCtxSealing, parkCommits, config, webAdmin, consolidationValve, costQuota, deploymentModsLoaded, deviceLane, drainState, durableEnabled, elicitation, fenceSessionOwner, fileHistoryStore, fleetBus, fleetLease, fleetUsage, governanceSeams, handslessRunner, hookAgent, hookLlm, hookWakeBus, imageBakes, imageIndex, instanceId, instrumentDegenerate, leaderEndpoint, loadedSkills, localRoot, logger, lspManager, mcpRevocations, memoryBundleFaces, memoryComplianceFaces, memoryConsolidationFaces, memoryEngine,
|
|
33
|
+
const { peerDesk, approvalAskAudit, approvalExemptionStore, approvalNonceStore, authorize, backend, backgroundAgentStore, brain, breakerState, centerRuntimeCapsResolver, checkpointStore, checkpointCtxSealing, parkCommits, config, webAdmin, consolidationValve, costQuota, deploymentModsLoaded, deviceLane, drainState, durableEnabled, elicitation, fenceSessionOwner, fileHistoryStore, fleetBus, fleetLease, fleetUsage, governanceSeams, handslessRunner, hookAgent, hookLlm, hookWakeBus, imageBakes, imageIndex, instanceId, instrumentDegenerate, leaderEndpoint, loadedSkills, localRoot, logger, lspManager, mcpRevocations, memoryBundleFaces, memoryComplianceFaces, memoryConsolidationFaces, memoryEngine, memoryExportStores, 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, sandboxGitPlane, scenarioDetails, scenarios, selectEnvTool, sendFileLedger, sendUserFileEmitter, sendUserFileToolSpec, sessionAudit, sessionEnvSelection, sessionMemoryStatusFace, sessionPolicyStore, sessionTitler, sessionWatchRegistry, setSessionCwd, setSessionInheritEnv, setSessionShellEnv, sharedMemoryStore, sideQueryAccounting, sqlEngine, sqlWorkflowRunStore, staticWiring, storePosture, subRunner, subagentSteerRegistry, taskAttachmentStore, taskLimitCaps, taskTimeoutSec, toolApproval, toolResultStore, usageWindowStore, userInputLedger, webSearchProvider, workflowAgentRegistry, workflowAgentSessionIndex, workflowParkDecisions, workflowCompletionInbox, workflowJournalStore, workflowModelAllowlistSnapshot, workflowNotifyGate, workflowNotifyJournal, workflowRecoverOpts, workflowRunStore, workflowsCapable, orgDeliveryGate } = ctx;
|
|
33
34
|
const stores = {
|
|
34
35
|
runStore,
|
|
35
36
|
resumeAnchorStore: resumeAnchorStore ? resumeAnchorStore : undefined,
|
|
@@ -86,15 +87,16 @@ export async function runStage10(ctx) {
|
|
|
86
87
|
subagentTaskOutput: (handle, access) => backgroundAgentOutput(defaultTaskRegistry, handle, access, backgroundAgentStore),
|
|
87
88
|
taskHandleOutput: (handle, access) => taskHandleOutput(defaultTaskRegistry, handle, access, backgroundAgentStore),
|
|
88
89
|
taskHandleStop: (handle, access) => taskHandleStop(defaultTaskRegistry, handle, access, backgroundAgentStore),
|
|
89
|
-
memoryExport:
|
|
90
|
-
memorySync:
|
|
91
|
-
? (scope, syncReq) => performMemorySync(
|
|
90
|
+
memoryExport: memoryExportStores ? (scope) => exportMemoryScope(memoryStoreForRequest(memoryExportStores, [scope]), scope) : undefined,
|
|
91
|
+
memorySync: memoryExportStores && memorySyncCursors
|
|
92
|
+
? (scope, syncReq) => performMemorySync(memoryStoreForRequest(memoryExportStores, [scope]), memorySyncCursors, scope, syncReq)
|
|
92
93
|
: undefined,
|
|
93
94
|
memoryBundleExport: memoryBundleFaces ? memoryBundleFaces.exportScopes : undefined,
|
|
94
95
|
memoryBundleImport: memoryBundleFaces ? memoryBundleFaces.importBundle : undefined,
|
|
95
96
|
memoryCompliance: memoryComplianceFaces,
|
|
96
97
|
memoryOriginFace: memoryOriginFaces,
|
|
97
98
|
sessionMemoryStatus: sessionMemoryStatusFace,
|
|
99
|
+
memorySyncLeg: memorySyncRunner,
|
|
98
100
|
memoryAutoConsolidationArmed: autoRunOnRecommendationEffective(runnerDeps),
|
|
99
101
|
memoryConsolidationValve: consolidationValve,
|
|
100
102
|
memoryConsolidation: memoryConsolidationFaces,
|
package/dist/boot/stores.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type MemoryBackend } from "@sema-agent/core";
|
|
2
1
|
import type { ServiceConfig } from "../config.js";
|
|
3
2
|
import { type MemorySyncRunner } from "../memory-sync-client.js";
|
|
4
3
|
import type { Logger } from "../observability/logger.js";
|
|
@@ -7,6 +6,7 @@ import { type MemorySyncStore } from "../plugins/memory-sync-store-pg.js";
|
|
|
7
6
|
import { type MailboxRecipientLifecycle } from "../plugins/mailbox-recipient-lifecycle.js";
|
|
8
7
|
import { type TaskAttachmentStore } from "../plugins/task-attachment-store.js";
|
|
9
8
|
import { type StoreBackend } from "../plugins/store-backend.js";
|
|
9
|
+
import { type MemoryScopeStores } from "../memory-scope-stores.js";
|
|
10
10
|
export interface OpenStoresCtx {
|
|
11
11
|
config: ServiceConfig;
|
|
12
12
|
logger: Logger;
|
|
@@ -24,10 +24,7 @@ export declare function assertApprovalAskRuleMaterialOnBackend(backend: StoreBac
|
|
|
24
24
|
export declare function openStores(ctx: OpenStoresCtx): Promise<{
|
|
25
25
|
backend: StoreBackend | undefined;
|
|
26
26
|
storePosture: import("../store-posture.js").StorePosture;
|
|
27
|
-
memoryEngine:
|
|
28
|
-
backend: MemoryBackend;
|
|
29
|
-
root: string;
|
|
30
|
-
} | undefined;
|
|
27
|
+
memoryEngine: MemoryScopeStores | undefined;
|
|
31
28
|
engineDataRoot: string;
|
|
32
29
|
memorySyncCursors: MemorySyncStore | undefined;
|
|
33
30
|
rosterStore: import("@sema-agent/core").RosterStore | undefined;
|
|
@@ -35,7 +32,7 @@ export declare function openStores(ctx: OpenStoresCtx): Promise<{
|
|
|
35
32
|
mailboxRecipientLifecycle: MailboxRecipientLifecycle | undefined;
|
|
36
33
|
taskAttachmentStore: TaskAttachmentStore | undefined;
|
|
37
34
|
mailboxStore: import("@sema-agent/core").MailboxStore | undefined;
|
|
38
|
-
|
|
35
|
+
memoryExportStores: MemoryScopeStores | undefined;
|
|
39
36
|
memorySyncRunner: MemorySyncRunner | undefined;
|
|
40
37
|
sessionStore: import("@sema-agent/core").SessionStore<import("@sema-agent/core").SessionStoreSummary, import("@sema-agent/core").SessionListQuery>;
|
|
41
38
|
breakerState: import("../plugins/breaker-state-sql.js").TiDBBreakerState | import("../plugins/breaker-state-sql.js").PgBreakerState | undefined;
|