@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.
Files changed (328) hide show
  1. package/MIGRATION.md +471 -0
  2. package/README.md +1 -1
  3. package/README.zh-CN.md +1 -1
  4. package/USAGE.md +94 -26
  5. package/dist/adoption/runner.js +1 -1
  6. package/dist/adoption/sql.js +1 -1
  7. package/dist/approval-batch-census.d.ts +27 -0
  8. package/dist/approval-batch-census.js +27 -0
  9. package/dist/approval-card.d.ts +37 -22
  10. package/dist/approval-card.js +6 -3
  11. package/dist/approval.d.ts +15 -0
  12. package/dist/approval.js +10 -0
  13. package/dist/audit.d.ts +4 -2
  14. package/dist/audit.js +2 -2
  15. package/dist/bench/s1/live-deps.js +3 -2
  16. package/dist/bench/s1/row.d.ts +5 -2
  17. package/dist/bench/s1/row.js +2 -22
  18. package/dist/boot/adoption.js +1 -1
  19. package/dist/boot/device-lane.d.ts +11 -0
  20. package/dist/boot/device-lane.js +16 -0
  21. package/dist/boot/engine-lease.d.ts +24 -3
  22. package/dist/boot/engine-lease.js +9 -2
  23. package/dist/boot/execution-env.js +18 -12
  24. package/dist/boot/execution-lane.d.ts +8 -0
  25. package/dist/boot/execution-lane.js +6 -1
  26. package/dist/boot/memory-boundary.d.ts +16 -53
  27. package/dist/boot/memory-boundary.js +10 -20
  28. package/dist/boot/memory-consolidation.d.ts +16 -12
  29. package/dist/boot/memory-consolidation.js +24 -13
  30. package/dist/boot/reapers.d.ts +2 -2
  31. package/dist/boot/resolve-spec.d.ts +3 -5
  32. package/dist/boot/resolve-spec.js +9 -8
  33. package/dist/boot/runner-deps.d.ts +3 -3
  34. package/dist/boot/runner-deps.js +1 -0
  35. package/dist/boot/session-faces.d.ts +1 -1
  36. package/dist/boot/session-faces.js +4 -3
  37. package/dist/boot/shutdown.js +5 -0
  38. package/dist/boot/stage-03-store-backend.d.ts +2 -6
  39. package/dist/boot/stage-03-store-backend.js +2 -3
  40. package/dist/boot/stage-04-stores.d.ts +2 -6
  41. package/dist/boot/stage-04-stores.js +5 -5
  42. package/dist/boot/stage-05-execution-env.d.ts +2 -6
  43. package/dist/boot/stage-05-execution-env.js +3 -1
  44. package/dist/boot/stage-06-runners.d.ts +2 -8
  45. package/dist/boot/stage-06-runners.js +3 -3
  46. package/dist/boot/stage-07-capability-layer.d.ts +2 -7
  47. package/dist/boot/stage-07-capability-layer.js +8 -10
  48. package/dist/boot/stage-08-reapers.d.ts +2 -7
  49. package/dist/boot/stage-09-leader.d.ts +2 -7
  50. package/dist/boot/stage-10-http-server.d.ts +2 -7
  51. package/dist/boot/stage-10-http-server.js +6 -4
  52. package/dist/boot/stores.d.ts +3 -6
  53. package/dist/boot/stores.js +37 -44
  54. package/dist/boot/task-list-lane.d.ts +1 -1
  55. package/dist/boot/task-list-lane.js +1 -1
  56. package/dist/boot/web-admin.js +36 -9
  57. package/dist/capabilities/execution-lane.d.ts +2 -2
  58. package/dist/capabilities/scenarios.d.ts +1 -1
  59. package/dist/capability-facts.d.ts +9 -0
  60. package/dist/capability-facts.js +9 -0
  61. package/dist/card-void.d.ts +38 -0
  62. package/dist/card-void.js +23 -0
  63. package/dist/config-catalog.js +12 -8
  64. package/dist/config-provider.d.ts +18 -17
  65. package/dist/config-provider.js +28 -36
  66. package/dist/config-types.d.ts +36 -9
  67. package/dist/config.js +56 -46
  68. package/dist/delegated-session-owner.d.ts +23 -20
  69. package/dist/delegated-session-owner.js +2 -2
  70. package/dist/deployment-shape.d.ts +9 -8
  71. package/dist/deployment-shape.js +4 -4
  72. package/dist/device-store.d.ts +7 -0
  73. package/dist/device-store.js +3 -0
  74. package/dist/execution-config-root.d.ts +22 -0
  75. package/dist/execution-config-root.js +35 -0
  76. package/dist/execution-lane-caps.d.ts +145 -107
  77. package/dist/execution-lane-caps.js +144 -83
  78. package/dist/execution-placement.d.ts +3 -0
  79. package/dist/execution-placement.js +7 -0
  80. package/dist/fleet/drain-entry.d.ts +3 -0
  81. package/dist/hosted-posture.d.ts +8 -0
  82. package/dist/hosted-posture.js +4 -0
  83. package/dist/http/admission.js +3 -3
  84. package/dist/http/caller-trust.d.ts +3 -2
  85. package/dist/http/caller-trust.js +2 -1
  86. package/dist/http/dispatch.js +4 -0
  87. package/dist/http/live-frame.d.ts +24 -0
  88. package/dist/http/live-frame.js +16 -0
  89. package/dist/http/memory-compliance-failure-reply.d.ts +3 -1
  90. package/dist/http/memory-compliance-failure-reply.js +5 -0
  91. package/dist/http/memory-layer-reply.d.ts +30 -0
  92. package/dist/http/memory-layer-reply.js +24 -0
  93. package/dist/http/resume-legs.js +49 -35
  94. package/dist/http/retired-service-deps.d.ts +1 -1
  95. package/dist/http/retired-service-deps.js +1 -1
  96. package/dist/http/route-table.js +2 -0
  97. package/dist/http/routes/adoption.js +1 -1
  98. package/dist/http/routes/approvals-assistant.js +1 -0
  99. package/dist/http/routes/capabilities.js +5 -4
  100. package/dist/http/routes/diagnostics.d.ts +0 -19
  101. package/dist/http/routes/diagnostics.js +16 -2
  102. package/dist/http/routes/memory-bundle.d.ts +2 -2
  103. package/dist/http/routes/memory-bundle.js +4 -1
  104. package/dist/http/routes/memory-compliance.js +9 -2
  105. package/dist/http/routes/memory-consolidation.js +12 -1
  106. package/dist/http/routes/memory-origin.js +14 -2
  107. package/dist/http/routes/memory-policy.js +7 -2
  108. package/dist/http/routes/run-permission-mode.d.ts +75 -0
  109. package/dist/http/routes/run-permission-mode.js +170 -0
  110. package/dist/http/routes/session-sync.d.ts +3 -6
  111. package/dist/http/routes/session-sync.js +7 -2
  112. package/dist/http/routes/sessions.js +33 -15
  113. package/dist/http/routes/tasks.js +67 -68
  114. package/dist/http/run-read-face.js +3 -3
  115. package/dist/http/send.d.ts +1 -1
  116. package/dist/http/send.js +2 -2
  117. package/dist/http/server.d.ts +14 -27
  118. package/dist/http/server.js +2 -2
  119. package/dist/http/sse-log.d.ts +3 -8
  120. package/dist/http/stored-body-replay.d.ts +3 -3
  121. package/dist/http/stored-body-replay.js +3 -1
  122. package/dist/identity-source.d.ts +1 -1
  123. package/dist/identity-source.js +1 -1
  124. package/dist/instruction-source-notice.d.ts +7 -0
  125. package/dist/instruction-source-notice.js +6 -6
  126. package/dist/lane-home-probe.d.ts +68 -42
  127. package/dist/lane-home-probe.js +53 -30
  128. package/dist/leader/wire.js +5 -4
  129. package/dist/mcp-assertion-header.d.ts +4 -0
  130. package/dist/mcp-assertion-header.js +5 -0
  131. package/dist/memory-bundle-engine.d.ts +16 -9
  132. package/dist/memory-bundle-engine.js +29 -6
  133. package/dist/memory-operator-faces.d.ts +85 -30
  134. package/dist/memory-operator-faces.js +136 -30
  135. package/dist/memory-posture.d.ts +1 -1
  136. package/dist/memory-project-layer.d.ts +3 -21
  137. package/dist/memory-project-layer.js +11 -8
  138. package/dist/memory-scope-stores.d.ts +73 -0
  139. package/dist/memory-scope-stores.js +86 -0
  140. package/dist/memory-scope.d.ts +33 -9
  141. package/dist/memory-scope.js +17 -5
  142. package/dist/memory-sync-client.d.ts +34 -9
  143. package/dist/memory-sync-client.js +108 -28
  144. package/dist/observability/fail-open.d.ts +30 -2
  145. package/dist/observability/fail-open.js +30 -2
  146. package/dist/observability/metrics.js +0 -1
  147. package/dist/observability/run-terminal.d.ts +6 -2
  148. package/dist/observability/run-terminal.js +25 -26
  149. package/dist/observability/secret-env-scrub.d.ts +20 -1
  150. package/dist/observability/secret-env-scrub.js +14 -0
  151. package/dist/orchestration/workflow-completion-inbox.d.ts +5 -2
  152. package/dist/orchestration/workflow-completion-inbox.js +13 -5
  153. package/dist/orchestration/workflow-notify-journal.d.ts +5 -3
  154. package/dist/orchestration/workflow-notify-journal.js +2 -1
  155. package/dist/permission-mode-admission.d.ts +68 -0
  156. package/dist/permission-mode-admission.js +23 -0
  157. package/dist/permission-rule-list.d.ts +55 -6
  158. package/dist/permission-rule-list.js +52 -5
  159. package/dist/plugins/adoption-log-sql.js +4 -4
  160. package/dist/plugins/approval-ask-store-sql.js +14 -14
  161. package/dist/plugins/approval-nonce-store.js +4 -4
  162. package/dist/plugins/blob-backend.d.ts +4 -4
  163. package/dist/plugins/blob-backend.js +7 -7
  164. package/dist/plugins/breaker-state-sql.js +2 -2
  165. package/dist/plugins/caching-session-store.d.ts +6 -0
  166. package/dist/plugins/caching-session-store.js +3 -0
  167. package/dist/plugins/checkpoint-index-columns.js +2 -2
  168. package/dist/plugins/checkpoint-store-sql.d.ts +65 -17
  169. package/dist/plugins/checkpoint-store-sql.js +90 -19
  170. package/dist/plugins/device-store-sql.d.ts +5 -2
  171. package/dist/plugins/device-store-sql.js +23 -20
  172. package/dist/plugins/ensure-index.d.ts +1 -2
  173. package/dist/plugins/execution-placement-sql.d.ts +19 -9
  174. package/dist/plugins/execution-placement-sql.js +20 -9
  175. package/dist/plugins/file-history-store-sql.d.ts +2 -2
  176. package/dist/plugins/file-history-store-sql.js +4 -4
  177. package/dist/plugins/file-run-store.d.ts +2 -2
  178. package/dist/plugins/file-run-store.js +1 -1
  179. package/dist/plugins/fork-routing-session-store.d.ts +10 -32
  180. package/dist/plugins/fork-routing-session-store.js +2 -61
  181. package/dist/plugins/image-bake-store-sql.js +9 -9
  182. package/dist/plugins/image-index-sql.js +11 -11
  183. package/dist/plugins/k8s-exec-protocol.d.ts +4 -1
  184. package/dist/plugins/k8s-exec-protocol.js +6 -1
  185. package/dist/plugins/leader-run-store-sql.js +4 -4
  186. package/dist/plugins/local-checkpoint-store.d.ts +10 -1
  187. package/dist/plugins/local-checkpoint-store.js +22 -0
  188. package/dist/plugins/local-session-store.d.ts +227 -35
  189. package/dist/plugins/local-session-store.js +518 -37
  190. package/dist/plugins/local-session-window.d.ts +17 -3
  191. package/dist/plugins/local-session-window.js +7 -13
  192. package/dist/plugins/mailbox-store-sql.d.ts +2 -1
  193. package/dist/plugins/mailbox-store-sql.js +4 -4
  194. package/dist/plugins/memory-engine-tidb.js +5 -5
  195. package/dist/plugins/memory-optout-grant-store-sql.js +1 -1
  196. package/dist/plugins/memory-run-store.d.ts +2 -2
  197. package/dist/plugins/memory-run-store.js +1 -1
  198. package/dist/plugins/memory-sync-store-tidb.js +3 -3
  199. package/dist/plugins/one-time-migrations.d.ts +52 -11
  200. package/dist/plugins/one-time-migrations.js +101 -39
  201. package/dist/plugins/org-delivery-quota-store.js +2 -2
  202. package/dist/plugins/outcome-ledger-sql.js +2 -2
  203. package/dist/plugins/permission-rule-store-sql.d.ts +4 -4
  204. package/dist/plugins/permission-rule-store-sql.js +16 -16
  205. package/dist/plugins/pg-pool.js +3 -2
  206. package/dist/plugins/pg-session-storage.d.ts +2 -0
  207. package/dist/plugins/pg-session-storage.js +3 -2
  208. package/dist/plugins/remote-env-adb.d.ts +7 -24
  209. package/dist/plugins/remote-env-adb.js +22 -5
  210. package/dist/plugins/remote-env-device.d.ts +2 -28
  211. package/dist/plugins/remote-env-device.js +2 -1
  212. package/dist/plugins/remote-env-e2b.d.ts +40 -27
  213. package/dist/plugins/remote-env-e2b.js +180 -20
  214. package/dist/plugins/remote-env-file-error.d.ts +1 -1
  215. package/dist/plugins/remote-env-file-error.js +8 -2
  216. package/dist/plugins/remote-env-host.d.ts +19 -35
  217. package/dist/plugins/remote-env-host.js +26 -3
  218. package/dist/plugins/remote-env-k8s.d.ts +22 -14
  219. package/dist/plugins/remote-env-k8s.js +150 -26
  220. package/dist/plugins/remote-env-local-docker.d.ts +27 -24
  221. package/dist/plugins/remote-env-local-docker.js +91 -24
  222. package/dist/plugins/remote-env-ssh.d.ts +4 -24
  223. package/dist/plugins/remote-env-ssh.js +4 -3
  224. package/dist/plugins/resume-anchor-store-sql.js +2 -2
  225. package/dist/plugins/retention-lane-store-sql.d.ts +1 -1
  226. package/dist/plugins/retention-lane-store-sql.js +2 -2
  227. package/dist/plugins/retention-store-sql.d.ts +1 -1
  228. package/dist/plugins/retention-store-sql.js +6 -6
  229. package/dist/plugins/run-store-sql.d.ts +3 -3
  230. package/dist/plugins/run-store-sql.js +19 -18
  231. package/dist/plugins/sandbox-read-floor.d.ts +273 -0
  232. package/dist/plugins/sandbox-read-floor.js +608 -0
  233. package/dist/plugins/schema-consistency.d.ts +6 -6
  234. package/dist/plugins/schema-consistency.js +1 -1
  235. package/dist/plugins/schema-ensure-legs.d.ts +2 -3
  236. package/dist/plugins/schema-ensure-legs.js +2 -2
  237. package/dist/plugins/schema-live-columns.d.ts +1 -1
  238. package/dist/plugins/session-capture-record-store-sql.js +1 -1
  239. package/dist/plugins/session-ownership.d.ts +2 -1
  240. package/dist/plugins/session-placement.d.ts +17 -4
  241. package/dist/plugins/session-placement.js +2 -1
  242. package/dist/plugins/session-rules-column.d.ts +1 -1
  243. package/dist/plugins/session-rules-column.js +1 -1
  244. package/dist/plugins/session-store.d.ts +18 -20
  245. package/dist/plugins/session-store.js +4 -12
  246. package/dist/plugins/session-workspace-cell.d.ts +1 -1
  247. package/dist/plugins/session-workspace-cell.js +1 -1
  248. package/dist/plugins/shared-memory-store-sql.js +2 -2
  249. package/dist/plugins/sql-driver.d.ts +10 -5
  250. package/dist/plugins/sql-driver.js +6 -6
  251. package/dist/plugins/sql-errors.js +1 -1
  252. package/dist/plugins/store-backend.d.ts +35 -6
  253. package/dist/plugins/store-backend.js +27 -10
  254. package/dist/plugins/store-contracts.d.ts +9 -2
  255. package/dist/plugins/task-list-store-sql.js +11 -11
  256. package/dist/plugins/tidb-pool.js +7 -6
  257. package/dist/plugins/tidb-session-storage.js +4 -4
  258. package/dist/plugins/tidb-session-store.d.ts +4 -1
  259. package/dist/plugins/tidb-session-store.js +16 -15
  260. package/dist/plugins/tool-result-store-sql.d.ts +2 -2
  261. package/dist/plugins/tool-result-store-sql.js +3 -3
  262. package/dist/plugins/user-input-ledger-sql.js +2 -2
  263. package/dist/plugins/workflow-journal-store-sql.js +5 -5
  264. package/dist/plugins/workflow-run-store-sql.js +19 -19
  265. package/dist/plugins/write-behind-counter.d.ts +2 -3
  266. package/dist/plugins/write-behind-counter.js +5 -5
  267. package/dist/resource-suspend.d.ts +14 -12
  268. package/dist/resource-suspend.js +1 -1
  269. package/dist/resource-window.d.ts +4 -3
  270. package/dist/run-cancel-context.d.ts +34 -0
  271. package/dist/run-cancel-context.js +7 -0
  272. package/dist/run-local.js +14 -19
  273. package/dist/runs.d.ts +47 -16
  274. package/dist/runs.js +112 -113
  275. package/dist/security.d.ts +2 -2
  276. package/dist/server-secret-env.d.ts +2 -1
  277. package/dist/server-secret-env.js +2 -4
  278. package/dist/session-error-wire.d.ts +22 -4
  279. package/dist/session-error-wire.js +16 -0
  280. package/dist/session-incarnation.d.ts +10 -4
  281. package/dist/session-incarnation.js +1 -1
  282. package/dist/session-policy-wire.d.ts +1 -1
  283. package/dist/session-sync-kernel.d.ts +42 -1
  284. package/dist/session-sync-kernel.js +17 -0
  285. package/dist/session-sync.js +16 -4
  286. package/dist/sql-engine-coordinates.d.ts +49 -0
  287. package/dist/sql-engine-coordinates.js +27 -0
  288. package/dist/sql-engine-posture.d.ts +1 -1
  289. package/dist/sql-engine-posture.js +1 -1
  290. package/dist/standing-answer-grant.d.ts +31 -2
  291. package/dist/standing-answer-grant.js +14 -2
  292. package/dist/store-posture.d.ts +1 -1
  293. package/dist/{plugins → stores-sql}/background-agent-store-sql.d.ts +2 -2
  294. package/dist/{plugins → stores-sql}/background-agent-store-sql.js +8 -8
  295. package/dist/{plugins → stores-sql}/session-policy-store-sql.d.ts +7 -5
  296. package/dist/{plugins → stores-sql}/session-policy-store-sql.js +12 -12
  297. package/dist/{plugins → stores-sql}/usage-window-store-sql.d.ts +1 -1
  298. package/dist/{plugins → stores-sql}/usage-window-store-sql.js +3 -3
  299. package/dist/task-a2a.d.ts +1 -1
  300. package/dist/task-a2a.js +5 -6
  301. package/dist/task-mcp.d.ts +21 -8
  302. package/dist/task-mcp.js +17 -9
  303. package/dist/task-settings.d.ts +52 -25
  304. package/dist/task-settings.js +91 -28
  305. package/dist/terminal.d.ts +103 -19
  306. package/dist/terminal.js +72 -20
  307. package/dist/trace/core-keyset-guard.d.ts +79 -2
  308. package/dist/trace/exit-seat.d.ts +7 -0
  309. package/dist/trace/exit-seat.js +1 -0
  310. package/dist/trace/model-segment.d.ts +2 -2
  311. package/dist/trace/redact.d.ts +3 -1
  312. package/dist/trace/redact.js +395 -110
  313. package/dist/trace/self-minted-wire.d.ts +226 -2
  314. package/dist/trace/self-minted-wire.js +79 -0
  315. package/dist/verifier-pause-card.d.ts +8 -0
  316. package/dist/verifier-pause-card.js +19 -0
  317. package/dist/web-admin-client/apply-effective.d.ts +5 -7
  318. package/dist/web-admin-client/apply-effective.js +2 -2
  319. package/dist/web-admin-client/candidate-gate.d.ts +11 -7
  320. package/dist/web-admin-client/candidate-gate.js +1 -1
  321. package/dist/web-admin-client/http-client.d.ts +5 -4
  322. package/dist/web-admin-client/http-client.js +2 -2
  323. package/dist/web-admin-client/read-warnings.d.ts +7 -17
  324. package/dist/web-admin-client/read-warnings.js +5 -9
  325. package/docs/DEVICE-EXECUTOR-PROTOCOL.md +3 -2
  326. package/package.json +2 -2
  327. package/wire-changes/server@7.140.0.json +184 -0
  328. package/wire-changes/server@7.141.0.json +367 -0
