@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":"D1TrackerSettingsRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1TrackerSettingsRepository.ts"],"names":[],"mappings":"AASA,qFAAqF;AACrF,MAAM,OAAO,2BAA2B;IACrB,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAsB;QACpC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,WAAmB;QAC3B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,EAAE;aACtB,OAAO,CAAC,uDAAuD,CAAC;aAChE,IAAI,CAAC,WAAW,CAAC;aACjB,KAAK,EAAc,CAAA;QACtB,IAAI,CAAC,GAAG;YAAE,OAAO,IAAI,CAAA;QACrB,OAAO;YACL,OAAO,EAAG,GAAG,CAAC,OAAsC,IAAI,IAAI;YAC5D,cAAc,EAAE,GAAG,CAAC,gBAAgB;YACpC,SAAS,EAAE,GAAG,CAAC,UAAU;SAC1B,CAAA;IACH,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,WAAmB,EAAE,QAAyB;QACtD,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CACN;;;;;4CAKoC,CACrC;aACA,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,SAAS,CAAC;aAChF,GAAG,EAAE,CAAA;IACV,CAAC;CACF"}
@@ -0,0 +1,19 @@
1
+ import type { IdentityProvider, UserIdentityRecord, UserRecord, UserRepository } from '@cat-factory/kernel';
2
+ import type { D1Database } from '@cloudflare/workers-types';
3
+ /** D1-backed store of canonical users + their linked login identities. */
4
+ export declare class D1UserRepository implements UserRepository {
5
+ private readonly db;
6
+ constructor({ db }: {
7
+ db: D1Database;
8
+ });
9
+ get(id: string): Promise<UserRecord | null>;
10
+ create(user: UserRecord): Promise<void>;
11
+ update(id: string, patch: Partial<Pick<UserRecord, 'name' | 'email' | 'avatarUrl'>>): Promise<void>;
12
+ findByIdentity(provider: IdentityProvider, subject: string): Promise<UserRecord | null>;
13
+ findByEmail(email: string): Promise<UserRecord | null>;
14
+ listByIds(ids: string[]): Promise<UserRecord[]>;
15
+ getIdentity(provider: IdentityProvider, subject: string): Promise<UserIdentityRecord | null>;
16
+ linkIdentity(identity: UserIdentityRecord): Promise<void>;
17
+ listIdentities(userId: string): Promise<UserIdentityRecord[]>;
18
+ }
19
+ //# sourceMappingURL=D1UserRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1UserRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1UserRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,cAAc,EACf,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAwC3D,0EAA0E;AAC1E,qBAAa,gBAAiB,YAAW,cAAc;IACrD,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,UAAU,CAAA;KAAE,EAErC;IAEK,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAGhD;IAEK,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAK5C;IAEK,MAAM,CACV,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC,CAAC,GAC/D,OAAO,CAAC,IAAI,CAAC,CAoBf;IAEK,cAAc,CAAC,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAU5F;IAEK,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAM3D;IAEK,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAQpD;IAEK,WAAW,CACf,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAMpC;IAEK,YAAY,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB9D;IAEK,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAMlE;CACF"}
@@ -0,0 +1,108 @@
1
+ function rowToUser(row) {
2
+ return {
3
+ id: row.id,
4
+ name: row.name,
5
+ email: row.email,
6
+ avatarUrl: row.avatar_url,
7
+ createdAt: row.created_at,
8
+ };
9
+ }
10
+ function rowToIdentity(row) {
11
+ return {
12
+ userId: row.user_id,
13
+ provider: row.provider,
14
+ subject: row.subject,
15
+ secret: row.secret,
16
+ metadata: row.metadata,
17
+ createdAt: row.created_at,
18
+ };
19
+ }
20
+ /** D1-backed store of canonical users + their linked login identities. */
21
+ export class D1UserRepository {
22
+ db;
23
+ constructor({ db }) {
24
+ this.db = db;
25
+ }
26
+ async get(id) {
27
+ const row = await this.db.prepare('SELECT * FROM users WHERE id = ?').bind(id).first();
28
+ return row ? rowToUser(row) : null;
29
+ }
30
+ async create(user) {
31
+ await this.db
32
+ .prepare('INSERT INTO users (id, name, email, avatar_url, created_at) VALUES (?, ?, ?, ?, ?)')
33
+ .bind(user.id, user.name, user.email, user.avatarUrl, user.createdAt)
34
+ .run();
35
+ }
36
+ async update(id, patch) {
37
+ const sets = [];
38
+ const binds = [];
39
+ if ('name' in patch) {
40
+ sets.push('name = ?');
41
+ binds.push(patch.name ?? null);
42
+ }
43
+ if ('email' in patch) {
44
+ sets.push('email = ?');
45
+ binds.push(patch.email ?? null);
46
+ }
47
+ if ('avatarUrl' in patch) {
48
+ sets.push('avatar_url = ?');
49
+ binds.push(patch.avatarUrl ?? null);
50
+ }
51
+ if (sets.length === 0)
52
+ return;
53
+ await this.db
54
+ .prepare(`UPDATE users SET ${sets.join(', ')} WHERE id = ?`)
55
+ .bind(...binds, id)
56
+ .run();
57
+ }
58
+ async findByIdentity(provider, subject) {
59
+ const row = await this.db
60
+ .prepare(`SELECT u.* FROM users u
61
+ JOIN user_identities i ON i.user_id = u.id
62
+ WHERE i.provider = ? AND i.subject = ?`)
63
+ .bind(provider, subject)
64
+ .first();
65
+ return row ? rowToUser(row) : null;
66
+ }
67
+ async findByEmail(email) {
68
+ const row = await this.db
69
+ .prepare('SELECT * FROM users WHERE email = ?')
70
+ .bind(email.toLowerCase().trim())
71
+ .first();
72
+ return row ? rowToUser(row) : null;
73
+ }
74
+ async listByIds(ids) {
75
+ if (ids.length === 0)
76
+ return [];
77
+ const placeholders = ids.map(() => '?').join(', ');
78
+ const { results } = await this.db
79
+ .prepare(`SELECT * FROM users WHERE id IN (${placeholders})`)
80
+ .bind(...ids)
81
+ .all();
82
+ return results.map(rowToUser);
83
+ }
84
+ async getIdentity(provider, subject) {
85
+ const row = await this.db
86
+ .prepare('SELECT * FROM user_identities WHERE provider = ? AND subject = ?')
87
+ .bind(provider, subject)
88
+ .first();
89
+ return row ? rowToIdentity(row) : null;
90
+ }
91
+ async linkIdentity(identity) {
92
+ await this.db
93
+ .prepare(`INSERT INTO user_identities (user_id, provider, subject, secret, metadata, created_at)
94
+ VALUES (?, ?, ?, ?, ?, ?)
95
+ ON CONFLICT (provider, subject) DO UPDATE SET
96
+ user_id = excluded.user_id, secret = excluded.secret, metadata = excluded.metadata`)
97
+ .bind(identity.userId, identity.provider, identity.subject, identity.secret, identity.metadata, identity.createdAt)
98
+ .run();
99
+ }
100
+ async listIdentities(userId) {
101
+ const { results } = await this.db
102
+ .prepare('SELECT * FROM user_identities WHERE user_id = ?')
103
+ .bind(userId)
104
+ .all();
105
+ return results.map(rowToIdentity);
106
+ }
107
+ }
108
+ //# sourceMappingURL=D1UserRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1UserRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1UserRepository.ts"],"names":[],"mappings":"AAyBA,SAAS,SAAS,CAAC,GAAY;IAC7B,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,KAAK,EAA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OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,EAAE;aAC9B,OAAO,CAAC,iDAAiD,CAAC;aAC1D,IAAI,CAAC,MAAM,CAAC;aACZ,GAAG,EAAe,CAAA;QACrB,OAAO,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;IACnC,CAAC;CACF"}
@@ -0,0 +1,19 @@
1
+ import type { WorkspaceMount, WorkspaceMountPatch, WorkspaceMountRepository } from '@cat-factory/kernel';
2
+ import type { D1Database } from '@cloudflare/workers-types';
3
+ /** A service mounted onto a workspace board + its per-workspace layout (migration 0030). */
4
+ export declare class D1WorkspaceMountRepository implements WorkspaceMountRepository {
5
+ private readonly db;
6
+ constructor({ db }: {
7
+ db: D1Database;
8
+ });
9
+ listByWorkspace(workspaceId: string): Promise<WorkspaceMount[]>;
10
+ listByService(serviceId: string): Promise<WorkspaceMount[]>;
11
+ listWorkspaceIdsMountingBlock(originWorkspaceId: string, blockId: string): Promise<string[]>;
12
+ countByServiceIds(serviceIds: string[]): Promise<Record<string, number>>;
13
+ get(workspaceId: string, serviceId: string): Promise<WorkspaceMount | null>;
14
+ upsert(mount: WorkspaceMount): Promise<void>;
15
+ update(workspaceId: string, serviceId: string, patch: WorkspaceMountPatch): Promise<void>;
16
+ remove(workspaceId: string, serviceId: string): Promise<void>;
17
+ removeByServices(serviceIds: string[]): Promise<void>;
18
+ }
19
+ //# sourceMappingURL=D1WorkspaceMountRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1WorkspaceMountRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1WorkspaceMountRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAuB3D,4FAA4F;AAC5F,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,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAMpE;IAEK,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAMhE;IAEK,6BAA6B,CACjC,iBAAiB,EAAE,MAAM,EACzB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,EAAE,CAAC,CAWnB;IAEK,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAgB7E;IAEK,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAMhF;IAEK,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBjD;IAEK,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB9F;IAEK,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKlE;IAEK,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAU1D;CACF"}
@@ -0,0 +1,115 @@
1
+ import { chunkForIn } from './chunk';
2
+ function rowToMount(row) {
3
+ return {
4
+ workspaceId: row.workspace_id,
5
+ serviceId: row.service_id,
6
+ position: { x: row.pos_x, y: row.pos_y },
7
+ size: row.width !== null && row.height !== null ? { w: row.width, h: row.height } : null,
8
+ createdAt: row.created_at,
9
+ };
10
+ }
11
+ /** A service mounted onto a workspace board + its per-workspace layout (migration 0030). */
12
+ export class D1WorkspaceMountRepository {
13
+ db;
14
+ constructor({ db }) {
15
+ this.db = db;
16
+ }
17
+ async listByWorkspace(workspaceId) {
18
+ const { results } = await this.db
19
+ .prepare(`SELECT * FROM workspace_services WHERE workspace_id = ? ORDER BY created_at`)
20
+ .bind(workspaceId)
21
+ .all();
22
+ return (results ?? []).map(rowToMount);
23
+ }
24
+ async listByService(serviceId) {
25
+ const { results } = await this.db
26
+ .prepare(`SELECT * FROM workspace_services WHERE service_id = ? ORDER BY created_at`)
27
+ .bind(serviceId)
28
+ .all();
29
+ return (results ?? []).map(rowToMount);
30
+ }
31
+ async listWorkspaceIdsMountingBlock(originWorkspaceId, blockId) {
32
+ // One join: the service owning the block → the workspaces that mount it. A block with no
33
+ // service makes the subquery NULL, which matches no rows (`service_id = NULL`) → empty.
34
+ const { results } = await this.db
35
+ .prepare(`SELECT workspace_id FROM workspace_services
36
+ WHERE service_id = (SELECT service_id FROM blocks WHERE workspace_id = ? AND id = ?)`)
37
+ .bind(originWorkspaceId, blockId)
38
+ .all();
39
+ return (results ?? []).map((r) => r.workspace_id);
40
+ }
41
+ async countByServiceIds(serviceIds) {
42
+ if (serviceIds.length === 0)
43
+ return {};
44
+ const counts = {};
45
+ // Chunk the IN list to stay under D1's bound-parameter limit.
46
+ for (const chunk of chunkForIn(serviceIds)) {
47
+ const placeholders = chunk.map(() => '?').join(', ');
48
+ const { results } = await this.db
49
+ .prepare(`SELECT service_id, COUNT(*) AS n FROM workspace_services
50
+ WHERE service_id IN (${placeholders}) GROUP BY service_id`)
51
+ .bind(...chunk)
52
+ .all();
53
+ for (const row of results ?? [])
54
+ counts[row.service_id] = Number(row.n);
55
+ }
56
+ return counts;
57
+ }
58
+ async get(workspaceId, serviceId) {
59
+ const row = await this.db
60
+ .prepare(`SELECT * FROM workspace_services WHERE workspace_id = ? AND service_id = ?`)
61
+ .bind(workspaceId, serviceId)
62
+ .first();
63
+ return row ? rowToMount(row) : null;
64
+ }
65
+ async upsert(mount) {
66
+ await this.db
67
+ .prepare(`INSERT INTO workspace_services (workspace_id, service_id, pos_x, pos_y, width, height, created_at)
68
+ VALUES (?, ?, ?, ?, ?, ?, ?)
69
+ ON CONFLICT (workspace_id, service_id) DO UPDATE SET
70
+ pos_x = excluded.pos_x,
71
+ pos_y = excluded.pos_y,
72
+ width = excluded.width,
73
+ height = excluded.height`)
74
+ .bind(mount.workspaceId, mount.serviceId, mount.position.x, mount.position.y, mount.size?.w ?? null, mount.size?.h ?? null, mount.createdAt)
75
+ .run();
76
+ }
77
+ async update(workspaceId, serviceId, patch) {
78
+ const sets = [];
79
+ const binds = [];
80
+ if (patch.position) {
81
+ sets.push('pos_x = ?', 'pos_y = ?');
82
+ binds.push(patch.position.x, patch.position.y);
83
+ }
84
+ if ('size' in patch) {
85
+ sets.push('width = ?', 'height = ?');
86
+ binds.push(patch.size?.w ?? null, patch.size?.h ?? null);
87
+ }
88
+ if (sets.length === 0)
89
+ return;
90
+ binds.push(workspaceId, serviceId);
91
+ await this.db
92
+ .prepare(`UPDATE workspace_services SET ${sets.join(', ')} WHERE workspace_id = ? AND service_id = ?`)
93
+ .bind(...binds)
94
+ .run();
95
+ }
96
+ async remove(workspaceId, serviceId) {
97
+ await this.db
98
+ .prepare(`DELETE FROM workspace_services WHERE workspace_id = ? AND service_id = ?`)
99
+ .bind(workspaceId, serviceId)
100
+ .run();
101
+ }
102
+ async removeByServices(serviceIds) {
103
+ if (serviceIds.length === 0)
104
+ return;
105
+ // Chunk the IN list to stay under D1's bound-parameter limit.
106
+ for (const chunk of chunkForIn(serviceIds)) {
107
+ const placeholders = chunk.map(() => '?').join(', ');
108
+ await this.db
109
+ .prepare(`DELETE FROM workspace_services WHERE service_id IN (${placeholders})`)
110
+ .bind(...chunk)
111
+ .run();
112
+ }
113
+ }
114
+ }
115
+ //# sourceMappingURL=D1WorkspaceMountRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1WorkspaceMountRepository.js","source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AC;YAAE,OAAM;QAC7B,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;QAClC,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CACN,iCAAiC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,4CAA4C,CAC7F;aACA,IAAI,CAAC,GAAG,KAAK,CAAC;aACd,GAAG,EAAE,CAAA;IACV,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,WAAmB,EAAE,SAAiB;QACjD,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CAAC,0EAA0E,CAAC;aACnF,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;aAC5B,GAAG,EAAE,CAAA;IACV,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,UAAoB;QACzC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;YAAE,OAAM;QACnC,8DAA8D;QAC9D,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3C,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACpD,MAAM,IAAI,CAAC,EAAE;iBACV,OAAO,CAAC,uDAAuD,YAAY,GAAG,CAAC;iBAC/E,IAAI,CAAC,GAAG,KAAK,CAAC;iBACd,GAAG,EAAE,CAAA;QACV,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,18 @@
1
+ import type { WorkspaceRepository, WorkspaceVisibility } from '@cat-factory/kernel';
2
+ import type { Workspace } from '@cat-factory/contracts';
3
+ import type { D1Database } from '@cloudflare/workers-types';
4
+ export declare class D1WorkspaceRepository implements WorkspaceRepository {
5
+ private readonly db;
6
+ constructor({ db }: {
7
+ db: D1Database;
8
+ });
9
+ listVisible(scope: WorkspaceVisibility): Promise<Workspace[]>;
10
+ get(id: string): Promise<Workspace | null>;
11
+ ownerOf(id: string): Promise<string | null | undefined>;
12
+ accountOf(id: string): Promise<string | null | undefined>;
13
+ create(workspace: Workspace, ownerUserId: string | null, accountId: string | null): Promise<void>;
14
+ rename(id: string, name: string): Promise<void>;
15
+ setDescription(id: string, description: string | null): Promise<void>;
16
+ delete(id: string): Promise<void>;
17
+ }
18
+ //# sourceMappingURL=D1WorkspaceRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1WorkspaceRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1WorkspaceRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAG3D,qBAAa,qBAAsB,YAAW,mBAAmB;IAC/D,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,UAAU,CAAA;KAAE,EAErC;IAEK,WAAW,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAsBlE;IAEK,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAM/C;IAEK,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAO5D;IAEK,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAO9D;IAEK,MAAM,CACV,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,IAAI,CAAC,CAcf;IAEK,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpD;IAEK,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAK1E;IAEK,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAStC;CACF"}
@@ -0,0 +1,77 @@
1
+ import { rowToWorkspace } from './mappers';
2
+ export class D1WorkspaceRepository {
3
+ db;
4
+ constructor({ db }) {
5
+ this.db = db;
6
+ }
7
+ async listVisible(scope) {
8
+ // A null scope means auth is disabled — return every board (dev behaviour).
9
+ if (scope === null) {
10
+ const { results } = await this.db
11
+ .prepare('SELECT * FROM workspaces ORDER BY created_at DESC')
12
+ .all();
13
+ return results.map(rowToWorkspace);
14
+ }
15
+ // A signed-in user sees boards in any account they belong to, plus any legacy
16
+ // board they personally own (account_id NULL, owner_user_id = them).
17
+ const placeholders = scope.accountIds.map(() => '?').join(', ');
18
+ const accountClause = scope.accountIds.length > 0 ? `account_id IN (${placeholders})` : '0';
19
+ const { results } = await this.db
20
+ .prepare(`SELECT * FROM workspaces
21
+ WHERE ${accountClause}
22
+ OR (account_id IS NULL AND owner_user_id = ?)
23
+ ORDER BY created_at DESC`)
24
+ .bind(...scope.accountIds, scope.ownerUserId)
25
+ .all();
26
+ return results.map(rowToWorkspace);
27
+ }
28
+ async get(id) {
29
+ const row = await this.db
30
+ .prepare('SELECT * FROM workspaces WHERE id = ?')
31
+ .bind(id)
32
+ .first();
33
+ return row ? rowToWorkspace(row) : null;
34
+ }
35
+ async ownerOf(id) {
36
+ const row = await this.db
37
+ .prepare('SELECT owner_user_id FROM workspaces WHERE id = ?')
38
+ .bind(id)
39
+ .first();
40
+ // Row absent → undefined (missing); present → the (possibly null) owner id.
41
+ return row ? row.owner_user_id : undefined;
42
+ }
43
+ async accountOf(id) {
44
+ const row = await this.db
45
+ .prepare('SELECT account_id FROM workspaces WHERE id = ?')
46
+ .bind(id)
47
+ .first();
48
+ // Row absent → undefined (missing); present → the (possibly null) account id.
49
+ return row ? row.account_id : undefined;
50
+ }
51
+ async create(workspace, ownerUserId, accountId) {
52
+ await this.db
53
+ .prepare('INSERT INTO workspaces (id, name, description, created_at, owner_user_id, account_id) VALUES (?, ?, ?, ?, ?, ?)')
54
+ .bind(workspace.id, workspace.name, workspace.description ?? null, workspace.createdAt, ownerUserId, accountId)
55
+ .run();
56
+ }
57
+ async rename(id, name) {
58
+ await this.db.prepare('UPDATE workspaces SET name = ? WHERE id = ?').bind(name, id).run();
59
+ }
60
+ async setDescription(id, description) {
61
+ await this.db
62
+ .prepare('UPDATE workspaces SET description = ? WHERE id = ?')
63
+ .bind(description, id)
64
+ .run();
65
+ }
66
+ async delete(id) {
67
+ // Cascade explicitly: D1 does not enforce foreign keys by default.
68
+ await this.db.batch([
69
+ // agent_runs holds both execution and bootstrap runs (migration 0019).
70
+ this.db.prepare('DELETE FROM agent_runs WHERE workspace_id = ?').bind(id),
71
+ this.db.prepare('DELETE FROM blocks WHERE workspace_id = ?').bind(id),
72
+ this.db.prepare('DELETE FROM pipelines WHERE workspace_id = ?').bind(id),
73
+ this.db.prepare('DELETE FROM workspaces WHERE id = ?').bind(id),
74
+ ]);
75
+ }
76
+ }
77
+ //# sourceMappingURL=D1WorkspaceRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1WorkspaceRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1WorkspaceRepository.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqB,cAAc,EAAE,MAAM,WAAW,CAAA;AAE7D,MAAM,OAAO,qBAAqB;IACf,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAsB;QACpC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAA0B;QAC1C,4EAA4E;QAC5E,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACn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ACzE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,2CAA2C,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YACrE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,8CAA8C,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YACxE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,qCAAqC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;SAChE,CAAC,CAAA;IACJ,CAAC;CACF"}
@@ -0,0 +1,17 @@
1
+ import type { WorkspaceSettingsRepository } from '@cat-factory/kernel';
2
+ import type { WorkspaceSettings } from '@cat-factory/contracts';
3
+ import type { D1Database } from '@cloudflare/workers-types';
4
+ /**
5
+ * Per-workspace runtime settings, one row per workspace in `workspace_settings`.
6
+ * The service lazily seeds the default on first read, so an absent row reads as
7
+ * `null` here. Per-type task limits are stored as a JSON column.
8
+ */
9
+ export declare class D1WorkspaceSettingsRepository implements WorkspaceSettingsRepository {
10
+ private readonly db;
11
+ constructor({ db }: {
12
+ db: D1Database;
13
+ });
14
+ get(workspaceId: string): Promise<WorkspaceSettings | null>;
15
+ upsert(workspaceId: string, settings: WorkspaceSettings): Promise<void>;
16
+ }
17
+ //# sourceMappingURL=D1WorkspaceSettingsRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1WorkspaceSettingsRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1WorkspaceSettingsRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;AACtE,OAAO,KAAK,EAAmC,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAChG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AA0B3D;;;;GAIG;AACH,qBAAa,6BAA8B,YAAW,2BAA2B;IAC/E,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,UAAU,CAAA;KAAE,EAErC;IAEK,GAAG,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAMhE;IAEK,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB5E;CACF"}
@@ -0,0 +1,50 @@
1
+ function rowToSettings(row) {
2
+ let perType = null;
3
+ if (row.task_limit_per_type) {
4
+ try {
5
+ perType = JSON.parse(row.task_limit_per_type);
6
+ }
7
+ catch {
8
+ perType = null;
9
+ }
10
+ }
11
+ return {
12
+ waitingEscalationMinutes: row.waiting_escalation_minutes,
13
+ taskLimitMode: row.task_limit_mode,
14
+ taskLimitShared: row.task_limit_shared,
15
+ taskLimitPerType: perType,
16
+ };
17
+ }
18
+ /**
19
+ * Per-workspace runtime settings, one row per workspace in `workspace_settings`.
20
+ * The service lazily seeds the default on first read, so an absent row reads as
21
+ * `null` here. Per-type task limits are stored as a JSON column.
22
+ */
23
+ export class D1WorkspaceSettingsRepository {
24
+ db;
25
+ constructor({ db }) {
26
+ this.db = db;
27
+ }
28
+ async get(workspaceId) {
29
+ const row = await this.db
30
+ .prepare(`SELECT * FROM workspace_settings WHERE workspace_id = ?`)
31
+ .bind(workspaceId)
32
+ .first();
33
+ return row ? rowToSettings(row) : null;
34
+ }
35
+ async upsert(workspaceId, settings) {
36
+ await this.db
37
+ .prepare(`INSERT INTO workspace_settings
38
+ (workspace_id, waiting_escalation_minutes, task_limit_mode, task_limit_shared,
39
+ task_limit_per_type)
40
+ VALUES (?, ?, ?, ?, ?)
41
+ ON CONFLICT (workspace_id) DO UPDATE SET
42
+ waiting_escalation_minutes = excluded.waiting_escalation_minutes,
43
+ task_limit_mode = excluded.task_limit_mode,
44
+ task_limit_shared = excluded.task_limit_shared,
45
+ task_limit_per_type = excluded.task_limit_per_type`)
46
+ .bind(workspaceId, settings.waitingEscalationMinutes, settings.taskLimitMode, settings.taskLimitShared, settings.taskLimitPerType ? JSON.stringify(settings.taskLimitPerType) : null)
47
+ .run();
48
+ }
49
+ }
50
+ //# sourceMappingURL=D1WorkspaceSettingsRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"D1WorkspaceSettingsRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1WorkspaceSettingsRepository.ts"],"names":[],"mappings":"AAWA,SAAS,aAAa,CAAC,GAAyB;IAC9C,IAAI,OAAO,GAA4B,IAAI,CAAA;IAC3C,IAAI,GAAG,CAAC,mBAAmB,EAAE,CAAC;QAC5B,IAAI,CAAC;YACH,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAqB,CAAA;QACnE,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,GAAG,IAAI,CAAA;QAChB,CAAC;IACH,CAAC;IACD,OAAO;QACL,wBAAwB,EAAE,GAAG,CAAC,0BAA0B;QACxD,aAAa,EAAE,GAAG,CAAC,eAAgC;QACnD,eAAe,EAAE,GAAG,CAAC,iBAAiB;QACtC,gBAAgB,EAAE,OAAO;KAC1B,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,6BAA6B;IACvB,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAsB;QACpC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,WAAmB;QAC3B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,EAAE;aACtB,OAAO,CAAC,yDAAyD,CAAC;aAClE,IAAI,CAAC,WAAW,CAAC;aACjB,KAAK,EAAwB,CAAA;QAChC,OAAO,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACxC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,WAAmB,EAAE,QAA2B;QAC3D,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CACN;;;;;;;;8DAQsD,CACvD;aACA,IAAI,CACH,WAAW,EACX,QAAQ,CAAC,wBAAwB,EACjC,QAAQ,CAAC,aAAa,EACtB,QAAQ,CAAC,eAAe,EACxB,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,CAC7E;aACA,GAAG,EAAE,CAAA;IACV,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Cloudflare D1 rejects any prepared statement with more than 100 bound
3
+ * parameters (`D1_ERROR: too many SQL variables`). Every dynamically-built
4
+ * `IN (…)` list must therefore be chunked under that ceiling — with a little
5
+ * headroom for the handful of other bound params a query carries alongside the
6
+ * list (e.g. a leading `github_id = ?`).
7
+ */
8
+ export declare const D1_MAX_IN_PARAMS = 90;
9
+ /** Split `items` into consecutive chunks no larger than {@link D1_MAX_IN_PARAMS}. */
10
+ export declare function chunkForIn<T>(items: readonly T[]): T[][];
11
+ //# sourceMappingURL=chunk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/chunk.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAMxD"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Cloudflare D1 rejects any prepared statement with more than 100 bound
3
+ * parameters (`D1_ERROR: too many SQL variables`). Every dynamically-built
4
+ * `IN (…)` list must therefore be chunked under that ceiling — with a little
5
+ * headroom for the handful of other bound params a query carries alongside the
6
+ * list (e.g. a leading `github_id = ?`).
7
+ */
8
+ export const D1_MAX_IN_PARAMS = 90;
9
+ /** Split `items` into consecutive chunks no larger than {@link D1_MAX_IN_PARAMS}. */
10
+ export function chunkForIn(items) {
11
+ const chunks = [];
12
+ for (let i = 0; i < items.length; i += D1_MAX_IN_PARAMS) {
13
+ chunks.push(items.slice(i, i + D1_MAX_IN_PARAMS));
14
+ }
15
+ return chunks;
16
+ }
17
+ //# sourceMappingURL=chunk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/chunk.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAElC,qFAAqF;AACrF,MAAM,UAAU,UAAU,CAAI,KAAmB;IAC/C,MAAM,MAAM,GAAU,EAAE,CAAA;IACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,gBAAgB,EAAE,CAAC;QACxD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAA;IACnD,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { GitHubBranch } from '@cat-factory/contracts';
2
+ export interface GitHubBranchRow {
3
+ repo_github_id: number;
4
+ name: string;
5
+ head_sha: string;
6
+ protected: number;
7
+ synced_at: number;
8
+ }
9
+ export declare function rowToBranch(row: GitHubBranchRow): GitHubBranch;
10
+ export declare function branchValues(workspaceId: string, b: GitHubBranch): Record<string, unknown>;
11
+ //# sourceMappingURL=branch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branch.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/repositories/github-mappers/branch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAG1D,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,eAAe,GAAG,YAAY,CAQ9D;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAU1F"}
@@ -0,0 +1,22 @@
1
+ import { bool, intBool } from './serialize';
2
+ export function rowToBranch(row) {
3
+ return {
4
+ repoGithubId: row.repo_github_id,
5
+ name: row.name,
6
+ headSha: row.head_sha,
7
+ protected: bool(row.protected),
8
+ syncedAt: row.synced_at,
9
+ };
10
+ }
11
+ export function branchValues(workspaceId, b) {
12
+ return {
13
+ workspace_id: workspaceId,
14
+ repo_github_id: b.repoGithubId,
15
+ name: b.name,
16
+ head_sha: b.headSha,
17
+ protected: intBool(b.protected),
18
+ synced_at: b.syncedAt,
19
+ deleted_at: null,
20
+ };
21
+ }
22
+ //# sourceMappingURL=branch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branch.js","sourceRoot":"","sources":["../../../../src/infrastructure/repositories/github-mappers/branch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAU3C,MAAM,UAAU,WAAW,CAAC,GAAoB;IAC9C,OAAO;QACL,YAAY,EAAE,GAAG,CAAC,cAAc;QAChC,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,OAAO,EAAE,GAAG,CAAC,QAAQ;QACrB,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;QAC9B,QAAQ,EAAE,GAAG,CAAC,SAAS;KACxB,CAAA;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,WAAmB,EAAE,CAAe;IAC/D,OAAO;QACL,YAAY,EAAE,WAAW;QACzB,cAAc,EAAE,CAAC,CAAC,YAAY;QAC9B,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,QAAQ,EAAE,CAAC,CAAC,OAAO;QACnB,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/B,SAAS,EAAE,CAAC,CAAC,QAAQ;QACrB,UAAU,EAAE,IAAI;KACjB,CAAA;AACH,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { GitHubCheckRun } from '@cat-factory/contracts';
2
+ export interface GitHubCheckRunRow {
3
+ repo_github_id: number;
4
+ github_id: number;
5
+ head_sha: string;
6
+ name: string;
7
+ status: string;
8
+ conclusion: string | null;
9
+ synced_at: number;
10
+ }
11
+ export declare function rowToCheckRun(row: GitHubCheckRunRow): GitHubCheckRun;
12
+ export declare function checkRunValues(workspaceId: string, c: GitHubCheckRun): Record<string, unknown>;
13
+ //# sourceMappingURL=check-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-run.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/repositories/github-mappers/check-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,iBAAiB,GAAG,cAAc,CAUpE;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAW9F"}
@@ -0,0 +1,24 @@
1
+ export function rowToCheckRun(row) {
2
+ return {
3
+ repoGithubId: row.repo_github_id,
4
+ githubId: row.github_id,
5
+ headSha: row.head_sha,
6
+ name: row.name,
7
+ status: row.status,
8
+ conclusion: row.conclusion,
9
+ syncedAt: row.synced_at,
10
+ };
11
+ }
12
+ export function checkRunValues(workspaceId, c) {
13
+ return {
14
+ workspace_id: workspaceId,
15
+ repo_github_id: c.repoGithubId,
16
+ github_id: c.githubId,
17
+ head_sha: c.headSha,
18
+ name: c.name,
19
+ status: c.status,
20
+ conclusion: c.conclusion,
21
+ synced_at: c.syncedAt,
22
+ };
23
+ }
24
+ //# sourceMappingURL=check-run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-run.js","sourceRoot":"","sources":["../../../../src/infrastructure/repositories/github-mappers/check-run.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,aAAa,CAAC,GAAsB;IAClD,OAAO;QACL,YAAY,EAAE,GAAG,CAAC,cAAc;QAChC,QAAQ,EAAE,GAAG,CAAC,SAAS;QACvB,OAAO,EAAE,GAAG,CAAC,QAAQ;QACrB,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,QAAQ,EAAE,GAAG,CAAC,SAAS;KACxB,CAAA;AACH,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,WAAmB,EAAE,CAAiB;IACnE,OAAO;QACL,YAAY,EAAE,WAAW;QACzB,cAAc,EAAE,CAAC,CAAC,YAAY;QAC9B,SAAS,EAAE,CAAC,CAAC,QAAQ;QACrB,QAAQ,EAAE,CAAC,CAAC,OAAO;QACnB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,SAAS,EAAE,CAAC,CAAC,QAAQ;KACtB,CAAA;AACH,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { GitHubCommit } from '@cat-factory/contracts';
2
+ export interface GitHubCommitRow {
3
+ repo_github_id: number;
4
+ sha: string;
5
+ message: string;
6
+ author: string | null;
7
+ authored_at: number | null;
8
+ synced_at: number;
9
+ }
10
+ export declare function rowToCommit(row: GitHubCommitRow): GitHubCommit;
11
+ export declare function commitValues(workspaceId: string, c: GitHubCommit): Record<string, unknown>;
12
+ //# sourceMappingURL=commit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/repositories/github-mappers/commit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAE1D,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAA;IACtB,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,eAAe,GAAG,YAAY,CAS9D;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAU1F"}