@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
@@ -6,8 +6,9 @@
6
6
  * `DEPLOYMENT_SHAPE_PREDICATES.<行>.holds(config)`,不 import 散落函数;表外不许再长出一只自读部署形事实的布尔判据
7
7
  * (反向门 `test/deployment-shape-gate.test.ts` 按语法树判,判据逐字写在那份门的头注里)。
8
8
  *
9
- * ## 两根轴,每根轴一个读口(原始配置键只在这两个函数里被读)
9
+ * ## 三根轴,每根轴一个读口(原始配置键只在这三个函数里被读)
10
10
  * · `principal` —— 运维的 `REQUIRE_PRINCIPAL` 声明({@link readPrincipalAxis})。
11
+ * · `identity` —— 这台部署在**配置**上接了哪几个已验身份来源(唯一读法 `configuredIdentitySources`,`identity-source.ts`)+ 有没有声明只读 trace 凭据({@link readIdentityAxis})。
11
12
  * · `lane` —— `REMOTE_EXEC` 的归一车道词(`executionLaneOf`,认不出 ⇒ `undefined`,行必须 fail-closed)+ 那条车道的能力表行 +
12
13
  * 这份部署上执行环境的能力块(唯一作者 `capabilitiesFor`;k8s 的快照店是它的输入)+ 车道子旋钮(k8s 运行时类)({@link readLaneAxis})。
13
14
  *
@@ -16,15 +17,16 @@
16
17
  * `holds` 的入参型 = 所声明轴读入形的交叉({@link DeploymentShapeInput}),所以调用方递完整 `ServiceConfig` 或只递那几键的窄形都行。
17
18
  *
18
19
  * ## 什么进表、什么不进
19
- * 进表的是**形规则**:只由部署形事实决定的布尔(去重后 14 行;同一条规则的多个消费者读同一行,不各成一行)。
20
+ * 进表的是**形规则**:只由部署形事实决定的布尔(去重后 15 行;同一条规则的多个消费者读同一行,不各成一行)。
20
21
  * 把一行与**非形事实**(锁键、合规档位、审批意图、请求身份、请求体)合取的能力判据是**消费者**,住在它自己的模块
21
22
  * (`mcpInjectionHonored` = 锁 ∧ 合规 ∧ `!multiTenant`;`taskHooksHonored`;身份门 …),读行、不读原始键。
22
23
  * 车道表(`execution-lane-caps.ts`)按车道词键控的布尔列(`laneIsolated` 等)是车道轴自己的事实表,不是「部署」的谓词;行读它们。
23
24
  *
24
- * 依赖纪律:叶模块 —— 值导入只有 `execution-lane-caps.ts`(它本身是叶),零运行期环(引擎只 type-import)。
25
+ * 依赖纪律:叶模块 —— 值导入只有 `execution-lane-caps.ts` 与 `identity-source.ts`(两者本身是叶),零运行期环(引擎只 type-import)。
25
26
  */
26
27
  import type { ExecutionEnvCapabilities } from "@sema-agent/core";
27
28
  import { type ExecutionLane, type ExecutionLaneCaps } from "./execution-lane-caps.js";
29
+ import { type IdentitySource, type IdentitySourceConfig } from "./identity-source.js";
28
30
  /** `principal` 轴读的配置键(`ServiceConfig` 结构上满足)。 */