@@ -10,7 +10,7 @@ export async function fetchEffective(center, etag, fetchImpl, worker) {
10
10
  if (!res.ok)
11
11
  throw new Error(`web-admin HTTP ${res.status}`);
12
12
  const warnings = [];
13
- const { body, retiredDomains } = separateRetiredDomains(await res.json());
13
+ const { body, refusedDocuments } = separateRetiredDomains(await res.json());
14
14
  const wire = readEffectiveWire(body, (w) => warnings.push(w));
15
15
  const { domainErrors, droppedEntries, droppedCatalogEntries, unreadFiles } = splitFoldedReadWarnings(warnings, "center");
16
16
  const effective = withDroppedCatalogEntries(wire, droppedCatalogEntries);
@@ -22,7 +22,7 @@ export async function fetchEffective(center, etag, fetchImpl, worker) {
22
22
  ...(domainErrors.length > 0 ? { domainErrors } : {}),
23
23
  ...(droppedEntries.length > 0 ? { droppedEntries } : {}),
24
24
  ...(unreadFiles.length > 0 ? { unreadFiles } : {}),
25
- ...(retiredDomains.length > 0 ? { retiredDomains: [...retiredDomains] } : {}),
25
+ ...(refusedDocuments.length > 0 ? { refusedDocuments: [...refusedDocuments] } : {}),
26
26
  };
27
27
  }
