@leitwerk-dev/server 0.2.0 → 0.2.1

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 (392) hide show
  1. package/dist/app-7PKX73TU.js +8 -0
  2. package/dist/{app-D4XHIbwA.d.ts → app-WfwKzrVk.d.ts} +2029 -410
  3. package/dist/app.d.ts +55 -12
  4. package/dist/app.d.ts.map +1 -1
  5. package/dist/{chunk-XTXH6623.js → chunk-CNITOV76.js} +1359 -991
  6. package/dist/chunk-CNITOV76.js.map +1 -0
  7. package/dist/{chunk-AGC2ND53.js → chunk-ZSKM25SD.js} +588 -667
  8. package/dist/chunk-ZSKM25SD.js.map +1 -0
  9. package/dist/config/config-loader.d.ts +11 -0
  10. package/dist/config/config-loader.d.ts.map +1 -1
  11. package/dist/config/config-types.d.ts +152 -51
  12. package/dist/config/config-types.d.ts.map +1 -1
  13. package/dist/db/api-token-repo.d.ts +24 -0
  14. package/dist/db/api-token-repo.d.ts.map +1 -1
  15. package/dist/db/auth-repo.d.ts +30 -0
  16. package/dist/db/auth-repo.d.ts.map +1 -1
  17. package/dist/db/credential-cipher.d.ts +8 -3
  18. package/dist/db/credential-cipher.d.ts.map +1 -1
  19. package/dist/db/database.d.ts +19 -1
  20. package/dist/db/database.d.ts.map +1 -1
  21. package/dist/db/external-write-log-repo.d.ts +6 -1
  22. package/dist/db/external-write-log-repo.d.ts.map +1 -1
  23. package/dist/db/future-execution-repo.d.ts +47 -0
  24. package/dist/db/future-execution-repo.d.ts.map +1 -1
  25. package/dist/db/launch-run-repo.d.ts +17 -0
  26. package/dist/db/launch-run-repo.d.ts.map +1 -1
  27. package/dist/db/launcher-recent-value-repo.d.ts +15 -0
  28. package/dist/db/launcher-recent-value-repo.d.ts.map +1 -1
  29. package/dist/db/pending-external-source-fire-repo.d.ts +33 -0
  30. package/dist/db/pending-external-source-fire-repo.d.ts.map +1 -1
  31. package/dist/db/process-event-repo.d.ts +17 -0
  32. package/dist/db/process-event-repo.d.ts.map +1 -1
  33. package/dist/db/process-handoff-dedup-key-repo.d.ts +8 -0
  34. package/dist/db/process-handoff-dedup-key-repo.d.ts.map +1 -1
  35. package/dist/db/process-input-repo.d.ts +15 -0
  36. package/dist/db/process-input-repo.d.ts.map +1 -1
  37. package/dist/db/process-instance-repo.d.ts +49 -0
  38. package/dist/db/process-instance-repo.d.ts.map +1 -1
  39. package/dist/db/process-leaf-outcome-snapshot-repo.d.ts +18 -0
  40. package/dist/db/process-leaf-outcome-snapshot-repo.d.ts.map +1 -1
  41. package/dist/db/process-project-repo.d.ts +20 -0
  42. package/dist/db/process-project-repo.d.ts.map +1 -1
  43. package/dist/db/process-question-request-repo.d.ts +19 -0
  44. package/dist/db/process-question-request-repo.d.ts.map +1 -1
  45. package/dist/db/process-relation-repo.d.ts +5 -0
  46. package/dist/db/process-relation-repo.d.ts.map +1 -1
  47. package/dist/db/process-skill-repo.d.ts +4 -0
  48. package/dist/db/process-skill-repo.d.ts.map +1 -1
  49. package/dist/db/process-title-job-repo.d.ts +22 -0
  50. package/dist/db/process-title-job-repo.d.ts.map +1 -1
  51. package/dist/db/process-tool-approval-request-repo.d.ts +20 -0
  52. package/dist/db/process-tool-approval-request-repo.d.ts.map +1 -1
  53. package/dist/db/process-turn-annotation-repo.d.ts +22 -2
  54. package/dist/db/process-turn-annotation-repo.d.ts.map +1 -1
  55. package/dist/db/process-turn-record-repo.d.ts +27 -0
  56. package/dist/db/process-turn-record-repo.d.ts.map +1 -1
  57. package/dist/db/provider-credential-repo.d.ts +16 -0
  58. package/dist/db/provider-credential-repo.d.ts.map +1 -1
  59. package/dist/db/repositories.d.ts +33 -0
  60. package/dist/db/repositories.d.ts.map +1 -1
  61. package/dist/db/session-transfer-repo.d.ts +49 -1
  62. package/dist/db/session-transfer-repo.d.ts.map +1 -1
  63. package/dist/db/skill-repo.d.ts +20 -0
  64. package/dist/db/skill-repo.d.ts.map +1 -1
  65. package/dist/db/startup-observation-repo.d.ts +3 -0
  66. package/dist/db/startup-observation-repo.d.ts.map +1 -1
  67. package/dist/db/ticket-destination-recent-repo.d.ts +14 -0
  68. package/dist/db/ticket-destination-recent-repo.d.ts.map +1 -1
  69. package/dist/db/turn-start-record-repo.d.ts +9 -0
  70. package/dist/db/turn-start-record-repo.d.ts.map +1 -1
  71. package/dist/db/turn-summary-repo.d.ts +18 -0
  72. package/dist/db/turn-summary-repo.d.ts.map +1 -1
  73. package/dist/db/worker-lease-repo.d.ts +31 -1
  74. package/dist/db/worker-lease-repo.d.ts.map +1 -1
  75. package/dist/effects/post-commit-effect.d.ts +29 -0
  76. package/dist/effects/post-commit-effect.d.ts.map +1 -1
  77. package/dist/effects/post-commit-runner.d.ts +1 -0
  78. package/dist/effects/post-commit-runner.d.ts.map +1 -1
  79. package/dist/entry-ref-patch.d.ts +3 -0
  80. package/dist/entry-ref-patch.d.ts.map +1 -1
  81. package/dist/extension-ui/catalog.d.ts +15 -0
  82. package/dist/extension-ui/catalog.d.ts.map +1 -1
  83. package/dist/extensions/extension-host.d.ts +6 -0
  84. package/dist/extensions/extension-host.d.ts.map +1 -1
  85. package/dist/external-source-service.d.ts +8 -0
  86. package/dist/external-source-service.d.ts.map +1 -1
  87. package/dist/future-execution/execution.d.ts +23 -1
  88. package/dist/future-execution/execution.d.ts.map +1 -1
  89. package/dist/future-execution/launch-lifecycle.d.ts +76 -0
  90. package/dist/future-execution/launch-lifecycle.d.ts.map +1 -1
  91. package/dist/future-execution/lifecycle.d.ts +99 -0
  92. package/dist/future-execution/lifecycle.d.ts.map +1 -1
  93. package/dist/future-execution/model-projection.d.ts +6 -0
  94. package/dist/future-execution/model-projection.d.ts.map +1 -1
  95. package/dist/future-execution/transition-planner.d.ts +25 -0
  96. package/dist/future-execution/transition-planner.d.ts.map +1 -1
  97. package/dist/future-execution-scheduler.d.ts +1 -1
  98. package/dist/future-execution-scheduler.d.ts.map +1 -1
  99. package/dist/index.d.ts +3 -30
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +5 -239
  102. package/dist/index.js.map +1 -1
  103. package/dist/instance-tree.d.ts +3 -0
  104. package/dist/instance-tree.d.ts.map +1 -1
  105. package/dist/integration-tool-registry.d.ts +4 -1
  106. package/dist/integration-tool-registry.d.ts.map +1 -1
  107. package/dist/launch-coordinator.d.ts +33 -0
  108. package/dist/launch-coordinator.d.ts.map +1 -1
  109. package/dist/launch-pipeline.d.ts +60 -0
  110. package/dist/launch-pipeline.d.ts.map +1 -1
  111. package/dist/launcher-recent-values-service.d.ts +3 -0
  112. package/dist/launcher-recent-values-service.d.ts.map +1 -1
  113. package/dist/main.js +7 -14
  114. package/dist/main.js.map +1 -1
  115. package/dist/model-providers/builtin-server-adapter.d.ts +1 -0
  116. package/dist/model-providers/builtin-server-adapter.d.ts.map +1 -1
  117. package/dist/model-providers/credentials.d.ts +17 -0
  118. package/dist/model-providers/credentials.d.ts.map +1 -1
  119. package/dist/model-providers/model-status-cache.d.ts +30 -1
  120. package/dist/model-providers/model-status-cache.d.ts.map +1 -1
  121. package/dist/model-providers/provider-options.d.ts +21 -1
  122. package/dist/model-providers/provider-options.d.ts.map +1 -1
  123. package/dist/model-providers/registry.d.ts +22 -2
  124. package/dist/model-providers/registry.d.ts.map +1 -1
  125. package/dist/model-providers/server-adapters.d.ts +19 -0
  126. package/dist/model-providers/server-adapters.d.ts.map +1 -1
  127. package/dist/pi-resources/assemble.d.ts +24 -4
  128. package/dist/pi-resources/assemble.d.ts.map +1 -1
  129. package/dist/pi-resources/bundle-cache.d.ts +20 -1
  130. package/dist/pi-resources/bundle-cache.d.ts.map +1 -1
  131. package/dist/pi-resources/bundle-pin-lifecycle.d.ts +5 -1
  132. package/dist/pi-resources/bundle-pin-lifecycle.d.ts.map +1 -1
  133. package/dist/pi-resources/resource-collector.d.ts +11 -0
  134. package/dist/pi-resources/resource-collector.d.ts.map +1 -1
  135. package/dist/pi-session-tree.d.ts +13 -1
  136. package/dist/pi-session-tree.d.ts.map +1 -1
  137. package/dist/process-action-registry.d.ts +47 -0
  138. package/dist/process-action-registry.d.ts.map +1 -1
  139. package/dist/process-deletion-service.d.ts +12 -0
  140. package/dist/process-deletion-service.d.ts.map +1 -1
  141. package/dist/process-engine/decision.d.ts +12 -0
  142. package/dist/process-engine/decision.d.ts.map +1 -1
  143. package/dist/process-engine/engine.d.ts +1 -0
  144. package/dist/process-engine/engine.d.ts.map +1 -1
  145. package/dist/process-engine/operation.d.ts +23 -2
  146. package/dist/process-engine/operation.d.ts.map +1 -1
  147. package/dist/process-engine/startup-reconciliation.d.ts +14 -0
  148. package/dist/process-engine/startup-reconciliation.d.ts.map +1 -1
  149. package/dist/process-engine/types.d.ts +112 -1
  150. package/dist/process-engine/types.d.ts.map +1 -1
  151. package/dist/process-engine/writes/build-process-park-writes.d.ts +3 -0
  152. package/dist/process-engine/writes/build-process-park-writes.d.ts.map +1 -1
  153. package/dist/process-engine/writes/build-recovery-start-writes.d.ts +4 -0
  154. package/dist/process-engine/writes/build-recovery-start-writes.d.ts.map +1 -1
  155. package/dist/process-engine/writes/build-retry-writes.d.ts +3 -0
  156. package/dist/process-engine/writes/build-retry-writes.d.ts.map +1 -1
  157. package/dist/process-engine/writes/build-turn-failed-writes.d.ts +6 -0
  158. package/dist/process-engine/writes/build-turn-failed-writes.d.ts.map +1 -1
  159. package/dist/process-engine/writes/build-turn-outcome-writes.d.ts +8 -0
  160. package/dist/process-engine/writes/build-turn-outcome-writes.d.ts.map +1 -1
  161. package/dist/process-engine/writes/build-turn-selection-writes.d.ts +8 -0
  162. package/dist/process-engine/writes/build-turn-selection-writes.d.ts.map +1 -1
  163. package/dist/process-engine/writes/commit-writes.d.ts +14 -0
  164. package/dist/process-engine/writes/commit-writes.d.ts.map +1 -1
  165. package/dist/process-engine/writes/deferred-extension-events.d.ts +4 -0
  166. package/dist/process-engine/writes/deferred-extension-events.d.ts.map +1 -1
  167. package/dist/process-engine/writes/writes.d.ts +67 -0
  168. package/dist/process-engine/writes/writes.d.ts.map +1 -1
  169. package/dist/process-graph.d.ts +1 -1
  170. package/dist/process-graph.d.ts.map +1 -1
  171. package/dist/process-input-dispatch.d.ts +1 -0
  172. package/dist/process-input-dispatch.d.ts.map +1 -1
  173. package/dist/process-launch-executor.d.ts +1 -0
  174. package/dist/process-launch-executor.d.ts.map +1 -1
  175. package/dist/process-model-policy/types.d.ts +157 -1
  176. package/dist/process-model-policy/types.d.ts.map +1 -1
  177. package/dist/process-operation-coordinator.d.ts +3 -0
  178. package/dist/process-operation-coordinator.d.ts.map +1 -1
  179. package/dist/process-question-service.d.ts +36 -20
  180. package/dist/process-question-service.d.ts.map +1 -1
  181. package/dist/process-runtime-availability.d.ts +2 -1
  182. package/dist/process-runtime-availability.d.ts.map +1 -1
  183. package/dist/process-session-store.d.ts +15 -4
  184. package/dist/process-session-store.d.ts.map +1 -1
  185. package/dist/process-title-generator.d.ts +53 -0
  186. package/dist/process-title-generator.d.ts.map +1 -1
  187. package/dist/process-turn-navigation.d.ts +1 -30
  188. package/dist/process-turn-navigation.d.ts.map +1 -1
  189. package/dist/process-turn-trace.d.ts +7 -0
  190. package/dist/process-turn-trace.d.ts.map +1 -1
  191. package/dist/process-ui-registry.d.ts +2 -0
  192. package/dist/process-ui-registry.d.ts.map +1 -1
  193. package/dist/process-ui-snapshot-presenter.d.ts +68 -1
  194. package/dist/process-ui-snapshot-presenter.d.ts.map +1 -1
  195. package/dist/process-watcher-registry.d.ts +5 -0
  196. package/dist/process-watcher-registry.d.ts.map +1 -1
  197. package/dist/product-ref-state.d.ts +1 -0
  198. package/dist/product-ref-state.d.ts.map +1 -1
  199. package/dist/project-mutation-service.d.ts +19 -0
  200. package/dist/project-mutation-service.d.ts.map +1 -1
  201. package/dist/result-image-store.d.ts +20 -0
  202. package/dist/result-image-store.d.ts.map +1 -1
  203. package/dist/routes/process-route-helpers.d.ts +30 -0
  204. package/dist/routes/process-route-helpers.d.ts.map +1 -1
  205. package/dist/routes/ui-renderers.d.ts +4 -0
  206. package/dist/routes/ui-renderers.d.ts.map +1 -1
  207. package/dist/routes/watchers.d.ts +3 -0
  208. package/dist/routes/watchers.d.ts.map +1 -1
  209. package/dist/semantic-entry-ref-state.d.ts +1 -0
  210. package/dist/semantic-entry-ref-state.d.ts.map +1 -1
  211. package/dist/server-bootstrap/app-lifecycle.d.ts +24 -0
  212. package/dist/server-bootstrap/app-lifecycle.d.ts.map +1 -0
  213. package/dist/server-bootstrap/build-host-capabilities.d.ts +5 -1
  214. package/dist/server-bootstrap/build-host-capabilities.d.ts.map +1 -1
  215. package/dist/server-topology.d.ts +8 -1
  216. package/dist/server-topology.d.ts.map +1 -1
  217. package/dist/session-transfer-helper-relays.d.ts +24 -0
  218. package/dist/session-transfer-helper-relays.d.ts.map +1 -1
  219. package/dist/session-transfer-service.d.ts +63 -1
  220. package/dist/session-transfer-service.d.ts.map +1 -1
  221. package/dist/skills/catalog-service.d.ts +7 -0
  222. package/dist/skills/catalog-service.d.ts.map +1 -1
  223. package/dist/skills/source-importer.d.ts +8 -0
  224. package/dist/skills/source-importer.d.ts.map +1 -1
  225. package/dist/startup-evidence.d.ts.map +1 -1
  226. package/dist/supervisor/ipc-handler.d.ts +28 -0
  227. package/dist/supervisor/ipc-handler.d.ts.map +1 -1
  228. package/dist/supervisor/worker-event-ingestor.d.ts +10 -0
  229. package/dist/supervisor/worker-event-ingestor.d.ts.map +1 -1
  230. package/dist/supervisor/worker-start-payload-builder.d.ts +13 -0
  231. package/dist/supervisor/worker-start-payload-builder.d.ts.map +1 -1
  232. package/dist/supervisor/worker-storage-layout.d.ts +12 -0
  233. package/dist/supervisor/worker-storage-layout.d.ts.map +1 -1
  234. package/dist/supervisor/worker-supervisor.d.ts +47 -3
  235. package/dist/supervisor/worker-supervisor.d.ts.map +1 -1
  236. package/dist/supervisor/worker-turn-ipc-recorder.d.ts +19 -0
  237. package/dist/supervisor/worker-turn-ipc-recorder.d.ts.map +1 -1
  238. package/dist/supervisor/worker-unit-reclaimer.d.ts +3 -0
  239. package/dist/supervisor/worker-unit-reclaimer.d.ts.map +1 -1
  240. package/dist/supervisor/worker-websocket-ipc.d.ts +37 -0
  241. package/dist/supervisor/worker-websocket-ipc.d.ts.map +1 -1
  242. package/dist/test-helpers/accepted-turn-start.d.ts +17 -0
  243. package/dist/test-helpers/accepted-turn-start.d.ts.map +1 -1
  244. package/dist/test-helpers/session-snapshot-fixtures.d.ts +1 -1
  245. package/dist/test-helpers/session-snapshot-fixtures.d.ts.map +1 -1
  246. package/dist/test-helpers/turn-start-preflight-fixtures.d.ts +8 -1
  247. package/dist/test-helpers/turn-start-preflight-fixtures.d.ts.map +1 -1
  248. package/dist/test-helpers/unit-deps.d.ts +8 -0
  249. package/dist/test-helpers/unit-deps.d.ts.map +1 -1
  250. package/dist/testing.d.ts +4 -7
  251. package/dist/testing.d.ts.map +1 -1
  252. package/dist/testing.js +2 -53
  253. package/dist/testing.js.map +1 -1
  254. package/dist/tool-approval-gate.d.ts +21 -0
  255. package/dist/tool-approval-gate.d.ts.map +1 -1
  256. package/dist/turn-result-markdown.d.ts +2 -0
  257. package/dist/turn-result-markdown.d.ts.map +1 -1
  258. package/dist/worker-runtime-profile-selection.d.ts +20 -4
  259. package/dist/worker-runtime-profile-selection.d.ts.map +1 -1
  260. package/dist/ws/broadcast.d.ts +10 -0
  261. package/dist/ws/broadcast.d.ts.map +1 -1
  262. package/package.json +11 -11
  263. package/src/app.ts +916 -892
  264. package/src/config/config-loader.ts +12 -0
  265. package/src/config/config-types.ts +166 -66
  266. package/src/db/api-token-repo.ts +35 -2
  267. package/src/db/auth-repo.ts +35 -1
  268. package/src/db/credential-cipher.ts +8 -3
  269. package/src/db/database.ts +14 -0
  270. package/src/db/external-write-log-repo.ts +6 -1
  271. package/src/db/future-execution-repo.ts +51 -1
  272. package/src/db/launch-run-repo.ts +17 -0
  273. package/src/db/launcher-recent-value-repo.ts +15 -0
  274. package/src/db/pending-external-source-fire-repo.ts +33 -0
  275. package/src/db/process-event-repo.ts +21 -1
  276. package/src/db/process-handoff-dedup-key-repo.ts +8 -0
  277. package/src/db/process-input-repo.ts +15 -0
  278. package/src/db/process-instance-repo.ts +57 -2
  279. package/src/db/process-leaf-outcome-snapshot-repo.ts +18 -0
  280. package/src/db/process-project-repo.ts +20 -0
  281. package/src/db/process-question-request-repo.ts +19 -0
  282. package/src/db/process-relation-repo.ts +8 -1
  283. package/src/db/process-skill-repo.ts +4 -0
  284. package/src/db/process-title-job-repo.ts +30 -2
  285. package/src/db/process-tool-approval-request-repo.ts +24 -1
  286. package/src/db/process-turn-annotation-repo.ts +22 -2
  287. package/src/db/process-turn-record-repo.ts +27 -0
  288. package/src/db/provider-credential-repo.ts +20 -1
  289. package/src/db/repositories.ts +36 -1
  290. package/src/db/session-transfer-repo.ts +71 -9
  291. package/src/db/skill-repo.ts +24 -1
  292. package/src/db/startup-observation-repo.ts +3 -0
  293. package/src/db/ticket-destination-recent-repo.ts +14 -0
  294. package/src/db/turn-start-record-repo.ts +12 -1
  295. package/src/db/turn-summary-repo.ts +29 -2
  296. package/src/db/worker-lease-repo.ts +31 -1
  297. package/src/deployment-preflight.ts +1 -1
  298. package/src/effects/post-commit-effect.ts +42 -3
  299. package/src/effects/post-commit-runner.ts +1 -0
  300. package/src/entry-ref-patch.ts +9 -1
  301. package/src/extension-ui/catalog.ts +15 -0
  302. package/src/extensions/extension-host.ts +6 -0
  303. package/src/external-source-service.ts +12 -1
  304. package/src/future-execution/execution.ts +45 -8
  305. package/src/future-execution/launch-lifecycle.ts +145 -17
  306. package/src/future-execution/lifecycle.ts +124 -13
  307. package/src/future-execution/model-projection.ts +6 -0
  308. package/src/future-execution/transition-planner.ts +25 -0
  309. package/src/future-execution-scheduler.ts +7 -6
  310. package/src/index.ts +5 -153
  311. package/src/instance-tree.ts +3 -0
  312. package/src/integration-tool-registry.ts +17 -8
  313. package/src/launch-coordinator.ts +55 -5
  314. package/src/launch-pipeline.ts +103 -12
  315. package/src/launcher-recent-values-service.ts +3 -0
  316. package/src/main.ts +3 -10
  317. package/src/model-providers/builtin-server-adapter.ts +1 -0
  318. package/src/model-providers/credentials.ts +17 -0
  319. package/src/model-providers/model-status-cache.ts +30 -1
  320. package/src/model-providers/provider-options.ts +25 -2
  321. package/src/model-providers/registry.ts +22 -2
  322. package/src/model-providers/server-adapters.ts +19 -0
  323. package/src/pi-resources/assemble.ts +24 -4
  324. package/src/pi-resources/bundle-cache.ts +20 -1
  325. package/src/pi-resources/bundle-pin-lifecycle.ts +8 -2
  326. package/src/pi-resources/resource-collector.ts +11 -0
  327. package/src/pi-session-tree.ts +13 -1
  328. package/src/process-action-registry.ts +53 -1
  329. package/src/process-deletion-service.ts +29 -4
  330. package/src/process-engine/decision.ts +12 -0
  331. package/src/process-engine/engine.ts +1 -0
  332. package/src/process-engine/operation.ts +23 -2
  333. package/src/process-engine/startup-reconciliation.ts +14 -0
  334. package/src/process-engine/types.ts +176 -14
  335. package/src/process-engine/writes/build-process-park-writes.ts +3 -0
  336. package/src/process-engine/writes/build-recovery-start-writes.ts +4 -0
  337. package/src/process-engine/writes/build-retry-writes.ts +3 -0
  338. package/src/process-engine/writes/build-turn-failed-writes.ts +6 -0
  339. package/src/process-engine/writes/build-turn-outcome-writes.ts +8 -0
  340. package/src/process-engine/writes/build-turn-selection-writes.ts +8 -0
  341. package/src/process-engine/writes/commit-writes.ts +14 -0
  342. package/src/process-engine/writes/deferred-extension-events.ts +4 -0
  343. package/src/process-engine/writes/writes.ts +104 -10
  344. package/src/process-graph.ts +0 -3
  345. package/src/process-input-dispatch.ts +1 -0
  346. package/src/process-launch-executor.ts +1 -0
  347. package/src/process-model-policy/types.ts +195 -11
  348. package/src/process-operation-coordinator.ts +3 -0
  349. package/src/process-question-service.ts +53 -11
  350. package/src/process-runtime-availability.ts +4 -3
  351. package/src/process-session-store.ts +15 -4
  352. package/src/process-title-generator.ts +71 -5
  353. package/src/process-turn-navigation.ts +4 -1
  354. package/src/process-turn-trace.ts +7 -0
  355. package/src/process-ui-registry.ts +2 -0
  356. package/src/process-ui-snapshot-presenter.ts +75 -3
  357. package/src/process-watcher-registry.ts +5 -0
  358. package/src/product-ref-state.ts +1 -0
  359. package/src/project-mutation-service.ts +22 -1
  360. package/src/result-image-store.ts +27 -2
  361. package/src/routes/process-route-helpers.ts +30 -0
  362. package/src/routes/ui-renderers.ts +4 -0
  363. package/src/routes/watchers.ts +3 -0
  364. package/src/semantic-entry-ref-state.ts +1 -0
  365. package/src/server-bootstrap/app-lifecycle.ts +150 -0
  366. package/src/server-topology.ts +8 -1
  367. package/src/session-transfer-helper-relays.ts +33 -2
  368. package/src/session-transfer-service.ts +75 -7
  369. package/src/skills/catalog-service.ts +7 -0
  370. package/src/skills/source-importer.ts +8 -0
  371. package/src/startup-evidence.ts +23 -41
  372. package/src/supervisor/ipc-handler.ts +33 -1
  373. package/src/supervisor/worker-event-ingestor.ts +10 -0
  374. package/src/supervisor/worker-start-payload-builder.ts +16 -1
  375. package/src/supervisor/worker-storage-layout.ts +12 -0
  376. package/src/supervisor/worker-supervisor.ts +119 -133
  377. package/src/supervisor/worker-turn-ipc-recorder.ts +19 -0
  378. package/src/supervisor/worker-unit-reclaimer.ts +3 -0
  379. package/src/supervisor/worker-websocket-ipc.ts +57 -3
  380. package/src/test-helpers/accepted-turn-start.ts +28 -2
  381. package/src/test-helpers/session-snapshot-fixtures.ts +1 -1
  382. package/src/test-helpers/turn-start-preflight-fixtures.ts +8 -1
  383. package/src/test-helpers/unit-deps.ts +13 -1
  384. package/src/testing.ts +4 -23
  385. package/src/tool-approval-gate.ts +32 -3
  386. package/src/turn-result-markdown.ts +2 -0
  387. package/src/worker-runtime-profile-selection.ts +24 -5
  388. package/src/ws/broadcast.ts +20 -1
  389. package/dist/app-I4QQUL5B.js +0 -10
  390. package/dist/chunk-AGC2ND53.js.map +0 -1
  391. package/dist/chunk-XTXH6623.js.map +0 -1
  392. /package/dist/{app-I4QQUL5B.js.map → app-7PKX73TU.js.map} +0 -0
