@cat-factory/worker 0.6.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 (586) hide show
  1. package/LICENSE +21 -0
  2. package/dist/app.d.ts +22 -0
  3. package/dist/app.d.ts.map +1 -0
  4. package/dist/app.js +49 -0
  5. package/dist/app.js.map +1 -0
  6. package/dist/index.d.ts +17 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +234 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/infrastructure/ai/CloudflareModelProvider.d.ts +23 -0
  11. package/dist/infrastructure/ai/CloudflareModelProvider.d.ts.map +1 -0
  12. package/dist/infrastructure/ai/CloudflareModelProvider.js +62 -0
  13. package/dist/infrastructure/ai/CloudflareModelProvider.js.map +1 -0
  14. package/dist/infrastructure/ai/CompositeAgentExecutor.d.ts +2 -0
  15. package/dist/infrastructure/ai/CompositeAgentExecutor.d.ts.map +1 -0
  16. package/dist/infrastructure/ai/CompositeAgentExecutor.js +5 -0
  17. package/dist/infrastructure/ai/CompositeAgentExecutor.js.map +1 -0
  18. package/dist/infrastructure/ai/ContainerAgentExecutor.d.ts +2 -0
  19. package/dist/infrastructure/ai/ContainerAgentExecutor.d.ts.map +1 -0
  20. package/dist/infrastructure/ai/ContainerAgentExecutor.js +5 -0
  21. package/dist/infrastructure/ai/ContainerAgentExecutor.js.map +1 -0
  22. package/dist/infrastructure/ai/ContainerRepoBootstrapper.d.ts +2 -0
  23. package/dist/infrastructure/ai/ContainerRepoBootstrapper.d.ts.map +1 -0
  24. package/dist/infrastructure/ai/ContainerRepoBootstrapper.js +5 -0
  25. package/dist/infrastructure/ai/ContainerRepoBootstrapper.js.map +1 -0
  26. package/dist/infrastructure/ai/ContainerRepoScanner.d.ts +39 -0
  27. package/dist/infrastructure/ai/ContainerRepoScanner.d.ts.map +1 -0
  28. package/dist/infrastructure/ai/ContainerRepoScanner.js +115 -0
  29. package/dist/infrastructure/ai/ContainerRepoScanner.js.map +1 -0
  30. package/dist/infrastructure/ai/LlmFragmentSelector.d.ts +2 -0
  31. package/dist/infrastructure/ai/LlmFragmentSelector.d.ts.map +1 -0
  32. package/dist/infrastructure/ai/LlmFragmentSelector.js +4 -0
  33. package/dist/infrastructure/ai/LlmFragmentSelector.js.map +1 -0
  34. package/dist/infrastructure/ai/RunnerJobClient.d.ts +2 -0
  35. package/dist/infrastructure/ai/RunnerJobClient.d.ts.map +1 -0
  36. package/dist/infrastructure/ai/RunnerJobClient.js +5 -0
  37. package/dist/infrastructure/ai/RunnerJobClient.js.map +1 -0
  38. package/dist/infrastructure/ai/WorkersAiLlmUpstream.d.ts +28 -0
  39. package/dist/infrastructure/ai/WorkersAiLlmUpstream.d.ts.map +1 -0
  40. package/dist/infrastructure/ai/WorkersAiLlmUpstream.js +486 -0
  41. package/dist/infrastructure/ai/WorkersAiLlmUpstream.js.map +1 -0
  42. package/dist/infrastructure/ai/providerEndpoints.d.ts +17 -0
  43. package/dist/infrastructure/ai/providerEndpoints.d.ts.map +1 -0
  44. package/dist/infrastructure/ai/providerEndpoints.js +42 -0
  45. package/dist/infrastructure/ai/providerEndpoints.js.map +1 -0
  46. package/dist/infrastructure/ai/registries.d.ts +11 -0
  47. package/dist/infrastructure/ai/registries.d.ts.map +1 -0
  48. package/dist/infrastructure/ai/registries.js +14 -0
  49. package/dist/infrastructure/ai/registries.js.map +1 -0
  50. package/dist/infrastructure/auth/GitHubOAuth.d.ts +2 -0
  51. package/dist/infrastructure/auth/GitHubOAuth.d.ts.map +1 -0
  52. package/dist/infrastructure/auth/GitHubOAuth.js +3 -0
  53. package/dist/infrastructure/auth/GitHubOAuth.js.map +1 -0
  54. package/dist/infrastructure/auth/middleware.d.ts +2 -0
  55. package/dist/infrastructure/auth/middleware.d.ts.map +1 -0
  56. package/dist/infrastructure/auth/middleware.js +3 -0
  57. package/dist/infrastructure/auth/middleware.js.map +1 -0
  58. package/dist/infrastructure/auth/signing.d.ts +3 -0
  59. package/dist/infrastructure/auth/signing.d.ts.map +1 -0
  60. package/dist/infrastructure/auth/signing.js +3 -0
  61. package/dist/infrastructure/auth/signing.js.map +1 -0
  62. package/dist/infrastructure/config/agents.d.ts +6 -0
  63. package/dist/infrastructure/config/agents.d.ts.map +1 -0
  64. package/dist/infrastructure/config/agents.js +100 -0
  65. package/dist/infrastructure/config/agents.js.map +1 -0
  66. package/dist/infrastructure/config/auth.d.ts +13 -0
  67. package/dist/infrastructure/config/auth.d.ts.map +1 -0
  68. package/dist/infrastructure/config/auth.js +80 -0
  69. package/dist/infrastructure/config/auth.js.map +1 -0
  70. package/dist/infrastructure/config/cors.d.ts +2 -0
  71. package/dist/infrastructure/config/cors.d.ts.map +1 -0
  72. package/dist/infrastructure/config/cors.js +3 -0
  73. package/dist/infrastructure/config/cors.js.map +1 -0
  74. package/dist/infrastructure/config/datadog.d.ts +6 -0
  75. package/dist/infrastructure/config/datadog.d.ts.map +1 -0
  76. package/dist/infrastructure/config/datadog.js +22 -0
  77. package/dist/infrastructure/config/datadog.js.map +1 -0
  78. package/dist/infrastructure/config/documents.d.ts +5 -0
  79. package/dist/infrastructure/config/documents.d.ts.map +1 -0
  80. package/dist/infrastructure/config/documents.js +36 -0
  81. package/dist/infrastructure/config/documents.js.map +1 -0
  82. package/dist/infrastructure/config/email.d.ts +5 -0
  83. package/dist/infrastructure/config/email.d.ts.map +1 -0
  84. package/dist/infrastructure/config/email.js +12 -0
  85. package/dist/infrastructure/config/email.js.map +1 -0
  86. package/dist/infrastructure/config/environments.d.ts +5 -0
  87. package/dist/infrastructure/config/environments.d.ts.map +1 -0
  88. package/dist/infrastructure/config/environments.js +15 -0
  89. package/dist/infrastructure/config/environments.js.map +1 -0
  90. package/dist/infrastructure/config/execution.d.ts +5 -0
  91. package/dist/infrastructure/config/execution.d.ts.map +1 -0
  92. package/dist/infrastructure/config/execution.js +21 -0
  93. package/dist/infrastructure/config/execution.js.map +1 -0
  94. package/dist/infrastructure/config/fragmentLibrary.d.ts +5 -0
  95. package/dist/infrastructure/config/fragmentLibrary.d.ts.map +1 -0
  96. package/dist/infrastructure/config/fragmentLibrary.js +7 -0
  97. package/dist/infrastructure/config/fragmentLibrary.js.map +1 -0
  98. package/dist/infrastructure/config/github.d.ts +5 -0
  99. package/dist/infrastructure/config/github.d.ts.map +1 -0
  100. package/dist/infrastructure/config/github.js +25 -0
  101. package/dist/infrastructure/config/github.js.map +1 -0
  102. package/dist/infrastructure/config/index.d.ts +20 -0
  103. package/dist/infrastructure/config/index.d.ts.map +1 -0
  104. package/dist/infrastructure/config/index.js +52 -0
  105. package/dist/infrastructure/config/index.js.map +1 -0
  106. package/dist/infrastructure/config/langfuse.d.ts +10 -0
  107. package/dist/infrastructure/config/langfuse.d.ts.map +1 -0
  108. package/dist/infrastructure/config/langfuse.js +17 -0
  109. package/dist/infrastructure/config/langfuse.js.map +1 -0
  110. package/dist/infrastructure/config/observability.d.ts +10 -0
  111. package/dist/infrastructure/config/observability.d.ts.map +1 -0
  112. package/dist/infrastructure/config/observability.js +11 -0
  113. package/dist/infrastructure/config/observability.js.map +1 -0
  114. package/dist/infrastructure/config/retention.d.ts +5 -0
  115. package/dist/infrastructure/config/retention.d.ts.map +1 -0
  116. package/dist/infrastructure/config/retention.js +15 -0
  117. package/dist/infrastructure/config/retention.js.map +1 -0
  118. package/dist/infrastructure/config/runners.d.ts +5 -0
  119. package/dist/infrastructure/config/runners.d.ts.map +1 -0
  120. package/dist/infrastructure/config/runners.js +13 -0
  121. package/dist/infrastructure/config/runners.js.map +1 -0
  122. package/dist/infrastructure/config/slack.d.ts +5 -0
  123. package/dist/infrastructure/config/slack.d.ts.map +1 -0
  124. package/dist/infrastructure/config/slack.js +17 -0
  125. package/dist/infrastructure/config/slack.js.map +1 -0
  126. package/dist/infrastructure/config/spending.d.ts +4 -0
  127. package/dist/infrastructure/config/spending.d.ts.map +1 -0
  128. package/dist/infrastructure/config/spending.js +36 -0
  129. package/dist/infrastructure/config/spending.js.map +1 -0
  130. package/dist/infrastructure/config/tasks.d.ts +5 -0
  131. package/dist/infrastructure/config/tasks.d.ts.map +1 -0
  132. package/dist/infrastructure/config/tasks.js +31 -0
  133. package/dist/infrastructure/config/tasks.js.map +1 -0
  134. package/dist/infrastructure/config/utils.d.ts +6 -0
  135. package/dist/infrastructure/config/utils.d.ts.map +1 -0
  136. package/dist/infrastructure/config/utils.js +24 -0
  137. package/dist/infrastructure/config/utils.js.map +1 -0
  138. package/dist/infrastructure/container.d.ts +8 -0
  139. package/dist/infrastructure/container.d.ts.map +1 -0
  140. package/dist/infrastructure/container.js +1157 -0
  141. package/dist/infrastructure/container.js.map +1 -0
  142. package/dist/infrastructure/containers/CloudflareContainerTransport.d.ts +22 -0
  143. package/dist/infrastructure/containers/CloudflareContainerTransport.d.ts.map +1 -0
  144. package/dist/infrastructure/containers/CloudflareContainerTransport.js +129 -0
  145. package/dist/infrastructure/containers/CloudflareContainerTransport.js.map +1 -0
  146. package/dist/infrastructure/containers/ContainerInstanceRegistry.d.ts +62 -0
  147. package/dist/infrastructure/containers/ContainerInstanceRegistry.d.ts.map +1 -0
  148. package/dist/infrastructure/containers/ContainerInstanceRegistry.js +74 -0
  149. package/dist/infrastructure/containers/ContainerInstanceRegistry.js.map +1 -0
  150. package/dist/infrastructure/containers/ContainerSessionService.d.ts +2 -0
  151. package/dist/infrastructure/containers/ContainerSessionService.d.ts.map +1 -0
  152. package/dist/infrastructure/containers/ContainerSessionService.js +3 -0
  153. package/dist/infrastructure/containers/ContainerSessionService.js.map +1 -0
  154. package/dist/infrastructure/containers/ExecutionContainer.d.ts +48 -0
  155. package/dist/infrastructure/containers/ExecutionContainer.d.ts.map +1 -0
  156. package/dist/infrastructure/containers/ExecutionContainer.js +88 -0
  157. package/dist/infrastructure/containers/ExecutionContainer.js.map +1 -0
  158. package/dist/infrastructure/documents/ConfluenceProvider.d.ts +29 -0
  159. package/dist/infrastructure/documents/ConfluenceProvider.d.ts.map +1 -0
  160. package/dist/infrastructure/documents/ConfluenceProvider.js +179 -0
  161. package/dist/infrastructure/documents/ConfluenceProvider.js.map +1 -0
  162. package/dist/infrastructure/documents/GitHubDocsProvider.d.ts +42 -0
  163. package/dist/infrastructure/documents/GitHubDocsProvider.d.ts.map +1 -0
  164. package/dist/infrastructure/documents/GitHubDocsProvider.js +85 -0
  165. package/dist/infrastructure/documents/GitHubDocsProvider.js.map +1 -0
  166. package/dist/infrastructure/documents/NotionProvider.d.ts +32 -0
  167. package/dist/infrastructure/documents/NotionProvider.d.ts.map +1 -0
  168. package/dist/infrastructure/documents/NotionProvider.js +220 -0
  169. package/dist/infrastructure/documents/NotionProvider.js.map +1 -0
  170. package/dist/infrastructure/durable-objects/WorkspaceEventsHub.d.ts +20 -0
  171. package/dist/infrastructure/durable-objects/WorkspaceEventsHub.d.ts.map +1 -0
  172. package/dist/infrastructure/durable-objects/WorkspaceEventsHub.js +62 -0
  173. package/dist/infrastructure/durable-objects/WorkspaceEventsHub.js.map +1 -0
  174. package/dist/infrastructure/env.d.ts +370 -0
  175. package/dist/infrastructure/env.d.ts.map +1 -0
  176. package/dist/infrastructure/env.js +2 -0
  177. package/dist/infrastructure/env.js.map +1 -0
  178. package/dist/infrastructure/environments/HttpEnvironmentProvider.d.ts +27 -0
  179. package/dist/infrastructure/environments/HttpEnvironmentProvider.d.ts.map +1 -0
  180. package/dist/infrastructure/environments/HttpEnvironmentProvider.js +314 -0
  181. package/dist/infrastructure/environments/HttpEnvironmentProvider.js.map +1 -0
  182. package/dist/infrastructure/environments/WebCryptoSecretCipher.d.ts +2 -0
  183. package/dist/infrastructure/environments/WebCryptoSecretCipher.d.ts.map +1 -0
  184. package/dist/infrastructure/environments/WebCryptoSecretCipher.js +5 -0
  185. package/dist/infrastructure/environments/WebCryptoSecretCipher.js.map +1 -0
  186. package/dist/infrastructure/environments/sweep.d.ts +5 -0
  187. package/dist/infrastructure/environments/sweep.d.ts.map +1 -0
  188. package/dist/infrastructure/environments/sweep.js +16 -0
  189. package/dist/infrastructure/environments/sweep.js.map +1 -0
  190. package/dist/infrastructure/events/DurableObjectEventPublisher.d.ts +25 -0
  191. package/dist/infrastructure/events/DurableObjectEventPublisher.d.ts.map +1 -0
  192. package/dist/infrastructure/events/DurableObjectEventPublisher.js +64 -0
  193. package/dist/infrastructure/events/DurableObjectEventPublisher.js.map +1 -0
  194. package/dist/infrastructure/events/InAppNotificationChannel.d.ts +19 -0
  195. package/dist/infrastructure/events/InAppNotificationChannel.d.ts.map +1 -0
  196. package/dist/infrastructure/events/InAppNotificationChannel.js +22 -0
  197. package/dist/infrastructure/events/InAppNotificationChannel.js.map +1 -0
  198. package/dist/infrastructure/gateways/DoRealtimeGateway.d.ts +15 -0
  199. package/dist/infrastructure/gateways/DoRealtimeGateway.d.ts.map +1 -0
  200. package/dist/infrastructure/gateways/DoRealtimeGateway.js +20 -0
  201. package/dist/infrastructure/gateways/DoRealtimeGateway.js.map +1 -0
  202. package/dist/infrastructure/gateways/GitHubGateways.d.ts +27 -0
  203. package/dist/infrastructure/gateways/GitHubGateways.d.ts.map +1 -0
  204. package/dist/infrastructure/gateways/GitHubGateways.js +48 -0
  205. package/dist/infrastructure/gateways/GitHubGateways.js.map +1 -0
  206. package/dist/infrastructure/github/FetchGitHubClient.d.ts +2 -0
  207. package/dist/infrastructure/github/FetchGitHubClient.d.ts.map +1 -0
  208. package/dist/infrastructure/github/FetchGitHubClient.js +4 -0
  209. package/dist/infrastructure/github/FetchGitHubClient.js.map +1 -0
  210. package/dist/infrastructure/github/FetchGitHubProvisioningClient.d.ts +2 -0
  211. package/dist/infrastructure/github/FetchGitHubProvisioningClient.d.ts.map +1 -0
  212. package/dist/infrastructure/github/FetchGitHubProvisioningClient.js +5 -0
  213. package/dist/infrastructure/github/FetchGitHubProvisioningClient.js.map +1 -0
  214. package/dist/infrastructure/github/GitHubAppAuth.d.ts +2 -0
  215. package/dist/infrastructure/github/GitHubAppAuth.d.ts.map +1 -0
  216. package/dist/infrastructure/github/GitHubAppAuth.js +5 -0
  217. package/dist/infrastructure/github/GitHubAppAuth.js.map +1 -0
  218. package/dist/infrastructure/github/GitHubAppRegistry.d.ts +2 -0
  219. package/dist/infrastructure/github/GitHubAppRegistry.d.ts.map +1 -0
  220. package/dist/infrastructure/github/GitHubAppRegistry.js +4 -0
  221. package/dist/infrastructure/github/GitHubAppRegistry.js.map +1 -0
  222. package/dist/infrastructure/github/GitHubCiStatusProvider.d.ts +2 -0
  223. package/dist/infrastructure/github/GitHubCiStatusProvider.d.ts.map +1 -0
  224. package/dist/infrastructure/github/GitHubCiStatusProvider.js +4 -0
  225. package/dist/infrastructure/github/GitHubCiStatusProvider.js.map +1 -0
  226. package/dist/infrastructure/github/GitHubMergeabilityProvider.d.ts +2 -0
  227. package/dist/infrastructure/github/GitHubMergeabilityProvider.d.ts.map +1 -0
  228. package/dist/infrastructure/github/GitHubMergeabilityProvider.js +4 -0
  229. package/dist/infrastructure/github/GitHubMergeabilityProvider.js.map +1 -0
  230. package/dist/infrastructure/github/GitHubPullRequestMerger.d.ts +2 -0
  231. package/dist/infrastructure/github/GitHubPullRequestMerger.d.ts.map +1 -0
  232. package/dist/infrastructure/github/GitHubPullRequestMerger.js +4 -0
  233. package/dist/infrastructure/github/GitHubPullRequestMerger.js.map +1 -0
  234. package/dist/infrastructure/github/WebCryptoWebhookVerifier.d.ts +2 -0
  235. package/dist/infrastructure/github/WebCryptoWebhookVerifier.d.ts.map +1 -0
  236. package/dist/infrastructure/github/WebCryptoWebhookVerifier.js +5 -0
  237. package/dist/infrastructure/github/WebCryptoWebhookVerifier.js.map +1 -0
  238. package/dist/infrastructure/github/encoding.d.ts +2 -0
  239. package/dist/infrastructure/github/encoding.d.ts.map +1 -0
  240. package/dist/infrastructure/github/encoding.js +3 -0
  241. package/dist/infrastructure/github/encoding.js.map +1 -0
  242. package/dist/infrastructure/github/state.d.ts +2 -0
  243. package/dist/infrastructure/github/state.d.ts.map +1 -0
  244. package/dist/infrastructure/github/state.js +3 -0
  245. package/dist/infrastructure/github/state.js.map +1 -0
  246. package/dist/infrastructure/github/sync-consumer.d.ts +16 -0
  247. package/dist/infrastructure/github/sync-consumer.d.ts.map +1 -0
  248. package/dist/infrastructure/github/sync-consumer.js +130 -0
  249. package/dist/infrastructure/github/sync-consumer.js.map +1 -0
  250. package/dist/infrastructure/http/errorHandler.d.ts +2 -0
  251. package/dist/infrastructure/http/errorHandler.d.ts.map +1 -0
  252. package/dist/infrastructure/http/errorHandler.js +3 -0
  253. package/dist/infrastructure/http/errorHandler.js.map +1 -0
  254. package/dist/infrastructure/http/params.d.ts +2 -0
  255. package/dist/infrastructure/http/params.d.ts.map +1 -0
  256. package/dist/infrastructure/http/params.js +3 -0
  257. package/dist/infrastructure/http/params.js.map +1 -0
  258. package/dist/infrastructure/http/types.d.ts +12 -0
  259. package/dist/infrastructure/http/types.d.ts.map +1 -0
  260. package/dist/infrastructure/http/types.js +2 -0
  261. package/dist/infrastructure/http/types.js.map +1 -0
  262. package/dist/infrastructure/http/validation.d.ts +2 -0
  263. package/dist/infrastructure/http/validation.d.ts.map +1 -0
  264. package/dist/infrastructure/http/validation.js +3 -0
  265. package/dist/infrastructure/http/validation.js.map +1 -0
  266. package/dist/infrastructure/observability/logger.d.ts +3 -0
  267. package/dist/infrastructure/observability/logger.d.ts.map +1 -0
  268. package/dist/infrastructure/observability/logger.js +4 -0
  269. package/dist/infrastructure/observability/logger.js.map +1 -0
  270. package/dist/infrastructure/repositories/D1AccountInvitationRepository.d.ts +15 -0
  271. package/dist/infrastructure/repositories/D1AccountInvitationRepository.d.ts.map +1 -0
  272. package/dist/infrastructure/repositories/D1AccountInvitationRepository.js +63 -0
  273. package/dist/infrastructure/repositories/D1AccountInvitationRepository.js.map +1 -0
  274. package/dist/infrastructure/repositories/D1AccountRepository.d.ts +15 -0
  275. package/dist/infrastructure/repositories/D1AccountRepository.d.ts.map +1 -0
  276. package/dist/infrastructure/repositories/D1AccountRepository.js +52 -0
  277. package/dist/infrastructure/repositories/D1AccountRepository.js.map +1 -0
  278. package/dist/infrastructure/repositories/D1AgentRunRepository.d.ts +18 -0
  279. package/dist/infrastructure/repositories/D1AgentRunRepository.d.ts.map +1 -0
  280. package/dist/infrastructure/repositories/D1AgentRunRepository.js +34 -0
  281. package/dist/infrastructure/repositories/D1AgentRunRepository.js.map +1 -0
  282. package/dist/infrastructure/repositories/D1BlockRepository.d.ts +23 -0
  283. package/dist/infrastructure/repositories/D1BlockRepository.d.ts.map +1 -0
  284. package/dist/infrastructure/repositories/D1BlockRepository.js +101 -0
  285. package/dist/infrastructure/repositories/D1BlockRepository.js.map +1 -0
  286. package/dist/infrastructure/repositories/D1BootstrapJobRepository.d.ts +16 -0
  287. package/dist/infrastructure/repositories/D1BootstrapJobRepository.d.ts.map +1 -0
  288. package/dist/infrastructure/repositories/D1BootstrapJobRepository.js +209 -0
  289. package/dist/infrastructure/repositories/D1BootstrapJobRepository.js.map +1 -0
  290. package/dist/infrastructure/repositories/D1BranchProjectionRepository.d.ts +12 -0
  291. package/dist/infrastructure/repositories/D1BranchProjectionRepository.d.ts.map +1 -0
  292. package/dist/infrastructure/repositories/D1BranchProjectionRepository.js +29 -0
  293. package/dist/infrastructure/repositories/D1BranchProjectionRepository.js.map +1 -0
  294. package/dist/infrastructure/repositories/D1CheckRunProjectionRepository.d.ts +12 -0
  295. package/dist/infrastructure/repositories/D1CheckRunProjectionRepository.d.ts.map +1 -0
  296. package/dist/infrastructure/repositories/D1CheckRunProjectionRepository.js +29 -0
  297. package/dist/infrastructure/repositories/D1CheckRunProjectionRepository.js.map +1 -0
  298. package/dist/infrastructure/repositories/D1ClarityReviewRepository.d.ts +19 -0
  299. package/dist/infrastructure/repositories/D1ClarityReviewRepository.d.ts.map +1 -0
  300. package/dist/infrastructure/repositories/D1ClarityReviewRepository.js +75 -0
  301. package/dist/infrastructure/repositories/D1ClarityReviewRepository.js.map +1 -0
  302. package/dist/infrastructure/repositories/D1CommitProjectionRepository.d.ts +13 -0
  303. package/dist/infrastructure/repositories/D1CommitProjectionRepository.d.ts.map +1 -0
  304. package/dist/infrastructure/repositories/D1CommitProjectionRepository.js +48 -0
  305. package/dist/infrastructure/repositories/D1CommitProjectionRepository.js.map +1 -0
  306. package/dist/infrastructure/repositories/D1ConsensusSessionRepository.d.ts +19 -0
  307. package/dist/infrastructure/repositories/D1ConsensusSessionRepository.d.ts.map +1 -0
  308. package/dist/infrastructure/repositories/D1ConsensusSessionRepository.js +88 -0
  309. package/dist/infrastructure/repositories/D1ConsensusSessionRepository.js.map +1 -0
  310. package/dist/infrastructure/repositories/D1DatadogConnectionRepository.d.ts +17 -0
  311. package/dist/infrastructure/repositories/D1DatadogConnectionRepository.d.ts.map +1 -0
  312. package/dist/infrastructure/repositories/D1DatadogConnectionRepository.js +47 -0
  313. package/dist/infrastructure/repositories/D1DatadogConnectionRepository.js.map +1 -0
  314. package/dist/infrastructure/repositories/D1DocumentConnectionRepository.d.ts +27 -0
  315. package/dist/infrastructure/repositories/D1DocumentConnectionRepository.d.ts.map +1 -0
  316. package/dist/infrastructure/repositories/D1DocumentConnectionRepository.js +89 -0
  317. package/dist/infrastructure/repositories/D1DocumentConnectionRepository.js.map +1 -0
  318. package/dist/infrastructure/repositories/D1DocumentRepository.d.ts +15 -0
  319. package/dist/infrastructure/repositories/D1DocumentRepository.d.ts.map +1 -0
  320. package/dist/infrastructure/repositories/D1DocumentRepository.js +66 -0
  321. package/dist/infrastructure/repositories/D1DocumentRepository.js.map +1 -0
  322. package/dist/infrastructure/repositories/D1EmailConnectionRepository.d.ts +13 -0
  323. package/dist/infrastructure/repositories/D1EmailConnectionRepository.d.ts.map +1 -0
  324. package/dist/infrastructure/repositories/D1EmailConnectionRepository.js +46 -0
  325. package/dist/infrastructure/repositories/D1EmailConnectionRepository.js.map +1 -0
  326. package/dist/infrastructure/repositories/D1EnvironmentConnectionRepository.d.ts +13 -0
  327. package/dist/infrastructure/repositories/D1EnvironmentConnectionRepository.d.ts.map +1 -0
  328. package/dist/infrastructure/repositories/D1EnvironmentConnectionRepository.js +48 -0
  329. package/dist/infrastructure/repositories/D1EnvironmentConnectionRepository.js.map +1 -0
  330. package/dist/infrastructure/repositories/D1EnvironmentRegistryRepository.d.ts +17 -0
  331. package/dist/infrastructure/repositories/D1EnvironmentRegistryRepository.d.ts.map +1 -0
  332. package/dist/infrastructure/repositories/D1EnvironmentRegistryRepository.js +95 -0
  333. package/dist/infrastructure/repositories/D1EnvironmentRegistryRepository.js.map +1 -0
  334. package/dist/infrastructure/repositories/D1ExecutionRepository.d.ts +28 -0
  335. package/dist/infrastructure/repositories/D1ExecutionRepository.d.ts.map +1 -0
  336. package/dist/infrastructure/repositories/D1ExecutionRepository.js +113 -0
  337. package/dist/infrastructure/repositories/D1ExecutionRepository.js.map +1 -0
  338. package/dist/infrastructure/repositories/D1FragmentSourceRepository.d.ts +15 -0
  339. package/dist/infrastructure/repositories/D1FragmentSourceRepository.d.ts.map +1 -0
  340. package/dist/infrastructure/repositories/D1FragmentSourceRepository.js +66 -0
  341. package/dist/infrastructure/repositories/D1FragmentSourceRepository.js.map +1 -0
  342. package/dist/infrastructure/repositories/D1GitHubInstallationRepository.d.ts +17 -0
  343. package/dist/infrastructure/repositories/D1GitHubInstallationRepository.d.ts.map +1 -0
  344. package/dist/infrastructure/repositories/D1GitHubInstallationRepository.js +79 -0
  345. package/dist/infrastructure/repositories/D1GitHubInstallationRepository.js.map +1 -0
  346. package/dist/infrastructure/repositories/D1IssueProjectionRepository.d.ts +13 -0
  347. package/dist/infrastructure/repositories/D1IssueProjectionRepository.d.ts.map +1 -0
  348. package/dist/infrastructure/repositories/D1IssueProjectionRepository.js +36 -0
  349. package/dist/infrastructure/repositories/D1IssueProjectionRepository.js.map +1 -0
  350. package/dist/infrastructure/repositories/D1LiveContainerRepository.d.ts +17 -0
  351. package/dist/infrastructure/repositories/D1LiveContainerRepository.d.ts.map +1 -0
  352. package/dist/infrastructure/repositories/D1LiveContainerRepository.js +40 -0
  353. package/dist/infrastructure/repositories/D1LiveContainerRepository.js.map +1 -0
  354. package/dist/infrastructure/repositories/D1LlmCallMetricRepository.d.ts +15 -0
  355. package/dist/infrastructure/repositories/D1LlmCallMetricRepository.d.ts.map +1 -0
  356. package/dist/infrastructure/repositories/D1LlmCallMetricRepository.js +123 -0
  357. package/dist/infrastructure/repositories/D1LlmCallMetricRepository.js.map +1 -0
  358. package/dist/infrastructure/repositories/D1LocalModelEndpointRepository.d.ts +15 -0
  359. package/dist/infrastructure/repositories/D1LocalModelEndpointRepository.d.ts.map +1 -0
  360. package/dist/infrastructure/repositories/D1LocalModelEndpointRepository.js +63 -0
  361. package/dist/infrastructure/repositories/D1LocalModelEndpointRepository.js.map +1 -0
  362. package/dist/infrastructure/repositories/D1MembershipRepository.d.ts +15 -0
  363. package/dist/infrastructure/repositories/D1MembershipRepository.d.ts.map +1 -0
  364. package/dist/infrastructure/repositories/D1MembershipRepository.js +58 -0
  365. package/dist/infrastructure/repositories/D1MembershipRepository.js.map +1 -0
  366. package/dist/infrastructure/repositories/D1MergePresetRepository.d.ts +21 -0
  367. package/dist/infrastructure/repositories/D1MergePresetRepository.d.ts.map +1 -0
  368. package/dist/infrastructure/repositories/D1MergePresetRepository.js +88 -0
  369. package/dist/infrastructure/repositories/D1MergePresetRepository.js.map +1 -0
  370. package/dist/infrastructure/repositories/D1ModelDefaultsRepository.d.ts +18 -0
  371. package/dist/infrastructure/repositories/D1ModelDefaultsRepository.d.ts.map +1 -0
  372. package/dist/infrastructure/repositories/D1ModelDefaultsRepository.js +47 -0
  373. package/dist/infrastructure/repositories/D1ModelDefaultsRepository.js.map +1 -0
  374. package/dist/infrastructure/repositories/D1NotificationRepository.d.ts +20 -0
  375. package/dist/infrastructure/repositories/D1NotificationRepository.d.ts.map +1 -0
  376. package/dist/infrastructure/repositories/D1NotificationRepository.js +81 -0
  377. package/dist/infrastructure/repositories/D1NotificationRepository.js.map +1 -0
  378. package/dist/infrastructure/repositories/D1PersonalSubscriptionRepository.d.ts +28 -0
  379. package/dist/infrastructure/repositories/D1PersonalSubscriptionRepository.d.ts.map +1 -0
  380. package/dist/infrastructure/repositories/D1PersonalSubscriptionRepository.js +142 -0
  381. package/dist/infrastructure/repositories/D1PersonalSubscriptionRepository.js.map +1 -0
  382. package/dist/infrastructure/repositories/D1PipelineRepository.d.ts +15 -0
  383. package/dist/infrastructure/repositories/D1PipelineRepository.d.ts.map +1 -0
  384. package/dist/infrastructure/repositories/D1PipelineRepository.js +46 -0
  385. package/dist/infrastructure/repositories/D1PipelineRepository.js.map +1 -0
  386. package/dist/infrastructure/repositories/D1PipelineScheduleRepository.d.ts +26 -0
  387. package/dist/infrastructure/repositories/D1PipelineScheduleRepository.d.ts.map +1 -0
  388. package/dist/infrastructure/repositories/D1PipelineScheduleRepository.js +192 -0
  389. package/dist/infrastructure/repositories/D1PipelineScheduleRepository.js.map +1 -0
  390. package/dist/infrastructure/repositories/D1PromptFragmentRepository.d.ts +15 -0
  391. package/dist/infrastructure/repositories/D1PromptFragmentRepository.d.ts.map +1 -0
  392. package/dist/infrastructure/repositories/D1PromptFragmentRepository.js +90 -0
  393. package/dist/infrastructure/repositories/D1PromptFragmentRepository.js.map +1 -0
  394. package/dist/infrastructure/repositories/D1ProviderApiKeyRepository.d.ts +21 -0
  395. package/dist/infrastructure/repositories/D1ProviderApiKeyRepository.d.ts.map +1 -0
  396. package/dist/infrastructure/repositories/D1ProviderApiKeyRepository.js +108 -0
  397. package/dist/infrastructure/repositories/D1ProviderApiKeyRepository.js.map +1 -0
  398. package/dist/infrastructure/repositories/D1ProviderSubscriptionTokenRepository.d.ts +19 -0
  399. package/dist/infrastructure/repositories/D1ProviderSubscriptionTokenRepository.d.ts.map +1 -0
  400. package/dist/infrastructure/repositories/D1ProviderSubscriptionTokenRepository.js +78 -0
  401. package/dist/infrastructure/repositories/D1ProviderSubscriptionTokenRepository.js.map +1 -0
  402. package/dist/infrastructure/repositories/D1PullRequestProjectionRepository.d.ts +13 -0
  403. package/dist/infrastructure/repositories/D1PullRequestProjectionRepository.d.ts.map +1 -0
  404. package/dist/infrastructure/repositories/D1PullRequestProjectionRepository.js +32 -0
  405. package/dist/infrastructure/repositories/D1PullRequestProjectionRepository.js.map +1 -0
  406. package/dist/infrastructure/repositories/D1RateLimitRepository.d.ts +18 -0
  407. package/dist/infrastructure/repositories/D1RateLimitRepository.d.ts.map +1 -0
  408. package/dist/infrastructure/repositories/D1RateLimitRepository.js +30 -0
  409. package/dist/infrastructure/repositories/D1RateLimitRepository.js.map +1 -0
  410. package/dist/infrastructure/repositories/D1ReferenceArchitectureRepository.d.ts +15 -0
  411. package/dist/infrastructure/repositories/D1ReferenceArchitectureRepository.d.ts.map +1 -0
  412. package/dist/infrastructure/repositories/D1ReferenceArchitectureRepository.js +77 -0
  413. package/dist/infrastructure/repositories/D1ReferenceArchitectureRepository.js.map +1 -0
  414. package/dist/infrastructure/repositories/D1ReleaseHealthConfigRepository.d.ts +17 -0
  415. package/dist/infrastructure/repositories/D1ReleaseHealthConfigRepository.d.ts.map +1 -0
  416. package/dist/infrastructure/repositories/D1ReleaseHealthConfigRepository.js +64 -0
  417. package/dist/infrastructure/repositories/D1ReleaseHealthConfigRepository.js.map +1 -0
  418. package/dist/infrastructure/repositories/D1RepoBlueprintRepository.d.ts +20 -0
  419. package/dist/infrastructure/repositories/D1RepoBlueprintRepository.d.ts.map +1 -0
  420. package/dist/infrastructure/repositories/D1RepoBlueprintRepository.js +64 -0
  421. package/dist/infrastructure/repositories/D1RepoBlueprintRepository.js.map +1 -0
  422. package/dist/infrastructure/repositories/D1RepoProjectionRepository.d.ts +20 -0
  423. package/dist/infrastructure/repositories/D1RepoProjectionRepository.d.ts.map +1 -0
  424. package/dist/infrastructure/repositories/D1RepoProjectionRepository.js +121 -0
  425. package/dist/infrastructure/repositories/D1RepoProjectionRepository.js.map +1 -0
  426. package/dist/infrastructure/repositories/D1RequirementReviewRepository.d.ts +20 -0
  427. package/dist/infrastructure/repositories/D1RequirementReviewRepository.d.ts.map +1 -0
  428. package/dist/infrastructure/repositories/D1RequirementReviewRepository.js +76 -0
  429. package/dist/infrastructure/repositories/D1RequirementReviewRepository.js.map +1 -0
  430. package/dist/infrastructure/repositories/D1RunnerPoolConnectionRepository.d.ts +13 -0
  431. package/dist/infrastructure/repositories/D1RunnerPoolConnectionRepository.d.ts.map +1 -0
  432. package/dist/infrastructure/repositories/D1RunnerPoolConnectionRepository.js +48 -0
  433. package/dist/infrastructure/repositories/D1RunnerPoolConnectionRepository.js.map +1 -0
  434. package/dist/infrastructure/repositories/D1ServiceFragmentDefaultsRepository.d.ts +16 -0
  435. package/dist/infrastructure/repositories/D1ServiceFragmentDefaultsRepository.d.ts.map +1 -0
  436. package/dist/infrastructure/repositories/D1ServiceFragmentDefaultsRepository.js +27 -0
  437. package/dist/infrastructure/repositories/D1ServiceFragmentDefaultsRepository.js.map +1 -0
  438. package/dist/infrastructure/repositories/D1ServiceRepository.d.ts +19 -0
  439. package/dist/infrastructure/repositories/D1ServiceRepository.d.ts.map +1 -0
  440. package/dist/infrastructure/repositories/D1ServiceRepository.js +114 -0
  441. package/dist/infrastructure/repositories/D1ServiceRepository.js.map +1 -0
  442. package/dist/infrastructure/repositories/D1SlackRepositories.d.ts +29 -0
  443. package/dist/infrastructure/repositories/D1SlackRepositories.d.ts.map +1 -0
  444. package/dist/infrastructure/repositories/D1SlackRepositories.js +119 -0
  445. package/dist/infrastructure/repositories/D1SlackRepositories.js.map +1 -0
  446. package/dist/infrastructure/repositories/D1TaskConnectionRepository.d.ts +27 -0
  447. package/dist/infrastructure/repositories/D1TaskConnectionRepository.d.ts.map +1 -0
  448. package/dist/infrastructure/repositories/D1TaskConnectionRepository.js +89 -0
  449. package/dist/infrastructure/repositories/D1TaskConnectionRepository.js.map +1 -0
  450. package/dist/infrastructure/repositories/D1TaskRepository.d.ts +15 -0
  451. package/dist/infrastructure/repositories/D1TaskRepository.d.ts.map +1 -0
  452. package/dist/infrastructure/repositories/D1TaskRepository.js +90 -0
  453. package/dist/infrastructure/repositories/D1TaskRepository.js.map +1 -0
  454. package/dist/infrastructure/repositories/D1TokenUsageRepository.d.ts +13 -0
  455. package/dist/infrastructure/repositories/D1TokenUsageRepository.d.ts.map +1 -0
  456. package/dist/infrastructure/repositories/D1TokenUsageRepository.js +41 -0
  457. package/dist/infrastructure/repositories/D1TokenUsageRepository.js.map +1 -0
  458. package/dist/infrastructure/repositories/D1TrackerSettingsRepository.d.ts +12 -0
  459. package/dist/infrastructure/repositories/D1TrackerSettingsRepository.d.ts.map +1 -0
  460. package/dist/infrastructure/repositories/D1TrackerSettingsRepository.js +32 -0
  461. package/dist/infrastructure/repositories/D1TrackerSettingsRepository.js.map +1 -0
  462. package/dist/infrastructure/repositories/D1UserRepository.d.ts +19 -0
  463. package/dist/infrastructure/repositories/D1UserRepository.d.ts.map +1 -0
  464. package/dist/infrastructure/repositories/D1UserRepository.js +108 -0
  465. package/dist/infrastructure/repositories/D1UserRepository.js.map +1 -0
  466. package/dist/infrastructure/repositories/D1WorkspaceMountRepository.d.ts +19 -0
  467. package/dist/infrastructure/repositories/D1WorkspaceMountRepository.d.ts.map +1 -0
  468. package/dist/infrastructure/repositories/D1WorkspaceMountRepository.js +115 -0
  469. package/dist/infrastructure/repositories/D1WorkspaceMountRepository.js.map +1 -0
  470. package/dist/infrastructure/repositories/D1WorkspaceRepository.d.ts +18 -0
  471. package/dist/infrastructure/repositories/D1WorkspaceRepository.d.ts.map +1 -0
  472. package/dist/infrastructure/repositories/D1WorkspaceRepository.js +77 -0
  473. package/dist/infrastructure/repositories/D1WorkspaceRepository.js.map +1 -0
  474. package/dist/infrastructure/repositories/D1WorkspaceSettingsRepository.d.ts +17 -0
  475. package/dist/infrastructure/repositories/D1WorkspaceSettingsRepository.d.ts.map +1 -0
  476. package/dist/infrastructure/repositories/D1WorkspaceSettingsRepository.js +50 -0
  477. package/dist/infrastructure/repositories/D1WorkspaceSettingsRepository.js.map +1 -0
  478. package/dist/infrastructure/repositories/chunk.d.ts +11 -0
  479. package/dist/infrastructure/repositories/chunk.d.ts.map +1 -0
  480. package/dist/infrastructure/repositories/chunk.js +17 -0
  481. package/dist/infrastructure/repositories/chunk.js.map +1 -0
  482. package/dist/infrastructure/repositories/github-mappers/branch.d.ts +11 -0
  483. package/dist/infrastructure/repositories/github-mappers/branch.d.ts.map +1 -0
  484. package/dist/infrastructure/repositories/github-mappers/branch.js +22 -0
  485. package/dist/infrastructure/repositories/github-mappers/branch.js.map +1 -0
  486. package/dist/infrastructure/repositories/github-mappers/check-run.d.ts +13 -0
  487. package/dist/infrastructure/repositories/github-mappers/check-run.d.ts.map +1 -0
  488. package/dist/infrastructure/repositories/github-mappers/check-run.js +24 -0
  489. package/dist/infrastructure/repositories/github-mappers/check-run.js.map +1 -0
  490. package/dist/infrastructure/repositories/github-mappers/commit.d.ts +12 -0
  491. package/dist/infrastructure/repositories/github-mappers/commit.d.ts.map +1 -0
  492. package/dist/infrastructure/repositories/github-mappers/commit.js +22 -0
  493. package/dist/infrastructure/repositories/github-mappers/commit.js.map +1 -0
  494. package/dist/infrastructure/repositories/github-mappers/index.d.ts +11 -0
  495. package/dist/infrastructure/repositories/github-mappers/index.d.ts.map +1 -0
  496. package/dist/infrastructure/repositories/github-mappers/index.js +14 -0
  497. package/dist/infrastructure/repositories/github-mappers/index.js.map +1 -0
  498. package/dist/infrastructure/repositories/github-mappers/installation.d.ts +16 -0
  499. package/dist/infrastructure/repositories/github-mappers/installation.d.ts.map +1 -0
  500. package/dist/infrastructure/repositories/github-mappers/installation.js +29 -0
  501. package/dist/infrastructure/repositories/github-mappers/installation.js.map +1 -0
  502. package/dist/infrastructure/repositories/github-mappers/issue.d.ts +15 -0
  503. package/dist/infrastructure/repositories/github-mappers/issue.d.ts.map +1 -0
  504. package/dist/infrastructure/repositories/github-mappers/issue.js +29 -0
  505. package/dist/infrastructure/repositories/github-mappers/issue.js.map +1 -0
  506. package/dist/infrastructure/repositories/github-mappers/pull-request.d.ts +18 -0
  507. package/dist/infrastructure/repositories/github-mappers/pull-request.d.ts.map +1 -0
  508. package/dist/infrastructure/repositories/github-mappers/pull-request.js +36 -0
  509. package/dist/infrastructure/repositories/github-mappers/pull-request.js.map +1 -0
  510. package/dist/infrastructure/repositories/github-mappers/repo.d.ts +15 -0
  511. package/dist/infrastructure/repositories/github-mappers/repo.d.ts.map +1 -0
  512. package/dist/infrastructure/repositories/github-mappers/repo.js +31 -0
  513. package/dist/infrastructure/repositories/github-mappers/repo.js.map +1 -0
  514. package/dist/infrastructure/repositories/github-mappers/serialize.d.ts +3 -0
  515. package/dist/infrastructure/repositories/github-mappers/serialize.d.ts.map +1 -0
  516. package/dist/infrastructure/repositories/github-mappers/serialize.js +4 -0
  517. package/dist/infrastructure/repositories/github-mappers/serialize.js.map +1 -0
  518. package/dist/infrastructure/repositories/github-mappers/sync-cursor.d.ts +8 -0
  519. package/dist/infrastructure/repositories/github-mappers/sync-cursor.d.ts.map +1 -0
  520. package/dist/infrastructure/repositories/github-mappers/sync-cursor.js +4 -0
  521. package/dist/infrastructure/repositories/github-mappers/sync-cursor.js.map +1 -0
  522. package/dist/infrastructure/repositories/github-mappers/upsert.d.ts +11 -0
  523. package/dist/infrastructure/repositories/github-mappers/upsert.d.ts.map +1 -0
  524. package/dist/infrastructure/repositories/github-mappers/upsert.js +18 -0
  525. package/dist/infrastructure/repositories/github-mappers/upsert.js.map +1 -0
  526. package/dist/infrastructure/repositories/mappers.d.ts +2 -0
  527. package/dist/infrastructure/repositories/mappers.d.ts.map +1 -0
  528. package/dist/infrastructure/repositories/mappers.js +4 -0
  529. package/dist/infrastructure/repositories/mappers.js.map +1 -0
  530. package/dist/infrastructure/runners/HttpRunnerPoolProvider.d.ts +2 -0
  531. package/dist/infrastructure/runners/HttpRunnerPoolProvider.d.ts.map +1 -0
  532. package/dist/infrastructure/runners/HttpRunnerPoolProvider.js +5 -0
  533. package/dist/infrastructure/runners/HttpRunnerPoolProvider.js.map +1 -0
  534. package/dist/infrastructure/runners/RunnerPoolTransport.d.ts +2 -0
  535. package/dist/infrastructure/runners/RunnerPoolTransport.d.ts.map +1 -0
  536. package/dist/infrastructure/runners/RunnerPoolTransport.js +5 -0
  537. package/dist/infrastructure/runners/RunnerPoolTransport.js.map +1 -0
  538. package/dist/infrastructure/runtime.d.ts +8 -0
  539. package/dist/infrastructure/runtime.d.ts.map +1 -0
  540. package/dist/infrastructure/runtime.js +13 -0
  541. package/dist/infrastructure/runtime.js.map +1 -0
  542. package/dist/infrastructure/tasks/GitHubIssuesProvider.d.ts +50 -0
  543. package/dist/infrastructure/tasks/GitHubIssuesProvider.d.ts.map +1 -0
  544. package/dist/infrastructure/tasks/GitHubIssuesProvider.js +91 -0
  545. package/dist/infrastructure/tasks/GitHubIssuesProvider.js.map +1 -0
  546. package/dist/infrastructure/tasks/JiraProvider.d.ts +29 -0
  547. package/dist/infrastructure/tasks/JiraProvider.d.ts.map +1 -0
  548. package/dist/infrastructure/tasks/JiraProvider.js +109 -0
  549. package/dist/infrastructure/tasks/JiraProvider.js.map +1 -0
  550. package/dist/infrastructure/workflows/BootstrapWorkflow.d.ts +21 -0
  551. package/dist/infrastructure/workflows/BootstrapWorkflow.d.ts.map +1 -0
  552. package/dist/infrastructure/workflows/BootstrapWorkflow.js +72 -0
  553. package/dist/infrastructure/workflows/BootstrapWorkflow.js.map +1 -0
  554. package/dist/infrastructure/workflows/ExecutionWorkflow.d.ts +15 -0
  555. package/dist/infrastructure/workflows/ExecutionWorkflow.d.ts.map +1 -0
  556. package/dist/infrastructure/workflows/ExecutionWorkflow.js +169 -0
  557. package/dist/infrastructure/workflows/ExecutionWorkflow.js.map +1 -0
  558. package/dist/infrastructure/workflows/GitHubBackfillWorkflow.d.ts +17 -0
  559. package/dist/infrastructure/workflows/GitHubBackfillWorkflow.d.ts.map +1 -0
  560. package/dist/infrastructure/workflows/GitHubBackfillWorkflow.js +24 -0
  561. package/dist/infrastructure/workflows/GitHubBackfillWorkflow.js.map +1 -0
  562. package/dist/infrastructure/workflows/WorkflowsBootstrapRunner.d.ts +15 -0
  563. package/dist/infrastructure/workflows/WorkflowsBootstrapRunner.d.ts.map +1 -0
  564. package/dist/infrastructure/workflows/WorkflowsBootstrapRunner.js +34 -0
  565. package/dist/infrastructure/workflows/WorkflowsBootstrapRunner.js.map +1 -0
  566. package/dist/infrastructure/workflows/WorkflowsWorkRunner.d.ts +31 -0
  567. package/dist/infrastructure/workflows/WorkflowsWorkRunner.d.ts.map +1 -0
  568. package/dist/infrastructure/workflows/WorkflowsWorkRunner.js +55 -0
  569. package/dist/infrastructure/workflows/WorkflowsWorkRunner.js.map +1 -0
  570. package/dist/infrastructure/workflows/retention.d.ts +35 -0
  571. package/dist/infrastructure/workflows/retention.d.ts.map +1 -0
  572. package/dist/infrastructure/workflows/retention.js +26 -0
  573. package/dist/infrastructure/workflows/retention.js.map +1 -0
  574. package/dist/infrastructure/workflows/sweeper.d.ts +57 -0
  575. package/dist/infrastructure/workflows/sweeper.d.ts.map +1 -0
  576. package/dist/infrastructure/workflows/sweeper.js +62 -0
  577. package/dist/infrastructure/workflows/sweeper.js.map +1 -0
  578. package/migrations/0001_init.sql +677 -0
  579. package/migrations/0002_clarity_reviews.sql +19 -0
  580. package/migrations/0002_consensus.sql +38 -0
  581. package/migrations/0002_llm_reasoning_text.sql +6 -0
  582. package/migrations/0002_local_model_endpoints.sql +16 -0
  583. package/migrations/0003_pipeline_labels_archive.sql +13 -0
  584. package/migrations/0003_release_health.sql +34 -0
  585. package/migrations/0004_run_timing_task_types.sql +24 -0
  586. package/package.json +65 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1EmailConnectionRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1EmailConnectionRepository.ts"],"names":[],"mappings":"AAiBA,SAAS,WAAW,CAAC,GAAuB;IAC1C,OAAO;QACL,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,QAAQ,EAAE,GAAG,CAAC,QAA6B;QAC3C,WAAW,EAAE,GAAG,CAAC,YAAY;QAC7B,YAAY,EAAE,GAAG,CAAC,cAAc;QAChC,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,SAAS,EAAE,GAAG,CAAC,UAAU;KAC1B,CAAA;AACH,CAAC;AAED,+EAA+E;AAC/E,MAAM,OAAO,2BAA2B;IACrB,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAsB;QACpC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,SAAiB;QAClC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,EAAE;aACtB,OAAO,CAAC,6EAA6E,CAAC;aACtF,IAAI,CAAC,SAAS,CAAC;aACf,KAAK,EAAsB,CAAA;QAC9B,OAAO,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACtC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAA6B;QACxC,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CACN;;;;;;;;4CAQoC,CACrC;aACA,IAAI,CACH,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,YAAY,EACnB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,SAAS,CACjB;aACA,GAAG,EAAE,CAAA;IACV,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,SAAiB,EAAE,EAAU;QAC5C,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CAAC,kFAAkF,CAAC;aAC3F,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC;aACvB,GAAG,EAAE,CAAA;IACV,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ import type { EnvironmentConnectionRecord, EnvironmentConnectionRepository } from '@cat-factory/kernel';