28
28
  export async function fetchPrincipalCaps(center, principal, etag, fetchImpl, worker) {
@@ -25,29 +25,19 @@
25
25
  * 留在条目上,只有颗粒更粗的失效才动候选。
26
26
  */
27
27
  import { z } from "zod";
28
- import { type DroppedEntryIdentity, type DroppedEntryReasonCode, type EffectiveReadWarning, type RetiredDomainName } from "@sema-agent/settings-schema";
29
- /**
30
- * 退役域的一条**发现**(两条读腿同形)。读腿只把契约包的墓碑(`RetiredDomainError`)换成数据交出去 —— 判决只在候选判官
31
- * (`candidate-gate.ts` 的 `judgeConfigCandidate`,成因 `retired_domain`):与域判形失败同一条回落链(候选 → 盘上 LKG → env)、同一行
32
- * `config_candidate_rejected`、刷新拍同形(拍跑完,候选被判拒是结论)。拉取层的抛只剩 I/O 与载荷形(不是一份 effective)两种。
33
- * `error` = 契约包铸的整句(墓碑表那一行:退役版本、事实今天住哪、一次性迁移 id)—— 模板句,不含任何配置值,所以不过 `redactConfigError`
34
- * (那道脱敏把引号段换成指纹,会把句中点名的域名换掉)。
35
- */
36
- export type RetiredDomainFinding = {
37
- readonly domain: RetiredDomainName;
38
- readonly error: string;
39
- readonly migration: string;
40
- };
41
- /** 墓碑 → 发现;不是墓碑 ⇒ `undefined`(调用方照原样抛)。两条读腿的唯一换装点。 */
42
- export declare function retiredDomainFindingOf(e: unknown): RetiredDomainFinding | undefined;
28
+ import { type ConfigDocumentRefusal, type DroppedEntryIdentity, type DroppedEntryReasonCode, type EffectiveReadWarning } from "@sema-agent/settings-schema";
43
29
  /**
44
30
  * 远端读腿在过契约读腿(`readEffectiveWire`)**之前**把退役域键分出去:wire 体上每个退役域键过契约的同一只墓碑(`refuseRetiredDomain`)——
45
- * 带事实 ⇒ 一条发现、这一键从体上拿掉(其余域照读、版本照读,判官整拒这份候选);缺席 / `{}` ⇒ 不理会(契约读腿自己丢 `{}`)。
31
+ * 带事实 ⇒ 一份被拒文档(契约的类型 `ConfigDocumentRefusal` 的墓碑臂:`document` = 退役域名,`reason: "retired_domain"`,`error` / `migration` 取
32
+ * `RetiredDomainError` 的同名字段)、这一键从体上拿掉(其余域照读、版本照读,判官整拒这份候选);缺席 / `{}` ⇒ 不理会(契约读腿自己丢 `{}`)。
46
33
  * 体不是对象 ⇒ 原样交回、不判(载荷形错,契约读腿抛)。墓碑判据只在契约包,这里只分键。
34
+ * 被拒文档是两条读腿同形的发现(判决只在候选判官 `candidate-gate.ts` 的 `judgeConfigCandidate`,成因词 = 发现自带的 `reason`):本地腿的被拒文档是契约单读口
35
+ * `FileConfigStore.read()` 那一读的拒单原样(`config-provider.ts`),wire 上没有文件层,只有这一种墓碑。`error` 本模块不脱敏(与折叠产物同律):各腿在自己的产出边界上过
36
+ * `redactSecrets` 兜底、不过 `redactConfigError`(句子不含配置值;引号段读法会把句中点名的域名换成指纹)。
47
37
  */
48
38
  export declare function separateRetiredDomains(body: unknown): {
49
39
  readonly body: unknown;
50
- readonly retiredDomains: readonly RetiredDomainFinding[];
40
+ readonly refusedDocuments: readonly ConfigDocumentRefusal[];
51
41
  };
52
42
  /** 折叠产物:`scope` 决定消费方做什么 —— `"domain"` 进候选门(`domainErrors`),`"entry"` 进逐条丢弃面(`droppedEntries`),
53
43
  * `"unread"` 进读腿不读的文件面(`unreadFiles`;点名不判拒)。 */
@@ -1,26 +1,22 @@
1
1
  import { z } from "zod";
2
2
  import { DROPPED_ENTRY_REASON_CODES, ModelRole, RETIRED_DOMAINS, RetiredDomainError, formatConfigPath, isDisclosableIdentity, isRetiredDomainName, refuseRetiredDomain, renderQuotedSentence, } from "@sema-agent/settings-schema";
3
- export function retiredDomainFindingOf(e) {
4
- return e instanceof RetiredDomainError ? { domain: e.domain, error: e.message, migration: e.migration } : undefined;
5
- }
6
3
  export function separateRetiredDomains(body) {
7
4
  if (body === null || typeof body !== "object" || Array.isArray(body))
8
- return { body, retiredDomains: [] };
9
- const findings = [];
5
+ return { body, refusedDocuments: [] };
6
+ const refused = [];
10
7
  const rest = { ...body };
11
8
  for (const domain of Object.keys(RETIRED_DOMAINS).filter(isRetiredDomainName)) {
12
9
  try {
13
10
  refuseRetiredDomain(domain, rest[domain]);
14
11
  }
15
12
  catch (e) {
16
- const finding = retiredDomainFindingOf(e);
17
- if (finding === undefined)
13
+ if (!(e instanceof RetiredDomainError))
18
14
  throw e;
19
- findings.push(finding);
15
+ refused.push({ document: e.domain, reason: "retired_domain", error: e.message, migration: e.migration });
20
16
  delete rest[domain];
21
17
  }
22
18
  }
23
- return findings.length === 0 ? { body, retiredDomains: [] } : { body: rest, retiredDomains: findings };
19
+ return refused.length === 0 ? { body, refusedDocuments: [] } : { body: rest, refusedDocuments: refused };
24
20
  }
25
21
  export function buildUnreadConfigKeyFields(k, dir) {
26
22
  return {
@@ -20,9 +20,10 @@ dials the device, so the device needs no inbound port, no public address and no
20
20
  (this deployment has no device lane) or an object `{ enabled: true, protocolVersion, maxInflightPerDevice,
21
21
  wsPath, management, relayUrl? }`. Read `wsPath` from there rather than hardcoding it: the path is part of the wire
22
22
  contract and reading it means a future path change is not a cross-repo break. `relayUrl` (server 7.137.0+) is present
23
- only when the operator declared one (`DEVICE_RELAY_URL`): the engine sits behind a relay or gateway and the device
23
+ only when the operator declared a relay URL (`DEVICE_RELAY_URL`): the engine sits behind a relay or gateway and the device
24
24
  must dial that absolute `ws://` / `wss://` URL verbatim instead of the engine's own address — do not rebuild it from
25
- the engine address and `wsPath`. Absent ⇒ dial the engine's own address at `wsPath`, as before. `protocolVersion` tells you
25
+ the engine address and `wsPath`. Absent ⇒ dial the engine's own address at `wsPath`, as before (the operator declared
26
+ `DEVICE_RELAY_URL=none`; a device-lane server does not start without one of the two declarations). `protocolVersion` tells you
26
27
  which protocol **revision** the server speaks before you spend a handshake finding out (§2.1: the revision decides
27
28
  which `errorCode` words the server accepts from you).
28
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/server",
3
- "version": "7.139.0",
3
+ "version": "7.141.0",
4
4
  "description": "Sema Server — the server/API implementation layer for Sema, wiring core, registry, model providers, and cloud agent execution. Built on @sema-agent/core.",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",
@@ -70,7 +70,7 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@sema-agent/core": "7.60.0",
73
- "@sema-agent/settings-schema": "15.1.0",
73
+ "@sema-agent/settings-schema": "16.0.0",
74
74
  "e2b": "^2.28.0",
75
75
  "libsodium-wrappers": "^0.8.4",
76
76
  "mysql2": "^3.22.4",
@@ -0,0 +1,184 @@
1
+ {
2
+ "repo": "server",
3
+ "version": "7.140.0",
4
+ "from": "v7.139.0",
5
+ "fromCommit": "c00fd6fb591f29cbd4435b9d0af52b4a952dfb95",
6
+ "to": "v7.140.0",
7
+ "generator": "scripts/wire-changes-server.mjs",
8
+ "sources": [
9
+ "docs/ASSISTANT-WIRE-CONTRACT.md#A.1",
10
+ "docs/ASSISTANT-WIRE-CONTRACT.md#A.1b",
11
+ "docs/ASSISTANT-WIRE-CONTRACT.md#B.1",
12
+ "docs/ASSISTANT-WIRE-CONTRACT.md#B.1a",
13
+ "docs/ASSISTANT-WIRE-CONTRACT.md#B.2b",
14
+ "docs/ASSISTANT-WIRE-CONTRACT.md#B.2",
15
+ "docs/ASSISTANT-WIRE-CONTRACT.md#D.3",
16
+ "src/trace/wire-projection-faces.ts",
17
+ "src/trace/self-minted-wire.ts",
18
+ "node_modules/@sema-agent/core/wire-changes"
19
+ ],
20
+ "added": [
21
+ {
22
+ "id": "A1",
23
+ "source": "errorCode",
24
+ "member": "config.read_deny_floor_unkept",
25
+ "text": "附录 A.1 / A.1b 错误码新增 `config.read_deny_floor_unkept`(状态码 409)"
26
+ },
27
+ {
28
+ "id": "A2",
29
+ "source": "errorCode",
30
+ "member": "memory.erasure_store_unjudged",
31
+ "text": "附录 A.1 / A.1b 错误码新增 `memory.erasure_store_unjudged`(状态码 409)"
32
+ },
33
+ {
34
+ "id": "A3",
35
+ "source": "errorCode",
36
+ "member": "request.memory_layer",
37
+ "text": "附录 A.1 / A.1b 错误码新增 `request.memory_layer`(状态码 400)"
38
+ },
39
+ {
40
+ "id": "A4",
41
+ "source": "selfMinted.endpointFaceStatus",
42
+ "member": "GET /v1/memory/entries/:entryId/provenance|POST /v1/memory/erase|GET /v1/memory/origin/clearances|POST /v1/memory/origin/entries/:entryId/clear#layer_unaddressed_two_stores(不点名层的条目 id / 店级账本请求,本部署点名的层分住两只店;体 request.memory_layer)",
43
+ "text": "自铸 逐端点应答面 → 状态(<端点>#<面> → 状态;只登记本版改了状态的面) 新增 `GET /v1/memory/entries/:entryId/provenance|POST /v1/memory/erase|GET /v1/memory/origin/clearances|POST /v1/memory/origin/entries/:entryId/clear#layer_unaddressed_two_stores(不点名层的条目 id / 店级账本请求,本部署点名的层分住两只店;体 request.memory_layer)`(属性 400;since 7.140.0 = 本版新上 wire)"
44
+ },
45
+ {
46
+ "id": "A5",
47
+ "source": "selfMinted.endpointFaceStatus",
48
+ "member": "POST /v1/memory/erase|POST /v1/sessions/:id/memory/erase#erasure_store_unjudged(抹除落到部署的店之外的那只店:点名的层住在个人挂载上,或按会话抹除而这只会话在另一只店有贡献 / 那只店的账读不出;体 memory.erasure_store_unjudged,什么都没删)",
49
+ "text": "自铸 逐端点应答面 → 状态(<端点>#<面> → 状态;只登记本版改了状态的面) 新增 `POST /v1/memory/erase|POST /v1/sessions/:id/memory/erase#erasure_store_unjudged(抹除落到部署的店之外的那只店:点名的层住在个人挂载上,或按会话抹除而这只会话在另一只店有贡献 / 那只店的账读不出;体 memory.erasure_store_unjudged,什么都没删)`(属性 409;since 7.140.0 = 本版新上 wire)"
50
+ },
51
+ {
52
+ "id": "A6",
53
+ "source": "selfMinted.endpointFaceStatus",
54
+ "member": "POST /v1/memory/export|POST /v1/memory/import|GET /v1/memory/origin/external|POST /v1/memory/erase#layers_span_two_stores(请求点名的层分住两只店;体 request.memory_layer)",
55
+ "text": "自铸 逐端点应答面 → 状态(<端点>#<面> → 状态;只登记本版改了状态的面) 新增 `POST /v1/memory/export|POST /v1/memory/import|GET /v1/memory/origin/external|POST /v1/memory/erase#layers_span_two_stores(请求点名的层分住两只店;体 request.memory_layer)`(属性 400;since 7.140.0 = 本版新上 wire)"
56
+ },
57
+ {
58
+ "id": "A7",
59
+ "source": "selfMinted.endpointFaceStatus",
60
+ "member": "记忆诸口 + POST /v1/admin/memory/consolidation/run|GET /v1/admin/memory/consolidation|GET /v1/memory/export|POST /v1/memory/sync/:scope#layer_unreadable(请求点名的层引擎读不出;体 request.memory_layer)",
61
+ "text": "自铸 逐端点应答面 → 状态(<端点>#<面> → 状态;只登记本版改了状态的面) 新增 `记忆诸口 + POST /v1/admin/memory/consolidation/run|GET /v1/admin/memory/consolidation|GET /v1/memory/export|POST /v1/memory/sync/:scope#layer_unreadable(请求点名的层引擎读不出;体 request.memory_layer)`(属性 400;since 7.140.0 = 本版新上 wire)"
62
+ },
63
+ {
64
+ "id": "A8",
65
+ "source": "selfMinted.memoryLayerSeatKey",
66
+ "member": "GET /v1/memory/entries/:entryId/provenance#query.scope",
67
+ "text": "自铸 记忆动词的层座(<端点>#<query | body>.scope → 读法;只登本版新增的) 新增 `GET /v1/memory/entries/:entryId/provenance#query.scope`(属性 optional;non-empty-string else 400 request.field_invalid;names the layer whose store answers;since 7.140.0 = 本版新上 wire)"
68
+ },
69
+ {
70
+ "id": "A9",
71
+ "source": "selfMinted.memoryLayerSeatKey",
72
+ "member": "GET /v1/memory/origin/clearances#query.scope",
73
+ "text": "自铸 记忆动词的层座(<端点>#<query | body>.scope → 读法;只登本版新增的) 新增 `GET /v1/memory/origin/clearances#query.scope`(属性 optional;non-empty-string else 400 request.field_invalid;names the layer whose store answers;since 7.140.0 = 本版新上 wire)"
74
+ },
75
+ {
76
+ "id": "A10",
77
+ "source": "selfMinted.memoryLayerSeatKey",
78
+ "member": "GET /v1/sessions/:id/memory-status#query.scope",
79
+ "text": "自铸 记忆动词的层座(<端点>#<query | body>.scope → 读法;只登本版新增的) 新增 `GET /v1/sessions/:id/memory-status#query.scope`(属性 optional;non-empty-string else 400 request.field_invalid;names the layer whose store answers;absent ⇒ every store of this deployment, folded;cache keyed by (session, store control plane);since 7.140.0 = 本版新上 wire)"
80
+ },
81
+ {
82
+ "id": "A11",
83
+ "source": "selfMinted.memoryLayerSeatKey",
84
+ "member": "POST /v1/memory/origin/entries/:entryId/clear#body.scope",
85
+ "text": "自铸 记忆动词的层座(<端点>#<query | body>.scope → 读法;只登本版新增的) 新增 `POST /v1/memory/origin/entries/:entryId/clear#body.scope`(属性 optional;non-empty-string else 400 request.field_invalid;names the layer whose store answers;not passed to the engine;since 7.140.0 = 本版新上 wire)"
86
+ },
87
+ {
88
+ "id": "A12",
89
+ "source": "selfMinted.memoryLayerSeatKey",
90
+ "member": "POST /v1/sessions/:id/memory/erase#body.scope",
91
+ "text": "自铸 记忆动词的层座(<端点>#<query | body>.scope → 读法;只登本版新增的) 新增 `POST /v1/sessions/:id/memory/erase#body.scope`(属性 optional;non-empty-string else 400 request.field_invalid;names the layer whose store answers;absent ⇒ the deployment's store;selector still minted from the path;since 7.140.0 = 本版新上 wire)"
92
+ },
93
+ {
94
+ "id": "A13",
95
+ "source": "selfMinted.sessionMemoryEraseStatus",
96
+ "member": "memory.erasure_store_unjudged",
97
+ "text": "自铸 POST /v1/sessions/:id/memory/erase(已分类拒 errorCode → HTTP 状态) 新增 `memory.erasure_store_unjudged`(属性 409;since 7.140.0 = 本版新上 wire)"
98
+ },
99
+ {
100
+ "id": "A14",
101
+ "source": "selfMinted.wireValueRule",
102
+ "member": "GET /v1/sessions/:id/memory-status#committedCount|foldedCount|lastCaptureAt|captureOptedOut|optOutSource(不带层座)",
103
+ "text": "自铸 出口值变换(<端点>#<键> → 变换) 新增 `GET /v1/sessions/:id/memory-status#committedCount|foldedCount|lastCaptureAt|captureOptedOut|optOutSource(不带层座)`(属性 fold-across-deployment-stores(sum|max|any-record|absent-if-any-unreadable);one-store⇒identity;since 7.140.0 = 本版新上 wire)"
104
+ }
105
+ ],
106
+ "registered": [],
107
+ "excluded": [],
108
+ "removed": [],
109
+ "changed": [],
110
+ "narrowed": [],
111
+ "closedSetMembers": [
112
+ {
113
+ "set": "errorCode",
114
+ "at": [
115
+ "docs/ASSISTANT-WIRE-CONTRACT.md#A.1",
116
+ "docs/ASSISTANT-WIRE-CONTRACT.md#A.1b"
117
+ ],
118
+ "added": [
119
+ "config.read_deny_floor_unkept",
120
+ "memory.erasure_store_unjudged",
121
+ "request.memory_layer"
122
+ ],
123
+ "registered": [],
124
+ "removed": [],
125
+ "breaking": false
126
+ },
127
+ {
128
+ "set": "selfMinted.endpointFaceStatus",
129
+ "at": [
130
+ "src/trace/self-minted-wire.ts#endpointFaceStatus"
131
+ ],
132
+ "added": [
133
+ "GET /v1/memory/entries/:entryId/provenance|POST /v1/memory/erase|GET /v1/memory/origin/clearances|POST /v1/memory/origin/entries/:entryId/clear#layer_unaddressed_two_stores(不点名层的条目 id / 店级账本请求,本部署点名的层分住两只店;体 request.memory_layer)",
134
+ "POST /v1/memory/erase|POST /v1/sessions/:id/memory/erase#erasure_store_unjudged(抹除落到部署的店之外的那只店:点名的层住在个人挂载上,或按会话抹除而这只会话在另一只店有贡献 / 那只店的账读不出;体 memory.erasure_store_unjudged,什么都没删)",
135
+ "POST /v1/memory/export|POST /v1/memory/import|GET /v1/memory/origin/external|POST /v1/memory/erase#layers_span_two_stores(请求点名的层分住两只店;体 request.memory_layer)",
136
+ "记忆诸口 + POST /v1/admin/memory/consolidation/run|GET /v1/admin/memory/consolidation|GET /v1/memory/export|POST /v1/memory/sync/:scope#layer_unreadable(请求点名的层引擎读不出;体 request.memory_layer)"
137
+ ],
138
+ "registered": [],
139
+ "removed": [],
140
+ "breaking": false
141
+ },
142
+ {
143
+ "set": "selfMinted.memoryLayerSeatKey",
144
+ "at": [
145
+ "src/trace/self-minted-wire.ts#memoryLayerSeatKey"
146
+ ],
147
+ "added": [
148
+ "GET /v1/memory/entries/:entryId/provenance#query.scope",
149
+ "GET /v1/memory/origin/clearances#query.scope",
150
+ "GET /v1/sessions/:id/memory-status#query.scope",
151
+ "POST /v1/memory/origin/entries/:entryId/clear#body.scope",
152
+ "POST /v1/sessions/:id/memory/erase#body.scope"
153
+ ],
154
+ "registered": [],
155
+ "removed": [],
156
+ "breaking": false
157
+ },
158
+ {
159
+ "set": "selfMinted.sessionMemoryEraseStatus",
160
+ "at": [
161
+ "src/trace/self-minted-wire.ts#sessionMemoryEraseStatus"
162
+ ],
163
+ "added": [
164
+ "memory.erasure_store_unjudged"
165
+ ],
166
+ "registered": [],
167
+ "removed": [],
168
+ "breaking": false
169
+ },
170
+ {
171
+ "set": "selfMinted.wireValueRule",
172
+ "at": [
173
+ "src/trace/self-minted-wire.ts#wireValueRule"
174
+ ],
175
+ "added": [
176
+ "GET /v1/sessions/:id/memory-status#committedCount|foldedCount|lastCaptureAt|captureOptedOut|optOutSource(不带层座)"
177
+ ],
178
+ "registered": [],
179
+ "removed": [],
180
+ "breaking": false
181
+ }
182
+ ],
183
+ "breaking": 0
184
+ }