@cat-factory/kernel 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 (318) hide show
  1. package/LICENSE +21 -0
  2. package/dist/domain/catalog.d.ts +36 -0
  3. package/dist/domain/catalog.d.ts.map +1 -0
  4. package/dist/domain/catalog.js +55 -0
  5. package/dist/domain/catalog.js.map +1 -0
  6. package/dist/domain/errors.d.ts +57 -0
  7. package/dist/domain/errors.d.ts.map +1 -0
  8. package/dist/domain/errors.js +60 -0
  9. package/dist/domain/errors.js.map +1 -0
  10. package/dist/domain/models.d.ts +204 -0
  11. package/dist/domain/models.d.ts.map +1 -0
  12. package/dist/domain/models.js +522 -0
  13. package/dist/domain/models.js.map +1 -0
  14. package/dist/domain/pipeline-registry.d.ts +19 -0
  15. package/dist/domain/pipeline-registry.d.ts.map +1 -0
  16. package/dist/domain/pipeline-registry.js +48 -0
  17. package/dist/domain/pipeline-registry.js.map +1 -0
  18. package/dist/domain/seed.d.ts +14 -0
  19. package/dist/domain/seed.d.ts.map +1 -0
  20. package/dist/domain/seed.js +369 -0
  21. package/dist/domain/seed.js.map +1 -0
  22. package/dist/domain/service-registration.d.ts +31 -0
  23. package/dist/domain/service-registration.d.ts.map +1 -0
  24. package/dist/domain/service-registration.js +37 -0
  25. package/dist/domain/service-registration.js.map +1 -0
  26. package/dist/domain/subtasks.logic.d.ts +6 -0
  27. package/dist/domain/subtasks.logic.d.ts.map +1 -0
  28. package/dist/domain/subtasks.logic.js +20 -0
  29. package/dist/domain/subtasks.logic.js.map +1 -0
  30. package/dist/domain/types.d.ts +2 -0
  31. package/dist/domain/types.d.ts.map +1 -0
  32. package/dist/domain/types.js +2 -0
  33. package/dist/domain/types.js.map +1 -0
  34. package/dist/index.d.ts +16 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +21 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/ports/account-repositories.d.ts +46 -0
  39. package/dist/ports/account-repositories.d.ts.map +1 -0
  40. package/dist/ports/account-repositories.js +2 -0
  41. package/dist/ports/account-repositories.js.map +1 -0
  42. package/dist/ports/agent-executor.d.ts +361 -0
  43. package/dist/ports/agent-executor.d.ts.map +1 -0
  44. package/dist/ports/agent-executor.js +8 -0
  45. package/dist/ports/agent-executor.js.map +1 -0
  46. package/dist/ports/agent-runs.d.ts +28 -0
  47. package/dist/ports/agent-runs.d.ts.map +1 -0
  48. package/dist/ports/agent-runs.js +2 -0
  49. package/dist/ports/agent-runs.js.map +1 -0
  50. package/dist/ports/board-operations.d.ts +15 -0
  51. package/dist/ports/board-operations.d.ts.map +1 -0
  52. package/dist/ports/board-operations.js +2 -0
  53. package/dist/ports/board-operations.js.map +1 -0
  54. package/dist/ports/board-scan-repositories.d.ts +23 -0
  55. package/dist/ports/board-scan-repositories.d.ts.map +1 -0
  56. package/dist/ports/board-scan-repositories.js +2 -0
  57. package/dist/ports/board-scan-repositories.js.map +1 -0
  58. package/dist/ports/bootstrap-repositories.d.ts +71 -0
  59. package/dist/ports/bootstrap-repositories.d.ts.map +1 -0
  60. package/dist/ports/bootstrap-repositories.js +2 -0
  61. package/dist/ports/bootstrap-repositories.js.map +1 -0
  62. package/dist/ports/bootstrap-runner.d.ts +20 -0
  63. package/dist/ports/bootstrap-runner.d.ts.map +1 -0
  64. package/dist/ports/bootstrap-runner.js +12 -0
  65. package/dist/ports/bootstrap-runner.js.map +1 -0
  66. package/dist/ports/ci-status.d.ts +23 -0
  67. package/dist/ports/ci-status.d.ts.map +1 -0
  68. package/dist/ports/ci-status.js +8 -0
  69. package/dist/ports/ci-status.js.map +1 -0
  70. package/dist/ports/clarity-review-repositories.d.ts +12 -0
  71. package/dist/ports/clarity-review-repositories.d.ts.map +1 -0
  72. package/dist/ports/clarity-review-repositories.js +2 -0
  73. package/dist/ports/clarity-review-repositories.js.map +1 -0
  74. package/dist/ports/consensus-repositories.d.ts +12 -0
  75. package/dist/ports/consensus-repositories.d.ts.map +1 -0
  76. package/dist/ports/consensus-repositories.js +2 -0
  77. package/dist/ports/consensus-repositories.js.map +1 -0
  78. package/dist/ports/document-repositories.d.ts +55 -0
  79. package/dist/ports/document-repositories.d.ts.map +1 -0
  80. package/dist/ports/document-repositories.js +2 -0
  81. package/dist/ports/document-repositories.js.map +1 -0
  82. package/dist/ports/document-source.d.ts +55 -0
  83. package/dist/ports/document-source.d.ts.map +1 -0
  84. package/dist/ports/document-source.js +2 -0
  85. package/dist/ports/document-source.js.map +1 -0
  86. package/dist/ports/email-sender.d.ts +42 -0
  87. package/dist/ports/email-sender.d.ts.map +1 -0
  88. package/dist/ports/email-sender.js +7 -0
  89. package/dist/ports/email-sender.js.map +1 -0
  90. package/dist/ports/environment-provider.d.ts +67 -0
  91. package/dist/ports/environment-provider.d.ts.map +1 -0
  92. package/dist/ports/environment-provider.js +2 -0
  93. package/dist/ports/environment-provider.js.map +1 -0
  94. package/dist/ports/environment-repositories.d.ts +64 -0
  95. package/dist/ports/environment-repositories.d.ts.map +1 -0
  96. package/dist/ports/environment-repositories.js +2 -0
  97. package/dist/ports/environment-repositories.js.map +1 -0
  98. package/dist/ports/execution-events.d.ts +72 -0
  99. package/dist/ports/execution-events.d.ts.map +1 -0
  100. package/dist/ports/execution-events.js +16 -0
  101. package/dist/ports/execution-events.js.map +1 -0
  102. package/dist/ports/fragment-repositories.d.ts +65 -0
  103. package/dist/ports/fragment-repositories.d.ts.map +1 -0
  104. package/dist/ports/fragment-repositories.js +2 -0
  105. package/dist/ports/fragment-repositories.js.map +1 -0
  106. package/dist/ports/fragment-selector.d.ts +64 -0
  107. package/dist/ports/fragment-selector.d.ts.map +1 -0
  108. package/dist/ports/fragment-selector.js +2 -0
  109. package/dist/ports/fragment-selector.js.map +1 -0
  110. package/dist/ports/github-client.d.ts +226 -0
  111. package/dist/ports/github-client.d.ts.map +1 -0
  112. package/dist/ports/github-client.js +2 -0
  113. package/dist/ports/github-client.js.map +1 -0
  114. package/dist/ports/github-provisioning.d.ts +47 -0
  115. package/dist/ports/github-provisioning.d.ts.map +1 -0
  116. package/dist/ports/github-provisioning.js +12 -0
  117. package/dist/ports/github-provisioning.js.map +1 -0
  118. package/dist/ports/github-repositories.d.ts +136 -0
  119. package/dist/ports/github-repositories.d.ts.map +1 -0
  120. package/dist/ports/github-repositories.js +2 -0
  121. package/dist/ports/github-repositories.js.map +1 -0
  122. package/dist/ports/incident-enrichment.d.ts +40 -0
  123. package/dist/ports/incident-enrichment.d.ts.map +1 -0
  124. package/dist/ports/incident-enrichment.js +30 -0
  125. package/dist/ports/incident-enrichment.js.map +1 -0
  126. package/dist/ports/index.d.ts +68 -0
  127. package/dist/ports/index.d.ts.map +1 -0
  128. package/dist/ports/index.js +11 -0
  129. package/dist/ports/index.js.map +1 -0
  130. package/dist/ports/invitation-repositories.d.ts +28 -0
  131. package/dist/ports/invitation-repositories.d.ts.map +1 -0
  132. package/dist/ports/invitation-repositories.js +2 -0
  133. package/dist/ports/invitation-repositories.js.map +1 -0
  134. package/dist/ports/llm-metrics.d.ts +142 -0
  135. package/dist/ports/llm-metrics.d.ts.map +1 -0
  136. package/dist/ports/llm-metrics.js +16 -0
  137. package/dist/ports/llm-metrics.js.map +1 -0
  138. package/dist/ports/llm-trace-sink.d.ts +84 -0
  139. package/dist/ports/llm-trace-sink.d.ts.map +1 -0
  140. package/dist/ports/llm-trace-sink.js +55 -0
  141. package/dist/ports/llm-trace-sink.js.map +1 -0
  142. package/dist/ports/local-model-repositories.d.ts +29 -0
  143. package/dist/ports/local-model-repositories.d.ts.map +1 -0
  144. package/dist/ports/local-model-repositories.js +2 -0
  145. package/dist/ports/local-model-repositories.js.map +1 -0
  146. package/dist/ports/merge-preset-repositories.d.ts +14 -0
  147. package/dist/ports/merge-preset-repositories.d.ts.map +1 -0
  148. package/dist/ports/merge-preset-repositories.js +2 -0
  149. package/dist/ports/merge-preset-repositories.js.map +1 -0
  150. package/dist/ports/model-default-repositories.d.ts +9 -0
  151. package/dist/ports/model-default-repositories.d.ts.map +1 -0
  152. package/dist/ports/model-default-repositories.js +6 -0
  153. package/dist/ports/model-default-repositories.js.map +1 -0
  154. package/dist/ports/model-provider.d.ts +69 -0
  155. package/dist/ports/model-provider.d.ts.map +1 -0
  156. package/dist/ports/model-provider.js +16 -0
  157. package/dist/ports/model-provider.js.map +1 -0
  158. package/dist/ports/notification-channel.d.ts +16 -0
  159. package/dist/ports/notification-channel.d.ts.map +1 -0
  160. package/dist/ports/notification-channel.js +22 -0
  161. package/dist/ports/notification-channel.js.map +1 -0
  162. package/dist/ports/notification-repositories.d.ts +15 -0
  163. package/dist/ports/notification-repositories.d.ts.map +1 -0
  164. package/dist/ports/notification-repositories.js +2 -0
  165. package/dist/ports/notification-repositories.js.map +1 -0
  166. package/dist/ports/password-hasher.d.ts +14 -0
  167. package/dist/ports/password-hasher.d.ts.map +1 -0
  168. package/dist/ports/password-hasher.js +9 -0
  169. package/dist/ports/password-hasher.js.map +1 -0
  170. package/dist/ports/personal-secret-cipher.d.ts +7 -0
  171. package/dist/ports/personal-secret-cipher.d.ts.map +1 -0
  172. package/dist/ports/personal-secret-cipher.js +12 -0
  173. package/dist/ports/personal-secret-cipher.js.map +1 -0
  174. package/dist/ports/personal-subscription-repositories.d.ts +72 -0
  175. package/dist/ports/personal-subscription-repositories.d.ts.map +1 -0
  176. package/dist/ports/personal-subscription-repositories.js +2 -0
  177. package/dist/ports/personal-subscription-repositories.js.map +1 -0
  178. package/dist/ports/pr-mergeability.d.ts +24 -0
  179. package/dist/ports/pr-mergeability.d.ts.map +1 -0
  180. package/dist/ports/pr-mergeability.js +7 -0
  181. package/dist/ports/pr-mergeability.js.map +1 -0
  182. package/dist/ports/pr-merger.d.ts +10 -0
  183. package/dist/ports/pr-merger.d.ts.map +1 -0
  184. package/dist/ports/pr-merger.js +8 -0
  185. package/dist/ports/pr-merger.js.map +1 -0
  186. package/dist/ports/provider-api-key-repositories.d.ts +71 -0
  187. package/dist/ports/provider-api-key-repositories.d.ts.map +1 -0
  188. package/dist/ports/provider-api-key-repositories.js +15 -0
  189. package/dist/ports/provider-api-key-repositories.js.map +1 -0
  190. package/dist/ports/provider-subscription-repositories.d.ts +51 -0
  191. package/dist/ports/provider-subscription-repositories.d.ts.map +1 -0
  192. package/dist/ports/provider-subscription-repositories.js +15 -0
  193. package/dist/ports/provider-subscription-repositories.js.map +1 -0
  194. package/dist/ports/recurring-repositories.d.ts +46 -0
  195. package/dist/ports/recurring-repositories.d.ts.map +1 -0
  196. package/dist/ports/recurring-repositories.js +2 -0
  197. package/dist/ports/recurring-repositories.js.map +1 -0
  198. package/dist/ports/release-health-repositories.d.ts +42 -0
  199. package/dist/ports/release-health-repositories.d.ts.map +1 -0
  200. package/dist/ports/release-health-repositories.js +6 -0
  201. package/dist/ports/release-health-repositories.js.map +1 -0
  202. package/dist/ports/release-health.d.ts +59 -0
  203. package/dist/ports/release-health.d.ts.map +1 -0
  204. package/dist/ports/release-health.js +8 -0
  205. package/dist/ports/release-health.js.map +1 -0
  206. package/dist/ports/repo-bootstrapper.d.ts +80 -0
  207. package/dist/ports/repo-bootstrapper.d.ts.map +1 -0
  208. package/dist/ports/repo-bootstrapper.js +2 -0
  209. package/dist/ports/repo-bootstrapper.js.map +1 -0
  210. package/dist/ports/repo-scanner.d.ts +22 -0
  211. package/dist/ports/repo-scanner.d.ts.map +1 -0
  212. package/dist/ports/repo-scanner.js +2 -0
  213. package/dist/ports/repo-scanner.js.map +1 -0
  214. package/dist/ports/repositories.d.ts +131 -0
  215. package/dist/ports/repositories.d.ts.map +1 -0
  216. package/dist/ports/repositories.js +2 -0
  217. package/dist/ports/repositories.js.map +1 -0
  218. package/dist/ports/requirement-review-repositories.d.ts +16 -0
  219. package/dist/ports/requirement-review-repositories.d.ts.map +1 -0
  220. package/dist/ports/requirement-review-repositories.js +2 -0
  221. package/dist/ports/requirement-review-repositories.js.map +1 -0
  222. package/dist/ports/runner-pool-provider.d.ts +25 -0
  223. package/dist/ports/runner-pool-provider.d.ts.map +1 -0
  224. package/dist/ports/runner-pool-provider.js +2 -0
  225. package/dist/ports/runner-pool-provider.js.map +1 -0
  226. package/dist/ports/runner-pool-repositories.d.ts +27 -0
  227. package/dist/ports/runner-pool-repositories.d.ts.map +1 -0
  228. package/dist/ports/runner-pool-repositories.js +7 -0
  229. package/dist/ports/runner-pool-repositories.js.map +1 -0
  230. package/dist/ports/runner-transport.d.ts +119 -0
  231. package/dist/ports/runner-transport.d.ts.map +1 -0
  232. package/dist/ports/runner-transport.js +2 -0
  233. package/dist/ports/runner-transport.js.map +1 -0
  234. package/dist/ports/runtime.d.ts +9 -0
  235. package/dist/ports/runtime.d.ts.map +1 -0
  236. package/dist/ports/runtime.js +5 -0
  237. package/dist/ports/runtime.js.map +1 -0
  238. package/dist/ports/sandbox-repositories.d.ts +39 -0
  239. package/dist/ports/sandbox-repositories.d.ts.map +1 -0
  240. package/dist/ports/sandbox-repositories.js +2 -0
  241. package/dist/ports/sandbox-repositories.js.map +1 -0
  242. package/dist/ports/secret-cipher.d.ts +7 -0
  243. package/dist/ports/secret-cipher.d.ts.map +1 -0
  244. package/dist/ports/secret-cipher.js +7 -0
  245. package/dist/ports/secret-cipher.js.map +1 -0
  246. package/dist/ports/service-fragment-default-repositories.d.ts +7 -0
  247. package/dist/ports/service-fragment-default-repositories.d.ts.map +1 -0
  248. package/dist/ports/service-fragment-default-repositories.js +6 -0
  249. package/dist/ports/service-fragment-default-repositories.js.map +1 -0
  250. package/dist/ports/service-repositories.d.ts +68 -0
  251. package/dist/ports/service-repositories.d.ts.map +1 -0
  252. package/dist/ports/service-repositories.js +2 -0
  253. package/dist/ports/service-repositories.js.map +1 -0
  254. package/dist/ports/slack-repositories.d.ts +61 -0
  255. package/dist/ports/slack-repositories.d.ts.map +1 -0
  256. package/dist/ports/slack-repositories.js +2 -0
  257. package/dist/ports/slack-repositories.js.map +1 -0
  258. package/dist/ports/task-repositories.d.ts +61 -0
  259. package/dist/ports/task-repositories.d.ts.map +1 -0
  260. package/dist/ports/task-repositories.js +2 -0
  261. package/dist/ports/task-repositories.js.map +1 -0
  262. package/dist/ports/task-source.d.ts +69 -0
  263. package/dist/ports/task-source.d.ts.map +1 -0
  264. package/dist/ports/task-source.js +2 -0
  265. package/dist/ports/task-source.js.map +1 -0
  266. package/dist/ports/ticket-tracker.d.ts +19 -0
  267. package/dist/ports/ticket-tracker.d.ts.map +1 -0
  268. package/dist/ports/ticket-tracker.js +8 -0
  269. package/dist/ports/ticket-tracker.js.map +1 -0
  270. package/dist/ports/token-usage.d.ts +37 -0
  271. package/dist/ports/token-usage.d.ts.map +1 -0
  272. package/dist/ports/token-usage.js +6 -0
  273. package/dist/ports/token-usage.js.map +1 -0
  274. package/dist/ports/tracker-settings-repositories.d.ts +6 -0
  275. package/dist/ports/tracker-settings-repositories.d.ts.map +1 -0
  276. package/dist/ports/tracker-settings-repositories.js +2 -0
  277. package/dist/ports/tracker-settings-repositories.js.map +1 -0
  278. package/dist/ports/url-safety-policy.d.ts +15 -0
  279. package/dist/ports/url-safety-policy.d.ts.map +1 -0
  280. package/dist/ports/url-safety-policy.js +13 -0
  281. package/dist/ports/url-safety-policy.js.map +1 -0
  282. package/dist/ports/user-repositories.d.ts +52 -0
  283. package/dist/ports/user-repositories.d.ts.map +1 -0
  284. package/dist/ports/user-repositories.js +13 -0
  285. package/dist/ports/user-repositories.js.map +1 -0
  286. package/dist/ports/webhook-verifier.d.ts +9 -0
  287. package/dist/ports/webhook-verifier.d.ts.map +1 -0
  288. package/dist/ports/webhook-verifier.js +8 -0
  289. package/dist/ports/webhook-verifier.js.map +1 -0
  290. package/dist/ports/work-runner.d.ts +19 -0
  291. package/dist/ports/work-runner.d.ts.map +1 -0
  292. package/dist/ports/work-runner.js +19 -0
  293. package/dist/ports/work-runner.js.map +1 -0
  294. package/dist/ports/workspace-settings-repositories.d.ts +8 -0
  295. package/dist/ports/workspace-settings-repositories.d.ts.map +1 -0
  296. package/dist/ports/workspace-settings-repositories.js +2 -0
  297. package/dist/ports/workspace-settings-repositories.js.map +1 -0
  298. package/dist/shared/atlassian.logic.d.ts +11 -0
  299. package/dist/shared/atlassian.logic.d.ts.map +1 -0
  300. package/dist/shared/atlassian.logic.js +148 -0
  301. package/dist/shared/atlassian.logic.js.map +1 -0
  302. package/dist/shared/markdown.logic.d.ts +5 -0
  303. package/dist/shared/markdown.logic.d.ts.map +1 -0
  304. package/dist/shared/markdown.logic.js +21 -0
  305. package/dist/shared/markdown.logic.js.map +1 -0
  306. package/dist/shared/source-registry.logic.d.ts +10 -0
  307. package/dist/shared/source-registry.logic.d.ts.map +1 -0
  308. package/dist/shared/source-registry.logic.js +17 -0
  309. package/dist/shared/source-registry.logic.js.map +1 -0
  310. package/dist/shared/tasks-prompt.logic.d.ts +16 -0
  311. package/dist/shared/tasks-prompt.logic.d.ts.map +1 -0
  312. package/dist/shared/tasks-prompt.logic.js +29 -0
  313. package/dist/shared/tasks-prompt.logic.js.map +1 -0
  314. package/dist/workspace-guard.d.ts +4 -0
  315. package/dist/workspace-guard.d.ts.map +1 -0
  316. package/dist/workspace-guard.js +5 -0
  317. package/dist/workspace-guard.js.map +1 -0
  318. package/package.json +32 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-status.d.ts","sourceRoot":"","sources":["../../src/ports/ci-status.ts"],"names":[],"mappings":"AAOA,mFAAmF;AACnF,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAA;IACd,oGAAoG;IACpG,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,kFAAkF;IAClF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,6FAA6F;IAC7F,MAAM,EAAE,OAAO,EAAE,CAAA;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;CACzE"}
