@mastra/factory 0.0.0-aggregate-trace-20261015182851

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 (926) hide show
  1. package/LICENSE.md +32 -0
  2. package/README.md +671 -0
  3. package/dist/auth.d.ts +201 -0
  4. package/dist/auth.d.ts.map +1 -0
  5. package/dist/auth.js +623 -0
  6. package/dist/auth.js.map +1 -0
  7. package/dist/boards/define-board.d.ts +111 -0
  8. package/dist/boards/define-board.d.ts.map +1 -0
  9. package/dist/boards/define-board.js +156 -0
  10. package/dist/boards/define-board.js.map +1 -0
  11. package/dist/boards/index.d.ts +14 -0
  12. package/dist/boards/index.d.ts.map +1 -0
  13. package/dist/boards/index.js +21 -0
  14. package/dist/boards/index.js.map +1 -0
  15. package/dist/boards/registry.d.ts +16 -0
  16. package/dist/boards/registry.d.ts.map +1 -0
  17. package/dist/boards/registry.js +25 -0
  18. package/dist/boards/registry.js.map +1 -0
  19. package/dist/boards/relocate.d.ts +21 -0
  20. package/dist/boards/relocate.d.ts.map +1 -0
  21. package/dist/boards/relocate.js +58 -0
  22. package/dist/boards/relocate.js.map +1 -0
  23. package/dist/boards/review.d.ts +6 -0
  24. package/dist/boards/review.d.ts.map +1 -0
  25. package/dist/boards/review.js +104 -0
  26. package/dist/boards/review.js.map +1 -0
  27. package/dist/boards/semantics.d.ts +68 -0
  28. package/dist/boards/semantics.d.ts.map +1 -0
  29. package/dist/boards/semantics.js +119 -0
  30. package/dist/boards/semantics.js.map +1 -0
  31. package/dist/boards/transition-policy.d.ts +67 -0
  32. package/dist/boards/transition-policy.d.ts.map +1 -0
  33. package/dist/boards/transition-policy.js +36 -0
  34. package/dist/boards/transition-policy.js.map +1 -0
  35. package/dist/boards/work-tool-rules.d.ts +8 -0
  36. package/dist/boards/work-tool-rules.d.ts.map +1 -0
  37. package/dist/boards/work-tool-rules.js +20 -0
  38. package/dist/boards/work-tool-rules.js.map +1 -0
  39. package/dist/boards/work-transition-policy.d.ts +3 -0
  40. package/dist/boards/work-transition-policy.d.ts.map +1 -0
  41. package/dist/boards/work-transition-policy.js +46 -0
  42. package/dist/boards/work-transition-policy.js.map +1 -0
  43. package/dist/boards/work.d.ts +4 -0
  44. package/dist/boards/work.d.ts.map +1 -0
  45. package/dist/boards/work.js +222 -0
  46. package/dist/boards/work.js.map +1 -0
  47. package/dist/capabilities/connection.d.ts +9 -0
  48. package/dist/capabilities/connection.d.ts.map +1 -0
  49. package/dist/capabilities/connection.js +1 -0
  50. package/dist/capabilities/intake.d.ts +153 -0
  51. package/dist/capabilities/intake.d.ts.map +1 -0
  52. package/dist/capabilities/intake.js +1 -0
  53. package/dist/capabilities/version-control.d.ts +268 -0
  54. package/dist/capabilities/version-control.d.ts.map +1 -0
  55. package/dist/capabilities/version-control.js +1 -0
  56. package/dist/environment/build-runner.d.ts +72 -0
  57. package/dist/environment/build-runner.d.ts.map +1 -0
  58. package/dist/environment/build-runner.js +131 -0
  59. package/dist/environment/build-runner.js.map +1 -0
  60. package/dist/environment/build-schedule.d.ts +40 -0
  61. package/dist/environment/build-schedule.d.ts.map +1 -0
  62. package/dist/environment/build-schedule.js +94 -0
  63. package/dist/environment/build-schedule.js.map +1 -0
  64. package/dist/environment/build-workflow.d.ts +62 -0
  65. package/dist/environment/build-workflow.d.ts.map +1 -0
  66. package/dist/environment/build-workflow.js +149 -0
  67. package/dist/environment/build-workflow.js.map +1 -0
  68. package/dist/environment/build.d.ts +111 -0
  69. package/dist/environment/build.d.ts.map +1 -0
  70. package/dist/environment/build.js +344 -0
  71. package/dist/environment/build.js.map +1 -0
  72. package/dist/environment/heads.d.ts +36 -0
  73. package/dist/environment/heads.d.ts.map +1 -0
  74. package/dist/environment/heads.js +60 -0
  75. package/dist/environment/heads.js.map +1 -0
  76. package/dist/factory.d.ts +225 -0
  77. package/dist/factory.d.ts.map +1 -0
  78. package/dist/factory.js +1006 -0
  79. package/dist/factory.js.map +1 -0
  80. package/dist/feed-events.d.ts +13 -0
  81. package/dist/feed-events.d.ts.map +1 -0
  82. package/dist/feed-events.js +25 -0
  83. package/dist/feed-events.js.map +1 -0
  84. package/dist/index.d.ts +22 -0
  85. package/dist/index.d.ts.map +1 -0
  86. package/dist/index.js +15 -0
  87. package/dist/integrations/base.d.ts +302 -0
  88. package/dist/integrations/base.d.ts.map +1 -0
  89. package/dist/integrations/base.js +1 -0
  90. package/dist/integrations/github/acceptance-labels.d.ts +16 -0
  91. package/dist/integrations/github/acceptance-labels.d.ts.map +1 -0
  92. package/dist/integrations/github/acceptance-labels.js +55 -0
  93. package/dist/integrations/github/acceptance-labels.js.map +1 -0
  94. package/dist/integrations/github/app-identity.d.ts +43 -0
  95. package/dist/integrations/github/app-identity.d.ts.map +1 -0
  96. package/dist/integrations/github/app-identity.js +62 -0
  97. package/dist/integrations/github/app-identity.js.map +1 -0
  98. package/dist/integrations/github/commits.d.ts +40 -0
  99. package/dist/integrations/github/commits.d.ts.map +1 -0
  100. package/dist/integrations/github/commits.js +48 -0
  101. package/dist/integrations/github/commits.js.map +1 -0
  102. package/dist/integrations/github/config.d.ts +60 -0
  103. package/dist/integrations/github/config.d.ts.map +1 -0
  104. package/dist/integrations/github/config.js +42 -0
  105. package/dist/integrations/github/config.js.map +1 -0
  106. package/dist/integrations/github/default-rules.d.ts +218 -0
  107. package/dist/integrations/github/default-rules.d.ts.map +1 -0
  108. package/dist/integrations/github/default-rules.js +296 -0
  109. package/dist/integrations/github/default-rules.js.map +1 -0
  110. package/dist/integrations/github/integration.d.ts +270 -0
  111. package/dist/integrations/github/integration.d.ts.map +1 -0
  112. package/dist/integrations/github/integration.js +1375 -0
  113. package/dist/integrations/github/integration.js.map +1 -0
  114. package/dist/integrations/github/issue-reconciler.d.ts +28 -0
  115. package/dist/integrations/github/issue-reconciler.d.ts.map +1 -0
  116. package/dist/integrations/github/issue-reconciler.js +138 -0
  117. package/dist/integrations/github/issue-reconciler.js.map +1 -0
  118. package/dist/integrations/github/pat.d.ts +38 -0
  119. package/dist/integrations/github/pat.d.ts.map +1 -0
  120. package/dist/integrations/github/pat.js +59 -0
  121. package/dist/integrations/github/pat.js.map +1 -0
  122. package/dist/integrations/github/provenance.d.ts +34 -0
  123. package/dist/integrations/github/provenance.d.ts.map +1 -0
  124. package/dist/integrations/github/provenance.js +91 -0
  125. package/dist/integrations/github/provenance.js.map +1 -0
  126. package/dist/integrations/github/reconcile-worker.d.ts +45 -0
  127. package/dist/integrations/github/reconcile-worker.d.ts.map +1 -0
  128. package/dist/integrations/github/reconcile-worker.js +189 -0
  129. package/dist/integrations/github/reconcile-worker.js.map +1 -0
  130. package/dist/integrations/github/reconciliation-config.d.ts +3 -0
  131. package/dist/integrations/github/reconciliation-config.d.ts.map +1 -0
  132. package/dist/integrations/github/reconciliation-config.js +19 -0
  133. package/dist/integrations/github/reconciliation-config.js.map +1 -0
  134. package/dist/integrations/github/routes.d.ts +90 -0
  135. package/dist/integrations/github/routes.d.ts.map +1 -0
  136. package/dist/integrations/github/routes.js +1362 -0
  137. package/dist/integrations/github/routes.js.map +1 -0
  138. package/dist/integrations/github/rules.d.ts +173 -0
  139. package/dist/integrations/github/rules.d.ts.map +1 -0
  140. package/dist/integrations/github/rules.js +1021 -0
  141. package/dist/integrations/github/rules.js.map +1 -0
  142. package/dist/integrations/github/sandbox-release.d.ts +25 -0
  143. package/dist/integrations/github/sandbox-release.d.ts.map +1 -0
  144. package/dist/integrations/github/sandbox-release.js +38 -0
  145. package/dist/integrations/github/sandbox-release.js.map +1 -0
  146. package/dist/integrations/github/sandbox.d.ts +234 -0
  147. package/dist/integrations/github/sandbox.d.ts.map +1 -0
  148. package/dist/integrations/github/sandbox.js +947 -0
  149. package/dist/integrations/github/sandbox.js.map +1 -0
  150. package/dist/integrations/github/session-subscriptions.d.ts +28 -0
  151. package/dist/integrations/github/session-subscriptions.d.ts.map +1 -0
  152. package/dist/integrations/github/session-subscriptions.js +283 -0
  153. package/dist/integrations/github/session-subscriptions.js.map +1 -0
  154. package/dist/integrations/github/settle-or-abort.d.ts +7 -0
  155. package/dist/integrations/github/settle-or-abort.d.ts.map +1 -0
  156. package/dist/integrations/github/settle-or-abort.js +25 -0
  157. package/dist/integrations/github/settle-or-abort.js.map +1 -0
  158. package/dist/integrations/github/stale-reviews.d.ts +22 -0
  159. package/dist/integrations/github/stale-reviews.d.ts.map +1 -0
  160. package/dist/integrations/github/stale-reviews.js +70 -0
  161. package/dist/integrations/github/stale-reviews.js.map +1 -0
  162. package/dist/integrations/github/subscriptions.d.ts +54 -0
  163. package/dist/integrations/github/subscriptions.d.ts.map +1 -0
  164. package/dist/integrations/github/subscriptions.js +64 -0
  165. package/dist/integrations/github/subscriptions.js.map +1 -0
  166. package/dist/integrations/github/token-refresh.d.ts +31 -0
  167. package/dist/integrations/github/token-refresh.d.ts.map +1 -0
  168. package/dist/integrations/github/token-refresh.js +42 -0
  169. package/dist/integrations/github/token-refresh.js.map +1 -0
  170. package/dist/integrations/github/webhook.d.ts +139 -0
  171. package/dist/integrations/github/webhook.d.ts.map +1 -0
  172. package/dist/integrations/github/webhook.js +432 -0
  173. package/dist/integrations/github/webhook.js.map +1 -0
  174. package/dist/integrations/gitlab/agent-tools.d.ts +14 -0
  175. package/dist/integrations/gitlab/agent-tools.d.ts.map +1 -0
  176. package/dist/integrations/gitlab/agent-tools.js +42 -0
  177. package/dist/integrations/gitlab/agent-tools.js.map +1 -0
  178. package/dist/integrations/gitlab/api.d.ts +222 -0
  179. package/dist/integrations/gitlab/api.d.ts.map +1 -0
  180. package/dist/integrations/gitlab/api.js +274 -0
  181. package/dist/integrations/gitlab/api.js.map +1 -0
  182. package/dist/integrations/gitlab/default-rules.d.ts +125 -0
  183. package/dist/integrations/gitlab/default-rules.d.ts.map +1 -0
  184. package/dist/integrations/gitlab/default-rules.js +180 -0
  185. package/dist/integrations/gitlab/default-rules.js.map +1 -0
  186. package/dist/integrations/gitlab/integration.d.ts +138 -0
  187. package/dist/integrations/gitlab/integration.d.ts.map +1 -0
  188. package/dist/integrations/gitlab/integration.js +705 -0
  189. package/dist/integrations/gitlab/integration.js.map +1 -0
  190. package/dist/integrations/gitlab/issue-reconciler.d.ts +6 -0
  191. package/dist/integrations/gitlab/issue-reconciler.d.ts.map +1 -0
  192. package/dist/integrations/gitlab/issue-reconciler.js +123 -0
  193. package/dist/integrations/gitlab/issue-reconciler.js.map +1 -0
  194. package/dist/integrations/gitlab/merge-request-reconciler.d.ts +6 -0
  195. package/dist/integrations/gitlab/merge-request-reconciler.d.ts.map +1 -0
  196. package/dist/integrations/gitlab/merge-request-reconciler.js +267 -0
  197. package/dist/integrations/gitlab/merge-request-reconciler.js.map +1 -0
  198. package/dist/integrations/gitlab/reconciler.d.ts +5 -0
  199. package/dist/integrations/gitlab/reconciler.d.ts.map +1 -0
  200. package/dist/integrations/gitlab/reconciler.js +31 -0
  201. package/dist/integrations/gitlab/reconciler.js.map +1 -0
  202. package/dist/integrations/gitlab/reconciliation-config.d.ts +3 -0
  203. package/dist/integrations/gitlab/reconciliation-config.d.ts.map +1 -0
  204. package/dist/integrations/gitlab/reconciliation-config.js +17 -0
  205. package/dist/integrations/gitlab/reconciliation-config.js.map +1 -0
  206. package/dist/integrations/gitlab/routes.d.ts +20 -0
  207. package/dist/integrations/gitlab/routes.d.ts.map +1 -0
  208. package/dist/integrations/gitlab/routes.js +474 -0
  209. package/dist/integrations/gitlab/routes.js.map +1 -0
  210. package/dist/integrations/gitlab/rules.d.ts +35 -0
  211. package/dist/integrations/gitlab/rules.d.ts.map +1 -0
  212. package/dist/integrations/gitlab/rules.js +502 -0
  213. package/dist/integrations/gitlab/rules.js.map +1 -0
  214. package/dist/integrations/gitlab/session-subscriptions.d.ts +32 -0
  215. package/dist/integrations/gitlab/session-subscriptions.d.ts.map +1 -0
  216. package/dist/integrations/gitlab/session-subscriptions.js +193 -0
  217. package/dist/integrations/gitlab/session-subscriptions.js.map +1 -0
  218. package/dist/integrations/gitlab/subscriptions.d.ts +70 -0
  219. package/dist/integrations/gitlab/subscriptions.d.ts.map +1 -0
  220. package/dist/integrations/gitlab/subscriptions.js +76 -0
  221. package/dist/integrations/gitlab/subscriptions.js.map +1 -0
  222. package/dist/integrations/gitlab/version-control.d.ts +16 -0
  223. package/dist/integrations/gitlab/version-control.d.ts.map +1 -0
  224. package/dist/integrations/gitlab/version-control.js +621 -0
  225. package/dist/integrations/gitlab/version-control.js.map +1 -0
  226. package/dist/integrations/gitlab/webhook-dispatch.d.ts +75 -0
  227. package/dist/integrations/gitlab/webhook-dispatch.d.ts.map +1 -0
  228. package/dist/integrations/gitlab/webhook-dispatch.js +235 -0
  229. package/dist/integrations/gitlab/webhook-dispatch.js.map +1 -0
  230. package/dist/integrations/gitlab/webhook.d.ts +72 -0
  231. package/dist/integrations/gitlab/webhook.d.ts.map +1 -0
  232. package/dist/integrations/gitlab/webhook.js +201 -0
  233. package/dist/integrations/gitlab/webhook.js.map +1 -0
  234. package/dist/integrations/incidentio/agent-tools.d.ts +49 -0
  235. package/dist/integrations/incidentio/agent-tools.d.ts.map +1 -0
  236. package/dist/integrations/incidentio/agent-tools.js +90 -0
  237. package/dist/integrations/incidentio/agent-tools.js.map +1 -0
  238. package/dist/integrations/incidentio/api.d.ts +400 -0
  239. package/dist/integrations/incidentio/api.d.ts.map +1 -0
  240. package/dist/integrations/incidentio/api.js +192 -0
  241. package/dist/integrations/incidentio/api.js.map +1 -0
  242. package/dist/integrations/incidentio/claim.d.ts +8 -0
  243. package/dist/integrations/incidentio/claim.d.ts.map +1 -0
  244. package/dist/integrations/incidentio/claim.js +14 -0
  245. package/dist/integrations/incidentio/claim.js.map +1 -0
  246. package/dist/integrations/incidentio/default-rules.d.ts +46 -0
  247. package/dist/integrations/incidentio/default-rules.d.ts.map +1 -0
  248. package/dist/integrations/incidentio/default-rules.js +68 -0
  249. package/dist/integrations/incidentio/default-rules.js.map +1 -0
  250. package/dist/integrations/incidentio/intake.d.ts +10 -0
  251. package/dist/integrations/incidentio/intake.d.ts.map +1 -0
  252. package/dist/integrations/incidentio/intake.js +307 -0
  253. package/dist/integrations/incidentio/intake.js.map +1 -0
  254. package/dist/integrations/incidentio/integration.d.ts +63 -0
  255. package/dist/integrations/incidentio/integration.d.ts.map +1 -0
  256. package/dist/integrations/incidentio/integration.js +141 -0
  257. package/dist/integrations/incidentio/integration.js.map +1 -0
  258. package/dist/integrations/incidentio/issue-reconciler.d.ts +10 -0
  259. package/dist/integrations/incidentio/issue-reconciler.d.ts.map +1 -0
  260. package/dist/integrations/incidentio/issue-reconciler.js +75 -0
  261. package/dist/integrations/incidentio/issue-reconciler.js.map +1 -0
  262. package/dist/integrations/incidentio/reconciliation-config.d.ts +3 -0
  263. package/dist/integrations/incidentio/reconciliation-config.d.ts.map +1 -0
  264. package/dist/integrations/incidentio/reconciliation-config.js +17 -0
  265. package/dist/integrations/incidentio/reconciliation-config.js.map +1 -0
  266. package/dist/integrations/incidentio/routes.d.ts +76 -0
  267. package/dist/integrations/incidentio/routes.d.ts.map +1 -0
  268. package/dist/integrations/incidentio/routes.js +249 -0
  269. package/dist/integrations/incidentio/routes.js.map +1 -0
  270. package/dist/integrations/incidentio/rules.d.ts +55 -0
  271. package/dist/integrations/incidentio/rules.d.ts.map +1 -0
  272. package/dist/integrations/incidentio/rules.js +189 -0
  273. package/dist/integrations/incidentio/rules.js.map +1 -0
  274. package/dist/integrations/issue-reconcile-worker.d.ts +19 -0
  275. package/dist/integrations/issue-reconcile-worker.d.ts.map +1 -0
  276. package/dist/integrations/issue-reconcile-worker.js +97 -0
  277. package/dist/integrations/issue-reconcile-worker.js.map +1 -0
  278. package/dist/integrations/issue-reconciler.d.ts +51 -0
  279. package/dist/integrations/issue-reconciler.d.ts.map +1 -0
  280. package/dist/integrations/issue-reconciler.js +158 -0
  281. package/dist/integrations/issue-reconciler.js.map +1 -0
  282. package/dist/integrations/jira/adf.d.ts +26 -0
  283. package/dist/integrations/jira/adf.d.ts.map +1 -0
  284. package/dist/integrations/jira/adf.js +73 -0
  285. package/dist/integrations/jira/adf.js.map +1 -0
  286. package/dist/integrations/jira/agent-tools.d.ts +45 -0
  287. package/dist/integrations/jira/agent-tools.d.ts.map +1 -0
  288. package/dist/integrations/jira/agent-tools.js +87 -0
  289. package/dist/integrations/jira/agent-tools.js.map +1 -0
  290. package/dist/integrations/jira/api.d.ts +157 -0
  291. package/dist/integrations/jira/api.d.ts.map +1 -0
  292. package/dist/integrations/jira/api.js +141 -0
  293. package/dist/integrations/jira/api.js.map +1 -0
  294. package/dist/integrations/jira/claim.d.ts +9 -0
  295. package/dist/integrations/jira/claim.d.ts.map +1 -0
  296. package/dist/integrations/jira/claim.js +15 -0
  297. package/dist/integrations/jira/claim.js.map +1 -0
  298. package/dist/integrations/jira/default-rules.d.ts +47 -0
  299. package/dist/integrations/jira/default-rules.d.ts.map +1 -0
  300. package/dist/integrations/jira/default-rules.js +69 -0
  301. package/dist/integrations/jira/default-rules.js.map +1 -0
  302. package/dist/integrations/jira/integration.d.ts +114 -0
  303. package/dist/integrations/jira/integration.d.ts.map +1 -0
  304. package/dist/integrations/jira/integration.js +407 -0
  305. package/dist/integrations/jira/integration.js.map +1 -0
  306. package/dist/integrations/jira/issue-reconciler.d.ts +10 -0
  307. package/dist/integrations/jira/issue-reconciler.d.ts.map +1 -0
  308. package/dist/integrations/jira/issue-reconciler.js +70 -0
  309. package/dist/integrations/jira/issue-reconciler.js.map +1 -0
  310. package/dist/integrations/jira/reconciliation-config.d.ts +3 -0
  311. package/dist/integrations/jira/reconciliation-config.d.ts.map +1 -0
  312. package/dist/integrations/jira/reconciliation-config.js +17 -0
  313. package/dist/integrations/jira/reconciliation-config.js.map +1 -0
  314. package/dist/integrations/jira/routes.d.ts +54 -0
  315. package/dist/integrations/jira/routes.d.ts.map +1 -0
  316. package/dist/integrations/jira/routes.js +260 -0
  317. package/dist/integrations/jira/routes.js.map +1 -0
  318. package/dist/integrations/jira/rules.d.ts +57 -0
  319. package/dist/integrations/jira/rules.d.ts.map +1 -0
  320. package/dist/integrations/jira/rules.js +189 -0
  321. package/dist/integrations/jira/rules.js.map +1 -0
  322. package/dist/integrations/linear/agent-tools.d.ts +34 -0
  323. package/dist/integrations/linear/agent-tools.d.ts.map +1 -0
  324. package/dist/integrations/linear/agent-tools.js +87 -0
  325. package/dist/integrations/linear/agent-tools.js.map +1 -0
  326. package/dist/integrations/linear/claim.d.ts +8 -0
  327. package/dist/integrations/linear/claim.d.ts.map +1 -0
  328. package/dist/integrations/linear/claim.js +14 -0
  329. package/dist/integrations/linear/claim.js.map +1 -0
  330. package/dist/integrations/linear/default-rules.d.ts +46 -0
  331. package/dist/integrations/linear/default-rules.d.ts.map +1 -0
  332. package/dist/integrations/linear/default-rules.js +70 -0
  333. package/dist/integrations/linear/default-rules.js.map +1 -0
  334. package/dist/integrations/linear/integration.d.ts +260 -0
  335. package/dist/integrations/linear/integration.d.ts.map +1 -0
  336. package/dist/integrations/linear/integration.js +900 -0
  337. package/dist/integrations/linear/integration.js.map +1 -0
  338. package/dist/integrations/linear/issue-reconciler.d.ts +8 -0
  339. package/dist/integrations/linear/issue-reconciler.d.ts.map +1 -0
  340. package/dist/integrations/linear/issue-reconciler.js +73 -0
  341. package/dist/integrations/linear/issue-reconciler.js.map +1 -0
  342. package/dist/integrations/linear/reconciliation-config.d.ts +3 -0
  343. package/dist/integrations/linear/reconciliation-config.d.ts.map +1 -0
  344. package/dist/integrations/linear/reconciliation-config.js +21 -0
  345. package/dist/integrations/linear/reconciliation-config.js.map +1 -0
  346. package/dist/integrations/linear/routes.d.ts +81 -0
  347. package/dist/integrations/linear/routes.d.ts.map +1 -0
  348. package/dist/integrations/linear/routes.js +380 -0
  349. package/dist/integrations/linear/routes.js.map +1 -0
  350. package/dist/integrations/linear/rules.d.ts +54 -0
  351. package/dist/integrations/linear/rules.d.ts.map +1 -0
  352. package/dist/integrations/linear/rules.js +189 -0
  353. package/dist/integrations/linear/rules.js.map +1 -0
  354. package/dist/integrations/linear/storage.d.ts +65 -0
  355. package/dist/integrations/linear/storage.d.ts.map +1 -0
  356. package/dist/integrations/linear/storage.js +1 -0
  357. package/dist/integrations/platform/api-client.d.ts +26 -0
  358. package/dist/integrations/platform/api-client.d.ts.map +1 -0
  359. package/dist/integrations/platform/api-client.js +177 -0
  360. package/dist/integrations/platform/api-client.js.map +1 -0
  361. package/dist/integrations/platform/connect/routes.d.ts +39 -0
  362. package/dist/integrations/platform/connect/routes.d.ts.map +1 -0
  363. package/dist/integrations/platform/connect/routes.js +133 -0
  364. package/dist/integrations/platform/connect/routes.js.map +1 -0
  365. package/dist/integrations/platform/github/event-worker.d.ts +58 -0
  366. package/dist/integrations/platform/github/event-worker.d.ts.map +1 -0
  367. package/dist/integrations/platform/github/event-worker.js +449 -0
  368. package/dist/integrations/platform/github/event-worker.js.map +1 -0
  369. package/dist/integrations/platform/github/integration.d.ts +89 -0
  370. package/dist/integrations/platform/github/integration.d.ts.map +1 -0
  371. package/dist/integrations/platform/github/integration.js +1266 -0
  372. package/dist/integrations/platform/github/integration.js.map +1 -0
  373. package/dist/integrations/platform/gitlab/event-worker.d.ts +64 -0
  374. package/dist/integrations/platform/gitlab/event-worker.d.ts.map +1 -0
  375. package/dist/integrations/platform/gitlab/event-worker.js +305 -0
  376. package/dist/integrations/platform/gitlab/event-worker.js.map +1 -0
  377. package/dist/integrations/platform/gitlab/integration.d.ts +57 -0
  378. package/dist/integrations/platform/gitlab/integration.d.ts.map +1 -0
  379. package/dist/integrations/platform/gitlab/integration.js +113 -0
  380. package/dist/integrations/platform/gitlab/integration.js.map +1 -0
  381. package/dist/integrations/platform/incidentio/integration.d.ts +74 -0
  382. package/dist/integrations/platform/incidentio/integration.d.ts.map +1 -0
  383. package/dist/integrations/platform/incidentio/integration.js +406 -0
  384. package/dist/integrations/platform/incidentio/integration.js.map +1 -0
  385. package/dist/integrations/platform/jira/agent-tools.d.ts +36 -0
  386. package/dist/integrations/platform/jira/agent-tools.d.ts.map +1 -0
  387. package/dist/integrations/platform/jira/agent-tools.js +85 -0
  388. package/dist/integrations/platform/jira/agent-tools.js.map +1 -0
  389. package/dist/integrations/platform/jira/integration.d.ts +65 -0
  390. package/dist/integrations/platform/jira/integration.d.ts.map +1 -0
  391. package/dist/integrations/platform/jira/integration.js +546 -0
  392. package/dist/integrations/platform/jira/integration.js.map +1 -0
  393. package/dist/integrations/platform/jira/routes.d.ts +55 -0
  394. package/dist/integrations/platform/jira/routes.d.ts.map +1 -0
  395. package/dist/integrations/platform/jira/routes.js +274 -0
  396. package/dist/integrations/platform/jira/routes.js.map +1 -0
  397. package/dist/integrations/platform/linear/event-worker.d.ts +105 -0
  398. package/dist/integrations/platform/linear/event-worker.d.ts.map +1 -0
  399. package/dist/integrations/platform/linear/event-worker.js +379 -0
  400. package/dist/integrations/platform/linear/event-worker.js.map +1 -0
  401. package/dist/integrations/platform/linear/integration.d.ts +92 -0
  402. package/dist/integrations/platform/linear/integration.d.ts.map +1 -0
  403. package/dist/integrations/platform/linear/integration.js +754 -0
  404. package/dist/integrations/platform/linear/integration.js.map +1 -0
  405. package/dist/integrations/pull-request-head.d.ts +18 -0
  406. package/dist/integrations/pull-request-head.d.ts.map +1 -0
  407. package/dist/integrations/pull-request-head.js +45 -0
  408. package/dist/integrations/pull-request-head.js.map +1 -0
  409. package/dist/integrations/reconciliation-config.d.ts +3 -0
  410. package/dist/integrations/reconciliation-config.d.ts.map +1 -0
  411. package/dist/integrations/reconciliation-config.js +16 -0
  412. package/dist/integrations/reconciliation-config.js.map +1 -0
  413. package/dist/integrations/slack/connect-route.d.ts +46 -0
  414. package/dist/integrations/slack/connect-route.d.ts.map +1 -0
  415. package/dist/integrations/slack/connect-route.js +186 -0
  416. package/dist/integrations/slack/connect-route.js.map +1 -0
  417. package/dist/integrations/slack/emoji-shortcodes.generated.d.ts +8 -0
  418. package/dist/integrations/slack/emoji-shortcodes.generated.d.ts.map +1 -0
  419. package/dist/integrations/slack/emoji-shortcodes.generated.js +1985 -0
  420. package/dist/integrations/slack/emoji-shortcodes.generated.js.map +1 -0
  421. package/dist/integrations/slack/emoji.d.ts +3 -0
  422. package/dist/integrations/slack/emoji.d.ts.map +1 -0
  423. package/dist/integrations/slack/emoji.js +12 -0
  424. package/dist/integrations/slack/emoji.js.map +1 -0
  425. package/dist/integrations/slack/feed-publisher.d.ts +26 -0
  426. package/dist/integrations/slack/feed-publisher.d.ts.map +1 -0
  427. package/dist/integrations/slack/feed-publisher.js +44 -0
  428. package/dist/integrations/slack/feed-publisher.js.map +1 -0
  429. package/dist/integrations/slack/integration.d.ts +80 -0
  430. package/dist/integrations/slack/integration.d.ts.map +1 -0
  431. package/dist/integrations/slack/integration.js +93 -0
  432. package/dist/integrations/slack/integration.js.map +1 -0
  433. package/dist/integrations/slack/slack.d.ts +205 -0
  434. package/dist/integrations/slack/slack.d.ts.map +1 -0
  435. package/dist/integrations/slack/slack.js +653 -0
  436. package/dist/integrations/slack/slack.js.map +1 -0
  437. package/dist/integrations/subscription-session.d.ts +49 -0
  438. package/dist/integrations/subscription-session.d.ts.map +1 -0
  439. package/dist/integrations/subscription-session.js +103 -0
  440. package/dist/integrations/subscription-session.js.map +1 -0
  441. package/dist/integrations/workos/integration.d.ts +39 -0
  442. package/dist/integrations/workos/integration.d.ts.map +1 -0
  443. package/dist/integrations/workos/integration.js +91 -0
  444. package/dist/integrations/workos/integration.js.map +1 -0
  445. package/dist/packages/_internals/workspace/dist/index.js +48 -0
  446. package/dist/packages/_internals/workspace/dist/index.js.map +1 -0
  447. package/dist/platform-auth-host.d.ts +4 -0
  448. package/dist/platform-auth-host.d.ts.map +1 -0
  449. package/dist/platform-auth-host.js +18 -0
  450. package/dist/platform-auth-host.js.map +1 -0
  451. package/dist/review-verdict.d.ts +6 -0
  452. package/dist/review-verdict.d.ts.map +1 -0
  453. package/dist/review-verdict.js +14 -0
  454. package/dist/review-verdict.js.map +1 -0
  455. package/dist/routes/attention-activity.d.ts +23 -0
  456. package/dist/routes/attention-activity.d.ts.map +1 -0
  457. package/dist/routes/attention-activity.js +152 -0
  458. package/dist/routes/attention-activity.js.map +1 -0
  459. package/dist/routes/attention-parked.d.ts +22 -0
  460. package/dist/routes/attention-parked.d.ts.map +1 -0
  461. package/dist/routes/attention-parked.js +136 -0
  462. package/dist/routes/attention-parked.js.map +1 -0
  463. package/dist/routes/attention-proposed.d.ts +3 -0
  464. package/dist/routes/attention-proposed.d.ts.map +1 -0
  465. package/dist/routes/attention-proposed.js +21 -0
  466. package/dist/routes/attention-proposed.js.map +1 -0
  467. package/dist/routes/attention-providers.d.ts +159 -0
  468. package/dist/routes/attention-providers.d.ts.map +1 -0
  469. package/dist/routes/attention-providers.js +524 -0
  470. package/dist/routes/attention-providers.js.map +1 -0
  471. package/dist/routes/attention.d.ts +23 -0
  472. package/dist/routes/attention.d.ts.map +1 -0
  473. package/dist/routes/attention.js +219 -0
  474. package/dist/routes/attention.js.map +1 -0
  475. package/dist/routes/automation-runs.d.ts +37 -0
  476. package/dist/routes/automation-runs.d.ts.map +1 -0
  477. package/dist/routes/automation-runs.js +196 -0
  478. package/dist/routes/automation-runs.js.map +1 -0
  479. package/dist/routes/config.d.ts +238 -0
  480. package/dist/routes/config.d.ts.map +1 -0
  481. package/dist/routes/config.js +1011 -0
  482. package/dist/routes/config.js.map +1 -0
  483. package/dist/routes/contracts.d.ts +1080 -0
  484. package/dist/routes/contracts.d.ts.map +1 -0
  485. package/dist/routes/contracts.js +673 -0
  486. package/dist/routes/contracts.js.map +1 -0
  487. package/dist/routes/custom-provider-source.d.ts +52 -0
  488. package/dist/routes/custom-provider-source.d.ts.map +1 -0
  489. package/dist/routes/custom-provider-source.js +124 -0
  490. package/dist/routes/custom-provider-source.js.map +1 -0
  491. package/dist/routes/fs.d.ts +189 -0
  492. package/dist/routes/fs.d.ts.map +1 -0
  493. package/dist/routes/fs.js +916 -0
  494. package/dist/routes/fs.js.map +1 -0
  495. package/dist/routes/intake.d.ts +64 -0
  496. package/dist/routes/intake.d.ts.map +1 -0
  497. package/dist/routes/intake.js +627 -0
  498. package/dist/routes/intake.js.map +1 -0
  499. package/dist/routes/knowledge.d.ts +247 -0
  500. package/dist/routes/knowledge.d.ts.map +1 -0
  501. package/dist/routes/knowledge.js +1128 -0
  502. package/dist/routes/knowledge.js.map +1 -0
  503. package/dist/routes/oauth.d.ts +43 -0
  504. package/dist/routes/oauth.d.ts.map +1 -0
  505. package/dist/routes/oauth.js +477 -0
  506. package/dist/routes/oauth.js.map +1 -0
  507. package/dist/routes/projects.d.ts +68 -0
  508. package/dist/routes/projects.d.ts.map +1 -0
  509. package/dist/routes/projects.js +919 -0
  510. package/dist/routes/projects.js.map +1 -0
  511. package/dist/routes/provider-credentials.d.ts +82 -0
  512. package/dist/routes/provider-credentials.d.ts.map +1 -0
  513. package/dist/routes/provider-credentials.js +80 -0
  514. package/dist/routes/provider-credentials.js.map +1 -0
  515. package/dist/routes/route.d.ts +48 -0
  516. package/dist/routes/route.d.ts.map +1 -0
  517. package/dist/routes/route.js +15 -0
  518. package/dist/routes/route.js.map +1 -0
  519. package/dist/routes/skills.d.ts +30 -0
  520. package/dist/routes/skills.d.ts.map +1 -0
  521. package/dist/routes/skills.js +198 -0
  522. package/dist/routes/skills.js.map +1 -0
  523. package/dist/routes/source-control-sessions.d.ts +22 -0
  524. package/dist/routes/source-control-sessions.d.ts.map +1 -0
  525. package/dist/routes/source-control-sessions.js +356 -0
  526. package/dist/routes/source-control-sessions.js.map +1 -0
  527. package/dist/routes/source-control-settings.d.ts +10 -0
  528. package/dist/routes/source-control-settings.d.ts.map +1 -0
  529. package/dist/routes/source-control-settings.js +87 -0
  530. package/dist/routes/source-control-settings.js.map +1 -0
  531. package/dist/routes/supervisor.d.ts +25 -0
  532. package/dist/routes/supervisor.d.ts.map +1 -0
  533. package/dist/routes/supervisor.js +35 -0
  534. package/dist/routes/supervisor.js.map +1 -0
  535. package/dist/routes/surface.d.ts +133 -0
  536. package/dist/routes/surface.d.ts.map +1 -0
  537. package/dist/routes/surface.js +518 -0
  538. package/dist/routes/surface.js.map +1 -0
  539. package/dist/routes/telemetry.d.ts +13 -0
  540. package/dist/routes/telemetry.d.ts.map +1 -0
  541. package/dist/routes/telemetry.js +60 -0
  542. package/dist/routes/telemetry.js.map +1 -0
  543. package/dist/routes/tenant-credentials.d.ts +87 -0
  544. package/dist/routes/tenant-credentials.d.ts.map +1 -0
  545. package/dist/routes/tenant-credentials.js +219 -0
  546. package/dist/routes/tenant-credentials.js.map +1 -0
  547. package/dist/routes/work-items.d.ts +49 -0
  548. package/dist/routes/work-items.d.ts.map +1 -0
  549. package/dist/routes/work-items.js +633 -0
  550. package/dist/routes/work-items.js.map +1 -0
  551. package/dist/rules/binding-context.d.ts +59 -0
  552. package/dist/rules/binding-context.d.ts.map +1 -0
  553. package/dist/rules/binding-context.js +134 -0
  554. package/dist/rules/binding-context.js.map +1 -0
  555. package/dist/rules/decision-applicability.d.ts +32 -0
  556. package/dist/rules/decision-applicability.d.ts.map +1 -0
  557. package/dist/rules/decision-applicability.js +56 -0
  558. package/dist/rules/decision-applicability.js.map +1 -0
  559. package/dist/rules/dispatch-errors.d.ts +13 -0
  560. package/dist/rules/dispatch-errors.d.ts.map +1 -0
  561. package/dist/rules/dispatch-errors.js +105 -0
  562. package/dist/rules/dispatch-errors.js.map +1 -0
  563. package/dist/rules/dispatcher.d.ts +86 -0
  564. package/dist/rules/dispatcher.d.ts.map +1 -0
  565. package/dist/rules/dispatcher.js +1159 -0
  566. package/dist/rules/dispatcher.js.map +1 -0
  567. package/dist/rules/event-rules.d.ts +23 -0
  568. package/dist/rules/event-rules.d.ts.map +1 -0
  569. package/dist/rules/event-rules.js +46 -0
  570. package/dist/rules/event-rules.js.map +1 -0
  571. package/dist/rules/index.d.ts +6 -0
  572. package/dist/rules/index.d.ts.map +1 -0
  573. package/dist/rules/index.js +4 -0
  574. package/dist/rules/processor.d.ts +90 -0
  575. package/dist/rules/processor.d.ts.map +1 -0
  576. package/dist/rules/processor.js +486 -0
  577. package/dist/rules/processor.js.map +1 -0
  578. package/dist/rules/resolve.d.ts +15 -0
  579. package/dist/rules/resolve.d.ts.map +1 -0
  580. package/dist/rules/resolve.js +23 -0
  581. package/dist/rules/resolve.js.map +1 -0
  582. package/dist/rules/review-source-tool.d.ts +105 -0
  583. package/dist/rules/review-source-tool.d.ts.map +1 -0
  584. package/dist/rules/review-source-tool.js +109 -0
  585. package/dist/rules/review-source-tool.js.map +1 -0
  586. package/dist/rules/start-coordinator.d.ts +64 -0
  587. package/dist/rules/start-coordinator.d.ts.map +1 -0
  588. package/dist/rules/start-coordinator.js +246 -0
  589. package/dist/rules/start-coordinator.js.map +1 -0
  590. package/dist/rules/terminal-cleanup.d.ts +38 -0
  591. package/dist/rules/terminal-cleanup.d.ts.map +1 -0
  592. package/dist/rules/terminal-cleanup.js +68 -0
  593. package/dist/rules/terminal-cleanup.js.map +1 -0
  594. package/dist/rules/tools.d.ts +15 -0
  595. package/dist/rules/tools.d.ts.map +1 -0
  596. package/dist/rules/tools.js +185 -0
  597. package/dist/rules/tools.js.map +1 -0
  598. package/dist/rules/transition-service.d.ts +93 -0
  599. package/dist/rules/transition-service.d.ts.map +1 -0
  600. package/dist/rules/transition-service.js +402 -0
  601. package/dist/rules/transition-service.js.map +1 -0
  602. package/dist/rules/types.d.ts +553 -0
  603. package/dist/rules/types.d.ts.map +1 -0
  604. package/dist/rules/types.js +154 -0
  605. package/dist/rules/types.js.map +1 -0
  606. package/dist/rules/validation.d.ts +21 -0
  607. package/dist/rules/validation.d.ts.map +1 -0
  608. package/dist/rules/validation.js +327 -0
  609. package/dist/rules/validation.js.map +1 -0
  610. package/dist/sandbox/callback-factory-sandbox.d.ts +15 -0
  611. package/dist/sandbox/callback-factory-sandbox.d.ts.map +1 -0
  612. package/dist/sandbox/callback-factory-sandbox.js +22 -0
  613. package/dist/sandbox/callback-factory-sandbox.js.map +1 -0
  614. package/dist/sandbox/git-ref.d.ts +7 -0
  615. package/dist/sandbox/git-ref.d.ts.map +1 -0
  616. package/dist/sandbox/git-ref.js +15 -0
  617. package/dist/sandbox/git-ref.js.map +1 -0
  618. package/dist/sandbox/local-factory-sandbox.d.ts +20 -0
  619. package/dist/sandbox/local-factory-sandbox.d.ts.map +1 -0
  620. package/dist/sandbox/local-factory-sandbox.js +27 -0
  621. package/dist/sandbox/local-factory-sandbox.js.map +1 -0
  622. package/dist/sandbox/materialization.d.ts +41 -0
  623. package/dist/sandbox/materialization.d.ts.map +1 -0
  624. package/dist/sandbox/materialization.js +18 -0
  625. package/dist/sandbox/materialization.js.map +1 -0
  626. package/dist/sandbox/session-retirement.d.ts +45 -0
  627. package/dist/sandbox/session-retirement.d.ts.map +1 -0
  628. package/dist/sandbox/session-retirement.js +153 -0
  629. package/dist/sandbox/session-retirement.js.map +1 -0
  630. package/dist/sandbox/session-sandbox.d.ts +185 -0
  631. package/dist/sandbox/session-sandbox.d.ts.map +1 -0
  632. package/dist/sandbox/session-sandbox.js +248 -0
  633. package/dist/sandbox/session-sandbox.js.map +1 -0
  634. package/dist/sandbox/workdir.d.ts +45 -0
  635. package/dist/sandbox/workdir.d.ts.map +1 -0
  636. package/dist/sandbox/workdir.js +64 -0
  637. package/dist/sandbox/workdir.js.map +1 -0
  638. package/dist/secret-encryption.d.ts +25 -0
  639. package/dist/secret-encryption.d.ts.map +1 -0
  640. package/dist/secret-encryption.js +107 -0
  641. package/dist/secret-encryption.js.map +1 -0
  642. package/dist/server-error.d.ts +12 -0
  643. package/dist/server-error.d.ts.map +1 -0
  644. package/dist/server-error.js +16 -0
  645. package/dist/server-error.js.map +1 -0
  646. package/dist/session/credential-policy.d.ts +20 -0
  647. package/dist/session/credential-policy.d.ts.map +1 -0
  648. package/dist/session/credential-policy.js +70 -0
  649. package/dist/session/credential-policy.js.map +1 -0
  650. package/dist/session/default-model-hydration.d.ts +46 -0
  651. package/dist/session/default-model-hydration.d.ts.map +1 -0
  652. package/dist/session/default-model-hydration.js +85 -0
  653. package/dist/session/default-model-hydration.js.map +1 -0
  654. package/dist/session/environment-repositories.d.ts +31 -0
  655. package/dist/session/environment-repositories.d.ts.map +1 -0
  656. package/dist/session/environment-repositories.js +89 -0
  657. package/dist/session/environment-repositories.js.map +1 -0
  658. package/dist/session/environment-state-processor.d.ts +59 -0
  659. package/dist/session/environment-state-processor.d.ts.map +1 -0
  660. package/dist/session/environment-state-processor.js +105 -0
  661. package/dist/session/environment-state-processor.js.map +1 -0
  662. package/dist/session/factory-session.d.ts +159 -0
  663. package/dist/session/factory-session.d.ts.map +1 -0
  664. package/dist/session/factory-session.js +226 -0
  665. package/dist/session/factory-session.js.map +1 -0
  666. package/dist/session/filesystem-capture.d.ts +50 -0
  667. package/dist/session/filesystem-capture.d.ts.map +1 -0
  668. package/dist/session/filesystem-capture.js +231 -0
  669. package/dist/session/filesystem-capture.js.map +1 -0
  670. package/dist/session/first-exec-capture.d.ts +38 -0
  671. package/dist/session/first-exec-capture.d.ts.map +1 -0
  672. package/dist/session/first-exec-capture.js +91 -0
  673. package/dist/session/first-exec-capture.js.map +1 -0
  674. package/dist/session/first-message-capture.d.ts +33 -0
  675. package/dist/session/first-message-capture.d.ts.map +1 -0
  676. package/dist/session/first-message-capture.js +35 -0
  677. package/dist/session/first-message-capture.js.map +1 -0
  678. package/dist/session/live-sessions.d.ts +63 -0
  679. package/dist/session/live-sessions.d.ts.map +1 -0
  680. package/dist/session/live-sessions.js +90 -0
  681. package/dist/session/live-sessions.js.map +1 -0
  682. package/dist/session/memory-settings-hydration.d.ts +36 -0
  683. package/dist/session/memory-settings-hydration.d.ts.map +1 -0
  684. package/dist/session/memory-settings-hydration.js +43 -0
  685. package/dist/session/memory-settings-hydration.js.map +1 -0
  686. package/dist/session/org-seed.d.ts +67 -0
  687. package/dist/session/org-seed.d.ts.map +1 -0
  688. package/dist/session/org-seed.js +53 -0
  689. package/dist/session/org-seed.js.map +1 -0
  690. package/dist/session/run-audit.d.ts +54 -0
  691. package/dist/session/run-audit.d.ts.map +1 -0
  692. package/dist/session/run-audit.js +124 -0
  693. package/dist/session/run-audit.js.map +1 -0
  694. package/dist/session/session-title.d.ts +7 -0
  695. package/dist/session/session-title.d.ts.map +1 -0
  696. package/dist/session/session-title.js +14 -0
  697. package/dist/session/session-title.js.map +1 -0
  698. package/dist/session/shell-commands.d.ts +5 -0
  699. package/dist/session/shell-commands.d.ts.map +1 -0
  700. package/dist/session/shell-commands.js +25 -0
  701. package/dist/session/shell-commands.js.map +1 -0
  702. package/dist/session/source-control-tools.d.ts +25 -0
  703. package/dist/session/source-control-tools.d.ts.map +1 -0
  704. package/dist/session/source-control-tools.js +594 -0
  705. package/dist/session/source-control-tools.js.map +1 -0
  706. package/dist/session/thread-title-mirror.d.ts +35 -0
  707. package/dist/session/thread-title-mirror.d.ts.map +1 -0
  708. package/dist/session/thread-title-mirror.js +51 -0
  709. package/dist/session/thread-title-mirror.js.map +1 -0
  710. package/dist/session/work-item-repository.d.ts +21 -0
  711. package/dist/session/work-item-repository.d.ts.map +1 -0
  712. package/dist/session/work-item-repository.js +113 -0
  713. package/dist/session/work-item-repository.js.map +1 -0
  714. package/dist/skills/catalog.d.ts +14 -0
  715. package/dist/skills/catalog.d.ts.map +1 -0
  716. package/dist/skills/catalog.js +62 -0
  717. package/dist/skills/catalog.js.map +1 -0
  718. package/dist/skills/service.d.ts +70 -0
  719. package/dist/skills/service.d.ts.map +1 -0
  720. package/dist/skills/service.js +88 -0
  721. package/dist/skills/service.js.map +1 -0
  722. package/dist/spa-static.d.ts +33 -0
  723. package/dist/spa-static.d.ts.map +1 -0
  724. package/dist/spa-static.js +104 -0
  725. package/dist/spa-static.js.map +1 -0
  726. package/dist/state-signing.d.ts +59 -0
  727. package/dist/state-signing.d.ts.map +1 -0
  728. package/dist/state-signing.js +83 -0
  729. package/dist/state-signing.js.map +1 -0
  730. package/dist/storage/domains/audit/actions.d.ts +24 -0
  731. package/dist/storage/domains/audit/actions.d.ts.map +1 -0
  732. package/dist/storage/domains/audit/actions.js +69 -0
  733. package/dist/storage/domains/audit/actions.js.map +1 -0
  734. package/dist/storage/domains/audit/actors.d.ts +5 -0
  735. package/dist/storage/domains/audit/actors.d.ts.map +1 -0
  736. package/dist/storage/domains/audit/actors.js +25 -0
  737. package/dist/storage/domains/audit/actors.js.map +1 -0
  738. package/dist/storage/domains/audit/agent-audit.d.ts +30 -0
  739. package/dist/storage/domains/audit/agent-audit.d.ts.map +1 -0
  740. package/dist/storage/domains/audit/agent-audit.js +93 -0
  741. package/dist/storage/domains/audit/agent-audit.js.map +1 -0
  742. package/dist/storage/domains/audit/base.d.ts +133 -0
  743. package/dist/storage/domains/audit/base.d.ts.map +1 -0
  744. package/dist/storage/domains/audit/base.js +206 -0
  745. package/dist/storage/domains/audit/base.js.map +1 -0
  746. package/dist/storage/domains/audit/domain.d.ts +79 -0
  747. package/dist/storage/domains/audit/domain.d.ts.map +1 -0
  748. package/dist/storage/domains/audit/domain.js +248 -0
  749. package/dist/storage/domains/audit/domain.js.map +1 -0
  750. package/dist/storage/domains/audit/wire.d.ts +24 -0
  751. package/dist/storage/domains/audit/wire.d.ts.map +1 -0
  752. package/dist/storage/domains/audit/wire.js +16 -0
  753. package/dist/storage/domains/audit/wire.js.map +1 -0
  754. package/dist/storage/domains/channel-identity/base.d.ts +100 -0
  755. package/dist/storage/domains/channel-identity/base.d.ts.map +1 -0
  756. package/dist/storage/domains/channel-identity/base.js +164 -0
  757. package/dist/storage/domains/channel-identity/base.js.map +1 -0
  758. package/dist/storage/domains/comments/activity.d.ts +40 -0
  759. package/dist/storage/domains/comments/activity.d.ts.map +1 -0
  760. package/dist/storage/domains/comments/activity.js +94 -0
  761. package/dist/storage/domains/comments/activity.js.map +1 -0
  762. package/dist/storage/domains/comments/actor.d.ts +51 -0
  763. package/dist/storage/domains/comments/actor.d.ts.map +1 -0
  764. package/dist/storage/domains/comments/actor.js +38 -0
  765. package/dist/storage/domains/comments/actor.js.map +1 -0
  766. package/dist/storage/domains/comments/base.d.ts +245 -0
  767. package/dist/storage/domains/comments/base.d.ts.map +1 -0
  768. package/dist/storage/domains/comments/base.js +533 -0
  769. package/dist/storage/domains/comments/base.js.map +1 -0
  770. package/dist/storage/domains/comments/domain.d.ts +135 -0
  771. package/dist/storage/domains/comments/domain.d.ts.map +1 -0
  772. package/dist/storage/domains/comments/domain.js +285 -0
  773. package/dist/storage/domains/comments/domain.js.map +1 -0
  774. package/dist/storage/domains/comments/feed-context.d.ts +22 -0
  775. package/dist/storage/domains/comments/feed-context.d.ts.map +1 -0
  776. package/dist/storage/domains/comments/feed-context.js +89 -0
  777. package/dist/storage/domains/comments/feed-context.js.map +1 -0
  778. package/dist/storage/domains/comments/feed-sync.d.ts +21 -0
  779. package/dist/storage/domains/comments/feed-sync.d.ts.map +1 -0
  780. package/dist/storage/domains/comments/feed-sync.js +1 -0
  781. package/dist/storage/domains/comments/parse.d.ts +23 -0
  782. package/dist/storage/domains/comments/parse.d.ts.map +1 -0
  783. package/dist/storage/domains/comments/parse.js +90 -0
  784. package/dist/storage/domains/comments/parse.js.map +1 -0
  785. package/dist/storage/domains/comments/routes.d.ts +24 -0
  786. package/dist/storage/domains/comments/routes.d.ts.map +1 -0
  787. package/dist/storage/domains/comments/routes.js +302 -0
  788. package/dist/storage/domains/comments/routes.js.map +1 -0
  789. package/dist/storage/domains/comments/schema.d.ts +5 -0
  790. package/dist/storage/domains/comments/schema.d.ts.map +1 -0
  791. package/dist/storage/domains/comments/schema.js +179 -0
  792. package/dist/storage/domains/comments/schema.js.map +1 -0
  793. package/dist/storage/domains/comments/wire.d.ts +40 -0
  794. package/dist/storage/domains/comments/wire.d.ts.map +1 -0
  795. package/dist/storage/domains/comments/wire.js +37 -0
  796. package/dist/storage/domains/comments/wire.js.map +1 -0
  797. package/dist/storage/domains/credentials/base.d.ts +136 -0
  798. package/dist/storage/domains/credentials/base.d.ts.map +1 -0
  799. package/dist/storage/domains/credentials/base.js +294 -0
  800. package/dist/storage/domains/credentials/base.js.map +1 -0
  801. package/dist/storage/domains/custom-providers/base.d.ts +59 -0
  802. package/dist/storage/domains/custom-providers/base.d.ts.map +1 -0
  803. package/dist/storage/domains/custom-providers/base.js +176 -0
  804. package/dist/storage/domains/custom-providers/base.js.map +1 -0
  805. package/dist/storage/domains/filesystem/base.d.ts +26 -0
  806. package/dist/storage/domains/filesystem/base.d.ts.map +1 -0
  807. package/dist/storage/domains/filesystem/base.js +74 -0
  808. package/dist/storage/domains/filesystem/base.js.map +1 -0
  809. package/dist/storage/domains/intake/base.d.ts +150 -0
  810. package/dist/storage/domains/intake/base.d.ts.map +1 -0
  811. package/dist/storage/domains/intake/base.js +431 -0
  812. package/dist/storage/domains/intake/base.js.map +1 -0
  813. package/dist/storage/domains/integrations/base.d.ts +128 -0
  814. package/dist/storage/domains/integrations/base.d.ts.map +1 -0
  815. package/dist/storage/domains/integrations/base.js +333 -0
  816. package/dist/storage/domains/integrations/base.js.map +1 -0
  817. package/dist/storage/domains/memory-settings/base.d.ts +58 -0
  818. package/dist/storage/domains/memory-settings/base.d.ts.map +1 -0
  819. package/dist/storage/domains/memory-settings/base.js +129 -0
  820. package/dist/storage/domains/memory-settings/base.js.map +1 -0
  821. package/dist/storage/domains/model-defaults/base.d.ts +29 -0
  822. package/dist/storage/domains/model-defaults/base.d.ts.map +1 -0
  823. package/dist/storage/domains/model-defaults/base.js +79 -0
  824. package/dist/storage/domains/model-defaults/base.js.map +1 -0
  825. package/dist/storage/domains/projects/base.d.ts +191 -0
  826. package/dist/storage/domains/projects/base.d.ts.map +1 -0
  827. package/dist/storage/domains/projects/base.js +352 -0
  828. package/dist/storage/domains/projects/base.js.map +1 -0
  829. package/dist/storage/domains/queue-health/base.d.ts +52 -0
  830. package/dist/storage/domains/queue-health/base.d.ts.map +1 -0
  831. package/dist/storage/domains/queue-health/base.js +122 -0
  832. package/dist/storage/domains/queue-health/base.js.map +1 -0
  833. package/dist/storage/domains/source-control/base.d.ts +422 -0
  834. package/dist/storage/domains/source-control/base.d.ts.map +1 -0
  835. package/dist/storage/domains/source-control/base.js +1114 -0
  836. package/dist/storage/domains/source-control/base.js.map +1 -0
  837. package/dist/storage/domains/source-control/inmemory.d.ts +147 -0
  838. package/dist/storage/domains/source-control/inmemory.d.ts.map +1 -0
  839. package/dist/storage/domains/source-control/inmemory.js +416 -0
  840. package/dist/storage/domains/source-control/inmemory.js.map +1 -0
  841. package/dist/storage/domains/work-items/base.d.ts +794 -0
  842. package/dist/storage/domains/work-items/base.d.ts.map +1 -0
  843. package/dist/storage/domains/work-items/base.js +2747 -0
  844. package/dist/storage/domains/work-items/base.js.map +1 -0
  845. package/dist/storage/domains/work-items/board-version.d.ts +26 -0
  846. package/dist/storage/domains/work-items/board-version.d.ts.map +1 -0
  847. package/dist/storage/domains/work-items/board-version.js +110 -0
  848. package/dist/storage/domains/work-items/board-version.js.map +1 -0
  849. package/dist/storage/domains/work-items/metrics.d.ts +97 -0
  850. package/dist/storage/domains/work-items/metrics.d.ts.map +1 -0
  851. package/dist/storage/domains/work-items/metrics.js +226 -0
  852. package/dist/storage/domains/work-items/metrics.js.map +1 -0
  853. package/dist/supervisor/health-worker.d.ts +19 -0
  854. package/dist/supervisor/health-worker.d.ts.map +1 -0
  855. package/dist/supervisor/health-worker.js +74 -0
  856. package/dist/supervisor/health-worker.js.map +1 -0
  857. package/dist/supervisor/health.d.ts +79 -0
  858. package/dist/supervisor/health.d.ts.map +1 -0
  859. package/dist/supervisor/health.js +228 -0
  860. package/dist/supervisor/health.js.map +1 -0
  861. package/dist/supervisor/instructions.d.ts +6 -0
  862. package/dist/supervisor/instructions.d.ts.map +1 -0
  863. package/dist/supervisor/instructions.js +66 -0
  864. package/dist/supervisor/instructions.js.map +1 -0
  865. package/dist/supervisor/read-tools.d.ts +43 -0
  866. package/dist/supervisor/read-tools.d.ts.map +1 -0
  867. package/dist/supervisor/read-tools.js +343 -0
  868. package/dist/supervisor/read-tools.js.map +1 -0
  869. package/dist/supervisor/session-messaging.d.ts +26 -0
  870. package/dist/supervisor/session-messaging.d.ts.map +1 -0
  871. package/dist/supervisor/session-messaging.js +21 -0
  872. package/dist/supervisor/session-messaging.js.map +1 -0
  873. package/dist/supervisor/session.d.ts +38 -0
  874. package/dist/supervisor/session.d.ts.map +1 -0
  875. package/dist/supervisor/session.js +79 -0
  876. package/dist/supervisor/session.js.map +1 -0
  877. package/dist/supervisor/write-tools.d.ts +30 -0
  878. package/dist/supervisor/write-tools.d.ts.map +1 -0
  879. package/dist/supervisor/write-tools.js +231 -0
  880. package/dist/supervisor/write-tools.js.map +1 -0
  881. package/dist/telemetry-types.d.ts +7 -0
  882. package/dist/telemetry-types.d.ts.map +1 -0
  883. package/dist/telemetry-types.js +24 -0
  884. package/dist/telemetry-types.js.map +1 -0
  885. package/dist/telemetry.d.ts +9 -0
  886. package/dist/telemetry.d.ts.map +1 -0
  887. package/dist/telemetry.js +47 -0
  888. package/dist/telemetry.js.map +1 -0
  889. package/dist/timing.d.ts +15 -0
  890. package/dist/timing.d.ts.map +1 -0
  891. package/dist/timing.js +34 -0
  892. package/dist/timing.js.map +1 -0
  893. package/dist/work-item-branch.d.ts +33 -0
  894. package/dist/work-item-branch.d.ts.map +1 -0
  895. package/dist/work-item-branch.js +70 -0
  896. package/dist/work-item-branch.js.map +1 -0
  897. package/dist/workspace.d.ts +131 -0
  898. package/dist/workspace.d.ts.map +1 -0
  899. package/dist/workspace.js +995 -0
  900. package/dist/workspace.js.map +1 -0
  901. package/factory-skills/configure-factory-rules/SKILL.md +122 -0
  902. package/factory-skills/factory-complete-issue/SKILL.md +24 -0
  903. package/factory-skills/factory-gitlab-rereview/SKILL.md +22 -0
  904. package/factory-skills/factory-gitlab-review/SKILL.md +48 -0
  905. package/factory-skills/factory-plan/SKILL.md +72 -0
  906. package/factory-skills/factory-rereview/SKILL.md +225 -0
  907. package/factory-skills/factory-review/SKILL.md +214 -0
  908. package/factory-skills/factory-review/references/archaeology.md +225 -0
  909. package/factory-skills/factory-review/references/categories/README.md +34 -0
  910. package/factory-skills/factory-review/references/categories/behavior-change.md +36 -0
  911. package/factory-skills/factory-review/references/categories/bug-fix.md +37 -0
  912. package/factory-skills/factory-review/references/categories/docs.md +32 -0
  913. package/factory-skills/factory-review/references/categories/experimental-flagged.md +34 -0
  914. package/factory-skills/factory-review/references/categories/infra-tooling.md +37 -0
  915. package/factory-skills/factory-review/references/categories/internal-capability.md +35 -0
  916. package/factory-skills/factory-review/references/categories/large-cross-cutting.md +35 -0
  917. package/factory-skills/factory-review/references/categories/mechanical.md +36 -0
  918. package/factory-skills/factory-review/references/categories/performance.md +33 -0
  919. package/factory-skills/factory-review/references/categories/public-api.md +38 -0
  920. package/factory-skills/factory-review/references/categories/refactor.md +35 -0
  921. package/factory-skills/factory-review/references/categories/revert.md +31 -0
  922. package/factory-skills/factory-review/references/categories/schema-storage.md +39 -0
  923. package/factory-skills/factory-review/references/categories/security.md +35 -0
  924. package/factory-skills/factory-review/references/categories/tests-only.md +38 -0
  925. package/factory-skills/factory-triage/SKILL.md +197 -0
  926. package/package.json +92 -0
