@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
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* `memory_harvest_rejections_total{code}` + 一条 warn,见 `boot/runner-deps.ts` 的 harvest 报告站点),
|
|
41
41
|
* 等下一次非受限会话走正常门收编。
|
|
42
42
|
* ⚠️ **这一层只在 file 记忆引擎上**(受限视图 = `FileMemoryEngineBackend` 的实装,`materialize` 取它是
|
|
43
|
-
* `?? this.backend` 的可选 seam):`MEMORY_ENGINE_BACKEND=pg|
|
|
43
|
+
* `?? this.backend` 的可选 seam):`MEMORY_ENGINE_BACKEND=pg|mysql` 的两条腿读侧走库、盘上只是每任务投影,
|
|
44
44
|
* 没有「读磁盘即收编」的通道,`false` 在它们上仍买到披露/写门/零收编 harvest 三件。
|
|
45
45
|
* ⚠️ **口径别混**:受限 = **会话级 verdict 单键**(declared-false 那一个键);`writeScope:null` 的只读
|
|
46
46
|
* **平面**(请求键 `memoryWrite:false` 的 per-run 暂停 / org 层默认只读 / 双根非写面)**保持 adopt-on-read
|
|
@@ -56,35 +56,6 @@
|
|
|
56
56
|
*/
|
|
57
57
|
import { type ExecutionLane, type RemoteExecProvider } from "../execution-lane-caps.js";
|
|
58
58
|
import type { MemoryEngineBackend } from "@sema-agent/settings-schema/execution-lanes";
|
|
59
|
-
/**
|
|
60
|
-
* [ref] A3 源头修(黑板 [ref]/[ref]/[ref],[ref])—— `memoryPersistenceCapable` 的**装配层有效值**:
|
|
61
|
-
* operator 显式 env 恒赢;env 缺席时,`REMOTE_EXEC=host` 腿自动补 `true`;其余一律缺席(现行为)。
|
|
62
|
-
*
|
|
63
|
-
* ## 为什么 host 腿可以自动声明(而且只有 host 腿)
|
|
64
|
-
* core r13/r14 的 withhold 判据是「执行环境暴露 remote 面」——它对 host 腿是**误伤**:host 腿的文件
|
|
65
|
-
* 工具就跑在**这台机器**的 fs 上(`hostSemanticsLane`,与 core 的 remote 判决是两根轴,见下方 facts 注),
|
|
66
|
-
* 记忆根也在这台机器上,「执行车道与记忆根共享文件平面」这个 capable=true 所断言的**车道级事实**由
|
|
67
|
-
* 构造成立。剩下的围栏维(记忆根是否落在该次任务的 fs 授权边界内)在 in-process 上**同样存在**而 core
|
|
68
|
-
* 并不 withhold——它由本模块的 ② 号 warn、fs 门的 `path_not_in_root` 拒绝、以及 core 准入席自动放行写家
|
|
69
|
-
* ([ref])这套既有处置管,不归 withhold 判据管。所以 host 腿自动 true 与 in-process 的默认行为**同等诚实**。
|
|
70
|
-
* 沙箱腿(e2b/k8s/ssh/local-docker)文件平面在沙箱盘,withhold 是对的,恒不自动。
|
|
71
|
-
*
|
|
72
|
-
* ## 为什么不是「围栏覆盖记忆根」的更严合取
|
|
73
|
-
* boot 期对 host 腿**算不出**围栏根(host factory 每任务另铸 `sema-host-*` 子目录、per-session cwd 可整个
|
|
74
|
-
* 换掉 workspaceBase——见 boot/stores.ts 的 codex 已核注释),那个合取在恰恰需要它的腿上永不可满足;
|
|
75
|
-
* 而且它断言的是 per-task 事实,不是本键的车道级语义。
|
|
76
|
-
*
|
|
77
|
-
* ## 位置与纪律
|
|
78
|
-
* 单源:resolve-spec 的 spec 直通(引擎据它判「本会话没有持久记忆」的披露与四只记忆面臂)、boot 审计的 declared 位
|
|
79
|
-
* 两处都必须读本函数,禁各自重算(operator-knob 律:显式 env 的优先权在这一个函数里执法一次)。
|
|
80
|
-
* 自动补位在 boot 日志上必须可见(stores.ts 的 info 行),部署方随时可用显式 env 覆盖。
|
|
81
|
-
*/
|
|
82
|
-
export declare function effectiveMemoryPersistenceCapable(config: {
|
|
83
|
-
remoteExec?: {
|
|
84
|
-
provider?: string;
|
|
85
|
-
};
|
|
86
|
-
memoryPersistenceCapable?: boolean;
|
|
87
|
-
}): boolean | undefined;
|
|
88
59
|
/** boot 期可知的全部事实。每一位都必须由调用点从真配置/真装配结果取,禁在本模块内重算(重算=第二真源)。 */
|
|
89
60
|
export interface MemoryWriteBoundaryFacts {
|
|
90
61
|
/** 引擎的**挂载平面**根 —— 引擎真正读写条目的那棵树,由 `memoryMountRootOf(backend, root)` 单铸点取
|
|
@@ -97,21 +68,14 @@ export interface MemoryWriteBoundaryFacts {
|
|
|
97
68
|
memoryRoot: string | undefined;
|
|
98
69
|
/** 执行车道名,只进文案(归一读口 `executionLaneOf` 的答案;[ref] 起不在调用点手写 `?? "in-process"`)。 */
|
|
99
70
|
lane: ExecutionLane;
|
|
100
|
-
/**
|
|
101
|
-
*
|
|
102
|
-
* [medium] 就是把它们当成一根轴的后果):`host` 车道的文件平面就是本机(这一位 true),但 core 眼里它
|
|
103
|
-
* 仍是 remote(那一位也 true)。 */
|
|
71
|
+
/** 该车道的路径是不是本机的文件(执行环境块 `hostLocalPaths`:in-process 的桩块 / `REMOTE_EXEC=host` 为真)。false = 沙箱 / 远端 / 设备盘,
|
|
72
|
+
* 与记忆根分平面 —— 引擎在这一形上不教 `# Memory` 写指令(除非部署声明 `memoryPersistenceCapable: true`),判的是同一键。 */
|
|
104
73
|
hostSemanticsLane: boolean;
|
|
105
|
-
/** core 的 `isRemoteExecutionEnv` 对本部署执行环境的判决 —— 判别位 = `REMOTE_EXEC` 有没有设(**含
|
|
106
|
-
* `host`**:core 的判别是鸭子类型,`remote-env-host.ts` 把那几件全实现了,亲验坐实)。
|
|
107
|
-
* 5.26.0 的 r13/r14 收窄按的是**这一位**,不是文件平面:凡 core 判 remote,`# Memory` 写指令一律撤,
|
|
108
|
-
* 除非声明 `memoryPersistenceCapable: true`。 */
|
|
109
|
-
coreRemoteExecutionEnv: boolean;
|
|
110
74
|
/** 部署声明 `MEMORY_PERSISTENCE_CAPABLE`(三态)。两极都让本模块闭嘴,但理由不同 —— 见各臂注释。 */
|
|
111
75
|
declaredCapable: boolean | undefined;
|
|
112
76
|
/** 本部署的记忆引擎后端(`config.memoryEngineBackend`)。**只进文案**,不参与任何判决 —— 它在这里的
|
|
113
77
|
* 唯一作用是把「怎么把根挪进围栏」这句话指向**在该腿上真的有效**的那个旋钮:`MEMORY_ENGINE_DIR` 只被
|
|
114
|
-
* file 腿读(memory-scope 的 `resolveMemoryEngineRoot`),pg/
|
|
78
|
+
* file 腿读(memory-scope 的 `resolveMemoryEngineRoot`),pg/mysql 腿的根是
|
|
115
79
|
* `<LOCAL_DATA_ROOT|数据根>/memory-work`(boot/stores.ts 两支),那条腿上指 MEMORY_ENGINE_DIR 是让
|
|
116
80
|
* operator 去拧一个不接线的旋钮 —— 修不好还以为自己修了。 */
|
|
117
81
|
engineBackend: MemoryEngineBackend;
|
|
@@ -119,31 +83,30 @@ export interface MemoryWriteBoundaryFacts {
|
|
|
119
83
|
containmentRoots: readonly string[];
|
|
120
84
|
}
|
|
121
85
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* · `
|
|
126
|
-
*
|
|
127
|
-
* 读数逐车道不变(对账:`test/execution-lane-caps.test.ts` 的真装配点联合覆盖格)。`processCwd` 由调用点传
|
|
128
|
-
* (stores 传 `process.cwd()`),本函数保持纯。
|
|
86
|
+
* 审计的**车道三位**由本函数派生(boot/stores.ts 的装配点只调它,不就地手写):
|
|
87
|
+
* · `lane` ⇐ 归一读口 `executionLaneOf`;
|
|
88
|
+
* · `hostSemanticsLane` ⇐ 执行环境块 `hostLocalPaths`(唯一作者 `capabilitiesFor`;引擎撤不撤写指令读的是同一键);
|
|
89
|
+
* · `containmentRoots` ⇐ 只有 in-process 给得出(见下)。
|
|
90
|
+
* `processCwd` 由调用点传(stores 传 `process.cwd()`),本函数保持纯。
|
|
129
91
|
*/
|
|
130
92
|
export declare function buildMemoryBoundaryLaneFacts(config: {
|
|
131
93
|
readonly remoteExec?: {
|
|
132
94
|
readonly provider: RemoteExecProvider;
|
|
95
|
+
readonly s3Snapshot?: unknown;
|
|
133
96
|
} | undefined;
|
|
134
|
-
}, processCwd: string): Pick<MemoryWriteBoundaryFacts, "lane" | "hostSemanticsLane" | "
|
|
97
|
+
}, processCwd: string): Pick<MemoryWriteBoundaryFacts, "lane" | "hostSemanticsLane" | "containmentRoots">;
|
|
135
98
|
/** 一条启动告警:`tag` 进日志事件名(可被运维按名过滤/告警),`detail` 是给人读的整句(含恢复路径)。 */
|
|
136
99
|
export interface MemoryWriteBoundaryWarning {
|
|
137
100
|
tag: "memory_root_outside_write_boundary" | "memory_remote_lane_write_instruction_dropped";
|
|
138
101
|
detail: string;
|
|
139
102
|
}
|
|
140
103
|
/**
|
|
141
|
-
* 判两件事,互斥(
|
|
104
|
+
* 判两件事,互斥(路径不是本机的车道上不叠围栏话 —— 围栏根本不在这台机器上,说了是噪音):
|
|
142
105
|
*
|
|
143
|
-
* ①
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
* ②
|
|
106
|
+
* ① **路径不是本机的车道**(块 `hostLocalPaths` 为假:沙箱 / 远端 / 设备;记忆引擎在这里只可能因为 `MEMORY_ENGINE_REMOTE_LANE=allow`
|
|
107
|
+
* 或 DB 记忆面才在):引擎不教 `# Memory` 写指令(手带够不着本机的记忆根),官方恢复路径是声明 `memoryPersistenceCapable: true`。
|
|
108
|
+
* 未声明 ⇒ 点名 warn,把恢复旋钮写进句子里。
|
|
109
|
+
* ② **路径是本机的车道**(in-process / host):记忆根不在任何一个已知围栏根内 ⇒ 模型被教着往一个 fs 工具够不到的路径写。
|
|
147
110
|
*
|
|
148
111
|
* 两极声明都让本模块闭嘴,但理由不同,别合并:
|
|
149
112
|
* · `true` = operator 自证有推断看不见的持久通道(共享挂载 / 自定义 writer),我们的结构判断本就不该
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { resolve } from "node:path";
|
|
2
|
-
import {
|
|
3
|
-
export function effectiveMemoryPersistenceCapable(config) {
|
|
4
|
-
if (config.memoryPersistenceCapable !== undefined)
|
|
5
|
-
return config.memoryPersistenceCapable;
|
|
6
|
-
return config.remoteExec?.provider === "host" ? true : undefined;
|
|
7
|
-
}
|
|
2
|
+
import { capabilitiesFor, executionLaneOf } from "../execution-lane-caps.js";
|
|
8
3
|
export function buildMemoryBoundaryLaneFacts(config, processCwd) {
|
|
9
4
|
const lane = executionLaneOf(config.remoteExec?.provider);
|
|
10
|
-
const caps = executionLaneCaps(lane);
|
|
11
5
|
return {
|
|
12
6
|
lane,
|
|
13
|
-
hostSemanticsLane:
|
|
14
|
-
coreRemoteExecutionEnv: laneWiresExecutionEnv(lane),
|
|
7
|
+
hostSemanticsLane: capabilitiesFor(config).hostLocalPaths,
|
|
15
8
|
containmentRoots: lane === "in-process" ? [processCwd] : [],
|
|
16
9
|
};
|
|
17
10
|
}
|
|
@@ -21,25 +14,22 @@ function isInside(child, root) {
|
|
|
21
14
|
return c === r || c.startsWith(r === "/" ? "/" : `${r}/`);
|
|
22
15
|
}
|
|
23
16
|
export function buildMemoryWriteBoundaryAudit(facts) {
|
|
24
|
-
const { memoryRoot, lane, hostSemanticsLane,
|
|
17
|
+
const { memoryRoot, lane, hostSemanticsLane, declaredCapable, containmentRoots, engineBackend } = facts;
|
|
25
18
|
if (memoryRoot === undefined)
|
|
26
19
|
return { warnings: [] };
|
|
27
20
|
if (declaredCapable !== undefined)
|
|
28
21
|
return { warnings: [] };
|
|
29
|
-
if (
|
|
30
|
-
const plane = hostSemanticsLane
|
|
31
|
-
? `the model's file tools DO run on this worker's filesystem, but core classifies this execution environment as ` +
|
|
32
|
-
`remote (it exposes the remote-env surface), so the instruction is withheld anyway`
|
|
33
|
-
: `the model's file tools write the SANDBOX filesystem while the memory root (${memoryRoot}) lives on this worker`;
|
|
22
|
+
if (!hostSemanticsLane) {
|
|
34
23
|
return {
|
|
35
24
|
warnings: [
|
|
36
25
|
{
|
|
37
26
|
tag: "memory_remote_lane_write_instruction_dropped",
|
|
38
|
-
detail: `the memory engine is wired over the "${lane}" execution lane and
|
|
39
|
-
`
|
|
40
|
-
`
|
|
41
|
-
`the
|
|
42
|
-
`MEMORY_PERSISTENCE_CAPABLE=
|
|
27
|
+
detail: `the memory engine is wired over the "${lane}" execution lane and the model's file tools write the SANDBOX filesystem ` +
|
|
28
|
+
`while the memory root (${memoryRoot}) lives on this worker. The engine withholds the "# Memory" WRITE instruction when ` +
|
|
29
|
+
`the execution environment's paths are not this worker's files, so this deployment reads memory but does not teach ` +
|
|
30
|
+
`the model how to save into it. If this lane genuinely reaches the memory root, declare it: ` +
|
|
31
|
+
`MEMORY_PERSISTENCE_CAPABLE=true restores the write instruction. If it does not, MEMORY_PERSISTENCE_CAPABLE=false ` +
|
|
32
|
+
`makes the read-only state explicit to the model instead of leaving it silent.`,
|
|
43
33
|
},
|
|
44
34
|
],
|
|
45
35
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type LaneHomeDeployment } from "../execution-lane-caps.js";
|
|
2
|
+
import { type MemoryScopeStores } from "../memory-scope-stores.js";
|
|
3
|
+
import type { SessionCaptureRecordSource } from "../plugins/store-backend.js";
|
|
2
4
|
import type { RestartSliceCtx } from "../web-admin-client/restart-signal.js";
|
|
3
5
|
import type { MemoryConsolidationDriverConfig, ServiceConfig } from "../config-types.js";
|
|
4
|
-
import { resolveMemoryConsolidationDriver, type ConsolidationWriteJudge, type ConsolidationWriteJudgeInput, type EngineNotice, type ConsolidationDriverRunRow, type ConsolidationRunReceipt, type
|
|
6
|
+
import { resolveMemoryConsolidationDriver, type ConsolidationWriteJudge, type ConsolidationWriteJudgeInput, type EngineNotice, type ConsolidationDriverRunRow, type ConsolidationRunReceipt, type MemoryConsolidationDriverDeps, type PermissionRuleStoreProvider } from "@sema-agent/core";
|
|
5
7
|
/**
|
|
6
8
|
* 座解析的 options 形 = core 解析器交回的那只(core 7.50.0 起它**不含** `writeJudge`:判官不是模型席的一部分,由调用方在动词上带)。
|
|
7
9
|
* 取解析器的返回型而不是自己写 `Omit<…>`:形的属主是 core 的解析器,本仓不持第二份。
|
|
@@ -208,7 +210,7 @@ export declare function consolidationSeatBillingOf(plane: ConsolidationSeatPlane
|
|
|
208
210
|
* (结构上跑不起来由下游 D1 三条拒启臂照拒,本判决不吞);开而座落主模型 ⇒ 开 + 一行
|
|
209
211
|
* `memory_consolidation_on_main_model`(部署方显式承担,但必须知道账按主模型记)。
|
|
210
212
|
* · **未设 = 出厂缺省派生**([ref] 取代 [ref] ① 的「出厂 off」实况):
|
|
211
|
-
* 结构上跑不起来(判官 {@link consolidationDriverUnwirable} 有成因:多租户 / `MEMORY_ENGINE=off` / pg·
|
|
213
|
+
* 结构上跑不起来(判官 {@link consolidationDriverUnwirable} 有成因:多租户 / `MEMORY_ENGINE=off` / pg·mysql
|
|
212
214
|
* 记忆后端 / `MEMORY_PROVENANCE=off`)⇒ **恒关、零提示、零探针** —— 派生开撞上 D1 拒启臂 = 每台配了便宜模型的
|
|
213
215
|
* 多租户 worker 升级即起不来;而配不配便宜模型它都开不了,一句指向 `MODEL_CHEAP_ID` 的提示是误导;
|
|
214
216
|
* 座不落主模型({@link consolidationSeatBillingOf} = `own-model`)⇒ **开**;
|
|
@@ -462,14 +464,19 @@ export interface MemoryConsolidationFaces {
|
|
|
462
464
|
lastRun(scope: string): ConsolidationDriverRunRow | undefined;
|
|
463
465
|
}
|
|
464
466
|
/**
|
|
465
|
-
*
|
|
467
|
+
* 在**记忆作用域店**上建 consolidation 操作面。命名照 CLAUDE.md 工厂律:返回带行为的活对象 ⇒ `create*`。
|
|
468
|
+
*
|
|
469
|
+
* ## 引擎建在哪只店上:被整理的那一层住的那只
|
|
470
|
+
* 整理一层 = 读这一层的库、把产物写回这一层 —— 店只问记忆作用域店(`memoryStoreForRequest(stores, [scope])`;读不出的层键 ⇒ `request.memory_layer`)。
|
|
471
|
+
* 一只店一只引擎,`lastRun` 读那只引擎的控制面(run 账住在被整理的那只店的控制面里)。修前恒在部署的店上建:目录钉住的部署上,
|
|
472
|
+
* 类型化个人层(`user:` / `userproj:` / `org:`)的库在个人挂载上的另一只店里,整理读到的是空库、产物落在会话不读的店。
|
|
466
473
|
*
|
|
467
474
|
* ## 为什么这里现构一只引擎(与 `createMemoryComplianceFaces` / `createMemoryBundleFaces` 同一条理由)
|
|
468
475
|
*
|
|
469
476
|
* 本仓**没有**一个长命的 `MemoryEngine` 实例:`boot/stores.ts` 装配出来的 `memoryEngine` 是
|
|
470
|
-
*
|
|
471
|
-
*
|
|
472
|
-
*
|
|
477
|
+
* 记忆作用域店,真引擎由 core 的 Runner **每任务现构**。HTTP 面要一个引擎就得自己构。
|
|
478
|
+
* 两只引擎不会各说各话:控制面由店写死(`backend.controlPlaneRoot`),gate / run 账 / plan 归档
|
|
479
|
+
* 全住在那里,所以操作面引擎与每任务引擎在同一只店上看的是**同一本**账。
|
|
473
480
|
*
|
|
474
481
|
* ## `consolidation: {}` = 出厂缺省,**显式在场**
|
|
475
482
|
*
|
|
@@ -481,10 +488,7 @@ export interface MemoryConsolidationFaces {
|
|
|
481
488
|
* `multiNode` 也**刻意不声明**:声明它就必须注入一只全局租约,而本仓今天没有(见顶注「v1 没有周期腿」
|
|
482
489
|
* 那一段的同一条理由)——不声明 = 单机 plan-seat CAS 是唯一互斥,core 的契约原话如此,不是偷偷降级。
|
|
483
490
|
*/
|
|
484
|
-
export declare function createMemoryConsolidationFaces(
|
|
485
|
-
backend: MemoryBackend;
|
|
486
|
-
root: string;
|
|
487
|
-
}, input: {
|
|
491
|
+
export declare function createMemoryConsolidationFaces(stores: MemoryScopeStores, input: {
|
|
488
492
|
seat: ConsolidationDriverSeat;
|
|
489
493
|
scopes: readonly string[];
|
|
490
494
|
/** 部署的 provenance 姿态,原样交给引擎(缺席 ⇒ core 缺省 `carry`)。 */
|
|
@@ -496,13 +500,13 @@ export declare function createMemoryConsolidationFaces(store: {
|
|
|
496
500
|
/** 停因自由文本的**运维日志**座(缺席 = 没人听,不影响任何行为)。载荷由 {@link buildStopDetailAudit}
|
|
497
501
|
* 铸,调用点在单飞回调**之内** ⇒ 一轮真 run 一行,并入的等待者不各落一行。 */
|
|
498
502
|
onStopDetail?: (audit: ReturnType<typeof buildStopDetailAudit>) => void;
|
|
499
|
-
/** [ref]②(383 §2.1b):capture opt-out
|
|
503
|
+
/** [ref]②(383 §2.1b):capture opt-out 记录的按平面取用源(main.ts 取一次,与 Runner 同源;每只引擎按它那只店的控制面取)。
|
|
500
504
|
* 🔴 这只引擎是四只 operator 面里**真读名册**的那只:`consolidationEligibility` 第四臂
|
|
501
505
|
* (engine.js `listCaptureOptOutSessions`)拿它筛掉 opt-out 会话的贡献条目 —— SQL 部署上漏喂
|
|
502
506
|
* = 驱动器读文件空名册 ⇒ 蒸馏器放大用户明说不要记的内容(S-5 真实失效形;全站同批注入律,
|
|
503
507
|
* 机器钉 capture-optout-lane ②)。[ref] 起 local 车道在引擎接线时也供(core 文件三腿,同一只控制面);
|
|
504
508
|
* 缺席 ⇒ 记忆面暗(引擎未接线),与 Runner 同本。 */
|
|
505
|
-
|
|
509
|
+
captureRecords?: SessionCaptureRecordSource;
|
|
506
510
|
/** core 7.50.0:整理跑的**写判官座**(必填 —— 缺席不是「没有规则」,core 也拒)。操作面不判任何东西,只把它原样递给驱动动词:
|
|
507
511
|
* 早问库目录一次、应用时问每个产物文件,答 `no_objection` 以外一律拒写。装配层给哪一只见 {@link createOperatorValveWriteJudge}。 */
|
|
508
512
|
writeJudge: ConsolidationWriteJudge;
|
|
@@ -4,7 +4,8 @@ import { buildOperatorRosterWayOut } from "../http/principal-gate.js";
|
|
|
4
4
|
import { memoryMountRootOf } from "../memory-scope.js";
|
|
5
5
|
import { executionLaneHomeDir } from "../execution-lane-caps.js";
|
|
6
6
|
import { DEFAULT_MODEL_REF, resolveMainModel } from "../model-select.js";
|
|
7
|
-
import { backendOwnsControlPlane } from "../memory-operator-faces.js";
|
|
7
|
+
import { backendOwnsControlPlane, captureRecordStoreOf } from "../memory-operator-faces.js";
|
|
8
|
+
import { memoryStoreForRequest } from "../memory-scope-stores.js";
|
|
8
9
|
import { createConsolidationWriteJudge, deliverWriteRefusal, expandTiers, MemoryEngine, modelOriginOf, readConsolidationDriverRun, resolveMemoryConsolidationDriver, runMemoryConsolidationDriver, } from "@sema-agent/core";
|
|
9
10
|
export function resolveConsolidationDriverSeat(deps) {
|
|
10
11
|
let options;
|
|
@@ -113,7 +114,7 @@ function unwirableRefusal(code, facts) {
|
|
|
113
114
|
`(MEMORY_ENGINE_BACKEND=${facts.memoryEngineBackend}) does NOT own an engine control plane (controlPlaneRoot) — ` +
|
|
114
115
|
`core would derive one on THIS replica's local disk, and a consolidation run's resumable account would die with ` +
|
|
115
116
|
`the pod (a lost run re-mints the whole library at full model cost on the next attempt). The file memory backend ` +
|
|
116
|
-
`owns a control plane; the pg/
|
|
117
|
+
`owns a control plane; the pg/mysql memory backends do not. Set MEMORY_ENGINE_BACKEND=file, or set ` +
|
|
117
118
|
`MEMORY_CONSOLIDATION_DRIVER=off.`);
|
|
118
119
|
case "provenance-off":
|
|
119
120
|
return (`MEMORY_CONSOLIDATION_DRIVER=on is incompatible with MEMORY_PROVENANCE=off — core refuses to enable consolidation ` +
|
|
@@ -333,22 +334,32 @@ export function createOperatorValveWriteJudge(facts) {
|
|
|
333
334
|
return judge(target);
|
|
334
335
|
};
|
|
335
336
|
}
|
|
336
|
-
export function createMemoryConsolidationFaces(
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
337
|
+
export function createMemoryConsolidationFaces(stores, input) {
|
|
338
|
+
const engines = new Map();
|
|
339
|
+
const engineOf = (scope) => {
|
|
340
|
+
const store = memoryStoreForRequest(stores, [scope]);
|
|
341
|
+
const known = engines.get(store);
|
|
342
|
+
if (known !== undefined)
|
|
343
|
+
return known;
|
|
344
|
+
const records = captureRecordStoreOf(input.captureRecords, store);
|
|
345
|
+
const engine = new MemoryEngine({
|
|
346
|
+
backend: store,
|
|
347
|
+
memoryDir: memoryMountRootOf(store, stores.root),
|
|
348
|
+
consolidation: {},
|
|
349
|
+
...(input.provenance !== undefined ? { provenance: input.provenance } : {}),
|
|
350
|
+
...(input.onIncident !== undefined ? { onIncident: input.onIncident } : {}),
|
|
351
|
+
...(records !== undefined ? { captureRecordStore: records } : {}),
|
|
352
|
+
});
|
|
353
|
+
engines.set(store, engine);
|
|
354
|
+
return engine;
|
|
355
|
+
};
|
|
345
356
|
const flight = createPerScopeSingleFlight();
|
|
346
357
|
return {
|
|
347
358
|
seat: input.seat.seat,
|
|
348
359
|
model: input.seat.model,
|
|
349
360
|
scopes: input.scopes,
|
|
350
361
|
run: (scope) => flight(scope, async () => {
|
|
351
|
-
const receipt = await runMemoryConsolidationDriver(
|
|
362
|
+
const receipt = await runMemoryConsolidationDriver(engineOf(scope), scope, {
|
|
352
363
|
...input.seat.options,
|
|
353
364
|
writeJudge: input.writeJudge,
|
|
354
365
|
...(input.onNotice !== undefined ? { onNotice: input.onNotice } : {}),
|
|
@@ -361,7 +372,7 @@ export function createMemoryConsolidationFaces(store, input) {
|
|
|
361
372
|
}
|
|
362
373
|
return receipt;
|
|
363
374
|
}),
|
|
364
|
-
lastRun: (scope) => readConsolidationDriverRun(
|
|
375
|
+
lastRun: (scope) => readConsolidationDriverRun(engineOf(scope).controlPlaneRoot, scope),
|
|
365
376
|
};
|
|
366
377
|
}
|
|
367
378
|
//# sourceMappingURL=memory-consolidation.js.map
|
package/dist/boot/reapers.d.ts
CHANGED
|
@@ -167,8 +167,8 @@ interface ReapSessionsInputs {
|
|
|
167
167
|
* 的那条臂**结构上看不见**它(它从行出发枚举),只有从会话侧枚举才找得到。
|
|
168
168
|
*
|
|
169
169
|
* 两只面必须落在**host durable 店**上,而 release 这一格是承重的:
|
|
170
|
-
* · `listPlaced` = host 店的分区枚举(SQL
|
|
171
|
-
*
|
|
170
|
+
* · `listPlaced` = host 店的分区枚举(三只持久会话店都实装:SQL 两孪生读 `session_meta`,local 读会话存档行头;
|
|
171
|
+
* 店上没有这只面 ⇒ 键**不设**,core 那条腿如实不可用 —— 绝不给一个恒返回 `[]` 的假面,那会把「枚不了」读成「没有孤儿」);
|
|
172
172
|
* · `release` 对 **placed id** 必须走 host 店:路由店(`ForkRoutingSessionStore`)对一个重启后不认识
|
|
173
173
|
* 的 id 会回落 transient(进程内 no-op),那会让 core 数出一次**从未发生**的 release
|
|
174
174
|
* (`orphanPlacedReleased` 当场变成谎)而字节还在库里。故先按**持久化元组**判(一次 PK 探针),
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type MemoryBackend } from "@sema-agent/core";
|
|
2
1
|
import { SessionEnvironmentSelection, selectEnvironmentTool } from "../capabilities/select-environment-tool.js";
|
|
3
2
|
import { sendUserFileTool } from "../capabilities/send-user-file-tool.js";
|
|
4
3
|
import { selectScenario } from "../capabilities/scenarios.js";
|
|
@@ -17,6 +16,7 @@ import type { StoreBackend } from "../plugins/store-backend.js";
|
|
|
17
16
|
import { type TaskAttachmentStore } from "../plugins/task-attachment-store.js";
|
|
18
17
|
import type { createPrincipalEntitlementsClient } from "../runtime-caps-resolver.js";
|
|
19
18
|
import { type OwnerAwareSessionStore } from "../security.js";
|
|
19
|
+
import type { MemoryScopeStores } from "../memory-scope-stores.js";
|
|
20
20
|
import type { MemorySyncRunner } from "../memory-sync-client.js";
|
|
21
21
|
import type { PeerDesk } from "../peer-seat.js";
|
|
22
22
|
import type { RunnerDepsOnAsk } from "./runner-deps.js";
|
|
@@ -55,10 +55,8 @@ export interface ResolveSpecCtx {
|
|
|
55
55
|
taskTimeoutSec: number;
|
|
56
56
|
selectEnvTool: ReturnType<typeof selectEnvironmentTool> | undefined;
|
|
57
57
|
sendUserFileToolSpec: ReturnType<typeof sendUserFileTool> | undefined;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
root: string;
|
|
61
|
-
} | undefined;
|
|
58
|
+
/** 记忆引擎对象 = 记忆作用域店(`memory-scope-stores.ts`;项目层准备一步按层问它的店)。 */
|
|
59
|
+
memoryEngine: MemoryScopeStores | undefined;
|
|
62
60
|
/** [ref]:记忆同步腿(开 `MEMORY_SYNC_*` 且记忆引擎接线时在场)—— 项目层准备一步把本任务的项目层交给它跟踪(`memory-project-layer.ts`)。 */
|
|
63
61
|
memorySyncRunner: MemorySyncRunner | undefined;
|
|
64
62
|
durableEnabled: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { realpathSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { NodeExecutionEnv, QUESTION_AWAITS_RESUME, deriveAskEffective, expandTiers,
|
|
3
|
+
import { NodeExecutionEnv, QUESTION_AWAITS_RESUME, deriveAskEffective, expandTiers, resolveAskSeamForm } from "@sema-agent/core";
|
|
4
4
|
import { cappedCeiling } from "../budget.js";
|
|
5
5
|
import { recordFailOpen } from "../observability/fail-open.js";
|
|
6
6
|
import { SessionEnvironmentSelection, selectEnvironmentTool } from "../capabilities/select-environment-tool.js";
|
|
@@ -14,7 +14,7 @@ import { createDeploymentListExemption, gateIntentUnserviceableReason, singleUse
|
|
|
14
14
|
import { acceptShellScratchpadDir, buildEnvFacts, egressForRemoteExec, ensureScratchpadDir, resumeFactsForLane, scratchpadCoveringTaskRoot } from "../env-facts.js";
|
|
15
15
|
import { FleetEventBus } from "../fleet/fleet-bus.js";
|
|
16
16
|
import { createSettingsHooksRegistration, settingsHooksBudgetMs } from "../hooks/hook-runner.js";
|
|
17
|
-
import { HOST_POSTURE_REFUSED_CODE,
|
|
17
|
+
import { HOST_POSTURE_REFUSED_CODE, permissionModeWriteFaceRefusal, taskInheritEnvRefusal } from "../hosted-posture.js";
|
|
18
18
|
import { headerStr } from "../http/principal-gate.js";
|
|
19
19
|
import { explicitOperatorOk } from "../http/server.js";
|
|
20
20
|
import { isAtMentionable, matchCatalogModel, refusedCatalogEntry, resolveTaskModel, selectableCatalog, terminalCatalogName } from "../model-select.js";
|
|
@@ -51,7 +51,7 @@ import { TENANCY_WALL_CLOCK_BASE_SEC, enableForkFromBody, normalizeRetainSubagen
|
|
|
51
51
|
import { redactSecrets } from "../trace/redact.js";
|
|
52
52
|
import { DeferredSandboxPathEnv, sandboxPathEnvSlots } from "./deferred-sandbox-path-env.js";
|
|
53
53
|
import { executionLaneHomeDir, executionLaneOf, laneWiresExecutionEnv } from "../execution-lane-caps.js";
|
|
54
|
-
import {
|
|
54
|
+
import { executionConfigRootOf } from "../execution-config-root.js";
|
|
55
55
|
import { withUnattendedLeg } from "../unattended-permission-mode.js";
|
|
56
56
|
import { fieldConflictFacts } from "../field-conflict.js";
|
|
57
57
|
function unrooted(spec) {
|
|
@@ -75,7 +75,7 @@ export function createResolveSpec(ctx) {
|
|
|
75
75
|
const sessionCwd = auth?.sessionId ? effectiveHostWorkspace(perSessionCwd.get(auth.sessionId), {}) : undefined;
|
|
76
76
|
return sessionCwd ?? (executionLaneOf(config.remoteExec?.provider) === "in-process" ? process.cwd() : undefined);
|
|
77
77
|
};
|
|
78
|
-
const memoryProjectLayers = createMemoryProjectLayers({
|
|
78
|
+
const memoryProjectLayers = createMemoryProjectLayers({ stores: memoryEngine, syncRunner: memorySyncRunner, log: logger });
|
|
79
79
|
if (onlySensitiveBaseline)
|
|
80
80
|
logger.warn(onlySensitiveBaseline.event, onlySensitiveBaseline.fields);
|
|
81
81
|
const approvalGrantNotice = buildApprovalGrantNotice(config);
|
|
@@ -161,8 +161,8 @@ export function createResolveSpec(ctx) {
|
|
|
161
161
|
assertRequestImageUrls(body.images);
|
|
162
162
|
const gated = await gateScenarioAndAppend(body, auth, opts);
|
|
163
163
|
const effMode = effectivePermissionMode(body, gated.parsedSettings.settings);
|
|
164
|
-
|
|
165
|
-
const why =
|
|
164
|
+
{
|
|
165
|
+
const why = permissionModeWriteFaceRefusal(effMode, config);
|
|
166
166
|
if (why !== undefined)
|
|
167
167
|
throw new HttpError(422, why, { code: HOST_POSTURE_REFUSED_CODE });
|
|
168
168
|
}
|
|
@@ -493,7 +493,7 @@ export function createResolveSpec(ctx) {
|
|
|
493
493
|
memory: memoryEngine
|
|
494
494
|
? memorySpecForRequest(auth?.memoryScope, projectKey, body.memoryWrite, s4DefaultScopes, { multiTenant: config.requirePrincipal === true }, { memory: body.memory, memoryCapture: body.memoryCapture })
|
|
495
495
|
: undefined,
|
|
496
|
-
...(
|
|
496
|
+
...(config.memoryPersistenceCapable !== undefined ? { memoryPersistenceCapable: config.memoryPersistenceCapable } : {}),
|
|
497
497
|
tools: ((base) => {
|
|
498
498
|
const extra = [...(selectEnvTool ? [selectEnvTool] : []), ...(sendUserFileToolSpec ? [sendUserFileToolSpec] : [])];
|
|
499
499
|
const merged = extra.length > 0 ? [...(base ?? []), ...extra] : base;
|
|
@@ -524,7 +524,6 @@ export function createResolveSpec(ctx) {
|
|
|
524
524
|
...((rs) => (rs ? { resourceSuspend: rs } : {}))(resourceSuspendOptIn({
|
|
525
525
|
enabled: config.resourceSuspend,
|
|
526
526
|
ttlSec: config.resourceSuspendTtlSec,
|
|
527
|
-
isVerify: body.verify === true,
|
|
528
527
|
isCascade: body.cascade === true,
|
|
529
528
|
scope: encodeCheckpointScope(auth?.principal),
|
|
530
529
|
totalTokens: config.resourceSuspendTotalTokens,
|
|
@@ -581,9 +580,11 @@ export function createResolveSpec(ctx) {
|
|
|
581
580
|
? await ensureScratchpadDir(config.localDataRoot ?? localRoot, auth.sessionId, (msg, meta) => logger.warn(msg, { ...(meta ?? {}), sessionId: auth.sessionId }))
|
|
582
581
|
: undefined);
|
|
583
582
|
if (effectiveSettings) {
|
|
583
|
+
const configRoot = executionConfigRootOf(config);
|
|
584
584
|
const ruleBases = {
|
|
585
585
|
...(pathAdjudication.taskRoot !== undefined ? { taskRoot: pathAdjudication.taskRoot } : {}),
|
|
586
586
|
...(pathAdjudication.taskHome !== undefined ? { taskHome: pathAdjudication.taskHome } : {}),
|
|
587
|
+
...(configRoot !== undefined ? { configRoot } : {}),
|
|
587
588
|
};
|
|
588
589
|
try {
|
|
589
590
|
governed = applyTaskSettings(governedBase, effectiveSettings, ruleBases);
|
|
@@ -183,7 +183,7 @@ export interface RunnerDepsCtx {
|
|
|
183
183
|
* (`backend.sessionCaptureRecords()`,main.ts 取**一次**、与四只 operator 面引擎同一只源 —— 全站同批
|
|
184
184
|
* 注入律,机器钉 = test/memory-capture-optout-lane.test.ts ②)。在场 ⇒ `capture:"off"` 声明与中途翻转
|
|
185
185
|
* verb 真持久;缺席 ⇒ core 读作「无店」,而 core 的 `captureCarrierUnsupported` 判据是**席位在不在**
|
|
186
|
-
* (不是「文件形能不能用」)
|
|
186
|
+
* (不是「文件形能不能用」),叠上执行环境块 `hostLocalPaths` 为假(沙箱 / 远端 / 设备车道)⇒ 两条 ingress 都拒
|
|
187
187
|
* `config.memory_capture_unsupported`。[ref] 起三条车道都供(SQL 双方言 twin / local 的控制面文件三腿),
|
|
188
188
|
* 所以缺席今天只剩一个成因:**记忆面暗**的 local 部署(那时 core 的 capture 腿本就不参与)。 */
|
|
189
189
|
sessionCaptureRecords: SessionCaptureRecordSource | undefined;
|
|
@@ -247,7 +247,7 @@ export interface RunnerDepsCtx {
|
|
|
247
247
|
}
|
|
248
248
|
/** [ref] A10 留档发现②:main runner `RunnerDeps` 与 main.ts subRunner 字面量之间此前手工重复
|
|
249
249
|
* 的 ~15 个键,类型标注见 {@link createSharedRunnerDeps} 头注。 */
|
|
250
|
-
export type SharedRunnerDeps = Pick<RunnerDeps, "brain" | "readFace" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "memoryDelegationEvidence" | "memoryProvenance" | "memoryCapturePolicy" | "delegationEntryCaps" | "crossSessionInbound" | "crossSessionDialogExpiry" | "writeProtectedPaths" | "memoryEngineDir" | "allowedTools" | "crossBoundaryPosture" | "models" | "roles" | "tiers" | "pricing" | "tracer" | "promptSource" | "executionEnvFactory" | "lspManager" | "backgroundAgentStore" | "mailboxStore" | "rosterStore" | "mods" | "toolResultStore" | "checkpointStore" | "hands" | "sessionPolicyStore" | "usageWindows" | "usageWindowStore" | "memoryScopeAdmission" | "deploymentMemoryScopes" | "sharedMemoryStores" | "compliancePostureResolver" | "lockedConfig" | "retentionPolicy" | "onNotice" | "mcpRevocations" | "peerSeat">;
|
|
250
|
+
export type SharedRunnerDeps = Pick<RunnerDeps, "brain" | "readFace" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "readDenyFloorRequired" | "memoryDelegationEvidence" | "memoryProvenance" | "memoryCapturePolicy" | "delegationEntryCaps" | "crossSessionInbound" | "crossSessionDialogExpiry" | "writeProtectedPaths" | "memoryEngineDir" | "allowedTools" | "crossBoundaryPosture" | "models" | "roles" | "tiers" | "pricing" | "tracer" | "promptSource" | "executionEnvFactory" | "lspManager" | "backgroundAgentStore" | "mailboxStore" | "rosterStore" | "mods" | "toolResultStore" | "checkpointStore" | "hands" | "sessionPolicyStore" | "usageWindows" | "usageWindowStore" | "memoryScopeAdmission" | "deploymentMemoryScopes" | "sharedMemoryStores" | "compliancePostureResolver" | "lockedConfig" | "retentionPolicy" | "onNotice" | "mcpRevocations" | "peerSeat">;
|
|
251
251
|
/**
|
|
252
252
|
* [ref] A10 留档发现②(review 2026-07-29,[ref]§三族A 同源修补的延续):main runner 的
|
|
253
253
|
* `RunnerDeps` 字面量(下方 `createRunnerDeps`)与 `main.ts` 里 subRunner 的 `new Runner({...})`
|
|
@@ -322,7 +322,7 @@ export declare function createEngineNoticeSeat(logger: {
|
|
|
322
322
|
* 「键为 undefined」与「键缺席」对引擎逐字等价)。**不复制引擎缺省**(`roots`/`static-face`/`carry`/`open`/
|
|
323
323
|
* CC parity 20/200 一个都不抄):上游改缺省之日起本仓不会成为第二份真源。
|
|
324
324
|
*/
|
|
325
|
-
export type DeploymentPostureSeats = Pick<RunnerDeps, "readFace" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "memoryDelegationEvidence" | "memoryProvenance" | "memoryCapturePolicy" | "delegationEntryCaps" | "crossSessionInbound" | "crossSessionDialogExpiry" | "writeProtectedPaths" | "allowedTools" | "agentConfigDir" | "crossBoundaryPosture">;
|
|
325
|
+
export type DeploymentPostureSeats = Pick<RunnerDeps, "readFace" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "readDenyFloorRequired" | "memoryDelegationEvidence" | "memoryProvenance" | "memoryCapturePolicy" | "delegationEntryCaps" | "crossSessionInbound" | "crossSessionDialogExpiry" | "writeProtectedPaths" | "allowedTools" | "agentConfigDir" | "crossBoundaryPosture">;
|
|
326
326
|
/** 本族读的配置切面:席名与 config 键同名的那几席 + 运维 allow 表(席 `allowedTools` ← config `approvalGrant`,env 名 `APPROVAL_GRANT` 不改)
|
|
327
327
|
* + LKG 覆写路径(`readDenyPatterns` 席并入它派生的读拒行,`lkgReadDenyRows`)+ 主体门(席 `crossBoundaryPosture` ← config `requirePrincipal`)。 */
|
|
328
328
|
export type DeploymentPostureConfig = Pick<ServiceConfig, Exclude<keyof DeploymentPostureSeats, "allowedTools" | "crossBoundaryPosture"> | "approvalGrant" | "configLkgPath" | "requirePrincipal">;
|
package/dist/boot/runner-deps.js
CHANGED
|
@@ -79,6 +79,7 @@ export function buildDeploymentPostureSeats(config) {
|
|
|
79
79
|
readDenyPatterns: readDenyAdditions ? readDenyAdditions : undefined,
|
|
80
80
|
readDenyBuiltinTiers: config.readDenyBuiltinTiers ?? undefined,
|
|
81
81
|
readDenyBuiltinExclude: config.readDenyBuiltinExclude ?? undefined,
|
|
82
|
+
readDenyFloorRequired: config.readDenyFloorRequired,
|
|
82
83
|
agentConfigDir: config.agentConfigDir ?? undefined,
|
|
83
84
|
memoryDelegationEvidence: config.memoryDelegationEvidence ?? undefined,
|
|
84
85
|
memoryProvenance: config.memoryProvenance ?? undefined,
|
|
@@ -16,7 +16,7 @@ import type { Logger } from "../observability/logger.js";
|
|
|
16
16
|
import type { Metrics } from "../observability/metrics.js";
|
|
17
17
|
import type { WorkflowCompletionInbox } from "../orchestration/workflow-completion-inbox.js";
|
|
18
18
|
import { PlanCacheProbe } from "../plan-cache-probe.js";
|
|
19
|
-
import type
|
|
19
|
+
import { type CheckpointStoreFull, type StoreBackend, type ToolResultStoreFull } from "../plugins/store-backend.js";
|
|
20
20
|
import type { createSessionStore } from "../plugins/session-store.js";
|
|
21
21
|
import type { TaskAttachmentStore } from "../plugins/task-attachment-store.js";
|
|
22
22
|
import type { FileHistoryErasureFace } from "../file-history-capture.js";
|
|
@@ -2,6 +2,7 @@ import { buildRewindHandles, buildSessionAudit, buildSessionAuditLocal, buildSes
|
|
|
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";
|
|
5
|
+
import { localSessionRowsOf } from "../plugins/store-backend.js";
|
|
5
6
|
import { setLeafAdvanceListener } from "../session-leaf-bus.js";
|
|
6
7
|
import { SessionWatchRegistry, posIntEnv } from "../session-watch.js";
|
|
7
8
|
import { defaultTaskRegistry, peerSessionBoxHandle } from "@sema-agent/core";
|
|
@@ -14,17 +15,17 @@ export function createSessionFaces(ctx) {
|
|
|
14
15
|
const { config, logger, metrics, localRoot, backend, sessionStore, runStore, checkpointStore, toolResultStore, resumeAnchorStore, approvalExemptionStore, sessionPolicyStore, taskAttachmentStore, fileHistoryErasure, workflowCompletionInbox, taskListLane, dropSessionScoped, mailboxStore, mailboxRecipientLifecycle, backgroundAgentStore, userInputLedgerStore, spaceReclaimer, } = ctx;
|
|
15
16
|
const mysqlPool = backend?.mysqlPool();
|
|
16
17
|
const auditPgPool = backend?.pgPool();
|
|
17
|
-
const
|
|
18
|
+
const auditLocalRows = localSessionRowsOf(backend);
|
|
18
19
|
const ownerAware = sessionStore;
|
|
19
20
|
const headOf = headReadOf(sessionStore);
|
|
20
|
-
const sessionAudit = mysqlPool || auditPgPool ||
|
|
21
|
+
const sessionAudit = mysqlPool || auditPgPool || auditLocalRows
|
|
21
22
|
? async (sessionId, opts) => {
|
|
22
23
|
const handles = opts !== undefined && resumeAnchorStore !== undefined ? buildRewindHandles(await resumeAnchorStore.listBySession(sessionId), opts.reader) : undefined;
|
|
23
24
|
const audit = mysqlPool
|
|
24
25
|
? await buildSessionAudit(mysqlPool, sessionId, handles)
|
|
25
26
|
: auditPgPool
|
|
26
27
|
? await buildSessionAuditPg(auditPgPool, sessionId, handles)
|
|
27
|
-
: await buildSessionAuditLocal(
|
|
28
|
+
: await buildSessionAuditLocal(auditLocalRows, sessionId, handles);
|
|
28
29
|
if (!audit)
|
|
29
30
|
return undefined;
|
|
30
31
|
const [head, placement] = await Promise.all([headOf?.(sessionId), opts !== undefined ? ownerAware.placementOf?.(sessionId) : undefined]);
|
package/dist/boot/shutdown.js
CHANGED
|
@@ -74,6 +74,7 @@ export function installShutdownHandlers(ctx) {
|
|
|
74
74
|
let closingAt = 0;
|
|
75
75
|
let parentWatch;
|
|
76
76
|
let engineLease;
|
|
77
|
+
let leaseFactsReader;
|
|
77
78
|
const hardShutdown = () => {
|
|
78
79
|
if (closing)
|
|
79
80
|
return;
|
|
@@ -280,6 +281,8 @@ export function installShutdownHandlers(ctx) {
|
|
|
280
281
|
: {}),
|
|
281
282
|
log: (event, fields) => logger.info(event, fields),
|
|
282
283
|
});
|
|
284
|
+
leaseFactsReader = () => engineLease?.facts;
|
|
285
|
+
drainState.engineLease = leaseFactsReader;
|
|
283
286
|
}
|
|
284
287
|
let disposed = false;
|
|
285
288
|
return {
|
|
@@ -302,6 +305,8 @@ export function installShutdownHandlers(ctx) {
|
|
|
302
305
|
engineLease?.stop();
|
|
303
306
|
if (drainState.enter === enterByRequest)
|
|
304
307
|
drainState.enter = undefined;
|
|
308
|
+
if (leaseFactsReader !== undefined && drainState.engineLease === leaseFactsReader)
|
|
309
|
+
drainState.engineLease = undefined;
|
|
305
310
|
},
|
|
306
311
|
};
|
|
307
312
|
}
|
|
@@ -7,16 +7,12 @@ export declare function runStage03(ctx: Awaited<ReturnType<typeof runStage02>>):
|
|
|
7
7
|
instanceId: string;
|
|
8
8
|
mailboxRecipientLifecycle: import("../plugins/mailbox-recipient-lifecycle.js").MailboxRecipientLifecycle | undefined;
|
|
9
9
|
mailboxStore: import("@sema-agent/core").MailboxStore | undefined;
|
|
10
|
-
memoryEngine:
|
|
11
|
-
|
|
12
|
-
root: string;
|
|
13
|
-
} | undefined;
|
|
14
|
-
memoryExportBackend: import("@sema-agent/core").MemoryBackend | undefined;
|
|
10
|
+
memoryEngine: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
11
|
+
memoryExportStores: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
15
12
|
memoryPosture: import("../memory-posture.js").MemoryPosture;
|
|
16
13
|
memorySyncCursors: import("../plugins/memory-sync-store-pg.js").MemorySyncStore | undefined;
|
|
17
14
|
memorySyncRunner: import("../memory-sync-client.js").MemorySyncRunner | undefined;
|
|
18
15
|
rosterStore: import("@sema-agent/core").RosterStore | undefined;
|
|
19
|
-
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
20
16
|
sessionCaptureRecords: import("../index.js").SessionCaptureRecordSource | undefined;
|
|
21
17
|
sessionStore: import("@sema-agent/core").SessionStore<import("@sema-agent/core").SessionStoreSummary, import("@sema-agent/core").SessionListQuery>;
|
|
22
18
|
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|
|
@@ -2,10 +2,9 @@ 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,
|
|
5
|
+
const { backend, storePosture, memoryEngine, engineDataRoot, memorySyncCursors, rosterStore, backgroundAgentStore, taskAttachmentStore, mailboxStore, mailboxRecipientLifecycle, memoryExportStores, 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
|
-
|
|
9
|
-
return { ...ctx, backend, backgroundAgentStore, breakerState, engineDataRoot, instanceId, mailboxRecipientLifecycle, mailboxStore, memoryEngine, memoryExportBackend, memoryPosture, memorySyncCursors, memorySyncRunner, rosterStore, sessionCaptureRecordStore, sessionCaptureRecords, sessionStore, sqlEngine, storePosture, taskAttachmentStore, taskListLane, usageWindowStore };
|
|
8
|
+
return { ...ctx, backend, backgroundAgentStore, breakerState, engineDataRoot, instanceId, mailboxRecipientLifecycle, mailboxStore, memoryEngine, memoryExportStores, memoryPosture, memorySyncCursors, memorySyncRunner, rosterStore, sessionCaptureRecords, sessionStore, sqlEngine, storePosture, taskAttachmentStore, taskListLane, usageWindowStore };
|
|
10
9
|
}
|
|
11
10
|
//# sourceMappingURL=stage-03-store-backend.js.map
|
|
@@ -37,16 +37,12 @@ export declare function runStage04(ctx: Awaited<ReturnType<typeof runStage03>>):
|
|
|
37
37
|
instanceId: string;
|
|
38
38
|
mailboxRecipientLifecycle: import("../plugins/mailbox-recipient-lifecycle.js").MailboxRecipientLifecycle | undefined;
|
|
39
39
|
mailboxStore: import("@sema-agent/core").MailboxStore | undefined;
|
|
40
|
-
memoryEngine:
|
|
41
|
-
|
|
42
|
-
root: string;
|
|
43
|
-
} | undefined;
|
|
44
|
-
memoryExportBackend: import("@sema-agent/core").MemoryBackend | undefined;
|
|
40
|
+
memoryEngine: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
41
|
+
memoryExportStores: import("../memory-scope-stores.js").MemoryScopeStores | undefined;
|
|
45
42
|
memoryPosture: import("../memory-posture.js").MemoryPosture;
|
|
46
43
|
memorySyncCursors: import("../plugins/memory-sync-store-pg.js").MemorySyncStore | undefined;
|
|
47
44
|
memorySyncRunner: import("../memory-sync-client.js").MemorySyncRunner | undefined;
|
|
48
45
|
rosterStore: import("@sema-agent/core").RosterStore | undefined;
|
|
49
|
-
sessionCaptureRecordStore: import("@sema-agent/core").SessionCaptureRecordStore | undefined;
|
|
50
46
|
sessionCaptureRecords: import("../index.js").SessionCaptureRecordSource | undefined;
|
|
51
47
|
sessionStore: import("@sema-agent/core").SessionStore<import("@sema-agent/core").SessionStoreSummary, import("@sema-agent/core").SessionListQuery>;
|
|
52
48
|
sqlEngine: import("../plugins/sql-driver.js").SqlEngineReading | undefined;
|