@@ -3,6 +3,7 @@ import type { WorkerInputConsumedPayload } from "@leitwerk-dev/worker-protocol";
3
3
 
4
4
  import { mergeEntryRefPatchIntoStateJson } from "./entry-ref-patch.js";
5
5
 
6
+ /** @internal */
6
7
  export type ProcessProductRefPatch = Record<string, ProcessProductRef | null | undefined>;
7
8
 
8
9
  export function mergeProductRefPatchIntoStateJson(
@@ -9,27 +9,41 @@ import type { PostCommitEffect } from "./effects/post-commit-effect.js";
9
9
  import { runPostCommitEffectList } from "./effects/post-commit-runner.js";
10
10
  import type { Broadcaster } from "./ws/broadcast.js";
11
11
 
12
+ /** @internal */
12
13
  export type ProjectUpdatedFrameInput = Extract<DurableWsFrameInput, { type: "project.updated" }>;
13
14
 
15
+ /** @internal */
14
16
  export interface ProjectMutationCommit {
17
+ /** @internal */
15
18
  project: ProcessProject | null;
19
+ /** @internal */
16
20
  effects: PostCommitEffect[];
17
21
  }
18
22
 
23
+ /** @internal */
19
24
  export interface ProjectMutationService {
25
+ /** @internal */
20
26
  create(input: CreateProcessProjectInput): ProcessProject;
27
+ /** @internal */
21
28
  update(id: string, input: UpdateProcessProjectInput): ProcessProject | null;
29
+ /** @internal */
22
30
  getById(id: string): ProcessProject | null;
31
+ /** @internal */
23
32
  getByInstanceAndKey(instanceId: string, key: string): ProcessProject | null;
33
+ /** @internal */
24
34
  listByInstance(instanceId: string): ProcessProject[];
25
35
  }
26
36
 
37
+ /** @internal */
27
38
  export interface ProjectMutationServiceDeps
28
39
  extends Pick<RepositoryBundle, "projects" | "transaction"> {
40
+ /** @internal */
29
41
  broadcaster: Broadcaster;
42
+ /** @internal */
30
43
  onProjectMutated?: (project: ProcessProject) => void;
31
44
  }
32
45
 
46
+ /** @internal */
33
47
  export function buildProjectUpdatedFrame(project: ProcessProject): ProjectUpdatedFrameInput {
34
48
  return {
35
49
  type: "project.updated",
@@ -51,18 +65,24 @@ export function buildProjectUpdatedFrame(project: ProcessProject): ProjectUpdate
51
65
  };
52
66
  }
53
67
 
68
+ /** @internal */
54
69
  export function buildProjectUpdatedEffect(project: ProcessProject): PostCommitEffect {
55
70
  return { kind: "broadcast", frame: buildProjectUpdatedFrame(project) };
56
71
  }
57
72
 
73
+ /** @internal */
58
74
  export function commitProjectCreate(
59
75
  deps: Pick<RepositoryBundle, "projects">,
60
76
  input: CreateProcessProjectInput,
61
- ): ProjectMutationCommit & { project: ProcessProject } {
77
+ ): ProjectMutationCommit & {
78
+ /** @internal */
79
+ project: ProcessProject;
80
+ } {
62
81
  const project = deps.projects.create(input);
63
82
  return { project, effects: [buildProjectUpdatedEffect(project)] };
64
83
  }
65
84
 
85
+ /** @internal */
66
86
  export function commitProjectUpdate(
67
87
  deps: Pick<RepositoryBundle, "projects">,
68
88
  id: string,
@@ -88,6 +108,7 @@ function runProjectMutationPostCommitEffects(
88
108
  );
89
109
  }
90
110
 
111
+ /** @internal */
91
112
  export function createProjectMutationService(
92
113
  deps: ProjectMutationServiceDeps,
93
114
  ): ProjectMutationService {
@@ -8,9 +8,13 @@ import {
8
8
  type ResultImageMimeType,
9
9
  } from "@leitwerk-dev/worker-protocol";
10
10
 
11
+ /** @internal */
11
12
  export interface ResultImageMetadata {
13
+ /** @internal */
12
14
  imageId: string;
15
+ /** @internal */
13
16
  mimeType: ResultImageMimeType;
17
+ /** @internal */
14
18
  byteSize: number;
15
19
  }
16
20
 
@@ -24,9 +28,15 @@ const MIME_BY_EXTENSION: Record<string, ResultImageMimeType> = {
24
28
  jpg: "image/jpeg",
25
29
  webp: "image/webp",
26
30
  };
31
+ /** @internal */
27
32
  export class ResultImageStore {
33
+ /** @internal */
28
34
  readonly rootDir: string;
29
- constructor(input: { rootDir: string }) {
35
+ /** @internal */
36
+ constructor(input: {
37
+ /** @internal */
38
+ rootDir: string;
39
+ }) {
30
40
  this.rootDir = path.resolve(input.rootDir);
31
41
  }
32
42
  private turnDir(instanceId: string, turnRecordId: string): string {
@@ -34,10 +44,15 @@ export class ResultImageStore {
34
44
  throw new Error("Invalid result image storage id");
35
45
  return path.join(this.rootDir, instanceId, turnRecordId);
36
46
  }
47
+ /** @internal */
37
48
  async put(input: {
49
+ /** @internal */
38
50
  instanceId: string;
51
+ /** @internal */
39
52
  turnRecordId: string;
53
+ /** @internal */
40
54
  bytes: Buffer;
55
+ /** @internal */
41
56
  mimeType: ResultImageMimeType;
42
57
  }): Promise<ResultImageMetadata> {
43
58
  const dir = this.turnDir(input.instanceId, input.turnRecordId);
@@ -54,13 +69,17 @@ export class ResultImageStore {
54
69
  }
55
70
  return { imageId, mimeType: input.mimeType, byteSize: input.bytes.length };
56
71
  }
72
+ /** @internal */
57
73
  async deleteProcess(instanceId: string): Promise<void> {
58
74
  if (!isResultImageStorageSegment(instanceId))
59
75
  throw new Error("Invalid result image storage id");
60
76
  await rm(path.join(this.rootDir, instanceId), { recursive: true, force: true });
61
77
  }
78
+ /** @internal */
62
79
  async cleanupProcesses(input: {
80
+ /** @internal */
63
81
  retainedInstanceIds: ReadonlySet<string>;
82
+ /** @internal */
64
83
  expiredInstanceIds?: ReadonlySet<string>;
65
84
  }): Promise<string[]> {
66
85
  let entries: Dirent[];
@@ -83,11 +102,17 @@ export class ResultImageStore {
83
102
  }
84
103
  return removed;
85
104
  }
105
+ /** @internal */
86
106
  async get(
87
107
  instanceId: string,
88
108
  turnRecordId: string,
89
109
  imageId: string,
90
- ): Promise<{ metadata: ResultImageMetadata; bytes: Buffer } | null> {
110
+ ): Promise<{
111
+ /** @internal */
112
+ metadata: ResultImageMetadata;
113
+ /** @internal */
114
+ bytes: Buffer;
115
+ } | null> {
91
116
  const extension = parseResultImageId(imageId)?.extension;
92
117
  if (!extension) return null;
93
118
  try {
@@ -91,6 +91,7 @@ import type { Broadcaster } from "../ws/broadcast.js";
91
91
 
92
92
  export const PRIMARY_PATH_ACTIVE_TURN_EVENT_LIMIT = 500;
93
93
 
94
+ /** @public */
94
95
  export interface RouteDeps
95
96
  extends Pick<
96
97
  RepositoryBundle,
@@ -115,37 +116,66 @@ export interface RouteDeps
115
116
  | "externalWrites"
116
117
  | "transaction"
117
118
  > {
119
+ /** @internal */
118
120
  startupObservations?: RepositoryBundle["startupObservations"];
121
+ /** @public */
119
122
  externalSourceService?: Pick<
120
123
  import("../external-source-service.js").ExternalSourceService,
121
124
  "currentGenerations"
122
125
  >;
126
+ /** @internal */
123
127
  broadcaster: Broadcaster;
128
+ /** @internal */
124
129
  processOperations: ProcessOperationCoordinator;
130
+ /** @internal */
125
131
  processQuestions: ProcessQuestionService;
132
+ /** @internal */
126
133
  toolApprovalGate: ToolApprovalGate;
134
+ /** @internal */
127
135
  processGraphs: ProcessGraphRegistry;
136
+ /** @internal */
128
137
  supervisor?: WorkerSupervisor;
138
+ /** @internal */
129
139
  processEngine: ProcessEngine;
140
+ /** @internal */
130
141
  processDeletion: ProcessDeletionService;
142
+ /** @internal */
131
143
  processActionRegistry?: ProcessActionRegistry;
144
+ /** @internal */
132
145
  processUiRegistry?: ProcessUiRegistry;
146
+ /** @internal */
133
147
  extensionHost?: ExtensionHost;
148
+ /** @internal */
134
149
  launcherService: ProcessLauncherService;
150
+ /** @internal */
135
151
  launchCoordinator: LaunchCoordinator;
152
+ /** @internal */
136
153
  launcherRecentValues: LauncherRecentValuesService;
154
+ /** @internal */
137
155
  launchPlans: ProcessLaunchPlanServiceLike;
156
+ /** @internal */
138
157
  processTitles?: ProcessTitleGenerator;
158
+ /** @internal */
139
159
  toolRenderers?: ReadonlyMap<string, ToolCallRendererDefinition>;
160
+ /** @internal */
140
161
  config?: LeitwerkConfig;
162
+ /** @internal */
141
163
  sessionReader: ProcessSessionReader;
164
+ /** @internal */
142
165
  futureExecutionLifecycle: FutureExecutionLifecycle;
166
+ /** @internal */
143
167
  modelProviderRegistry?: ModelProviderRegistry;
168
+ /** @internal */
144
169
  modelProviderCredentialStatus?: ModelProviderCredentialStatusResolver;
170
+ /** @internal */
145
171
  modelStatusCache: ModelStatusCache;
172
+ /** @internal */
146
173
  processModelPolicy: ServerProcessModelPolicy;
174
+ /** @internal */
147
175
  processModelSelection: ProcessModelSelectionServiceLike;
176
+ /** @internal */
148
177
  skillCatalog?: SkillCatalogService;
178
+ /** @internal */
149
179
  sessionTransferService?: SessionTransferService;
150
180
  }
151
181
 
@@ -6,11 +6,15 @@ import {
6
6
  resolveExtensionUiAssetPath,
7
7
  } from "../extension-ui/catalog.js";
8
8
 
9
+ /** @internal */
9
10
  export interface UiRouteDeps {
11
+ /** @internal */
10
12
  extensionUiCatalog: ExtensionUiCatalog;
13
+ /** @internal */
11
14
  extensionUiAssetCacheControl?: string;
12
15
  }
13
16
 
17
+ /** @internal */
14
18
  export function registerUiRendererRoutes(app: FastifyInstance, deps: UiRouteDeps): void {
15
19
  app.get("/api/ui/extensions", async () => ({
16
20
  ok: true,
@@ -10,7 +10,9 @@ import type {
10
10
  RegisteredProcessWatcherLike,
11
11
  } from "../process-watcher-registry.js";
12
12
 
13
+ /** @internal */
13
14
  export interface WatcherRouteDeps {
15
+ /** @internal */
14
16
  processWatchers?: ProcessWatcherServiceLike;
15
17
  }
16
18
 
@@ -58,6 +60,7 @@ function buildWatcherSummary(watcher: RegisteredProcessWatcherLike): WatcherSumm
58
60
  };
59
61
  }
60
62
 
63
+ /** @internal */
61
64
  export function registerWatcherRoutes(app: FastifyInstance, deps: WatcherRouteDeps): void {
62
65
  app.get("/api/watchers", async () => {
63
66
  const watchers = deps.processWatchers?.listAll() ?? [];
@@ -3,6 +3,7 @@ import type { WorkerInputConsumedPayload } from "@leitwerk-dev/worker-protocol";
3
3
 
4
4
  import { type EntryRefPatch, mergeEntryRefPatchIntoStateJson } from "./entry-ref-patch.js";
5
5
 
6
+ /** @internal */
6
7
  export type ProcessSemanticEntryRefPatch = Partial<
7
8
  Record<ProcessSemanticEntryRefKey, EntryRefPatch[string]>
8
9
  >;
@@ -0,0 +1,150 @@
1
+ import type { FastifyInstance } from "fastify";
2
+ import type { ServerListenOptions, ServerListenResult } from "../app.js";
3
+ import type { LeitwerkConfig } from "../config/index.js";
4
+
5
+ type LifecycleHook = () => void | Promise<void>;
6
+
7
+ /** @internal */
8
+ export async function collectCleanupErrors(operations: Array<() => void | Promise<void>>) {
9
+ const errors: unknown[] = [];
10
+ for (const operation of [...operations].reverse()) {
11
+ try {
12
+ await operation();
13
+ } catch (error) {
14
+ errors.push(error);
15
+ }
16
+ }
17
+ return errors;
18
+ }
19
+
20
+ /** Coordinates one context's listener, startup and shutdown. @internal */
21
+ export function createAppLifecycle(input: {
22
+ app: FastifyInstance;
23
+ server: LeitwerkConfig["server"];
24
+ authEnabled: boolean;
25
+ reconcile(assertOpen: () => void): Promise<void>;
26
+ startHooks: readonly LifecycleHook[];
27
+ preCloseCleanup: LifecycleHook[];
28
+ closeDatabase: LifecycleHook;
29
+ }) {
30
+ const { app } = input;
31
+ let closing = false;
32
+ let closePromise: Promise<void> | undefined;
33
+ let startupOperation: Promise<void> | undefined;
34
+ let startupPromise: Promise<void> | undefined;
35
+ let binding: Required<ServerListenOptions> | undefined;
36
+ let bindOperation: Promise<ServerListenResult> | undefined;
37
+ const cleanupErrors: unknown[] = [];
38
+ function assertOpen() {
39
+ if (closing) throw new Error("AppContext startup interrupted: context is closed");
40
+ }
41
+ function close(): Promise<void> {
42
+ closing = true;
43
+ backgroundServicesReady = false;
44
+ closePromise ??= (async () => {
45
+ await bindOperation?.catch(() => {});
46
+ await startupOperation?.catch(() => {});
47
+ await app.close();
48
+ })();
49
+ return closePromise;
50
+ }
51
+ async function failStartup(error: unknown): Promise<never> {
52
+ try {
53
+ await close();
54
+ } catch (cleanupError) {
55
+ throw new AggregateError([error, cleanupError], "Server startup failed and cleanup failed", {
56
+ cause: error,
57
+ });
58
+ }
59
+ throw error;
60
+ }
61
+ async function listen(options: ServerListenOptions = {}): Promise<ServerListenResult> {
62
+ assertOpen();
63
+ if (binding) {
64
+ for (const key of ["host", "port", "useBoundAddressAsBaseUrl"] as const) {
65
+ if (options[key] !== undefined && options[key] !== binding[key])
66
+ throw new Error(`Conflicting listener option: ${key}`);
67
+ }
68
+ } else {
69
+ if (app.server.listening) throw new Error("Cannot adopt a manually bound listener");
70
+ const requested = {
71
+ host: options.host ?? input.server.host,
72
+ port: options.port ?? input.server.port,
73
+ useBoundAddressAsBaseUrl: options.useBoundAddressAsBaseUrl ?? false,
74
+ };
75
+ if (
76
+ requested.useBoundAddressAsBaseUrl &&
77
+ (input.authEnabled || !["127.0.0.1", "::1", "localhost"].includes(requested.host))
78
+ )
79
+ throw new Error("Bound base URL requires an unauthenticated loopback listener");
80
+ binding = requested;
81
+ bindOperation = (async () => {
82
+ const started = performance.now();
83
+ const address = await app.listen({ host: requested.host, port: requested.port });
84
+ app.log.info(
85
+ { listenDurationMs: Math.round((performance.now() - started) * 10) / 10 },
86
+ "Server HTTP listener ready",
87
+ );
88
+ const info = app.server.address();
89
+ if (!info || typeof info === "string") throw new Error("Expected TCP listener address");
90
+ if (requested.useBoundAddressAsBaseUrl) input.server.base_url = address;
91
+ return { address, port: info.port };
92
+ })();
93
+ }
94
+ let result: ServerListenResult;
95
+ try {
96
+ if (!bindOperation) throw new Error("Listener was not initialized");
97
+ result = await bindOperation;
98
+ } catch (error) {
99
+ return failStartup(error);
100
+ }
101
+ await startServices();
102
+ assertOpen();
103
+ return result;
104
+ }
105
+ function startServices(): Promise<void> {
106
+ if (closing)
107
+ return Promise.reject(new Error("AppContext startup interrupted: context is closed"));
108
+ if (startupPromise) return startupPromise;
109
+ startupOperation = (async () => {
110
+ await bindOperation;
111
+ assertOpen();
112
+ await input.reconcile(assertOpen);
113
+ for (const hook of input.startHooks) {
114
+ assertOpen();
115
+ await hook();
116
+ }
117
+ assertOpen();
118
+ backgroundServicesReady = true;
119
+ })();
120
+ // Cleanup waits on the raw operation, not this promise that itself awaits close().
121
+ startupPromise = startupOperation.catch(failStartup);
122
+ return startupPromise;
123
+ }
124
+ let backgroundServicesReady = false;
125
+ let cleanupOperation: Promise<void> | undefined;
126
+ function cleanup() {
127
+ closing = true;
128
+ backgroundServicesReady = false;
129
+ cleanupOperation ??= (async () => {
130
+ await startupOperation?.catch(() => {});
131
+ // Stop services and workers before connection teardown; retain SQLite for onClose.
132
+ cleanupErrors.push(...(await collectCleanupErrors(input.preCloseCleanup.splice(0))));
133
+ })();
134
+ return cleanupOperation;
135
+ }
136
+ app.addHook("preClose", cleanup);
137
+ async function finishCleanup() {
138
+ await cleanup();
139
+ cleanupErrors.push(...(await collectCleanupErrors([input.closeDatabase])));
140
+ if (cleanupErrors.length) throw new AggregateError(cleanupErrors, "AppContext cleanup failed");
141
+ }
142
+
143
+ return {
144
+ listen,
145
+ close,
146
+ isReady: () => backgroundServicesReady,
147
+ isClosing: () => closing,
148
+ finishCleanup,
149
+ };
150
+ }
@@ -1,7 +1,7 @@
1
1
  import { readFileSync } from "node:fs";
2
2
  import type { LeitwerkConfig } from "./config/config-types.js";
3
3
 
4
- /** Reads a file's UTF-8 contents. Injected so the pure logic stays testable. */
4
+ /** Reads a file's UTF-8 contents. Injected so the pure logic stays testable. @internal */
5
5
  export type FileReader = (path: string) => string;
6
6
 
7
7
  const defaultFileReader: FileReader = (path) => readFileSync(path, "utf8");
@@ -14,11 +14,17 @@ const defaultFileReader: FileReader = (path) => readFileSync(path, "utf8");
14
14
  * verification. Config validation currently rejects `internal_tls.client_ca_file`
15
15
  * until workers receive client cert/key material.
16
16
  */
17
+ /** @internal */
17
18
  export interface ServerTlsOptions {
19
+ /** @internal */
18
20
  cert: string;
21
+ /** @internal */
19
22
  key: string;
23
+ /** @internal */
20
24
  ca?: string;
25
+ /** @internal */
21
26
  requestCert: boolean;
27
+ /** @internal */
22
28
  rejectUnauthorized: boolean;
23
29
  }
24
30
 
@@ -32,6 +38,7 @@ export interface ServerTlsOptions {
32
38
  * verification is intentionally not configurable yet because workers do not
33
39
  * receive client cert/key material.
34
40
  */
41
+ /** @internal */
35
42
  export function resolveServerTlsOptions(
36
43
  config: LeitwerkConfig,
37
44
  readFile: FileReader = defaultFileReader,
@@ -53,9 +53,13 @@ function sameManifestAuthority(
53
53
  return JSON.stringify(manifestAuthority(expected)) === JSON.stringify(manifestAuthority(actual));
54
54
  }
55
55
 
56
+ /** @internal */
56
57
  export function createSessionTransferHelperRelays(deps: {
58
+ /** @internal */
57
59
  repos: Pick<RepositoryBundle, "sessionTransfers">;
60
+ /** @internal */
58
61
  limits: SessionTransferLimits;
62
+ /** @internal */
59
63
  now?: () => Date;
60
64
  }) {
61
65
  const now = deps.now ?? (() => new Date());
@@ -83,8 +87,11 @@ export function createSessionTransferHelperRelays(deps: {
83
87
  }
84
88
 
85
89
  return {
90
+ /** @internal */
86
91
  create(input: {
92
+ /** @internal */
87
93
  instanceId: string;
94
+ /** @internal */
88
95
  manifest: LeitwerkTransferManifestV1;
89
96
  }): ProcessStateExportHelperRelay {
90
97
  const attempt = deps.repos.sessionTransfers.getActiveByInstance(input.instanceId);
@@ -128,20 +135,30 @@ export function createSessionTransferHelperRelays(deps: {
128
135
  fail: runtime.fail,
129
136
  };
130
137
  },
138
+ /** @internal */
131
139
  sweep(): void {
132
140
  const currentTime = now().getTime();
133
141
  for (const helper of helpers.values()) {
134
142
  if (helper.expiresAt <= currentTime) helper.fail(new Error("export_helper_expired"));
135
143
  }
136
144
  },
145
+ /** @internal */
137
146
  stop(): void {
138
147
  for (const helper of helpers.values()) helper.fail(new Error("server_stopping"));
139
148
  helpers.clear();
140
149
  },
150
+ /** @internal */
141
151
  helperSpec(input: {
152
+ /** @internal */
142
153
  exportId: string;
154
+ /** @internal */
143
155
  credential: string;
144
- }): { manifest: LeitwerkTransferManifestV1; limits: SessionTransferLimits } | null {
156
+ }): {
157
+ /** @internal */
158
+ manifest: LeitwerkTransferManifestV1;
159
+ /** @internal */
160
+ limits: SessionTransferLimits;
161
+ } | null {
145
162
  const helper = active(input.exportId, input.credential);
146
163
  if (!helper || helper.reported || helper.streamAccepted) return null;
147
164
  const attempt = deps.repos.sessionTransfers.getAttempt(helper.attemptId);
@@ -153,10 +170,15 @@ export function createSessionTransferHelperRelays(deps: {
153
170
  limits: { ...deps.limits },
154
171
  };
155
172
  },
173
+ /** @internal */
156
174
  async reportHelperPreflight(input: {
175
+ /** @internal */
157
176
  exportId: string;
177
+ /** @internal */
158
178
  credential: string;
179
+ /** @internal */
159
180
  report: unknown;
181
+ /** @internal */
160
182
  signal?: AbortSignal;
161
183
  }): Promise<boolean> {
162
184
  const helper = active(input.exportId, input.credential);
@@ -184,7 +206,15 @@ export function createSessionTransferHelperRelays(deps: {
184
206
  return false;
185
207
  }
186
208
  },
187
- acceptHelperStream(input: { exportId: string; credential: string; stream: Readable }): boolean {
209
+ /** @internal */
210
+ acceptHelperStream(input: {
211
+ /** @internal */
212
+ exportId: string;
213
+ /** @internal */
214
+ credential: string;
215
+ /** @internal */
216
+ stream: Readable;
217
+ }): boolean {
188
218
  const helper = active(input.exportId, input.credential);
189
219
  if (!helper?.reported || helper.streamAccepted) return false;
190
220
  const attempt = deps.repos.sessionTransfers.getAttempt(helper.attemptId);
@@ -198,4 +228,5 @@ export function createSessionTransferHelperRelays(deps: {
198
228
  };
199
229
  }
200
230
 
231
+ /** @internal */
201
232
  export type SessionTransferHelperRelays = ReturnType<typeof createSessionTransferHelperRelays>;