@leitwerk-dev/server 0.3.0 → 0.4.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 (355) hide show
  1. package/dist/{app-WfwKzrVk.d.ts → app-CsuxFZT5.d.ts} +332 -111
  2. package/dist/app-JM4CBTND.js +8 -0
  3. package/dist/app.d.ts +9 -0
  4. package/dist/app.d.ts.map +1 -1
  5. package/dist/auth/fastify-auth.d.ts +9 -0
  6. package/dist/auth/fastify-auth.d.ts.map +1 -1
  7. package/dist/{chunk-LK3RO6C7.js → chunk-FPMDWQF7.js} +3050 -645
  8. package/dist/chunk-FPMDWQF7.js.map +1 -0
  9. package/dist/{chunk-KIOQNNG6.js → chunk-MBHRCQFE.js} +2781 -1822
  10. package/dist/chunk-MBHRCQFE.js.map +1 -0
  11. package/dist/config/config-loader.d.ts +1 -1
  12. package/dist/config/config-loader.d.ts.map +1 -1
  13. package/dist/config/config-types.d.ts +14 -1
  14. package/dist/config/config-types.d.ts.map +1 -1
  15. package/dist/config/kubernetes-docker-isolation.d.ts +7 -0
  16. package/dist/config/kubernetes-docker-isolation.d.ts.map +1 -0
  17. package/dist/db/database.d.ts.map +1 -1
  18. package/dist/db/execution-inspection-repo.d.ts +15 -0
  19. package/dist/db/execution-inspection-repo.d.ts.map +1 -0
  20. package/dist/db/history-window.d.ts +11 -0
  21. package/dist/db/history-window.d.ts.map +1 -0
  22. package/dist/db/mapped-llm-run-repo.d.ts +56 -0
  23. package/dist/db/mapped-llm-run-repo.d.ts.map +1 -0
  24. package/dist/db/process-event-repo.d.ts +2 -0
  25. package/dist/db/process-event-repo.d.ts.map +1 -1
  26. package/dist/db/process-instance-repo.d.ts +4 -1
  27. package/dist/db/process-instance-repo.d.ts.map +1 -1
  28. package/dist/db/process-leaf-outcome-snapshot-repo.d.ts +2 -1
  29. package/dist/db/process-leaf-outcome-snapshot-repo.d.ts.map +1 -1
  30. package/dist/db/process-project-repo.d.ts +2 -0
  31. package/dist/db/process-project-repo.d.ts.map +1 -1
  32. package/dist/db/process-skill-repo.d.ts.map +1 -1
  33. package/dist/db/process-turn-annotation-repo.d.ts +4 -1
  34. package/dist/db/process-turn-annotation-repo.d.ts.map +1 -1
  35. package/dist/db/process-turn-record-repo.d.ts +7 -1
  36. package/dist/db/process-turn-record-repo.d.ts.map +1 -1
  37. package/dist/db/publication-repo.d.ts +5 -0
  38. package/dist/db/publication-repo.d.ts.map +1 -0
  39. package/dist/db/repo-helpers.d.ts +6 -0
  40. package/dist/db/repo-helpers.d.ts.map +1 -1
  41. package/dist/db/repositories.d.ts +16 -0
  42. package/dist/db/repositories.d.ts.map +1 -1
  43. package/dist/db/schema.d.ts +1177 -71
  44. package/dist/db/schema.d.ts.map +1 -1
  45. package/dist/db/scoped-settings-repo.d.ts +37 -0
  46. package/dist/db/scoped-settings-repo.d.ts.map +1 -0
  47. package/dist/db/skill-repo.d.ts +3 -0
  48. package/dist/db/skill-repo.d.ts.map +1 -1
  49. package/dist/db/turn-start-record-repo.d.ts +2 -1
  50. package/dist/db/turn-start-record-repo.d.ts.map +1 -1
  51. package/dist/db/turn-summary-repo.d.ts +1 -1
  52. package/dist/db/turn-summary-repo.d.ts.map +1 -1
  53. package/dist/db/worker-lease-repo.d.ts +2 -1
  54. package/dist/db/worker-lease-repo.d.ts.map +1 -1
  55. package/dist/domain-logic/outcome-tools.d.ts.map +1 -1
  56. package/dist/external-source-service.d.ts.map +1 -1
  57. package/dist/future-execution/execution.d.ts +4 -1
  58. package/dist/future-execution/execution.d.ts.map +1 -1
  59. package/dist/future-execution/launch-lifecycle.d.ts +9 -25
  60. package/dist/future-execution/launch-lifecycle.d.ts.map +1 -1
  61. package/dist/future-execution/lifecycle.d.ts +3 -28
  62. package/dist/future-execution/lifecycle.d.ts.map +1 -1
  63. package/dist/future-execution/model-projection.d.ts.map +1 -1
  64. package/dist/future-execution/reconciliation.d.ts +1 -0
  65. package/dist/future-execution/reconciliation.d.ts.map +1 -1
  66. package/dist/future-execution-presenter.d.ts +4 -14
  67. package/dist/future-execution-presenter.d.ts.map +1 -1
  68. package/dist/index.js +2 -2
  69. package/dist/integration-tool-registry.d.ts +11 -2
  70. package/dist/integration-tool-registry.d.ts.map +1 -1
  71. package/dist/launch-coordinator-test-harness.d.ts.map +1 -1
  72. package/dist/launch-coordinator.d.ts.map +1 -1
  73. package/dist/launcher-model-config-service.d.ts +7 -1
  74. package/dist/launcher-model-config-service.d.ts.map +1 -1
  75. package/dist/leaf-outcome-snapshot-capture.d.ts +1 -0
  76. package/dist/leaf-outcome-snapshot-capture.d.ts.map +1 -1
  77. package/dist/main.js +3 -3
  78. package/dist/primary-path-snapshot.d.ts.map +1 -1
  79. package/dist/process-action-presenter.d.ts +11 -0
  80. package/dist/process-action-presenter.d.ts.map +1 -0
  81. package/dist/process-action-registry.d.ts.map +1 -1
  82. package/dist/process-engine/decision.d.ts +2 -0
  83. package/dist/process-engine/decision.d.ts.map +1 -1
  84. package/dist/process-engine/engine.d.ts.map +1 -1
  85. package/dist/process-engine/mapped-turns.d.ts +45 -0
  86. package/dist/process-engine/mapped-turns.d.ts.map +1 -0
  87. package/dist/process-engine/operation.d.ts +1 -1
  88. package/dist/process-engine/operation.d.ts.map +1 -1
  89. package/dist/process-engine/ops/accept-worker-turn-start.d.ts +2 -0
  90. package/dist/process-engine/ops/accept-worker-turn-start.d.ts.map +1 -1
  91. package/dist/process-engine/ops/continue-failed-turn.d.ts.map +1 -1
  92. package/dist/process-engine/ops/process-observation.d.ts +6 -0
  93. package/dist/process-engine/ops/process-observation.d.ts.map +1 -0
  94. package/dist/process-engine/ops/retry-failed-turn.d.ts.map +1 -1
  95. package/dist/process-engine/ops/retry-startup.d.ts.map +1 -1
  96. package/dist/process-engine/ops/start-process.d.ts +2 -0
  97. package/dist/process-engine/ops/start-process.d.ts.map +1 -1
  98. package/dist/process-engine/ops/turn-outcome.d.ts.map +1 -1
  99. package/dist/process-engine/ops/turn-wait.d.ts +30 -0
  100. package/dist/process-engine/ops/turn-wait.d.ts.map +1 -0
  101. package/dist/process-engine/ops/update-model-config.d.ts +9 -0
  102. package/dist/process-engine/ops/update-model-config.d.ts.map +1 -0
  103. package/dist/process-engine/recorder.d.ts.map +1 -1
  104. package/dist/process-engine/turn-start-preflight.d.ts +6 -0
  105. package/dist/process-engine/turn-start-preflight.d.ts.map +1 -1
  106. package/dist/process-engine/turn-wait-state.d.ts +24 -0
  107. package/dist/process-engine/turn-wait-state.d.ts.map +1 -0
  108. package/dist/process-engine/turn-worker-requirement.d.ts +2 -0
  109. package/dist/process-engine/turn-worker-requirement.d.ts.map +1 -1
  110. package/dist/process-engine/types.d.ts +10 -1
  111. package/dist/process-engine/types.d.ts.map +1 -1
  112. package/dist/process-engine/writes/build-process-abort-writes.d.ts +3 -1
  113. package/dist/process-engine/writes/build-process-abort-writes.d.ts.map +1 -1
  114. package/dist/process-engine/writes/build-recovery-start-writes.d.ts.map +1 -1
  115. package/dist/process-engine/writes/build-turn-outcome-writes.d.ts +10 -1
  116. package/dist/process-engine/writes/build-turn-outcome-writes.d.ts.map +1 -1
  117. package/dist/process-engine/writes/build-turn-selection-writes.d.ts.map +1 -1
  118. package/dist/process-engine/writes/commit-writes.d.ts +2 -0
  119. package/dist/process-engine/writes/commit-writes.d.ts.map +1 -1
  120. package/dist/process-engine/writes/reserve-selected-turn-start.d.ts +5 -0
  121. package/dist/process-engine/writes/reserve-selected-turn-start.d.ts.map +1 -0
  122. package/dist/process-engine/writes/writes.d.ts +35 -49
  123. package/dist/process-engine/writes/writes.d.ts.map +1 -1
  124. package/dist/process-graph.d.ts +1 -1
  125. package/dist/process-graph.d.ts.map +1 -1
  126. package/dist/process-inspection-reader.d.ts +21 -0
  127. package/dist/process-inspection-reader.d.ts.map +1 -0
  128. package/dist/process-inspection-trace.d.ts +13 -0
  129. package/dist/process-inspection-trace.d.ts.map +1 -0
  130. package/dist/process-inspection.d.ts +22 -0
  131. package/dist/process-inspection.d.ts.map +1 -0
  132. package/dist/process-instance-tree-presenter.d.ts +4 -3
  133. package/dist/process-instance-tree-presenter.d.ts.map +1 -1
  134. package/dist/process-launch-executor.d.ts +2 -0
  135. package/dist/process-launch-executor.d.ts.map +1 -1
  136. package/dist/process-launch-plan.d.ts +1 -0
  137. package/dist/process-launch-plan.d.ts.map +1 -1
  138. package/dist/process-launcher-registry.d.ts.map +1 -1
  139. package/dist/process-model-config.d.ts +19 -0
  140. package/dist/process-model-config.d.ts.map +1 -0
  141. package/dist/process-model-policy/construct.d.ts.map +1 -1
  142. package/dist/process-model-policy/evaluate.d.ts.map +1 -1
  143. package/dist/process-model-policy/index.d.ts +4 -1
  144. package/dist/process-model-policy/index.d.ts.map +1 -1
  145. package/dist/process-model-policy/project.d.ts.map +1 -1
  146. package/dist/process-model-policy/types.d.ts +18 -0
  147. package/dist/process-model-policy/types.d.ts.map +1 -1
  148. package/dist/process-model-policy-presenter.d.ts.map +1 -1
  149. package/dist/process-runtime-availability.d.ts +2 -1
  150. package/dist/process-runtime-availability.d.ts.map +1 -1
  151. package/dist/process-turn-navigation.d.ts +12 -2
  152. package/dist/process-turn-navigation.d.ts.map +1 -1
  153. package/dist/process-turn-trace.d.ts.map +1 -1
  154. package/dist/process-ui-snapshot-presenter.d.ts +15 -3
  155. package/dist/process-ui-snapshot-presenter.d.ts.map +1 -1
  156. package/dist/routes/future-executions.d.ts.map +1 -1
  157. package/dist/routes/launchers.d.ts.map +1 -1
  158. package/dist/routes/process-actions.d.ts.map +1 -1
  159. package/dist/routes/process-detail.d.ts.map +1 -1
  160. package/dist/routes/process-diagnostics-assembler.d.ts +3 -1
  161. package/dist/routes/process-diagnostics-assembler.d.ts.map +1 -1
  162. package/dist/routes/process-model-config.d.ts +4 -0
  163. package/dist/routes/process-model-config.d.ts.map +1 -0
  164. package/dist/routes/process-primary-path-assembler.d.ts +4 -12
  165. package/dist/routes/process-primary-path-assembler.d.ts.map +1 -1
  166. package/dist/routes/process-route-helpers.d.ts +15 -41
  167. package/dist/routes/process-route-helpers.d.ts.map +1 -1
  168. package/dist/routes/processes.d.ts.map +1 -1
  169. package/dist/routes/settings.d.ts +11 -0
  170. package/dist/routes/settings.d.ts.map +1 -0
  171. package/dist/routes/ticket-creation.d.ts.map +1 -1
  172. package/dist/scoped-settings-service.d.ts +83 -0
  173. package/dist/scoped-settings-service.d.ts.map +1 -0
  174. package/dist/server-bootstrap/build-host-capabilities.d.ts +2 -0
  175. package/dist/server-bootstrap/build-host-capabilities.d.ts.map +1 -1
  176. package/dist/server-bootstrap/register-http.d.ts.map +1 -1
  177. package/dist/session-summary-projection.d.ts.map +1 -1
  178. package/dist/skills/bundled-skills.d.ts +5 -0
  179. package/dist/skills/bundled-skills.d.ts.map +1 -0
  180. package/dist/skills/catalog-service.d.ts +1 -0
  181. package/dist/skills/catalog-service.d.ts.map +1 -1
  182. package/dist/skills/extension-importer.d.ts +11 -0
  183. package/dist/skills/extension-importer.d.ts.map +1 -0
  184. package/dist/skills/launch-skills.d.ts +11 -0
  185. package/dist/skills/launch-skills.d.ts.map +1 -0
  186. package/dist/skills/skill-frontmatter.d.ts +5 -0
  187. package/dist/skills/skill-frontmatter.d.ts.map +1 -1
  188. package/dist/skills/source-importer.d.ts +3 -0
  189. package/dist/skills/source-importer.d.ts.map +1 -1
  190. package/dist/startup-evidence.d.ts +3 -0
  191. package/dist/startup-evidence.d.ts.map +1 -1
  192. package/dist/supervisor/execution-inspection-ingestor.d.ts +9 -0
  193. package/dist/supervisor/execution-inspection-ingestor.d.ts.map +1 -0
  194. package/dist/supervisor/ipc-handler.d.ts +2 -0
  195. package/dist/supervisor/ipc-handler.d.ts.map +1 -1
  196. package/dist/supervisor/worker-event-ingestor.d.ts +1 -0
  197. package/dist/supervisor/worker-event-ingestor.d.ts.map +1 -1
  198. package/dist/supervisor/worker-start-payload-builder.d.ts +2 -0
  199. package/dist/supervisor/worker-start-payload-builder.d.ts.map +1 -1
  200. package/dist/supervisor/worker-supervisor.d.ts +4 -0
  201. package/dist/supervisor/worker-supervisor.d.ts.map +1 -1
  202. package/dist/supervisor/worker-turn-ipc-recorder.d.ts +2 -2
  203. package/dist/supervisor/worker-turn-ipc-recorder.d.ts.map +1 -1
  204. package/dist/test-helpers/accepted-turn-start.d.ts +18 -4
  205. package/dist/test-helpers/accepted-turn-start.d.ts.map +1 -1
  206. package/dist/test-helpers/owned-test-deps.d.ts +18 -0
  207. package/dist/test-helpers/owned-test-deps.d.ts.map +1 -0
  208. package/dist/test-helpers/prepared-fixture-start.d.ts.map +1 -1
  209. package/dist/test-helpers/process-model-fixtures.d.ts +1 -0
  210. package/dist/test-helpers/process-model-fixtures.d.ts.map +1 -1
  211. package/dist/test-helpers/scoped-settings-fixtures.d.ts +16 -0
  212. package/dist/test-helpers/scoped-settings-fixtures.d.ts.map +1 -0
  213. package/dist/test-helpers/skill-fixtures.d.ts +4 -0
  214. package/dist/test-helpers/skill-fixtures.d.ts.map +1 -0
  215. package/dist/testing.d.ts +1 -1
  216. package/dist/testing.d.ts.map +1 -1
  217. package/dist/testing.js +14 -10
  218. package/dist/testing.js.map +1 -1
  219. package/dist/tool-approval-gate.d.ts +3 -0
  220. package/dist/tool-approval-gate.d.ts.map +1 -1
  221. package/dist/turn-progress.d.ts.map +1 -1
  222. package/dist/turn-wait-service.d.ts +28 -0
  223. package/dist/turn-wait-service.d.ts.map +1 -0
  224. package/dist/worker-runtime-profile-selection.d.ts +2 -0
  225. package/dist/worker-runtime-profile-selection.d.ts.map +1 -1
  226. package/package.json +20 -19
  227. package/src/app.ts +117 -5
  228. package/src/auth/fastify-auth.ts +13 -0
  229. package/src/config/config-loader.ts +40 -2
  230. package/src/config/config-types.ts +14 -1
  231. package/src/config/kubernetes-docker-isolation.ts +21 -0
  232. package/src/db/database.ts +159 -40
  233. package/src/db/execution-inspection-repo.ts +163 -0
  234. package/src/db/history-window.ts +18 -0
  235. package/src/db/mapped-llm-run-repo.ts +177 -0
  236. package/src/db/process-event-repo.ts +88 -10
  237. package/src/db/process-instance-repo.ts +9 -2
  238. package/src/db/process-leaf-outcome-snapshot-repo.ts +8 -2
  239. package/src/db/process-project-repo.ts +4 -0
  240. package/src/db/process-skill-repo.ts +9 -2
  241. package/src/db/process-turn-annotation-repo.ts +27 -9
  242. package/src/db/process-turn-record-repo.ts +53 -13
  243. package/src/db/publication-repo.ts +63 -0
  244. package/src/db/repo-helpers.ts +11 -1
  245. package/src/db/repositories.ts +22 -0
  246. package/src/db/schema.ts +173 -2
  247. package/src/db/scoped-settings-repo.ts +234 -0
  248. package/src/db/skill-repo.ts +89 -27
  249. package/src/db/turn-start-record-repo.ts +13 -3
  250. package/src/db/turn-summary-repo.ts +12 -3
  251. package/src/db/worker-lease-repo.ts +8 -2
  252. package/src/domain-logic/outcome-tools.ts +4 -149
  253. package/src/external-source-service.ts +33 -7
  254. package/src/future-execution/execution.ts +9 -2
  255. package/src/future-execution/launch-lifecycle.ts +87 -78
  256. package/src/future-execution/lifecycle.ts +5 -34
  257. package/src/future-execution/model-projection.ts +2 -0
  258. package/src/future-execution/reconciliation.ts +7 -0
  259. package/src/future-execution-presenter.ts +14 -22
  260. package/src/integration-tool-registry.ts +59 -26
  261. package/src/launch-coordinator-test-harness.ts +8 -4
  262. package/src/launch-coordinator.ts +10 -1
  263. package/src/launcher-model-config-service.ts +24 -3
  264. package/src/leaf-outcome-snapshot-capture.ts +2 -0
  265. package/src/primary-path-snapshot.ts +3 -4
  266. package/src/process-action-presenter.ts +98 -0
  267. package/src/process-action-registry.ts +31 -39
  268. package/src/process-engine/decision.ts +10 -0
  269. package/src/process-engine/engine.ts +13 -4
  270. package/src/process-engine/mapped-turns.ts +328 -0
  271. package/src/process-engine/operation.ts +1 -1
  272. package/src/process-engine/ops/accept-worker-turn-start.ts +6 -0
  273. package/src/process-engine/ops/continue-failed-turn.ts +2 -13
  274. package/src/process-engine/ops/process-observation.ts +119 -0
  275. package/src/process-engine/ops/retry-failed-turn.ts +2 -12
  276. package/src/process-engine/ops/retry-startup.ts +10 -13
  277. package/src/process-engine/ops/start-process.ts +34 -2
  278. package/src/process-engine/ops/turn-outcome.ts +65 -62
  279. package/src/process-engine/ops/turn-wait.ts +225 -0
  280. package/src/process-engine/ops/update-model-config.ts +66 -0
  281. package/src/process-engine/recorder.ts +33 -5
  282. package/src/process-engine/runner.ts +8 -8
  283. package/src/process-engine/turn-start-preflight.ts +168 -105
  284. package/src/process-engine/turn-wait-state.ts +126 -0
  285. package/src/process-engine/turn-worker-requirement.ts +4 -0
  286. package/src/process-engine/types.ts +15 -0
  287. package/src/process-engine/writes/build-process-abort-writes.ts +30 -19
  288. package/src/process-engine/writes/build-recovery-start-writes.ts +1 -0
  289. package/src/process-engine/writes/build-turn-outcome-writes.ts +118 -21
  290. package/src/process-engine/writes/build-turn-selection-writes.ts +2 -31
  291. package/src/process-engine/writes/commit-writes.ts +20 -2
  292. package/src/process-engine/writes/reserve-selected-turn-start.ts +44 -0
  293. package/src/process-engine/writes/writes.ts +73 -61
  294. package/src/process-graph.ts +0 -1
  295. package/src/process-inspection-reader.ts +305 -0
  296. package/src/process-inspection-trace.ts +176 -0
  297. package/src/process-inspection.ts +169 -0
  298. package/src/process-instance-tree-presenter.ts +56 -216
  299. package/src/process-launch-executor.ts +5 -2
  300. package/src/process-launch-plan.ts +17 -2
  301. package/src/process-launcher-registry.ts +28 -16
  302. package/src/process-model-config.ts +100 -0
  303. package/src/process-model-policy/construct.ts +1 -0
  304. package/src/process-model-policy/evaluate.ts +34 -32
  305. package/src/process-model-policy/index.ts +45 -3
  306. package/src/process-model-policy/project.ts +62 -76
  307. package/src/process-model-policy/types.ts +26 -0
  308. package/src/process-model-policy-presenter.ts +7 -3
  309. package/src/process-runtime-availability.ts +9 -4
  310. package/src/process-turn-navigation.ts +86 -8
  311. package/src/process-turn-trace.ts +12 -24
  312. package/src/process-ui-snapshot-presenter.ts +249 -298
  313. package/src/routes/future-executions.ts +5 -5
  314. package/src/routes/launchers.ts +51 -1
  315. package/src/routes/process-actions.ts +10 -10
  316. package/src/routes/process-detail.ts +25 -2
  317. package/src/routes/process-diagnostics-assembler.ts +32 -6
  318. package/src/routes/process-model-config.ts +70 -0
  319. package/src/routes/process-primary-path-assembler.ts +17 -33
  320. package/src/routes/process-route-helpers.ts +161 -327
  321. package/src/routes/processes.ts +2 -0
  322. package/src/routes/settings.ts +173 -0
  323. package/src/routes/ticket-creation.ts +28 -5
  324. package/src/scoped-settings-service.ts +736 -0
  325. package/src/server-bootstrap/build-host-capabilities.ts +42 -0
  326. package/src/server-bootstrap/register-http.ts +7 -1
  327. package/src/session-summary-projection.ts +1 -2
  328. package/src/skills/bundled-skills.ts +64 -0
  329. package/src/skills/catalog-service.ts +35 -6
  330. package/src/skills/extension-importer.ts +97 -0
  331. package/src/skills/launch-skills.ts +19 -0
  332. package/src/skills/skill-frontmatter.ts +13 -0
  333. package/src/skills/source-importer.ts +3 -0
  334. package/src/startup-evidence.ts +20 -0
  335. package/src/supervisor/execution-inspection-ingestor.ts +55 -0
  336. package/src/supervisor/ipc-handler.ts +29 -18
  337. package/src/supervisor/worker-event-ingestor.ts +30 -14
  338. package/src/supervisor/worker-start-payload-builder.ts +42 -0
  339. package/src/supervisor/worker-supervisor.ts +5 -0
  340. package/src/supervisor/worker-turn-ipc-recorder.ts +13 -1
  341. package/src/test-helpers/accepted-turn-start.ts +51 -27
  342. package/src/test-helpers/owned-test-deps.ts +45 -0
  343. package/src/test-helpers/prepared-fixture-start.ts +1 -0
  344. package/src/test-helpers/process-model-fixtures.ts +2 -0
  345. package/src/test-helpers/scoped-settings-fixtures.ts +126 -0
  346. package/src/test-helpers/skill-fixtures.ts +28 -0
  347. package/src/testing.ts +4 -1
  348. package/src/tool-approval-gate.ts +16 -0
  349. package/src/turn-progress.ts +3 -2
  350. package/src/turn-wait-service.ts +228 -0
  351. package/src/worker-runtime-profile-selection.ts +8 -1
  352. package/dist/app-4QSV4FUQ.js +0 -8
  353. package/dist/chunk-KIOQNNG6.js.map +0 -1
  354. package/dist/chunk-LK3RO6C7.js.map +0 -1
  355. /package/dist/{app-4QSV4FUQ.js.map → app-JM4CBTND.js.map} +0 -0
