@mastra/factory 0.28.0-alpha.0 → 0.28.0-alpha.10

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 (746) hide show
  1. package/README.md +528 -161
  2. package/dist/auth.d.ts.map +1 -1
  3. package/dist/auth.js +12 -6
  4. package/dist/auth.js.map +1 -1
  5. package/dist/boards/board-events.d.ts +54 -0
  6. package/dist/boards/board-events.d.ts.map +1 -0
  7. package/dist/boards/board-events.js +87 -0
  8. package/dist/boards/board-events.js.map +1 -0
  9. package/dist/boards/board-writes.d.ts +86 -0
  10. package/dist/boards/board-writes.d.ts.map +1 -0
  11. package/dist/boards/board-writes.js +266 -0
  12. package/dist/boards/board-writes.js.map +1 -0
  13. package/dist/boards/card-facts.d.ts +3 -1
  14. package/dist/boards/card-facts.d.ts.map +1 -1
  15. package/dist/boards/card-facts.js +30 -4
  16. package/dist/boards/card-facts.js.map +1 -1
  17. package/dist/boards/default-board.d.ts +7 -0
  18. package/dist/boards/default-board.d.ts.map +1 -0
  19. package/dist/boards/default-board.js +10 -0
  20. package/dist/boards/default-board.js.map +1 -0
  21. package/dist/boards/define-board.d.ts +56 -23
  22. package/dist/boards/define-board.d.ts.map +1 -1
  23. package/dist/boards/define-board.js +89 -45
  24. package/dist/boards/define-board.js.map +1 -1
  25. package/dist/boards/index.d.ts +6 -9
  26. package/dist/boards/index.d.ts.map +1 -1
  27. package/dist/boards/index.js +6 -20
  28. package/dist/boards/intake-routing.d.ts +55 -11
  29. package/dist/boards/intake-routing.d.ts.map +1 -1
  30. package/dist/boards/intake-routing.js +109 -19
  31. package/dist/boards/intake-routing.js.map +1 -1
  32. package/dist/boards/legacy-plan-role.d.ts.map +1 -1
  33. package/dist/boards/legacy-plan-role.js +14 -5
  34. package/dist/boards/legacy-plan-role.js.map +1 -1
  35. package/dist/boards/phase-automation.d.ts +7 -0
  36. package/dist/boards/phase-automation.d.ts.map +1 -1
  37. package/dist/boards/phase-automation.js +19 -3
  38. package/dist/boards/phase-automation.js.map +1 -1
  39. package/dist/boards/phase-runner.d.ts +18 -10
  40. package/dist/boards/phase-runner.d.ts.map +1 -1
  41. package/dist/boards/phase-runner.js +39 -34
  42. package/dist/boards/phase-runner.js.map +1 -1
  43. package/dist/boards/project-boards.d.ts +65 -8
  44. package/dist/boards/project-boards.d.ts.map +1 -1
  45. package/dist/boards/project-boards.js +217 -26
  46. package/dist/boards/project-boards.js.map +1 -1
  47. package/dist/boards/registry.d.ts +7 -1
  48. package/dist/boards/registry.d.ts.map +1 -1
  49. package/dist/boards/registry.js +19 -4
  50. package/dist/boards/registry.js.map +1 -1
  51. package/dist/boards/relocate.d.ts +1 -1
  52. package/dist/boards/relocate.d.ts.map +1 -1
  53. package/dist/boards/relocate.js +3 -2
  54. package/dist/boards/relocate.js.map +1 -1
  55. package/dist/boards/review.d.ts +5 -2
  56. package/dist/boards/review.d.ts.map +1 -1
  57. package/dist/boards/review.js +12 -11
  58. package/dist/boards/review.js.map +1 -1
  59. package/dist/boards/semantics.d.ts +160 -20
  60. package/dist/boards/semantics.d.ts.map +1 -1
  61. package/dist/boards/semantics.js +255 -23
  62. package/dist/boards/semantics.js.map +1 -1
  63. package/dist/boards/stored-board.d.ts +73 -1
  64. package/dist/boards/stored-board.d.ts.map +1 -1
  65. package/dist/boards/stored-board.js +157 -11
  66. package/dist/boards/stored-board.js.map +1 -1
  67. package/dist/boards/work-migrations.d.ts +43 -0
  68. package/dist/boards/work-migrations.d.ts.map +1 -0
  69. package/dist/boards/work-migrations.js +353 -0
  70. package/dist/boards/work-migrations.js.map +1 -0
  71. package/dist/boards/work-routes.d.ts +58 -0
  72. package/dist/boards/work-routes.d.ts.map +1 -0
  73. package/dist/boards/work-routes.js +270 -0
  74. package/dist/boards/work-routes.js.map +1 -0
  75. package/dist/boards/work-seeds.d.ts +9 -0
  76. package/dist/boards/work-seeds.d.ts.map +1 -0
  77. package/dist/boards/work-seeds.js +56 -0
  78. package/dist/boards/work-seeds.js.map +1 -0
  79. package/dist/boards/work.d.ts +8 -19
  80. package/dist/boards/work.d.ts.map +1 -1
  81. package/dist/boards/work.js +33 -281
  82. package/dist/boards/work.js.map +1 -1
  83. package/dist/environment/build-runner.d.ts.map +1 -1
  84. package/dist/environment/build-runner.js +2 -2
  85. package/dist/environment/build-runner.js.map +1 -1
  86. package/dist/environment/build-workflow.d.ts.map +1 -1
  87. package/dist/environment/build-workflow.js +6 -5
  88. package/dist/environment/build-workflow.js.map +1 -1
  89. package/dist/environment/build.d.ts +15 -2
  90. package/dist/environment/build.d.ts.map +1 -1
  91. package/dist/environment/build.js +32 -9
  92. package/dist/environment/build.js.map +1 -1
  93. package/dist/factory.d.ts +90 -9
  94. package/dist/factory.d.ts.map +1 -1
  95. package/dist/factory.js +334 -141
  96. package/dist/factory.js.map +1 -1
  97. package/dist/feed-events.d.ts +4 -4
  98. package/dist/feed-events.d.ts.map +1 -1
  99. package/dist/feed-events.js +6 -6
  100. package/dist/feed-events.js.map +1 -1
  101. package/dist/index.d.ts +10 -3
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.js +7 -4
  104. package/dist/integrations/base.d.ts +12 -13
  105. package/dist/integrations/base.d.ts.map +1 -1
  106. package/dist/integrations/closing-references.d.ts +15 -0
  107. package/dist/integrations/closing-references.d.ts.map +1 -0
  108. package/dist/integrations/closing-references.js +69 -0
  109. package/dist/integrations/closing-references.js.map +1 -0
  110. package/dist/integrations/github/acceptance-labels.d.ts +4 -0
  111. package/dist/integrations/github/acceptance-labels.d.ts.map +1 -1
  112. package/dist/integrations/github/acceptance-labels.js +1 -1
  113. package/dist/integrations/github/acceptance-labels.js.map +1 -1
  114. package/dist/integrations/github/default-rules.d.ts +17 -75
  115. package/dist/integrations/github/default-rules.d.ts.map +1 -1
  116. package/dist/integrations/github/default-rules.js +134 -77
  117. package/dist/integrations/github/default-rules.js.map +1 -1
  118. package/dist/integrations/github/integration.d.ts.map +1 -1
  119. package/dist/integrations/github/integration.js +7 -3
  120. package/dist/integrations/github/integration.js.map +1 -1
  121. package/dist/integrations/github/issue-reconciler.d.ts.map +1 -1
  122. package/dist/integrations/github/issue-reconciler.js +21 -3
  123. package/dist/integrations/github/issue-reconciler.js.map +1 -1
  124. package/dist/integrations/github/provenance.js +1 -1
  125. package/dist/integrations/github/provenance.js.map +1 -1
  126. package/dist/integrations/github/pull-request-source.d.ts +8 -0
  127. package/dist/integrations/github/pull-request-source.d.ts.map +1 -0
  128. package/dist/integrations/github/pull-request-source.js +17 -0
  129. package/dist/integrations/github/pull-request-source.js.map +1 -0
  130. package/dist/integrations/github/reconcile-worker.d.ts +5 -1
  131. package/dist/integrations/github/reconcile-worker.d.ts.map +1 -1
  132. package/dist/integrations/github/reconcile-worker.js +39 -6
  133. package/dist/integrations/github/reconcile-worker.js.map +1 -1
  134. package/dist/integrations/github/review-status-comment.d.ts +61 -0
  135. package/dist/integrations/github/review-status-comment.d.ts.map +1 -0
  136. package/dist/integrations/github/review-status-comment.js +217 -0
  137. package/dist/integrations/github/review-status-comment.js.map +1 -0
  138. package/dist/integrations/github/review-status-reporter.d.ts +42 -0
  139. package/dist/integrations/github/review-status-reporter.d.ts.map +1 -0
  140. package/dist/integrations/github/review-status-reporter.js +104 -0
  141. package/dist/integrations/github/review-status-reporter.js.map +1 -0
  142. package/dist/integrations/github/review-status.d.ts +28 -0
  143. package/dist/integrations/github/review-status.d.ts.map +1 -0
  144. package/dist/integrations/github/review-status.js +95 -0
  145. package/dist/integrations/github/review-status.js.map +1 -0
  146. package/dist/integrations/github/routes.d.ts +4 -3
  147. package/dist/integrations/github/routes.d.ts.map +1 -1
  148. package/dist/integrations/github/routes.js +11 -91
  149. package/dist/integrations/github/routes.js.map +1 -1
  150. package/dist/integrations/github/rules.d.ts +92 -8
  151. package/dist/integrations/github/rules.d.ts.map +1 -1
  152. package/dist/integrations/github/rules.js +498 -103
  153. package/dist/integrations/github/rules.js.map +1 -1
  154. package/dist/integrations/github/sandbox.d.ts +10 -2
  155. package/dist/integrations/github/sandbox.d.ts.map +1 -1
  156. package/dist/integrations/github/sandbox.js +20 -4
  157. package/dist/integrations/github/sandbox.js.map +1 -1
  158. package/dist/integrations/github/session-subscriptions.js +2 -2
  159. package/dist/integrations/github/session-subscriptions.js.map +1 -1
  160. package/dist/integrations/github/token-refresh.d.ts +2 -1
  161. package/dist/integrations/github/token-refresh.d.ts.map +1 -1
  162. package/dist/integrations/github/token-refresh.js.map +1 -1
  163. package/dist/integrations/gitlab/agent-tools.js +1 -1
  164. package/dist/integrations/gitlab/default-rules.d.ts +96 -39
  165. package/dist/integrations/gitlab/default-rules.d.ts.map +1 -1
  166. package/dist/integrations/gitlab/default-rules.js +109 -46
  167. package/dist/integrations/gitlab/default-rules.js.map +1 -1
  168. package/dist/integrations/gitlab/issue-reconciler.d.ts.map +1 -1
  169. package/dist/integrations/gitlab/issue-reconciler.js +2 -1
  170. package/dist/integrations/gitlab/issue-reconciler.js.map +1 -1
  171. package/dist/integrations/gitlab/merge-request-reconciler.d.ts.map +1 -1
  172. package/dist/integrations/gitlab/merge-request-reconciler.js +12 -5
  173. package/dist/integrations/gitlab/merge-request-reconciler.js.map +1 -1
  174. package/dist/integrations/gitlab/routes.d.ts.map +1 -1
  175. package/dist/integrations/gitlab/routes.js +2 -6
  176. package/dist/integrations/gitlab/routes.js.map +1 -1
  177. package/dist/integrations/gitlab/rules.d.ts +22 -1
  178. package/dist/integrations/gitlab/rules.d.ts.map +1 -1
  179. package/dist/integrations/gitlab/rules.js +188 -34
  180. package/dist/integrations/gitlab/rules.js.map +1 -1
  181. package/dist/integrations/gitlab/session-subscriptions.js +1 -1
  182. package/dist/integrations/incidentio/agent-tools.js +6 -6
  183. package/dist/integrations/incidentio/agent-tools.js.map +1 -1
  184. package/dist/integrations/incidentio/default-rules.d.ts +1 -9
  185. package/dist/integrations/incidentio/default-rules.d.ts.map +1 -1
  186. package/dist/integrations/incidentio/default-rules.js +6 -7
  187. package/dist/integrations/incidentio/default-rules.js.map +1 -1
  188. package/dist/integrations/incidentio/issue-reconciler.d.ts.map +1 -1
  189. package/dist/integrations/incidentio/issue-reconciler.js +2 -1
  190. package/dist/integrations/incidentio/issue-reconciler.js.map +1 -1
  191. package/dist/integrations/incidentio/routes.d.ts +2 -2
  192. package/dist/integrations/incidentio/routes.d.ts.map +1 -1
  193. package/dist/integrations/incidentio/routes.js +11 -17
  194. package/dist/integrations/incidentio/routes.js.map +1 -1
  195. package/dist/integrations/incidentio/rules.d.ts +11 -4
  196. package/dist/integrations/incidentio/rules.d.ts.map +1 -1
  197. package/dist/integrations/incidentio/rules.js +52 -16
  198. package/dist/integrations/incidentio/rules.js.map +1 -1
  199. package/dist/integrations/issue-reconciler.js +1 -1
  200. package/dist/integrations/issue-reconciler.js.map +1 -1
  201. package/dist/integrations/jira/agent-tools.js +1 -1
  202. package/dist/integrations/jira/binding-scope.d.ts +5 -6
  203. package/dist/integrations/jira/binding-scope.d.ts.map +1 -1
  204. package/dist/integrations/jira/binding-scope.js +9 -11
  205. package/dist/integrations/jira/binding-scope.js.map +1 -1
  206. package/dist/integrations/jira/default-rules.d.ts +1 -9
  207. package/dist/integrations/jira/default-rules.d.ts.map +1 -1
  208. package/dist/integrations/jira/default-rules.js +6 -7
  209. package/dist/integrations/jira/default-rules.js.map +1 -1
  210. package/dist/integrations/jira/issue-reconciler.d.ts.map +1 -1
  211. package/dist/integrations/jira/issue-reconciler.js +2 -1
  212. package/dist/integrations/jira/issue-reconciler.js.map +1 -1
  213. package/dist/integrations/jira/routes.d.ts.map +1 -1
  214. package/dist/integrations/jira/routes.js +4 -9
  215. package/dist/integrations/jira/routes.js.map +1 -1
  216. package/dist/integrations/jira/rules.d.ts +11 -4
  217. package/dist/integrations/jira/rules.d.ts.map +1 -1
  218. package/dist/integrations/jira/rules.js +52 -16
  219. package/dist/integrations/jira/rules.js.map +1 -1
  220. package/dist/integrations/linear/agent-tools.d.ts +9 -1
  221. package/dist/integrations/linear/agent-tools.d.ts.map +1 -1
  222. package/dist/integrations/linear/agent-tools.js +81 -3
  223. package/dist/integrations/linear/agent-tools.js.map +1 -1
  224. package/dist/integrations/linear/default-rules.d.ts +1 -9
  225. package/dist/integrations/linear/default-rules.d.ts.map +1 -1
  226. package/dist/integrations/linear/default-rules.js +6 -7
  227. package/dist/integrations/linear/default-rules.js.map +1 -1
  228. package/dist/integrations/linear/integration.d.ts +4 -1
  229. package/dist/integrations/linear/integration.d.ts.map +1 -1
  230. package/dist/integrations/linear/integration.js +21 -1
  231. package/dist/integrations/linear/integration.js.map +1 -1
  232. package/dist/integrations/linear/issue-reconciler.d.ts.map +1 -1
  233. package/dist/integrations/linear/issue-reconciler.js +2 -1
  234. package/dist/integrations/linear/issue-reconciler.js.map +1 -1
  235. package/dist/integrations/linear/routes.d.ts +2 -1
  236. package/dist/integrations/linear/routes.d.ts.map +1 -1
  237. package/dist/integrations/linear/routes.js +16 -21
  238. package/dist/integrations/linear/routes.js.map +1 -1
  239. package/dist/integrations/linear/rules.d.ts +11 -4
  240. package/dist/integrations/linear/rules.d.ts.map +1 -1
  241. package/dist/integrations/linear/rules.js +50 -17
  242. package/dist/integrations/linear/rules.js.map +1 -1
  243. package/dist/integrations/platform/connect/routes.d.ts +7 -1
  244. package/dist/integrations/platform/connect/routes.d.ts.map +1 -1
  245. package/dist/integrations/platform/connect/routes.js +42 -5
  246. package/dist/integrations/platform/connect/routes.js.map +1 -1
  247. package/dist/integrations/platform/connect/session-tools.d.ts +12 -0
  248. package/dist/integrations/platform/connect/session-tools.d.ts.map +1 -0
  249. package/dist/integrations/platform/connect/session-tools.js +35 -0
  250. package/dist/integrations/platform/connect/session-tools.js.map +1 -0
  251. package/dist/integrations/platform/github/event-worker.d.ts +4 -1
  252. package/dist/integrations/platform/github/event-worker.d.ts.map +1 -1
  253. package/dist/integrations/platform/github/event-worker.js +39 -3
  254. package/dist/integrations/platform/github/event-worker.js.map +1 -1
  255. package/dist/integrations/platform/github/integration.d.ts +8 -0
  256. package/dist/integrations/platform/github/integration.d.ts.map +1 -1
  257. package/dist/integrations/platform/github/integration.js +132 -90
  258. package/dist/integrations/platform/github/integration.js.map +1 -1
  259. package/dist/integrations/platform/jira/agent-tools.js +1 -1
  260. package/dist/integrations/platform/jira/routes.d.ts.map +1 -1
  261. package/dist/integrations/platform/jira/routes.js +4 -9
  262. package/dist/integrations/platform/jira/routes.js.map +1 -1
  263. package/dist/integrations/platform/linear/event-worker.d.ts +1 -1
  264. package/dist/integrations/platform/linear/event-worker.d.ts.map +1 -1
  265. package/dist/integrations/platform/linear/event-worker.js +10 -1
  266. package/dist/integrations/platform/linear/event-worker.js.map +1 -1
  267. package/dist/integrations/platform/linear/integration.d.ts +1 -1
  268. package/dist/integrations/platform/linear/integration.d.ts.map +1 -1
  269. package/dist/integrations/platform/linear/integration.js +7 -8
  270. package/dist/integrations/platform/linear/integration.js.map +1 -1
  271. package/dist/integrations/slack/channel-reply-processor.d.ts +2 -0
  272. package/dist/integrations/slack/channel-reply-processor.d.ts.map +1 -1
  273. package/dist/integrations/slack/channel-reply-processor.js +6 -1
  274. package/dist/integrations/slack/channel-reply-processor.js.map +1 -1
  275. package/dist/integrations/slack/chat-tools.js +1 -1
  276. package/dist/integrations/slack/connect-route.d.ts.map +1 -1
  277. package/dist/integrations/slack/connect-route.js +1 -1
  278. package/dist/integrations/slack/connect-route.js.map +1 -1
  279. package/dist/integrations/slack/integration.d.ts +0 -2
  280. package/dist/integrations/slack/integration.d.ts.map +1 -1
  281. package/dist/integrations/slack/integration.js +2 -5
  282. package/dist/integrations/slack/integration.js.map +1 -1
  283. package/dist/integrations/slack/reply-tool.js +1 -1
  284. package/dist/integrations/slack/run-error-card.js +1 -0
  285. package/dist/integrations/slack/run-error-card.js.map +1 -1
  286. package/dist/integrations/slack/share-file-tool.js +1 -1
  287. package/dist/integrations/slack/slack.d.ts +23 -30
  288. package/dist/integrations/slack/slack.d.ts.map +1 -1
  289. package/dist/integrations/slack/slack.js +131 -125
  290. package/dist/integrations/slack/slack.js.map +1 -1
  291. package/dist/integrations/slack/voice-clips.d.ts +32 -0
  292. package/dist/integrations/slack/voice-clips.d.ts.map +1 -0
  293. package/dist/integrations/slack/voice-clips.js +201 -0
  294. package/dist/integrations/slack/voice-clips.js.map +1 -0
  295. package/dist/integrations/workos/integration.d.ts.map +1 -1
  296. package/dist/integrations/workos/integration.js +1 -3
  297. package/dist/integrations/workos/integration.js.map +1 -1
  298. package/dist/links.d.ts +1 -2
  299. package/dist/links.d.ts.map +1 -1
  300. package/dist/links.js +4 -4
  301. package/dist/links.js.map +1 -1
  302. package/dist/mcp/routes.js +2 -2
  303. package/dist/mcp/routes.js.map +1 -1
  304. package/dist/packages/_internals/workspace/dist/index.js +1 -1
  305. package/dist/provider-display-name.d.ts.map +1 -1
  306. package/dist/provider-display-name.js +1 -0
  307. package/dist/provider-display-name.js.map +1 -1
  308. package/dist/routes/attention-parked.d.ts +1 -0
  309. package/dist/routes/attention-parked.d.ts.map +1 -1
  310. package/dist/routes/attention-parked.js +2 -2
  311. package/dist/routes/attention-parked.js.map +1 -1
  312. package/dist/routes/attention-providers.d.ts +0 -25
  313. package/dist/routes/attention-providers.d.ts.map +1 -1
  314. package/dist/routes/attention-providers.js +3 -151
  315. package/dist/routes/attention-providers.js.map +1 -1
  316. package/dist/routes/attention.d.ts +0 -2
  317. package/dist/routes/attention.d.ts.map +1 -1
  318. package/dist/routes/attention.js +2 -13
  319. package/dist/routes/attention.js.map +1 -1
  320. package/dist/routes/automation-runs.d.ts +5 -1
  321. package/dist/routes/automation-runs.d.ts.map +1 -1
  322. package/dist/routes/automation-runs.js +16 -4
  323. package/dist/routes/automation-runs.js.map +1 -1
  324. package/dist/routes/board-snapshot.d.ts +15 -0
  325. package/dist/routes/board-snapshot.d.ts.map +1 -0
  326. package/dist/routes/board-snapshot.js +41 -0
  327. package/dist/routes/board-snapshot.js.map +1 -0
  328. package/dist/routes/boards.d.ts +9 -7
  329. package/dist/routes/boards.d.ts.map +1 -1
  330. package/dist/routes/boards.js +59 -145
  331. package/dist/routes/boards.js.map +1 -1
  332. package/dist/routes/config.d.ts +11 -1
  333. package/dist/routes/config.d.ts.map +1 -1
  334. package/dist/routes/config.js +122 -29
  335. package/dist/routes/config.js.map +1 -1
  336. package/dist/routes/contracts.d.ts +366 -34
  337. package/dist/routes/contracts.d.ts.map +1 -1
  338. package/dist/routes/contracts.js +179 -51
  339. package/dist/routes/contracts.js.map +1 -1
  340. package/dist/routes/feed-events.d.ts +15 -0
  341. package/dist/routes/feed-events.d.ts.map +1 -0
  342. package/dist/routes/feed-events.js +68 -0
  343. package/dist/routes/feed-events.js.map +1 -0
  344. package/dist/routes/fs.d.ts +4 -0
  345. package/dist/routes/fs.d.ts.map +1 -1
  346. package/dist/routes/fs.js +9 -8
  347. package/dist/routes/fs.js.map +1 -1
  348. package/dist/routes/intake-routes.d.ts.map +1 -1
  349. package/dist/routes/intake-routes.js +25 -13
  350. package/dist/routes/intake-routes.js.map +1 -1
  351. package/dist/routes/intake.d.ts +0 -23
  352. package/dist/routes/intake.d.ts.map +1 -1
  353. package/dist/routes/intake.js +16 -314
  354. package/dist/routes/intake.js.map +1 -1
  355. package/dist/routes/knowledge.d.ts.map +1 -1
  356. package/dist/routes/knowledge.js +2 -5
  357. package/dist/routes/knowledge.js.map +1 -1
  358. package/dist/routes/mastra-gateway.d.ts +19 -0
  359. package/dist/routes/mastra-gateway.d.ts.map +1 -0
  360. package/dist/routes/mastra-gateway.js +120 -0
  361. package/dist/routes/mastra-gateway.js.map +1 -0
  362. package/dist/routes/oauth.d.ts.map +1 -1
  363. package/dist/routes/oauth.js +1 -4
  364. package/dist/routes/oauth.js.map +1 -1
  365. package/dist/routes/projects.d.ts +3 -0
  366. package/dist/routes/projects.d.ts.map +1 -1
  367. package/dist/routes/projects.js +80 -61
  368. package/dist/routes/projects.js.map +1 -1
  369. package/dist/routes/provider-credentials.d.ts +6 -1
  370. package/dist/routes/provider-credentials.d.ts.map +1 -1
  371. package/dist/routes/provider-credentials.js +44 -3
  372. package/dist/routes/provider-credentials.js.map +1 -1
  373. package/dist/routes/route.d.ts +8 -0
  374. package/dist/routes/route.d.ts.map +1 -1
  375. package/dist/routes/route.js +5 -1
  376. package/dist/routes/route.js.map +1 -1
  377. package/dist/routes/running-packages.d.ts +13 -0
  378. package/dist/routes/running-packages.d.ts.map +1 -0
  379. package/dist/routes/running-packages.js +45 -0
  380. package/dist/routes/running-packages.js.map +1 -0
  381. package/dist/routes/sandbox-envs.d.ts +26 -0
  382. package/dist/routes/sandbox-envs.d.ts.map +1 -0
  383. package/dist/routes/sandbox-envs.js +180 -0
  384. package/dist/routes/sandbox-envs.js.map +1 -0
  385. package/dist/routes/session-access.d.ts.map +1 -1
  386. package/dist/routes/session-access.js +12 -3
  387. package/dist/routes/session-access.js.map +1 -1
  388. package/dist/routes/skills.d.ts.map +1 -1
  389. package/dist/routes/skills.js +1 -4
  390. package/dist/routes/skills.js.map +1 -1
  391. package/dist/routes/source-control-sessions.d.ts.map +1 -1
  392. package/dist/routes/source-control-sessions.js +1 -3
  393. package/dist/routes/source-control-sessions.js.map +1 -1
  394. package/dist/routes/source-control-settings.d.ts.map +1 -1
  395. package/dist/routes/source-control-settings.js +3 -2
  396. package/dist/routes/source-control-settings.js.map +1 -1
  397. package/dist/routes/surface.d.ts +13 -9
  398. package/dist/routes/surface.d.ts.map +1 -1
  399. package/dist/routes/surface.js +116 -43
  400. package/dist/routes/surface.js.map +1 -1
  401. package/dist/routes/tenant-credentials.d.ts.map +1 -1
  402. package/dist/routes/tenant-credentials.js +5 -1
  403. package/dist/routes/tenant-credentials.js.map +1 -1
  404. package/dist/routes/voice.d.ts +48 -0
  405. package/dist/routes/voice.d.ts.map +1 -0
  406. package/dist/routes/voice.js +248 -0
  407. package/dist/routes/voice.js.map +1 -0
  408. package/dist/routes/work-items.d.ts +0 -3
  409. package/dist/routes/work-items.d.ts.map +1 -1
  410. package/dist/routes/work-items.js +39 -14
  411. package/dist/routes/work-items.js.map +1 -1
  412. package/dist/rules/binding-context.d.ts.map +1 -1
  413. package/dist/rules/binding-context.js +1 -0
  414. package/dist/rules/binding-context.js.map +1 -1
  415. package/dist/rules/decision-applicability.js +1 -1
  416. package/dist/rules/dispatcher.d.ts +28 -9
  417. package/dist/rules/dispatcher.d.ts.map +1 -1
  418. package/dist/rules/dispatcher.js +734 -143
  419. package/dist/rules/dispatcher.js.map +1 -1
  420. package/dist/rules/event-rules.d.ts +71 -1
  421. package/dist/rules/event-rules.d.ts.map +1 -1
  422. package/dist/rules/event-rules.js +94 -1
  423. package/dist/rules/event-rules.js.map +1 -1
  424. package/dist/rules/index.d.ts +2 -4
  425. package/dist/rules/index.d.ts.map +1 -1
  426. package/dist/rules/index.js +2 -3
  427. package/dist/rules/phase-goal.d.ts +54 -0
  428. package/dist/rules/phase-goal.d.ts.map +1 -0
  429. package/dist/rules/phase-goal.js +70 -0
  430. package/dist/rules/phase-goal.js.map +1 -0
  431. package/dist/rules/phase-tools.d.ts +11 -0
  432. package/dist/rules/phase-tools.d.ts.map +1 -0
  433. package/dist/rules/phase-tools.js +19 -0
  434. package/dist/rules/phase-tools.js.map +1 -0
  435. package/dist/rules/processor.d.ts.map +1 -1
  436. package/dist/rules/processor.js +116 -15
  437. package/dist/rules/processor.js.map +1 -1
  438. package/dist/rules/review-source-tool.d.ts +4 -1
  439. package/dist/rules/review-source-tool.d.ts.map +1 -1
  440. package/dist/rules/review-source-tool.js +24 -4
  441. package/dist/rules/review-source-tool.js.map +1 -1
  442. package/dist/rules/rule-group.d.ts +1 -1
  443. package/dist/rules/rule-group.d.ts.map +1 -1
  444. package/dist/rules/rule-group.js +15 -6
  445. package/dist/rules/rule-group.js.map +1 -1
  446. package/dist/rules/start-coordinator.d.ts +5 -1
  447. package/dist/rules/start-coordinator.d.ts.map +1 -1
  448. package/dist/rules/start-coordinator.js +9 -3
  449. package/dist/rules/start-coordinator.js.map +1 -1
  450. package/dist/rules/tools.d.ts.map +1 -1
  451. package/dist/rules/tools.js +39 -28
  452. package/dist/rules/tools.js.map +1 -1
  453. package/dist/rules/transition-service.d.ts +10 -7
  454. package/dist/rules/transition-service.d.ts.map +1 -1
  455. package/dist/rules/transition-service.js +63 -55
  456. package/dist/rules/transition-service.js.map +1 -1
  457. package/dist/rules/types.d.ts +140 -39
  458. package/dist/rules/types.d.ts.map +1 -1
  459. package/dist/rules/types.js +7 -41
  460. package/dist/rules/types.js.map +1 -1
  461. package/dist/rules/validation.d.ts.map +1 -1
  462. package/dist/rules/validation.js +89 -4
  463. package/dist/rules/validation.js.map +1 -1
  464. package/dist/run-error.d.ts +1 -1
  465. package/dist/run-error.d.ts.map +1 -1
  466. package/dist/run-error.js +38 -5
  467. package/dist/run-error.js.map +1 -1
  468. package/dist/sandbox/sandbox-env-cache.d.ts +33 -0
  469. package/dist/sandbox/sandbox-env-cache.d.ts.map +1 -0
  470. package/dist/sandbox/sandbox-env-cache.js +140 -0
  471. package/dist/sandbox/sandbox-env-cache.js.map +1 -0
  472. package/dist/sandbox/sandbox-env.d.ts +77 -0
  473. package/dist/sandbox/sandbox-env.d.ts.map +1 -0
  474. package/dist/sandbox/sandbox-env.js +130 -0
  475. package/dist/sandbox/sandbox-env.js.map +1 -0
  476. package/dist/secret-encryption.d.ts +21 -0
  477. package/dist/secret-encryption.d.ts.map +1 -1
  478. package/dist/secret-encryption.js +31 -4
  479. package/dist/secret-encryption.js.map +1 -1
  480. package/dist/session/credential-policy.d.ts +2 -2
  481. package/dist/session/credential-policy.d.ts.map +1 -1
  482. package/dist/session/credential-policy.js +3 -3
  483. package/dist/session/credential-policy.js.map +1 -1
  484. package/dist/session/default-model-hydration.d.ts +2 -2
  485. package/dist/session/default-model-hydration.d.ts.map +1 -1
  486. package/dist/session/default-model-hydration.js +4 -4
  487. package/dist/session/default-model-hydration.js.map +1 -1
  488. package/dist/session/live-sessions.d.ts +11 -4
  489. package/dist/session/live-sessions.d.ts.map +1 -1
  490. package/dist/session/live-sessions.js +31 -10
  491. package/dist/session/live-sessions.js.map +1 -1
  492. package/dist/session/self-review-gate.d.ts +6 -4
  493. package/dist/session/self-review-gate.d.ts.map +1 -1
  494. package/dist/session/self-review-gate.js +9 -12
  495. package/dist/session/self-review-gate.js.map +1 -1
  496. package/dist/session/session-threads.d.ts +10 -3
  497. package/dist/session/session-threads.d.ts.map +1 -1
  498. package/dist/session/session-threads.js +11 -1
  499. package/dist/session/session-threads.js.map +1 -1
  500. package/dist/session/source-control-tools.d.ts +39 -13
  501. package/dist/session/source-control-tools.d.ts.map +1 -1
  502. package/dist/session/source-control-tools.js +55 -61
  503. package/dist/session/source-control-tools.js.map +1 -1
  504. package/dist/session/work-item-state-processor.d.ts +24 -0
  505. package/dist/session/work-item-state-processor.d.ts.map +1 -0
  506. package/dist/session/work-item-state-processor.js +275 -0
  507. package/dist/session/work-item-state-processor.js.map +1 -0
  508. package/dist/skills/catalog.js +1 -1
  509. package/dist/storage/domains/audit/actions.d.ts +3 -2
  510. package/dist/storage/domains/audit/actions.d.ts.map +1 -1
  511. package/dist/storage/domains/audit/actions.js +7 -5
  512. package/dist/storage/domains/audit/actions.js.map +1 -1
  513. package/dist/storage/domains/audit/domain.d.ts.map +1 -1
  514. package/dist/storage/domains/audit/domain.js +1 -3
  515. package/dist/storage/domains/audit/domain.js.map +1 -1
  516. package/dist/storage/domains/boards/base.d.ts +107 -23
  517. package/dist/storage/domains/boards/base.d.ts.map +1 -1
  518. package/dist/storage/domains/boards/base.js +201 -65
  519. package/dist/storage/domains/boards/base.js.map +1 -1
  520. package/dist/storage/domains/boards/schemas.d.ts.map +1 -1
  521. package/dist/storage/domains/boards/schemas.js +25 -1
  522. package/dist/storage/domains/boards/schemas.js.map +1 -1
  523. package/dist/storage/domains/channel-identity/base.d.ts +0 -4
  524. package/dist/storage/domains/channel-identity/base.d.ts.map +1 -1
  525. package/dist/storage/domains/channel-identity/base.js +0 -7
  526. package/dist/storage/domains/channel-identity/base.js.map +1 -1
  527. package/dist/storage/domains/intake/base.d.ts +5 -45
  528. package/dist/storage/domains/intake/base.d.ts.map +1 -1
  529. package/dist/storage/domains/intake/base.js +11 -89
  530. package/dist/storage/domains/intake/base.js.map +1 -1
  531. package/dist/storage/domains/memory-settings/base.d.ts +0 -8
  532. package/dist/storage/domains/memory-settings/base.d.ts.map +1 -1
  533. package/dist/storage/domains/memory-settings/base.js +1 -11
  534. package/dist/storage/domains/memory-settings/base.js.map +1 -1
  535. package/dist/storage/domains/projects/base.d.ts +23 -9
  536. package/dist/storage/domains/projects/base.d.ts.map +1 -1
  537. package/dist/storage/domains/projects/base.js +24 -8
  538. package/dist/storage/domains/projects/base.js.map +1 -1
  539. package/dist/storage/domains/sandbox-envs/base.d.ts +70 -0
  540. package/dist/storage/domains/sandbox-envs/base.d.ts.map +1 -0
  541. package/dist/storage/domains/sandbox-envs/base.js +227 -0
  542. package/dist/storage/domains/sandbox-envs/base.js.map +1 -0
  543. package/dist/storage/domains/voice-settings/base.d.ts +31 -0
  544. package/dist/storage/domains/voice-settings/base.d.ts.map +1 -0
  545. package/dist/storage/domains/voice-settings/base.js +81 -0
  546. package/dist/storage/domains/voice-settings/base.js.map +1 -0
  547. package/dist/storage/domains/work-items/base.d.ts +93 -24
  548. package/dist/storage/domains/work-items/base.d.ts.map +1 -1
  549. package/dist/storage/domains/work-items/base.js +413 -188
  550. package/dist/storage/domains/work-items/base.js.map +1 -1
  551. package/dist/storage/domains/work-items/board-version.d.ts +6 -2
  552. package/dist/storage/domains/work-items/board-version.d.ts.map +1 -1
  553. package/dist/storage/domains/work-items/board-version.js +20 -9
  554. package/dist/storage/domains/work-items/board-version.js.map +1 -1
  555. package/dist/storage/domains/work-items/cards.d.ts +33 -5
  556. package/dist/storage/domains/work-items/cards.d.ts.map +1 -1
  557. package/dist/storage/domains/work-items/cards.js +208 -25
  558. package/dist/storage/domains/work-items/cards.js.map +1 -1
  559. package/dist/storage/domains/work-items/legacy-review.d.ts +63 -0
  560. package/dist/storage/domains/work-items/legacy-review.d.ts.map +1 -0
  561. package/dist/storage/domains/work-items/legacy-review.js +109 -0
  562. package/dist/storage/domains/work-items/legacy-review.js.map +1 -0
  563. package/dist/storage/domains/work-items/metrics.d.ts +12 -4
  564. package/dist/storage/domains/work-items/metrics.d.ts.map +1 -1
  565. package/dist/storage/domains/work-items/metrics.js +14 -32
  566. package/dist/storage/domains/work-items/metrics.js.map +1 -1
  567. package/dist/storage/domains/work-items/work-item-schema.d.ts +6 -2
  568. package/dist/storage/domains/work-items/work-item-schema.d.ts.map +1 -1
  569. package/dist/storage/domains/work-items/work-item-schema.js +83 -27
  570. package/dist/storage/domains/work-items/work-item-schema.js.map +1 -1
  571. package/dist/timing.d.ts +1 -0
  572. package/dist/timing.d.ts.map +1 -1
  573. package/dist/timing.js +1 -1
  574. package/dist/timing.js.map +1 -1
  575. package/dist/tools/approval-tools.d.ts.map +1 -1
  576. package/dist/tools/approval-tools.js +28 -9
  577. package/dist/tools/approval-tools.js.map +1 -1
  578. package/dist/tools/index.d.ts +1 -1
  579. package/dist/tools/index.js +1 -1
  580. package/dist/tools/index.js.map +1 -1
  581. package/dist/tools/messaging-tools.d.ts +3 -0
  582. package/dist/tools/messaging-tools.d.ts.map +1 -1
  583. package/dist/tools/messaging-tools.js +2 -1
  584. package/dist/tools/messaging-tools.js.map +1 -1
  585. package/dist/tools/read-tools.d.ts +10 -6
  586. package/dist/tools/read-tools.d.ts.map +1 -1
  587. package/dist/tools/read-tools.js +89 -39
  588. package/dist/tools/read-tools.js.map +1 -1
  589. package/dist/tools/reports.d.ts +1 -0
  590. package/dist/tools/reports.d.ts.map +1 -1
  591. package/dist/tools/reports.js +2 -1
  592. package/dist/tools/reports.js.map +1 -1
  593. package/dist/tools/run-watch.d.ts +1 -1
  594. package/dist/tools/run-watch.d.ts.map +1 -1
  595. package/dist/tools/run-watch.js +1 -0
  596. package/dist/tools/run-watch.js.map +1 -1
  597. package/dist/tools/sandbox-tools.js +1 -1
  598. package/dist/tools/session-tools.d.ts +1 -1
  599. package/dist/tools/session-tools.d.ts.map +1 -1
  600. package/dist/tools/session-tools.js +1 -1
  601. package/dist/tools/session-tools.js.map +1 -1
  602. package/dist/tools/sessions-state-processor.d.ts +3 -1
  603. package/dist/tools/sessions-state-processor.d.ts.map +1 -1
  604. package/dist/tools/sessions-state-processor.js +13 -4
  605. package/dist/tools/sessions-state-processor.js.map +1 -1
  606. package/dist/tools/side-sessions.d.ts +2 -0
  607. package/dist/tools/side-sessions.d.ts.map +1 -1
  608. package/dist/tools/side-sessions.js +2 -1
  609. package/dist/tools/side-sessions.js.map +1 -1
  610. package/dist/tools/work-item-tools.d.ts +0 -3
  611. package/dist/tools/work-item-tools.d.ts.map +1 -1
  612. package/dist/tools/work-item-tools.js +10 -20
  613. package/dist/tools/work-item-tools.js.map +1 -1
  614. package/dist/voice/rate-limit.d.ts +13 -0
  615. package/dist/voice/rate-limit.d.ts.map +1 -0
  616. package/dist/voice/rate-limit.js +36 -0
  617. package/dist/voice/rate-limit.js.map +1 -0
  618. package/dist/voice/realtime.d.ts +13 -0
  619. package/dist/voice/realtime.d.ts.map +1 -0
  620. package/dist/voice/realtime.js +56 -0
  621. package/dist/voice/realtime.js.map +1 -0
  622. package/dist/voice/transcription.d.ts +51 -0
  623. package/dist/voice/transcription.d.ts.map +1 -0
  624. package/dist/voice/transcription.js +112 -0
  625. package/dist/voice/transcription.js.map +1 -0
  626. package/dist/work-item-branch.d.ts +13 -0
  627. package/dist/work-item-branch.d.ts.map +1 -1
  628. package/dist/work-item-branch.js +16 -1
  629. package/dist/work-item-branch.js.map +1 -1
  630. package/dist/work-items/create-work-item.d.ts +6 -0
  631. package/dist/work-items/create-work-item.d.ts.map +1 -1
  632. package/dist/work-items/create-work-item.js +28 -3
  633. package/dist/work-items/create-work-item.js.map +1 -1
  634. package/dist/work-items/description-context.d.ts +5 -0
  635. package/dist/work-items/description-context.d.ts.map +1 -0
  636. package/dist/work-items/description-context.js +17 -0
  637. package/dist/work-items/description-context.js.map +1 -0
  638. package/dist/work-items/providers/base.d.ts +4 -1
  639. package/dist/work-items/providers/base.d.ts.map +1 -1
  640. package/dist/work-items/providers/base.js +6 -1
  641. package/dist/work-items/providers/base.js.map +1 -1
  642. package/dist/work-items/providers/github.d.ts.map +1 -1
  643. package/dist/work-items/providers/github.js +2 -1
  644. package/dist/work-items/providers/github.js.map +1 -1
  645. package/dist/work-items/providers/gitlab.d.ts.map +1 -1
  646. package/dist/work-items/providers/gitlab.js +2 -1
  647. package/dist/work-items/providers/gitlab.js.map +1 -1
  648. package/dist/work-items/providers/jira.d.ts.map +1 -1
  649. package/dist/work-items/providers/jira.js +3 -2
  650. package/dist/work-items/providers/jira.js.map +1 -1
  651. package/dist/work-items/providers/linear.d.ts.map +1 -1
  652. package/dist/work-items/providers/linear.js +3 -2
  653. package/dist/work-items/providers/linear.js.map +1 -1
  654. package/dist/work-items/providers/types.d.ts +6 -0
  655. package/dist/work-items/providers/types.d.ts.map +1 -1
  656. package/dist/work-items/split-backfill.d.ts +13 -0
  657. package/dist/work-items/split-backfill.d.ts.map +1 -0
  658. package/dist/work-items/split-backfill.js +32 -0
  659. package/dist/work-items/split-backfill.js.map +1 -0
  660. package/dist/work-items/split-migration.d.ts +39 -2
  661. package/dist/work-items/split-migration.d.ts.map +1 -1
  662. package/dist/work-items/split-migration.js +178 -70
  663. package/dist/work-items/split-migration.js.map +1 -1
  664. package/dist/workspace.d.ts +3 -1
  665. package/dist/workspace.d.ts.map +1 -1
  666. package/dist/workspace.js +118 -34
  667. package/dist/workspace.js.map +1 -1
  668. package/factory-skills/configure-factory-rules/SKILL.md +13 -11
  669. package/factory-skills/factory-build/SKILL.md +64 -0
  670. package/factory-skills/factory-gitlab-rereview/SKILL.md +4 -4
  671. package/factory-skills/factory-gitlab-review/SKILL.md +6 -6
  672. package/factory-skills/factory-plan/SKILL.md +8 -10
  673. package/factory-skills/factory-rereview/SKILL.md +74 -28
  674. package/factory-skills/factory-review/SKILL.md +85 -29
  675. package/factory-skills/factory-self-review/SKILL.md +32 -13
  676. package/factory-skills/factory-triage/SKILL.md +36 -32
  677. package/package.json +12 -11
  678. package/dist/boards/index.js.map +0 -1
  679. package/dist/boards/pull-request-review.d.ts +0 -14
  680. package/dist/boards/pull-request-review.d.ts.map +0 -1
  681. package/dist/boards/pull-request-review.js +0 -81
  682. package/dist/boards/pull-request-review.js.map +0 -1
  683. package/dist/boards/work-tool-rules.d.ts +0 -8
  684. package/dist/boards/work-tool-rules.d.ts.map +0 -1
  685. package/dist/boards/work-tool-rules.js +0 -19
  686. package/dist/boards/work-tool-rules.js.map +0 -1
  687. package/dist/integrations/slack/emoji-shortcodes.generated.d.ts +0 -8
  688. package/dist/integrations/slack/emoji-shortcodes.generated.d.ts.map +0 -1
  689. package/dist/integrations/slack/emoji-shortcodes.generated.js +0 -1984
  690. package/dist/integrations/slack/emoji-shortcodes.generated.js.map +0 -1
  691. package/dist/integrations/slack/emoji.d.ts +0 -3
  692. package/dist/integrations/slack/emoji.d.ts.map +0 -1
  693. package/dist/integrations/slack/emoji.js +0 -11
  694. package/dist/integrations/slack/emoji.js.map +0 -1
  695. package/dist/integrations/slack/feed-publisher.d.ts +0 -26
  696. package/dist/integrations/slack/feed-publisher.d.ts.map +0 -1
  697. package/dist/integrations/slack/feed-publisher.js +0 -43
  698. package/dist/integrations/slack/feed-publisher.js.map +0 -1
  699. package/dist/routes/attention-activity.d.ts +0 -23
  700. package/dist/routes/attention-activity.d.ts.map +0 -1
  701. package/dist/routes/attention-activity.js +0 -154
  702. package/dist/routes/attention-activity.js.map +0 -1
  703. package/dist/rules/resolve.d.ts +0 -15
  704. package/dist/rules/resolve.d.ts.map +0 -1
  705. package/dist/rules/resolve.js +0 -22
  706. package/dist/rules/resolve.js.map +0 -1
  707. package/dist/storage/domains/comments/activity.d.ts +0 -40
  708. package/dist/storage/domains/comments/activity.d.ts.map +0 -1
  709. package/dist/storage/domains/comments/activity.js +0 -93
  710. package/dist/storage/domains/comments/activity.js.map +0 -1
  711. package/dist/storage/domains/comments/actor.d.ts +0 -51
  712. package/dist/storage/domains/comments/actor.d.ts.map +0 -1
  713. package/dist/storage/domains/comments/actor.js +0 -37
  714. package/dist/storage/domains/comments/actor.js.map +0 -1
  715. package/dist/storage/domains/comments/base.d.ts +0 -245
  716. package/dist/storage/domains/comments/base.d.ts.map +0 -1
  717. package/dist/storage/domains/comments/base.js +0 -539
  718. package/dist/storage/domains/comments/base.js.map +0 -1
  719. package/dist/storage/domains/comments/domain.d.ts +0 -135
  720. package/dist/storage/domains/comments/domain.d.ts.map +0 -1
  721. package/dist/storage/domains/comments/domain.js +0 -284
  722. package/dist/storage/domains/comments/domain.js.map +0 -1
  723. package/dist/storage/domains/comments/feed-context.d.ts +0 -22
  724. package/dist/storage/domains/comments/feed-context.d.ts.map +0 -1
  725. package/dist/storage/domains/comments/feed-context.js +0 -88
  726. package/dist/storage/domains/comments/feed-context.js.map +0 -1
  727. package/dist/storage/domains/comments/feed-sync.d.ts +0 -21
  728. package/dist/storage/domains/comments/feed-sync.d.ts.map +0 -1
  729. package/dist/storage/domains/comments/feed-sync.js +0 -1
  730. package/dist/storage/domains/comments/parse.d.ts +0 -23
  731. package/dist/storage/domains/comments/parse.d.ts.map +0 -1
  732. package/dist/storage/domains/comments/parse.js +0 -89
  733. package/dist/storage/domains/comments/parse.js.map +0 -1
  734. package/dist/storage/domains/comments/routes.d.ts +0 -24
  735. package/dist/storage/domains/comments/routes.d.ts.map +0 -1
  736. package/dist/storage/domains/comments/routes.js +0 -301
  737. package/dist/storage/domains/comments/routes.js.map +0 -1
  738. package/dist/storage/domains/comments/schema.d.ts +0 -5
  739. package/dist/storage/domains/comments/schema.d.ts.map +0 -1
  740. package/dist/storage/domains/comments/schema.js +0 -178
  741. package/dist/storage/domains/comments/schema.js.map +0 -1
  742. package/dist/storage/domains/comments/wire.d.ts +0 -40
  743. package/dist/storage/domains/comments/wire.d.ts.map +0 -1
  744. package/dist/storage/domains/comments/wire.js +0 -36
  745. package/dist/storage/domains/comments/wire.js.map +0 -1
  746. package/factory-skills/factory-complete-issue/SKILL.md +0 -24