2
+ import type { D1Database } from '@cloudflare/workers-types';
3
+ /** D1-backed store of workspace → environment provider bindings (migration 0008). */
4
+ export declare class D1EnvironmentConnectionRepository implements EnvironmentConnectionRepository {
5
+ private readonly db;
6
+ constructor({ db }: {
7
+ db: D1Database;
8
+ });
9
+ getByWorkspace(workspaceId: string): Promise<EnvironmentConnectionRecord | null>;
10
+ upsert(record: EnvironmentConnectionRecord): Promise<void>;
11
+ softDelete(workspaceId: string, at: number): Promise<void>;
12
+ }
13
+ //# sourceMappingURL=D1EnvironmentConnectionRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1EnvironmentConnectionRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1EnvironmentConnectionRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,+BAA+B,EAChC,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AA0B3D,qFAAqF;AACrF,qBAAa,iCAAkC,YAAW,+BAA+B;IACvF,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,UAAU,CAAA;KAAE,EAErC;IAEK,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAQrF;IAEK,MAAM,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB/D;IAEK,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO/D;CACF"}
@@ -0,0 +1,48 @@
1
+ function rowToRecord(row) {
2
+ return {
3
+ workspaceId: row.workspace_id,
4
+ providerId: row.provider_id,
5
+ label: row.label,
6
+ baseUrl: row.base_url,
7
+ manifestJson: row.manifest_json,
8
+ secretsCipher: row.secrets_cipher,
9
+ createdAt: row.created_at,
10
+ deletedAt: row.deleted_at,
11
+ };
12
+ }
13
+ /** D1-backed store of workspace → environment provider bindings (migration 0008). */
14
+ export class D1EnvironmentConnectionRepository {
15
+ db;
16
+ constructor({ db }) {
17
+ this.db = db;
18
+ }
19
+ async getByWorkspace(workspaceId) {
20
+ const row = await this.db
21
+ .prepare('SELECT * FROM environment_connections WHERE workspace_id = ? AND deleted_at IS NULL')
22
+ .bind(workspaceId)
23
+ .first();
24
+ return row ? rowToRecord(row) : null;
25
+ }
26
+ async upsert(record) {
27
+ // A workspace has a single live provider: clear any prior binding (live or
28
+ // tombstoned) before inserting, so re-registering a different provider can't
29
+ // collide on the (workspace_id, provider_id) primary key.
30
+ await this.db
31
+ .prepare('DELETE FROM environment_connections WHERE workspace_id = ?')
32
+ .bind(record.workspaceId)
33
+ .run();
34
+ await this.db
35
+ .prepare(`INSERT INTO environment_connections
36
+ (workspace_id, provider_id, label, base_url, manifest_json, secrets_cipher, created_at, deleted_at)
37
+ VALUES (?, ?, ?, ?, ?, ?, ?, NULL)`)
38
+ .bind(record.workspaceId, record.providerId, record.label, record.baseUrl, record.manifestJson, record.secretsCipher, record.createdAt)
39
+ .run();
40
+ }
41
+ async softDelete(workspaceId, at) {
42
+ await this.db
43
+ .prepare('UPDATE environment_connections SET deleted_at = ? WHERE workspace_id = ? AND deleted_at IS NULL')
44
+ .bind(at, workspaceId)
45
+ .run();
46
+ }
47
+ }
48
+ //# sourceMappingURL=D1EnvironmentConnectionRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1EnvironmentConnectionRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1EnvironmentConnectionRepository.ts"],"names":[],"mappings":"AAiBA,SAAS,WAAW,CAAC,GAA6B;IAChD,OAAO;QACL,WAAW,EAAE,GAAG,CAAC,YAAY;QAC7B,UAAU,EAAE,GAAG,CAAC,WAAW;QAC3B,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,OAAO,EAAE,GAAG,CAAC,QAAQ;QACrB,YAAY,EAAE,GAAG,CAAC,aAAa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@@ -0,0 +1,17 @@
1
+ import type { EnvironmentRecord, EnvironmentRecordPatch, EnvironmentRegistryRepository } from '@cat-factory/kernel';
2
+ import type { D1Database } from '@cloudflare/workers-types';
3
+ /** D1-backed registry of provisioned environments (migration 0008). */
4
+ export declare class D1EnvironmentRegistryRepository implements EnvironmentRegistryRepository {
5
+ private readonly db;
6
+ constructor({ db }: {
7
+ db: D1Database;
8
+ });
9
+ insert(record: EnvironmentRecord): Promise<void>;
10
+ update(workspaceId: string, id: string, patch: EnvironmentRecordPatch): Promise<void>;
11
+ get(workspaceId: string, id: string): Promise<EnvironmentRecord | null>;
12
+ getByBlock(workspaceId: string, blockId: string): Promise<EnvironmentRecord | null>;
13
+ listByWorkspace(workspaceId: string): Promise<EnvironmentRecord[]>;
14
+ listExpired(nowEpochMs: number): Promise<EnvironmentRecord[]>;
15
+ softDelete(workspaceId: string, id: string, at: number): Promise<void>;
16
+ }
17
+ //# sourceMappingURL=D1EnvironmentRegistryRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1EnvironmentRegistryRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1EnvironmentRegistryRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACtB,6BAA6B,EAC9B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAiD3D,uEAAuE;AACvE,qBAAa,+BAAgC,YAAW,6BAA6B;IACnF,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,UAAU,CAAA;KAAE,EAErC;IAEK,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBrD;IAEK,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAa1F;IAEK,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAQ5E;IAEK,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAUxF;IAEK,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAQvE;IAEK,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CASlE;IAEK,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO3E;CACF"}
@@ -0,0 +1,95 @@
1
+ function rowToRecord(row) {
2
+ return {
3
+ id: row.id,
4
+ workspaceId: row.workspace_id,
5
+ blockId: row.block_id,
6
+ executionId: row.execution_id,
7
+ providerId: row.provider_id,
8
+ externalId: row.external_id,
9
+ url: row.url,
10
+ status: row.status,
11
+ accessCipher: row.access_cipher,
12
+ provisionFieldsCipher: row.provision_fields_cipher,
13
+ createdAt: row.created_at,
14
+ expiresAt: row.expires_at,
15
+ lastError: row.last_error,
16
+ deletedAt: row.deleted_at,
17
+ };
18
+ }
19
+ /** Maps a patch field name to its DB column. */
20
+ const PATCH_COLUMNS = {
21
+ externalId: 'external_id',
22
+ url: 'url',
23
+ status: 'status',
24
+ accessCipher: 'access_cipher',
25
+ provisionFieldsCipher: 'provision_fields_cipher',
26
+ expiresAt: 'expires_at',
27
+ lastError: 'last_error',
28
+ };
29
+ /** D1-backed registry of provisioned environments (migration 0008). */
30
+ export class D1EnvironmentRegistryRepository {
31
+ db;
32
+ constructor({ db }) {
33
+ this.db = db;
34
+ }
35
+ async insert(record) {
36
+ await this.db
37
+ .prepare(`INSERT INTO environments
38
+ (id, workspace_id, block_id, execution_id, provider_id, external_id, url, status,
39
+ access_cipher, provision_fields_cipher, created_at, expires_at, last_error, deleted_at)
40
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NULL)`)
41
+ .bind(record.id, record.workspaceId, record.blockId, record.executionId, record.providerId, record.externalId, record.url, record.status, record.accessCipher, record.provisionFieldsCipher, record.createdAt, record.expiresAt, record.lastError)
42
+ .run();
43
+ }
44
+ async update(workspaceId, id, patch) {
45
+ const entries = Object.entries(patch).filter(([, value]) => value !== undefined);
46
+ if (entries.length === 0)
47
+ return;
48
+ const setClause = entries
49
+ .map(([key]) => `${PATCH_COLUMNS[key]} = ?`)
50
+ .join(', ');
51
+ const values = entries.map(([, value]) => value);
52
+ await this.db
53
+ .prepare(`UPDATE environments SET ${setClause} WHERE workspace_id = ? AND id = ? AND deleted_at IS NULL`)
54
+ .bind(...values, workspaceId, id)
55
+ .run();
56
+ }
57
+ async get(workspaceId, id) {
58
+ const row = await this.db
59
+ .prepare('SELECT * FROM environments WHERE workspace_id = ? AND id = ? AND deleted_at IS NULL')
60
+ .bind(workspaceId, id)
61
+ .first();
62
+ return row ? rowToRecord(row) : null;
63
+ }
64
+ async getByBlock(workspaceId, blockId) {
65
+ const row = await this.db
66
+ .prepare(`SELECT * FROM environments
67
+ WHERE workspace_id = ? AND block_id = ? AND deleted_at IS NULL
68
+ ORDER BY created_at DESC LIMIT 1`)
69
+ .bind(workspaceId, blockId)
70
+ .first();
71
+ return row ? rowToRecord(row) : null;
72
+ }
73
+ async listByWorkspace(workspaceId) {
74
+ const { results } = await this.db
75
+ .prepare('SELECT * FROM environments WHERE workspace_id = ? AND deleted_at IS NULL ORDER BY created_at DESC')
76
+ .bind(workspaceId)
77
+ .all();
78
+ return (results ?? []).map(rowToRecord);
79
+ }
80
+ async listExpired(nowEpochMs) {
81
+ const { results } = await this.db
82
+ .prepare(`SELECT * FROM environments
83
+ WHERE deleted_at IS NULL AND expires_at IS NOT NULL AND expires_at <= ?`)
84
+ .bind(nowEpochMs)
85
+ .all();
86
+ return (results ?? []).map(rowToRecord);
87
+ }
88
+ async softDelete(workspaceId, id, at) {
89
+ await this.db
90
+ .prepare('UPDATE environments SET deleted_at = ? WHERE workspace_id = ? AND id = ? AND deleted_at IS NULL')
91
+ .bind(at, workspaceId, id)
92
+ .run();
93
+ }
94
+ }
95
+ //# sourceMappingURL=D1EnvironmentRegistryRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1EnvironmentRegistryRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1EnvironmentRegistryRepository.ts"],"names":[],"mappings":"AAwBA,SAAS,WAAW,CAAC,GAAmB;IACtC,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,WAAW,EAAE,GAAG,CAAC,YAAY;QAC7B,OAAO,EAAE,GAAG,CAAC,QAAQ;QACrB,WAAW,EAAE,GAAG,CAAC,YAAY;QAC7B,UAAU,EAAE,GAAG,CAAC,WAAW;QAC3B,UAAU,EAAE,GAAG,CAAC,WAAW;QAC3B,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,MAAM,EAAE,GAAG,CAAC,MAAqC;QACjD,YAAY,EAAE,GAAG,CAAC,aAAa;QAC/B,qBAAqB,EAAE,GAAG,CAAC,uBAAuB;QAClD,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,SAAS,EAAE,GAAG,CAAC,UAAU;KAC1B,CAAA;AACH,CAAC;AAED,gDAAgD;AAChD,MAAM,aAAa,GAAiD;IAClE,UAAU,EAAE,aAAa;IACzB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,eAAe;IAC7B,qBAAqB,EAAE,yBAAyB;IAChD,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,YAAY;CACxB,CAAA;A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,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,WAAmB,EAAE,EAAU,EAAE,EAAU;QAC1D,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CACN,iGAAiG,CAClG;aACA,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,CAAC;aACzB,GAAG,EAAE,CAAA;IACV,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ import type { AgentFailure, Clock, ExecutionRepository, RunRef } from '@cat-factory/kernel';
2
+ import type { ExecutionInstance } from '@cat-factory/contracts';
3
+ import type { D1Database } from '@cloudflare/workers-types';
4
+ /**
5
+ * Execution runs, stored as `kind='execution'` rows of the unified `agent_runs`
6
+ * table (migration 0019). Every statement is scoped by `kind='execution'` so the
7
+ * bootstrap flow's rows (owned by {@link D1BootstrapJobRepository}) never collide
8
+ * — in particular `deleteByBlock` must NOT delete the bootstrap run that created a
9
+ * service frame when an execution on that block is replaced/cancelled.
10
+ */
11
+ export declare class D1ExecutionRepository implements ExecutionRepository {
12
+ private readonly db;
13
+ private readonly clock;
14
+ constructor({ db, clock }: {
15
+ db: D1Database;
16
+ clock: Clock;
17
+ });
18
+ listByWorkspace(workspaceId: string): Promise<ExecutionInstance[]>;
19
+ listByService(serviceId: string): Promise<ExecutionInstance[]>;
20
+ listByServices(serviceIds: string[]): Promise<ExecutionInstance[]>;
21
+ get(workspaceId: string, id: string): Promise<ExecutionInstance | null>;
22
+ getByBlock(workspaceId: string, blockId: string): Promise<ExecutionInstance | null>;
23
+ upsert(workspaceId: string, execution: ExecutionInstance): Promise<void>;
24
+ deleteByBlock(workspaceId: string, blockId: string): Promise<void>;
25
+ listStale(olderThanEpochMs: number): Promise<RunRef[]>;
26
+ markFailed(workspaceId: string, id: string, failure: AgentFailure): Promise<void>;
27
+ }
28
+ //# sourceMappingURL=D1ExecutionRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1ExecutionRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1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AAC,MAAM,EAAE,CAAC,CAU3D;IAEK,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAStF;CACF"}
@@ -0,0 +1,113 @@
1
+ import { chunkForIn } from './chunk';
2
+ import { executionToDetail, rowToExecution } from './mappers';
3
+ /**
4
+ * Execution runs, stored as `kind='execution'` rows of the unified `agent_runs`
5
+ * table (migration 0019). Every statement is scoped by `kind='execution'` so the
6
+ * bootstrap flow's rows (owned by {@link D1BootstrapJobRepository}) never collide
7
+ * — in particular `deleteByBlock` must NOT delete the bootstrap run that created a
8
+ * service frame when an execution on that block is replaced/cancelled.
9
+ */
10
+ export class D1ExecutionRepository {
11
+ db;
12
+ clock;
13
+ constructor({ db, clock }) {
14
+ this.db = db;
15
+ this.clock = clock;
16
+ }
17
+ async listByWorkspace(workspaceId) {
18
+ const { results } = await this.db
19
+ .prepare(`SELECT * FROM agent_runs WHERE workspace_id = ? AND kind = 'execution' ORDER BY created_at`)
20
+ .bind(workspaceId)
21
+ .all();
22
+ return results.map(rowToExecution);
23
+ }
24
+ async listByService(serviceId) {
25
+ const { results } = await this.db
26
+ .prepare(`SELECT * FROM agent_runs WHERE service_id = ? AND kind = 'execution' ORDER BY created_at`)
27
+ .bind(serviceId)
28
+ .all();
29
+ return results.map(rowToExecution);
30
+ }
31
+ async listByServices(serviceIds) {
32
+ if (serviceIds.length === 0)
33
+ return [];
34
+ const out = [];
35
+ // Chunk the IN list to stay under D1's bound-parameter limit.
36
+ for (const chunk of chunkForIn(serviceIds)) {
37
+ const placeholders = chunk.map(() => '?').join(', ');
38
+ const { results } = await this.db
39
+ .prepare(`SELECT * FROM agent_runs WHERE service_id IN (${placeholders}) AND kind = 'execution' ORDER BY created_at`)
40
+ .bind(...chunk)
41
+ .all();
42
+ for (const row of results)
43
+ out.push(rowToExecution(row));
44
+ }
45
+ return out;
46
+ }
47
+ async get(workspaceId, id) {
48
+ const row = await this.db
49
+ .prepare(`SELECT * FROM agent_runs WHERE workspace_id = ? AND id = ? AND kind = 'execution'`)
50
+ .bind(workspaceId, id)
51
+ .first();
52
+ return row ? rowToExecution(row) : null;
53
+ }
54
+ async getByBlock(workspaceId, blockId) {
55
+ const row = await this.db
56
+ .prepare(`SELECT * FROM agent_runs WHERE workspace_id = ? AND block_id = ? AND kind = 'execution'`)
57
+ .bind(workspaceId, blockId)
58
+ .first();
59
+ return row ? rowToExecution(row) : null;
60
+ }
61
+ async upsert(workspaceId, execution) {
62
+ // The pipeline shape lives in `detail`; lifecycle is top-level. `updated_at`
63
+ // is refreshed on every write so it doubles as the sweeper's lease.
64
+ // `error`/`failure`/`workflow_instance_id` are deliberately left out of the
65
+ // conflict update so they survive normal step writes (see markFailed).
66
+ const now = this.clock.now();
67
+ const detail = executionToDetail(execution);
68
+ // Stamp `service_id` from the run's block so the run is discoverable by service (in-org
69
+ // sharing): a shared service's runs surface on every board that mounts it via
70
+ // `listByService`. Derived here (not carried on ExecutionInstance) and refreshed on every
71
+ // write so it follows a reparent that re-homes the block to another service.
72
+ await this.db
73
+ .prepare(`INSERT INTO agent_runs
74
+ (workspace_id, id, kind, block_id, status, detail, created_at, updated_at,
75
+ workflow_instance_id, service_id)
76
+ VALUES (?, ?, 'execution', ?, ?, ?, ?, ?, ?,
77
+ (SELECT service_id FROM blocks WHERE workspace_id = ? AND id = ?))
78
+ ON CONFLICT (workspace_id, id) DO UPDATE SET
79
+ block_id = excluded.block_id,
80
+ status = excluded.status,
81
+ detail = excluded.detail,
82
+ updated_at = excluded.updated_at,
83
+ service_id = excluded.service_id`)
84
+ .bind(workspaceId, execution.id, execution.blockId, execution.status, detail, now, now,
85
+ // Instance id == execution id today; stored for forward-compatibility.
86
+ execution.id, workspaceId, execution.blockId)
87
+ .run();
88
+ }
89
+ async deleteByBlock(workspaceId, blockId) {
90
+ await this.db
91
+ .prepare(`DELETE FROM agent_runs WHERE workspace_id = ? AND block_id = ? AND kind = 'execution'`)
92
+ .bind(workspaceId, blockId)
93
+ .run();
94
+ }
95
+ async listStale(olderThanEpochMs) {
96
+ const { results } = await this.db
97
+ .prepare(`SELECT workspace_id, id FROM agent_runs
98
+ WHERE kind = 'execution' AND status = 'running' AND updated_at < ?
99
+ ORDER BY updated_at`)
100
+ .bind(olderThanEpochMs)
101
+ .all();
102
+ return results.map((r) => ({ workspaceId: r.workspace_id, id: r.id }));
103
+ }
104
+ async markFailed(workspaceId, id, failure) {
105
+ await this.db
106
+ .prepare(`UPDATE agent_runs
107
+ SET status = 'failed', error = ?, failure = ?, updated_at = ?
108
+ WHERE workspace_id = ? AND id = ? AND kind = 'execution'`)
109
+ .bind(failure.message, JSON.stringify(failure), this.clock.now(), workspaceId, id)
110
+ .run();
111
+ }
112
+ }
113
+ //# sourceMappingURL=D1ExecutionRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1ExecutionRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1ExecutionRepository.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAqB,iBAAiB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEhF;;;;;;GAMG;AACH,MAAM,OAAO,qBAAqB;IACf,EAAE,CAAY;IACd,KAAK,CAAO;IAE7B,YAAY,EAAE,EAAE,EAAE,KAAK,EAAoC;QACzD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;QACZ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,WAAmB;QACvC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,EAAE;aAC9B,OAAO,CACN,4FAA4F,CAC7F;aACA,IAAI,CAAC,WAAW,CAAC;aACjB,GAAG,EAAgB,CAAA;QACtB,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;IACpC,CAAC;IA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GAAG,EAAwC,CAAA;QAC9C,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;IACxE,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,WAAmB,EAAE,EAAU,EAAE,OAAqB;QACrE,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CACN;;kEAE0D,CAC3D;aACA,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,EAAE,CAAC;aACjF,GAAG,EAAE,CAAA;IACV,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ import type { FragmentOwnerKind, FragmentSourceRecord, FragmentSourceRepository } from '@cat-factory/kernel';
2
+ import type { D1Database } from '@cloudflare/workers-types';
3
+ /** D1-backed store of fragment-source repo linkages (migration 0020). */
4
+ export declare class D1FragmentSourceRepository implements FragmentSourceRepository {
5
+ private readonly db;
6
+ constructor({ db }: {
7
+ db: D1Database;
8
+ });
9
+ listByOwner(ownerKind: FragmentOwnerKind, ownerId: string): Promise<FragmentSourceRecord[]>;
10
+ get(id: string): Promise<FragmentSourceRecord | null>;
11
+ upsert(record: FragmentSourceRecord): Promise<void>;
12
+ updateSyncState(id: string, lastSyncedSha: string, lastSyncedAt: number): Promise<void>;
13
+ softDelete(id: string, at: number): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=D1FragmentSourceRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1FragmentSourceRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1FragmentSourceRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAgC3D,yEAAyE;AACzE,qBAAa,0BAA2B,YAAW,wBAAwB;IACzE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,UAAU,CAAA;KAAE,EAErC;IAEK,WAAW,CACf,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAQjC;IAEK,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAM1D;IAEK,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BxD;IAEK,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAK5F;IAEK,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKtD;CACF"}
@@ -0,0 +1,66 @@
1
+ function rowToRecord(row) {
2
+ return {
3
+ id: row.id,
4
+ ownerKind: row.owner_kind,
5
+ ownerId: row.owner_id,
6
+ repoOwner: row.repo_owner,
7
+ repoName: row.repo_name,
8
+ gitRef: row.git_ref,
9
+ dirPath: row.dir_path,
10
+ lastSyncedSha: row.last_synced_sha,
11
+ lastSyncedAt: row.last_synced_at,
12
+ createdAt: row.created_at,
13
+ deletedAt: row.deleted_at,
14
+ };
15
+ }
16
+ /** D1-backed store of fragment-source repo linkages (migration 0020). */
17
+ export class D1FragmentSourceRepository {
18
+ db;
19
+ constructor({ db }) {
20
+ this.db = db;
21
+ }
22
+ async listByOwner(ownerKind, ownerId) {
23
+ const { results } = await this.db
24
+ .prepare('SELECT * FROM fragment_sources WHERE owner_kind = ? AND owner_id = ? AND deleted_at IS NULL ORDER BY created_at DESC')
25
+ .bind(ownerKind, ownerId)
26
+ .all();
27
+ return results.map(rowToRecord);
28
+ }
29
+ async get(id) {
30
+ const row = await this.db
31
+ .prepare('SELECT * FROM fragment_sources WHERE id = ?')
32
+ .bind(id)
33
+ .first();
34
+ return row ? rowToRecord(row) : null;
35
+ }
36
+ async upsert(record) {
37
+ await this.db
38
+ .prepare(`INSERT INTO fragment_sources
39
+ (id, owner_kind, owner_id, repo_owner, repo_name, git_ref, dir_path,
40
+ last_synced_sha, last_synced_at, created_at, deleted_at)
41
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
42
+ ON CONFLICT (id) DO UPDATE SET
43
+ repo_owner = excluded.repo_owner,
44
+ repo_name = excluded.repo_name,
45
+ git_ref = excluded.git_ref,
46
+ dir_path = excluded.dir_path,
47
+ last_synced_sha = excluded.last_synced_sha,
48
+ last_synced_at = excluded.last_synced_at,
49
+ deleted_at = excluded.deleted_at`)
50
+ .bind(record.id, record.ownerKind, record.ownerId, record.repoOwner, record.repoName, record.gitRef, record.dirPath, record.lastSyncedSha, record.lastSyncedAt, record.createdAt, record.deletedAt)
51
+ .run();
52
+ }
53
+ async updateSyncState(id, lastSyncedSha, lastSyncedAt) {
54
+ await this.db
55
+ .prepare('UPDATE fragment_sources SET last_synced_sha = ?, last_synced_at = ? WHERE id = ?')
56
+ .bind(lastSyncedSha, lastSyncedAt, id)
57
+ .run();
58
+ }
59
+ async softDelete(id, at) {
60
+ await this.db
61
+ .prepare('UPDATE fragment_sources SET deleted_at = ? WHERE id = ?')
62
+ .bind(at, id)
63
+ .run();
64
+ }
65
+ }
66
+ //# sourceMappingURL=D1FragmentSourceRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1FragmentSourceRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1FragmentSourceRepository.ts"],"names":[],"mappings":"AAqBA,SAAS,WAAW,CAAC,GAAsB;I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C;aACA,IAAI,CACH,MAAM,CAAC,EAAE,EACT,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,aAAa,EACpB,MAAM,CAAC,YAAY,EACnB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,SAAS,CACjB;aACA,GAAG,EAAE,CAAA;IACV,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,EAAU,EAAE,aAAqB,EAAE,YAAoB;QAC3E,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CAAC,kFAAkF,CAAC;aAC3F,IAAI,CAAC,aAAa,EAAE,YAAY,EAAE,EAAE,CAAC;aACrC,GAAG,EAAE,CAAA;IACV,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,EAAU,EAAE,EAAU;QACrC,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CAAC,yDAAyD,CAAC;aAClE,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC;aACZ,GAAG,EAAE,CAAA;IACV,CAAC;CACF"}
@@ -0,0 +1,17 @@
1
+ import type { GitHubInstallation, GitHubInstallationRepository } from '@cat-factory/kernel';
2
+ import type { D1Database } from '@cloudflare/workers-types';
3
+ /** D1-backed store of workspace → GitHub App installation bindings (migration 0004). */
4
+ export declare class D1GitHubInstallationRepository implements GitHubInstallationRepository {
5
+ private readonly db;
6
+ constructor({ db }: {
7
+ db: D1Database;
8
+ });
9
+ getByInstallationId(installationId: number): Promise<GitHubInstallation | null>;
10
+ getByWorkspace(workspaceId: string): Promise<GitHubInstallation | null>;
11
+ listWorkspacesForInstallation(installationId: number): Promise<string[]>;
12
+ listActive(): Promise<GitHubInstallation[]>;
13
+ upsert(installation: GitHubInstallation): Promise<void>;
14
+ updateCachedToken(installationId: number, token: string, expiresAt: number): Promise<void>;
15
+ softDelete(installationId: number, at: number): Promise<void>;
16
+ }
17
+ //# sourceMappingURL=D1GitHubInstallationRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1GitHubInstallationRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1GitHubInstallationRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AAC3F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAQ3D,wFAAwF;AACxF,qBAAa,8BAA+B,YAAW,4BAA4B;IACjF,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,UAAU,CAAA;KAAE,EAErC;IAEK,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAMpF;IAEK,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAoB5E;IAEK,6BAA6B,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAkB7E;IAEK,UAAU,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAKhD;IAEK,MAAM,CAAC,YAAY,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ5D;IAEK,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO/F;IAEK,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKlE;CACF"}
@@ -0,0 +1,79 @@
1
+ import { buildUpsert, installationValues, rowToInstallation, } from './github-mappers';
2
+ /** D1-backed store of workspace → GitHub App installation bindings (migration 0004). */
3
+ export class D1GitHubInstallationRepository {
4
+ db;
5
+ constructor({ db }) {
6
+ this.db = db;
7
+ }
8
+ async getByInstallationId(installationId) {
9
+ const row = await this.db
10
+ .prepare('SELECT * FROM github_installations WHERE installation_id = ?')
11
+ .bind(installationId)
12
+ .first();
13
+ return row ? rowToInstallation(row) : null;
14
+ }
15
+ async getByWorkspace(workspaceId) {
16
+ // The installation backing a workspace is either its own direct binding
17
+ // (the connector, or the auth-disabled path where account_id is null) OR one
18
+ // shared via the workspace's account. Prefer the direct binding when both
19
+ // exist. The account match is gated on a non-null account so unrelated
20
+ // null-account dev rows never collide.
21
+ const row = await this.db
22
+ .prepare(`SELECT i.* FROM github_installations i
23
+ WHERE i.deleted_at IS NULL AND (
24
+ i.workspace_id = ?1
25
+ OR (i.account_id IS NOT NULL
26
+ AND i.account_id = (SELECT w.account_id FROM workspaces w WHERE w.id = ?1))
27
+ )
28
+ ORDER BY (i.workspace_id = ?1) DESC
29
+ LIMIT 1`)
30
+ .bind(workspaceId)
31
+ .first();
32
+ return row ? rowToInstallation(row) : null;
33
+ }
34
+ async listWorkspacesForInstallation(installationId) {
35
+ // The connector workspace, plus every workspace in the installation's account.
36
+ const { results } = await this.db
37
+ .prepare(`SELECT i.workspace_id AS id
38
+ FROM github_installations i
39
+ WHERE i.installation_id = ?1 AND i.deleted_at IS NULL
40
+ UNION
41
+ SELECT w.id AS id
42
+ FROM workspaces w
43
+ WHERE w.account_id IS NOT NULL AND w.account_id = (
44
+ SELECT i.account_id FROM github_installations i
45
+ WHERE i.installation_id = ?1 AND i.deleted_at IS NULL
46
+ )`)
47
+ .bind(installationId)
48
+ .all();
49
+ return results.map((r) => r.id);
50
+ }
51
+ async listActive() {
52
+ const { results } = await this.db
53
+ .prepare('SELECT * FROM github_installations WHERE deleted_at IS NULL')
54
+ .all();
55
+ return results.map(rowToInstallation);
56
+ }
57
+ async upsert(installation) {
58
+ const { sql, binds } = buildUpsert('github_installations', installationValues(installation), [
59
+ 'installation_id',
60
+ ]);
61
+ await this.db
62
+ .prepare(sql)
63
+ .bind(...binds)
64
+ .run();
65
+ }
66
+ async updateCachedToken(installationId, token, expiresAt) {
67
+ await this.db
68
+ .prepare('UPDATE github_installations SET cached_token = ?, token_expires_at = ? WHERE installation_id = ?')
69
+ .bind(token, expiresAt, installationId)
70
+ .run();
71
+ }
72
+ async softDelete(installationId, at) {
73
+ await this.db
74
+ .prepare('UPDATE github_installations SET deleted_at = ? WHERE installation_id = ?')
75
+ .bind(at, installationId)
76
+ .run();
77
+ }
78
+ }
79
+ //# sourceMappingURL=D1GitHubInstallationRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1GitHubInstallationRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1GitHubInstallationRepository.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,WAAW,EACX,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,kBAAkB,CAAA;AAEzB,wFAAwF;AACxF,MAAM,OAAO,8BAA8B;IACxB,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAsB;QACpC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,cAAsB;QAC9C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,EAAE;aACtB,OAAO,CAAC,8DAA8D,CAAC;aACvE,IAAI,CAAC,cAAc,CAAC;aACpB,KAAK,EAAyB,CAAA;QACjC,OAAO,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5C,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,WAAmB;QACtC,wEAAwE;QACxE,6EAA6E;QAC7E,0EAA0E;QAC1E,uEAAuE;QACvE,uCAAuC;QACvC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,EAAE;aACtB,OAAO,CACN;;;;;;;iBAOS,CACV;aACA,IAAI,CAAC,WAAW,CAAC;aACjB,KAAK,EAAyB,CAAA;Q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AAO,CAAC,0EAA0E,CAAC;aACnF,IAAI,CAAC,EAAE,EAAE,cAAc,CAAC;aACxB,GAAG,EAAE,CAAA;IACV,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ import type { GitHubIssue, IssueProjectionRepository } from '@cat-factory/kernel';
2
+ import type { D1Database } from '@cloudflare/workers-types';
3
+ /** D1-backed projection of issues (migration 0004). */
4
+ export declare class D1IssueProjectionRepository implements IssueProjectionRepository {
5
+ private readonly db;
6
+ constructor({ db }: {
7
+ db: D1Database;
8
+ });
9
+ upsertMany(workspaceId: string, issues: GitHubIssue[]): Promise<void>;
10
+ listByRepo(workspaceId: string, repoGithubId: number): Promise<GitHubIssue[]>;
11
+ listByWorkspace(workspaceId: string): Promise<GitHubIssue[]>;
12
+ }
13
+ //# sourceMappingURL=D1IssueProjectionRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1IssueProjectionRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1IssueProjectionRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AACjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAG3D,uDAAuD;AACvD,qBAAa,2BAA4B,YAAW,yBAAyB;IAC3E,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,UAAU,CAAA;KAAE,EAErC;IAEK,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAW1E;IAEK,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAQlF;IAEK,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAQjE;CACF"}
@@ -0,0 +1,36 @@
1
+ import { buildUpsert, issueValues, rowToIssue } from './github-mappers';
2
+ /** D1-backed projection of issues (migration 0004). */
3
+ export class D1IssueProjectionRepository {
4
+ db;
5
+ constructor({ db }) {
6
+ this.db = db;
7
+ }
8
+ async upsertMany(workspaceId, issues) {
9
+ if (issues.length === 0)
10
+ return;
11
+ const statements = issues.map((issue) => {
12
+ const { sql, binds } = buildUpsert('github_issues', issueValues(workspaceId, issue), [
13
+ 'workspace_id',
14
+ 'repo_github_id',
15
+ 'number',
16
+ ]);
17
+ return this.db.prepare(sql).bind(...binds);
18
+ });
19
+ await this.db.batch(statements);
20
+ }
21
+ async listByRepo(workspaceId, repoGithubId) {
22
+ const { results } = await this.db
23
+ .prepare('SELECT * FROM github_issues WHERE workspace_id = ? AND repo_github_id = ? AND deleted_at IS NULL ORDER BY number DESC')
24
+ .bind(workspaceId, repoGithubId)
25
+ .all();
26
+ return results.map(rowToIssue);
27
+ }
28
+ async listByWorkspace(workspaceId) {
29
+ const { results } = await this.db
30
+ .prepare('SELECT * FROM github_issues WHERE workspace_id = ? AND deleted_at IS NULL ORDER BY gh_updated_at DESC')
31
+ .bind(workspaceId)
32
+ .all();
33
+ return results.map(rowToIssue);
34
+ }
35
+ }
36
+ //# sourceMappingURL=D1IssueProjectionRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1IssueProjectionRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1IssueProjectionRepository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE5F,uDAAuD;AACvD,MAAM,OAAO,2BAA2B;IACrB,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAsB;QACpC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,WAAmB,EAAE,MAAqB;QACzD,IAAI,MAAM,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