29
31
  export interface PrincipalAxisInput {
30
32
  readonly requirePrincipal?: boolean | undefined;
@@ -34,6 +36,17 @@ export interface PrincipalAxisFacts {
34
36
  /** 运维声明了 `REQUIRE_PRINCIPAL=true`。 */
35
37
  readonly declared: boolean;
36
38
  }
39
+ /** `identity` 轴读的配置键(`ServiceConfig` 结构上满足):身份来源的配置面 + 只读 trace 凭据。 */
40
+ export interface IdentityAxisInput extends IdentitySourceConfig {
41
+ readonly traceToken?: string | undefined;
42
+ }
43
+ /** `identity` 轴的事实。 */
44
+ export interface IdentityAxisFacts {
45
+ /** 配置接了线的已验身份来源(`configuredIdentitySources`,序同 `IDENTITY_SOURCES`)。鉴权桥那一格 = 配置里有 issuer(显式或中心回退)—— 验签器由起服第 9 段按同一个读数建。 */
46
+ readonly sources: readonly IdentitySource[];
47
+ /** 声明了只读 trace 凭据(不是身份来源:它不验任何主体,但这台部署因此有一道凭据门)。 */
48
+ readonly traceTokenDeclared: boolean;
49
+ }
37
50
  /** `lane` 轴读的配置键:**已合成**的 `remoteExec` 里本表用得到的那几键(`ServiceConfig` 的判别联合每一臂结构上都满足;车道必在 ——
38
51
  * 没有声明的部署在执行车道合成步拒启)。`provider` 收开放串:手搓的部署形 / 外部输入上认不出的词 ⇒ 行在 `lane` 那一格 fail-closed。 */
39
52
  export interface LaneAxisInput {
@@ -60,6 +73,10 @@ interface AxisShapes {
60
73
  readonly input: PrincipalAxisInput;
61
74
  readonly facts: PrincipalAxisFacts;
62
75
  };
76
+ readonly identity: {
77
+ readonly input: IdentityAxisInput;
78
+ readonly facts: IdentityAxisFacts;
79
+ };
63
80
  readonly lane: {
64
81
  readonly input: LaneAxisInput;
65
82
  readonly facts: LaneAxisFacts;
@@ -86,29 +103,47 @@ export interface DeploymentShapePredicate<A extends DeploymentShapeAxis> {
86
103
  export declare const DEPLOYMENT_SHAPE_PREDICATES: Readonly<{
87
104
  /** 身份门的问法。读者:请求面的身份 / 属主门(`http/principal-gate.ts`、`http/request-guards.ts`、`security.ts`)。 */
88
105
  principalRequired: DeploymentShapePredicate<"principal">;
106
+ /**
107
+ * 「这台部署有没有身份边界」的问法 —— 有 = 请求里有东西替主体作保或拦在门外:声明了 `REQUIRE_PRINCIPAL`,或配置接了任一已验身份来源
108
+ * (service 凭据 / 鉴权桥 issuer,含中心回退 / 直连门),或声明了只读 trace 凭据。没有 = dev-open:主体头是谁都能自报的(不是认证;报了它的请求仍为那位主体)。
109
+ * 只读配置(验签器在起服第 9 段按同一个配置读数建 ⇒「验签器在场」≡「配置里有桥」),所以先于验签器的起服段(第 3 段的一次性迁移)与请求面读到同一个答案。
110
+ * 读者:请求面的 dev-open 判据(`http/principal-gate.ts` 的 `devOpenDeployment`,`actsForDeployment` 的一臂:不报主体的调用方在属主存取器的 fleet 一格与 `/metrics` 族上代部署本人)、
111
+ * 一次性迁移 M48 的输入(`plugins/store-backend.ts`:有边界 ⇒ 不改写哨兵属主)。
112
+ */
113
+ identityBoundary: DeploymentShapePredicate<"principal" | "identity">;
89
114
  /**
90
115
  * 租户轴的问法。今天与 {@link DEPLOYMENT_SHAPE_PREDICATES.principalRequired} 读**同一个声明**([ref] ①:托管 / 多租 ⇔ `REQUIRE_PRINCIPAL=true`,
91
116
  * 签发方配置是身份验签轴、不算租户证据)—— 两个问题、一根轴、一个读口;「鉴权必需」与「多租形」拆成两个声明时只改这一行的判官。
92
117
  */
93
118
  multiTenant: DeploymentShapePredicate<"principal">;
94
119
  /** 读能力表 `callerCwd` 位(host = 单主才开;device = 路径落在发起者自己的设备上,归属由根会话行执行格上的设备绑定验过,不要求单主)。 */
95
- callerCwd: DeploymentShapePredicate<"lane" | "principal">;
96
- /** 调用方给的宿主绝对路径(附加目录 / 项目上下文 / 本机 SendUserFile / 指令文件探针)只在「手就在本 worker 的盘上 ∧ 单主」时指向调用方自己的东西。 */
97
- callerOwnsWorkerDisk: DeploymentShapePredicate<"lane" | "principal">;
120
+ callerCwd: DeploymentShapePredicate<"principal" | "lane">;
121
+ /** 调用方给的宿主绝对路径(附加目录 / 项目上下文 / 本机 SendUserFile / 指令文件探针)只在「手就在本 worker 的盘上 ∧ 单主」时指向调用方自己的东西;
122
+ * 本机语言服务器(`createLspManager`:本机子进程、在 worker 盘上找根)同问这一句,读这一行 × `LSP_HOST_ENABLED`。
123
+ * local 店的声明(`local-store-declaration.ts` 的 `localStoreDeclarationOf`)同问这一句:店的数据根就在这块盘上,盘是调用方自己的且易失 ⇒ 部署不替他声明它活过替换。 */
124
+ callerOwnsWorkerDisk: DeploymentShapePredicate<"principal" | "lane">;
98
125
  /** wire `executionLane.toolsOnThisHost` 与出厂 / 中心技能的 `baseDir`:只问文件系统同一性,与租户无关(出厂内容每个租户拿到同一份)。 */
99
126
  toolsOnThisHost: DeploymentShapePredicate<"lane">;
100
127
  /** 无手形(声明 `none`;判据读执行环境块 `io`,不点名车道词)且单主:进程级消费者(hooks 命令、项目上下文本机读、卡批规则 root)看到的就是引擎自己的进程 cwd / env。 */
101
- noHandsSingleUser: DeploymentShapePredicate<"lane" | "principal">;
128
+ noHandsSingleUser: DeploymentShapePredicate<"principal" | "lane">;
102
129
  /** 任务层替部署声明宿主姿态(bypassPermissions 开写面 / host shell 继承整份环境)的射程:device 车道上跨租户宿主穿越结构性不存在(clay 裁定③)。 */
103
- taskHostPostureDeclarations: DeploymentShapePredicate<"lane" | "principal">;
130
+ taskHostPostureDeclarations: DeploymentShapePredicate<"principal" | "lane">;
104
131
  /** 写门走代理裁决(执行环境块 `hostLocalPaths` 为假:路径不是本 worker 盘上的文件);认不出的词 ⇒ 走代理(代理 slot 空 ⇒ 写门 fail-closed)。 */
105
132
  sandboxPathAdjudication: DeploymentShapePredicate<"lane">;
106
133
  /** 读能力表 `sandboxSendUserFile` 位(e2b / k8s 每任务一只沙箱 ⇒ 任何租户;ssh 共享一台真机 ⇒ 只单主)。 */
107
- sandboxSendUserFile: DeploymentShapePredicate<"lane" | "principal">;
134
+ sandboxSendUserFile: DeploymentShapePredicate<"principal" | "lane">;
108
135
  /** 读能力表 `remoteScratchpad` 位(`/tmp/scratchpad/<sessionId>` 远端约定)。 */
109
136
  remoteScratchpad: DeploymentShapePredicate<"lane">;
137
+ /**
138
+ * 读能力表 `backgroundShell` 位 —— 「这条车道的执行环境能不能开后台 shell(`run_in_background` / `BashOutput` / `KillShell`),含把运行中的前台命令领养成后台任务」的**唯一**答者:
139
+ * e2b / k8s 每任务一只沙箱 ⇒ 任何租户;host(命令落在 worker 宿主上的同一张进程表)⇒ 只单主;其余车道(含 none)没有后台 shell;认不出的车道 ⇒ 否。
140
+ * 读者(同读这一行,没有第二份判别式):三只声明后台 shell 的适配器的 `backgroundCapabilities`(`supported` 与 `supportsDetach` 是同一个答案)、
141
+ * host 适配器的装配点(`boot/execution-env.ts` / `run-local.ts` 把行的答案交给适配器的 `backgroundShell`)、能力事实 `autoBackgroundOnTimeout`(`/health.autoBackgroundOnTimeout`)。
142
+ * 全局关停开关 `HOST_BG_ENABLED` 不在行里 —— 它是旋钮不是部署形,host 适配器与事实在行之上各合取一次。
143
+ */
144
+ backgroundShell: DeploymentShapePredicate<"principal" | "lane">;
110
145
  /** 读能力表 `tenantSeparation` 位(值来自 settings-schema 车道词表正本);唯一读者 = 跨域不变量 `multi-tenant-shared-lane`。 */
111
- laneSeparatesTenants: DeploymentShapePredicate<"lane" | "principal">;
146
+ laneSeparatesTenants: DeploymentShapePredicate<"principal" | "lane">;
112
147
  /**
113
148
  * [ref] —— **VM 级**隔离强度(独立内核:e2b 的 Firecracker microVM;k8s 只在 Kata / gVisor 运行时类上)。与执行环境块 `isolation` 键
114
149
  * (OS 级边界,容器即算;wire `executionLane.isolated` 的属主 `laneIsolated`)是两个问题,所以不叫「isolated」。读者:A 值路由。
@@ -131,7 +166,7 @@ export declare const DEPLOYMENT_SHAPE_PREDICATES: Readonly<{
131
166
  * · `none`:没有执行环境(能力事实先判无手车道,这里照样表态)。
132
167
  * 读者:能力事实 `sessionRewindFiles`(能力位与该口的 501 同读这一行)。
133
168
  */
134
- rewindableWorkspace: DeploymentShapePredicate<"lane" | "principal">;
169
+ rewindableWorkspace: DeploymentShapePredicate<"principal" | "lane">;
135
170
  }>;
136
171
  export {};
137
172
  //# sourceMappingURL=deployment-shape.d.ts.map
@@ -1,7 +1,11 @@
1
1
  import { capabilitiesFor, executionLaneCaps, executionLaneOf, handsOnWorkerFilePlane, laneWiresExecutionEnv } from "./execution-lane-caps.js";
2
+ import { configuredIdentitySources } from "./identity-source.js";
2
3
  function readPrincipalAxis(deployment) {
3
4
  return { declared: deployment.requirePrincipal === true };
4
5
  }
6
+ function readIdentityAxis(deployment) {
7
+ return { sources: configuredIdentitySources(deployment), traceTokenDeclared: Boolean(deployment.traceToken) };
8
+ }
5
9
  function readLaneAxis(deployment) {
6
10
  const declaration = deployment.remoteExec;
7
11
  const lane = executionLaneOf(declaration.provider);
@@ -16,6 +20,8 @@ function readAxis(axis, deployment) {
16
20
  switch (axis) {
17
21
  case "principal":
18
22
  return readPrincipalAxis(deployment);
23
+ case "identity":
24
+ return readIdentityAxis(deployment);
19
25
  case "lane":
20
26
  return readLaneAxis(deployment);
21
27
  }
@@ -47,6 +53,7 @@ function capabilityHolds(cap, principal) {
47
53
  const VM_ISOLATION_RUNTIME_CLASSES = new Set(["kata", "kata-qemu", "kata-clh", "kata-fc", "gvisor", "runsc"]);
48
54
  export const DEPLOYMENT_SHAPE_PREDICATES = Object.freeze({
49
55
  principalRequired: createPredicate(["principal"], "身份轴:运维声明了 REQUIRE_PRINCIPAL=true —— 每个调用方都必须带一个验过的主体。", ({ principal }) => principal.declared),
56
+ identityBoundary: createPredicate(["principal", "identity"], "身份轴:这台部署有身份边界 —— 声明了 REQUIRE_PRINCIPAL,或配置接了任一已验身份来源(service 凭据 / 鉴权桥 / 直连门),或声明了只读 trace 凭据。", ({ principal, identity }) => principal.declared || identity.sources.length > 0 || identity.traceTokenDeclared),
50
57
  multiTenant: createPredicate(["principal"], "租户轴:这台部署服务不止一个主人(托管 / 多租;C-R100 ① 由 REQUIRE_PRINCIPAL=true 声明)。", ({ principal }) => principal.declared),
51
58
  callerCwd: createPredicate(["lane", "principal"], "车道 × 租户 / 设备归属:调用方送来的 cwd(与 settings.env)被尊重 —— host 车道且单主,或 device 车道。", ({ lane, principal }) => lane.caps !== undefined && capabilityHolds(lane.caps.callerCwd, principal)),
52
59
  callerOwnsWorkerDisk: createPredicate(["lane", "principal"], "车道 × 租户:手就在本 worker 的盘上且部署只有一个主人 —— 这块盘上的路径就是调用方自己的。", ({ lane, principal }) => lane.lane !== undefined && handsOnWorkerFilePlane(lane.lane) && !principal.declared),
@@ -56,6 +63,7 @@ export const DEPLOYMENT_SHAPE_PREDICATES = Object.freeze({
56
63
  sandboxPathAdjudication: createPredicate(["lane"], "车道:写门的路径事实要经代理到执行环境里取(文件平面不在本 worker 盘上;认不出的车道也走代理)。", ({ lane }) => lane.block === undefined || !lane.block.hostLocalPaths),
57
64
  sandboxSendUserFile: createPredicate(["lane", "principal"], "车道 × 租户:SendUserFile 的沙箱直传腿可以挂(沙箱盘 = 租户自己的任务工作区,或共享真机上的单主部署)。", ({ lane, principal }) => lane.caps !== undefined && capabilityHolds(lane.caps.sandboxSendUserFile, principal)),
58
65
  remoteScratchpad: createPredicate(["lane"], "车道:执行环境里按会话分的远端 scratchpad 约定适用。", ({ lane }) => lane.caps !== undefined && lane.caps.remoteScratchpad === "supported"),
66
+ backgroundShell: createPredicate(["lane", "principal"], "车道 × 租户:本车道的执行环境可以开后台 shell(含领养运行中的前台命令)—— e2b / k8s 任何租户,host 只单主,其余车道没有。", ({ lane, principal }) => lane.caps !== undefined && capabilityHolds(lane.caps.backgroundShell, principal)),
59
67
  laneSeparatesTenants: createPredicate(["lane", "principal"], "车道 × 租户:这条车道在这台部署上不让两个租户的命令落在同一个共享目标上(单主部署恒成立;认不出的车道不成立)。", ({ lane, principal }) => lane.caps !== undefined && capabilityHolds(lane.caps.tenantSeparation, principal)),
60
68
  vmIsolatedHands: createPredicate(["lane"], "车道 / 隔离强度:手跑在 VM 级边界里(独立内核);runc / 共享内核 / 真机 / 认不出 ⇒ 否。", ({ lane }) => {
61
69
  if (lane.lane === "e2b")
@@ -1,12 +1,30 @@
1
1
  /**
2
- * 本服务**自己**发往配置端点的出站请求(hook 直连模型腿 `hooks/hook-llm.ts`、记忆 embedder `plugins/memory-embedder.ts`)的
3
- * 重定向律 —— 与 core 7.51.0([ref])一方 brain 的请求同一条:请求以 `redirect: "manual"` 发出,端点回重定向 ⇒ 拒;
4
- * 不跟、不重试、拒句不点名目标。
2
+ * 本服务**自己**发出的每一个出站 HTTP 请求的重定向律 —— 与 core 7.51.0([ref])一方 brain 的请求同一条:
3
+ * 请求以 `redirect: "manual"` 发出,对端回重定向 ⇒ 拒;不跟、不重试,拒句不点名目标。
5
4
  *
6
5
  * 为什么:请求只去被判过的那个根。传输层(undici)跟随 POST 307 / 308 时把请求体(用户内容 / 记忆正文)原样送到
7
- * `Location`,跨 origin 只剥 `authorization` —— anthropic 形的 `x-api-key` 随行(`test/hook-llm.test.ts` 的 G1 格在
8
- * 7.128.x 上实测送达重定向目标)。判据与拒句与 core 的 brain 请求门同形(`opaqueredirect` 或 3xx)。
6
+ * `Location`,跨 origin 只剥 `authorization` —— 自定义凭据头(`x-api-key` / `X-Subscription-Token` / OTLP 的 `headers` / S3 预签名的 query)
7
+ * 随行,同 origin 的跟随连 `authorization` 一起带走(`test/hook-llm.test.ts` 的 G1 格在 7.128.x 上实测送达重定向目标)。
8
+ *
9
+ * **一只出口**:{@link createEgressFetch} 是本仓里全局 `fetch` 的**唯一**值引用(`test/egress-redirect-surfaces.test.ts` 的语法树门:
10
+ * 全树零第二处全局 `fetch`、`redirect` 选项只写这里一处、`createEgressFetch(` 调用点闭集登记 —— 新加出站面必登)。
11
+ * 每个出站面各自造一只带「出路」句的出口,请求只经它发出;注入的 `fetchImpl`(测试座 / 嵌入方)同样被它包住 ——
12
+ * 注入不是绕过判据的门。判据 {@link egressRedirectRefusal} 不导出:没有「自己设 `redirect: manual` 再自己判」的第二种写法。
13
+ *
14
+ * 响亮:对端回重定向 ⇒ 抛 {@link EgressRedirectRefusedError}(带对端回的码),拒句前面由各面的失败臂冠上自己的面名。
15
+ * 各面既有的失败臂(日志 / 失败码 / 终态)照旧收它 —— 没有哪一面把它吞成「没拿到结果」而不留话。
16
+ */
17
+ /** 对端回了重定向、本服务按律不跟:`status` 是对端回的码(0 = `opaqueredirect`)。`message` = 拒句,不回显 `Location` / 凭据 / 请求体。 */
18
+ export declare class EgressRedirectRefusedError extends Error {
19
+ readonly status: number;
20
+ constructor(status: number, message: string);
21
+ }
22
+ /**
23
+ * 造一只出站 `fetch`:`redirect: "manual"` 强制(调用方传的 `redirect` 不作数),回重定向 ⇒ 抛 {@link EgressRedirectRefusedError}。
24
+ *
25
+ * · `fix` = 出路一句(「把最终地址写进哪一席」),由各面按自己打的那一席给;拼进拒句。
26
+ * · `fetchImpl` 缺席 ⇒ 调用时现取全局 `fetch`(不在造出口时捕获:测试对全局 `fetch` 的替换在造出口之后也生效);在场 ⇒ 用它,同样被判。
27
+ * · 其余答复(2xx / 4xx / 5xx / 304)原样交回,各面自己的失败臂照旧。
9
28
  */
10
- /** 端点回的是重定向 ⇒ 拒句(调用方在前面冠上自己的面名);否则 `undefined`。命中时丢弃响应体(不读、不留连接)。 */
11
- export declare function egressRedirectRefusal(res: Response, fix: string): string | undefined;
29
+ export declare function createEgressFetch(fix: string, fetchImpl?: typeof fetch): typeof fetch;
12
30
  //# sourceMappingURL=egress-redirect.d.ts.map
@@ -1,7 +1,25 @@
1
- export function egressRedirectRefusal(res, fix) {
2
- if (res.type !== "opaqueredirect" && !(res.status >= 300 && res.status < 400))
1
+ export class EgressRedirectRefusedError extends Error {
2
+ status;
3
+ constructor(status, message) {
4
+ super(message);
5
+ this.name = "EgressRedirectRefusedError";
6
+ this.status = status;
7
+ }
8
+ }
9
+ const NOT_MODIFIED = 304;
10
+ function egressRedirectRefusal(res, fix) {
11
+ if (res.type !== "opaqueredirect" && !(res.status >= 300 && res.status < 400 && res.status !== NOT_MODIFIED))
3
12
  return undefined;
4
13
  void res.body?.cancel().catch(() => undefined);
5
14
  return `endpoint answered with a redirect${res.status > 0 ? ` (HTTP ${res.status})` : ""}; it was not followed and no credential was sent anywhere else — ${fix}`;
6
15
  }
16
+ export function createEgressFetch(fix, fetchImpl) {
17
+ return async (input, init) => {
18
+ const res = await (fetchImpl ?? fetch)(input, { ...init, redirect: "manual" });
19
+ const refusal = egressRedirectRefusal(res, fix);
20
+ if (refusal !== undefined)
21
+ throw new EgressRedirectRefusedError(res.status, refusal);
22
+ return res;
23
+ };
24
+ }
7
25
  //# sourceMappingURL=egress-redirect.js.map
@@ -1,4 +1,5 @@
1
1
  import { type McpElicitRequest, type McpElicitResponse } from "@sema-agent/core";
2
+ import { type HitlTransport } from "./hitl-delivery.js";
2
3
  /** A live elicitation frame delivered to whoever is tailing this run's stream. `type` IS the SSE event name
3
4
  * (mirrors the named-event convention: the payload also carries `type` so a proxy that strips event names still
4
5
  * works). The shell renders the `elicitation` frame as a dialog and dismisses on `elicitation_complete`. */
@@ -27,13 +28,13 @@ export interface ElicitationFrame {
27
28
  /** "elicitation" only: `serverNowMs + expiresInMs` — the absolute deadline on the server's clock. */
28
29
  expiresAtMs?: number;
29
30
  }
30
- /** The per-run context `onElicit` recovers via ALS. `emit` delivers a frame to the run's live stream;
31
- * `abortSignal` (the run's own cancel signal) lets a run-abort promptly cancel an elicitation parked awaiting a
32
- * human, since the MCP per-request signal may not be chained to the run abort. */
31
+ /** The per-run context `onElicit` recovers via ALS. `transport` = the leg's ONE HITL transport (shared with the question and
32
+ * approval contexts of the same leg); `abortSignal` (the run's own cancel signal) lets a run-abort promptly cancel an
33
+ * elicitation parked awaiting a human, since the MCP per-request signal may not be chained to the run abort. */
33
34
  export interface ElicitationRunContext {
34
35
  taskId: string;
35
36
  owner: string | null;
36
- emit: (frame: ElicitationFrame) => void | Promise<void>;
37
+ transport: HitlTransport<ElicitationFrame>;
37
38
  abortSignal?: AbortSignal;
38
39
  }
39
40
  export interface ElicitationThrottle {
@@ -81,7 +82,7 @@ export declare class ElicitationCoordinator {
81
82
  elicit: (req: McpElicitRequest, signal?: AbortSignal) => Promise<McpElicitResponse>;
82
83
  /** `POST /v1/elicitations/:id/respond` — resolve a parked elicitation with the shell's answer. Owner-gated with a
83
84
  * 404 (no existence oracle): a non-owner AND an unknown id (answered / expired / wrong replica) both get 404.
84
- * Returns the HTTP {status, body}; the HTTP layer owns auth (gatedPrincipal + REQUIRE_PRINCIPAL) before calling. */
85
+ * Returns the HTTP {status, body}; the HTTP layer owns auth (gatedSubject + REQUIRE_PRINCIPAL) before calling. */
85
86
  respond(id: string, principal: string | undefined, body: unknown): {
86
87
  status: number;
87
88
  body: unknown;
@@ -3,6 +3,8 @@ import { uuidv7, delimitUntrusted } from "@sema-agent/core";
3
3
  import { redactSecrets, redactDeep } from "./trace/redact.js";
4
4
  import { recordFailOpen } from "./observability/fail-open.js";
5
5
  import { refusalBody } from "./http/refusal-body.js";
6
+ import { keyAdmits, ownerCellOf, recoveredSubject } from "./owner-faces.js";
7
+ import { createHitlOpenRace } from "./hitl-delivery.js";
6
8
  const MAX_ELICIT_MESSAGE_CHARS = 4096;
7
9
  const MAX_ELICIT_SCHEMA_BYTES = 8192;
8
10
  const RELEASE_ACTION = { refused: "decline", unanswered: "cancel" };
@@ -114,34 +116,33 @@ export class ElicitationCoordinator {
114
116
  signal?.addEventListener("abort", onAbort, { once: true });
115
117
  ctx.abortSignal?.addEventListener("abort", onAbort, { once: true });
116
118
  this.pending.set(id, { settle, owner: ctx.owner, taskId: ctx.taskId });
117
- const emitted = (async () => {
118
- const now = this.now();
119
- return ctx.emit({ type: "elicitation", elicitationId: id, mcpServerName: req.server, message, ...(requestedSchema !== undefined ? { requestedSchema } : {}), mode: "form", serverNowMs: now, expiresInMs: this.throttle.ttlMs, expiresAtMs: now + this.throttle.ttlMs });
120
- })().then(() => "ok", () => "failed");
121
- const delivery = await Promise.race([emitted, answerP.then(() => "stalled")]);
122
- if (delivery === "ok") {
119
+ const now = this.now();
120
+ const race = createHitlOpenRace({
121
+ targets: [{ transport: ctx.transport, frame: { type: "elicitation", elicitationId: id, mcpServerName: req.server, message, ...(requestedSchema !== undefined ? { requestedSchema } : {}), mode: "form", serverNowMs: now, expiresInMs: this.throttle.ttlMs, expiresAtMs: now + this.throttle.ttlMs } }],
122
+ settled: answerP,
123
+ });
124
+ const charge = () => {
123
125
  rc.total += 1;
124
126
  rc.lastByServer.set(req.server, t);
127
+ };
128
+ const phase = await race.phase;
129
+ if (phase === "delivered") {
130
+ charge();
125
131
  }
126
- else if (delivery === "failed") {
132
+ else if (phase === "undelivered") {
127
133
  recordFailOpen("server.elicitation.open-frame-undelivered", `elicitation=${id} server=${req.server}`);
128
134
  settle({ action: RELEASE_ACTION.unanswered });
129
135
  }
130
- const answer = await answerP;
131
- void emitted
132
- .then((result) => {
133
- if (result === "failed") {
134
- if (delivery === "stalled")
136
+ else {
137
+ void race.landing.then((late) => {
138
+ if (late === "delivered")
139
+ charge();
140
+ else
135
141
  recordFailOpen("server.elicitation.open-frame-undelivered", `elicitation=${id} server=${req.server}`);
136
- return undefined;
137
- }
138
- if (delivery === "stalled") {
139
- rc.total += 1;
140
- rc.lastByServer.set(req.server, t);
141
- }
142
- return ctx.emit({ type: "elicitation_complete", elicitationId: id, mcpServerName: req.server, action: answer.action, serverNowMs: this.now() });
143
- })
144
- .catch(() => recordFailOpen("server.elicitation.complete-breadcrumb-dropped", `elicitation=${id}`));
142
+ });
143
+ }
144
+ const answer = await answerP;
145
+ race.close({ type: "elicitation_complete", elicitationId: id, mcpServerName: req.server, action: answer.action, serverNowMs: this.now() });
145
146
  return answer;
146
147
  };
147
148
  respond(id, principal, body) {
@@ -149,7 +150,7 @@ export class ElicitationCoordinator {
149
150
  if (!parsed.ok)
150
151
  return { status: 400, body: refusalBody({ errorCode: "request.body_shape", message: parsed.error }) };
151
152
  const entry = this.pending.get(id);
152
- if (!entry || (entry.owner !== null && entry.owner !== principal)) {
153
+ if (!entry || !keyAdmits("ask.answer", { subject: recoveredSubject(principal), operator: false }, ownerCellOf(entry.owner))) {
153
154
  return { status: 404, body: refusalBody({ errorCode: "elicitation.not_pending", message: "no pending elicitation for this id (answered, expired, or not on this replica)" }) };
154
155
  }
155
156
  entry.settle(parsed.value);
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 🔴 **引擎交界的身份**(唯一一处;叶子):一只主体的三格(`owner-brands.ts` 的 `partsOf`)怎么落进引擎 `TaskSpec` 的身份格。
3
+ *
4
+ * 二元形:`principal` = **人**(引擎的成文契约「终端用户 / MCP RBAC / 治理键」:用量窗扣账、出站 MCP / A2A 身份、事件归因、检查点的 `principal` 格都按人,
5
+ * 与本仓的人面汇点同轴);`isolationScope` = **带场景的主体**(只在请求带了场景时有;引擎按它分登记域 / offload 租界 / 后台登记 / peer 目录 / 工作流 scope,
6
+ * 引擎的读法是「隔离格缺席 ⇒ 读 `principal`」)。没带场景的请求只有 `principal`,与今天逐字节同。检查点的分区走本仓自己供的 `scope` 格。
7
+ *
8
+ * 今天的引擎还没有隔离格:{@link taskSpecIdentityOf} 是**唯一的落点**,今天只写 `principal`;隔离格到货后改那一行(钉在 `test/scenario-subject.test.ts`)。
9
+ * 落点之前引擎自己按 `spec.principal` 分的那几面按人分(同一个人的各场景在那几面互见)—— 本仓镜像这几面的读口(工作流读面、后台登记簿的停止标记、
10
+ * leader 子任务的 spec)同读 {@link taskSpecIdentityOf},读到的就是引擎写下的那一个值,不各写一份。
11
+ */
12
+ import type { Person, Subject, SubjectParts } from "./owner-brands.js";
13
+ /** 引擎交界的身份(本仓的类型;二元)。 */
14
+ export interface EngineIdentity {
15
+ readonly principal: Person | undefined;
16
+ /** 带场景的主体;没带场景 ⇒ 缺席(引擎读 `principal`)。 */
17
+ readonly isolationScope?: Subject;
18
+ }
19
+ /** 一只主体(没有 ⇒ 匿名)在引擎交界上的身份。 */
20
+ export declare function specIdentityOf(parts: SubjectParts | undefined): EngineIdentity;
21
+ /**
22
+ * 落进 `TaskSpec` 的身份格(**唯一落点**)。今天的引擎没有隔离格 ⇒ 只写 `principal`,`isolationScope` 在这里不落(引擎按人分它自己的那几面);
23
+ * 引擎的隔离格到货 ⇒ 这里加一格,别处不动。
24
+ */
25
+ export declare function taskSpecIdentityOf(parts: SubjectParts | undefined): {
26
+ readonly principal?: string;
27
+ };
28
+ //# sourceMappingURL=engine-identity.d.ts.map
@@ -0,0 +1,10 @@
1
+ export function specIdentityOf(parts) {
2
+ if (parts === undefined)
3
+ return { principal: undefined };
4
+ return parts.scenario === undefined ? { principal: parts.person } : { principal: parts.person, isolationScope: parts.subject };
5
+ }
6
+ export function taskSpecIdentityOf(parts) {
7
+ const { principal } = specIdentityOf(parts);
8
+ return principal === undefined ? {} : { principal };
9
+ }
10
+ //# sourceMappingURL=engine-identity.js.map
@@ -18,14 +18,12 @@ export interface EntryProblem {
18
18
  }
19
19
  /** 铸一条问题:`entry` 收**原串**,这里过脱敏(调用方没有「忘了脱敏」的可能)。 */
20
20
  export declare function entryProblem(code: string, field: string, rawEntry: string, reason: string): EntryProblem;
21
- /** 拒体上的机读位(原样进 `HttpError.extra` / `refusalBody` 的 `facts`:顶层 `field` + 对象形 `detail`)。 */
22
- export interface EntryProblemsFacts {
21
+ /** 拒体上的机读位(原样摊在拒体根上:`HttpError.extra` / `refusalBody` 的 `facts`)。型别名而不是接口 —— 要能直接当 `Record<string, unknown>` 用。 */
22
+ export type EntryProblemsFacts = {
23
23
  readonly field: string;
24
- readonly detail: {
25
- readonly problems: readonly EntryProblem[];
26
- readonly total: number;
27
- };
28
- }
24
+ readonly problems: readonly EntryProblem[];
25
+ readonly total: number;
26
+ };
29
27
  /**
30
28
  * 一遍判下来的全部问题 ⇒ 拒体的机读位。**不能空**:没有问题就没有拒(调用方只在命中时调),空表是调用点的错,响亮抛。
31
29
  * 顶层 `field` = 第一条问题的坐标(句子点名的那一张清单)。
@@ -9,6 +9,6 @@ export function entryProblemsFacts(found) {
9
9
  const first = found[0];
10
10
  if (first === undefined)
11
11
  throw new Error("entryProblemsFacts: a refusal needs at least one problem");
12
- return { field: first.field, detail: { problems: found.length > MAX_ENTRY_PROBLEMS ? found.slice(0, MAX_ENTRY_PROBLEMS) : found, total: found.length } };
12
+ return { field: first.field, problems: found.length > MAX_ENTRY_PROBLEMS ? found.slice(0, MAX_ENTRY_PROBLEMS) : found, total: found.length };
13
13
  }
14
14
  //# sourceMappingURL=entry-problems.js.map
package/dist/env-facts.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { writeLogText } from "./observability/logger.js";
1
2
  import { isAbsolute, join, resolve, sep } from "node:path";
2
3
  import { mkdir, readdir, rm, stat } from "node:fs/promises";
3
4
  import { ensureDir } from "@sema-agent/core";
@@ -147,7 +148,7 @@ export async function purgeScratchpadDir(localDataRoot, sessionId) {
147
148
  await rm(dir, { recursive: true, force: true });
148
149
  }
149
150
  catch (err) {
150
- console.warn(`scratchpad_purge_failed dir=${dir}: ${err instanceof Error ? err.message : String(err)}`);
151
+ writeLogText("stderr", `scratchpad_purge_failed dir=${dir}: ${err instanceof Error ? err.message : String(err)}`);
151
152
  }
152
153
  }
153
154
  export async function sweepStaleScratchpads(localDataRoot, opts) {
@@ -6,14 +6,15 @@
6
6
  * · `example` 进拒句;
7
7
  * · `multiTenant` = `REQUIRE_PRINCIPAL=true` 下名单作不作数 —— **只有服务进程读的旋钮有这一列**(姿态是服务进程的概念):
8
8
  * - `LSP_ENV_ALLOW` ⇒ ignored:host 腿语言服务器在多租户姿态下本来就不起,名单无处作数,设了要说出来([ref])。
9
+ * - `HOOK_ENV_ALLOW` ⇒ ignored:请求的 `settings.hooks` 在多租户姿态下整只不跑(`task-settings.ts` `taskHooksHonored`,同一只部署形谓词),名单无处作数。
9
10
  * - 三只沙箱名单(e2b / local-docker / k8s 各一只) ⇒ honored:[ref] 照录修前语义(任何姿态下都转发),[ref] 主会话裁定维持 —— 沙箱 env 是部署方为隔离沙箱显式配的
10
11
  * 带外凭据(e2b / docker / k8s 车道本来就是多租户 fleet 的主形),与 LSP 那条「本机子进程」的形不同;多租户下起服说一句。
11
12
  * · `BAKE_ENV_ALLOW`([ref] 残余,7.103.0)由 **bake-runner 进程**读(构建宿主守护进程:没有主体、没有租户 ⇒ 没有姿态列,
12
- * 不进 {@link describeAllowlistPostures} 的姿态句)。它与服务侧四只旋钮同一只解析器、同一只「点名放行」谓词、同一条「原文按凭据类」律。
13
- * · `channel` = 这张名单**交给谁、在谁的减法之上**(闭集两词)。它只定拒句里「交到哪里」那半句与出路的主语,**不定拒不拒**:「不许点哪些名」对五只一律
13
+ * 不进 {@link describeAllowlistPostures} 的姿态句)。它与服务侧五只旋钮同一只解析器、同一只「点名放行」谓词、同一条「原文按凭据类」律。
14
+ * · `channel` = 这张名单**交给谁、在谁的减法之上**(闭集两词)。它只定拒句里「交到哪里」那半句与出路的主语,**不定拒不拒**:「不许点哪些名」对六只一律
14
15
  * = 名单型旋钮名 ∪ 本服务自有凭据名(引擎此刻的声明:起服解析时判一次,声明增长时由换代声明对活配置里每只服务侧名单此刻交出去的名重判一次;判官 = 引擎
15
16
  * `inheritEnvPolicyProblem`,与引擎拒嵌入方白名单同句),规则全文在解析器头注 ②。
16
- * - `host-put-back`(`LSP_ENV_ALLOW` / `BAKE_ENV_ALLOW`)—— 剥后放回形:宿主子进程的 env 先经唯一组合(引擎扣掉本服务自有凭据 + 形状剥),
17
+ * - `host-put-back`(`LSP_ENV_ALLOW` / `HOOK_ENV_ALLOW` / `BAKE_ENV_ALLOW`)—— 剥后放回形:宿主子进程的 env 先经唯一组合(引擎扣掉本服务自有凭据 + 形状剥 / 严格名单),
17
18
  * 名单点到的键再从本进程环境**原样**取回叠上去;点到本服务自有凭据名 = 把引擎刚扣下的那枚交回那只子进程。
18
19
  * - `sandbox-grant`(三只沙箱名单)—— 沙箱 env 的唯一来源(沙箱不从本进程继承任何东西),部署方显式交出的带外凭据([ref] 照转发);
19
20
  * 点到本服务自有凭据名 = 把它装进模型读得到的沙箱 env。沙箱要凭据 ⇒ 部署方给沙箱另铸一把(名与值都不同于本服务的任何凭据)。
@@ -25,7 +26,7 @@
25
26
  * 当场撒谎。为什么是纯叶:`config-catalog.ts` 被 `config.ts` 值引,表留在 `config.ts` 会成装载环。
26
27
  */
27
28
  /** 服务进程(`config.ts` `loadConfig`)读的名单型旋钮 —— 有多租户姿态。 */
28
- export type ServerEnvNameAllowlistKnob = "LSP_ENV_ALLOW" | "E2B_SANDBOX_ENV" | "DOCKER_SANDBOX_ENV" | "K8S_SANDBOX_ENV";
29
+ export type ServerEnvNameAllowlistKnob = "LSP_ENV_ALLOW" | "HOOK_ENV_ALLOW" | "E2B_SANDBOX_ENV" | "DOCKER_SANDBOX_ENV" | "K8S_SANDBOX_ENV";
29
30
  /** bake-runner 进程(`bake-runner/main.ts` `loadEnv`)读的名单型旋钮 —— 构建宿主守护进程没有主体 / 租户,没有姿态。 */
30
31
  export type RunnerEnvNameAllowlistKnob = "BAKE_ENV_ALLOW";
31
32
  export type EnvNameAllowlistKnob = ServerEnvNameAllowlistKnob | RunnerEnvNameAllowlistKnob;
@@ -52,7 +53,7 @@ export type EnvNameAllowlistKnobTable = {
52
53
  readonly [K in EnvNameAllowlistKnob]: K extends ServerEnvNameAllowlistKnob ? ServerEnvNameAllowlistKnobRow : RunnerEnvNameAllowlistKnobRow;
53
54
  };
54
55
  export declare const ENV_NAME_ALLOWLIST_KNOBS: EnvNameAllowlistKnobTable;
55
- /** 名单型旋钮的全部名字(五只;表键派生)—— 两处用:解析器的「点名名单型旋钮 = 形错」、剥除的「名单原文按凭据类」臂。 */
56
+ /** 名单型旋钮的全部名字(六只;表键派生)—— 两处用:解析器的「点名名单型旋钮 = 形错」、剥除的「名单原文按凭据类」臂。 */
56
57
  export declare const ENV_NAME_ALLOWLIST_KNOB_NAMES: ReadonlySet<string>;
57
58
  /**
58
59
  * 多租户姿态句 —— **由表派生**,不许在别处手写。形:`under REQUIRE_PRINCIPAL=true: <旋钮> is ignored; <旋钮> / <旋钮> are forwarded as configured`
@@ -4,6 +4,11 @@ export const ENV_NAME_ALLOWLIST_KNOBS = {
4
4
  channel: "host-put-back",
5
5
  multiTenant: { kind: "ignored", why: "the host-lane language server is not started in this posture, and the language-server env keeps the full secret strip" },
6
6
  },
7
+ HOOK_ENV_ALLOW: {
8
+ example: "HOOK_ENV_ALLOW=HOOK_TOKEN,WEBHOOK_SIGNING_KEY",
9
+ channel: "host-put-back",
10
+ multiTenant: { kind: "ignored", why: "request settings hooks are not run in this posture, so no hook environment reads the list" },
11
+ },
7
12
  E2B_SANDBOX_ENV: { example: "E2B_SANDBOX_ENV=GIT_TOKEN,NPM_TOKEN", channel: "sandbox-grant", multiTenant: { kind: "honored" } },
8
13
  DOCKER_SANDBOX_ENV: { example: "DOCKER_SANDBOX_ENV=GIT_TOKEN,NPM_TOKEN", channel: "sandbox-grant", multiTenant: { kind: "honored" } },
9
14
  K8S_SANDBOX_ENV: { example: "K8S_SANDBOX_ENV=GIT_TOKEN,NPM_TOKEN", channel: "sandbox-grant", multiTenant: { kind: "honored" } },
@@ -0,0 +1,7 @@
1
+ /** 出口座登记「这条 run 的环境一旦留下持久物就告诉我」;交回注销口(只注销自己登记的那一只)。 */
2
+ export declare function listenEnvWitness(runId: string, onWitness: () => void): () => void;
3
+ /** 环境留下了按会话键的持久物(run id 缺席 = 子 run / 服务自起的 run,不属任何提交 ⇒ 无事)。 */
4
+ export declare function witnessEnv(runId: string | undefined): void;
5
+ /** 在听的座数(测试读:收场后归零 = 不积累)。 */
6
+ export declare function envWitnessListeners(): number;
7
+ //# sourceMappingURL=env-witness.d.ts.map
@@ -0,0 +1,16 @@
1
+ const listening = new Map();
2
+ export function listenEnvWitness(runId, onWitness) {
3
+ listening.set(runId, onWitness);
4
+ return () => {
5
+ if (listening.get(runId) === onWitness)
6
+ listening.delete(runId);
7
+ };
8
+ }
9
+ export function witnessEnv(runId) {
10
+ if (runId !== undefined)
11
+ listening.get(runId)?.();
12
+ }
13
+ export function envWitnessListeners() {
14
+ return listening.size;
15
+ }
16
+ //# sourceMappingURL=env-witness.js.map
@@ -3,7 +3,7 @@ import { type ExecutionLane as DeclarableLane, type ExecutionLaneRow } from "@se
3
3
  import type { ServiceConfigFlat } from "./config-types.js";
4
4
  import { type LaneHomeConfig } from "./lane-home-probe.js";
5
5
  /** 一位能力的三态。`single-user-only` = 车道支持,但只在单用户部署(`requirePrincipal !== true`)开 ——
6
- * 多租户下这一位必须关(host 家族的 cwd/scheduler/backgroundShell/LSP 都是这一档,理由同源:
6
+ * 多租户下这一位必须关(host 家族的 cwd/scheduler/backgroundShell 都是这一档,理由同源 —— 本机语言服务器同理由,答者是部署形行 `callerOwnsWorkerDisk`:
7
7
  * 一个租户的输入不许把 agent 指向 worker 宿主上另一个租户/运维的文件与进程)。 */
8
8
  export type LaneCapability = "supported" | "unsupported" | "single-user-only";
9
9
  /** 闭集:执行车道全集 = settings-schema 词表正本的可声明车道(**派生**,本仓零手抄;`REMOTE_EXEC` 能写下去的词就是这些)。
@@ -16,15 +16,12 @@ export type ExecutionLane = DeclarableLane;
16
16
  export interface ExecutionLaneCaps {
17
17
  /** 调用方送来的 `cwd` 是否被尊重。读者:部署形表行 `callerCwd`(本位即判据;改前对账 `task-cwd.ts` 的 `cwdHonored || deviceCwdHonored`)。 */
18
18
  readonly callerCwd: LaneCapability;
19
- /** core 的后台 shell 面(`run_in_background`/`BashOutput`/`KillShell`)。判别式:各 adapter 的
20
- * `backgroundCapabilities.supported`(`plugins/remote-env-{host,e2b,k8s}.ts`);host 腿的闸在
21
- * `boot/execution-env.ts` 的 `hostCfg.backgroundShell`。 */
19
+ /** core 的后台 shell 面(`run_in_background`/`BashOutput`/`KillShell`),含把运行中的前台命令领养成后台任务(`supportsDetach`)。读者:部署形表行 `backgroundShell`(本位即判据);
20
+ * 三只适配器的 `backgroundCapabilities`(`supported` 与 `supportsDetach` 同一个答案)、host 适配器的装配点与事实 `autoBackgroundOnTimeout` 同读这一行,没有第二份判别式。 */
22
21
  readonly backgroundShell: LaneCapability;
23
22
  /** 自唤醒 scheduler(`CronCreate`/…)。判别式:`boot/execution-env.ts` host 臂的 `hostScheduler`
24
23
  * 与 `http/routes/capabilities.ts` 的 `scheduler` 位(两处同判据)。 */
25
24
  readonly scheduler: LaneCapability;
26
- /** LSP。判别式:`boot/execution-env.ts` 的 `lspManager` 两臂(沙箱桥 e2b/k8s;host 本地 NodeLspManager)。 */
27
- readonly lsp: LaneCapability;
28
25
  /** SendUserFile 的**沙箱直传腿**(host 的本机 fs 源是另一条腿,不是本位)。
29
26
  * 读者:部署形表行 `sandboxSendUserFile`(本位即判据;判定依据在 `capabilities/sandbox-file-send.ts` 头注)。 */
30
27
  readonly sandboxSendUserFile: LaneCapability;
@@ -58,8 +55,8 @@ export interface ExecutionLaneCaps {
58
55
  * 绑定验证),故不要求单用户。(部署形表行 `callerCwd` 直接读本位。)
59
56
  * · `remoteScratchpad: supported` —— executor 平台闭集 = darwin|linux,`/tmp/scratchpad/<sessionId>`
60
57
  * 的惰性 mkdir 约定原样适用;不加词则 scratchpad envFact 对模型整块缺席。
61
- * · scheduler / backgroundShell / lsp / sandboxSendUserFile / worktreeIsolation = v1 **诚实关闭**
62
- * (不是遗漏:设备侧长驻进程、LSP sidecar、直传腿都是 follow-on,声明了就是谎)。
58
+ * · scheduler / backgroundShell / sandboxSendUserFile / worktreeIsolation = v1 **诚实关闭**
59
+ * (不是遗漏:设备侧长驻进程、直传腿都是 follow-on,声明了就是谎)。
63
60
  */
64
61
  export declare function executionLaneCaps(lane: ExecutionLane): ExecutionLaneCaps;
65
62
  /** 读地板旋钮的 env 名(拒起句与起服行点名它)。 */
@@ -186,22 +183,11 @@ export declare function deployedExecutionLanes(config: Pick<ServiceConfigFlat, "
186
183
  *
187
184
  * 读者问的都是这一句,**同一只函数**,不许各写一份 `=== "host"`:
188
185
  * ① 部署形表行 `toolsOnThisHost`(`deployment-shape.ts`)—— wire `executionLane.toolsOnThisHost` + 出厂自扫技能与中心 plugin 技能的 `baseDir`;
189
- * ② 部署形表行 `callerOwnsWorkerDisk`(本列 ∧ 单主)—— SendUserFile 本机腿(「无手不挂」)、调用方宿主路径(附加目录 / 项目上下文)、指令文件探针;
186
+ * ② 部署形表行 `callerOwnsWorkerDisk`(本列 ∧ 单主)—— SendUserFile 本机腿(「无手不挂」)、调用方宿主路径(附加目录 / 项目上下文)、指令文件探针、
187
+ * 本机语言服务器(`createLspManager`;这类车道的适配器必须绑得住读 `openBound`,对拍钉 `test/host-env-open-bound.test.ts`);
190
188
  * ③ `approval.ts` 的 `buildNoResponderBootWarns` —— 写门的 ask 只在「有手写本机盘」时才会发生(它手里已有车道词,直接读本列)。
191
189
  */
192
190
  export declare function handsOnWorkerFilePlane(lane: ExecutionLane): boolean;
193
- /**
194
- * core 7.50.0 —— 「这条车道的执行环境能不能把一次读**绑到判过的那只对象**上」(`FileSystem.openBound`:开着并持有,叶链接不跟,
195
- * 开后身份对拍)。LSP 会话的读口与路径附件只经它读;环境不实现 ⇒ 那两个读口在这条车道上一律拒。
196
- *
197
- * **一条律**:LSP 只在本谓词为真的车道挂(`boot/execution-env.ts` 的 LSP 管理器两臂都合取它;表的 `lsp` 位与之同向,
198
- * 对拍钉 `test/host-env-open-bound.test.ts`:本谓词 ⟺ 适配器类原型上有 `openBound`)。
199
- * · `host` —— `RemoteHostExecutionEnv.openBound` 委托 core `NodeExecutionEnv` 的实现(唯一属主),真;
200
- * · `none` —— 没有手(执行环境两座都不给),无物可绑;
201
- * · 其余车道(沙箱 / 远端 shell / 设备)—— 读走 exec / sftp / 设备协议,本版不实现绑定读,假。实现之日翻这一格,LSP 沙箱桥随之回来。
202
- * 穷举 switch、无 default 臂:车道加词而此处不表态 = 编译红。
203
- */
204
- export declare function laneBindsReads(lane: ExecutionLane): boolean;
205
191
  /**
206
192
  * 「这条车道的执行环境**自己读得出家目录**」—— 读得出 ⇒ 读数是真源:适配器持一只 `LaneHomeSeat`(取值律与座的唯一属主 = `lane-home-probe.ts`),
207
193
  * 部署给的主张({@link buildLaneHomeClaim})在每只环境开起来时被证,不一致 ⇒ 那只环境不开;没有主张 ⇒ 读数填 `ExecutionEnv.homeDir` 的座。
@@ -343,11 +329,27 @@ export declare function buildLaneHomeBootNote(deployment: LaneHomeDeployment): {
343
329
  readonly event: string;
344
330
  readonly note: string;
345
331
  } | undefined;
332
+ /**
333
+ * 读拒表的字节地板不守时一条 run 的**两种结局**(闭集):`ran` = 部署没要求地板,run 照跑(引擎每 run 一条 `config.read_deny_floor_unkept` 通告);
334
+ * `refused` = 部署要求地板(`READ_DENY_FLOOR_REQUIRED=true`),run 在准备期拒(同码失败终局,同步提交 409)。判官只有引擎一只(`judgeReadFloorKept`),
335
+ * 结局由旋钮分开 —— 本仓只说话。
336
+ */
337
+ export type ReadDenyFloorOutcome = "ran" | "refused";
338
+ /**
339
+ * **读拒字节地板不守的那一句** —— 本仓说这件事的**唯一**组句器(纯字符串 ⇒ `build*`):点名执行环境(`REMOTE_EXEC=<车道>`,运维写的那一格)、
340
+ * 「不守读拒字节地板」与出路 `READ_DENY_FLOOR_REQUIRED`。读它的面(一个事实一句话,不另写第二句):
341
+ * · `ran` —— run 事件流的 `engine_notice` 帧、运维 `engine_notice` 日志行与终局结果的 `readDenyFloor.message`(`read-deny-floor-notice.ts` 的呈现器);
342
+ * · `refused` —— 失败终局的句子(同步提交 409 的 `error`、run 行 `error`、`done` 帧 `terminal.message`,`terminal.ts` 的两只出口属主)与起服那一行
343
+ * `read_deny_floor_required_unkept` 的 `note`({@link buildReadDenyFloorUnkeptNote})。
344
+ * 句子不带行数(行数在通告的 `detail.rowCount`):同一条部署上同一种结局逐字同一句,运维能把起服行、409 与日志对上。
345
+ * 车道名以旋钮形 `REMOTE_EXEC=<词>` 出现 —— 那是调用方 / 运维写得出、查得到的名字,不是本仓对执行车道的自称。
346
+ */
347
+ export declare function buildReadDenyFloorSentence(lane: string, outcome: ReadDenyFloorOutcome): string;
346
348
  /**
347
349
  * 「部署要求读拒表的字节地板(`READ_DENY_FLOOR_REQUIRED=true`),而本部署车道的执行环境块不守地板」时起服那一行的 `note`(纯字符串 ⇒ `build*`);否则 `undefined`。
348
350
  * 判据只读部署的要求与 {@link capabilitiesFor} 的 `keepsReadFloor`(认不出的车道答不出块 ⇒ 按不守说,不静默)。`none` 的桩块守地板 ⇒ 不出。
349
- * 句子点名车道与键:这条车道上每个读拒表有行的 run(出厂读拒档在岗时就有行)都在准备期拒,一个命令都不起 —— 起服先把后果与两条出路说出来,
350
- * 不让运维从第一条 409 才知道。
351
+ * 句子 = 这条车道上每条被拒的 run 的拒句({@link buildReadDenyFloorSentence} 的 `refused`,一字不差):起服先把后果与两条出路说出来,
352
+ * 运维不必从第一条 409 才知道,且起服行与 409 是同一句。
351
353
  */
352
354
  export declare function buildReadDenyFloorUnkeptNote(deployment: CapabilitiesDeployment & {
353
355
  readonly readDenyFloorRequired: boolean;