@sema-agent/server 7.147.0 → 7.149.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 (790) hide show
  1. package/MIGRATION.md +1468 -24
  2. package/README.md +35 -7
  3. package/README.zh-CN.md +18 -8
  4. package/USAGE.md +444 -193
  5. package/deploy/sema-up/README.md +16 -5
  6. package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
  7. package/deploy/sema-up/chart/templates/_helpers.tpl +20 -4
  8. package/deploy/sema-up/chart/values.yaml +3 -2
  9. package/deploy/sema-up/cluster-up.sh +74 -176
  10. package/deploy/sema-up/kube-up.sh +29 -49
  11. package/deploy/sema-up/lib/chart-run.sh +23 -0
  12. package/deploy/sema-up/lib/dataroot.sh +3 -3
  13. package/deploy/sema-up/lib/health.sh +62 -13
  14. package/deploy/sema-up/lib/helm-values-cluster.py +18 -0
  15. package/deploy/sema-up/lib/helm-values-kube.py +35 -0
  16. package/deploy/sema-up/lib/regcred.py +8 -0
  17. package/deploy/sema-up/lib/remote/helm-install.sh +3 -0
  18. package/deploy/sema-up/lib/remote/image-import.sh +6 -0
  19. package/deploy/sema-up/lib/remote/machine-precheck.sh +11 -0
  20. package/deploy/sema-up/lib/remote/region-probe.sh +3 -0
  21. package/deploy/sema-up/lib/remote/stack-ready.sh +26 -0
  22. package/deploy/sema-up/lib/remote/vxlan-guard.sh +8 -0
  23. package/deploy/sema-up/lib/render-stack.py +17 -0
  24. package/deploy/sema-up/lib/shell-text.sh +87 -0
  25. package/deploy/sema-up/lib/usage-flags.txt +10 -0
  26. package/deploy/sema-up/lib/usage-head.txt +1 -0
  27. package/deploy/sema-up/lib/usage-tail.txt +13 -0
  28. package/deploy/sema-up/preflight.sh +10 -8
  29. package/deploy/sema-up/sema-up.sh +14 -39
  30. package/deploy/sema-up/smoke.sh +7 -6
  31. package/deploy/sema-up/stack/compose.dataroot.yaml +3 -0
  32. package/deploy/sema-up/stack/compose.yaml +13 -1
  33. package/deploy/sema-up/stack/sema-stack-cluster.yaml +21 -0
  34. package/dist/adoption/plan.d.ts +24 -0
  35. package/dist/adoption/plan.js +53 -1
  36. package/dist/adoption/runner.d.ts +10 -1
  37. package/dist/adoption/runner.js +36 -16
  38. package/dist/approval-card.d.ts +36 -38
  39. package/dist/approval-gate-currency.js +3 -2
  40. package/dist/approval-leg-origin.d.ts +33 -0
  41. package/dist/approval-leg-origin.js +4 -0
  42. package/dist/approval-reconciler.d.ts +4 -13
  43. package/dist/approval-reconciler.js +2 -2
  44. package/dist/approval.d.ts +13 -11
  45. package/dist/approval.js +3 -3
  46. package/dist/audit.d.ts +10 -3
  47. package/dist/audit.js +15 -7
  48. package/dist/auth-bridge.d.ts +9 -15
  49. package/dist/auth-bridge.js +4 -11
  50. package/dist/auth-keys.d.ts +10 -1
  51. package/dist/auth-keys.js +8 -0
  52. package/dist/auto-mode-face.d.ts +10 -7
  53. package/dist/auto-mode-face.js +7 -4
  54. package/dist/background-agent-name.d.ts +19 -1
  55. package/dist/background-agent-name.js +12 -2
  56. package/dist/background-session-reap.d.ts +1 -1
  57. package/dist/bake-runner/main.js +9 -6
  58. package/dist/bench/s1/arms.js +6 -5
  59. package/dist/bench/s1/live-deps.js +5 -2
  60. package/dist/bench/s1/run-firm.js +6 -5
  61. package/dist/bind-host.d.ts +25 -0
  62. package/dist/bind-host.js +25 -0
  63. package/dist/boot/adoption.d.ts +3 -0
  64. package/dist/boot/adoption.js +1 -0
  65. package/dist/boot/deployment-mods.d.ts +1 -1
  66. package/dist/boot/execution-env.d.ts +17 -7
  67. package/dist/boot/execution-env.js +47 -42
  68. package/dist/boot/execution-lane.d.ts +6 -4
  69. package/dist/boot/execution-lane.js +3 -1
  70. package/dist/boot/exit-boundary.d.ts +2 -2
  71. package/dist/boot/exit-boundary.js +6 -5
  72. package/dist/boot/fatal-exit.d.ts +3 -5
  73. package/dist/boot/fatal-exit.js +2 -2
  74. package/dist/boot/leader.d.ts +15 -0
  75. package/dist/boot/leader.js +17 -15
  76. package/dist/boot/memory-consolidation.d.ts +37 -29
  77. package/dist/boot/memory-consolidation.js +11 -5
  78. package/dist/boot/org-delivery.d.ts +3 -2
  79. package/dist/boot/org-memory.js +1 -1
  80. package/dist/boot/parked-revive-gate.js +2 -2
  81. package/dist/boot/reapers.d.ts +4 -3
  82. package/dist/boot/reapers.js +19 -16
  83. package/dist/boot/resolve-spec.d.ts +5 -3
  84. package/dist/boot/resolve-spec.js +60 -70
  85. package/dist/boot/retention-lane.d.ts +4 -4
  86. package/dist/boot/retention-lane.js +2 -2
  87. package/dist/boot/runner-deps.d.ts +28 -7
  88. package/dist/boot/runner-deps.js +14 -5
  89. package/dist/boot/runtime-caps.d.ts +2 -2
  90. package/dist/boot/runtime-caps.js +16 -2
  91. package/dist/boot/session-faces.d.ts +16 -7
  92. package/dist/boot/session-faces.js +114 -94
  93. package/dist/boot/shutdown.d.ts +5 -4
  94. package/dist/boot/shutdown.js +6 -4
  95. package/dist/boot/stage-01-config.d.ts +1 -0
  96. package/dist/boot/stage-01-config.js +13 -4
  97. package/dist/boot/stage-02-web-admin-pull.d.ts +2 -0
  98. package/dist/boot/stage-02-web-admin-pull.js +16 -3
  99. package/dist/boot/stage-03-store-backend.d.ts +4 -0
  100. package/dist/boot/stage-03-store-backend.js +4 -3
  101. package/dist/boot/stage-04-stores.d.ts +3 -0
  102. package/dist/boot/stage-04-stores.js +2 -2
  103. package/dist/boot/stage-05-execution-env.d.ts +8 -3
  104. package/dist/boot/stage-05-execution-env.js +2 -2
  105. package/dist/boot/stage-06-runners.d.ts +12 -13
  106. package/dist/boot/stage-06-runners.js +23 -15
  107. package/dist/boot/stage-07-capability-layer.d.ts +13 -9
  108. package/dist/boot/stage-07-capability-layer.js +5 -3
  109. package/dist/boot/stage-08-reapers.d.ts +13 -9
  110. package/dist/boot/stage-08-reapers.js +3 -3
  111. package/dist/boot/stage-09-leader.d.ts +14 -16
  112. package/dist/boot/stage-09-leader.js +12 -4
  113. package/dist/boot/stage-10-http-server.d.ts +14 -16
  114. package/dist/boot/stage-10-http-server.js +7 -4
  115. package/dist/boot/store-evidence.d.ts +20 -0
  116. package/dist/boot/store-evidence.js +13 -0
  117. package/dist/boot/stores.d.ts +6 -0
  118. package/dist/boot/stores.js +41 -27
  119. package/dist/boot/task-list-lane.d.ts +4 -4
  120. package/dist/boot/web-admin.d.ts +4 -2
  121. package/dist/boot/web-admin.js +55 -35
  122. package/dist/boot/webfetch-summarize-lane.d.ts +1 -1
  123. package/dist/boot-reclaim.d.ts +3 -1
  124. package/dist/boot-reclaim.js +1 -1
  125. package/dist/brain.d.ts +7 -18
  126. package/dist/brain.js +5 -17
  127. package/dist/budget.js +6 -6
  128. package/dist/capabilities/center-plugins.d.ts +7 -1
  129. package/dist/capabilities/center-plugins.js +32 -10
  130. package/dist/capabilities/center-wiring.js +1 -1
  131. package/dist/capabilities/composite-members.d.ts +2 -2
  132. package/dist/capabilities/composite-members.js +2 -2
  133. package/dist/capabilities/repo-tools.d.ts +2 -0
  134. package/dist/capabilities/repo-tools.js +14 -12
  135. package/dist/capabilities/scenarios.d.ts +6 -15
  136. package/dist/capabilities/scenarios.js +11 -16
  137. package/dist/capabilities/skills.d.ts +1 -1
  138. package/dist/capabilities/tool-defer.d.ts +1 -1
  139. package/dist/capability-facts.d.ts +39 -11
  140. package/dist/capability-facts.js +35 -7
  141. package/dist/card-settle-stored-scope.d.ts +56 -0
  142. package/dist/card-settle-stored-scope.js +27 -0
  143. package/dist/card-void.d.ts +8 -13
  144. package/dist/card-void.js +2 -7
  145. package/dist/center-credential-renewer.d.ts +6 -2
  146. package/dist/center-credential-renewer.js +7 -3
  147. package/dist/config-catalog.d.ts +28 -1
  148. package/dist/config-catalog.js +95 -85
  149. package/dist/config-dir-trust.d.ts +37 -4
  150. package/dist/config-dir-trust.js +88 -44
  151. package/dist/config-invariants.d.ts +43 -3
  152. package/dist/config-invariants.js +69 -5
  153. package/dist/config-lkg.d.ts +23 -1
  154. package/dist/config-lkg.js +17 -3
  155. package/dist/config-provider.d.ts +9 -9
  156. package/dist/config-provider.js +25 -110
  157. package/dist/config-pull-failure.d.ts +50 -0
  158. package/dist/config-pull-failure.js +48 -0
  159. package/dist/config-types.d.ts +62 -21
  160. package/dist/config.d.ts +14 -21
  161. package/dist/config.js +141 -64
  162. package/dist/context-window-notice.d.ts +31 -0
  163. package/dist/context-window-notice.js +28 -0
  164. package/dist/delegated-session-owner.d.ts +1 -1
  165. package/dist/deleted-session-ids.d.ts +3 -2
  166. package/dist/deployment-governance.d.ts +3 -3
  167. package/dist/deployment-shape.d.ts +46 -11
  168. package/dist/deployment-shape.js +8 -0
  169. package/dist/egress-redirect.d.ts +25 -7
  170. package/dist/egress-redirect.js +20 -2
  171. package/dist/elicitation.d.ts +6 -5
  172. package/dist/elicitation.js +23 -22
  173. package/dist/engine-identity.d.ts +28 -0
  174. package/dist/engine-identity.js +10 -0
  175. package/dist/entry-problems.d.ts +5 -7
  176. package/dist/entry-problems.js +1 -1
  177. package/dist/env-facts.js +2 -1
  178. package/dist/env-name-allowlist-knobs.d.ts +6 -5
  179. package/dist/env-name-allowlist-knobs.js +5 -0
  180. package/dist/env-witness.d.ts +7 -0
  181. package/dist/env-witness.js +16 -0
  182. package/dist/execution-lane-caps.d.ts +25 -23
  183. package/dist/execution-lane-caps.js +18 -26
  184. package/dist/execution-placement.d.ts +58 -18
  185. package/dist/execution-placement.js +41 -2
  186. package/dist/field-conflict.d.ts +7 -11
  187. package/dist/field-conflict.js +3 -3
  188. package/dist/file-history-capture.d.ts +3 -3
  189. package/dist/file-history-disclosure.js +1 -0
  190. package/dist/fleet/fleet-bus.d.ts +21 -3
  191. package/dist/fleet/fleet-bus.js +35 -25
  192. package/dist/fleet/fleet-reconciler.js +2 -2
  193. package/dist/fleet/serving-lease.js +3 -3
  194. package/dist/fleet-client.js +3 -3
  195. package/dist/fleet-lease.d.ts +0 -1
  196. package/dist/fleet-lease.js +4 -5
  197. package/dist/history-anchor.d.ts +23 -3
  198. package/dist/history-anchor.js +24 -4
  199. package/dist/hitl-delivery.d.ts +90 -0
  200. package/dist/hitl-delivery.js +98 -0
  201. package/dist/hooks/classic-stations.d.ts +8 -11
  202. package/dist/hooks/classic-stations.js +0 -7
  203. package/dist/hooks/command-spawn.d.ts +7 -2
  204. package/dist/hooks/command-spawn.js +13 -6
  205. package/dist/hooks/hook-llm.d.ts +5 -1
  206. package/dist/hooks/hook-llm.js +24 -15
  207. package/dist/hooks/hook-runner.d.ts +72 -57
  208. package/dist/hooks/hook-runner.js +271 -193
  209. package/dist/host-lsp-manager.d.ts +22 -8
  210. package/dist/host-lsp-manager.js +4 -1
  211. package/dist/http/active-run-conflict.d.ts +2 -43
  212. package/dist/http/active-run-conflict.js +3 -7
  213. package/dist/http/admission.d.ts +4 -18
  214. package/dist/http/admission.js +76 -79
  215. package/dist/http/approval-sweeps.d.ts +3 -3
  216. package/dist/http/approval-sweeps.js +56 -31
  217. package/dist/http/caller-trust.d.ts +8 -10
  218. package/dist/http/caller-trust.js +1 -2
  219. package/dist/http/claim-heartbeat.d.ts +49 -0
  220. package/dist/http/claim-heartbeat.js +46 -0
  221. package/dist/http/claimed-run.d.ts +16 -8
  222. package/dist/http/claimed-run.js +8 -0
  223. package/dist/http/dispatch.d.ts +8 -1
  224. package/dist/http/dispatch.js +78 -30
  225. package/dist/http/durable-run-leg.d.ts +11 -4
  226. package/dist/http/durable-run-leg.js +45 -21
  227. package/dist/http/execution-context.d.ts +122 -47
  228. package/dist/http/execution-context.js +135 -43
  229. package/dist/http/health-reader.d.ts +36 -0
  230. package/dist/http/health-reader.js +21 -0
  231. package/dist/http/health-self-report.d.ts +9 -9
  232. package/dist/http/health-self-report.js +4 -4
  233. package/dist/http/idempotency.d.ts +9 -5
  234. package/dist/http/idempotency.js +4 -4
  235. package/dist/http/memory-compliance-failure-reply.d.ts +15 -16
  236. package/dist/http/memory-compliance-failure-reply.js +4 -2
  237. package/dist/http/memory-face-fault-reply.d.ts +67 -0
  238. package/dist/http/memory-face-fault-reply.js +71 -0
  239. package/dist/http/memory-store-refusal-reply.d.ts +1 -1
  240. package/dist/http/memory-store-refusal-reply.js +3 -0
  241. package/dist/http/owner-access.d.ts +392 -67
  242. package/dist/http/owner-access.js +370 -35
  243. package/dist/http/principal-gate.d.ts +39 -89
  244. package/dist/http/principal-gate.js +26 -68
  245. package/dist/http/refusal-body.d.ts +35 -2
  246. package/dist/http/refusal-body.js +34 -0
  247. package/dist/http/request-guards.d.ts +9 -13
  248. package/dist/http/request-guards.js +34 -68
  249. package/dist/http/resume-composition.d.ts +37 -0
  250. package/dist/http/resume-composition.js +18 -0
  251. package/dist/http/resume-ctx-read.d.ts +46 -12
  252. package/dist/http/resume-ctx-read.js +31 -6
  253. package/dist/http/resume-legs.d.ts +54 -19
  254. package/dist/http/resume-legs.js +408 -196
  255. package/dist/http/retired-skill-manifest.d.ts +1 -1
  256. package/dist/http/route-ctx.d.ts +31 -32
  257. package/dist/http/routes/a2a-serve.d.ts +43 -5
  258. package/dist/http/routes/a2a-serve.js +60 -37
  259. package/dist/http/routes/admin-config-refresh.js +2 -2
  260. package/dist/http/routes/admin-drain.js +2 -2
  261. package/dist/http/routes/admin-memory-optout.js +4 -3
  262. package/dist/http/routes/adoption.d.ts +3 -0
  263. package/dist/http/routes/adoption.js +17 -10
  264. package/dist/http/routes/agents-roster.js +13 -7
  265. package/dist/http/routes/approvals-assistant.js +73 -67
  266. package/dist/http/routes/attachments.js +2 -2
  267. package/dist/http/routes/background.d.ts +3 -3
  268. package/dist/http/routes/background.js +9 -17
  269. package/dist/http/routes/capabilities.js +16 -19
  270. package/dist/http/routes/config-catalog.js +2 -2
  271. package/dist/http/routes/devices.d.ts +3 -3
  272. package/dist/http/routes/devices.js +4 -4
  273. package/dist/http/routes/diagnostics.d.ts +29 -3
  274. package/dist/http/routes/diagnostics.js +49 -18
  275. package/dist/http/routes/engine.js +2 -2
  276. package/dist/http/routes/fleet.js +5 -3
  277. package/dist/http/routes/images.js +10 -6
  278. package/dist/http/routes/leader.d.ts +7 -2
  279. package/dist/http/routes/leader.js +12 -3
  280. package/dist/http/routes/mcp-reconnect.d.ts +1 -1
  281. package/dist/http/routes/mcp-reconnect.js +7 -15
  282. package/dist/http/routes/memory-bundle.js +4 -7
  283. package/dist/http/routes/memory-compliance.js +4 -4
  284. package/dist/http/routes/memory-consolidation.js +6 -9
  285. package/dist/http/routes/memory-origin.d.ts +2 -0
  286. package/dist/http/routes/memory-origin.js +7 -8
  287. package/dist/http/routes/memory-policy.js +17 -12
  288. package/dist/http/routes/notify-wake.js +10 -19
  289. package/dist/http/routes/observability.js +3 -3
  290. package/dist/http/routes/principal-inbox.d.ts +4 -2
  291. package/dist/http/routes/principal-inbox.js +5 -4
  292. package/dist/http/routes/projects.d.ts +1 -1
  293. package/dist/http/routes/projects.js +3 -2
  294. package/dist/http/routes/retention-ops.js +6 -9
  295. package/dist/http/routes/rules.js +20 -5
  296. package/dist/http/routes/run-memory-capture.d.ts +2 -2
  297. package/dist/http/routes/run-memory-capture.js +6 -12
  298. package/dist/http/routes/run-permission-mode.d.ts +2 -2
  299. package/dist/http/routes/run-permission-mode.js +10 -17
  300. package/dist/http/routes/runs.js +155 -237
  301. package/dist/http/routes/session-memory-sync.d.ts +2 -2
  302. package/dist/http/routes/session-memory-sync.js +7 -13
  303. package/dist/http/routes/session-sync.d.ts +28 -7
  304. package/dist/http/routes/session-sync.js +63 -50
  305. package/dist/http/routes/sessions-list.d.ts +3 -3
  306. package/dist/http/routes/sessions-list.js +9 -9
  307. package/dist/http/routes/sessions.js +87 -124
  308. package/dist/http/routes/shared-memory.js +6 -6
  309. package/dist/http/routes/side-query.js +2 -2
  310. package/dist/http/routes/tasks.js +237 -187
  311. package/dist/http/routes/trace-usage.d.ts +0 -12
  312. package/dist/http/routes/trace-usage.js +40 -46
  313. package/dist/http/routes/workflows.d.ts +39 -4
  314. package/dist/http/routes/workflows.js +42 -14
  315. package/dist/http/run-concurrency-cap.d.ts +20 -12
  316. package/dist/http/run-concurrency-cap.js +39 -26
  317. package/dist/http/run-read-face.d.ts +3 -5
  318. package/dist/http/run-read-face.js +8 -13
  319. package/dist/http/send.d.ts +12 -3
  320. package/dist/http/send.js +42 -6
  321. package/dist/http/server.d.ts +43 -45
  322. package/dist/http/server.js +61 -11
  323. package/dist/http/sse-log.d.ts +17 -10
  324. package/dist/http/sse-log.js +7 -7
  325. package/dist/http/stored-body-replay.d.ts +12 -0
  326. package/dist/http/stored-body-replay.js +2 -2
  327. package/dist/http/submit-ctx.d.ts +17 -8
  328. package/dist/http/submit-ctx.js +8 -5
  329. package/dist/http/submit-replay.d.ts +19 -6
  330. package/dist/http/submit-replay.js +18 -6
  331. package/dist/http/sync-submit-body.d.ts +3 -4
  332. package/dist/http/sync-submit-body.js +4 -5
  333. package/dist/http/wire-types.d.ts +4 -3
  334. package/dist/identity-source.d.ts +36 -5
  335. package/dist/identity-source.js +27 -0
  336. package/dist/index.d.ts +4 -1
  337. package/dist/index.js +2 -0
  338. package/dist/key-resolver.d.ts +32 -0
  339. package/dist/key-resolver.js +23 -9
  340. package/dist/leader/diffup.js +2 -1
  341. package/dist/leader/endpoint.d.ts +26 -5
  342. package/dist/leader/endpoint.js +154 -14
  343. package/dist/leader/fanout.d.ts +3 -0
  344. package/dist/leader/fanout.js +78 -63
  345. package/dist/leader/leader.d.ts +16 -0
  346. package/dist/leader/leader.js +43 -3
  347. package/dist/leader/merge.d.ts +9 -1
  348. package/dist/leader/merge.js +16 -1
  349. package/dist/leader/repair-wire.js +1 -1
  350. package/dist/leader/wire.d.ts +36 -3
  351. package/dist/leader/wire.js +59 -18
  352. package/dist/leg-facts.d.ts +7 -2
  353. package/dist/leg-facts.js +1 -0
  354. package/dist/local-store-declaration.d.ts +54 -0
  355. package/dist/local-store-declaration.js +59 -0
  356. package/dist/lsp-evict.d.ts +6 -4
  357. package/dist/lsp-evict.js +2 -3
  358. package/dist/mcp-assertion-header.d.ts +1 -1
  359. package/dist/mcp-assertion-header.js +1 -1
  360. package/dist/memory-operator-faces.d.ts +5 -4
  361. package/dist/memory-operator-faces.js +1 -1
  362. package/dist/memory-project-layer.js +1 -1
  363. package/dist/memory-scope.d.ts +33 -6
  364. package/dist/memory-scope.js +68 -19
  365. package/dist/memory-store-refusal.d.ts +5 -2
  366. package/dist/memory-sync-client.d.ts +3 -2
  367. package/dist/memory-sync-client.js +8 -5
  368. package/dist/model-compat.d.ts +17 -8
  369. package/dist/model-compat.js +6 -2
  370. package/dist/model-context-window.d.ts +57 -0
  371. package/dist/model-context-window.js +21 -0
  372. package/dist/model-entry-headers.d.ts +46 -4
  373. package/dist/model-entry-headers.js +2 -2
  374. package/dist/model-entry-refusal.d.ts +40 -20
  375. package/dist/model-entry-refusal.js +57 -30
  376. package/dist/model-plane-face.d.ts +19 -11
  377. package/dist/model-plane-face.js +9 -1
  378. package/dist/model-plane-probe.d.ts +2 -0
  379. package/dist/model-plane-probe.js +17 -0
  380. package/dist/model-provider.d.ts +3 -3
  381. package/dist/model-reach-scope.d.ts +2 -1
  382. package/dist/model-route-endpoint.d.ts +9 -5
  383. package/dist/model-route-endpoint.js +29 -7
  384. package/dist/model-select.d.ts +16 -0
  385. package/dist/model-select.js +4 -0
  386. package/dist/mountinfo.d.ts +37 -0
  387. package/dist/mountinfo.js +47 -0
  388. package/dist/namespaced-rule-name.d.ts +23 -14
  389. package/dist/namespaced-rule-name.js +8 -11
  390. package/dist/net-address.d.ts +1 -1
  391. package/dist/observability/corrupt-read-seat.d.ts +4 -4
  392. package/dist/observability/corrupt-read-seat.js +5 -3
  393. package/dist/observability/fail-open.d.ts +72 -40
  394. package/dist/observability/fail-open.js +74 -40
  395. package/dist/observability/logger.d.ts +22 -1
  396. package/dist/observability/logger.js +89 -12
  397. package/dist/observability/metrics.js +4 -5
  398. package/dist/observability/otel-exporter.js +2 -1
  399. package/dist/observability/principal-context.d.ts +14 -7
  400. package/dist/observability/principal-context.js +8 -3
  401. package/dist/observability/run-terminal.d.ts +7 -1
  402. package/dist/observability/run-terminal.js +6 -2
  403. package/dist/observability/secret-env-scrub.d.ts +1 -1
  404. package/dist/observability/secret-env-scrub.js +1 -1
  405. package/dist/orchestration/hardened-vm-runner.d.ts +1 -0
  406. package/dist/orchestration/hardened-vm-runner.js +11 -5
  407. package/dist/orchestration/hardened-vm-worker-runner.d.ts +0 -14
  408. package/dist/orchestration/hardened-vm-worker-runner.js +5 -0
  409. package/dist/orchestration/hardened-vm-worker.js +2 -1
  410. package/dist/orchestration/workflow-completion-inbox.d.ts +3 -3
  411. package/dist/orchestration/workflow-completion-inbox.js +3 -2
  412. package/dist/org-delivery-gate.d.ts +36 -10
  413. package/dist/org-delivery-gate.js +12 -8
  414. package/dist/outbound-dispatcher.d.ts +1 -1
  415. package/dist/outbound-dispatcher.js +6 -12
  416. package/dist/owner-brands.d.ts +81 -0
  417. package/dist/owner-brands.js +42 -0
  418. package/dist/owner-faces.d.ts +532 -0
  419. package/dist/owner-faces.js +126 -0
  420. package/dist/park-row-commit.d.ts +67 -0
  421. package/dist/park-row-commit.js +76 -0
  422. package/dist/parked-decide.d.ts +76 -12
  423. package/dist/parked-decide.js +152 -11
  424. package/dist/parked-revive-surface.d.ts +14 -4
  425. package/dist/parked-revive-surface.js +5 -4
  426. package/dist/peer-directory.d.ts +7 -9
  427. package/dist/peer-directory.js +3 -2
  428. package/dist/permission-rule-vocab.d.ts +53 -8
  429. package/dist/permission-rule-vocab.js +30 -2
  430. package/dist/plugins/adoption-log-sql.d.ts +3 -25
  431. package/dist/plugins/adoption-log-sql.js +23 -21
  432. package/dist/plugins/approval-ask-retired-delete-by-task-m50.d.ts +7 -0
  433. package/dist/plugins/approval-ask-retired-delete-by-task-m50.js +17 -0
  434. package/dist/plugins/approval-ask-store-file.d.ts +18 -7
  435. package/dist/plugins/approval-ask-store-file.js +37 -14
  436. package/dist/plugins/approval-ask-store-memory.d.ts +12 -4
  437. package/dist/plugins/approval-ask-store-memory.js +24 -10
  438. package/dist/plugins/approval-ask-store-sql.d.ts +40 -21
  439. package/dist/plugins/approval-ask-store-sql.js +44 -15
  440. package/dist/plugins/approval-exemption-skill-cutoff.d.ts +64 -0
  441. package/dist/plugins/approval-exemption-skill-cutoff.js +122 -0
  442. package/dist/plugins/approval-exemption-skill-m46.d.ts +14 -0
  443. package/dist/plugins/approval-exemption-skill-m46.js +21 -0
  444. package/dist/plugins/approval-exemption-store.d.ts +32 -2
  445. package/dist/plugins/approval-exemption-store.js +42 -19
  446. package/dist/plugins/approval-nonce-store.d.ts +39 -12
  447. package/dist/plugins/approval-nonce-store.js +72 -23
  448. package/dist/plugins/blob-backend.d.ts +2 -0
  449. package/dist/plugins/blob-backend.js +9 -6
  450. package/dist/plugins/caching-session-store.d.ts +13 -1
  451. package/dist/plugins/caching-session-store.js +43 -4
  452. package/dist/plugins/checkpoint-index-columns.d.ts +32 -5
  453. package/dist/plugins/checkpoint-index-columns.js +36 -1
  454. package/dist/plugins/checkpoint-store-face.d.ts +83 -10
  455. package/dist/plugins/checkpoint-store-face.js +18 -1
  456. package/dist/plugins/device-store-sql.js +1 -0
  457. package/dist/plugins/ensure-index.d.ts +13 -1
  458. package/dist/plugins/ensure-index.js +154 -21
  459. package/dist/plugins/ensure-schema-lock-policy.d.ts +36 -18
  460. package/dist/plugins/ensure-schema-lock-policy.js +76 -9
  461. package/dist/plugins/file-run-store.d.ts +85 -32
  462. package/dist/plugins/file-run-store.js +177 -94
  463. package/dist/plugins/host-platform.d.ts +24 -3
  464. package/dist/plugins/host-platform.js +15 -1
  465. package/dist/plugins/image-bake-store-sql.js +2 -0
  466. package/dist/plugins/imported-layer-root-retirement.d.ts +2 -2
  467. package/dist/plugins/k8s-pod-reaper.d.ts +1 -3
  468. package/dist/plugins/k8s-pod-reaper.js +0 -1
  469. package/dist/plugins/leader-run-store-sql.d.ts +22 -0
  470. package/dist/plugins/leader-run-store-sql.js +34 -4
  471. package/dist/plugins/local-checkpoint-store.d.ts +62 -23
  472. package/dist/plugins/local-checkpoint-store.js +197 -77
  473. package/dist/plugins/local-data-dir-modes-m39.js +2 -1
  474. package/dist/plugins/local-data-root-admission.d.ts +52 -0
  475. package/dist/plugins/local-data-root-admission.js +100 -0
  476. package/dist/plugins/local-docker-capacity.d.ts +93 -0
  477. package/dist/plugins/local-docker-capacity.js +194 -0
  478. package/dist/plugins/local-docker-reaper.d.ts +92 -0
  479. package/dist/plugins/local-docker-reaper.js +102 -0
  480. package/dist/plugins/local-engine-high-water.d.ts +29 -6
  481. package/dist/plugins/local-engine-high-water.js +27 -19
  482. package/dist/plugins/local-session-store.d.ts +458 -140
  483. package/dist/plugins/local-session-store.js +906 -292
  484. package/dist/plugins/local-session-window.d.ts +3 -2
  485. package/dist/plugins/local-session-window.js +3 -2
  486. package/dist/plugins/local-sidecar-quarantine.js +3 -2
  487. package/dist/plugins/local-task-attachment-store.d.ts +18 -1
  488. package/dist/plugins/local-task-attachment-store.js +22 -1
  489. package/dist/plugins/memory-embedder.js +9 -7
  490. package/dist/plugins/memory-engine-pg.d.ts +3 -2
  491. package/dist/plugins/memory-engine-pg.js +14 -5
  492. package/dist/plugins/memory-engine-sql-apply.d.ts +8 -4
  493. package/dist/plugins/memory-engine-sql-apply.js +6 -8
  494. package/dist/plugins/memory-engine-tidb.d.ts +4 -2
  495. package/dist/plugins/memory-engine-tidb.js +11 -2
  496. package/dist/plugins/memory-optout-grant-store-sql.d.ts +1 -1
  497. package/dist/plugins/memory-optout-grant-store-sql.js +3 -3
  498. package/dist/plugins/memory-run-store.d.ts +53 -36
  499. package/dist/plugins/memory-run-store.js +116 -88
  500. package/dist/plugins/one-time-migration-marker.d.ts +26 -0
  501. package/dist/plugins/one-time-migration-marker.js +13 -0
  502. package/dist/plugins/one-time-migrations.d.ts +214 -47
  503. package/dist/plugins/one-time-migrations.js +481 -135
  504. package/dist/plugins/org-delivery-quota-store.d.ts +34 -11
  505. package/dist/plugins/org-delivery-quota-store.js +31 -15
  506. package/dist/plugins/permission-rule-store-file.d.ts +3 -3
  507. package/dist/plugins/permission-rule-store-sql.d.ts +5 -64
  508. package/dist/plugins/permission-rule-store-sql.js +11 -95
  509. package/dist/plugins/pg-pool.d.ts +2 -32
  510. package/dist/plugins/pg-pool.js +24 -17
  511. package/dist/plugins/remote-env-device.d.ts +3 -2
  512. package/dist/plugins/remote-env-e2b.d.ts +8 -32
  513. package/dist/plugins/remote-env-e2b.js +44 -32
  514. package/dist/plugins/remote-env-host.d.ts +51 -17
  515. package/dist/plugins/remote-env-host.js +111 -42
  516. package/dist/plugins/remote-env-k8s.d.ts +40 -45
  517. package/dist/plugins/remote-env-k8s.js +111 -60
  518. package/dist/plugins/remote-env-local-docker.d.ts +152 -15
  519. package/dist/plugins/remote-env-local-docker.js +352 -72
  520. package/dist/plugins/remote-scratchpad.js +4 -0
  521. package/dist/plugins/retention-deployment.d.ts +49 -17
  522. package/dist/plugins/retention-deployment.js +39 -8
  523. package/dist/plugins/run-preview-m45.d.ts +11 -0
  524. package/dist/plugins/run-preview-m45.js +19 -0
  525. package/dist/plugins/run-store-sql.d.ts +82 -75
  526. package/dist/plugins/run-store-sql.js +164 -125
  527. package/dist/plugins/s3-answer.d.ts +2 -1
  528. package/dist/plugins/sandbox-reaper.d.ts +26 -0
  529. package/dist/plugins/sandbox-reaper.js +2 -0
  530. package/dist/plugins/scenario-prefix-switch-m42.d.ts +56 -0
  531. package/dist/plugins/scenario-prefix-switch-m42.js +56 -0
  532. package/dist/plugins/scheduler-support.d.ts +16 -1
  533. package/dist/plugins/scheduler-support.js +22 -2
  534. package/dist/plugins/schema-consistency.d.ts +131 -14
  535. package/dist/plugins/schema-consistency.js +388 -18
  536. package/dist/plugins/schema-drift-sentence.d.ts +10 -6
  537. package/dist/plugins/schema-drift-sentence.js +15 -7
  538. package/dist/plugins/schema-ensure-legs.d.ts +9 -0
  539. package/dist/plugins/schema-ensure-legs.js +1 -1
  540. package/dist/plugins/schema-indexes.js +3 -0
  541. package/dist/plugins/schema-live-columns.d.ts +14 -5
  542. package/dist/plugins/schema-live-columns.js +10 -10
  543. package/dist/plugins/send-user-file.js +2 -1
  544. package/dist/plugins/session-birth.d.ts +37 -0
  545. package/dist/plugins/session-birth.js +38 -0
  546. package/dist/plugins/session-epoch-anchor.d.ts +40 -12
  547. package/dist/plugins/session-epoch-anchor.js +33 -11
  548. package/dist/plugins/session-ext-table.d.ts +27 -3
  549. package/dist/plugins/session-ext-table.js +19 -6
  550. package/dist/plugins/session-fork.d.ts +15 -1
  551. package/dist/plugins/session-fork.js +3 -0
  552. package/dist/plugins/session-ownership.d.ts +1 -1
  553. package/dist/plugins/session-placement.d.ts +27 -20
  554. package/dist/plugins/session-placement.js +15 -12
  555. package/dist/plugins/session-row-sql.d.ts +12 -0
  556. package/dist/plugins/session-row-sql.js +3 -3
  557. package/dist/plugins/session-run-rollup.d.ts +29 -0
  558. package/dist/plugins/session-run-rollup.js +40 -0
  559. package/dist/plugins/session-store-sql.d.ts +38 -12
  560. package/dist/plugins/session-store-sql.js +130 -30
  561. package/dist/plugins/session-withdraw-sql.d.ts +36 -0
  562. package/dist/plugins/session-withdraw-sql.js +42 -0
  563. package/dist/plugins/shared-memory-store-sql.d.ts +0 -69
  564. package/dist/plugins/shared-memory-store-sql.js +2 -1
  565. package/dist/plugins/shell-sentinel-owner-m48.d.ts +42 -0
  566. package/dist/plugins/shell-sentinel-owner-m48.js +9 -0
  567. package/dist/plugins/snapshot-bucket-presence.d.ts +2 -1
  568. package/dist/plugins/sql-driver.d.ts +1 -1
  569. package/dist/plugins/sql-driver.js +2 -1
  570. package/dist/plugins/sql-errors.d.ts +32 -5
  571. package/dist/plugins/sql-errors.js +55 -7
  572. package/dist/plugins/sql-json-column.d.ts +8 -7
  573. package/dist/plugins/sql-json-column.js +10 -6
  574. package/dist/plugins/stop-then-start-sentence.d.ts +16 -0
  575. package/dist/plugins/stop-then-start-sentence.js +7 -0
  576. package/dist/plugins/store-backend.d.ts +99 -16
  577. package/dist/plugins/store-backend.js +230 -65
  578. package/dist/plugins/store-contracts.d.ts +123 -33
  579. package/dist/plugins/store-contracts.js +38 -1
  580. package/dist/plugins/store-fault.d.ts +28 -2
  581. package/dist/plugins/store-fault.js +20 -2
  582. package/dist/plugins/task-attachment-store.d.ts +15 -3
  583. package/dist/plugins/task-attachment-store.js +22 -9
  584. package/dist/plugins/tidb-pool.d.ts +11 -6
  585. package/dist/plugins/tidb-pool.js +39 -18
  586. package/dist/plugins/web-search.js +5 -3
  587. package/dist/plugins/workflow-run-store-sql.d.ts +6 -1
  588. package/dist/plugins/workflow-run-store-sql.js +11 -5
  589. package/dist/plugins/workspace-custody.d.ts +44 -0
  590. package/dist/plugins/workspace-custody.js +47 -0
  591. package/dist/principal-jwt.d.ts +4 -4
  592. package/dist/principal-jwt.js +20 -5
  593. package/dist/principal-shape.d.ts +41 -0
  594. package/dist/principal-shape.js +19 -0
  595. package/dist/project-identity.d.ts +8 -7
  596. package/dist/project-identity.js +40 -17
  597. package/dist/project-layer-key.d.ts +13 -2
  598. package/dist/project-layer-key.js +9 -1
  599. package/dist/question.d.ts +13 -23
  600. package/dist/question.js +21 -39
  601. package/dist/read-deny-floor-notice.d.ts +36 -0
  602. package/dist/read-deny-floor-notice.js +40 -0
  603. package/dist/{plain-string-record.d.ts → request-declaration-disposition.d.ts} +9 -23
  604. package/dist/request-declaration-disposition.js +39 -0
  605. package/dist/request-declaration-refusal.d.ts +35 -12
  606. package/dist/request-declaration-refusal.js +21 -9
  607. package/dist/request-form.d.ts +58 -0
  608. package/dist/request-form.js +72 -0
  609. package/dist/request-image-urls.d.ts +8 -2
  610. package/dist/request-image-urls.js +2 -1
  611. package/dist/request-images.d.ts +20 -0
  612. package/dist/request-images.js +59 -0
  613. package/dist/request-key-closure.d.ts +6 -7
  614. package/dist/request-key-closure.js +15 -2
  615. package/dist/resource-suspend.d.ts +7 -16
  616. package/dist/resource-suspend.js +1 -1
  617. package/dist/retired-name-host-notice.d.ts +21 -0
  618. package/dist/retired-name-host-notice.js +12 -0
  619. package/dist/rule-entry-list.d.ts +2 -2
  620. package/dist/rule-entry-list.js +3 -4
  621. package/dist/rule-issue-reading.d.ts +58 -0
  622. package/dist/rule-issue-reading.js +14 -0
  623. package/dist/rules-consent.d.ts +5 -3
  624. package/dist/rules-consent.js +1 -0
  625. package/dist/run-acceptance.d.ts +3 -1
  626. package/dist/run-acceptance.js +3 -0
  627. package/dist/run-cancel-card.d.ts +28 -0
  628. package/dist/run-cancel-card.js +19 -0
  629. package/dist/run-cancel-context.d.ts +10 -0
  630. package/dist/run-cancel-context.js +1 -0
  631. package/dist/run-local.d.ts +14 -6
  632. package/dist/run-local.js +117 -90
  633. package/dist/run-stale-default.d.ts +7 -0
  634. package/dist/run-stale-default.js +2 -0
  635. package/dist/runs.d.ts +56 -21
  636. package/dist/runs.js +73 -43
  637. package/dist/runtime-caps-resolver.d.ts +21 -6
  638. package/dist/runtime-caps-resolver.js +17 -4
  639. package/dist/runtime-governance.d.ts +2 -2
  640. package/dist/runtime-governance.js +5 -3
  641. package/dist/sealed-key-layout.d.ts +12 -5
  642. package/dist/sealed-key-layout.js +5 -0
  643. package/dist/sealed-key.d.ts +12 -2
  644. package/dist/sealed-key.js +115 -27
  645. package/dist/security.d.ts +128 -158
  646. package/dist/security.js +163 -59
  647. package/dist/sema-config-dir.d.ts +20 -0
  648. package/dist/sema-config-dir.js +25 -0
  649. package/dist/server-secret-env.d.ts +55 -25
  650. package/dist/server-secret-env.js +75 -22
  651. package/dist/session-agent.d.ts +3 -2
  652. package/dist/session-children-retire.d.ts +13 -8
  653. package/dist/session-children-retire.js +9 -7
  654. package/dist/session-deletion.d.ts +88 -0
  655. package/dist/session-deletion.js +8 -0
  656. package/dist/session-erase.d.ts +145 -0
  657. package/dist/session-erase.js +115 -0
  658. package/dist/session-error-wire.d.ts +5 -5
  659. package/dist/session-error-wire.js +1 -1
  660. package/dist/session-incarnation.d.ts +52 -5
  661. package/dist/session-incarnation.js +19 -2
  662. package/dist/session-policy-wire.d.ts +6 -3
  663. package/dist/session-policy-wire.js +11 -1
  664. package/dist/session-resident-background.d.ts +0 -71
  665. package/dist/session-resident-background.js +4 -3
  666. package/dist/session-row.d.ts +2 -1
  667. package/dist/session-rules-seat.d.ts +12 -0
  668. package/dist/session-rules-seat.js +19 -0
  669. package/dist/session-titler.d.ts +7 -15
  670. package/dist/session-titler.js +1 -1
  671. package/dist/session-workspace.d.ts +3 -3
  672. package/dist/spec-fields.d.ts +57 -3
  673. package/dist/spec-fields.js +72 -51
  674. package/dist/store-admission.d.ts +33 -0
  675. package/dist/store-admission.js +49 -0
  676. package/dist/store-posture.d.ts +141 -20
  677. package/dist/store-posture.js +205 -3
  678. package/dist/stored-request-hooks-m20.js +2 -2
  679. package/dist/stores-sql/background-agent-store-sql.d.ts +11 -2
  680. package/dist/stores-sql/background-agent-store-sql.js +73 -20
  681. package/dist/stores-sql/checkpoint-store-sql.d.ts +34 -29
  682. package/dist/stores-sql/checkpoint-store-sql.js +78 -49
  683. package/dist/stores-sql/file-history-store-sql.d.ts +1 -1
  684. package/dist/stores-sql/file-history-store-sql.js +3 -5
  685. package/dist/stores-sql/mailbox-store-sql.d.ts +7 -4
  686. package/dist/stores-sql/mailbox-store-sql.js +31 -32
  687. package/dist/stores-sql/pg-session-storage.d.ts +7 -5
  688. package/dist/stores-sql/pg-session-storage.js +54 -46
  689. package/dist/stores-sql/retention-store-sql.d.ts +87 -19
  690. package/dist/stores-sql/retention-store-sql.js +92 -27
  691. package/dist/stores-sql/session-policy-store-sql.d.ts +32 -10
  692. package/dist/stores-sql/session-policy-store-sql.js +44 -36
  693. package/dist/stores-sql/session-write-hooks.d.ts +12 -6
  694. package/dist/stores-sql/tidb-session-storage.d.ts +4 -4
  695. package/dist/stores-sql/tidb-session-storage.js +13 -8
  696. package/dist/stores-sql/tidb-session-store.d.ts +36 -17
  697. package/dist/stores-sql/tidb-session-store.js +69 -39
  698. package/dist/stores-sql/tool-result-store-sql.d.ts +1 -1
  699. package/dist/stores-sql/tool-result-store-sql.js +4 -6
  700. package/dist/stores-sql/windowed-session-storage.d.ts +5 -0
  701. package/dist/stores-sql/windowed-session-storage.js +9 -0
  702. package/dist/submission-exit.d.ts +50 -0
  703. package/dist/submission-exit.js +108 -0
  704. package/dist/task-a2a.d.ts +3 -8
  705. package/dist/task-a2a.js +28 -30
  706. package/dist/task-cwd.d.ts +43 -7
  707. package/dist/task-cwd.js +11 -0
  708. package/dist/task-mcp.d.ts +3 -3
  709. package/dist/task-mcp.js +4 -4
  710. package/dist/task-settings.d.ts +14 -10
  711. package/dist/task-settings.js +19 -7
  712. package/dist/terminal.d.ts +27 -43
  713. package/dist/terminal.js +49 -14
  714. package/dist/tool-approval.d.ts +173 -163
  715. package/dist/tool-approval.js +247 -232
  716. package/dist/trace/core-keyset-guard.d.ts +13 -6
  717. package/dist/trace/core-vocab-wire.d.ts +95 -0
  718. package/dist/trace/core-vocab-wire.js +15 -0
  719. package/dist/trace/engine-notice-wire.d.ts +24 -21
  720. package/dist/trace/engine-notice-wire.js +7 -3
  721. package/dist/trace/exit-seat.d.ts +30 -4
  722. package/dist/trace/exit-seat.js +40 -36
  723. package/dist/trace/extension-call-face.d.ts +3 -2
  724. package/dist/trace/extension-call-face.js +3 -1
  725. package/dist/trace/ledger-events.d.ts +4 -7
  726. package/dist/trace/ledger-sink.d.ts +4 -31
  727. package/dist/trace/ledger-sink.js +0 -11
  728. package/dist/trace/model-segment.d.ts +5 -5
  729. package/dist/trace/model-segment.js +5 -5
  730. package/dist/trace/project.d.ts +59 -44
  731. package/dist/trace/project.js +60 -26
  732. package/dist/trace/redact.d.ts +135 -27
  733. package/dist/trace/redact.js +884 -260
  734. package/dist/trace/self-minted-wire.d.ts +567 -20
  735. package/dist/trace/self-minted-wire.js +205 -24
  736. package/dist/trace/wire-projection-faces.d.ts +5 -6
  737. package/dist/trace/wire-projection-faces.js +2 -2
  738. package/dist/upstream-body.d.ts +23 -0
  739. package/dist/upstream-body.js +16 -0
  740. package/dist/url-refusal.d.ts +3 -3
  741. package/dist/url-refusal.js +11 -4
  742. package/dist/user-authored-text.d.ts +1 -1
  743. package/dist/user-input-ledger.d.ts +7 -8
  744. package/dist/user-input-ledger.js +1 -1
  745. package/dist/web-admin-client/apply-effective.d.ts +6 -3
  746. package/dist/web-admin-client/apply-effective.js +33 -23
  747. package/dist/web-admin-client/apply-ledger.d.ts +16 -7
  748. package/dist/web-admin-client/apply-ledger.js +5 -2
  749. package/dist/web-admin-client/center-request.d.ts +2 -2
  750. package/dist/web-admin-client/center-request.js +15 -15
  751. package/dist/web-admin-client/effective-keys.d.ts +1 -1
  752. package/dist/web-admin-client/effective-keys.js +1 -1
  753. package/dist/web-admin-client/entry-metadata.d.ts +8 -0
  754. package/dist/web-admin-client/entry-metadata.js +13 -0
  755. package/dist/web-admin-client/http-client.d.ts +1 -1
  756. package/dist/web-admin-client/http-client.js +23 -4
  757. package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
  758. package/dist/web-admin-client/mcp-revocation.js +2 -1
  759. package/dist/web-admin-client/read-warnings.d.ts +1 -0
  760. package/dist/web-admin-client/read-warnings.js +1 -0
  761. package/dist/web-admin-client/restart-signal.js +8 -4
  762. package/dist/web-admin-client/skills-mcp.d.ts +2 -2
  763. package/dist/web-admin-client/types.d.ts +1 -2
  764. package/dist/workspace-space.d.ts +3 -2
  765. package/docs/DEVICE-EXECUTOR-PROTOCOL.md +4 -4
  766. package/docs/error-text-lexicon.json +317 -0
  767. package/package.json +8 -3
  768. package/scripts/drain-check-local.mjs +118 -147
  769. package/scripts/drain-check.mysql.sql +22 -2
  770. package/scripts/drain-check.pg.sql +22 -2
  771. package/scripts/embed-minimal.mjs +183 -0
  772. package/wire-changes/server@7.148.0.json +1517 -0
  773. package/wire-changes/server@7.149.0.json +372 -0
  774. package/dist/http/memory-control-plane-corrupt-reply.d.ts +0 -25
  775. package/dist/http/memory-control-plane-corrupt-reply.js +0 -19
  776. package/dist/http/memory-layer-reply.d.ts +0 -30
  777. package/dist/http/memory-layer-reply.js +0 -24
  778. package/dist/lsp/e2b-bridge.d.ts +0 -57
  779. package/dist/lsp/e2b-bridge.js +0 -139
  780. package/dist/lsp/e2b-manager.d.ts +0 -93
  781. package/dist/lsp/e2b-manager.js +0 -178
  782. package/dist/lsp/lsp-frames.d.ts +0 -14
  783. package/dist/lsp/lsp-frames.js +0 -25
  784. package/dist/lsp/manager.d.ts +0 -129
  785. package/dist/lsp/manager.js +0 -127
  786. package/dist/lsp/types.d.ts +0 -12
  787. package/dist/lsp/types.js +0 -2
  788. package/dist/lsp/ws-transport.d.ts +0 -40
  789. package/dist/lsp/ws-transport.js +0 -210
  790. package/dist/plain-string-record.js +0 -70