@@ -1,23 +0,0 @@
1
- /** Request-body parsing for the comment routes: unknown JSON in, a typed input or `null` out. */
2
- import type { Context } from 'hono';
3
- import type { FactoryMentionRef } from './base.js';
4
- export declare const UUID_RE: RegExp;
5
- export declare function isRecord(value: unknown): value is Record<string, unknown>;
6
- export declare function readJson(c: Context): Promise<unknown>;
7
- export interface ParsedCreateComment {
8
- body: string;
9
- clientToken?: string;
10
- replyTo?: {
11
- commentId: string;
12
- quote?: string;
13
- };
14
- mentions?: FactoryMentionRef[];
15
- }
16
- export declare function parseCreateCommentBody(raw: unknown): ParsedCreateComment | null;
17
- export interface ParsedEditComment {
18
- body: string;
19
- mentions?: FactoryMentionRef[];
20
- expectedRevision?: number;
21
- }
22
- export declare function parseEditCommentBody(raw: unknown): ParsedEditComment | null;
23
- //# sourceMappingURL=parse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/comments/parse.ts"],"names":[],"mappings":"AAAA,iGAAiG;AAEjG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGnD,eAAO,MAAM,OAAO,QAAoE,CAAC;AAGzF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,wBAAsB,QAAQ,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAM3D;AAyCD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAChC;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,mBAAmB,GAAG,IAAI,CAkB/E;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,iBAAiB,GAAG,IAAI,CAe3E"}
@@ -1,89 +0,0 @@
1
- import { isMentionableActorId } from "./actor.js";
2
- import { commentBodyError } from "./base.js";
3
- // src/storage/domains/comments/parse.ts
4
- const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
5
- const CLIENT_TOKEN_RE = /^[A-Za-z0-9-]{8,64}$/;
6
- function isRecord(value) {
7
- return typeof value === "object" && value !== null && !Array.isArray(value);
8
- }
9
- async function readJson(c) {
10
- try {
11
- return await c.req.json();
12
- } catch {
13
- return;
14
- }
15
- }
16
- /** `undefined` when the field is absent, `null` when it is present but malformed. */
17
- function parseMentions(raw) {
18
- if (raw === void 0) return void 0;
19
- if (!Array.isArray(raw) || raw.length > 20) return null;
20
- const mentions = [];
21
- for (const entry of raw) {
22
- if (!isRecord(entry)) return null;
23
- if (entry.kind !== "user" || typeof entry.id !== "string" || !isMentionableActorId(entry.id)) return null;
24
- mentions.push({
25
- kind: "user",
26
- id: entry.id
27
- });
28
- }
29
- return mentions;
30
- }
31
- function parseBody(raw) {
32
- if (typeof raw !== "string" || commentBodyError(raw)) return null;
33
- return raw;
34
- }
35
- function parseClientToken(raw) {
36
- if (raw === void 0) return void 0;
37
- if (typeof raw !== "string" || !CLIENT_TOKEN_RE.test(raw)) return null;
38
- return raw;
39
- }
40
- function parseExpectedRevision(raw) {
41
- if (raw === void 0) return void 0;
42
- if (typeof raw !== "number" || !Number.isInteger(raw)) return null;
43
- return raw;
44
- }
45
- function parseReplyTo(raw) {
46
- if (raw === void 0) return void 0;
47
- if (!isRecord(raw)) return null;
48
- if (typeof raw.commentId !== "string" || !UUID_RE.test(raw.commentId)) return null;
49
- if (raw.quote !== void 0 && typeof raw.quote !== "string") return null;
50
- const quote = typeof raw.quote === "string" ? raw.quote.slice(0, 500) : void 0;
51
- return {
52
- commentId: raw.commentId,
53
- ...quote ? { quote } : {}
54
- };
55
- }
56
- function parseCreateCommentBody(raw) {
57
- if (!isRecord(raw)) return null;
58
- const body = parseBody(raw.body);
59
- if (body === null) return null;
60
- const mentions = parseMentions(raw.mentions);
61
- if (mentions === null) return null;
62
- const replyTo = parseReplyTo(raw.replyTo);
63
- if (replyTo === null) return null;
64
- const clientToken = parseClientToken(raw.clientToken);
65
- if (clientToken === null) return null;
66
- return {
67
- body,
68
- ...clientToken ? { clientToken } : {},
69
- ...replyTo ? { replyTo } : {},
70
- ...mentions ? { mentions } : {}
71
- };
72
- }
73
- function parseEditCommentBody(raw) {
74
- if (!isRecord(raw)) return null;
75
- const body = parseBody(raw.body);
76
- if (body === null) return null;
77
- const mentions = parseMentions(raw.mentions);
78
- if (mentions === null) return null;
79
- const expectedRevision = parseExpectedRevision(raw.expectedRevision);
80
- if (expectedRevision === null) return null;
81
- return {
82
- body,
83
- ...mentions ? { mentions } : {},
84
- ...expectedRevision !== void 0 ? { expectedRevision } : {}
85
- };
86
- }
87
- export { UUID_RE, isRecord, parseCreateCommentBody, parseEditCommentBody, readJson };
88
-
89
- //# sourceMappingURL=parse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse.js","names":[],"sources":["../../../../src/storage/domains/comments/parse.ts"],"sourcesContent":["/** Request-body parsing for the comment routes: unknown JSON in, a typed input or `null` out. */\n\nimport type { Context } from 'hono';\n\nimport { isMentionableActorId } from './actor.js';\nimport type { FactoryMentionRef } from './base.js';\nimport { commentBodyError, MAX_COMMENT_MENTIONS, MAX_COMMENT_QUOTE_LENGTH } from './base.js';\n\nexport const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\nconst CLIENT_TOKEN_RE = /^[A-Za-z0-9-]{8,64}$/;\n\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport async function readJson(c: Context): Promise<unknown> {\n try {\n return await c.req.json();\n } catch {\n return undefined;\n }\n}\n\n/** `undefined` when the field is absent, `null` when it is present but malformed. */\nfunction parseMentions(raw: unknown): FactoryMentionRef[] | null | undefined {\n if (raw === undefined) return undefined;\n if (!Array.isArray(raw) || raw.length > MAX_COMMENT_MENTIONS) return null;\n const mentions: FactoryMentionRef[] = [];\n for (const entry of raw) {\n if (!isRecord(entry)) return null;\n if (entry.kind !== 'user' || typeof entry.id !== 'string' || !isMentionableActorId(entry.id)) return null;\n mentions.push({ kind: 'user', id: entry.id });\n }\n return mentions;\n}\n\nfunction parseBody(raw: unknown): string | null {\n if (typeof raw !== 'string' || commentBodyError(raw)) return null;\n return raw;\n}\n\nfunction parseClientToken(raw: unknown): string | null | undefined {\n if (raw === undefined) return undefined;\n if (typeof raw !== 'string' || !CLIENT_TOKEN_RE.test(raw)) return null;\n return raw;\n}\n\nfunction parseExpectedRevision(raw: unknown): number | null | undefined {\n if (raw === undefined) return undefined;\n if (typeof raw !== 'number' || !Number.isInteger(raw)) return null;\n return raw;\n}\n\nfunction parseReplyTo(raw: unknown): { commentId: string; quote?: string } | null | undefined {\n if (raw === undefined) return undefined;\n if (!isRecord(raw)) return null;\n if (typeof raw.commentId !== 'string' || !UUID_RE.test(raw.commentId)) return null;\n if (raw.quote !== undefined && typeof raw.quote !== 'string') return null;\n const quote = typeof raw.quote === 'string' ? raw.quote.slice(0, MAX_COMMENT_QUOTE_LENGTH) : undefined;\n return { commentId: raw.commentId, ...(quote ? { quote } : {}) };\n}\n\nexport interface ParsedCreateComment {\n body: string;\n clientToken?: string;\n replyTo?: { commentId: string; quote?: string };\n mentions?: FactoryMentionRef[];\n}\n\nexport function parseCreateCommentBody(raw: unknown): ParsedCreateComment | null {\n if (!isRecord(raw)) return null;\n\n const body = parseBody(raw.body);\n if (body === null) return null;\n const mentions = parseMentions(raw.mentions);\n if (mentions === null) return null;\n const replyTo = parseReplyTo(raw.replyTo);\n if (replyTo === null) return null;\n const clientToken = parseClientToken(raw.clientToken);\n if (clientToken === null) return null;\n\n return {\n body,\n ...(clientToken ? { clientToken } : {}),\n ...(replyTo ? { replyTo } : {}),\n ...(mentions ? { mentions } : {}),\n };\n}\n\nexport interface ParsedEditComment {\n body: string;\n mentions?: FactoryMentionRef[];\n expectedRevision?: number;\n}\n\nexport function parseEditCommentBody(raw: unknown): ParsedEditComment | null {\n if (!isRecord(raw)) return null;\n\n const body = parseBody(raw.body);\n if (body === null) return null;\n const mentions = parseMentions(raw.mentions);\n if (mentions === null) return null;\n const expectedRevision = parseExpectedRevision(raw.expectedRevision);\n if (expectedRevision === null) return null;\n\n return {\n body,\n ...(mentions ? { mentions } : {}),\n ...(expectedRevision !== undefined ? { expectedRevision } : {}),\n };\n}\n"],"mappings":";;;AAQA,MAAa,UAAU;AACvB,MAAM,kBAAkB;AAExB,SAAgB,SAAS,OAAkD;CACzE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,eAAsB,SAAS,GAA8B;CAC3D,IAAI;EACF,OAAO,MAAM,EAAE,IAAI,KAAK;CAC1B,QAAQ;EACN;CACF;AACF;;AAGA,SAAS,cAAc,KAAsD;CAC3E,IAAI,QAAQ,KAAA,GAAW,OAAO,KAAA;CAC9B,IAAI,CAAC,MAAM,QAAQ,GAAG,KAAK,IAAI,SAAA,IAA+B,OAAO;CACrE,MAAM,WAAgC,CAAC;CACvC,KAAK,MAAM,SAAS,KAAK;EACvB,IAAI,CAAC,SAAS,KAAK,GAAG,OAAO;EAC7B,IAAI,MAAM,SAAS,U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,aAAa,IAAI,OAAO;CACxC,IAAI,YAAY,MAAM,OAAO;CAC7B,MAAM,cAAc,iBAAiB,IAAI,WAAW;CACpD,IAAI,gBAAgB,MAAM,OAAO;CAEjC,OAAO;EACL;EACA,GAAI,cAAc,EAAE,YAAY,IAAI,CAAC;EACrC,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;EAC7B,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;CACjC;AACF;AAQA,SAAgB,qBAAqB,KAAwC;CAC3E,IAAI,CAAC,SAAS,GAAG,GAAG,OAAO;CAE3B,MAAM,OAAO,UAAU,IAAI,IAAI;CAC/B,IAAI,SAAS,MAAM,OAAO;CAC1B,MAAM,WAAW,cAAc,IAAI,QAAQ;CAC3C,IAAI,aAAa,MAAM,OAAO;CAC9B,MAAM,mBAAmB,sBAAsB,IAAI,gBAAgB;CACnE,IAAI,qBAAqB,MAAM,OAAO;CAEtC,OAAO;EACL;EACA,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;EAC/B,GAAI,qBAAqB,KAAA,IAAY,EAAE,iBAAiB,IAAI,CAAC;CAC/D;AACF"}
@@ -1,24 +0,0 @@
1
- /**
2
- * HTTP for the item feed. Every handler is the same shape: resolve the tenant,
3
- * validate the path ids, delegate to a `CommentsDomain` service method, map its
4
- * result status to a status code, then emit audit.
5
- */
6
- import type { PubSub } from '@mastra/core/events';
7
- import type { ApiRoute } from '@mastra/core/server';
8
- import type { RouteAuth } from '../../../routes/route.js';
9
- import type { AuditEmitter } from '../audit/domain.js';
10
- import type { FactoryProjectsStorage } from '../projects/base.js';
11
- import type { WorkItemsStorage } from '../work-items/base.js';
12
- import type { WorkItemCommentsStorage } from './base.js';
13
- import type { CommentsDomain } from './domain.js';
14
- export interface CommentRouteDependencies {
15
- domain: CommentsDomain;
16
- auth: RouteAuth;
17
- comments: WorkItemCommentsStorage;
18
- workItems: WorkItemsStorage;
19
- projects: FactoryProjectsStorage;
20
- pubsub: PubSub;
21
- audit?: AuditEmitter;
22
- }
23
- export declare function buildCommentRoutes(dependencies: CommentRouteDependencies): ApiRoute[];
24
- //# sourceMappingURL=routes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/comments/routes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAOpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,aAAa,CAAC;AAWjE,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,uBAAuB,CAAC;IAClC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAWD,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,wBAAwB,GAAG,QAAQ,EAAE,CAqSrF"}
@@ -1,301 +0,0 @@
1
- import { getFactoryAuthUser } from "../../../auth.js";
2
- import { feedTopic } from "../../../feed-events.js";
3
- import { actorFromAuthUser } from "./actor.js";
4
- import { decodeCommentCursor } from "./base.js";
5
- import { UUID_RE, isRecord, parseCreateCommentBody, parseEditCommentBody, readJson } from "./parse.js";
6
- import { toWireComment } from "./wire.js";
7
- import { registerApiRoute } from "@mastra/core/server";
8
- import { withAck } from "@mastra/core/events";
9
- import { streamSSE } from "hono/streaming";
10
- // src/storage/domains/comments/routes.ts
11
- /**
12
- * HTTP for the item feed. Every handler is the same shape: resolve the tenant,
13
- * validate the path ids, delegate to a `CommentsDomain` service method, map its
14
- * result status to a status code, then emit audit.
15
- */
16
- const MAX_AUDIT_BODY_SNAPSHOT = 1024;
17
- /** Comment frames only — proxies drop an idle stream, and `write` can't detect a dead peer. */
18
- const FEED_KEEPALIVE_MS = 25e3;
19
- function loose(c) {
20
- return c;
21
- }
22
- function buildCommentRoutes(dependencies) {
23
- const { domain, auth, comments, workItems, projects, pubsub, audit } = dependencies;
24
- async function resolveTenant(c) {
25
- await auth.ensureUser(c);
26
- const tenant = auth.tenant(c);
27
- if (!tenant) return { response: c.json({ error: "unauthorized" }, 401) };
28
- if (!tenant.orgId) return { response: c.json({
29
- error: "organization_required",
30
- message: "The item feed requires an organization."
31
- }, 403) };
32
- return {
33
- orgId: tenant.orgId,
34
- userId: tenant.userId
35
- };
36
- }
37
- function editorFor(c, tenant) {
38
- return {
39
- userId: tenant.userId,
40
- canModerate: () => auth.isOrganizationAdmin(c, tenant.orgId)
41
- };
42
- }
43
- async function emitMentionAudit(c, target, commentId, mentionedIds) {
44
- if (mentionedIds.length === 0) return;
45
- await audit?.emit({
46
- context: c,
47
- input: {
48
- action: "factory.work_item.comment_mentioned",
49
- factoryProjectId: target.factoryProjectId,
50
- targets: [{
51
- type: "work_item",
52
- id: target.workItemId,
53
- ...target.title ? { name: target.title } : {}
54
- }],
55
- metadata: {
56
- commentId,
57
- mentionedIds
58
- }
59
- }
60
- });
61
- }
62
- return [
63
- registerApiRoute("/web/factory/work-items/:workItemId/comments", {
64
- method: "GET",
65
- handler: async (cc) => {
66
- const c = loose(cc);
67
- const tenant = await resolveTenant(c);
68
- if ("response" in tenant) return tenant.response;
69
- const workItemId = c.req.param("workItemId");
70
- if (!workItemId || !UUID_RE.test(workItemId)) return c.json({ error: "Work item not found" }, 404);
71
- await workItems.ensureReady();
72
- const workItem = await workItems.get({
73
- orgId: tenant.orgId,
74
- id: workItemId
75
- });
76
- if (!workItem) return c.json({ error: "Work item not found" }, 404);
77
- await comments.ensureReady();
78
- const limitRaw = c.req.query("limit");
79
- const limit = limitRaw ? Number.parseInt(limitRaw, 10) : void 0;
80
- const before = c.req.query("before") || void 0;
81
- if (before && !decodeCommentCursor(before)) return c.json({ error: "invalid_cursor" }, 422);
82
- const around = c.req.query("around") || void 0;
83
- if (around && !UUID_RE.test(around)) return c.json({ error: "invalid_comment_id" }, 422);
84
- const page = await comments.list({
85
- orgId: tenant.orgId,
86
- factoryProjectId: workItem.factoryProjectId,
87
- workItemId,
88
- before,
89
- ...around ? { around } : {},
90
- ...limit !== void 0 && Number.isFinite(limit) ? { limit } : {}
91
- });
92
- const wirePage = {
93
- comments: page.comments.map((comment) => toWireComment(comment, tenant.userId)),
94
- ...page.nextCursor ? { nextCursor: page.nextCursor } : {}
95
- };
96
- return c.json(wirePage);
97
- }
98
- }),
99
- registerApiRoute("/web/factory/work-items/:workItemId/comments", {
100
- method: "POST",
101
- handler: async (cc) => {
102
- const c = loose(cc);
103
- const tenant = await resolveTenant(c);
104
- if ("response" in tenant) return tenant.response;
105
- const workItemId = c.req.param("workItemId");
106
- if (!workItemId || !UUID_RE.test(workItemId)) return c.json({ error: "Work item not found" }, 404);
107
- const parsed = parseCreateCommentBody(await readJson(c));
108
- if (!parsed) return c.json({ error: "invalid_comment" }, 422);
109
- const result = await domain.createComment({
110
- orgId: tenant.orgId,
111
- workItemId,
112
- author: actorFromAuthUser(tenant.userId, getFactoryAuthUser(c)),
113
- body: parsed.body,
114
- ...parsed.replyTo ? { replyTo: parsed.replyTo } : {},
115
- ...parsed.mentions ? { mentions: parsed.mentions } : {},
116
- ...parsed.clientToken ? { clientToken: parsed.clientToken } : {}
117
- });
118
- if (result.status === "work_item_not_found") return c.json({ error: "Work item not found" }, 404);
119
- if (result.status === "token_conflict") return c.json({ error: "comment_token_conflict" }, 409);
120
- if (result.status === "invalid") return c.json({
121
- error: "invalid_comment",
122
- message: result.message
123
- }, 422);
124
- const { comment, workItem } = result;
125
- await audit?.emit({
126
- context: c,
127
- input: {
128
- action: "factory.work_item.comment_created",
129
- factoryProjectId: workItem.factoryProjectId,
130
- targets: [{
131
- type: "work_item",
132
- id: workItem.id,
133
- name: workItem.title
134
- }],
135
- metadata: { commentId: comment.id }
136
- }
137
- });
138
- await emitMentionAudit(c, {
139
- factoryProjectId: workItem.factoryProjectId,
140
- workItemId: workItem.id,
141
- title: workItem.title
142
- }, comment.id, comment.mentions.map((mention) => mention.id).filter((id) => id !== comment.author.id));
143
- return c.json({ comment: toWireComment(comment, tenant.userId) }, 201);
144
- }
145
- }),
146
- registerApiRoute("/web/factory/work-items/:workItemId/comments/:commentId", {
147
- method: "PATCH",
148
- handler: async (cc) => {
149
- const c = loose(cc);
150
- const tenant = await resolveTenant(c);
151
- if ("response" in tenant) return tenant.response;
152
- const workItemId = c.req.param("workItemId");
153
- const commentId = c.req.param("commentId");
154
- if (!workItemId || !UUID_RE.test(workItemId) || !commentId || !UUID_RE.test(commentId)) return c.json({ error: "Comment not found" }, 404);
155
- const parsed = parseEditCommentBody(await readJson(c));
156
- if (!parsed) return c.json({ error: "invalid_comment" }, 422);
157
- const result = await domain.editComment({
158
- orgId: tenant.orgId,
159
- workItemId,
160
- commentId,
161
- editor: editorFor(c, tenant),
162
- body: parsed.body,
163
- ...parsed.mentions ? { mentions: parsed.mentions } : {},
164
- ...parsed.expectedRevision !== void 0 ? { expectedRevision: parsed.expectedRevision } : {}
165
- });
166
- if (result.status === "not_found") return c.json({ error: "Comment not found" }, 404);
167
- if (result.status === "forbidden") return c.json({ error: "not_comment_author" }, 403);
168
- if (result.status === "not_editable") return c.json({ error: "comment_not_editable" }, 409);
169
- if (result.status === "conflict") return c.json({ error: "comment_conflict" }, 409);
170
- if (result.status === "invalid") return c.json({
171
- error: "invalid_comment",
172
- message: result.message
173
- }, 422);
174
- const { comment } = result;
175
- await audit?.emit({
176
- context: c,
177
- input: {
178
- action: "factory.work_item.comment_edited",
179
- factoryProjectId: comment.factoryProjectId,
180
- targets: [{
181
- type: "work_item",
182
- id: comment.workItemId
183
- }],
184
- metadata: {
185
- commentId: comment.id,
186
- previousBody: result.previousBody.slice(0, MAX_AUDIT_BODY_SNAPSHOT)
187
- }
188
- }
189
- });
190
- await emitMentionAudit(c, {
191
- factoryProjectId: comment.factoryProjectId,
192
- workItemId: comment.workItemId
193
- }, comment.id, result.addedMentions.map((mention) => mention.id));
194
- return c.json({ comment: toWireComment(comment, tenant.userId) });
195
- }
196
- }),
197
- registerApiRoute("/web/factory/work-items/:workItemId/comments/:commentId", {
198
- method: "DELETE",
199
- handler: async (cc) => {
200
- const c = loose(cc);
201
- const tenant = await resolveTenant(c);
202
- if ("response" in tenant) return tenant.response;
203
- const workItemId = c.req.param("workItemId");
204
- const commentId = c.req.param("commentId");
205
- if (!workItemId || !UUID_RE.test(workItemId) || !commentId || !UUID_RE.test(commentId)) return c.json({ error: "Comment not found" }, 404);
206
- const result = await domain.deleteComment({
207
- orgId: tenant.orgId,
208
- workItemId,
209
- commentId,
210
- editor: editorFor(c, tenant)
211
- });
212
- if (result.status === "not_found") return c.json({ error: "Comment not found" }, 404);
213
- if (result.status === "forbidden") return c.json({ error: "not_comment_author" }, 403);
214
- if (result.status === "not_editable") return c.json({ error: "comment_not_editable" }, 409);
215
- await audit?.emit({
216
- context: c,
217
- input: {
218
- action: "factory.work_item.comment_deleted",
219
- factoryProjectId: result.comment.factoryProjectId,
220
- targets: [{
221
- type: "work_item",
222
- id: result.comment.workItemId
223
- }],
224
- metadata: { commentId: result.comment.id }
225
- }
226
- });
227
- return c.json({ comment: toWireComment(result.comment, tenant.userId) });
228
- }
229
- }),
230
- registerApiRoute("/web/factory/projects/:id/mention-roster", {
231
- method: "GET",
232
- handler: async (cc) => {
233
- const c = loose(cc);
234
- const tenant = await resolveTenant(c);
235
- if ("response" in tenant) return tenant.response;
236
- const projectId = c.req.param("id");
237
- if (!projectId || !UUID_RE.test(projectId)) return c.json({ error: "Project not found" }, 404);
238
- await projects.ensureReady();
239
- if (!await projects.get({
240
- orgId: tenant.orgId,
241
- id: projectId
242
- })) return c.json({ error: "Project not found" }, 404);
243
- await comments.ensureReady();
244
- const roster = await domain.mentionRoster({
245
- orgId: tenant.orgId,
246
- factoryProjectId: projectId
247
- });
248
- const query = c.req.query("q")?.trim().toLowerCase();
249
- const members = query ? roster.filter((member) => (member.name ?? member.id).toLowerCase().startsWith(query)) : roster;
250
- return c.json({ members });
251
- }
252
- }),
253
- registerApiRoute("/web/factory/projects/:id/feed-events", {
254
- method: "GET",
255
- handler: async (cc) => {
256
- const c = loose(cc);
257
- const tenant = await resolveTenant(c);
258
- if ("response" in tenant) return tenant.response;
259
- const projectId = c.req.param("id");
260
- if (!projectId || !UUID_RE.test(projectId)) return c.json({ error: "Project not found" }, 404);
261
- await projects.ensureReady();
262
- if (!await projects.get({
263
- orgId: tenant.orgId,
264
- id: projectId
265
- })) return c.json({ error: "Project not found" }, 404);
266
- const topic = feedTopic(tenant.orgId, projectId);
267
- return streamSSE(c, async (stream) => {
268
- const onEvent = withAck(async (event) => {
269
- if (stream.aborted) return;
270
- const data = event.data;
271
- const workItemId = isRecord(data) && typeof data.workItemId === "string" ? data.workItemId : void 0;
272
- try {
273
- await stream.writeSSE({
274
- event: "feed",
275
- data: JSON.stringify(workItemId ? { workItemId } : {})
276
- });
277
- } catch {}
278
- });
279
- const closed = new Promise((resolve) => stream.onAbort(resolve));
280
- let keepalive;
281
- try {
282
- await pubsub.subscribe(topic, onEvent, { startFrom: "latest" });
283
- if (!stream.aborted) {
284
- keepalive = setInterval(() => {
285
- if (stream.aborted) return;
286
- stream.write(": ping\n\n");
287
- }, FEED_KEEPALIVE_MS);
288
- await closed;
289
- }
290
- } finally {
291
- clearInterval(keepalive);
292
- await pubsub.unsubscribe(topic, onEvent);
293
- }
294
- });
295
- }
296
- })
297
- ];
298
- }
299
- export { buildCommentRoutes };
300
-
301
- //# sourceMappingURL=routes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"routes.js","names":[],"sources":["../../../../src/storage/domains/comments/routes.ts"],"sourcesContent":["/**\n * HTTP for the item feed. Every handler is the same shape: resolve the tenant,\n * validate the path ids, delegate to a `CommentsDomain` service method, map its\n * result status to a status code, then emit audit.\n */\n\nimport { withAck } from '@mastra/core/events';\nimport type { EventCallback, PubSub } from '@mastra/core/events';\nimport type { ApiRoute } from '@mastra/core/server';\nimport { registerApiRoute } from '@mastra/core/server';\nimport type { Context } from 'hono';\nimport { streamSSE } from 'hono/streaming';\n\nimport { getFactoryAuthUser } from '../../../auth.js';\nimport { feedTopic } from '../../../feed-events.js';\nimport type { RouteAuth } from '../../../routes/route.js';\nimport type { AuditEmitter } from '../audit/domain.js';\nimport type { FactoryProjectsStorage } from '../projects/base.js';\nimport type { WorkItemsStorage } from '../work-items/base.js';\nimport { actorFromAuthUser } from './actor.js';\nimport type { WorkItemCommentsStorage } from './base.js';\nimport { decodeCommentCursor } from './base.js';\nimport type { CommentEditor, CommentsDomain } from './domain.js';\nimport { isRecord, parseCreateCommentBody, parseEditCommentBody, readJson, UUID_RE } from './parse.js';\nimport { toWireComment } from './wire.js';\nimport type { WireCommentPage } from './wire.js';\n\nconst MAX_AUDIT_BODY_SNAPSHOT = 1024;\n/** Comment frames only — proxies drop an idle stream, and `write` can't detect a dead peer. */\nconst FEED_KEEPALIVE_MS = 25_000;\n// Ceiling: one broker subscription per open tab, not per project. A per-replica\n// topic multiplexer is the upgrade path if tab counts ever make that hurt.\n\nexport interface CommentRouteDependencies {\n domain: CommentsDomain;\n auth: RouteAuth;\n comments: WorkItemCommentsStorage;\n workItems: WorkItemsStorage;\n projects: FactoryProjectsStorage;\n pubsub: PubSub;\n audit?: AuditEmitter;\n}\n\ninterface Tenant {\n orgId: string;\n userId: string;\n}\n\nfunction loose(c: unknown): Context {\n return c as Context;\n}\n\nexport function buildCommentRoutes(dependencies: CommentRouteDependencies): ApiRoute[] {\n const { domain, auth, comments, workItems, projects, pubsub, audit } = dependencies;\n\n async function resolveTenant(c: Context): Promise<Tenant | { response: Response }> {\n await auth.ensureUser(c);\n const tenant = auth.tenant(c);\n if (!tenant) return { response: c.json({ error: 'unauthorized' }, 401) };\n if (!tenant.orgId) {\n return {\n response: c.json({ error: 'organization_required', message: 'The item feed requires an organization.' }, 403),\n };\n }\n return { orgId: tenant.orgId, userId: tenant.userId };\n }\n\n function editorFor(c: Context, tenant: Tenant): CommentEditor {\n return {\n userId: tenant.userId,\n canModerate: () => auth.isOrganizationAdmin(c, tenant.orgId),\n };\n }\n\n async function emitMentionAudit(\n c: Context,\n target: { factoryProjectId: string; workItemId: string; title?: string },\n commentId: string,\n mentionedIds: string[],\n ): Promise<void> {\n if (mentionedIds.length === 0) return;\n await audit?.emit({\n context: c,\n input: {\n action: 'factory.work_item.comment_mentioned',\n factoryProjectId: target.factoryProjectId,\n targets: [{ type: 'work_item', id: target.workItemId, ...(target.title ? { name: target.title } : {}) }],\n metadata: { commentId, mentionedIds },\n },\n });\n }\n\n return [\n registerApiRoute('/web/factory/work-items/:workItemId/comments', {\n method: 'GET',\n handler: async cc => {\n const c = loose(cc);\n const tenant = await resolveTenant(c);\n if ('response' in tenant) return tenant.response;\n\n const workItemId = c.req.param('workItemId');\n if (!workItemId || !UUID_RE.test(workItemId)) return c.json({ error: 'Work item not found' }, 404);\n await workItems.ensureReady();\n const workItem = await workItems.get({ orgId: tenant.orgId, id: workItemId });\n if (!workItem) return c.json({ error: 'Work item not found' }, 404);\n\n await comments.ensureReady();\n const limitRaw = c.req.query('limit');\n const limit = limitRaw ? Number.parseInt(limitRaw, 10) : undefined;\n const before = c.req.query('before') || undefined;\n if (before && !decodeCommentCursor(before)) return c.json({ error: 'invalid_cursor' }, 422);\n const around = c.req.query('around') || undefined;\n if (around && !UUID_RE.test(around)) return c.json({ error: 'invalid_comment_id' }, 422);\n const page = await comments.list({\n orgId: tenant.orgId,\n factoryProjectId: workItem.factoryProjectId,\n workItemId,\n before,\n ...(around ? { around } : {}),\n ...(limit !== undefined && Number.isFinite(limit) ? { limit } : {}),\n });\n const wirePage: WireCommentPage = {\n comments: page.comments.map(comment => toWireComment(comment, tenant.userId)),\n ...(page.nextCursor ? { nextCursor: page.nextCursor } : {}),\n };\n return c.json(wirePage);\n },\n }),\n\n registerApiRoute('/web/factory/work-items/:workItemId/comments', {\n method: 'POST',\n handler: async cc => {\n const c = loose(cc);\n const tenant = await resolveTenant(c);\n if ('response' in tenant) return tenant.response;\n\n const workItemId = c.req.param('workItemId');\n if (!workItemId || !UUID_RE.test(workItemId)) return c.json({ error: 'Work item not found' }, 404);\n\n const parsed = parseCreateCommentBody(await readJson(c));\n if (!parsed) return c.json({ error: 'invalid_comment' }, 422);\n\n const result = await domain.createComment({\n orgId: tenant.orgId,\n workItemId,\n author: actorFromAuthUser(tenant.userId, getFactoryAuthUser(c)),\n body: parsed.body,\n ...(parsed.replyTo ? { replyTo: parsed.replyTo } : {}),\n ...(parsed.mentions ? { mentions: parsed.mentions } : {}),\n ...(parsed.clientToken ? { clientToken: parsed.clientToken } : {}),\n });\n if (result.status === 'work_item_not_found') return c.json({ error: 'Work item not found' }, 404);\n if (result.status === 'token_conflict') return c.json({ error: 'comment_token_conflict' }, 409);\n if (result.status === 'invalid') return c.json({ error: 'invalid_comment', message: result.message }, 422);\n\n const { comment, workItem } = result;\n await audit?.emit({\n context: c,\n input: {\n action: 'factory.work_item.comment_created',\n factoryProjectId: workItem.factoryProjectId,\n targets: [{ type: 'work_item', id: workItem.id, name: workItem.title }],\n metadata: { commentId: comment.id },\n },\n });\n await emitMentionAudit(\n c,\n { factoryProjectId: workItem.factoryProjectId, workItemId: workItem.id, title: workItem.title },\n comment.id,\n comment.mentions.map(mention => mention.id).filter(id => id !== comment.author.id),\n );\n return c.json({ comment: toWireComment(comment, tenant.userId) }, 201);\n },\n }),\n\n registerApiRoute('/web/factory/work-items/:workItemId/comments/:commentId', {\n method: 'PATCH',\n handler: async cc => {\n const c = loose(cc);\n const tenant = await resolveTenant(c);\n if ('response' in tenant) return tenant.response;\n\n const workItemId = c.req.param('workItemId');\n const commentId = c.req.param('commentId');\n if (!workItemId || !UUID_RE.test(workItemId) || !commentId || !UUID_RE.test(commentId)) {\n return c.json({ error: 'Comment not found' }, 404);\n }\n\n const parsed = parseEditCommentBody(await readJson(c));\n if (!parsed) return c.json({ error: 'invalid_comment' }, 422);\n\n const result = await domain.editComment({\n orgId: tenant.orgId,\n workItemId,\n commentId,\n editor: editorFor(c, tenant),\n body: parsed.body,\n ...(parsed.mentions ? { mentions: parsed.mentions } : {}),\n ...(parsed.expectedRevision !== undefined ? { expectedRevision: parsed.expectedRevision } : {}),\n });\n if (result.status === 'not_found') return c.json({ error: 'Comment not found' }, 404);\n if (result.status === 'forbidden') return c.json({ error: 'not_comment_author' }, 403);\n if (result.status === 'not_editable') return c.json({ error: 'comment_not_editable' }, 409);\n if (result.status === 'conflict') return c.json({ error: 'comment_conflict' }, 409);\n if (result.status === 'invalid') return c.json({ error: 'invalid_comment', message: result.message }, 422);\n\n const { comment } = result;\n await audit?.emit({\n context: c,\n input: {\n action: 'factory.work_item.comment_edited',\n factoryProjectId: comment.factoryProjectId,\n targets: [{ type: 'work_item', id: comment.workItemId }],\n metadata: {\n commentId: comment.id,\n previousBody: result.previousBody.slice(0, MAX_AUDIT_BODY_SNAPSHOT),\n },\n },\n });\n await emitMentionAudit(\n c,\n { factoryProjectId: comment.factoryProjectId, workItemId: comment.workItemId },\n comment.id,\n result.addedMentions.map(mention => mention.id),\n );\n return c.json({ comment: toWireComment(comment, tenant.userId) });\n },\n }),\n\n registerApiRoute('/web/factory/work-items/:workItemId/comments/:commentId', {\n method: 'DELETE',\n handler: async cc => {\n const c = loose(cc);\n const tenant = await resolveTenant(c);\n if ('response' in tenant) return tenant.response;\n\n const workItemId = c.req.param('workItemId');\n const commentId = c.req.param('commentId');\n if (!workItemId || !UUID_RE.test(workItemId) || !commentId || !UUID_RE.test(commentId)) {\n return c.json({ error: 'Comment not found' }, 404);\n }\n\n const result = await domain.deleteComment({\n orgId: tenant.orgId,\n workItemId,\n commentId,\n editor: editorFor(c, tenant),\n });\n if (result.status === 'not_found') return c.json({ error: 'Comment not found' }, 404);\n if (result.status === 'forbidden') return c.json({ error: 'not_comment_author' }, 403);\n if (result.status === 'not_editable') return c.json({ error: 'comment_not_editable' }, 409);\n\n await audit?.emit({\n context: c,\n input: {\n action: 'factory.work_item.comment_deleted',\n factoryProjectId: result.comment.factoryProjectId,\n targets: [{ type: 'work_item', id: result.comment.workItemId }],\n metadata: { commentId: result.comment.id },\n },\n });\n return c.json({ comment: toWireComment(result.comment, tenant.userId) });\n },\n }),\n\n registerApiRoute('/web/factory/projects/:id/mention-roster', {\n method: 'GET',\n handler: async cc => {\n const c = loose(cc);\n const tenant = await resolveTenant(c);\n if ('response' in tenant) return tenant.response;\n\n const projectId = c.req.param('id');\n if (!projectId || !UUID_RE.test(projectId)) return c.json({ error: 'Project not found' }, 404);\n await projects.ensureReady();\n const project = await projects.get({ orgId: tenant.orgId, id: projectId });\n if (!project) return c.json({ error: 'Project not found' }, 404);\n\n await comments.ensureReady();\n const roster = await domain.mentionRoster({ orgId: tenant.orgId, factoryProjectId: projectId });\n const query = c.req.query('q')?.trim().toLowerCase();\n const members = query\n ? roster.filter(member => (member.name ?? member.id).toLowerCase().startsWith(query))\n : roster;\n return c.json({ members });\n },\n }),\n\n registerApiRoute('/web/factory/projects/:id/feed-events', {\n method: 'GET',\n handler: async cc => {\n const c = loose(cc);\n const tenant = await resolveTenant(c);\n if ('response' in tenant) return tenant.response;\n\n const projectId = c.req.param('id');\n if (!projectId || !UUID_RE.test(projectId)) return c.json({ error: 'Project not found' }, 404);\n await projects.ensureReady();\n const project = await projects.get({ orgId: tenant.orgId, id: projectId });\n if (!project) return c.json({ error: 'Project not found' }, 404);\n\n const topic = feedTopic(tenant.orgId, projectId);\n return streamSSE(c, async stream => {\n // `withAck` settles every delivery: on a durable broker (Redis\n // Streams) an unacked event stays in the subscription's pending set\n // and in the broker client's in-flight bookkeeping for the life of\n // this connection — a leak that grows with every feed touch on\n // long-lived dashboard tabs. Feed frames are fire-and-forget\n // invalidations, so a delivery is acked even when the tab is gone.\n const onEvent: EventCallback = withAck(async event => {\n if (stream.aborted) return;\n const data = event.data;\n const workItemId = isRecord(data) && typeof data.workItemId === 'string' ? data.workItemId : undefined;\n try {\n await stream.writeSSE({ event: 'feed', data: JSON.stringify(workItemId ? { workItemId } : {}) });\n } catch {\n // A write to a half-closed socket must not reach `withAck` as a\n // rejection: the nack would republish the event to the shared\n // feed topic, duplicating the invalidation for every tab.\n }\n });\n // Claimed before any await: `onAbort` handlers registered after the\n // reader is gone never run, and a broker subscribe is a round trip.\n const closed = new Promise<void>(resolve => stream.onAbort(resolve));\n let keepalive: ReturnType<typeof setInterval> | undefined;\n try {\n // Without `latest`, a retaining broker replays its whole backlog into\n // every new connection as spurious invalidations.\n await pubsub.subscribe(topic, onEvent, { startFrom: 'latest' });\n if (!stream.aborted) {\n keepalive = setInterval(() => {\n if (stream.aborted) return;\n void stream.write(': ping\\n\\n');\n }, FEED_KEEPALIVE_MS);\n // `streamSSE` closes the stream the moment this callback returns.\n await closed;\n }\n } finally {\n clearInterval(keepalive);\n await pubsub.unsubscribe(topic, onEvent);\n }\n });\n },\n }),\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2BA,MAAM,0BAA0B;;AAEhC,MAAM,oBAAoB;AAmB1B,SAAS,MAAM,GAAqB;CAClC,OAAO;AACT;AAEA,SAAgB,mBAAmB,cAAoD;CACrF,MAAM,EAAE,QAAQ,MAAM,UAAU,WAAW,UAAU,QAAQ,UAAU;CAEvE,eAAe,cAAc,GAAsD;EACjF,MAAM,KAAK,WAAW,CAAC;EACvB,MAAM,SAAS,KAAK,OAAO,CAAC;EAC5B,IAAI,CAAC,QAAQ,OAAO,EAAE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C,IAAI,CAAC,aAAa,CAAC,QAAQ,KAAK,SAAS,GAAG,OAAO,EAAE,KAAK,EAAE,OAAO,oBAAoB,GAAG,GAAG;IAC7F,MAAM,SAAS,YAAY;IAE3B,IAAI,CAAC,MADiB,SAAS,IAAI;KAAE,OAAO,OAAO;KAAO,IAAI;IAAU,CAAC,GAC3D,OAAO,EAAE,KAAK,EAAE,OAAO,oBAAoB,GAAG,GAAG;IAE/D,MAAM,QAAQ,UAAU,OAAO,OAAO,SAAS;IAC/C,OAAO,UAAU,GAAG,OAAM,WAAU;KAOlC,MAAM,UAAyB,QAAQ,OAAM,UAAS;MACpD,IAAI,OAAO,SAAS;MACpB,MAAM,OAAO,MAAM;MACnB,MAAM,aAAa,SAAS,IAAI,KAAK,OAAO,KAAK,eAAe,WAAW,KAAK,aAAa,KAAA;MAC7F,IAAI;OACF,MAAM,OAAO,SAAS;QAAE,OAAO;QAAQ,MAAM,KAAK,UAAU,aAAa,EAAE,WAAW,IAAI,CAAC,CAAC;OAAE,CAAC;MACjG,QAAQ,CAIR;KACF,CAAC;KAGD,MAAM,SAAS,IAAI,SAAc,YAAW,OAAO,QAAQ,OAAO,CAAC;KACnE,IAAI;KACJ,IAAI;MAGF,MAAM,OAAO,UAAU,OAAO,SAAS,EAAE,WAAW,SAAS,CAAC;MAC9D,IAAI,CAAC,OAAO,SAAS;OACnB,YAAY,kBAAkB;QAC5B,IAAI,OAAO,SAAS;QACpB,OAAY,MAAM,YAAY;OAChC,GAAG,iBAAiB;OAEpB,MAAM;MACR;KACF,UAAU;MACR,cAAc,SAAS;MACvB,MAAM,OAAO,YAAY,OAAO,OAAO;KACzC;IACF,CAAC;GACH;EACF,CAAC;CACH;AACF"}
@@ -1,5 +0,0 @@
1
- import type { CollectionSchema } from '@mastra/core/storage';
2
- export declare const WORK_ITEM_COMMENTS_SCHEMA: CollectionSchema;
3
- export declare const WORK_ITEM_COMMENT_MENTIONS_SCHEMA: CollectionSchema;
4
- export declare const WORK_ITEM_ACTIVITY_SCHEMA: CollectionSchema;
5
- //# sourceMappingURL=schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/comments/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,eAAO,MAAM,yBAAyB,EAAE,gBA2CvC,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,gBA6B/C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,gBAgCvC,CAAC"}