@@ -0,0 +1,23 @@
1
+ /** Projects `activity.ts` fan-out rows. */
2
+ import type { WorkItemCommentsStorage } from '../storage/domains/comments/base.js';
3
+ import type { WorkItemsStorage } from '../storage/domains/work-items/base.js';
4
+ import type { AttentionCounts, AttentionLatest, AttentionPageArgs, AttentionPageResult, AttentionProvider, AttentionScope, AttentionStreamPosition } from './attention-providers.js';
5
+ export declare class ActivityAttentionProvider implements AttentionProvider {
6
+ #private;
7
+ readonly kind: "activity";
8
+ constructor({ workItems, comments }: {
9
+ workItems: WorkItemsStorage;
10
+ comments: WorkItemCommentsStorage;
11
+ });
12
+ counts(scope: AttentionScope): Promise<AttentionCounts>;
13
+ latest(scope: AttentionScope): Promise<AttentionLatest | null>;
14
+ page(scope: AttentionScope, { view, search, before, limit }: AttentionPageArgs): Promise<AttentionPageResult>;
15
+ markAllRead(scope: AttentionScope, { before, now }: {
16
+ before?: AttentionStreamPosition;
17
+ now: Date;
18
+ }): Promise<{
19
+ hasMore: boolean;
20
+ continuation?: AttentionStreamPosition;
21
+ }>;
22
+ }
23
+ //# sourceMappingURL=attention-activity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attention-activity.d.ts","sourceRoot":"","sources":["../../src/routes/attention-activity.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAE3C,OAAO,KAAK,EAGV,uBAAuB,EACxB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAIV,gBAAgB,EACjB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,KAAK,EACV,eAAe,EAEf,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAmBlC,qBAAa,yBAA0B,YAAW,iBAAiB;;IACjE,QAAQ,CAAC,IAAI,EAAG,UAAU,CAAU;gBAIxB,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE;QAAE,SAAS,EAAE,gBAAgB,CAAC;QAAC,QAAQ,EAAE,uBAAuB,CAAA;KAAE;IA8DjG,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IAYvD,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAW9D,IAAI,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAgB7G,WAAW,CACf,KAAK,EAAE,cAAc,EACrB,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;QAAE,MAAM,CAAC,EAAE,uBAAuB,CAAC;QAAC,GAAG,EAAE,IAAI,CAAA;KAAE,GAC/D,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,uBAAuB,CAAA;KAAE,CAAC;CASzE"}
@@ -0,0 +1,152 @@
1
+ import { factoryActivityAttentionIdentity, factoryAttentionKey } from "../storage/domains/work-items/base.js";
2
+ import { collectPage, markScanRead, matchesView, receiptScope, scanBatches, workItemBoard } from "./attention-providers.js";
3
+ //#region src/routes/attention-activity.ts
4
+ var ActivityAttentionProvider = class {
5
+ kind = "activity";
6
+ #workItems;
7
+ #comments;
8
+ constructor({ workItems, comments }) {
9
+ this.#workItems = workItems;
10
+ this.#comments = comments;
11
+ }
12
+ #scan(scope, before) {
13
+ return scanBatches(async (cursor) => {
14
+ const rows = await this.#comments.listActivityForUser({
15
+ ...receiptScope(scope),
16
+ ...cursor ? { before: cursor } : {},
17
+ limit: 51
18
+ });
19
+ return {
20
+ rows: rows.slice(0, 50),
21
+ hasMore: rows.length > 50
22
+ };
23
+ }, (activity) => ({
24
+ occurredAt: activity.occurredAt,
25
+ id: activity.id
26
+ }), before);
27
+ }
28
+ /**
29
+ * A vanished work item drops the row; a deleted latest comment does not —
30
+ * the entry still reports that the discussion moved, with the body replaced.
31
+ */
32
+ async #resolve(scope, rows) {
33
+ const [receipts, comments, items] = await Promise.all([
34
+ this.#workItems.listAttentionReceipts({
35
+ ...receiptScope(scope),
36
+ identities: rows.map((row) => factoryActivityAttentionIdentity(row.workItemId, row.occurrence))
37
+ }),
38
+ this.#comments.listByIds({
39
+ orgId: scope.orgId,
40
+ ids: [...new Set(rows.map((row) => row.latestCommentId))]
41
+ }),
42
+ this.#workItems.listByIds({
43
+ orgId: scope.orgId,
44
+ factoryProjectId: scope.factoryProjectId,
45
+ ids: [...new Set(rows.map((row) => row.workItemId))]
46
+ })
47
+ ]);
48
+ const receiptByKey = new Map(receipts.map((receipt) => [factoryAttentionKey(scope.factoryProjectId, receipt), receipt]));
49
+ const commentById = new Map(comments.map((comment) => [comment.id, comment]));
50
+ const itemById = new Map(items.map((item) => [item.id, item]));
51
+ const resolved = [];
52
+ for (const activity of rows) {
53
+ const item = itemById.get(activity.workItemId);
54
+ if (!item) continue;
55
+ const identity = factoryActivityAttentionIdentity(activity.workItemId, activity.occurrence);
56
+ resolved.push({
57
+ activity,
58
+ item,
59
+ comment: commentById.get(activity.latestCommentId),
60
+ identity,
61
+ receipt: receiptByKey.get(factoryAttentionKey(scope.factoryProjectId, identity))
62
+ });
63
+ }
64
+ return resolved;
65
+ }
66
+ async counts(scope) {
67
+ let open = 0;
68
+ let unread = 0;
69
+ for await (const batch of this.#scan(scope)) for (const { receipt } of await this.#resolve(scope, batch.rows)) {
70
+ if (receipt?.state !== "archived") open += 1;
71
+ if (receipt === void 0) unread += 1;
72
+ }
73
+ return {
74
+ open,
75
+ unread
76
+ };
77
+ }
78
+ async latest(scope) {
79
+ const rows = await this.#comments.listActivityForUser({
80
+ ...receiptScope(scope),
81
+ limit: 10
82
+ });
83
+ const newest = (await this.#resolve(scope, rows))[0];
84
+ if (!newest) return null;
85
+ return {
86
+ key: factoryAttentionKey(scope.factoryProjectId, newest.identity),
87
+ at: newest.activity.occurredAt,
88
+ unread: newest.receipt === void 0
89
+ };
90
+ }
91
+ async page(scope, { view, search, before, limit }) {
92
+ return collectPage(this.#scan(scope, before), limit, async (rows) => {
93
+ const entries = [];
94
+ for (const resolved of await this.#resolve(scope, rows)) {
95
+ if (!matchesView(view, resolved.receipt)) continue;
96
+ if (search && !matchesActivitySearch(resolved, search)) continue;
97
+ entries.push({
98
+ occurredAt: resolved.activity.occurredAt,
99
+ resumeCursor: {
100
+ occurredAt: resolved.activity.occurredAt,
101
+ id: resolved.activity.id
102
+ },
103
+ item: toActivityItem(scope, resolved)
104
+ });
105
+ }
106
+ return entries;
107
+ });
108
+ }
109
+ async markAllRead(scope, { before, now }) {
110
+ return markScanRead(this.#scan(scope, before), async (rows) => {
111
+ await this.#workItems.markAttentionReceiptsRead({
112
+ ...receiptScope(scope),
113
+ identities: rows.map((row) => factoryActivityAttentionIdentity(row.workItemId, row.occurrence)),
114
+ now
115
+ });
116
+ });
117
+ }
118
+ };
119
+ function activityDetail({ comment }) {
120
+ if (!comment || comment.deletedAt) return "Comment removed";
121
+ return comment.body.slice(0, 512);
122
+ }
123
+ function matchesActivitySearch(resolved, search) {
124
+ return resolved.item.title.toLowerCase().includes(search) || activityDetail(resolved).toLowerCase().includes(search) || resolved.activity.latestAuthorName?.toLowerCase().includes(search) === true;
125
+ }
126
+ function toActivityItem(scope, resolved) {
127
+ const { activity, item, identity, receipt } = resolved;
128
+ return {
129
+ key: factoryAttentionKey(scope.factoryProjectId, identity),
130
+ kind: "activity",
131
+ commentId: activity.latestCommentId,
132
+ occurrence: activity.occurrence,
133
+ workItemId: activity.workItemId,
134
+ title: item.title,
135
+ detail: activityDetail(resolved),
136
+ authorId: activity.latestAuthorId,
137
+ ...activity.latestAuthorName ? { authorName: activity.latestAuthorName } : {},
138
+ occurredAt: activity.occurredAt.toISOString(),
139
+ read: receipt !== void 0,
140
+ archived: receipt?.state === "archived",
141
+ target: {
142
+ kind: "work-item",
143
+ workItemId: activity.workItemId,
144
+ board: workItemBoard(item),
145
+ commentId: activity.latestCommentId
146
+ }
147
+ };
148
+ }
149
+ //#endregion
150
+ export { ActivityAttentionProvider };
151
+
152
+ //# sourceMappingURL=attention-activity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attention-activity.js","names":["#workItems","#comments","#resolve","#scan"],"sources":["../../src/routes/attention-activity.ts"],"sourcesContent":["/** Projects `activity.ts` fan-out rows. */\n\nimport type {\n WorkItemActivityRow,\n WorkItemCommentRow,\n WorkItemCommentsStorage,\n} from '../storage/domains/comments/base.js';\nimport type {\n FactoryAttentionIdentity,\n FactoryAttentionReceiptRecord,\n WorkItemRow,\n WorkItemsStorage,\n} from '../storage/domains/work-items/base.js';\nimport { factoryActivityAttentionIdentity, factoryAttentionKey } from '../storage/domains/work-items/base.js';\nimport type {\n AttentionCounts,\n AttentionEntry,\n AttentionLatest,\n AttentionPageArgs,\n AttentionPageResult,\n AttentionProvider,\n AttentionScope,\n AttentionStreamPosition,\n} from './attention-providers.js';\nimport {\n collectPage,\n markScanRead,\n matchesView,\n receiptScope,\n SCAN_PAGE_SIZE,\n scanBatches,\n workItemBoard,\n} from './attention-providers.js';\n\ninterface ResolvedActivity {\n activity: WorkItemActivityRow;\n item: WorkItemRow;\n comment: WorkItemCommentRow | undefined;\n identity: FactoryAttentionIdentity;\n receipt: FactoryAttentionReceiptRecord | undefined;\n}\n\nexport class ActivityAttentionProvider implements AttentionProvider {\n readonly kind = 'activity' as const;\n readonly #workItems: WorkItemsStorage;\n readonly #comments: WorkItemCommentsStorage;\n\n constructor({ workItems, comments }: { workItems: WorkItemsStorage; comments: WorkItemCommentsStorage }) {\n this.#workItems = workItems;\n this.#comments = comments;\n }\n\n #scan(scope: AttentionScope, before?: AttentionStreamPosition) {\n return scanBatches<WorkItemActivityRow>(\n async cursor => {\n const rows = await this.#comments.listActivityForUser({\n ...receiptScope(scope),\n ...(cursor ? { before: cursor } : {}),\n limit: SCAN_PAGE_SIZE + 1,\n });\n return { rows: rows.slice(0, SCAN_PAGE_SIZE), hasMore: rows.length > SCAN_PAGE_SIZE };\n },\n activity => ({ occurredAt: activity.occurredAt, id: activity.id }),\n before,\n );\n }\n\n /**\n * A vanished work item drops the row; a deleted latest comment does not —\n * the entry still reports that the discussion moved, with the body replaced.\n */\n async #resolve(scope: AttentionScope, rows: WorkItemActivityRow[]): Promise<ResolvedActivity[]> {\n const [receipts, comments, items] = await Promise.all([\n this.#workItems.listAttentionReceipts({\n ...receiptScope(scope),\n identities: rows.map(row => factoryActivityAttentionIdentity(row.workItemId, row.occurrence)),\n }),\n this.#comments.listByIds({\n orgId: scope.orgId,\n ids: [...new Set(rows.map(row => row.latestCommentId))],\n }),\n this.#workItems.listByIds({\n orgId: scope.orgId,\n factoryProjectId: scope.factoryProjectId,\n ids: [...new Set(rows.map(row => row.workItemId))],\n }),\n ]);\n const receiptByKey = new Map(\n receipts.map(receipt => [factoryAttentionKey(scope.factoryProjectId, receipt), receipt]),\n );\n const commentById = new Map(comments.map(comment => [comment.id, comment]));\n const itemById = new Map(items.map(item => [item.id, item]));\n\n const resolved: ResolvedActivity[] = [];\n for (const activity of rows) {\n const item = itemById.get(activity.workItemId);\n if (!item) continue;\n const identity = factoryActivityAttentionIdentity(activity.workItemId, activity.occurrence);\n resolved.push({\n activity,\n item,\n comment: commentById.get(activity.latestCommentId),\n identity,\n receipt: receiptByKey.get(factoryAttentionKey(scope.factoryProjectId, identity)),\n });\n }\n return resolved;\n }\n\n async counts(scope: AttentionScope): Promise<AttentionCounts> {\n let open = 0;\n let unread = 0;\n for await (const batch of this.#scan(scope)) {\n for (const { receipt } of await this.#resolve(scope, batch.rows)) {\n if (receipt?.state !== 'archived') open += 1;\n if (receipt === undefined) unread += 1;\n }\n }\n return { open, unread };\n }\n\n async latest(scope: AttentionScope): Promise<AttentionLatest | null> {\n const rows = await this.#comments.listActivityForUser({ ...receiptScope(scope), limit: 10 });\n const newest = (await this.#resolve(scope, rows))[0];\n if (!newest) return null;\n return {\n key: factoryAttentionKey(scope.factoryProjectId, newest.identity),\n at: newest.activity.occurredAt,\n unread: newest.receipt === undefined,\n };\n }\n\n async page(scope: AttentionScope, { view, search, before, limit }: AttentionPageArgs): Promise<AttentionPageResult> {\n return collectPage(this.#scan(scope, before), limit, async rows => {\n const entries: AttentionEntry[] = [];\n for (const resolved of await this.#resolve(scope, rows)) {\n if (!matchesView(view, resolved.receipt)) continue;\n if (search && !matchesActivitySearch(resolved, search)) continue;\n entries.push({\n occurredAt: resolved.activity.occurredAt,\n resumeCursor: { occurredAt: resolved.activity.occurredAt, id: resolved.activity.id },\n item: toActivityItem(scope, resolved),\n });\n }\n return entries;\n });\n }\n\n async markAllRead(\n scope: AttentionScope,\n { before, now }: { before?: AttentionStreamPosition; now: Date },\n ): Promise<{ hasMore: boolean; continuation?: AttentionStreamPosition }> {\n return markScanRead(this.#scan(scope, before), async rows => {\n await this.#workItems.markAttentionReceiptsRead({\n ...receiptScope(scope),\n identities: rows.map(row => factoryActivityAttentionIdentity(row.workItemId, row.occurrence)),\n now,\n });\n });\n }\n}\n\nfunction activityDetail({ comment }: ResolvedActivity): string {\n if (!comment || comment.deletedAt) return 'Comment removed';\n return comment.body.slice(0, 512);\n}\n\nfunction matchesActivitySearch(resolved: ResolvedActivity, search: string): boolean {\n return (\n resolved.item.title.toLowerCase().includes(search) ||\n activityDetail(resolved).toLowerCase().includes(search) ||\n resolved.activity.latestAuthorName?.toLowerCase().includes(search) === true\n );\n}\n\nfunction toActivityItem(scope: AttentionScope, resolved: ResolvedActivity) {\n const { activity, item, identity, receipt } = resolved;\n return {\n key: factoryAttentionKey(scope.factoryProjectId, identity),\n kind: 'activity' as const,\n commentId: activity.latestCommentId,\n occurrence: activity.occurrence,\n workItemId: activity.workItemId,\n title: item.title,\n detail: activityDetail(resolved),\n authorId: activity.latestAuthorId,\n ...(activity.latestAuthorName ? { authorName: activity.latestAuthorName } : {}),\n occurredAt: activity.occurredAt.toISOString(),\n read: receipt !== undefined,\n archived: receipt?.state === 'archived',\n target: {\n kind: 'work-item' as const,\n workItemId: activity.workItemId,\n board: workItemBoard(item),\n commentId: activity.latestCommentId,\n },\n };\n}\n"],"mappings":";;;AA0CA,IAAa,4BAAb,MAAoE;CAClE,OAAgB;CAChB;CACA;CAEA,YAAY,EAAE,WAAW,YAAgF;EACvG,KAAKA,aAAa;EAClB,KAAKC,YAAY;CACnB;CAEA,MAAM,OAAuB,QAAkC;EAC7D,OAAO,YACL,OAAM,WAAU;GACd,MAAM,OAAO,MAAM,KAAKA,UAAU,oBAAoB;IACpD,GAAG,aAAa,KAAK;IACrB,GAAI,SAAS,EAAE,QAAQ,OAAO,IAAI,CAAC;IACnC,OAAA;GACF,CAAC;GACD,OAAO;IAAE,MAAM,KAAK,MAAM,GAAA,EAAiB;IAAG,SAAS,KAAK,SAAA;GAAwB;EACtF,IACA,cAAa;GAAE,YAAY,SAAS;GAAY,IAAI,SAAS;EAAG,IAChE,MACF;CACF;;;;;CAMA,MAAMC,SAAS,OAAuB,MAA0D;EAC9F,MAAM,CAAC,UAAU,UAAU,SAAS,MAAM,QAAQ,IAAI;GACpD,KAAKF,WAAW,sBAAsB;IACpC,GA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,QAAQ,WAAW,OAAO;CAC1C,OAAO,QAAQ,KAAK,MAAM,GAAG,GAAG;AAClC;AAEA,SAAS,sBAAsB,UAA4B,QAAyB;CAClF,OACE,SAAS,KAAK,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,KACjD,eAAe,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,MAAM,KACtD,SAAS,SAAS,kBAAkB,YAAY,CAAC,CAAC,SAAS,MAAM,MAAM;AAE3E;AAEA,SAAS,eAAe,OAAuB,UAA4B;CACzE,MAAM,EAAE,UAAU,MAAM,UAAU,YAAY;CAC9C,OAAO;EACL,KAAK,oBAAoB,MAAM,kBAAkB,QAAQ;EACzD,MAAM;EACN,WAAW,SAAS;EACpB,YAAY,SAAS;EACrB,YAAY,SAAS;EACrB,OAAO,KAAK;EACZ,QAAQ,eAAe,QAAQ;EAC/B,UAAU,SAAS;EACnB,GAAI,SAAS,mBAAmB,EAAE,YAAY,SAAS,iBAAiB,IAAI,CAAC;EAC7E,YAAY,SAAS,WAAW,YAAY;EAC5C,MAAM,YAAY,KAAA;EAClB,UAAU,SAAS,UAAU;EAC7B,QAAQ;GACN,MAAM;GACN,YAAY,SAAS;GACrB,OAAO,cAAc,IAAI;GACzB,WAAW,SAAS;EACtB;CACF;AACF"}
@@ -0,0 +1,22 @@
1
+ /** Sessions parked on a tool, read live from the registry: the item exists exactly as long as an answer is owed. */
2
+ import type { LiveSessions } from '../session/live-sessions.js';
3
+ import type { WorkItemsStorage } from '../storage/domains/work-items/base.js';
4
+ import type { AttentionCounts, AttentionLatest, AttentionPageArgs, AttentionPageResult, AttentionProvider, AttentionScope, AttentionStreamPosition } from './attention-providers.js';
5
+ export declare class ParkedRunAttentionProvider implements AttentionProvider {
6
+ #private;
7
+ readonly kind: "agent-waiting";
8
+ constructor({ workItems, liveSessions, }: {
9
+ workItems: WorkItemsStorage;
10
+ liveSessions: Pick<LiveSessions, 'parkedIn'>;
11
+ });
12
+ counts(scope: AttentionScope): Promise<AttentionCounts>;
13
+ latest(scope: AttentionScope): Promise<AttentionLatest | null>;
14
+ page(scope: AttentionScope, { view, search, before, limit }: AttentionPageArgs): Promise<AttentionPageResult>;
15
+ markAllRead(scope: AttentionScope, { before, now }: {
16
+ before?: AttentionStreamPosition;
17
+ now: Date;
18
+ }): Promise<{
19
+ hasMore: boolean;
20
+ }>;
21
+ }
22
+ //# sourceMappingURL=attention-parked.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attention-parked.d.ts","sourceRoot":"","sources":["../../src/routes/attention-parked.ts"],"names":[],"mappings":"AAAA,oHAAoH;AAEpH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAIV,gBAAgB,EACjB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,KAAK,EACV,eAAe,EAEf,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AA+ClC,qBAAa,0BAA2B,YAAW,iBAAiB;;IAClE,QAAQ,CAAC,IAAI,EAAG,eAAe,CAAU;gBAI7B,EACV,SAAS,EACT,YAAY,GACb,EAAE;QACD,SAAS,EAAE,gBAAgB,CAAC;QAC5B,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;KAC9C;IA6CK,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IAUvD,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAU9D,IAAI,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAiB7G,WAAW,CACf,KAAK,EAAE,cAAc,EACrB,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;QAAE,MAAM,CAAC,EAAE,uBAAuB,CAAC;QAAC,GAAG,EAAE,IAAI,CAAA;KAAE,GAC/D,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAWjC"}
@@ -0,0 +1,136 @@
1
+ import { factoryAgentWaitingAttentionIdentity, factoryAttentionKey } from "../storage/domains/work-items/base.js";
2
+ import { matchesView, receiptScope } from "./attention-providers.js";
3
+ //#region src/routes/attention-parked.ts
4
+ function parkedRunLabel(toolName) {
5
+ return toolName === "submit_plan" ? "Plan waiting for review" : "Agent is waiting for an answer";
6
+ }
7
+ function olderThan(entry, before) {
8
+ if (!before) return true;
9
+ const gap = entry.occurredAt.getTime() - before.occurredAt.getTime();
10
+ return gap < 0 || gap === 0 && entry.sessionId.localeCompare(before.id) > 0;
11
+ }
12
+ function toItem(scope, { entry, receipt }) {
13
+ return {
14
+ key: factoryAttentionKey(scope.factoryProjectId, entry.identity),
15
+ kind: "agent-waiting",
16
+ sessionId: entry.sessionId,
17
+ threadId: entry.threadId,
18
+ role: entry.role,
19
+ toolName: entry.toolName,
20
+ occurrence: entry.identity.occurrence,
21
+ workItemId: entry.item.id,
22
+ title: entry.item.title,
23
+ detail: parkedRunLabel(entry.toolName),
24
+ occurredAt: entry.occurredAt.toISOString(),
25
+ read: receipt !== void 0,
26
+ archived: receipt?.state === "archived",
27
+ target: {
28
+ kind: "thread",
29
+ sessionId: entry.sessionId,
30
+ threadId: entry.threadId
31
+ }
32
+ };
33
+ }
34
+ var ParkedRunAttentionProvider = class {
35
+ kind = "agent-waiting";
36
+ #workItems;
37
+ #liveSessions;
38
+ constructor({ workItems, liveSessions }) {
39
+ this.#workItems = workItems;
40
+ this.#liveSessions = liveSessions;
41
+ }
42
+ /** Newest park first. A session bound to several cards is listed once, under the first card. */
43
+ async #parked(scope) {
44
+ const runBySession = new Map(this.#liveSessions.parkedIn(scope.factoryProjectId).map(({ sessionId, run }) => [sessionId, run]));
45
+ if (runBySession.size === 0) return [];
46
+ const items = await this.#workItems.list({
47
+ orgId: scope.orgId,
48
+ factoryProjectId: scope.factoryProjectId
49
+ });
50
+ const bySession = /* @__PURE__ */ new Map();
51
+ for (const item of items) for (const [role, ref] of Object.entries(item.sessions)) {
52
+ const run = runBySession.get(ref.sessionId);
53
+ if (!run || bySession.has(ref.sessionId)) continue;
54
+ bySession.set(ref.sessionId, {
55
+ item,
56
+ role,
57
+ sessionId: ref.sessionId,
58
+ threadId: ref.threadId,
59
+ toolName: run.toolName,
60
+ occurredAt: new Date(run.suspendedAt),
61
+ identity: factoryAgentWaitingAttentionIdentity(ref.sessionId, run.suspendedAt)
62
+ });
63
+ }
64
+ return [...bySession.values()].sort((a, b) => b.occurredAt.getTime() - a.occurredAt.getTime() || a.sessionId.localeCompare(b.sessionId));
65
+ }
66
+ async #withReceipts(scope, parked) {
67
+ const receipts = await this.#workItems.listAttentionReceipts({
68
+ ...receiptScope(scope),
69
+ identities: parked.map((entry) => entry.identity)
70
+ });
71
+ const byKey = new Map(receipts.map((receipt) => [factoryAttentionKey(scope.factoryProjectId, receipt), receipt]));
72
+ return parked.map((entry) => ({
73
+ entry,
74
+ receipt: byKey.get(factoryAttentionKey(scope.factoryProjectId, entry.identity))
75
+ }));
76
+ }
77
+ async counts(scope) {
78
+ let open = 0;
79
+ let unread = 0;
80
+ for (const { receipt } of await this.#withReceipts(scope, await this.#parked(scope))) {
81
+ if (receipt?.state !== "archived") open += 1;
82
+ if (receipt === void 0) unread += 1;
83
+ }
84
+ return {
85
+ open,
86
+ unread
87
+ };
88
+ }
89
+ async latest(scope) {
90
+ const [newest] = await this.#withReceipts(scope, (await this.#parked(scope)).slice(0, 1));
91
+ if (!newest) return null;
92
+ return {
93
+ key: factoryAttentionKey(scope.factoryProjectId, newest.entry.identity),
94
+ at: newest.entry.occurredAt,
95
+ unread: newest.receipt === void 0
96
+ };
97
+ }
98
+ async page(scope, { view, search, before, limit }) {
99
+ const parked = (await this.#parked(scope)).filter((entry) => olderThan(entry, before));
100
+ const entries = [];
101
+ for (const receipted of await this.#withReceipts(scope, parked)) {
102
+ const { entry, receipt } = receipted;
103
+ if (!matchesView(view, receipt)) continue;
104
+ if (search && !`${entry.item.title} ${parkedRunLabel(entry.toolName)}`.toLowerCase().includes(search)) continue;
105
+ if (entries.length === limit) return {
106
+ entries,
107
+ hasMore: true
108
+ };
109
+ entries.push({
110
+ occurredAt: entry.occurredAt,
111
+ resumeCursor: {
112
+ occurredAt: entry.occurredAt,
113
+ id: entry.sessionId
114
+ },
115
+ item: toItem(scope, receipted)
116
+ });
117
+ }
118
+ return {
119
+ entries,
120
+ hasMore: false
121
+ };
122
+ }
123
+ async markAllRead(scope, { before, now }) {
124
+ const parked = (await this.#parked(scope)).filter((entry) => olderThan(entry, before));
125
+ if (parked.length > 0) await this.#workItems.markAttentionReceiptsRead({
126
+ ...receiptScope(scope),
127
+ identities: parked.map((entry) => entry.identity),
128
+ now
129
+ });
130
+ return { hasMore: false };
131
+ }
132
+ };
133
+ //#endregion
134
+ export { ParkedRunAttentionProvider };
135
+
136
+ //# sourceMappingURL=attention-parked.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attention-parked.js","names":["#workItems","#liveSessions","#parked","#withReceipts"],"sources":["../../src/routes/attention-parked.ts"],"sourcesContent":["/** Sessions parked on a tool, read live from the registry: the item exists exactly as long as an answer is owed. */\n\nimport type { LiveSessions } from '../session/live-sessions.js';\nimport type {\n FactoryAttentionIdentity,\n FactoryAttentionReceiptRecord,\n WorkItemRow,\n WorkItemsStorage,\n} from '../storage/domains/work-items/base.js';\nimport { factoryAgentWaitingAttentionIdentity, factoryAttentionKey } from '../storage/domains/work-items/base.js';\nimport type {\n AttentionCounts,\n AttentionEntry,\n AttentionLatest,\n AttentionPageArgs,\n AttentionPageResult,\n AttentionProvider,\n AttentionScope,\n AttentionStreamPosition,\n} from './attention-providers.js';\nimport { matchesView, receiptScope } from './attention-providers.js';\n\ninterface ParkedSession {\n item: WorkItemRow;\n role: string;\n sessionId: string;\n threadId: string;\n toolName: string;\n occurredAt: Date;\n identity: FactoryAttentionIdentity;\n}\n\ninterface ReceiptedParkedSession {\n entry: ParkedSession;\n receipt: FactoryAttentionReceiptRecord | undefined;\n}\n\nfunction parkedRunLabel(toolName: string): string {\n return toolName === 'submit_plan' ? 'Plan waiting for review' : 'Agent is waiting for an answer';\n}\n\nfunction olderThan(entry: ParkedSession, before: AttentionStreamPosition | undefined): boolean {\n if (!before) return true;\n const gap = entry.occurredAt.getTime() - before.occurredAt.getTime();\n return gap < 0 || (gap === 0 && entry.sessionId.localeCompare(before.id) > 0);\n}\n\nfunction toItem(scope: AttentionScope, { entry, receipt }: ReceiptedParkedSession): Record<string, unknown> {\n return {\n key: factoryAttentionKey(scope.factoryProjectId, entry.identity),\n kind: 'agent-waiting' as const,\n sessionId: entry.sessionId,\n threadId: entry.threadId,\n role: entry.role,\n toolName: entry.toolName,\n occurrence: entry.identity.occurrence,\n workItemId: entry.item.id,\n title: entry.item.title,\n detail: parkedRunLabel(entry.toolName),\n occurredAt: entry.occurredAt.toISOString(),\n read: receipt !== undefined,\n archived: receipt?.state === 'archived',\n target: { kind: 'thread' as const, sessionId: entry.sessionId, threadId: entry.threadId },\n };\n}\n\nexport class ParkedRunAttentionProvider implements AttentionProvider {\n readonly kind = 'agent-waiting' as const;\n readonly #workItems: WorkItemsStorage;\n readonly #liveSessions: Pick<LiveSessions, 'parkedIn'>;\n\n constructor({\n workItems,\n liveSessions,\n }: {\n workItems: WorkItemsStorage;\n liveSessions: Pick<LiveSessions, 'parkedIn'>;\n }) {\n this.#workItems = workItems;\n this.#liveSessions = liveSessions;\n }\n\n /** Newest park first. A session bound to several cards is listed once, under the first card. */\n async #parked(scope: AttentionScope): Promise<ParkedSession[]> {\n const runBySession = new Map(\n this.#liveSessions.parkedIn(scope.factoryProjectId).map(({ sessionId, run }) => [sessionId, run]),\n );\n if (runBySession.size === 0) return [];\n const items = await this.#workItems.list({ orgId: scope.orgId, factoryProjectId: scope.factoryProjectId });\n const bySession = new Map<string, ParkedSession>();\n for (const item of items) {\n for (const [role, ref] of Object.entries(item.sessions)) {\n const run = runBySession.get(ref.sessionId);\n if (!run || bySession.has(ref.sessionId)) continue;\n bySession.set(ref.sessionId, {\n item,\n role,\n sessionId: ref.sessionId,\n threadId: ref.threadId,\n toolName: run.toolName,\n occurredAt: new Date(run.suspendedAt),\n identity: factoryAgentWaitingAttentionIdentity(ref.sessionId, run.suspendedAt),\n });\n }\n }\n return [...bySession.values()].sort(\n (a, b) => b.occurredAt.getTime() - a.occurredAt.getTime() || a.sessionId.localeCompare(b.sessionId),\n );\n }\n\n async #withReceipts(scope: AttentionScope, parked: ParkedSession[]): Promise<ReceiptedParkedSession[]> {\n const receipts = await this.#workItems.listAttentionReceipts({\n ...receiptScope(scope),\n identities: parked.map(entry => entry.identity),\n });\n const byKey = new Map(receipts.map(receipt => [factoryAttentionKey(scope.factoryProjectId, receipt), receipt]));\n return parked.map(entry => ({\n entry,\n receipt: byKey.get(factoryAttentionKey(scope.factoryProjectId, entry.identity)),\n }));\n }\n\n async counts(scope: AttentionScope): Promise<AttentionCounts> {\n let open = 0;\n let unread = 0;\n for (const { receipt } of await this.#withReceipts(scope, await this.#parked(scope))) {\n if (receipt?.state !== 'archived') open += 1;\n if (receipt === undefined) unread += 1;\n }\n return { open, unread };\n }\n\n async latest(scope: AttentionScope): Promise<AttentionLatest | null> {\n const [newest] = await this.#withReceipts(scope, (await this.#parked(scope)).slice(0, 1));\n if (!newest) return null;\n return {\n key: factoryAttentionKey(scope.factoryProjectId, newest.entry.identity),\n at: newest.entry.occurredAt,\n unread: newest.receipt === undefined,\n };\n }\n\n async page(scope: AttentionScope, { view, search, before, limit }: AttentionPageArgs): Promise<AttentionPageResult> {\n const parked = (await this.#parked(scope)).filter(entry => olderThan(entry, before));\n const entries: AttentionEntry[] = [];\n for (const receipted of await this.#withReceipts(scope, parked)) {\n const { entry, receipt } = receipted;\n if (!matchesView(view, receipt)) continue;\n if (search && !`${entry.item.title} ${parkedRunLabel(entry.toolName)}`.toLowerCase().includes(search)) continue;\n if (entries.length === limit) return { entries, hasMore: true };\n entries.push({\n occurredAt: entry.occurredAt,\n resumeCursor: { occurredAt: entry.occurredAt, id: entry.sessionId },\n item: toItem(scope, receipted),\n });\n }\n return { entries, hasMore: false };\n }\n\n async markAllRead(\n scope: AttentionScope,\n { before, now }: { before?: AttentionStreamPosition; now: Date },\n ): Promise<{ hasMore: boolean }> {\n const parked = (await this.#parked(scope)).filter(entry => olderThan(entry, before));\n if (parked.length > 0) {\n await this.#workItems.markAttentionReceiptsRead({\n ...receiptScope(scope),\n identities: parked.map(entry => entry.identity),\n now,\n });\n }\n return { hasMore: false };\n }\n}\n"],"mappings":";;;AAqCA,SAAS,eAAe,UAA0B;CAChD,OAAO,aAAa,gBAAgB,4BAA4B;AAClE;AAEA,SAAS,UAAU,OAAsB,QAAsD;CAC7F,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,MAAM,MAAM,WAAW,QAAQ,IAAI,OAAO,WAAW,QAAQ;CACnE,OAAO,MAAM,KAAM,QAAQ,KAAK,MAAM,UAAU,cAAc,OAAO,EAAE,IAAI;AAC7E;AAEA,SAAS,OAAO,OAAuB,EAAE,OAAO,WAA4D;CAC1G,OAAO;EACL,KAAK,oBAAoB,MAAM,kBAAkB,MAAM,QAAQ;EAC/D,MAAM;EACN,WAAW,MAAM;EACjB,UAAU,MAAM;EAChB,MAAM,MAAM;EACZ,UAAU,MAAM;EAChB,YAAY,MAAM,SAAS;EAC3B,YAAY,MAAM,KAAK;EACvB,OAAO,MAAM,KAAK;EAClB,QAAQ,eAAe,MAAM,QAAQ;EACrC,YAAY,MAAM,WAAW,YAAY;EACzC,MAAM,YAAY,KAAA;EAClB,UAAU,SAAS,UAAU;EAC7B,QAAQ;GAAE,MAAM;GAAmB,WAAW,MAAM;GAAW,UAAU,MAAM;EAAS;CAC1F;AACF;AAEA,IAAa,6BAAb,MAAqE;CACnE,OAAgB;CAChB;CAC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Y,MAAM;KAAY,IAAI,MAAM;IAAU;IAClE,MAAM,OAAO,OAAO,SAAS;GAC/B,CAAC;EACH;EACA,OAAO;GAAE;GAAS,SAAS;EAAM;CACnC;CAEA,MAAM,YACJ,OACA,EAAE,QAAQ,OACqB;EAC/B,MAAM,UAAU,MAAM,KAAKD,QAAQ,KAAK,EAAA,CAAG,QAAO,UAAS,UAAU,OAAO,MAAM,CAAC;EACnF,IAAI,OAAO,SAAS,GAClB,MAAM,KAAKF,WAAW,0BAA0B;GAC9C,GAAG,aAAa,KAAK;GACrB,YAAY,OAAO,KAAI,UAAS,MAAM,QAAQ;GAC9C;EACF,CAAC;EAEH,OAAO,EAAE,SAAS,MAAM;CAC1B;AACF"}
@@ -0,0 +1,3 @@
1
+ import type { DecisionAttentionSpec } from './attention-providers.js';
2
+ export declare const proposedDecisionAttentionSpec: DecisionAttentionSpec;
3
+ //# sourceMappingURL=attention-proposed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attention-proposed.d.ts","sourceRoot":"","sources":["../../src/routes/attention-proposed.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAStE,eAAO,MAAM,6BAA6B,EAAE,qBAW3C,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { factoryProposalAttentionIdentity } from "../storage/domains/work-items/base.js";
2
+ import { factoryDecisionType } from "./attention-providers.js";
3
+ //#region src/routes/attention-proposed.ts
4
+ function proposedAction(decision) {
5
+ const { type, stage, role } = decision.decision;
6
+ if (type === "transition" && typeof stage === "string") return `move to ${stage.slice(0, 64)}`;
7
+ return `run ${typeof role === "string" ? role.slice(0, 64) : "automation"}`;
8
+ }
9
+ const proposedDecisionAttentionSpec = {
10
+ kind: "automation-proposed",
11
+ status: "proposed",
12
+ identity: (decision) => factoryProposalAttentionIdentity(decision.id),
13
+ occurredAt: (decision) => decision.updatedAt,
14
+ title: (decision, item) => item?.title ?? `Waiting for approval to ${proposedAction(decision)}`,
15
+ detail: (decision) => `Waiting for approval to ${proposedAction(decision)}`,
16
+ matches: (decision, item, search) => item?.title.toLowerCase().includes(search) === true || proposedAction(decision).toLowerCase().includes(search) || factoryDecisionType(decision).toLowerCase().includes(search)
17
+ };
18
+ //#endregion
19
+ export { proposedDecisionAttentionSpec };
20
+
21
+ //# sourceMappingURL=attention-proposed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attention-proposed.js","names":[],"sources":["../../src/routes/attention-proposed.ts"],"sourcesContent":["import { factoryProposalAttentionIdentity } from '../storage/domains/work-items/base.js';\nimport type { FactoryDeferredDecisionRecord } from '../storage/domains/work-items/base.js';\nimport type { DecisionAttentionSpec } from './attention-providers.js';\nimport { factoryDecisionType } from './attention-providers.js';\n\nfunction proposedAction(decision: FactoryDeferredDecisionRecord): string {\n const { type, stage, role } = decision.decision;\n if (type === 'transition' && typeof stage === 'string') return `move to ${stage.slice(0, 64)}`;\n return `run ${typeof role === 'string' ? role.slice(0, 64) : 'automation'}`;\n}\n\nexport const proposedDecisionAttentionSpec: DecisionAttentionSpec = {\n kind: 'automation-proposed',\n status: 'proposed',\n identity: decision => factoryProposalAttentionIdentity(decision.id),\n occurredAt: decision => decision.updatedAt,\n title: (decision, item) => item?.title ?? `Waiting for approval to ${proposedAction(decision)}`,\n detail: decision => `Waiting for approval to ${proposedAction(decision)}`,\n matches: (decision, item, search) =>\n item?.title.toLowerCase().includes(search) === true ||\n proposedAction(decision).toLowerCase().includes(search) ||\n factoryDecisionType(decision).toLowerCase().includes(search),\n};\n"],"mappings":";;;AAKA,SAAS,eAAe,UAAiD;CACvE,MAAM,EAAE,MAAM,OAAO,SAAS,SAAS;CACvC,IAAI,SAAS,gBAAgB,OAAO,UAAU,UAAU,OAAO,WAAW,MAAM,MAAM,GAAG,EAAE;CAC3F,OAAO,OAAO,OAAO,SAAS,WAAW,KAAK,MAAM,GAAG,EAAE,IAAI;AAC/D;AAEA,MAAa,gCAAuD;CAClE,MAAM;CACN,QAAQ;CACR,WAAU,aAAY,iCAAiC,SAAS,EAAE;CAClE,aAAY,aAAY,SAAS;CACjC,QAAQ,UAAU,SAAS,MAAM,SAAS,2BAA2B,eAAe,QAAQ;CAC5F,SAAQ,aAAY,2BAA2B,eAAe,QAAQ;CACtE,UAAU,UAAU,MAAM,WACxB,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,MAAM,QAC/C,eAAe,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,MAAM,KACtD,oBAAoB,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,MAAM;AAC/D"}
@@ -0,0 +1,159 @@
1
+ import type { BoardRegistry } from '../boards/index.js';
2
+ import type { WorkItemCommentsStorage } from '../storage/domains/comments/base.js';
3
+ import type { FactoryAttentionIdentity, FactoryAttentionKind, FactoryAttentionReceiptRecord, FactoryDeferredDecisionRecord, FactoryDispatchStatus, WorkItemRow, WorkItemsStorage } from '../storage/domains/work-items/base.js';
4
+ export type FactoryAttentionView = 'open' | 'unread' | 'archived';
5
+ export interface AttentionScope {
6
+ orgId: string;
7
+ userId: string;
8
+ factoryProjectId: string;
9
+ }
10
+ export interface AttentionStreamPosition {
11
+ occurredAt: Date;
12
+ id: string;
13
+ }
14
+ export interface AttentionEntry {
15
+ occurredAt: Date;
16
+ /** Position resuming the provider's stream right after this entry. */
17
+ resumeCursor: AttentionStreamPosition;
18
+ item: Record<string, unknown>;
19
+ }
20
+ export interface AttentionPageArgs {
21
+ view: FactoryAttentionView;
22
+ search?: string;
23
+ before?: AttentionStreamPosition;
24
+ limit: number;
25
+ }
26
+ export interface AttentionPageResult {
27
+ entries: AttentionEntry[];
28
+ /** More rows behind the scan once every returned entry is consumed. */
29
+ hasMore: boolean;
30
+ /** Resume point for a scan-budget stop past the last returned entry. */
31
+ continuation?: AttentionStreamPosition;
32
+ }
33
+ export interface AttentionCounts {
34
+ open: number;
35
+ unread: number;
36
+ }
37
+ export interface AttentionLatest {
38
+ key: string;
39
+ at: Date;
40
+ unread: boolean;
41
+ }
42
+ export interface AttentionProvider {
43
+ kind: FactoryAttentionKind;
44
+ counts(scope: AttentionScope): Promise<AttentionCounts>;
45
+ latest(scope: AttentionScope): Promise<AttentionLatest | null>;
46
+ page(scope: AttentionScope, args: AttentionPageArgs): Promise<AttentionPageResult>;
47
+ markAllRead(scope: AttentionScope, args: {
48
+ before?: AttentionStreamPosition;
49
+ now: Date;
50
+ }): Promise<{
51
+ hasMore: boolean;
52
+ continuation?: AttentionStreamPosition;
53
+ }>;
54
+ }
55
+ export declare const SCAN_PAGE_SIZE = 50;
56
+ interface ScanBatch<T> {
57
+ rows: T[];
58
+ /** Set only when the page budget stopped a scan that still had rows behind it. */
59
+ continuation?: AttentionStreamPosition;
60
+ }
61
+ /**
62
+ * One bounded keyset scan, shared by every provider read. Walks newest-first
63
+ * from `before` until the stream runs dry or the page budget is spent; the
64
+ * final batch of a budget stop carries the position to resume from.
65
+ */
66
+ export declare function scanBatches<T>(fetchBatch: (before?: AttentionStreamPosition) => Promise<{
67
+ rows: T[];
68
+ hasMore: boolean;
69
+ }>, positionOf: (row: T) => AttentionStreamPosition, before?: AttentionStreamPosition): AsyncGenerator<ScanBatch<T>>;
70
+ /** Fills a page from the scan, stopping at `limit` entries or at the scan budget. */
71
+ export declare function collectPage<T>(batches: AsyncGenerator<ScanBatch<T>>, limit: number, toEntries: (rows: T[]) => Promise<AttentionEntry[]>): Promise<AttentionPageResult>;
72
+ /** Marks every scanned batch read, reporting where a budget stop left off. */
73
+ export declare function markScanRead<T>(batches: AsyncGenerator<ScanBatch<T>>, markBatch: (rows: T[]) => Promise<void>): Promise<{
74
+ hasMore: boolean;
75
+ continuation?: AttentionStreamPosition;
76
+ }>;
77
+ export declare function factoryDecisionType(decision: FactoryDeferredDecisionRecord): string;
78
+ export declare function matchesView(view: FactoryAttentionView, receipt: FactoryAttentionReceiptRecord | undefined): boolean;
79
+ export declare function workItemBoard(item: WorkItemRow): 'review' | 'work';
80
+ /** One deferred-decision status seen as attention: failures and parked runs differ only by this. */
81
+ export interface DecisionAttentionSpec {
82
+ kind: FactoryAttentionKind;
83
+ status: FactoryDispatchStatus;
84
+ identity(decision: FactoryDeferredDecisionRecord): FactoryAttentionIdentity;
85
+ occurredAt(decision: FactoryDeferredDecisionRecord): Date;
86
+ title(decision: FactoryDeferredDecisionRecord, item: WorkItemRow | undefined): string;
87
+ detail(decision: FactoryDeferredDecisionRecord, item: WorkItemRow | undefined): string;
88
+ extra?(decision: FactoryDeferredDecisionRecord, context: {
89
+ overtaken: boolean;
90
+ }): Record<string, unknown>;
91
+ matches(decision: FactoryDeferredDecisionRecord, item: WorkItemRow | undefined, search: string): boolean;
92
+ }
93
+ export declare class DecisionAttentionProvider implements AttentionProvider {
94
+ #private;
95
+ readonly kind: FactoryAttentionKind;
96
+ constructor({ workItems, boards }: {
97
+ workItems: WorkItemsStorage;
98
+ boards: BoardRegistry;
99
+ }, spec: DecisionAttentionSpec);
100
+ counts(scope: AttentionScope): Promise<AttentionCounts>;
101
+ latest(scope: AttentionScope): Promise<AttentionLatest | null>;
102
+ page(scope: AttentionScope, { view, search, before, limit }: AttentionPageArgs): Promise<AttentionPageResult>;
103
+ markAllRead(scope: AttentionScope, { before, now }: {
104
+ before?: AttentionStreamPosition;
105
+ now: Date;
106
+ }): Promise<{
107
+ hasMore: boolean;
108
+ continuation?: AttentionStreamPosition;
109
+ }>;
110
+ }
111
+ export declare const failedDecisionAttentionSpec: DecisionAttentionSpec;
112
+ export declare class SupervisorFindingAttentionProvider implements AttentionProvider {
113
+ #private;
114
+ readonly kind: "supervisor-finding";
115
+ constructor({ workItems }: {
116
+ workItems: WorkItemsStorage;
117
+ });
118
+ counts(scope: AttentionScope): Promise<AttentionCounts>;
119
+ latest(scope: AttentionScope): Promise<AttentionLatest | null>;
120
+ page(scope: AttentionScope, args: AttentionPageArgs): Promise<AttentionPageResult>;
121
+ markAllRead(scope: AttentionScope, args: {
122
+ before?: AttentionStreamPosition;
123
+ now: Date;
124
+ }): Promise<{
125
+ hasMore: boolean;
126
+ continuation?: AttentionStreamPosition;
127
+ }>;
128
+ }
129
+ export declare class MentionAttentionProvider implements AttentionProvider {
130
+ #private;
131
+ readonly kind: "mention";
132
+ constructor({ workItems, comments }: {
133
+ workItems: WorkItemsStorage;
134
+ comments: WorkItemCommentsStorage;
135
+ });
136
+ /**
137
+ * Derived from the same bounded scan as `page`, never from raw aggregates:
138
+ * the badge must count exactly what the views can show, down to stopping at
139
+ * the same scan budget. Aggregates would count orphan mention rows the list
140
+ * can never display or clear.
141
+ */
142
+ counts(scope: AttentionScope): Promise<AttentionCounts>;
143
+ latest(scope: AttentionScope): Promise<AttentionLatest | null>;
144
+ page(scope: AttentionScope, { view, search, before, limit }: AttentionPageArgs): Promise<AttentionPageResult>;
145
+ markAllRead(scope: AttentionScope, { before, now }: {
146
+ before?: AttentionStreamPosition;
147
+ now: Date;
148
+ }): Promise<{
149
+ hasMore: boolean;
150
+ continuation?: AttentionStreamPosition;
151
+ }>;
152
+ }
153
+ export declare function receiptScope(scope: AttentionScope): {
154
+ orgId: string;
155
+ factoryProjectId: string;
156
+ userId: string;
157
+ };
158
+ export {};
159
+ //# sourceMappingURL=attention-providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attention-providers.d.ts","sourceRoot":"","sources":["../../src/routes/attention-providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AASxD,OAAO,KAAK,EAEV,uBAAuB,EAExB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACpB,6BAA6B,EAC7B,6BAA6B,EAC7B,qBAAqB,EAErB,WAAW,EACX,gBAAgB,EACjB,MAAM,uCAAuC,CAAC;AAS/C,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAElE,MAAM,WAAW,cAAc;IAC7B,K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