@@ -67,10 +67,9 @@ type WiringSectionExcluded = (typeof import("./wire-projection-faces.js").WIRE_P
67
67
  type _GuardWiringSections = AssertAllKeysHandled<Exclude<keyof WiringManifest, WiringSectionProjected | WiringSectionExcluded>>;
68
68
  type _GuardWiringSectionsReverse = AssertAllKeysHandled<Exclude<WiringSectionProjected | WiringSectionExcluded, keyof WiringManifest>>;
69
69
  type WiringSection<K extends keyof WiringManifest> = NonNullable<WiringManifest[K]>;
70
- type WiringLegHandled = "kind";
71
- type WiringLegExcluded = "runOrigin";
72
- type _GuardWiringLeg = AssertAllKeysHandled<Exclude<keyof WiringSection<"leg">, WiringLegHandled | WiringLegExcluded>>;
73
- type _GuardWiringLegReverse = AssertAllKeysHandled<Exclude<WiringLegHandled | WiringLegExcluded, keyof WiringSection<"leg">>>;
70
+ type WiringLegHandled = "kind" | "runOrigin";
71
+ type _GuardWiringLeg = AssertAllKeysHandled<Exclude<keyof WiringSection<"leg">, WiringLegHandled>>;
72
+ type _GuardWiringLegReverse = AssertAllKeysHandled<Exclude<WiringLegHandled, keyof WiringSection<"leg">>>;
74
73
  type WiringModRowKeys = WiringSection<"mods">[number] extends infer R ? (R extends unknown ? keyof R : never) : never;
75
74
  type WiringModRowHandled = "name" | "seat" | "tier" | "provenance" | "events" | "observe" | "skipped" | "refusedBy" | "reason";
76
75
  type _GuardWiringModRow = AssertAllKeysHandled<Exclude<WiringModRowKeys, WiringModRowHandled>>;
@@ -218,8 +217,8 @@ type _GuardPromptManifestKeysReverse = AssertAllKeysHandled<{
218
217
  type _GuardPromptManifestKeysNonEmpty = AssertAllKeysHandled<{
219
218
  [L in keyof ManifestCore]: [ManifestDeclared<ManifestFaces, L>] extends [never] ? L : never;
220
219
  }[keyof ManifestCore]>;
221
- type SummaryProjected = "sessionId" | "scope" | "createdAt" | "gateKind" | "severity" | "spentMicroUsd" | "deadline" | "hasBidiControls" | "requiresRealApproval" | "denialLimitFallback" | "origin" | "mandated" | "mandate" | "boundGrantDigest" | "boundGrants" | "classifierNoRuling" | "boundGrantAbsence" | "checkpointId" | "rowVerdict";
222
- type SummaryExcluded = "token" | "toolInput" | "toolName" | "toolCallId" | "preview" | "principal" | "sourceSessionId" | "agentId" | "approvalCard" | "restoreMode" | "previewWithheld" | "authoredBy" | "runOrigin" | "requestedByCallId";
220
+ type SummaryProjected = "sessionId" | "scope" | "createdAt" | "gateKind" | "severity" | "spentMicroUsd" | "deadline" | "hasBidiControls" | "requiresRealApproval" | "denialLimitFallback" | "origin" | "mandated" | "mandate" | "boundGrantDigest" | "boundGrants" | "classifierNoRuling" | "boundGrantAbsence" | "checkpointId" | "runOrigin" | "rowVerdict";
221
+ type SummaryExcluded = "token" | "toolInput" | "toolName" | "toolCallId" | "preview" | "principal" | "sourceSessionId" | "agentId" | "approvalCard" | "restoreMode" | "previewWithheld" | "authoredBy" | "requestedByCallId";
223
222
  type _GuardInboxSummary = AssertAllKeysHandled<Exclude<keyof CheckpointSummary, SummaryProjected | SummaryExcluded>>;
224
223
  type _GuardInboxSummaryReverse = AssertAllKeysHandled<Exclude<SummaryProjected | SummaryExcluded, keyof CheckpointSummary>>;
225
224
  type ParkArmKeys = keyof Extract<PendingAction, {
@@ -483,6 +482,10 @@ type _GuardWorkflowRunStats = AssertAllKeysHandled<Exclude<keyof WorkflowRun["st
483
482
  type _GuardWorkflowRunStatsReverse = AssertAllKeysHandled<Exclude<TableCoreKeys<WorkflowTables["WORKFLOW_RUN_STATS_DISPOSITIONS"]>, keyof WorkflowRun["stats"]>>;
484
483
  type _GuardWorkflowRunStatsNested = AssertAllKeysHandled<Exclude<keyof WorkflowRun["stats"]["nested"], TableCoreKeys<WorkflowTables["WORKFLOW_RUN_STATS_NESTED_DISPOSITIONS"]>>>;
485
484
  type _GuardWorkflowRunStatsNestedReverse = AssertAllKeysHandled<Exclude<TableCoreKeys<WorkflowTables["WORKFLOW_RUN_STATS_NESTED_DISPOSITIONS"]>, keyof WorkflowRun["stats"]["nested"]>>;
485
+ type _GuardWorkflowBudgetOvershoot = AssertAllKeysHandled<Exclude<keyof NonNullable<WorkflowRun["budgetOvershoot"]>, TableCoreKeys<WorkflowTables["WORKFLOW_BUDGET_OVERSHOOT_DISPOSITIONS"]>>>;
486
+ type _GuardWorkflowBudgetOvershootReverse = AssertAllKeysHandled<Exclude<TableCoreKeys<WorkflowTables["WORKFLOW_BUDGET_OVERSHOOT_DISPOSITIONS"]>, keyof NonNullable<WorkflowRun["budgetOvershoot"]>>>;
487
+ type _GuardWorkflowTimeoutInterruption = AssertAllKeysHandled<Exclude<keyof NonNullable<WorkflowRun["timeoutInterruption"]>, TableCoreKeys<WorkflowTables["WORKFLOW_TIMEOUT_INTERRUPTION_DISPOSITIONS"]>>>;
488
+ type _GuardWorkflowTimeoutInterruptionReverse = AssertAllKeysHandled<Exclude<TableCoreKeys<WorkflowTables["WORKFLOW_TIMEOUT_INTERRUPTION_DISPOSITIONS"]>, keyof NonNullable<WorkflowRun["timeoutInterruption"]>>>;
486
489
  type ReadRootCandidateProjected = "dir" | "clearsThisAsk" | "covers";
487
490
  type _GuardReadRootCandidate = AssertAllKeysHandled<Exclude<keyof ReadRootGrantCandidate, ReadRootCandidateProjected>>;
488
491
  type _GuardReadRootCandidateReverse = AssertAllKeysHandled<Exclude<ReadRootCandidateProjected, keyof ReadRootGrantCandidate>>;
@@ -649,6 +652,10 @@ export type CoreKeysetGuards = [
649
652
  _GuardWorkflowRunStatsReverse,
650
653
  _GuardWorkflowRunStatsNested,
651
654
  _GuardWorkflowRunStatsNestedReverse,
655
+ _GuardWorkflowBudgetOvershoot,
656
+ _GuardWorkflowBudgetOvershootReverse,
657
+ _GuardWorkflowTimeoutInterruption,
658
+ _GuardWorkflowTimeoutInterruptionReverse,
652
659
  _GuardReadRootCandidate,
653
660
  _GuardReadRootCandidateReverse,
654
661
  _GuardRiskAxes,
@@ -0,0 +1,95 @@
1
+ /**
2
+ * **本服务输出面逐字过境的 core 词表的登记处** —— wire 变更机器清单(`scripts/wire-changes-server.mjs`)的第五类源。
3
+ *
4
+ * ## 它治的病
5
+ * 有些 wire 值不是本服务铸的,也不是投影面表登记的键:本服务在自己的座上用 core 的闭集常量校验一个值、原样放上 wire
6
+ * (审批卡 `card_json` 的卡词 `approvalCard`、续跑起跑失败体的 `cause` …)。core 给这些常量加一个词,本服务的输出闭集就随之放宽 ——
7
+ * 对卡词写穷举 `switch` 的消费方会编译红;而清单的其余四类源(契约附录 / 面表 / 自铸登记表 / core 新键)都看不见这一层,清单零条。
8
+ *
9
+ * ## 一个事实一个来源
10
+ * **词只住在 core**:本表不抄任何一个词,只登记「哪只 core 词表逐字上了本服务的 wire、自哪一版起」。生成器从 core 随包的逐版清单
11
+ * (`node_modules/@sema-agent/core/wire-changes/core@<ver>.json` 的 `closedSetMembers`)读区间 (上一 tag 的钉, 本版的钉] 里这只词表的净增删,
12
+ * 记进本服务清单的 `added` / `removed` 与 `closedSetMembers`(集名 `coreVocab.<词表>`)。本表自身的增删按成员记(集名 `coreVocab`)。
13
+ *
14
+ * ## 表的形(一只词表一行)
15
+ * · 键 —— core 闭集的名字,与 core 清单 `closedSetMembers[].set` 同一拼写(= core 导出的运行期常量名);
16
+ * · `at` —— 它在本服务 wire 上的坐标(人读);
17
+ * · `site` —— 本服务按它校验 / 放行的那只模块(读点);
18
+ * · `since` —— 本服务 wire 上开始逐字带这只词表的版本(= 该常量首次出现在 `site` 模块里的那个 tag)。
19
+ *
20
+ * ## 绑定(派生,不手抄)
21
+ * `test/wire-changes-server.test.ts`「core 词表逐字过境」组:每个键都是 core 导出的字符串数组常量;每只 `site` 模块从 core 引入的
22
+ * 字符串数组常量 ≡ 本表 `site` 为它的那几行(两个方向:读点多引一只词表而本表没跟 ⇒ 红;本表多登一只读点不引的 ⇒ 红)。
23
+ * 经 core 谓词(`isAskOrigin` 一类)而不是常量读的词表、帧投影里随 core 型过境的值,不在本表的射程里(清单的已知缺口,见设计稿)。
24
+ *
25
+ * ⚠️ 纯数据:零 import(生成器在历史 ref 上把本文件转译求值)。
26
+ */
27
+ /** 一只逐字过境的 core 词表的登记。 */
28
+ export interface CoreVocabWireEntry {
29
+ readonly at: string;
30
+ readonly site: string;
31
+ readonly since: string;
32
+ }
33
+ export declare const CORE_VOCAB_WIRE: {
34
+ readonly ALLOW_RULE_MEMBERS: {
35
+ readonly at: "approval_request card(card_json)allow 层披露记录的 member";
36
+ readonly site: "src/approval-card.ts";
37
+ readonly since: "7.117.0";
38
+ };
39
+ readonly ASK_EVIDENCE_ABSENCE_VALUES: {
40
+ readonly at: "approval_request card(card_json)规则证据的 orgRevisionAbsent / orgRuleAbsent / personalRuleDotsAbsent";
41
+ readonly site: "src/approval-card.ts";
42
+ readonly since: "7.23.0";
43
+ };
44
+ readonly BOUND_GRANT_ABSENCES: {
45
+ readonly at: "approval_request 帧活面事实 boundGrantAbsence";
46
+ readonly site: "src/approval-card.ts";
47
+ readonly since: "7.129.0";
48
+ };
49
+ readonly DENIAL_LIMIT_BOUNDS: {
50
+ readonly at: "approval_request card(card_json)denialLimitFallback.limit";
51
+ readonly site: "src/approval-card.ts";
52
+ readonly since: "7.135.0";
53
+ };
54
+ readonly HOOK_QUESTION_CAUSES: {
55
+ readonly at: "approval_request card(card_json)问因 { by: hook }.cause";
56
+ readonly site: "src/approval-card.ts";
57
+ readonly since: "7.143.0";
58
+ };
59
+ readonly PERSISTED_RULE_MATCHES: {
60
+ readonly at: "approval_request card(card_json)ruleOffers[].match";
61
+ readonly site: "src/approval-card.ts";
62
+ readonly since: "7.57.0";
63
+ };
64
+ readonly RESUME_STARTUP_CAUSES: {
65
+ readonly at: "422 parked_resume.startup_failed 体 cause";
66
+ readonly site: "src/approval-card.ts";
67
+ readonly since: "7.129.0";
68
+ };
69
+ readonly RULE_OFFERS_ABSENCES: {
70
+ readonly at: "approval_request card(card_json)ruleOffersAbsence";
71
+ readonly site: "src/approval-card.ts";
72
+ readonly since: "7.129.0";
73
+ };
74
+ readonly RULE_OFFER_KINDS: {
75
+ readonly at: "approval_request card(card_json)ruleOffers[].kind";
76
+ readonly site: "src/approval-card.ts";
77
+ readonly since: "7.135.0";
78
+ };
79
+ readonly STEER_REPLAY_FACETS: {
80
+ readonly at: "409 steering.duplicate_input_id 体 differs[]";
81
+ readonly site: "src/approval-card.ts";
82
+ readonly since: "7.118.0";
83
+ };
84
+ readonly TOOL_APPROVAL_CARDS: {
85
+ readonly at: "approval_request card(card_json)approvalCard · 帧活面事实 approvalCard";
86
+ readonly site: "src/approval-card.ts";
87
+ readonly since: "7.136.0";
88
+ };
89
+ readonly UNCOVERED_SEGMENT_REASONS: {
90
+ readonly at: "approval_request card(card_json)ruleOffers[].uncoveredDetail[].reason";
91
+ readonly site: "src/approval-card.ts";
92
+ readonly since: "7.57.0";
93
+ };
94
+ };
95
+ //# sourceMappingURL=core-vocab-wire.d.ts.map
@@ -0,0 +1,15 @@
1
+ export const CORE_VOCAB_WIRE = {
2
+ ALLOW_RULE_MEMBERS: { at: "approval_request card(card_json)allow 层披露记录的 member", site: "src/approval-card.ts", since: "7.117.0" },
3
+ ASK_EVIDENCE_ABSENCE_VALUES: { at: "approval_request card(card_json)规则证据的 orgRevisionAbsent / orgRuleAbsent / personalRuleDotsAbsent", site: "src/approval-card.ts", since: "7.23.0" },
4
+ BOUND_GRANT_ABSENCES: { at: "approval_request 帧活面事实 boundGrantAbsence", site: "src/approval-card.ts", since: "7.129.0" },
5
+ DENIAL_LIMIT_BOUNDS: { at: "approval_request card(card_json)denialLimitFallback.limit", site: "src/approval-card.ts", since: "7.135.0" },
6
+ HOOK_QUESTION_CAUSES: { at: "approval_request card(card_json)问因 { by: hook }.cause", site: "src/approval-card.ts", since: "7.143.0" },
7
+ PERSISTED_RULE_MATCHES: { at: "approval_request card(card_json)ruleOffers[].match", site: "src/approval-card.ts", since: "7.57.0" },
8
+ RESUME_STARTUP_CAUSES: { at: "422 parked_resume.startup_failed 体 cause", site: "src/approval-card.ts", since: "7.129.0" },
9
+ RULE_OFFERS_ABSENCES: { at: "approval_request card(card_json)ruleOffersAbsence", site: "src/approval-card.ts", since: "7.129.0" },
10
+ RULE_OFFER_KINDS: { at: "approval_request card(card_json)ruleOffers[].kind", site: "src/approval-card.ts", since: "7.135.0" },
11
+ STEER_REPLAY_FACETS: { at: "409 steering.duplicate_input_id 体 differs[]", site: "src/approval-card.ts", since: "7.118.0" },
12
+ TOOL_APPROVAL_CARDS: { at: "approval_request card(card_json)approvalCard · 帧活面事实 approvalCard", site: "src/approval-card.ts", since: "7.136.0" },
13
+ UNCOVERED_SEGMENT_REASONS: { at: "approval_request card(card_json)ruleOffers[].uncoveredDetail[].reason", site: "src/approval-card.ts", since: "7.57.0" },
14
+ };
15
+ //# sourceMappingURL=core-vocab-wire.js.map
@@ -16,7 +16,7 @@
16
16
  * 同文件 G1 e2e 的全码扇出夹具、以及契约文档附录 D.3 那张表(含**小节标题里的码数** —— 那道门本批
17
17
  * 刚立,立完就在下一次加码时自己咬住了)。
18
18
  */
19
- export declare const ENGINE_NOTICE_WIRE_CODES: readonly ["memory.session_polluted", "memory.harvest_quarantined", "memory.delegation_static_mark_waived", "memory.hold_opened", "memory.hold_released", "memory.hold_disposed", "task.turn_interrupted", "steering.parked_input_blocked", "task.user_steer_undrained", "task.user_followup_undrained", "memory.capture_opted_out", "memory.capture_optout_unpersisted", "task.halt_unconsumed", "task.late_approval", "config.durable_gate_unavailable", "peer.inbound_disposition", "peer.held_settled", "peer.idle_subscription", "classifier.denial_limit", "mcp.injection_dropped", "delegation.ask_unresolvable", "task.interrupt_unconsumed", "approval.read_root_granted", "approval.read_root_grant_rejected", "instructions.source_changed", "session.lineage_rerooted", "server.model_unreachable", "permission.entry_mode_clamped", "classifier.unavailable", "config.permission_mode_unavailable", "permission.ask_released_by_mode", "permission.read_deny_unapplied", "permission.rule_store_unavailable", "permission.rule_row_dropped", "permission.allowed_tool_not_granted", "task.tool_turn_incomplete", "route.finish_reason_unknown", "route.stream_end_ignored", "route.credential_origin_mismatch", "mods.registration_refused", "config.session_rules_earlier_grammar", "advisor.not_attached", "inherit_env.names_withheld", "model.capability_downgraded", "context.media_removed", "mcp.authorization_required", "classifier.seat_rate_limited", "context.tool_schema_removed", "memory.harvest_refused", "memory.harvest_conflict", "config.legacy_tool_name"];
19
+ export declare const ENGINE_NOTICE_WIRE_CODES: readonly ["memory.session_polluted", "memory.harvest_quarantined", "memory.delegation_static_mark_waived", "memory.hold_opened", "memory.hold_released", "memory.hold_disposed", "task.turn_interrupted", "steering.parked_input_blocked", "task.user_steer_undrained", "task.user_followup_undrained", "memory.capture_opted_out", "memory.capture_optout_unpersisted", "task.halt_unconsumed", "task.late_approval", "config.durable_gate_unavailable", "peer.inbound_disposition", "peer.held_settled", "peer.idle_subscription", "classifier.denial_limit", "mcp.injection_dropped", "delegation.ask_unresolvable", "task.interrupt_unconsumed", "approval.read_root_granted", "approval.read_root_grant_rejected", "instructions.source_changed", "session.lineage_rerooted", "server.model_unreachable", "permission.entry_mode_clamped", "classifier.unavailable", "config.permission_mode_unavailable", "permission.ask_released_by_mode", "permission.read_deny_unapplied", "permission.rule_store_unavailable", "permission.rule_row_dropped", "permission.allowed_tool_not_granted", "task.tool_turn_incomplete", "route.finish_reason_unknown", "route.stream_end_ignored", "route.credential_origin_mismatch", "mods.registration_refused", "config.session_rules_earlier_grammar", "advisor.not_attached", "inherit_env.names_withheld", "model.capability_downgraded", "context.media_removed", "mcp.authorization_required", "classifier.seat_rate_limited", "context.tool_schema_removed", "memory.harvest_refused", "memory.harvest_conflict", "config.legacy_tool_name", "config.read_deny_floor_unkept"];
20
20
  export type EngineNoticeWireCode = (typeof ENGINE_NOTICE_WIRE_CODES)[number];
21
21
  /** 白名单谓词(单点):路由与门都读这一个,不许第二处手抄码串。 */
22
22
  export declare function isEngineNoticeWireCode(code: string): code is EngineNoticeWireCode;
@@ -121,6 +121,17 @@ export declare function engineNoticeEventData(notice: {
121
121
  export type EngineNoticeWireSink = (row: EngineNoticeWireRow) => unknown;
122
122
  /** 口的槽位(闭集):`live` = 流上的人(SSE),`durable` = 这条 run 的事件账。{@link EngineNoticeRouter.routeConfirmed} 只数 `durable` 槽的落账确认。 */
123
123
  export type EngineNoticeSlot = "live" | "durable";
124
+ /**
125
+ * 分流器收的通告形:引擎的四键(`code` / `message` / `detail` / 顶层 `sessionId`)加本服务的一只**投递键** `taskId` ——
126
+ * 在场 = 这条通告说的是哪一条 run(run 资源 id),只投给登记了同一条 run 的腿;缺席 = 按会话投(引擎的通告都不带它)。投递键不上 wire(行里没有它)。
127
+ */
128
+ export interface RoutedNotice {
129
+ readonly code: string;
130
+ readonly message: string;
131
+ readonly detail?: Record<string, unknown>;
132
+ readonly sessionId?: unknown;
133
+ readonly taskId?: unknown;
134
+ }
124
135
  /** 一条腿的两只具名口(各自可缺席:bg 腿没有 live SSE,ephemeral sync 腿没有账本)。 */
125
136
  export interface EngineNoticeLegSlots {
126
137
  readonly live?: EngineNoticeWireSink;
@@ -142,6 +153,11 @@ export interface EngineNoticeLegSlots {
142
153
  * 药:每次 `registerLeg` 铸一个单调 legId,`route` **只投最新代**;旧代的口留在表里(它自己的注销仍
143
154
  * 按身份精确删,不会误删新代),但一帧都收不到。方向 = fail-closed(宁可旧腿少一帧,不可新腿的事实
144
155
  * 写进旧腿的账)。
156
+ *
157
+ * 🔴 **反方向同一条:点名了 run 的通告不进别的 run 的账**(投递键 `taskId`,{@link RoutedNotice})。本服务按腿作用域定归属的通告
158
+ * (`read-deny-floor-notice.ts`:腿派出去的 run 的那一帧)带上这条腿的 run;腿的作用域可以被续延留住(后台子代在腿收场之后才准备),
159
+ * 那一刻同会话的最新一代可能已是下一条 run ⇒ 最新一代登记的 run 不是点名的那一条 ⇒ 不投。腿登记时带它写的那条 run(`registerEngineNoticeLeg` 的 `taskId`);
160
+ * 引擎的通告不带投递键,照旧按会话投。
145
161
  */
146
162
  export declare class EngineNoticeRouter {
147
163
  private readonly legs;
@@ -150,7 +166,7 @@ export declare class EngineNoticeRouter {
150
166
  *
151
167
  * 每只口各自 try 隔离在 {@link route} 里,单口抛不牵连同腿另一口。
152
168
  */
153
- registerLeg(sessionId: string, slots: EngineNoticeLegSlots): () => void;
169
+ registerLeg(sessionId: string, slots: EngineNoticeLegSlots, taskId?: string): () => void;
154
170
  /** 单口腿的便捷形(测试用):登记为 **durable** 槽 —— 这样 `route()` 与 `routeConfirmed()` 两条路都能用一只口测到(live 槽对后者结构上恒不计)。 */
155
171
  register(sessionId: string, sink: EngineNoticeWireSink): () => void;
156
172
  /** 诊断/门用:某会话此刻**最新代**有几只口在听(旧代不计——它们收不到帧)。 */
@@ -158,28 +174,18 @@ export declare class EngineNoticeRouter {
158
174
  /** 诊断/门用:某会话此刻有几代腿在表里(>1 = 正处在换代窗内)。 */
159
175
  legCount(sessionId: string): number;
160
176
  /**
161
- * 分流器的 wire 半场。返回**真投出去的口数**(0 = 没投:非白名单码 / 缺 sessionId / 该会话无活跃腿)。
177
+ * 分流器的 wire 半场。返回**真投出去的口数**(0 = 没投:非白名单码 / 缺 sessionId / 该会话无活跃腿 / 点名的 run 不是最新一代登记的那一条)。
162
178
  *
163
179
  * 单只口抛错**不吃掉同腿的其它口**(fleet bus 订阅者隔离同理由),并按 F 类登记留痕。
164
180
  */
165
- route(notice: {
166
- code: string;
167
- message: string;
168
- detail?: Record<string, unknown>;
169
- sessionId?: unknown;
170
- }, nowMs?: number): number;
181
+ route(notice: RoutedNotice, nowMs?: number): number;
171
182
  /**
172
183
  * [ref](codex r1-F2 / r2-F1;[ref] opus 腿 L2 改按槽判):同一只扇出,但**等**每只口交回的持久化结果 —— 返回**确认落账**的口数:
173
184
  * 只数 **`durable` 槽**里交回 thenable 且兑现 `true` 的口;兑现 `false` / 拒绝不算;`live` 槽**结构上不计**(不管它返回什么 —— 流上的人收没收到说明不了落账;
174
185
  * 修前按「交回 thenable」反推是不是 durable 口,哪天 live 口改成 async 返回 `true` 就会被计成落账)。给「投出之后要记一笔『告知过』」的铸点用:
175
186
  * 记账必须跟在**落账**之后,不能跟在「调用了口」之后(后台腿唯一的口是事件账 append,写失败时 `route()` 的计数照样是 1)。判据(白名单 / 归属 / 最新代 / 隔离)与 `route()` 逐字同一条。
176
187
  */
177
- routeConfirmed(notice: {
178
- code: string;
179
- message: string;
180
- detail?: Record<string, unknown>;
181
- sessionId?: unknown;
182
- }, nowMs?: number): Promise<number>;
188
+ routeConfirmed(notice: RoutedNotice, nowMs?: number): Promise<number>;
183
189
  /** 两只入口共用的扇出:返回每只**没抛**的口的持久化结果(promise 形一律先接住拒绝 ⇒ 绝不留未处理拒绝)。 */
184
190
  private fanOut;
185
191
  }
@@ -197,6 +203,8 @@ export declare const defaultEngineNoticeRouter: EngineNoticeRouter;
197
203
  */
198
204
  export declare function registerEngineNoticeLeg(opts: {
199
205
  sessionId: string | undefined;
206
+ /** 这条腿写的那条 run(run 资源 id = 本腿 `spec.taskId`;没有 run 资源 ⇒ 缺席)—— 点名了 run 的通告只投给登记了同一条 run 的腿。 */
207
+ taskId?: string;
200
208
  live?: EngineNoticeWireSink;
201
209
  durable?: EngineNoticeWireSink;
202
210
  router?: EngineNoticeRouter;
@@ -210,11 +218,6 @@ export declare function registerEngineNoticeLeg(opts: {
210
218
  * `route()` 恒返 0 —— 一条结构上永远投不出去的用户面披露,就是本仓 `task.user_steer_undrained` 陈腐明拒
211
219
  * 那一族的病。缺席/空数组 ⇒ 一个字节不投(既有腿逐字不变)。
212
220
  */
213
- pending?: readonly {
214
- code: string;
215
- message: string;
216
- detail?: Record<string, unknown>;
217
- sessionId?: unknown;
218
- }[];
221
+ pending?: readonly RoutedNotice[];
219
222
  }): () => void;
220
223
  //# sourceMappingURL=engine-notice-wire.d.ts.map
@@ -54,6 +54,7 @@ export const ENGINE_NOTICE_WIRE_CODES = [
54
54
  "memory.harvest_refused",
55
55
  "memory.harvest_conflict",
56
56
  "config.legacy_tool_name",
57
+ "config.read_deny_floor_unkept",
57
58
  ];
58
59
  const WIRE_CODES = new Set(ENGINE_NOTICE_WIRE_CODES);
59
60
  export function isEngineNoticeWireCode(code) {
@@ -149,9 +150,9 @@ const isThenableResult = (v) => typeof v === "object" && v !== null && typeof v.
149
150
  let nextLegId = 1;
150
151
  export class EngineNoticeRouter {
151
152
  legs = new Map();
152
- registerLeg(sessionId, slots) {
153
+ registerLeg(sessionId, slots, taskId) {
153
154
  const sinks = [...(slots.live ? [{ slot: "live", sink: slots.live }] : []), ...(slots.durable ? [{ slot: "durable", sink: slots.durable }] : [])];
154
- const leg = { legId: nextLegId++, sinks };
155
+ const leg = { legId: nextLegId++, sinks, ...(taskId !== undefined && taskId.length > 0 ? { taskId } : {}) };
155
156
  const list = this.legs.get(sessionId) ?? [];
156
157
  list.push(leg);
157
158
  this.legs.set(sessionId, list);
@@ -197,6 +198,9 @@ export class EngineNoticeRouter {
197
198
  const leg = list && list.length > 0 ? list[list.length - 1] : undefined;
198
199
  if (!leg || leg.sinks.length === 0)
199
200
  return [];
201
+ const named = notice.taskId;
202
+ if (typeof named === "string" && named.length > 0 && leg.taskId !== named)
203
+ return [];
200
204
  const row = engineNoticeEventData(notice, sessionId, nowMs, uuidv7());
201
205
  const outcomes = [];
202
206
  for (const { slot, sink } of leg.sinks) {
@@ -219,7 +223,7 @@ export function registerEngineNoticeLeg(opts) {
219
223
  if (live === undefined && durable === undefined)
220
224
  return () => undefined;
221
225
  const router = opts.router ?? defaultEngineNoticeRouter;
222
- const unregister = router.registerLeg(sessionId, { ...(live ? { live } : {}), ...(durable ? { durable } : {}) });
226
+ const unregister = router.registerLeg(sessionId, { ...(live ? { live } : {}), ...(durable ? { durable } : {}) }, opts.taskId);
223
227
  for (const notice of opts.pending ?? [])
224
228
  router.route(notice);
225
229
  return unregister;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * 「脱敏器抛 ⇒ 占位」的那一枚登记占位(**唯一属主在这里**:座的抛律用它,`observability/run-terminal.ts` 的终态 / 模型文本座与 `trace/model-segment.ts` 的活面放行窗
3
+ * 读同一枚)。属主住在座上而不在 run-terminal:日志出口接缝经座过筛,run-terminal 的模块图里有经接缝写日志的模块 —— 占位放在那边就是一个环。
4
+ */
5
+ export declare const OVERSIZED_REDACTION_PLACEHOLDER = "\u00ABredacted:oversized\u00BB";
1
6
  /** 品牌键:模块私有的 `unique symbol` —— 别处写不出这个键,于是写不出一个 `SafeText` 字面量;断言伪造由普查门在语法树上拦。 */
2
7
  declare const SAFE_TEXT: unique symbol;
3
8
  /** 经出口座的文本。是 `string` 的子型:读者零改;写进出口位只能用 {@link seatText} 铸的值。 */
@@ -20,9 +25,11 @@ export type SafeText = string & {
20
25
  * 引擎放过的形照抹);界 200 码元,原样出门(JSON 串值,消费方自己渲染)。
21
26
  * · `peer-declaration-sentence`:引擎判官对一份 MCP / A2A 对端声明说的句子(`toolAxes` / `toolFaces` / `sessionMetaKey` / 启动界的原因句,逐字带着声明方写的工具名、键名),
22
27
  * 进请求面 400 拒句、续跑重放的丢弃行与重读行、名册的跳过行,以及能力读面 `GET /v1/capabilities/mcp` 上引擎整集拒(两台撞同一工具命名空间前缀)的拒句 —— 读者是调用方与运维,句子已是一行;不设界(拒句要说全判官的话),原样出门。
23
- * · `inbox-diagnostics-text`:`workflow_complete` 补投帧上的诊断教学文本(`diagnostics`)—— 引擎在 workflow 完成通知上铸的「读哪里 / 怎么续跑」文本,入会话收件时洗一次,
24
- * 店里(`payload` 列)只放出门安全的字节,drain 逐字带出。洗法与 live `task_notification.diagnostics` 同一个 scope(`free-text`);
25
- * 这一行比 `trace-frame-text` 多一条界(4000 码元,与同族条目的文本位同额),原样出门:逐成员的粗截;整条 `payload` 装不装得下由条目编码座按字节预算终判
28
+ * · `completion-diagnostics-text`:一次 workflow 完成通知上的诊断教学文本(`diagnostics`)—— 引擎在完成通知上铸的「读哪里 / 怎么续跑」文本(含部署上的 journal 坐标:路径或 URL),
29
+ * **两张脸同读这一行**:live `task_notification` 帧(`trace/project.ts` 的 `taskNotificationEventData`,停驻补投的 `task_notification` 帧与账本行同一只)与 `workflow_complete` 补投帧
30
+ * (入会话收件时洗一次,店里 `payload` 列只放出门安全的字节,drain 逐字带出)。引擎在两条腿上给的不是同一份:sink 腿递未抹的原值、notifier 腿递「人类读者」档抹过的 ——
31
+ * 所以读者档在**这一行**上声明(`hostLeaks`),不靠哪条腿的上游记得抹:同一段输入,两张脸逐字节相等。洗法其余同 `trace-frame-text`(scope `free-text`);
32
+ * 这一行多一条界(4000 码元,与同族条目的文本位同额),原样出门:逐成员的粗截;整条 `payload` 装不装得下由条目编码座按字节预算终判
26
33
  * (`orchestration/workflow-completion-inbox.ts` 的 `encodeInboxBody`,预算 = 最窄后端的 `payload` 列容量,超 ⇒ 最小形 + `payloadTruncated`)。
27
34
  * · `inbox-frame-text`:`task_notification` 补投帧(停驻收件、下一次开流 drain)上会话箱车道的自由文本位 —— 三只载体的 `crossSessionMessage.fromName` /
28
35
  * `.body`、`crossSessionNotice.text` 与侧记 `_sema_provenance.peerMeta.notice` 的 `recipient` / `target` / `detail` / `dropReason`(别的会话写的或引擎嵌着
@@ -42,6 +49,10 @@ export type SafeText = string & {
42
49
  * `refused[].path` / `failed[].path`;源头是模型交的路径参数)—— 不设界(截过的路径就不是那个文件了,消费方要拿它去对文件),原样出门。
43
50
  * · `rewind-ledger-reason`:同一口台账上的拒因 / 故障句(`refused[].reason` / `failed[].reason` / `error.message`;引擎与文件历史店写的、可能带着抛出物原文)——
44
51
  * 界 500 码元,原样出门(JSON 串值,消费方自己渲染)。
52
+ * · `log-record`:日志出口接缝(`observability/logger.ts`)写出的**整条**结构化日志行 —— `{ ts, level, msg, ...fields }` 的 `JSON.stringify` 产物,进程 stdout / stderr 的诊断字节
53
+ * (写出点不判:字段里混进来的凭据形 —— 被拒的目录条目名、上游回显、错误消息里的令牌 —— 在这一行上统一挡);脱敏器按 JSON 读法读(`json`),不设界(日志行的长短是写出点的事),
54
+ * 原样出门。遮过的产物不再是一条 JSON ⇒ 按座的抛律换占位(见模块头注「抛」);占位不是一条 JSON ⇒ 接缝扣下这一行(固定字节的扣下句),见接缝头注。
55
+ * · `log-text`:日志出口接缝写出的一段诊断散文(与 `console.*` 同一种格式化,`util.format`;带调用栈的多行);不设界、不整形(多行照旧),原样出门。
45
56
  */
46
57
  declare const EXIT_SEATS: {
47
58
  readonly "trace-frame-text": {
@@ -83,9 +94,10 @@ declare const EXIT_SEATS: {
83
94
  readonly "peer-declaration-sentence": {
84
95
  readonly scope: "free-text";
85
96
  };
86
- readonly "inbox-diagnostics-text": {
97
+ readonly "completion-diagnostics-text": {
87
98
  readonly scope: "free-text";
88
99
  readonly maxChars: 4000;
100
+ readonly hostLeaks: true;
89
101
  };
90
102
  readonly "inbox-frame-text": {
91
103
  readonly scope: "free-text";
@@ -109,6 +121,13 @@ declare const EXIT_SEATS: {
109
121
  readonly scope: "free-text";
110
122
  readonly maxChars: 500;
111
123
  };
124
+ readonly "log-record": {
125
+ readonly scope: "free-text";
126
+ readonly json: true;
127
+ };
128
+ readonly "log-text": {
129
+ readonly scope: "free-text";
130
+ };
112
131
  };
113
132
  export type ExitSeat = keyof typeof EXIT_SEATS;
114
133
  /** 设了界的座名。 */
@@ -119,6 +138,13 @@ export type BoundedExitSeat = {
119
138
  }[ExitSeat];
120
139
  /** 一行的界(码元;含截断记号)—— 界的唯一属主是座表,站点要用这个数(显示预算、文档钉)就读它,不另抄一份。 */
121
140
  export declare function seatMaxChars(seat: BoundedExitSeat): number;
141
+ type ScanGeometry = {
142
+ readonly region: number;
143
+ readonly margin: number;
144
+ readonly window: number;
145
+ };
146
+ /** 一个有界行的扫描窗几何(读法单元):出门区、余量、窗 = 出门区 + 余量。窗的几何只有这里一处答 —— 站点 / 测试要这几个数就读它,不另抄。 */
147
+ export declare function seatScanGeometry(seat: BoundedExitSeat): ScanGeometry;
122
148
  /**
123
149
  * 出口座:`seat` 是座表的一行,`text` 是要出门的自由文本。返回的 {@link SafeText} 就是这个出口该写出去的字节。
124
150
  * 表外的座名(只有绕过类型才到得了)⇒ 抛 —— 那是调用方的编程错,不是脱敏失败,不吞成占位。
@@ -1,9 +1,10 @@
1
1
  import { stripControlAndBidi } from "@sema-agent/settings-schema";
2
+ import { REDACTION_MARKS, redactHostLeaks } from "@sema-agent/core";
2
3
  import { CALLER_TEXT_CUT_MARK } from "../caller-text-echo.js";
3
4
  import { errorKindOf } from "../observability/err-text.js";
4
5
  import { recordFailOpen } from "../observability/fail-open.js";
5
- import { OVERSIZED_REDACTION_PLACEHOLDER } from "../observability/run-terminal.js";
6
- import { proposeRedactionSpans, readingHeadEnd, REDACTION_TOKEN_RE_SRC, WHOLE_EXTENT } from "./redact.js";
6
+ import { MAX_RECOGNITION_SPAN, mergeRedactionSpans, proposeRedactionSpans, readingHeadEnd, REDACTION_TOKEN_RE_SRC, renderRedactionSpans, WHOLE_EXTENT } from "./redact.js";
7
+ export const OVERSIZED_REDACTION_PLACEHOLDER = "«redacted:oversized»";
7
8
  const EXIT_SEATS = {
8
9
  "trace-frame-text": { scope: "free-text" },
9
10
  "trace-frame-line": { scope: "free-text", maxChars: 300 },
@@ -14,13 +15,15 @@ const EXIT_SEATS = {
14
15
  "session-title": { scope: "free-text", maxChars: 80, emit: "title-line" },
15
16
  "mcp-remote-text": { scope: "free-text", maxChars: 200 },
16
17
  "peer-declaration-sentence": { scope: "free-text" },
17
- "inbox-diagnostics-text": { scope: "free-text", maxChars: 4000 },
18
+ "completion-diagnostics-text": { scope: "free-text", maxChars: 4000, hostLeaks: true },
18
19
  "inbox-frame-text": { scope: "free-text", maxChars: 4000 },
19
20
  "boot-refusal-line": { scope: "free-text", maxChars: 512, emit: "log-line" },
20
21
  "peer-inbound-card-text": { scope: "free-text" },
21
22
  "workflow-recovery-summary": { scope: "diagnostic" },
22
23
  "rewind-ledger-path": { scope: "free-text" },
23
24
  "rewind-ledger-reason": { scope: "free-text", maxChars: 500 },
25
+ "log-record": { scope: "free-text", json: true },
26
+ "log-text": { scope: "free-text" },
24
27
  };
25
28
  export function seatMaxChars(seat) {
26
29
  return EXIT_SEATS[seat].maxChars;
@@ -34,19 +37,9 @@ for (const [name, row] of SEAT_ROWS) {
34
37
  throw new Error(`exit seat "${name}": a row with an emission form must declare maxChars (the cut mark counts inside the bound)`);
35
38
  }
36
39
  }
37
- function mergeSpans(spans) {
38
- const order = spans.map((s, i) => ({ s, i })).sort((a, b) => a.s.start - b.s.start || b.s.end - a.s.end || a.i - b.i);
39
- const out = [];
40
- for (const { s } of order) {
41
- const last = out[out.length - 1];
42
- if (last === undefined || s.start > last.end)
43
- out.push(s);
44
- else if (s.end > last.end)
45
- out[out.length - 1] = { start: last.start, end: s.end, repl: last.repl };
46
- }
47
- return out;
48
- }
49
40
  const TOKEN_AT = new RegExp(REDACTION_TOKEN_RE_SRC, "y");
41
+ const ENGINE_MARKS = Object.values(REDACTION_MARKS);
42
+ const ENGINE_MARK_MAX = Math.max(...ENGINE_MARKS.map((m) => m.length));
50
43
  function safeCutPoint(gap, cut) {
51
44
  const hi = gap.charCodeAt(cut - 1);
52
45
  if (cut > 0 && hi >= 0xd800 && hi <= 0xdbff && (gap.charCodeAt(cut) & 0xfc00) === 0xdc00)
@@ -58,21 +51,23 @@ function safeCutPoint(gap, cut) {
58
51
  if (m !== null && open + m[0].length > cut)
59
52
  cut = open;
60
53
  }
61
- return cut;
62
- }
63
- const cutPlain = (gap, room) => gap.slice(0, safeCutPoint(gap, room));
64
- function renderOnce(text, groups, until = Number.POSITIVE_INFINITY) {
65
- const parts = [];
66
- let at = 0;
67
- for (const g of groups) {
68
- if (g.start >= until)
54
+ for (let at = gap.lastIndexOf("[", cut - 1); at !== -1 && at > cut - ENGINE_MARK_MAX; at = at === 0 ? -1 : gap.lastIndexOf("[", at - 1)) {
55
+ const mark = ENGINE_MARKS.find((m) => gap.startsWith(m, at));
56
+ if (mark !== undefined && at + mark.length > cut) {
57
+ cut = at;
69
58
  break;
70
- parts.push(text.slice(at, g.start), g.repl);
71
- at = g.end;
59
+ }
72
60
  }
73
- parts.push(text.slice(at, until));
74
- return parts.join("");
61
+ return cut;
62
+ }
63
+ function hostLeakSpans(text) {
64
+ const report = { findings: [] };
65
+ redactHostLeaks(text, report);
66
+ return report.findings
67
+ .filter((f) => f.marker === REDACTION_MARKS.url || f.marker === REDACTION_MARKS.path)
68
+ .map((f) => ({ start: f.span[0], end: f.span[1], repl: f.marker }));
75
69
  }
70
+ const cutPlain = (gap, room) => gap.slice(0, safeCutPoint(gap, room));
76
71
  function emitAs(form, text) {
77
72
  switch (form) {
78
73
  case "log-line":
@@ -90,9 +85,15 @@ function emitAs(form, text) {
90
85
  }
91
86
  }
92
87
  const layoutOf = (row) => (row.emit === undefined ? "multi-line" : "single-line");
93
- const SCAN_WINDOW_FLOOR = 4096;
94
- const SCAN_WINDOW_PER_BOUND = 8;
95
- const scanWindowOf = (maxChars) => Math.max(SCAN_WINDOW_FLOOR, maxChars * SCAN_WINDOW_PER_BOUND);
88
+ const SCAN_REGION_FLOOR = 2048;
89
+ const SCAN_REGION_PER_BOUND = 4;
90
+ const scanGeometryOf = (maxChars) => {
91
+ const region = Math.max(SCAN_REGION_FLOOR, maxChars * SCAN_REGION_PER_BOUND);
92
+ return { region, margin: MAX_RECOGNITION_SPAN, window: region + MAX_RECOGNITION_SPAN };
93
+ };
94
+ export function seatScanGeometry(seat) {
95
+ return scanGeometryOf(EXIT_SEATS[seat].maxChars);
96
+ }
96
97
  function boundRow(out, row, cutUpstream) {
97
98
  if (row.maxChars === undefined)
98
99
  return out;
@@ -110,13 +111,12 @@ export function seatText(seat, text) {
110
111
  let out;
111
112
  try {
112
113
  const layout = layoutOf(row);
113
- const scanWindow = row.maxChars === undefined ? undefined : scanWindowOf(row.maxChars);
114
+ const geometry = row.maxChars === undefined ? undefined : scanGeometryOf(row.maxChars);
114
115
  let windowEnd;
115
116
  let regionEnd;
116
- if (scanWindow !== undefined && text.length > scanWindow) {
117
- const half = scanWindow >>> 1;
118
- const region = safeCutPoint(text, readingHeadEnd(text, layout, half));
119
- const end = safeCutPoint(text, readingHeadEnd(text, layout, scanWindow - half, region));
117
+ if (geometry !== undefined && text.length > geometry.window) {
118
+ const region = safeCutPoint(text, readingHeadEnd(text, layout, geometry.region));
119
+ const end = safeCutPoint(text, readingHeadEnd(text, layout, geometry.margin, region));
120
120
  if (end < text.length) {
121
121
  windowEnd = end;
122
122
  regionEnd = region;
@@ -128,9 +128,13 @@ export function seatText(seat, text) {
128
128
  else {
129
129
  const emitUntil = regionEnd;
130
130
  const extent = windowEnd === undefined || regionEnd === undefined ? WHOLE_EXTENT : { kind: "head", emitEnd: regionEnd };
131
- const rendered = renderOnce(head, mergeSpans(proposeRedactionSpans(head, row.scope, layout, extent)), emitUntil);
131
+ const proposals = proposeRedactionSpans(head, row.scope, layout, extent, row.json === true);
132
+ const groups = row.hostLeaks === true ? mergeRedactionSpans([...proposals, ...hostLeakSpans(head)]) : proposals;
133
+ const rendered = renderRedactionSpans(head, groups, 0, emitUntil ?? head.length);
132
134
  out = boundRow(row.emit === undefined ? rendered : emitAs(row.emit, rendered), row, windowEnd !== undefined);
133
135
  }
136
+ if (row.json === true && out !== text)
137
+ JSON.parse(out);
134
138
  }
135
139
  catch (err) {
136
140
  recordFailOpen("server.run-terminal.redact-threw", `seat=${seat} len=${typeof text === "string" ? text.length : -1} err=${errorKindOf(err)}`);
@@ -19,8 +19,9 @@
19
19
  import type { ExtensionRequester, RewriteAuthor } from "@sema-agent/core";
20
20
  /** wire 上的发起者位 = 引擎的 `ExtensionRequester` 同形(`name` 已过出口纪律);引擎加一类发起者 ⇒ 这里的形随之,读法下面一处判。 */
21
21
  export type ExtensionRequesterFace = Readonly<ExtensionRequester>;
22
- /** `requestedBy` 的投影(缺席 ⇒ 缺席;形不对 ⇒ 丢 + 计一次)。`where` 进留痕句(哪一面:`tool_start` / `tool_end` / `tool_approval` / 读腿)。 */
23
- export declare function extensionRequesterOf(v: unknown, where: string): ExtensionRequesterFace | undefined;
22
+ /** 扩展发起者形(`ExtensionRequester`)的投影 —— `requestedBy`(调用的发起者)与 `declinedBy`(core 7.66.0:拒了这只附件的扩展)同一只读法(缺席 ⇒ 缺席;形不对 ⇒ 丢 + 计一次)。
23
+ * `where` 进留痕句(哪一面:`tool_start` / `tool_end` / `tool_approval` / 读腿 / `human_input.attachments`);`field` 让留痕句点对字段名(判据一只,丢弃句按字段各写一句字面量)。 */
24
+ export declare function extensionRequesterOf(v: unknown, where: string, field?: "requestedBy" | "declinedBy"): ExtensionRequesterFace | undefined;
24
25
  /** `answeredBy` 的投影(缺席 ⇒ 缺席;形不对 ⇒ 丢 + 计一次)。 */
25
26
  export declare function extensionAnswererOf(v: unknown, where: string): string | undefined;
26
27
  /** wire 上的改写记录 = 引擎的 `ToolInputRewrite` 同形(扩展项的 `name` 已过出口纪律、`input` 已脱敏)。 */
@@ -1,10 +1,12 @@
1
1
  import { sanitizeWireText } from "./engine-notice-wire.js";
2
2
  import { dropProjectedFace } from "./projection-drop.js";
3
- export function extensionRequesterOf(v, where) {
3
+ export function extensionRequesterOf(v, where, field = "requestedBy") {
4
4
  if (v === undefined)
5
5
  return undefined;
6
6
  if (typeof v === "object" && v !== null && "kind" in v && "name" in v && v.kind === "extension" && typeof v.name === "string" && v.name !== "")
7
7
  return { kind: "extension", name: sanitizeWireText(v.name) };
8
+ if (field === "declinedBy")
9
+ return dropProjectedFace("human_input.declinedBy is not { kind: extension, name: <non-empty string> } on " + where);
8
10
  return dropProjectedFace("extension_call.requestedBy is not { kind: extension, name: <non-empty string> } on " + where);
9
11
  }
10
12
  export function extensionAnswererOf(v, where) {
@@ -55,18 +55,15 @@ export type LedgerEventType = "reasoning" | "text" | "tool_start" | "tool_end" |
55
55
  | "suspended" | "needs_review" | "done" | "failed" | "suggestions" | "model_usage" | "prompt_assembled" | "config_assembled"
56
56
  /** core 7.54.0 [ref] O9b S1:`permission.cross_boundary_taint` 帧的耐久行(伴随记录,与 `config_assembled` 同一只队列、同一批 drain 点;只在执行于目标设备的树上有)。 */
57
57
  | "cross_boundary_taint" | "file_link"
58
- /** 人在环三族的 open/close 帧对(投递面 = 本腿的 durable events tail)。 */
58
+ /** 人在环三族的 open/close 帧对(投递 = 本腿那一只人在环传输,先落本账本再写直写面;`hitl-delivery.ts`)。 */
59
59
  | "elicitation" | "elicitation_complete" | "question" | "question_complete" | "tool_approval" | "tool_approval_complete"
60
60
  /** [ref] §4.3 呈卡族的开卡帧与单卡消卡帧(与上面两只 tool_approval 帧同一条投递面;一条腿只发其中一族,
61
61
  * bg / resume 两条 durable 腿恒是呈卡腿 ⇒ 它们的账本自 7.133.0 起只有本族)。 */
62
62
  | "approval_request" | "approval_complete"
63
63
  /**
64
- * [ref]([ref]):批级撤卡帧在 **bg/resume 两条 durable 腿**的账本落行(与呈卡帧同口
65
- * `append(type, rest)`,seq 由腿自己的 ledger 链步分配)。此前成文「reaper/收敛器无 seq 可分配故
66
- * live-only」只对**调用点**成立,不对 ctx 的投递口成立——帧经 `emitRevokeTo` 交给各 ctx 的
67
- * `emitRevoke`,durable 腿的那只钩子自己就是账本写口。sync 腿维持 live-only(行为零变,
68
- * `routes/tasks.ts` 装配点注)。重放语义:同一账本里卡帧(`approval_request`)在前、撤帧在后,
69
- * 全量重读恒同序 ⇒ 幂等诚实;不投影成 trace 2.3 帧(`LEDGER_TYPES_NOT_PROJECTED` 登记)。
64
+ * 批级撤卡帧:与呈卡帧同一只腿传输(`hitl-delivery.ts`:先本 run 账本、再直写),seq 由腿自己的账本链步分配 ——
65
+ * 三条腿(sync 腿有 durable run 行时)都落行。重放语义:账本里的序 = 入链序(陈旧快照的窄窗里撤帧可先于它点名的卡行),
66
+ * 全量重读恒同序,消费方按 `askIds` 幂等应用;不投影成 trace 2.3 帧(`LEDGER_TYPES_NOT_PROJECTED` 登记)。
70
67
  */
71
68
  | "approval_revoke"
72
69
  /** 异步 workflow 完成的入箱 drain(`emitPendingWorkflowCompletions` 两个字面型之一)。 */