@@ -1,4 +1,5 @@
1
1
  import {
2
+ isUnknownRecord,
2
3
  normalizeLaunchModelConfigInput,
3
4
  type ProcessEvent,
4
5
  type ProcessInstance,
@@ -8,9 +9,7 @@ import {
8
9
  } from "@leitwerk-dev/domain";
9
10
  import type { ProcessModelSelectionServiceLike } from "@leitwerk-dev/process-sdk";
10
11
  import {
11
- type FormDefinition,
12
12
  findUiLauncherById,
13
- isLlmTurnDefinition,
14
13
  type OutcomeToolParameterSpec,
15
14
  type ProcessLauncherService,
16
15
  type ProcessLaunchPlanServiceLike,
@@ -21,20 +20,13 @@ import {
21
20
  resolveProcessPiConfig,
22
21
  resolveTurnActiveToolNames,
23
22
  } from "@leitwerk-dev/process-sdk/pi-config";
24
- import {
25
- parseActionRequestBody,
26
- parseLauncherInputJson,
27
- parseLauncherRequestBody,
28
- } from "@leitwerk-dev/protocol";
23
+ import { parseLauncherInputJson, parseLauncherRequestBody } from "@leitwerk-dev/protocol";
29
24
  import type {
30
25
  LauncherModelConfigSchema,
31
26
  LauncherMutationResponseBody,
32
- ProcessActionPreviewSummary,
33
- ProcessActionSummary,
34
27
  ProcessLaunchConfigurationView,
35
28
  ProcessRunDetailsView,
36
29
  ProcessRunTurnView,
37
- ScheduledActionDetail,
38
30
  ScheduledActionMutationResponseBody,
39
31
  } from "@leitwerk-dev/protocol/http-contracts";
40
32
  import type { ToolCallRendererDefinition } from "@leitwerk-dev/protocol/tool-renderer-contract";
@@ -48,12 +40,11 @@ import type {
48
40
  ActionMutationOutcome,
49
41
  FutureExecutionLifecycle,
50
42
  LaunchMutationOutcome,
51
- NormalizedScheduledActionInput,
52
43
  NormalizedScheduledLaunchInput,
53
44
  } from "../future-execution/index.js";
54
45
  import {
55
46
  buildFutureExecutionListView,
56
- getScheduledActionDetailForProcess as getPresentedScheduledActionDetailForProcess,
47
+ getScheduledActionDetailForProcess,
57
48
  } from "../future-execution-presenter.js";
58
49
  import type { LaunchCoordinator } from "../launch-coordinator.js";
59
50
  import { normalizeSubmittedProcessTitle } from "../launch-title.js";
@@ -74,11 +65,7 @@ import { getProcessGraph, type ProcessGraphRegistry } from "../process-graph.js"
74
65
  import type { ServerProcessModelPolicy } from "../process-model-policy/index.js";
75
66
  import { presentLauncherModelConfigSchema } from "../process-model-policy-presenter.js";
76
67
  import type { ProcessOperationCoordinator } from "../process-operation-coordinator.js";
77
- import {
78
- getSelectedTurnSummaryForProcess,
79
- listCurrentVisibleActions,
80
- listVisibleActionsForProcess as listVisibleAttentionActionsForProcess,
81
- } from "../process-operator-attention.js";
68
+ import { getSelectedTurnSummaryForProcess } from "../process-operator-attention.js";
82
69
  import type { ProcessQuestionService } from "../process-question-service.js";
83
70
  import type { ProcessSessionReader } from "../process-session-store.js";
84
71
  import type { ProcessTitleGenerator } from "../process-title-generator.js";
@@ -101,6 +88,7 @@ export interface RouteDeps
101
88
  | "inputs"
102
89
  | "events"
103
90
  | "turnSummaries"
91
+ | "executionInspections"
104
92
  | "futureExecutions"
105
93
  | "skills"
106
94
  | "processSkills"
@@ -117,6 +105,14 @@ export interface RouteDeps
117
105
  | "transaction"
118
106
  > {
119
107
  /** @internal */
108
+ scopedSettingsService?: import("../scoped-settings-service.js").ScopedSettingsService;
109
+ /** @internal */
110
+ topicWiki?: RepositoryBundle["topicWiki"];
111
+ /** @internal */
112
+ onSettingsChanged?: () => Promise<void>;
113
+ /** @internal */
114
+ mappedRuns?: RepositoryBundle["mappedRuns"];
115
+ /** @internal */
120
116
  startupObservations?: RepositoryBundle["startupObservations"];
121
117
  /** @public */
122
118
  externalSourceService?: Pick<
@@ -179,10 +175,20 @@ export interface RouteDeps
179
175
  sessionTransferService?: SessionTransferService;
180
176
  }
181
177
 
182
- export function routeConfig(deps: RouteDeps): LeitwerkConfig {
178
+ export function routeConfig(deps: Pick<RouteDeps, "config">): LeitwerkConfig {
183
179
  return deps.config ?? getDefaultConfig();
184
180
  }
185
181
 
182
+ function safeLaunchValue(value: unknown): unknown {
183
+ if (typeof value === "string") return redactCredentialBearingAbsoluteUrl(value);
184
+ if (Array.isArray(value)) return value.map(safeLaunchValue);
185
+ if (value && typeof value === "object")
186
+ return Object.fromEntries(
187
+ Object.entries(value).map(([key, item]) => [key, safeLaunchValue(item)]),
188
+ );
189
+ return value;
190
+ }
191
+
186
192
  function formatLaunchParameterValue(value: unknown): string | null {
187
193
  if (value === undefined || value === null) {
188
194
  return null;
@@ -191,37 +197,31 @@ function formatLaunchParameterValue(value: unknown): string | null {
191
197
  const normalized = redactCredentialBearingAbsoluteUrl(value.trim());
192
198
  return normalized === "" ? null : normalized;
193
199
  }
194
- return String(value);
200
+ return typeof value === "object"
201
+ ? JSON.stringify(safeLaunchValue(value), null, 2)
202
+ : String(value);
195
203
  }
196
204
 
197
205
  function buildLaunchParameterRows(
198
206
  params: Record<string, unknown>,
199
207
  launcher: ReturnType<ProcessLauncherService["listUiLaunchers"]>[number] | null,
200
208
  ): ProcessLaunchConfigurationView["parameters"] {
201
- const rows: Array<ProcessLaunchConfigurationView["parameters"][number]> = [];
202
- const usedFieldIds = new Set<string>();
203
- for (const field of launcher?.launchConfigSchema.fields ?? []) {
204
- if (!Object.hasOwn(params, field.id)) {
205
- continue;
206
- }
207
- usedFieldIds.add(field.id);
208
- rows.push({
209
- fieldId: field.id,
210
- label: field.label || field.id,
211
- value: formatLaunchParameterValue(params[field.id]),
212
- });
213
- }
214
- for (const fieldId of Object.keys(params).sort((left, right) => left.localeCompare(right))) {
215
- if (usedFieldIds.has(fieldId)) {
216
- continue;
217
- }
218
- rows.push({
219
- fieldId,
220
- label: fieldId,
221
- value: formatLaunchParameterValue(params[fieldId]),
222
- });
223
- }
224
- return rows;
209
+ const fields = (launcher?.launchConfigSchema.fields ?? []).filter((field) =>
210
+ Object.hasOwn(params, field.id),
211
+ );
212
+ const declared = new Set(fields.map((field) => field.id));
213
+ return [
214
+ ...fields,
215
+ ...Object.keys(params)
216
+ .sort((left, right) => left.localeCompare(right))
217
+ .filter((id) => !declared.has(id))
218
+ .map((id) => ({ id, label: id })),
219
+ ].map(({ id, label }) => ({
220
+ fieldId: id,
221
+ label: label || id,
222
+ value: formatLaunchParameterValue(params[id]),
223
+ rawValue: safeLaunchValue(params[id]),
224
+ }));
225
225
  }
226
226
 
227
227
  export function buildProcessLaunchConfigurationView(
@@ -256,7 +256,7 @@ export function buildProcessLaunchConfigurationView(
256
256
  }
257
257
 
258
258
  export function buildProcessRunDetailsView(
259
- deps: RouteDeps,
259
+ deps: Pick<RouteDeps, "config" | "processActionRegistry" | "processGraphs">,
260
260
  process: ProcessInstance,
261
261
  projects: readonly ProcessProject[],
262
262
  ): ProcessRunDetailsView {
@@ -285,18 +285,57 @@ export function buildProcessRunDetailsView(
285
285
  const turns: ProcessRunTurnView[] = [];
286
286
 
287
287
  for (const [turnId, turnContract] of contract.turns) {
288
- if (turnContract.turnType !== "llm") {
289
- continue;
290
- }
291
288
  const turnDef = deps.processActionRegistry?.getTurnDefinition(process.processId, turnId);
292
- if (!turnDef || !isLlmTurnDefinition(turnDef)) {
289
+ if (!turnDef) continue;
290
+ const common = {
291
+ turnId,
292
+ description: turnDef.description,
293
+ consumedProducts: [...(turnContract.consumedProducts ?? [])],
294
+ };
295
+ if (turnDef.kind !== "llm") {
296
+ const actions =
297
+ turnDef.kind === "human"
298
+ ? Object.entries(turnDef.actions).map(([name, action]) => ({
299
+ name,
300
+ label: action.label,
301
+ description: action.description,
302
+ form: action.form,
303
+ }))
304
+ : [];
305
+ const outcomes =
306
+ turnDef.kind === "automatic"
307
+ ? Object.entries(turnDef.outcomes ?? {}).map(([name, outcome]) => ({
308
+ name,
309
+ description: outcome?.description,
310
+ parameters: outcome?.parameters,
311
+ }))
312
+ : [];
313
+ turns.push({
314
+ ...common,
315
+ pathType: "not_applicable",
316
+ publishedProducts: [...(turnContract.publishedProducts ?? [])],
317
+ activePiToolNames: [],
318
+ outcomeActions: [],
319
+ integrationToolNames: turnDef.kind === "automatic" ? (turnDef.integrationTools ?? []) : [],
320
+ definitionContract: {
321
+ kind: turnDef.kind,
322
+ actions,
323
+ outcomes,
324
+ reviewProduct: turnDef.kind === "human" ? turnDef.reviewProduct : undefined,
325
+ },
326
+ });
293
327
  continue;
294
328
  }
295
329
  turns.push({
296
- turnId,
297
- description: turnDef.description,
330
+ ...common,
298
331
  pathType: turnDef.branchType,
299
- consumedProducts: [...(turnContract.consumedProducts ?? [])],
332
+ definitionContract: {
333
+ kind: turnDef.kind,
334
+ context: turnDef.context,
335
+ modelPurpose: turnDef.modelPurpose ?? null,
336
+ askQuestions: turnDef.askQuestions ?? false,
337
+ },
338
+ integrationToolNames: turnDef.integrationTools ?? [],
300
339
  publishedProducts: [
301
340
  ...new Set(
302
341
  [turnContract.publishedProduct, ...(turnContract.publishedProducts ?? [])].filter(
@@ -324,7 +363,7 @@ export function buildProcessRunDetailsView(
324
363
  Object.entries(toolSpec.parameters) as [string, OutcomeToolParameterSpec][]
325
364
  ).map(([parameterName, parameterSpec]) => ({
326
365
  name: parameterName,
327
- type: parameterSpec.type,
366
+ type: parameterSpec.type ?? "union",
328
367
  description: parameterSpec.description,
329
368
  required: parameterSpec.required === true,
330
369
  })),
@@ -340,60 +379,10 @@ export function buildProcessRunDetailsView(
340
379
  };
341
380
  }
342
381
 
343
- export function actionHasPurePlan(
344
- deps: RouteDeps,
382
+ export function processDefinesLeafOutcome(
383
+ deps: Pick<RouteDeps, "processUiRegistry">,
345
384
  process: ProcessInstance,
346
- actionId: string,
347
385
  ): boolean {
348
- const action = deps.processActionRegistry?.getAction(process.processId, actionId);
349
- return typeof action?.plan === "function";
350
- }
351
-
352
- export function buildActionSummaryForProcess(
353
- deps: RouteDeps,
354
- process: ProcessInstance,
355
- actionId: string,
356
- action: {
357
- id: string;
358
- label: string;
359
- form?: FormDefinition;
360
- },
361
- labelOverride?: string | null,
362
- overrides: { supportsScheduling?: boolean } = {},
363
- ): ProcessActionSummary {
364
- const visibleAction = listCurrentVisibleActions(deps, process).find(
365
- (candidate) => candidate.id === actionId,
366
- );
367
- const preview =
368
- visibleAction?.preview ??
369
- deps.processActionRegistry?.resolveActionPreview(process.processId, process, actionId) ??
370
- null;
371
- const supportsScheduling =
372
- overrides.supportsScheduling ??
373
- Boolean(
374
- actionHasPurePlan(deps, process, actionId) &&
375
- deps.processActionRegistry?.resolveActionScheduling(process.processId, process, actionId),
376
- );
377
- return buildProcessActionSummary(action, labelOverride ?? visibleAction?.label ?? action.label, {
378
- description: visibleAction?.description ?? null,
379
- preview: buildProcessActionPreviewSummary(deps, preview, process),
380
- supportsScheduling,
381
- supportsNextTurnModelOverride: previewSupportsNextTurnModelOverride(
382
- deps,
383
- process,
384
- actionId,
385
- preview,
386
- ),
387
- });
388
- }
389
-
390
- export function listVisibleActionsForProcess(deps: RouteDeps, process: ProcessInstance) {
391
- return listVisibleAttentionActionsForProcess(deps, process).map((action) =>
392
- buildActionSummaryForProcess(deps, process, action.id, action, action.label),
393
- );
394
- }
395
-
396
- export function processDefinesLeafOutcome(deps: RouteDeps, process: ProcessInstance): boolean {
397
386
  return deps.processUiRegistry?.getLeafOutcomeDefinition(process.processId) != null;
398
387
  }
399
388
 
@@ -426,75 +415,71 @@ export interface NormalizedRecoveryModelRequest {
426
415
  providerOptions?: Record<string, string>;
427
416
  }
428
417
 
429
- function normalizeProviderOptions(
430
- value: unknown,
431
- ): { ok: true; value: Record<string, string> } | { ok: false; error: string } {
432
- if (typeof value !== "object" || value === null || Array.isArray(value)) {
433
- return { ok: false, error: "providerOptions must be an object of string values" };
434
- }
435
- const entries = Object.entries(value);
436
- if (entries.length > 64) return { ok: false, error: "providerOptions has too many fields" };
437
- const result: Record<string, string> = {};
438
- for (const [key, option] of entries) {
439
- if (!key || key.length > 128 || typeof option !== "string" || option.length > 4096) {
440
- return { ok: false, error: "providerOptions contains an invalid field" };
441
- }
442
- result[key] = option;
443
- }
444
- return { ok: true, value: result };
445
- }
418
+ const modelRequestEntries = {
419
+ nextTurnModelProfileId: v.exactOptional(
420
+ v.pipe(
421
+ v.nullish(v.string("nextTurnModelProfileId must be a string or null")),
422
+ v.transform((value) => value?.trim() || null),
423
+ ),
424
+ ),
425
+ providerOptions: v.exactOptional(
426
+ v.pipe(
427
+ v.custom<Record<string, unknown>>(
428
+ isUnknownRecord,
429
+ "providerOptions must be an object of string values",
430
+ ),
431
+ v.maxEntries(64, "providerOptions has too many fields"),
432
+ v.guard(
433
+ (options): options is Record<string, string> =>
434
+ Object.entries(options).every(
435
+ ([key, value]) =>
436
+ key.length > 0 &&
437
+ key.length <= 128 &&
438
+ typeof value === "string" &&
439
+ value.length <= 4096,
440
+ ),
441
+ "providerOptions contains an invalid field",
442
+ ),
443
+ v.transform((options) => Object.assign({}, options)),
444
+ ),
445
+ ),
446
+ };
447
+ const promptSchema = v.exactOptional(
448
+ v.pipe(
449
+ v.nullish(v.string("prompt must be a string or null")),
450
+ v.transform((value) => value ?? null),
451
+ ),
452
+ );
446
453
 
447
454
  function parseModelRequest(
448
455
  value: unknown,
449
- input: { requestName: string; allowedKeys: readonly string[]; expectedShape: string },
450
- ):
451
- | { ok: true; body: Record<string, unknown>; request: NormalizedRecoveryModelRequest }
452
- | { ok: false; error: string } {
453
- if (value === undefined || value === null) {
454
- return {
455
- ok: true,
456
- body: {},
457
- request: {},
458
- };
459
- }
460
- const parsedValue = v.safeParse(unknownRecordSchema, value);
461
- if (!parsedValue.success) {
462
- return { ok: false, error: `${input.requestName} request body must be an object` };
463
- }
464
- const body = parsedValue.output;
465
- if (Object.keys(body).some((key) => !input.allowedKeys.includes(key))) {
466
- return {
467
- ok: false,
468
- error: `${input.requestName} request body must use ${input.expectedShape}`,
469
- };
470
- }
471
- const nextTurnModelProfileIdProvided = Object.hasOwn(body, "nextTurnModelProfileId");
472
- const modelProfileId = body.nextTurnModelProfileId;
473
- if (
474
- modelProfileId !== undefined &&
475
- modelProfileId !== null &&
476
- typeof modelProfileId !== "string"
477
- ) {
478
- return { ok: false, error: "nextTurnModelProfileId must be a string or null" };
479
- }
480
- const providerOptionsProvided = Object.hasOwn(body, "providerOptions");
481
- const providerOptions = providerOptionsProvided
482
- ? normalizeProviderOptions(body.providerOptions)
483
- : ({ ok: true, value: {} } as const);
484
- if (!providerOptions.ok) return providerOptions;
485
- return {
486
- ok: true,
487
- body,
488
- request: {
489
- ...(nextTurnModelProfileIdProvided
490
- ? {
491
- nextTurnModelProfileId:
492
- typeof modelProfileId === "string" ? modelProfileId.trim() || null : null,
493
- }
494
- : {}),
495
- ...(providerOptionsProvided ? { providerOptions: providerOptions.value } : {}),
496
- },
497
- };
456
+ requestName: "continue" | "recovery",
457
+ ): { ok: true; request: NormalizedContinueRequest } | { ok: false; error: string } {
458
+ const schema =
459
+ requestName === "continue"
460
+ ? v.object({ ...modelRequestEntries, prompt: promptSchema })
461
+ : v.object(modelRequestEntries);
462
+ const shape =
463
+ requestName === "continue"
464
+ ? "{ prompt, nextTurnModelProfileId, providerOptions }"
465
+ : "{ nextTurnModelProfileId, providerOptions }";
466
+ const parsed = v.safeParse(
467
+ v.pipe(
468
+ v.unknown(),
469
+ v.check(isUnknownRecord, `${requestName} request body must be an object`),
470
+ unknownRecordSchema,
471
+ v.check(
472
+ (body) => Object.keys(body).every((key) => Object.hasOwn(schema.entries, key)),
473
+ `${requestName} request body must use ${shape}`,
474
+ ),
475
+ schema,
476
+ ),
477
+ value ?? {},
478
+ { abortEarly: true },
479
+ );
480
+ return parsed.success
481
+ ? { ok: true, request: parsed.output }
482
+ : { ok: false, error: parsed.issues[0].message };
498
483
  }
499
484
 
500
485
  export function normalizeLauncherRequest(value: unknown):
@@ -523,25 +508,6 @@ export function normalizeLauncherRequest(value: unknown):
523
508
  };
524
509
  }
525
510
 
526
- export function normalizeActionRequest(value: unknown):
527
- | {
528
- ok: true;
529
- request: NormalizedScheduledActionInput;
530
- }
531
- | {
532
- ok: false;
533
- error: string;
534
- } {
535
- const parsed = parseActionRequestBody(value);
536
- if (!parsed.ok) {
537
- return { ok: false, error: parsed.error };
538
- }
539
- return {
540
- ok: true,
541
- request: parsed.value,
542
- };
543
- }
544
-
545
511
  function isScheduleRequestError(error: string): boolean {
546
512
  return (
547
513
  error === "schedule must be an object" ||
@@ -568,139 +534,13 @@ export function sendActionRequestNormalizationError(reply: FastifyReply, error:
568
534
  export function normalizeContinueRequest(
569
535
  value: unknown,
570
536
  ): { ok: true; request: NormalizedContinueRequest } | { ok: false; error: string } {
571
- const parsed = parseModelRequest(value, {
572
- requestName: "continue",
573
- allowedKeys: ["prompt", "nextTurnModelProfileId", "providerOptions"],
574
- expectedShape: "{ prompt, nextTurnModelProfileId, providerOptions }",
575
- });
576
- if (!parsed.ok) return parsed;
577
- if (
578
- parsed.body.prompt !== undefined &&
579
- parsed.body.prompt !== null &&
580
- typeof parsed.body.prompt !== "string"
581
- ) {
582
- return { ok: false, error: "prompt must be a string or null" };
583
- }
584
- const promptProvided = Object.hasOwn(parsed.body, "prompt");
585
- return {
586
- ok: true,
587
- request: {
588
- ...parsed.request,
589
- ...(promptProvided ? { prompt: parsed.body.prompt ?? null } : {}),
590
- },
591
- };
537
+ return parseModelRequest(value, "continue");
592
538
  }
593
539
 
594
540
  export function normalizeRecoveryModelRequest(
595
541
  value: unknown,
596
542
  ): { ok: true; request: NormalizedRecoveryModelRequest } | { ok: false; error: string } {
597
- const parsed = parseModelRequest(value, {
598
- requestName: "recovery",
599
- allowedKeys: ["nextTurnModelProfileId", "providerOptions"],
600
- expectedShape: "{ nextTurnModelProfileId, providerOptions }",
601
- });
602
- return parsed.ok ? { ok: true, request: parsed.request } : parsed;
603
- }
604
-
605
- export function buildProcessActionPreviewSummary(
606
- deps: RouteDeps,
607
- preview: {
608
- candidateSelectedTurnId: string | null;
609
- lifecycleStatus?: string | null;
610
- } | null,
611
- process: ProcessInstance,
612
- ): ProcessActionPreviewSummary | null {
613
- if (!preview) {
614
- return null;
615
- }
616
- if (!preview.candidateSelectedTurnId) {
617
- return {
618
- kind: "terminal",
619
- turnId: null,
620
- turnKind: null,
621
- description: preview.lifecycleStatus === "aborted" ? "Abort process" : "Complete process",
622
- };
623
- }
624
- const turnDef = deps.processActionRegistry?.getTurnDefinition(
625
- process.processId,
626
- preview.candidateSelectedTurnId,
627
- );
628
- if (!turnDef) {
629
- return null;
630
- }
631
- return {
632
- kind: "turn",
633
- turnId: preview.candidateSelectedTurnId,
634
- turnKind: turnDef.kind,
635
- description: turnDef.description,
636
- };
637
- }
638
-
639
- export function previewSupportsNextTurnModelOverride(
640
- deps: RouteDeps,
641
- process: ProcessInstance,
642
- actionId: string,
643
- preview: { candidateSelectedTurnId: string | null } | null,
644
- ): boolean {
645
- if (!preview?.candidateSelectedTurnId) {
646
- return false;
647
- }
648
- if (!actionHasPurePlan(deps, process, actionId)) {
649
- return false;
650
- }
651
- const turnDef = deps.processActionRegistry?.getTurnDefinition(
652
- process.processId,
653
- preview.candidateSelectedTurnId,
654
- );
655
- return Boolean(turnDef && isLlmTurnDefinition(turnDef));
656
- }
657
-
658
- export function buildProcessActionSummary(
659
- action: {
660
- id: string;
661
- label: string;
662
- form?: FormDefinition;
663
- },
664
- labelOverride?: string | null,
665
- opts: {
666
- description?: string | null;
667
- preview?: ProcessActionPreviewSummary | null;
668
- supportsScheduling?: boolean;
669
- supportsNextTurnModelOverride?: boolean;
670
- } = {},
671
- ): ProcessActionSummary {
672
- return {
673
- id: action.id,
674
- label: labelOverride?.trim() ? labelOverride : action.label,
675
- description: opts.description ?? null,
676
- preview: opts.preview ?? null,
677
- supportsScheduling: opts.supportsScheduling === true,
678
- supportsNextTurnModelOverride: opts.supportsNextTurnModelOverride === true,
679
- ...(action.form
680
- ? {
681
- form: {
682
- id: action.form.id,
683
- title: action.form.title,
684
- submitLabel: action.form.submitLabel,
685
- fields: action.form.fields.map((field) => ({ ...field })),
686
- },
687
- }
688
- : {}),
689
- };
690
- }
691
-
692
- export function getScheduledActionDetailForProcess(
693
- deps: RouteDeps,
694
- process: ProcessInstance,
695
- ): ScheduledActionDetail | null {
696
- return getPresentedScheduledActionDetailForProcess(
697
- {
698
- ...deps,
699
- buildActionSummaryForProcess: (process, actionId, action, labelOverride, overrides) =>
700
- buildActionSummaryForProcess(deps, process, actionId, action, labelOverride, overrides),
701
- },
702
- process,
703
- );
543
+ return parseModelRequest(value, "recovery");
704
544
  }
705
545
 
706
546
  export function buildLauncherModelConfigSchema(
@@ -844,16 +684,10 @@ export function sendScheduledActionMutationResponse(
844
684
  export function mergeProcessEventWindowsAscending(
845
685
  windows: readonly (readonly ProcessEvent[])[],
846
686
  ): ProcessEvent[] {
847
- const eventsById = new Map<string, ProcessEvent>();
848
- for (const window of windows) {
849
- for (const event of window) {
850
- eventsById.set(event.id, event);
851
- }
852
- }
853
- return [...eventsById.values()].sort((left, right) => {
854
- const createdAtComparison = left.createdAt.localeCompare(right.createdAt);
855
- return createdAtComparison !== 0 ? createdAtComparison : left.id.localeCompare(right.id);
856
- });
687
+ return [...new Map(windows.flat().map((event) => [event.id, event])).values()].sort(
688
+ (left, right) =>
689
+ left.createdAt.localeCompare(right.createdAt) || left.id.localeCompare(right.id),
690
+ );
857
691
  }
858
692
 
859
693
  export { getSelectedTurnSummaryForProcess };
@@ -3,6 +3,7 @@ import { registerFutureExecutionRoutes } from "./future-executions.js";
3
3
  import { registerLauncherRoutes } from "./launchers.js";
4
4
  import { registerProcessActionRoutes } from "./process-actions.js";
5
5
  import { registerProcessDetailRoutes } from "./process-detail.js";
6
+ import { registerProcessModelConfigRoutes } from "./process-model-config.js";
6
7
  import { registerProcessQuestionRoutes } from "./process-questions.js";
7
8
  import type { RouteDeps } from "./process-route-helpers.js";
8
9
  import { registerProcessSessionRoutes } from "./process-session.js";
@@ -12,6 +13,7 @@ export type { RouteDeps } from "./process-route-helpers.js";
12
13
 
13
14
  export function registerProcessRoutes(app: FastifyInstance, deps: RouteDeps) {
14
15
  registerProcessDetailRoutes(app, deps);
16
+ registerProcessModelConfigRoutes(app, deps);
15
17
  registerLauncherRoutes(app, deps, deps.futureExecutionLifecycle);
16
18
  registerFutureExecutionRoutes(app, deps, deps.futureExecutionLifecycle);
17
19
  registerProcessActionRoutes(app, deps, deps.futureExecutionLifecycle);