@@ -0,0 +1,8 @@
1
+ // Port for reading a block's CI status — the GitHub check runs for the head
2
+ // commit of the pull request an implementation step opened. The execution
3
+ // engine's `ci` step polls this between durable sleeps to decide whether CI is
4
+ // green (advance), still running (keep polling) or failing (dispatch a CI-fixer).
5
+ // Modelled as a port so core stays free of GitHub specifics; the worker resolves
6
+ // the block's repo target + PR branch head and calls `GitHubClient.listCheckRuns`.
7
+ export {};
8
+ //# sourceMappingURL=ci-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-status.js","sourceRoot":"","sources":["../../src/ports/ci-status.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,0EAA0E;AAC1E,+EAA+E;AAC/E,kFAAkF;AAClF,iFAAiF;AACjF,mFAAmF"}
@@ -0,0 +1,12 @@
1
+ import type { ClarityReview } from '../domain/types.js';
2
+ export interface ClarityReviewRepository {
3
+ /** The current review for a block, or null if none has been run. */
4
+ getByBlock(workspaceId: string, blockId: string): Promise<ClarityReview | null>;
5
+ /** A review by its id, or null if it does not exist. */
6
+ get(workspaceId: string, id: string): Promise<ClarityReview | null>;
7
+ /** Create or replace a review (the service deletes a block's prior review first). */
8
+ upsert(workspaceId: string, review: ClarityReview): Promise<void>;
9
+ /** Drop any existing review(s) for a block (called before a fresh review run). */
10
+ deleteByBlock(workspaceId: string, blockId: string): Promise<void>;
11
+ }
12
+ //# sourceMappingURL=clarity-review-repositories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clarity-review-repositories.d.ts","sourceRoot":"","sources":["../../src/ports/clarity-review-repositories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAQvD,MAAM,WAAW,uBAAuB;IACtC,oEAAoE;IACpE,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;IAC/E,wDAAwD;IACxD,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;IACnE,qFAAqF;IACrF,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACjE,kFAAkF;IAClF,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACnE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=clarity-review-repositories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clarity-review-repositories.js","sourceRoot":"","sources":["../../src/ports/clarity-review-repositories.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import type { ConsensusSession } from '../domain/types.js';
2
+ export interface ConsensusSessionRepository {
3
+ /** A session by its id, or null if it does not exist. */
4
+ get(workspaceId: string, id: string): Promise<ConsensusSession | null>;
5
+ /** The session for a specific run step, or null if none has run. */
6
+ getByStep(workspaceId: string, executionId: string, stepIndex: number): Promise<ConsensusSession | null>;
7
+ /** The most recent session for a block, or null if none has run. */
8
+ getByBlock(workspaceId: string, blockId: string): Promise<ConsensusSession | null>;
9
+ /** Create or replace a session (idempotent per id — replays/live updates re-upsert). */
10
+ upsert(workspaceId: string, session: ConsensusSession): Promise<void>;
11
+ }
12
+ //# sourceMappingURL=consensus-repositories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consensus-repositories.d.ts","sourceRoot":"","sources":["../../src/ports/consensus-repositories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAU1D,MAAM,WAAW,0BAA0B;IACzC,yDAAyD;IACzD,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAA;IACtE,oEAAoE;IACpE,SAAS,CACP,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAA;IACnC,oEAAoE;IACpE,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAA;IAClF,wFAAwF;IACxF,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACtE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=consensus-repositories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consensus-repositories.js","sourceRoot":"","sources":["../../src/ports/consensus-repositories.ts"],"names":[],"mappings":""}
@@ -0,0 +1,55 @@
1
+ import type { DocumentSourceKind } from '../domain/types.js';
2
+ import type { DocumentCredentials } from './document-source.js';
3
+ /**
4
+ * A workspace's connection to one document source, including its credential bag.
5
+ * Credentials are infrastructure detail (never sent on the wire); they live here
6
+ * so the import path can authenticate against the source for this workspace.
7
+ */
8
+ export interface DocumentConnectionRecord {
9
+ workspaceId: string;
10
+ source: DocumentSourceKind;
11
+ credentials: DocumentCredentials;
12
+ /** Human-friendly label for the connection (site URL, workspace name). */
13
+ label: string;
14
+ createdAt: number;
15
+ /** Set when the workspace disconnects (tombstone). */
16
+ deletedAt: number | null;
17
+ }
18
+ export interface DocumentConnectionRepository {
19
+ /** The workspace's live connection for a source, or null if not connected. */
20
+ getByWorkspace(workspaceId: string, source: DocumentSourceKind): Promise<DocumentConnectionRecord | null>;
21
+ /** Every live connection the workspace holds, across sources. */
22
+ listByWorkspace(workspaceId: string): Promise<DocumentConnectionRecord[]>;
23
+ /** Create or replace the live connection for a (workspace, source). */
24
+ upsert(record: DocumentConnectionRecord): Promise<void>;
25
+ /** Tombstone the workspace's connection to a source. */
26
+ softDelete(workspaceId: string, source: DocumentSourceKind, at: number): Promise<void>;
27
+ }
28
+ /**
29
+ * A page projected locally for a workspace. The cached `body` (normalized
30
+ * Markdown) backs both the planner and the agent context injection;
31
+ * `linkedBlockId` records the board block this page is attached to, if any.
32
+ */
33
+ export interface DocumentRecord {
34
+ workspaceId: string;
35
+ source: DocumentSourceKind;
36
+ externalId: string;
37
+ title: string;
38
+ url: string;
39
+ excerpt: string;
40
+ body: string;
41
+ linkedBlockId: string | null;
42
+ syncedAt: number;
43
+ deletedAt: number | null;
44
+ }
45
+ export interface DocumentRepository {
46
+ upsert(record: DocumentRecord): Promise<void>;
47
+ get(workspaceId: string, source: DocumentSourceKind, externalId: string): Promise<DocumentRecord | null>;
48
+ /** Every live document imported into the workspace, across sources. */
49
+ listByWorkspace(workspaceId: string): Promise<DocumentRecord[]>;
50
+ /** Live documents attached to a board block (resolved during execution). */
51
+ listByBlock(workspaceId: string, blockId: string): Promise<DocumentRecord[]>;
52
+ /** Attach a document to a board block (or detach with null). */
53
+ linkBlock(workspaceId: string, source: DocumentSourceKind, externalId: string, blockId: string | null): Promise<void>;
54
+ }
55
+ //# sourceMappingURL=document-repositories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-repositories.d.ts","sourceRoot":"","sources":["../../src/ports/document-repositories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAO/D;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,kBAAkB,CAAA;IAC1B,WAAW,EAAE,mBAAmB,CAAA;IAChC,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,sDAAsD;IACtD,SA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A4E;IAC5E,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAA;IAC5E,gEAAgE;IAChE,SAAS,CACP,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,kBAAkB,EAC1B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GAAG,IAAI,GACrB,OAAO,CAAC,IAAI,CAAC,CAAA;CACjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=document-repositories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-repositories.js","sourceRoot":"","sources":["../../src/ports/document-repositories.ts"],"names":[],"mappings":""}
@@ -0,0 +1,55 @@
1
+ import type { DocumentSourceKind, DocumentSourceDescriptor, DocumentSearchResult } from '../domain/types.js';
2
+ /** A source's per-workspace credentials, as a flat key→value bag. */
3
+ export type DocumentCredentials = Record<string, string>;
4
+ /** A page fetched from a source, with its body normalized to Markdown. */
5
+ export interface DocumentContent {
6
+ /** The source's stable id for the page. */
7
+ externalId: string;
8
+ title: string;
9
+ /** Canonical web URL of the page. */
10
+ url: string;
11
+ /** Body normalized to lightweight Markdown (consumed by the planner/excerpt). */
12
+ body: string;
13
+ }
14
+ /** The result of validating + normalizing connect credentials. */
15
+ export interface NormalizedConnection {
16
+ /** The credential bag to persist (trimmed/normalized). */
17
+ credentials: DocumentCredentials;
18
+ /** A human-friendly label for the connection (site URL, workspace name). */
19
+ label: string;
20
+ }
21
+ export interface DocumentSourceProvider {
22
+ /** Which source this provider serves. */
23
+ readonly kind: DocumentSourceKind;
24
+ /** Self-description so the UI can render the connect/import forms generically. */
25
+ readonly descriptor: DocumentSourceDescriptor;
26
+ /**
27
+ * Validate the supplied credentials and return the bag to persist plus a
28
+ * display label. Throws a ValidationError on anything missing/unsafe.
29
+ */
30
+ normalizeConnection(input: DocumentCredentials): NormalizedConnection;
31
+ /** Resolve a stable page id from raw user input (a bare id or a page URL); null if unparseable. */
32
+ parseRef(input: string): string | null;
33
+ /** Fetch a single page by its id using the connection credentials. */
34
+ fetchDocument(credentials: DocumentCredentials, externalId: string): Promise<DocumentContent>;
35
+ /**
36
+ * Search the source's catalogue by free text and return lean hits (no body).
37
+ * Optional: a provider that only supports paste-a-URL import omits it (and its
38
+ * descriptor sets `searchable: false`). The provider builds the query and maps
39
+ * the response; the returned `externalId`s are valid import refs.
40
+ *
41
+ * `workspaceId` is the workspace whose connection is searching, so a provider
42
+ * that authenticates per-workspace out-of-band (e.g. the GitHub App, which
43
+ * ignores `credentials`) can scope the search to that workspace's installation
44
+ * instead of leaking across tenants.
45
+ */
46
+ search?(credentials: DocumentCredentials, query: string, workspaceId: string): Promise<DocumentSearchResult[]>;
47
+ }
48
+ /** A lookup of the providers wired for this deployment, keyed by source. */
49
+ export interface DocumentSourceRegistry {
50
+ /** The provider for a source, or undefined if that source isn't configured. */
51
+ get(kind: DocumentSourceKind): DocumentSourceProvider | undefined;
52
+ /** Every configured provider (drives the source list exposed to the UI). */
53
+ list(): DocumentSourceProvider[];
54
+ }
55
+ //# sourceMappingURL=document-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-source.d.ts","sourceRoot":"","sources":["../../src/ports/document-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,oBAAoB,CAAA;AAa3B,qEAAqE;AACrE,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAExD,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAA;IACX,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAA;CACb;AAED,kEAAkE;AAClE,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,WAAW,EAAE,mBAAmB,CAAA;IAChC,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;IACjC,kFAAkF;IAClF,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAA;IAC7C;;;OAGG;IACH,mBAAmB,CAAC,KAAK,EAAE,mBAAmB,GAAG,oBAAoB,CAAA;IACrE,mGAAmG;IACnG,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IACtC,sEAAsE;IACtE,aAAa,CAAC,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IAC7F;;;;;;;;;;OAUG;IACH,MAAM,CAAC,CACL,WAAW,EAAE,mBAAmB,EAChC,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAA;CACnC;AAED,4EAA4E;AAC5E,MAAM,WAAW,sBAAsB;IACrC,+EAA+E;IAC/E,GAAG,CAAC,IAAI,EAAE,kBAAkB,GAAG,sBAAsB,GAAG,SAAS,CAAA;IACjE,4EAA4E;IAC5E,IAAI,IAAI,sBAAsB,EAAE,CAAA;CACjC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=document-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-source.js","sourceRoot":"","sources":["../../src/ports/document-source.ts"],"names":[],"mappings":""}
@@ -0,0 +1,42 @@
1
+ export interface EmailMessage {
2
+ to: string;
3
+ subject: string;
4
+ /** HTML body. */
5
+ html: string;
6
+ /** Plain-text fallback (recommended for deliverability). */
7
+ text?: string;
8
+ }
9
+ export interface EmailSender {
10
+ /** Send one transactional email. Throws on a provider/transport failure. */
11
+ send(message: EmailMessage): Promise<void>;
12
+ }
13
+ /** Supported transactional-email providers (UI-onboarded per account). */
14
+ export type EmailProviderKind = 'sendgrid' | 'resend';
15
+ /**
16
+ * An account's email-sender connection: which provider, the From address, and the
17
+ * encrypted provider API key. Keyed per-account and stored in the DB (onboarded in
18
+ * the UI, never via env). The key is decrypted only in-memory at send time.
19
+ */
20
+ export interface EmailConnectionRecord {
21
+ accountId: string;
22
+ provider: EmailProviderKind;
23
+ fromAddress: string;
24
+ /** Ciphertext of the provider API key (SecretCipher envelope); never plaintext. */
25
+ apiKeyCipher: string;
26
+ createdAt: number;
27
+ updatedAt: number;
28
+ /** Set when the account disconnects email (tombstone). */
29
+ deletedAt: number | null;
30
+ }
31
+ export interface EmailConnectionRepository {
32
+ /**
33
+ * The account's live (non-tombstoned) connection, or null when not connected or
34
+ * disconnected. Soft-deleted rows are filtered out, so callers never see a tombstone.
35
+ */
36
+ getByAccount(accountId: string): Promise<EmailConnectionRecord | null>;
37
+ /** Create or replace the live connection for an account. */
38
+ upsert(record: EmailConnectionRecord): Promise<void>;
39
+ /** Tombstone the account's connection. */
40
+ softDelete(accountId: string, at: number): Promise<void>;
41
+ }
42
+ //# sourceMappingURL=email-sender.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-sender.d.ts","sourceRoot":"","sources":["../../src/ports/email-sender.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,IAAI,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3C;AAED,0EAA0E;AAC1E,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,QAAQ,CAAA;AAErD;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,mFAAmF;IACnF,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,0DAA0D;IAC1D,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAA;IACtE,4DAA4D;IAC5D,MAAM,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpD,0CAA0C;IAC1C,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzD"}
@@ -0,0 +1,7 @@
1
+ // Port for transactional email delivery (invitations today; could back an email
2
+ // NotificationChannel later). The facade composes whichever provider is configured
3
+ // (SendGrid / Resend) behind this single port — mirroring how the model registry
4
+ // composes vendor resolvers. Unconfigured ⇒ the port is simply not wired, and the
5
+ // callers that need it are opt-in.
6
+ export {};
7
+ //# sourceMappingURL=email-sender.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-sender.js","sourceRoot":"","sources":["../../src/ports/email-sender.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,mFAAmF;AACnF,iFAAiF;AACjF,kFAAkF;AAClF,mCAAmC"}
@@ -0,0 +1,67 @@
1
+ import type { EnvironmentAccessHandle, EnvironmentManifest, EnvironmentStatus } from '../domain/types.js';
2
+ /** Resolve a manifest `secretRef.key` to its value, or undefined if unset. */
3
+ export type SecretResolver = (key: string) => string | undefined;
4
+ /** Fields extracted from an earlier provision response, for status/teardown. */
5
+ export type ProvisionFields = Record<string, string>;
6
+ /**
7
+ * Typed build context for a provision call, derived from the block under deployment.
8
+ * A PR-environment provider needs the git ref + repo identity to target the right
9
+ * environment; the same values are also flattened into `inputs` as `{{input.*}}`
10
+ * strings for the manifest path. Every field is optional — a manual provision or a
11
+ * non-PR block may carry none.
12
+ */
13
+ export interface ProvisionContext {
14
+ blockId?: string;
15
+ /** The head branch the agent pushed its work to, when known. */
16
+ branch?: string;
17
+ /** The pull request number within the repo, when known. */
18
+ pullNumber?: number;
19
+ /** The pull request web URL, when known. */
20
+ pullUrl?: string;
21
+ /** The repo owner (org/user login), when resolvable. */
22
+ repoOwner?: string;
23
+ /** The repo name, when resolvable. */
24
+ repoName?: string;
25
+ }
26
+ export interface ProvisionEnvironmentRequest {
27
+ manifest: EnvironmentManifest;
28
+ /** Provision inputs (`{{input.*}}` in templates). */
29
+ inputs: Record<string, string>;
30
+ /**
31
+ * Typed git/PR/repo context for a code adapter. The same values are also present
32
+ * in `inputs` as strings, so the manifest-HTTP path needs nothing extra.
33
+ */
34
+ provisionContext?: ProvisionContext;
35
+ resolveSecret: SecretResolver;
36
+ }
37
+ export interface EnvironmentStatusRequest {
38
+ manifest: EnvironmentManifest;
39
+ externalId: string | null;
40
+ /** Fields captured at provision time (`{{provision.*}}` in templates). */
41
+ provisionFields: ProvisionFields;
42
+ resolveSecret: SecretResolver;
43
+ }
44
+ export interface EnvironmentTeardownRequest {
45
+ manifest: EnvironmentManifest;
46
+ externalId: string | null;
47
+ provisionFields: ProvisionFields;
48
+ resolveSecret: SecretResolver;
49
+ }
50
+ /** The provider's view of a provisioned environment (mapped from its response). */
51
+ export interface ProvisionedEnvironment {
52
+ externalId: string | null;
53
+ url: string | null;
54
+ status: EnvironmentStatus;
55
+ expiresAt: number | null;
56
+ access: EnvironmentAccessHandle | null;
57
+ /** All fields the response mapping captured, for later status/teardown calls. */
58
+ fields: ProvisionFields;
59
+ }
60
+ export interface EnvironmentProvider {
61
+ provision(req: ProvisionEnvironmentRequest): Promise<ProvisionedEnvironment>;
62
+ status(req: EnvironmentStatusRequest): Promise<ProvisionedEnvironment>;
63
+ teardown(req: EnvironmentTeardownRequest): Promise<{
64
+ status: EnvironmentStatus;
65
+ }>;
66
+ }
67
+ //# sourceMappingURL=environment-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-provider.d.ts","sourceRoot":"","sources":["../../src/ports/environment-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,oBAAoB,CAAA;AAS3B,8EAA8E;AAC9E,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAA;AAEhE,gFAAgF;AAChF,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAEpD;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,aAAa,EAAE,cAAc,CAAA;CAC9B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,0EAA0E;IAC1E,eAAe,EAAE,eAAe,CAAA;IAChC,aAAa,EAAE,cAAc,CAAA;CAC9B;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,eAAe,EAAE,eAAe,CAAA;IAChC,aAAa,EAAE,cAAc,CAAA;CAC9B;AAED,mFAAmF;AACnF,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,MAAM,EAAE,iBAAiB,CAAA;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAAA;IACtC,iFAAiF;IACjF,MAAM,EAAE,eAAe,CAAA;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,GAAG,EAAE,2BAA2B,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAC5E,MAAM,CAAC,GAAG,EAAE,wBAAwB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;IACtE,QAAQ,CAAC,GAAG,EAAE,0BAA0B,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,iBAAiB,CAAA;KAAE,CAAC,CAAA;CAClF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=environment-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-provider.js","sourceRoot":"","sources":["../../src/ports/environment-provider.ts"],"names":[],"mappings":""}
@@ -0,0 +1,64 @@
1
+ import type { EnvironmentStatus } from '../domain/types.js';
2
+ /**
3
+ * A workspace's binding to an environment provider: the validated manifest and
4
+ * the encrypted per-tenant secret bundle (the management-API credentials). The
5
+ * bundle is decrypted only in-memory, at call time, by the provisioning path.
6
+ */
7
+ export interface EnvironmentConnectionRecord {
8
+ workspaceId: string;
9
+ providerId: string;
10
+ label: string;
11
+ baseUrl: string;
12
+ /** The validated manifest, serialized as JSON. */
13
+ manifestJson: string;
14
+ /** Ciphertext of the `{ key: value }` secret bundle (SecretCipher envelope). */
15
+ secretsCipher: string;
16
+ createdAt: number;
17
+ /** Set when the workspace unregisters (tombstone). */
18
+ deletedAt: number | null;
19
+ }
20
+ export interface EnvironmentConnectionRepository {
21
+ /** The workspace's live connection, or null if not registered. */
22
+ getByWorkspace(workspaceId: string): Promise<EnvironmentConnectionRecord | null>;
23
+ /** Create or replace the live connection for a workspace. */
24
+ upsert(record: EnvironmentConnectionRecord): Promise<void>;
25
+ /** Tombstone the workspace's connection. */
26
+ softDelete(workspaceId: string, at: number): Promise<void>;
27
+ }
28
+ /**
29
+ * A provisioned environment, projected locally. `accessCipher` holds the
30
+ * encrypted per-env access creds (what the tester uses); `provisionFieldsCipher`
31
+ * holds the encrypted fields captured at provision time (needed to interpolate
32
+ * status/teardown calls). Both are SecretCipher envelopes, never plaintext.
33
+ */
34
+ export interface EnvironmentRecord {
35
+ id: string;
36
+ workspaceId: string;
37
+ blockId: string | null;
38
+ executionId: string | null;
39
+ providerId: string;
40
+ externalId: string | null;
41
+ url: string | null;
42
+ status: EnvironmentStatus;
43
+ accessCipher: string | null;
44
+ provisionFieldsCipher: string | null;
45
+ createdAt: number;
46
+ expiresAt: number | null;
47
+ lastError: string | null;
48
+ deletedAt: number | null;
49
+ }
50
+ export type EnvironmentRecordPatch = Partial<Pick<EnvironmentRecord, 'externalId' | 'url' | 'status' | 'accessCipher' | 'provisionFieldsCipher' | 'expiresAt' | 'lastError'>>;
51
+ export interface EnvironmentRegistryRepository {
52
+ insert(record: EnvironmentRecord): Promise<void>;
53
+ update(workspaceId: string, id: string, patch: EnvironmentRecordPatch): Promise<void>;
54
+ get(workspaceId: string, id: string): Promise<EnvironmentRecord | null>;
55
+ /** The live environment provisioned for a board block — the discovery key. */
56
+ getByBlock(workspaceId: string, blockId: string): Promise<EnvironmentRecord | null>;
57
+ /** Every live environment in the workspace. */
58
+ listByWorkspace(workspaceId: string): Promise<EnvironmentRecord[]>;
59
+ /** Live environments whose TTL has elapsed (all workspaces), for the cron sweep. */
60
+ listExpired(nowEpochMs: number): Promise<EnvironmentRecord[]>;
61
+ /** Tombstone an environment record. */
62
+ softDelete(workspaceId: string, id: string, at: number): Promise<void>;
63
+ }
64
+ //# sourceMappingURL=environment-repositories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-repositories.d.ts","sourceRoot":"","sources":["../../src/ports/environment-repositories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAQ3D;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAA;IACpB,gFAAgF;IAChF,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,sDAAsD;IACtD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,WAAW,+BAA+B;IAC9C,kEAAkE;IAClE,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAAA;IAChF,6DAA6D;IAC7D,MAAM,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1D,4CAA4C;IAC5C,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3D;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAA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vC,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACvE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=environment-repositories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-repositories.js","sourceRoot":"","sources":["../../src/ports/environment-repositories.ts"],"names":[],"mappings":""}
@@ -0,0 +1,72 @@
1
+ import type { Block, BootstrapJob, ConsensusSession, ClarityReview, ExecutionInstance, LlmCallActivity, Notification, RequirementReview } from '../domain/types.js';
2
+ export interface ExecutionEventPublisher {
3
+ /** A run advanced: push the updated instance and its rolled-up block. */
4
+ executionChanged(workspaceId: string, instance: ExecutionInstance, block?: Block | null): Promise<void>;
5
+ /**
6
+ * A structural board change the per-instance event can't express (a module
7
+ * materialised, a run cancelled) — a coarse signal that prompts a full refresh.
8
+ * `blockId` (when known) identifies a block of the affected service so the change can
9
+ * be fanned out to every workspace that mounts it (in-org sharing); omit it for a
10
+ * genuinely board-wide signal, which then reaches the originating workspace only.
11
+ */
12
+ boardChanged(workspaceId: string, reason: string, blockId?: string | null): Promise<void>;
13
+ /**
14
+ * A repo-bootstrap run advanced: push the updated job (with live `subtasks`)
15
+ * and its provisional/linked service frame, so the board patches the
16
+ * "bootstrapping…" card and its progress without a refetch. Optional so
17
+ * publishers/tests that predate bootstrap progress need no change.
18
+ */
19
+ bootstrapChanged?(workspaceId: string, job: BootstrapJob, block?: Block | null): Promise<void>;
20
+ /**
21
+ * A human-actionable notification was raised or resolved: push it so the board
22
+ * surfaces/clears its badge and inbox entry live. Optional so publishers/tests
23
+ * that predate notifications need no change.
24
+ */
25
+ notificationChanged?(workspaceId: string, notification: Notification): Promise<void>;
26
+ /**
27
+ * One container-agent LLM call completed at the proxy: push its compact summary
28
+ * (no prompt/response bodies) so an open "Model activity" view updates live,
29
+ * independent of the durable driver (the proxy records calls even while the run's
30
+ * poll loop is frozen). Optional so publishers/tests that predate it need no change;
31
+ * a runtime with no real-time transport wired leaves it a no-op.
32
+ */
33
+ llmCallObserved?(workspaceId: string, activity: LlmCallActivity): Promise<void>;
34
+ /**
35
+ * A block's requirements review changed status (the async incorporate + re-review cycle
36
+ * started, produced new findings, converged, or hit its cap): push the updated review so
37
+ * an open review window / inspector reflects the transition live. This is live state, not
38
+ * a summons — the user is called back via a `notificationChanged` event when input is
39
+ * needed. Optional; a runtime with no real-time transport wired leaves it a no-op.
40
+ */
41
+ requirementReviewChanged?(workspaceId: string, review: RequirementReview): Promise<void>;
42
+ /**
43
+ * A consensus session advanced (a participant contributed, a round completed, the
44
+ * synthesis landed, or it failed): push the updated transcript so an open Consensus
45
+ * Session window reflects the multi-model process live. Optional; a runtime with no
46
+ * real-time transport — or no consensus package wired — leaves it a no-op.
47
+ */
48
+ consensusSessionChanged?(workspaceId: string, session: ConsensusSession): Promise<void>;
49
+ /**
50
+ * A block's clarity (bug-report triage) review changed status — the mirror of
51
+ * {@link requirementReviewChanged} for the clarity loop: push the updated review so an
52
+ * open review window / inspector reflects the transition live. Optional; a runtime with
53
+ * no real-time transport wired leaves it a no-op.
54
+ */
55
+ clarityReviewChanged?(workspaceId: string, review: ClarityReview): Promise<void>;
56
+ }
57
+ /**
58
+ * The default publisher: it does nothing. With it wired, the engine behaves exactly
59
+ * as before — no events are pushed (tests, and any deployment without the
60
+ * WORKSPACE_EVENTS binding).
61
+ */
62
+ export declare class NoopEventPublisher implements ExecutionEventPublisher {
63
+ executionChanged(): Promise<void>;
64
+ boardChanged(): Promise<void>;
65
+ bootstrapChanged(): Promise<void>;
66
+ notificationChanged(): Promise<void>;
67
+ llmCallObserved(): Promise<void>;
68
+ requirementReviewChanged(): Promise<void>;
69
+ consensusSessionChanged(): Promise<void>;
70
+ clarityReviewChanged(): Promise<void>;
71
+ }
72
+ //# sourceMappingURL=execution-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-events.d.ts","s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AAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACjF;AAED;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,uBAAuB;IAC1D,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;IACpC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;IAChC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;IACpC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;IACvC,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;IACnC,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;IAC5C,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;IAC3C,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;CAC/C"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The default publisher: it does nothing. With it wired, the engine behaves exactly
3
+ * as before — no events are pushed (tests, and any deployment without the
4
+ * WORKSPACE_EVENTS binding).
5
+ */
6
+ export class NoopEventPublisher {
7
+ async executionChanged() { }
8
+ async boardChanged() { }
9
+ async bootstrapChanged() { }
10
+ async notificationChanged() { }
11
+ async llmCallObserved() { }
12
+ async requirementReviewChanged() { }
13
+ async consensusSessionChanged() { }
14
+ async clarityReviewChanged() { }
15
+ }
16
+ //# sourceMappingURL=execution-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-events.js","sourceRoot":"","sources":["../../src/ports/execution-events.ts"],"names":[],"mappings":"AAmFA;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IAC7B,KAAK,CAAC,gBAAgB,KAAmB,CAAC;IAC1C,KAAK,CAAC,YAAY,KAAmB,CAAC;IACtC,KAAK,CAAC,gBAAgB,KAAmB,CAAC;IAC1C,KAAK,CAAC,mBAAmB,KAAmB,CAAC;IAC7C,KAAK,CAAC,eAAe,KAAmB,CAAC;IACzC,KAAK,CAAC,wBAAwB,KAAmB,CAAC;IAClD,KAAK,CAAC,uBAAuB,KAAmB,CAAC;IACjD,KAAK,CAAC,oBAAoB,KAAmB,CAAC;CAC/C"}
@@ -0,0 +1,65 @@
1
+ import type { AgentKind, BlockType, FragmentOwnerKind } from '../domain/types.js';
2
+ /** The `appliesTo` hints, retained as the deterministic-selection fallback. */
3
+ export interface FragmentAppliesTo {
4
+ blockTypes?: BlockType[];
5
+ agentKinds?: AgentKind[];
6
+ }
7
+ /** A persisted managed fragment row at one tier (see ADR 0006 §2). */
8
+ export interface PromptFragmentRecord {
9
+ /** Stable, globally-unique id (a slug, or `src:<sourceId>:<path>` for sourced). */
10
+ fragmentId: string;
11
+ ownerKind: FragmentOwnerKind;
12
+ ownerId: string;
13
+ version: string;
14
+ title: string;
15
+ category: string | null;
16
+ /** One-line description; fed to the relevance selector. */
17
+ summary: string;
18
+ /** The guidance folded into the system prompt. */
19
+ body: string;
20
+ appliesTo: FragmentAppliesTo | null;
21
+ tags: string[] | null;
22
+ /** Provenance, when sourced from a repo (null for hand-authored). */
23
+ sourceId: string | null;
24
+ sourcePath: string | null;
25
+ sourceSha: string | null;
26
+ createdAt: number;
27
+ updatedAt: number;
28
+ /** Tombstone: suppresses an inherited fragment, or marks one removed upstream. */
29
+ deletedAt: number | null;
30
+ }
31
+ export interface PromptFragmentRepository {
32
+ /**
33
+ * Fragments owned by `(ownerKind, ownerId)`. Excludes tombstones by default;
34
+ * pass `includeDeleted` for the catalog merge, which must see suppressions.
35
+ */
36
+ listByOwner(ownerKind: FragmentOwnerKind, ownerId: string, includeDeleted?: boolean): Promise<PromptFragmentRecord[]>;
37
+ get(ownerKind: FragmentOwnerKind, ownerId: string, fragmentId: string): Promise<PromptFragmentRecord | null>;
38
+ upsert(record: PromptFragmentRecord): Promise<void>;
39
+ softDelete(ownerKind: FragmentOwnerKind, ownerId: string, fragmentId: string, at: number): Promise<void>;
40
+ /** Live fragments produced by a given source, for resync diffing/tombstoning. */
41
+ listBySource(sourceId: string): Promise<PromptFragmentRecord[]>;
42
+ }
43
+ /** A repo a tier links as a source of Markdown guideline files (ADR 0006 §3). */
44
+ export interface FragmentSourceRecord {
45
+ id: string;
46
+ ownerKind: FragmentOwnerKind;
47
+ ownerId: string;
48
+ repoOwner: string;
49
+ repoName: string;
50
+ gitRef: string;
51
+ dirPath: string;
52
+ /** Digest of the source tree at the last successful sync; powers "changed?". */
53
+ lastSyncedSha: string | null;
54
+ lastSyncedAt: number | null;
55
+ createdAt: number;
56
+ deletedAt: number | null;
57
+ }
58
+ export interface FragmentSourceRepository {
59
+ listByOwner(ownerKind: FragmentOwnerKind, ownerId: string): Promise<FragmentSourceRecord[]>;
60
+ get(id: string): Promise<FragmentSourceRecord | null>;
61
+ upsert(record: FragmentSourceRecord): Promise<void>;
62
+ updateSyncState(id: string, lastSyncedSha: string, lastSyncedAt: number): Promise<void>;
63
+ softDelete(id: string, at: number): Promise<void>;
64
+ }
65
+ //# sourceMappingURL=fragment-repositories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fragment-repositories.d.ts","sourceRoot":"","sources":["../../src/ports/fragment-repositories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAUjF,+EAA+E;AAC/E,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;IACxB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;CACzB;AAED,sEAAsE;AACtE,MAAM,WAAW,oBAAoB;IACnC,mFAAmF;IACnF,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,iBAAiB,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAA;IAC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M,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,gFAAgF;IAChF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,CAAC,SAAS,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAA;IAC3F,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAA;IACrD,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACnD,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACvF,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAClD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=fragment-repositories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fragment-repositories.js","sourceRoot":"","sources":["../../src/ports/fragment-repositories.ts"],"names":[],"mappings":""}