@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,6 +1,7 @@
1
1
  import type { ProcessEvent } from "@leitwerk-dev/domain";
2
2
  import { applyEventToCompactTurnSummary, emptyCompactTurnSummary } from "@leitwerk-dev/protocol";
3
- import { and, asc, desc, eq, gte, inArray, like, type SQL, sql } from "drizzle-orm";
3
+ import type { SQL } from "drizzle-orm";
4
+ import { and, asc, desc, eq, getTableColumns, gte, inArray, like, sql } from "drizzle-orm";
4
5
  import type { LeitwerkDb } from "./database.js";
5
6
  import { generateId, now } from "./repo-helpers.js";
6
7
  import * as s from "./schema.js";
@@ -40,6 +41,87 @@ export function createProcessEventRepo(db: LeitwerkDb) {
40
41
  .all()
41
42
  .map(rowToProcessEvent);
42
43
  return {
44
+ /** Timeline facts without embedded process state or provider responses. @internal */
45
+ listUiSnapshotEvents(instanceId: string, turnRecordIds: readonly string[]): ProcessEvent[] {
46
+ const newestIds = (where: SQL | undefined, limit: number) =>
47
+ db
48
+ .select({ id: s.processEvents.id, sequence: s.processEvents.eventSequence })
49
+ .from(s.processEvents)
50
+ .where(where)
51
+ .orderBy(desc(s.processEvents.eventSequence))
52
+ .limit(limit)
53
+ .all();
54
+ // Select identities before loading payloads. Most candidates are discarded
55
+ // by the combined limit, and one provider response can be megabytes.
56
+ const candidates = [
57
+ "worker_capacity_queued",
58
+ "lifecycle_parked",
59
+ "worker_failed",
60
+ "external_trigger_listener_armed",
61
+ "external_source_armed",
62
+ "external_trigger_failed",
63
+ "external_source_failed",
64
+ "external_trigger_consumed",
65
+ "external_source_consumed",
66
+ ].flatMap((eventType) =>
67
+ newestIds(
68
+ and(eq(s.processEvents.instanceId, instanceId), eq(s.processEvents.eventType, eventType)),
69
+ 40,
70
+ ),
71
+ );
72
+ candidates.sort((left, right) => right.sequence - left.sequence);
73
+ const selected = candidates.slice(0, 40);
74
+ for (const turnRecordId of turnRecordIds) {
75
+ for (const eventType of ["turn.progress", "turn_outcome_recorded"]) {
76
+ selected.push(
77
+ ...newestIds(
78
+ and(
79
+ eq(s.processEvents.instanceId, instanceId),
80
+ eq(s.processEvents.turnRecordId, turnRecordId),
81
+ eq(s.processEvents.eventType, eventType),
82
+ ),
83
+ 1,
84
+ ),
85
+ );
86
+ }
87
+ }
88
+ const ids = [...new Set(selected.map((event) => event.id))];
89
+ if (ids.length === 0) return [];
90
+ const data = s.processEvents.data;
91
+ return db
92
+ .select({
93
+ ...getTableColumns(s.processEvents),
94
+ data: sql<string>`json_object(
95
+ 'turnRecordId', json_extract(${data}, '$.turnRecordId'),
96
+ 'turnId', json_extract(${data}, '$.turnId'),
97
+ 'outcome', json_extract(${data}, '$.outcome'),
98
+ 'params', json_object(
99
+ 'summary', json_extract(${data}, '$.params.summary'),
100
+ 'planMarkdown', json_extract(${data}, '$.params.planMarkdown'),
101
+ 'reviewMarkdown', json_extract(${data}, '$.params.reviewMarkdown'),
102
+ 'feedback', json_extract(${data}, '$.params.feedback')),
103
+ 'report', json_extract(${data}, '$.report'),
104
+ 'revision', json_extract(${data}, '$.revision'),
105
+ 'startRecordId', json_extract(${data}, '$.startRecordId'),
106
+ 'reason', json_extract(${data}, '$.reason'),
107
+ 'message', json_extract(${data}, '$.message'),
108
+ 'errorCode', json_extract(${data}, '$.errorCode'),
109
+ 'errorClass', json_extract(${data}, '$.errorClass'),
110
+ 'armingId', json_extract(${data}, '$.armingId'),
111
+ 'trigger', json_extract(${data}, '$.trigger'),
112
+ 'path', json_extract(${data}, '$.path'),
113
+ 'pollInterval', json_extract(${data}, '$.pollInterval'),
114
+ 'provider', json_object(
115
+ 'path', json_extract(${data}, '$.provider.path'),
116
+ 'pollInterval', json_extract(${data}, '$.provider.pollInterval'))
117
+ )`,
118
+ })
119
+ .from(s.processEvents)
120
+ .where(inArray(s.processEvents.id, ids))
121
+ .orderBy(asc(s.processEvents.createdAt), asc(s.processEvents.id))
122
+ .all()
123
+ .map(rowToProcessEvent);
124
+ },
43
125
  /** @internal */
44
126
  create(input: CreateProcessEventInput): ProcessEvent {
45
127
  const id = generateId("evt");
@@ -111,20 +193,16 @@ export function createProcessEventRepo(db: LeitwerkDb) {
111
193
  turnRecordId: string,
112
194
  eventType: string,
113
195
  ): ProcessEvent | null {
114
- const row = db
115
- .select()
116
- .from(s.processEvents)
117
- .where(
196
+ return (
197
+ listNewest(
118
198
  and(
119
199
  eq(s.processEvents.instanceId, instanceId),
120
200
  eq(s.processEvents.turnRecordId, turnRecordId),
121
201
  eq(s.processEvents.eventType, eventType),
122
202
  ),
123
- )
124
- .orderBy(desc(s.processEvents.eventSequence))
125
- .limit(1)
126
- .get();
127
- return row ? rowToProcessEvent(row) : null;
203
+ 1,
204
+ )[0] ?? null
205
+ );
128
206
  },
129
207
  /** @internal */
130
208
  summary(turnRecordId: string) {
@@ -362,10 +362,17 @@ export function createProcessInstanceRepo(db: LeitwerkDb) {
362
362
  },
363
363
 
364
364
  /** @public */
365
- update(id: string, input: UpdateProcessInstanceInput): ProcessInstance | null {
365
+ update(
366
+ id: string,
367
+ input: UpdateProcessInstanceInput,
368
+ options: {
369
+ /** Scheduling-only writes retain process activity time; never part of a process patch. @internal */
370
+ preserveUpdatedAt?: boolean;
371
+ } = {},
372
+ ): ProcessInstance | null {
366
373
  const ts = now();
367
374
  const setValues: SQLiteUpdateSetSource<typeof s.processInstances> = {
368
- updatedAt: ts,
375
+ ...(options.preserveUpdatedAt ? {} : { updatedAt: ts }),
369
376
  defaultModelProfileId: input.defaultModelProfileId,
370
377
  initialDefaultModelProfileId: input.initialDefaultModelProfileId,
371
378
  selectedTurnId: input.selectedTurnId,
@@ -4,6 +4,7 @@ import type {
4
4
  } from "@leitwerk-dev/domain";
5
5
  import { and, asc, desc, eq, sql } from "drizzle-orm";
6
6
  import type { LeitwerkDb } from "./database.js";
7
+ import { type HistoryWindow, historyWindow } from "./history-window.js";
7
8
  import { generateId, now, parseJsonRecord } from "./repo-helpers.js";
8
9
  import * as s from "./schema.js";
9
10
 
@@ -82,11 +83,16 @@ export function createProcessLeafOutcomeSnapshotRepo(db: LeitwerkDb) {
82
83
  },
83
84
 
84
85
  /** @internal */
85
- listByInstance(instanceId: string): ProcessLeafOutcomeSnapshot[] {
86
+ listByInstance(instanceId: string, window?: HistoryWindow): ProcessLeafOutcomeSnapshot[] {
86
87
  return db
87
88
  .select()
88
89
  .from(s.processLeafOutcomeSnapshots)
89
- .where(eq(s.processLeafOutcomeSnapshots.instanceId, instanceId))
90
+ .where(
91
+ and(
92
+ eq(s.processLeafOutcomeSnapshots.instanceId, instanceId),
93
+ historyWindow(s.processLeafOutcomeSnapshots.anchoredAt, window),
94
+ ),
95
+ )
90
96
  .orderBy(
91
97
  asc(s.processLeafOutcomeSnapshots.anchoredAt),
92
98
  asc(s.processLeafOutcomeSnapshots.createdAt),
@@ -60,6 +60,10 @@ function rowToProcessProject(row: typeof s.processProjects.$inferSelect): Proces
60
60
  /** @public */
61
61
  export function createProcessProjectRepo(db: LeitwerkDb) {
62
62
  return {
63
+ /** @internal */
64
+ listAll(): ProcessProject[] {
65
+ return db.select().from(s.processProjects).all().map(rowToProcessProject);
66
+ },
63
67
  /** @internal */
64
68
  create(input: CreateProcessProjectInput): ProcessProject {
65
69
  const id = generateId("prj");
@@ -49,15 +49,22 @@ export function createProcessSkillRepo(db: LeitwerkDb) {
49
49
  .select({
50
50
  digest: skillRevisions.bundleDigest,
51
51
  bytes: skillRevisions.bundleBytes,
52
+ provenance: skillRevisions.provenance,
52
53
  })
53
54
  .from(processSkills)
54
55
  .innerJoin(skillRevisions, eq(processSkills.skillRevisionId, skillRevisions.id))
55
56
  .where(eq(processSkills.instanceId, instanceId))
56
57
  .orderBy(asc(processSkills.position))
57
58
  .all()
58
- .map(({ digest, bytes }) => ({
59
+ .map(({ digest, bytes, provenance }) => ({
59
60
  bundle: { digest, bytes },
60
- owner: SKILL_RESOURCE_OWNER,
61
+ owner: provenance
62
+ ? {
63
+ kind: "skill" as const,
64
+ ownerExtensionId: provenance.extensionId,
65
+ packageName: provenance.packageName,
66
+ }
67
+ : SKILL_RESOURCE_OWNER,
61
68
  }));
62
69
  },
63
70
  };
@@ -1,8 +1,9 @@
1
1
  import type { ProcessTurnAnnotation, TurnAnnotationReference } from "@leitwerk-dev/domain";
2
2
  import { parseTurnAnnotationReferences } from "@leitwerk-dev/domain";
3
- import { and, asc, eq } from "drizzle-orm";
3
+ import { and, asc, eq, getTableColumns, sql } from "drizzle-orm";
4
4
  import type { SQLiteUpdateSetSource } from "drizzle-orm/sqlite-core";
5
5
  import type { LeitwerkDb } from "./database.js";
6
+ import { type HistoryWindow, historyWindow } from "./history-window.js";
6
7
  import { generateId, now, parseJsonRecord } from "./repo-helpers.js";
7
8
  import * as s from "./schema.js";
8
9
 
@@ -65,6 +66,24 @@ function rowToProcessTurnAnnotation(
65
66
 
66
67
  /** @internal */
67
68
  export function createProcessTurnAnnotationRepo(db: LeitwerkDb) {
69
+ const list = (instanceId: string, window: HistoryWindow | undefined, compact: boolean) =>
70
+ db
71
+ .select({
72
+ ...getTableColumns(s.turnAnnotations),
73
+ payloadJson: compact
74
+ ? sql<string>`json_remove(${s.turnAnnotations.payloadJson}, '$.event')`
75
+ : s.turnAnnotations.payloadJson,
76
+ })
77
+ .from(s.turnAnnotations)
78
+ .where(
79
+ and(
80
+ eq(s.turnAnnotations.instanceId, instanceId),
81
+ historyWindow(s.turnAnnotations.createdAt, window),
82
+ ),
83
+ )
84
+ .orderBy(asc(s.turnAnnotations.createdAt))
85
+ .all()
86
+ .map(rowToProcessTurnAnnotation);
68
87
  return {
69
88
  /** @internal */
70
89
  create(input: CreateProcessTurnAnnotationInput): ProcessTurnAnnotation {
@@ -111,14 +130,13 @@ export function createProcessTurnAnnotationRepo(db: LeitwerkDb) {
111
130
  },
112
131
 
113
132
  /** @internal */
114
- listByInstance(instanceId: string): ProcessTurnAnnotation[] {
115
- return db
116
- .select()
117
- .from(s.turnAnnotations)
118
- .where(eq(s.turnAnnotations.instanceId, instanceId))
119
- .orderBy(asc(s.turnAnnotations.createdAt))
120
- .all()
121
- .map(rowToProcessTurnAnnotation);
133
+ listByInstance(instanceId: string, window?: HistoryWindow): ProcessTurnAnnotation[] {
134
+ return list(instanceId, window, false);
135
+ },
136
+
137
+ /** Keep presentation and observation fields without the raw source event. @internal */
138
+ listForTimeline(instanceId: string, window?: HistoryWindow): ProcessTurnAnnotation[] {
139
+ return list(instanceId, window, true);
122
140
  },
123
141
 
124
142
  /** @internal */
@@ -1,4 +1,5 @@
1
1
  import type {
2
+ MappedTurnItemRef,
2
3
  ModelSelectionProvenance,
3
4
  ProcessTurnRecord,
4
5
  ProcessTurnRecordPathType,
@@ -7,10 +8,10 @@ import type {
7
8
  TurnId,
8
9
  WorkerErrorClass,
9
10
  } from "@leitwerk-dev/domain";
10
- import { asc, desc, eq } from "drizzle-orm";
11
+ import { and, asc, desc, eq, getTableColumns, isNull, ne, sql } from "drizzle-orm";
11
12
  import type { SQLiteUpdateSetSource } from "drizzle-orm/sqlite-core";
12
13
  import type { LeitwerkDb } from "./database.js";
13
- import { generateId, now } from "./repo-helpers.js";
14
+ import { generateId, mappedItemRef, now } from "./repo-helpers.js";
14
15
  import * as s from "./schema.js";
15
16
 
16
17
  /** @internal */
@@ -50,6 +51,8 @@ export interface UpdateProcessTurnRecordInput {
50
51
  /** @internal */
51
52
  modelSelectionProvenance?: ModelSelectionProvenance | null;
52
53
  /** @internal */
54
+ iteration?: MappedTurnItemRef | null;
55
+ /** @internal */
53
56
  turnResultMarkdown?: string | null;
54
57
  /** @internal */
55
58
  errorSummary?: string | null;
@@ -81,6 +84,7 @@ function rowToProcessTurnRecord(row: typeof s.turnRecords.$inferSelect): Process
81
84
  source: row.modelSelectionSource as ModelSelectionProvenance["source"],
82
85
  }
83
86
  : null,
87
+ iteration: mappedItemRef(row),
84
88
  turnResultMarkdown: row.turnResultMarkdown ?? null,
85
89
  errorSummary: row.errorSummary ?? null,
86
90
  errorClass: (row.errorClass as WorkerErrorClass | null | undefined) ?? null,
@@ -116,6 +120,9 @@ export function createProcessTurnRecordRepo(db: LeitwerkDb) {
116
120
  errorClass: input.errorClass ?? null,
117
121
  startedAt: input.startedAt ?? now(),
118
122
  endedAt: input.endedAt ?? null,
123
+ mappedRunId: input.iteration?.runId ?? null,
124
+ mappedItemKey: input.iteration?.itemKey ?? null,
125
+ mappedItemIndex: input.iteration?.itemIndex ?? null,
119
126
  };
120
127
  db.insert(s.turnRecords).values(values).run();
121
128
  return rowToProcessTurnRecord(values);
@@ -138,23 +145,56 @@ export function createProcessTurnRecordRepo(db: LeitwerkDb) {
138
145
  .map(rowToProcessTurnRecord);
139
146
  },
140
147
 
148
+ /** Only absent summaries need repair; don't read every retained turn at startup. @internal */
149
+ listMissingSummaries(instanceId: string): ProcessTurnRecord[] {
150
+ return db
151
+ .select(getTableColumns(s.turnRecords))
152
+ .from(s.turnRecords)
153
+ .leftJoin(s.turnSummaries, eq(s.turnSummaries.turnRecordId, s.turnRecords.id))
154
+ .where(and(eq(s.turnRecords.instanceId, instanceId), isNull(s.turnSummaries.turnRecordId)))
155
+ .all()
156
+ .map(rowToProcessTurnRecord);
157
+ },
158
+ /** A stable page, even when new turns arrive or timestamps tie. @internal */
159
+ listPage(
160
+ instanceId: string,
161
+ before?: Pick<ProcessTurnRecord, "startedAt" | "id">,
162
+ limit = 40,
163
+ ): ProcessTurnRecord[] {
164
+ return db
165
+ .select()
166
+ .from(s.turnRecords)
167
+ .where(
168
+ and(
169
+ eq(s.turnRecords.instanceId, instanceId),
170
+ before
171
+ ? sql`(${s.turnRecords.startedAt}, ${s.turnRecords.id}) < (${before.startedAt}, ${before.id})`
172
+ : undefined,
173
+ ),
174
+ )
175
+ .orderBy(desc(s.turnRecords.startedAt), desc(s.turnRecords.id))
176
+ .limit(limit)
177
+ .all()
178
+ .map(rowToProcessTurnRecord)
179
+ .reverse();
180
+ },
181
+
141
182
  /** @internal */
142
183
  getLatestSucceededPrimaryByInstance(instanceId: string): ProcessTurnRecord | null {
143
184
  const row = db
144
185
  .select()
145
186
  .from(s.turnRecords)
146
- .where(eq(s.turnRecords.instanceId, instanceId))
187
+ .where(
188
+ and(
189
+ eq(s.turnRecords.instanceId, instanceId),
190
+ eq(s.turnRecords.status, "succeeded"),
191
+ eq(s.turnRecords.pathType, "primary"),
192
+ ne(s.turnRecords.resultPiEntryId, ""),
193
+ ),
194
+ )
147
195
  .orderBy(desc(s.turnRecords.startedAt))
148
- .all()
149
- .map(rowToProcessTurnRecord)
150
- .find(
151
- (run) =>
152
- run.status === "succeeded" &&
153
- run.pathType === "primary" &&
154
- typeof run.resultPiEntryId === "string" &&
155
- run.resultPiEntryId.length > 0,
156
- );
157
- return row ?? null;
196
+ .get();
197
+ return row ? rowToProcessTurnRecord(row) : null;
158
198
  },
159
199
 
160
200
  /** @internal */
@@ -0,0 +1,63 @@
1
+ import type { PublicationReceipt, PublicationStore } from "@leitwerk-dev/external-writes";
2
+ import { eq } from "drizzle-orm";
3
+ import type { LeitwerkDb } from "./database.js";
4
+ import { topicPublications } from "./schema.js";
5
+
6
+ /** @internal */
7
+ export function createPublicationRepo(db: LeitwerkDb): PublicationStore {
8
+ const store: PublicationStore = {
9
+ publication(key) {
10
+ const row = db.select().from(topicPublications).where(eq(topicPublications.key, key)).get();
11
+ return row ? JSON.parse(row.data) : null;
12
+ },
13
+ publicationByExternalId(externalId) {
14
+ const row = db
15
+ .select()
16
+ .from(topicPublications)
17
+ .where(eq(topicPublications.externalId, externalId))
18
+ .get();
19
+ return row ? JSON.parse(row.data) : null;
20
+ },
21
+ reservePublication(input) {
22
+ return (
23
+ Number(
24
+ db
25
+ .insert(topicPublications)
26
+ .values({
27
+ key: input.key,
28
+ topicId: input.topicId,
29
+ externalId: null,
30
+ data: JSON.stringify(input),
31
+ })
32
+ .onConflictDoNothing()
33
+ .run().changes,
34
+ ) === 1
35
+ );
36
+ },
37
+ finishPublication(key, externalId, url) {
38
+ const current = store.publication(key);
39
+ if (!current || (current.externalId && current.externalId !== externalId))
40
+ throw new Error("Publication receipt conflict");
41
+ const receipt: PublicationReceipt = { ...current, externalId, url };
42
+ db.update(topicPublications)
43
+ .set({ externalId, data: JSON.stringify(receipt) })
44
+ .where(eq(topicPublications.key, key))
45
+ .run();
46
+ },
47
+ releaseRejectedPublication(key) {
48
+ const current = store.publication(key);
49
+ if (current?.externalId) throw new Error("Cannot release a published ticket");
50
+ db.delete(topicPublications).where(eq(topicPublications.key, key)).run();
51
+ },
52
+ markPublicationTriggered(key) {
53
+ const current = store.publication(key);
54
+ if (!current?.externalId)
55
+ throw new Error("Ticket receipt is required before triggering changes");
56
+ db.update(topicPublications)
57
+ .set({ data: JSON.stringify({ ...current, triggered: true }) })
58
+ .where(eq(topicPublications.key, key))
59
+ .run();
60
+ },
61
+ };
62
+ return store;
63
+ }
@@ -1,4 +1,14 @@
1
- import { asUnknownRecord } from "@leitwerk-dev/domain";
1
+ import { asUnknownRecord, type MappedTurnItemRef } from "@leitwerk-dev/domain";
2
+
3
+ export function mappedItemRef(row: {
4
+ mappedRunId: string | null;
5
+ mappedItemKey: string | null;
6
+ mappedItemIndex: number | null;
7
+ }): MappedTurnItemRef | null {
8
+ return row.mappedRunId !== null && row.mappedItemKey !== null && row.mappedItemIndex !== null
9
+ ? { runId: row.mappedRunId, itemKey: row.mappedItemKey, itemIndex: row.mappedItemIndex }
10
+ : null;
11
+ }
2
12
 
3
13
  export function parsePersistedJson<T>(value: string, label: string): T {
4
14
  try {
@@ -1,4 +1,8 @@
1
+ import { createTopicWikiRepo } from "@leitwerk-dev/wiki/server";
1
2
  import { createApiTokenRepo } from "./api-token-repo.js";
3
+ import { createExecutionInspectionRepo } from "./execution-inspection-repo.js";
4
+ import { createPublicationRepo } from "./publication-repo.js";
5
+ import { createScopedSettingsRepo } from "./scoped-settings-repo.js";
2
6
  import { createStartupObservationRepo } from "./startup-observation-repo.js";
3
7
  import { createTurnSummaryRepo } from "./turn-summary-repo.js";
4
8
 
@@ -15,6 +19,7 @@ export * from "./external-write-log-repo.js";
15
19
  export * from "./future-execution-repo.js";
16
20
  export * from "./launch-run-repo.js";
17
21
  export * from "./launcher-recent-value-repo.js";
22
+ export * from "./mapped-llm-run-repo.js";
18
23
  export * from "./pending-external-source-fire-repo.js";
19
24
  export * from "./process-event-repo.js";
20
25
  export * from "./process-handoff-dedup-key-repo.js";
@@ -39,6 +44,7 @@ export * from "./worker-lease-repo.js";
39
44
  import { createFutureExecutionRepo } from "./future-execution-repo.js";
40
45
  import { createLaunchRunRepo } from "./launch-run-repo.js";
41
46
  import { createLauncherRecentValueRepo } from "./launcher-recent-value-repo.js";
47
+ import { createMappedLlmRunRepo } from "./mapped-llm-run-repo.js";
42
48
  import { createPendingExternalSourceFireRepo } from "./pending-external-source-fire-repo.js";
43
49
  import { createProcessEventRepo } from "./process-event-repo.js";
44
50
  import { createProcessHandoffDedupKeyRepo } from "./process-handoff-dedup-key-repo.js";
@@ -64,6 +70,14 @@ import { createWorkerLeaseRepo } from "./worker-lease-repo.js";
64
70
 
65
71
  /** @public */
66
72
  export interface RepositoryBundle {
73
+ /** @internal */
74
+ topicWiki: ReturnType<typeof createTopicWikiRepo>;
75
+ /** @internal */
76
+ publications: ReturnType<typeof createPublicationRepo>;
77
+ /** @internal */
78
+ executionInspections: ReturnType<typeof createExecutionInspectionRepo>;
79
+ /** @internal */
80
+ scopedSettings: ReturnType<typeof createScopedSettingsRepo>;
67
81
  /** @internal */
68
82
  startupObservations: ReturnType<typeof createStartupObservationRepo>;
69
83
  /** @internal */
@@ -105,6 +119,8 @@ export interface RepositoryBundle {
105
119
  /** @internal */
106
120
  turnAnnotations: ReturnType<typeof createProcessTurnAnnotationRepo>;
107
121
  /** @internal */
122
+ mappedRuns: ReturnType<typeof createMappedLlmRunRepo>;
123
+ /** @internal */
108
124
  leases: ReturnType<typeof createWorkerLeaseRepo>;
109
125
  /** @internal */
110
126
  providerCredentials: ReturnType<typeof createProviderCredentialRepo>;
@@ -136,6 +152,11 @@ export function createAllRepos(
136
152
  ): RepositoryBundle {
137
153
  const credentialCipher = options.credentialCipher ?? createUnavailableCredentialCipher();
138
154
  const bundle: RepositoryBundle = {
155
+ topicWiki: createTopicWikiRepo(db),
156
+ publications: createPublicationRepo(db),
157
+ executionInspections: createExecutionInspectionRepo(db),
158
+
159
+ scopedSettings: createScopedSettingsRepo(db),
139
160
  startupObservations: createStartupObservationRepo(db),
140
161
  turnSummaries: createTurnSummaryRepo(db),
141
162
  processes: createProcessInstanceRepo(db),
@@ -156,6 +177,7 @@ export function createAllRepos(
156
177
  turnRecords: createProcessTurnRecordRepo(db),
157
178
  turnStarts: createTurnStartRecordRepo(db),
158
179
  turnAnnotations: createProcessTurnAnnotationRepo(db),
180
+ mappedRuns: createMappedLlmRunRepo(db),
159
181
  leases: createWorkerLeaseRepo(db),
160
182
  providerCredentials: createProviderCredentialRepo(db, credentialCipher),
161
183
  externalWrites: createExternalWriteLogRepo(db),