@mastra/factory 0.28.0 → 0.29.0-alpha.1

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 (407) hide show
  1. package/README.md +26 -8
  2. package/dist/board-changes.d.ts +16 -0
  3. package/dist/board-changes.d.ts.map +1 -0
  4. package/dist/board-changes.js +40 -0
  5. package/dist/board-changes.js.map +1 -0
  6. package/dist/boards/index.js +2 -1
  7. package/dist/boards/reroute.d.ts +31 -0
  8. package/dist/boards/reroute.d.ts.map +1 -0
  9. package/dist/boards/reroute.js +71 -0
  10. package/dist/boards/reroute.js.map +1 -0
  11. package/dist/boards/semantics.d.ts +1 -3
  12. package/dist/boards/semantics.d.ts.map +1 -1
  13. package/dist/boards/semantics.js +1 -5
  14. package/dist/boards/semantics.js.map +1 -1
  15. package/dist/environment/repository-access.d.ts +2 -0
  16. package/dist/environment/repository-access.d.ts.map +1 -1
  17. package/dist/environment/repository-access.js +9 -4
  18. package/dist/environment/repository-access.js.map +1 -1
  19. package/dist/factory.d.ts +4 -0
  20. package/dist/factory.d.ts.map +1 -1
  21. package/dist/factory.js +60 -9
  22. package/dist/factory.js.map +1 -1
  23. package/dist/integrations/base.d.ts +17 -0
  24. package/dist/integrations/base.d.ts.map +1 -1
  25. package/dist/integrations/dependabot/default-rules.d.ts +38 -0
  26. package/dist/integrations/dependabot/default-rules.d.ts.map +1 -0
  27. package/dist/integrations/dependabot/default-rules.js +63 -0
  28. package/dist/integrations/dependabot/default-rules.js.map +1 -0
  29. package/dist/integrations/dependabot/rules.d.ts +42 -0
  30. package/dist/integrations/dependabot/rules.d.ts.map +1 -0
  31. package/dist/integrations/dependabot/rules.js +187 -0
  32. package/dist/integrations/dependabot/rules.js.map +1 -0
  33. package/dist/integrations/dependabot/sync.d.ts +76 -0
  34. package/dist/integrations/dependabot/sync.d.ts.map +1 -0
  35. package/dist/integrations/dependabot/sync.js +111 -0
  36. package/dist/integrations/dependabot/sync.js.map +1 -0
  37. package/dist/integrations/github/pull-request-source.js +2 -1
  38. package/dist/integrations/github/pull-request-source.js.map +1 -1
  39. package/dist/integrations/github/reconcile-worker.js +1 -1
  40. package/dist/integrations/github/reconcile-worker.js.map +1 -1
  41. package/dist/integrations/github/routes.d.ts.map +1 -1
  42. package/dist/integrations/github/routes.js +7 -2
  43. package/dist/integrations/github/routes.js.map +1 -1
  44. package/dist/integrations/github/rules.d.ts +5 -2
  45. package/dist/integrations/github/rules.d.ts.map +1 -1
  46. package/dist/integrations/github/rules.js +16 -13
  47. package/dist/integrations/github/rules.js.map +1 -1
  48. package/dist/integrations/github/sandbox.d.ts +12 -0
  49. package/dist/integrations/github/sandbox.d.ts.map +1 -1
  50. package/dist/integrations/github/sandbox.js +24 -3
  51. package/dist/integrations/github/sandbox.js.map +1 -1
  52. package/dist/integrations/gitlab/default-rules.js +2 -1
  53. package/dist/integrations/gitlab/default-rules.js.map +1 -1
  54. package/dist/integrations/gitlab/discovery.d.ts +16 -0
  55. package/dist/integrations/gitlab/discovery.d.ts.map +1 -0
  56. package/dist/integrations/gitlab/discovery.js +107 -0
  57. package/dist/integrations/gitlab/discovery.js.map +1 -0
  58. package/dist/integrations/gitlab/integration.d.ts.map +1 -1
  59. package/dist/integrations/gitlab/integration.js +1 -2
  60. package/dist/integrations/gitlab/integration.js.map +1 -1
  61. package/dist/integrations/gitlab/issue-reconciler.d.ts.map +1 -1
  62. package/dist/integrations/gitlab/issue-reconciler.js +1 -0
  63. package/dist/integrations/gitlab/issue-reconciler.js.map +1 -1
  64. package/dist/integrations/gitlab/merge-request-reconciler.d.ts.map +1 -1
  65. package/dist/integrations/gitlab/merge-request-reconciler.js +26 -10
  66. package/dist/integrations/gitlab/merge-request-reconciler.js.map +1 -1
  67. package/dist/integrations/gitlab/reconciler.d.ts.map +1 -1
  68. package/dist/integrations/gitlab/reconciler.js +4 -2
  69. package/dist/integrations/gitlab/reconciler.js.map +1 -1
  70. package/dist/integrations/gitlab/reconciliation-config.d.ts +0 -1
  71. package/dist/integrations/gitlab/reconciliation-config.d.ts.map +1 -1
  72. package/dist/integrations/gitlab/reconciliation-config.js +2 -8
  73. package/dist/integrations/gitlab/reconciliation-config.js.map +1 -1
  74. package/dist/integrations/gitlab/routes.d.ts +17 -0
  75. package/dist/integrations/gitlab/routes.d.ts.map +1 -1
  76. package/dist/integrations/gitlab/routes.js +28 -22
  77. package/dist/integrations/gitlab/routes.js.map +1 -1
  78. package/dist/integrations/gitlab/rules.d.ts +10 -4
  79. package/dist/integrations/gitlab/rules.d.ts.map +1 -1
  80. package/dist/integrations/gitlab/rules.js +32 -8
  81. package/dist/integrations/gitlab/rules.js.map +1 -1
  82. package/dist/integrations/incidentio/integration.d.ts +2 -1
  83. package/dist/integrations/incidentio/integration.d.ts.map +1 -1
  84. package/dist/integrations/incidentio/integration.js +7 -7
  85. package/dist/integrations/incidentio/integration.js.map +1 -1
  86. package/dist/integrations/incidentio/issue-reconciler.d.ts +7 -0
  87. package/dist/integrations/incidentio/issue-reconciler.d.ts.map +1 -1
  88. package/dist/integrations/incidentio/issue-reconciler.js +36 -1
  89. package/dist/integrations/incidentio/issue-reconciler.js.map +1 -1
  90. package/dist/integrations/incidentio/reconciliation-config.d.ts +0 -1
  91. package/dist/integrations/incidentio/reconciliation-config.d.ts.map +1 -1
  92. package/dist/integrations/incidentio/reconciliation-config.js +2 -5
  93. package/dist/integrations/incidentio/reconciliation-config.js.map +1 -1
  94. package/dist/integrations/incidentio/routes.d.ts +24 -8
  95. package/dist/integrations/incidentio/routes.d.ts.map +1 -1
  96. package/dist/integrations/incidentio/routes.js +33 -35
  97. package/dist/integrations/incidentio/routes.js.map +1 -1
  98. package/dist/integrations/incidentio/rules.d.ts +0 -4
  99. package/dist/integrations/incidentio/rules.d.ts.map +1 -1
  100. package/dist/integrations/incidentio/rules.js +17 -14
  101. package/dist/integrations/incidentio/rules.js.map +1 -1
  102. package/dist/integrations/intake-discovery.d.ts +44 -0
  103. package/dist/integrations/intake-discovery.d.ts.map +1 -0
  104. package/dist/integrations/intake-discovery.js +60 -0
  105. package/dist/integrations/intake-discovery.js.map +1 -0
  106. package/dist/integrations/issue-reconcile-worker.js +1 -1
  107. package/dist/integrations/issue-reconcile-worker.js.map +1 -1
  108. package/dist/integrations/issue-reconciler.d.ts +7 -0
  109. package/dist/integrations/issue-reconciler.d.ts.map +1 -1
  110. package/dist/integrations/issue-reconciler.js +47 -12
  111. package/dist/integrations/issue-reconciler.js.map +1 -1
  112. package/dist/integrations/jira/integration.d.ts +3 -2
  113. package/dist/integrations/jira/integration.d.ts.map +1 -1
  114. package/dist/integrations/jira/integration.js +5 -7
  115. package/dist/integrations/jira/integration.js.map +1 -1
  116. package/dist/integrations/jira/issue-reconciler.d.ts +17 -1
  117. package/dist/integrations/jira/issue-reconciler.d.ts.map +1 -1
  118. package/dist/integrations/jira/issue-reconciler.js +34 -1
  119. package/dist/integrations/jira/issue-reconciler.js.map +1 -1
  120. package/dist/integrations/jira/reconciliation-config.d.ts +0 -1
  121. package/dist/integrations/jira/reconciliation-config.d.ts.map +1 -1
  122. package/dist/integrations/jira/reconciliation-config.js +2 -5
  123. package/dist/integrations/jira/reconciliation-config.js.map +1 -1
  124. package/dist/integrations/jira/routes.d.ts +0 -7
  125. package/dist/integrations/jira/routes.d.ts.map +1 -1
  126. package/dist/integrations/jira/routes.js +2 -12
  127. package/dist/integrations/jira/routes.js.map +1 -1
  128. package/dist/integrations/jira/rules.d.ts +0 -4
  129. package/dist/integrations/jira/rules.d.ts.map +1 -1
  130. package/dist/integrations/jira/rules.js +3 -13
  131. package/dist/integrations/jira/rules.js.map +1 -1
  132. package/dist/integrations/kept-cards.d.ts +49 -0
  133. package/dist/integrations/kept-cards.d.ts.map +1 -0
  134. package/dist/integrations/kept-cards.js +97 -0
  135. package/dist/integrations/kept-cards.js.map +1 -0
  136. package/dist/integrations/linear/intake-discovery.d.ts +34 -0
  137. package/dist/integrations/linear/intake-discovery.d.ts.map +1 -0
  138. package/dist/integrations/linear/intake-discovery.js +112 -0
  139. package/dist/integrations/linear/intake-discovery.js.map +1 -0
  140. package/dist/integrations/linear/integration.d.ts.map +1 -1
  141. package/dist/integrations/linear/integration.js +1 -4
  142. package/dist/integrations/linear/integration.js.map +1 -1
  143. package/dist/integrations/linear/issue-reconciler.d.ts +13 -4
  144. package/dist/integrations/linear/issue-reconciler.d.ts.map +1 -1
  145. package/dist/integrations/linear/issue-reconciler.js +24 -20
  146. package/dist/integrations/linear/issue-reconciler.js.map +1 -1
  147. package/dist/integrations/linear/reconciliation-config.d.ts +0 -1
  148. package/dist/integrations/linear/reconciliation-config.d.ts.map +1 -1
  149. package/dist/integrations/linear/reconciliation-config.js +2 -8
  150. package/dist/integrations/linear/reconciliation-config.js.map +1 -1
  151. package/dist/integrations/linear/routes.d.ts +0 -2
  152. package/dist/integrations/linear/routes.d.ts.map +1 -1
  153. package/dist/integrations/linear/routes.js +3 -9
  154. package/dist/integrations/linear/routes.js.map +1 -1
  155. package/dist/integrations/platform/api-client.d.ts +2 -0
  156. package/dist/integrations/platform/api-client.d.ts.map +1 -1
  157. package/dist/integrations/platform/api-client.js +6 -1
  158. package/dist/integrations/platform/api-client.js.map +1 -1
  159. package/dist/integrations/platform/connect/routes.d.ts.map +1 -1
  160. package/dist/integrations/platform/connect/routes.js +8 -1
  161. package/dist/integrations/platform/connect/routes.js.map +1 -1
  162. package/dist/integrations/platform/github/event-worker.d.ts +17 -0
  163. package/dist/integrations/platform/github/event-worker.d.ts.map +1 -1
  164. package/dist/integrations/platform/github/event-worker.js +89 -7
  165. package/dist/integrations/platform/github/event-worker.js.map +1 -1
  166. package/dist/integrations/platform/github/integration.d.ts +20 -1
  167. package/dist/integrations/platform/github/integration.d.ts.map +1 -1
  168. package/dist/integrations/platform/github/integration.js +54 -3
  169. package/dist/integrations/platform/github/integration.js.map +1 -1
  170. package/dist/integrations/platform/gitlab/event-worker.js +1 -1
  171. package/dist/integrations/platform/gitlab/event-worker.js.map +1 -1
  172. package/dist/integrations/platform/incidentio/integration.d.ts +3 -2
  173. package/dist/integrations/platform/incidentio/integration.d.ts.map +1 -1
  174. package/dist/integrations/platform/incidentio/integration.js +7 -7
  175. package/dist/integrations/platform/incidentio/integration.js.map +1 -1
  176. package/dist/integrations/platform/jira/integration.d.ts.map +1 -1
  177. package/dist/integrations/platform/jira/integration.js +4 -7
  178. package/dist/integrations/platform/jira/integration.js.map +1 -1
  179. package/dist/integrations/platform/jira/routes.d.ts +0 -7
  180. package/dist/integrations/platform/jira/routes.d.ts.map +1 -1
  181. package/dist/integrations/platform/jira/routes.js +2 -12
  182. package/dist/integrations/platform/jira/routes.js.map +1 -1
  183. package/dist/integrations/platform/linear/event-worker.d.ts +2 -2
  184. package/dist/integrations/platform/linear/event-worker.d.ts.map +1 -1
  185. package/dist/integrations/platform/linear/event-worker.js +1 -1
  186. package/dist/integrations/platform/linear/event-worker.js.map +1 -1
  187. package/dist/integrations/platform/linear/integration.d.ts +1 -0
  188. package/dist/integrations/platform/linear/integration.d.ts.map +1 -1
  189. package/dist/integrations/platform/linear/integration.js +7 -7
  190. package/dist/integrations/platform/linear/integration.js.map +1 -1
  191. package/dist/integrations/platform/vanta/integration.d.ts +38 -0
  192. package/dist/integrations/platform/vanta/integration.d.ts.map +1 -0
  193. package/dist/integrations/platform/vanta/integration.js +149 -0
  194. package/dist/integrations/platform/vanta/integration.js.map +1 -0
  195. package/dist/integrations/reconciliation-config.d.ts +0 -1
  196. package/dist/integrations/reconciliation-config.d.ts.map +1 -1
  197. package/dist/integrations/reconciliation-config.js +1 -8
  198. package/dist/integrations/reconciliation-config.js.map +1 -1
  199. package/dist/integrations/slack/channel-reply-processor.js +1 -1
  200. package/dist/integrations/slack/channel-reply-processor.js.map +1 -1
  201. package/dist/integrations/startup-summary.d.ts +8 -0
  202. package/dist/integrations/startup-summary.d.ts.map +1 -0
  203. package/dist/integrations/startup-summary.js +36 -0
  204. package/dist/integrations/startup-summary.js.map +1 -0
  205. package/dist/integrations/vanta/default-rules.d.ts +34 -0
  206. package/dist/integrations/vanta/default-rules.d.ts.map +1 -0
  207. package/dist/integrations/vanta/default-rules.js +61 -0
  208. package/dist/integrations/vanta/default-rules.js.map +1 -0
  209. package/dist/integrations/vanta/rules.d.ts +40 -0
  210. package/dist/integrations/vanta/rules.d.ts.map +1 -0
  211. package/dist/integrations/vanta/rules.js +208 -0
  212. package/dist/integrations/vanta/rules.js.map +1 -0
  213. package/dist/integrations/vanta/sync.d.ts +40 -0
  214. package/dist/integrations/vanta/sync.d.ts.map +1 -0
  215. package/dist/integrations/vanta/sync.js +81 -0
  216. package/dist/integrations/vanta/sync.js.map +1 -0
  217. package/dist/linked-repositories-changed.d.ts +14 -0
  218. package/dist/linked-repositories-changed.d.ts.map +1 -0
  219. package/dist/linked-repositories-changed.js +48 -0
  220. package/dist/linked-repositories-changed.js.map +1 -0
  221. package/dist/mcp/routes.d.ts.map +1 -1
  222. package/dist/mcp/routes.js +1 -1
  223. package/dist/mcp/routes.js.map +1 -1
  224. package/dist/routes/board-snapshot.d.ts +8 -1
  225. package/dist/routes/board-snapshot.d.ts.map +1 -1
  226. package/dist/routes/board-snapshot.js +23 -2
  227. package/dist/routes/board-snapshot.js.map +1 -1
  228. package/dist/routes/contracts.d.ts +322 -0
  229. package/dist/routes/contracts.d.ts.map +1 -1
  230. package/dist/routes/contracts.js +202 -5
  231. package/dist/routes/contracts.js.map +1 -1
  232. package/dist/routes/intake-routes.d.ts +3 -0
  233. package/dist/routes/intake-routes.d.ts.map +1 -1
  234. package/dist/routes/intake-routes.js +44 -0
  235. package/dist/routes/intake-routes.js.map +1 -1
  236. package/dist/routes/knowledge.d.ts.map +1 -1
  237. package/dist/routes/knowledge.js +3 -2
  238. package/dist/routes/knowledge.js.map +1 -1
  239. package/dist/routes/run-queue.d.ts +17 -0
  240. package/dist/routes/run-queue.d.ts.map +1 -0
  241. package/dist/routes/run-queue.js +69 -0
  242. package/dist/routes/run-queue.js.map +1 -0
  243. package/dist/routes/source-control-sessions.d.ts +1 -1
  244. package/dist/routes/source-control-sessions.d.ts.map +1 -1
  245. package/dist/routes/source-control-sessions.js +109 -3
  246. package/dist/routes/source-control-sessions.js.map +1 -1
  247. package/dist/routes/surface.d.ts +14 -1
  248. package/dist/routes/surface.d.ts.map +1 -1
  249. package/dist/routes/surface.js +76 -11
  250. package/dist/routes/surface.js.map +1 -1
  251. package/dist/routes/work-item-selection.d.ts +4 -5
  252. package/dist/routes/work-item-selection.d.ts.map +1 -1
  253. package/dist/routes/work-item-selection.js +11 -23
  254. package/dist/routes/work-item-selection.js.map +1 -1
  255. package/dist/routes/work-item-starters.d.ts.map +1 -1
  256. package/dist/routes/work-item-starters.js +4 -21
  257. package/dist/routes/work-item-starters.js.map +1 -1
  258. package/dist/routes/work-items.d.ts +5 -0
  259. package/dist/routes/work-items.d.ts.map +1 -1
  260. package/dist/routes/work-items.js +129 -36
  261. package/dist/routes/work-items.js.map +1 -1
  262. package/dist/rules/dispatch-errors.d.ts +3 -0
  263. package/dist/rules/dispatch-errors.d.ts.map +1 -1
  264. package/dist/rules/dispatch-errors.js +5 -0
  265. package/dist/rules/dispatch-errors.js.map +1 -1
  266. package/dist/rules/dispatcher.d.ts +15 -1
  267. package/dist/rules/dispatcher.d.ts.map +1 -1
  268. package/dist/rules/dispatcher.js +48 -20
  269. package/dist/rules/dispatcher.js.map +1 -1
  270. package/dist/rules/index.d.ts +2 -2
  271. package/dist/rules/index.d.ts.map +1 -1
  272. package/dist/rules/index.js +2 -2
  273. package/dist/rules/review-source-tool.js +2 -1
  274. package/dist/rules/review-source-tool.js.map +1 -1
  275. package/dist/rules/start-coordinator.d.ts +6 -1
  276. package/dist/rules/start-coordinator.d.ts.map +1 -1
  277. package/dist/rules/start-coordinator.js +6 -2
  278. package/dist/rules/start-coordinator.js.map +1 -1
  279. package/dist/rules/transition-service.d.ts.map +1 -1
  280. package/dist/rules/transition-service.js +3 -2
  281. package/dist/rules/transition-service.js.map +1 -1
  282. package/dist/rules/types.d.ts +71 -3
  283. package/dist/rules/types.d.ts.map +1 -1
  284. package/dist/rules/types.js +10 -2
  285. package/dist/rules/types.js.map +1 -1
  286. package/dist/rules/validation.d.ts.map +1 -1
  287. package/dist/rules/validation.js +5 -0
  288. package/dist/rules/validation.js.map +1 -1
  289. package/dist/session/factory-session.d.ts +20 -5
  290. package/dist/session/factory-session.d.ts.map +1 -1
  291. package/dist/session/factory-session.js +20 -6
  292. package/dist/session/factory-session.js.map +1 -1
  293. package/dist/storage/domains/audit/actions.d.ts +1 -1
  294. package/dist/storage/domains/audit/actions.d.ts.map +1 -1
  295. package/dist/storage/domains/audit/actions.js +2 -1
  296. package/dist/storage/domains/audit/actions.js.map +1 -1
  297. package/dist/storage/domains/audit/actors.d.ts.map +1 -1
  298. package/dist/storage/domains/audit/actors.js +1 -1
  299. package/dist/storage/domains/audit/actors.js.map +1 -1
  300. package/dist/storage/domains/intake/base.d.ts +1 -1
  301. package/dist/storage/domains/intake/base.js +2 -2
  302. package/dist/storage/domains/intake/base.js.map +1 -1
  303. package/dist/storage/domains/projects/base.d.ts +10 -0
  304. package/dist/storage/domains/projects/base.d.ts.map +1 -1
  305. package/dist/storage/domains/projects/base.js +24 -2
  306. package/dist/storage/domains/projects/base.js.map +1 -1
  307. package/dist/storage/domains/source-control/base.d.ts +32 -0
  308. package/dist/storage/domains/source-control/base.d.ts.map +1 -1
  309. package/dist/storage/domains/source-control/base.js +54 -4
  310. package/dist/storage/domains/source-control/base.js.map +1 -1
  311. package/dist/storage/domains/source-control/inmemory.d.ts +3 -0
  312. package/dist/storage/domains/source-control/inmemory.d.ts.map +1 -1
  313. package/dist/storage/domains/source-control/inmemory.js +17 -0
  314. package/dist/storage/domains/source-control/inmemory.js.map +1 -1
  315. package/dist/storage/domains/work-items/base.d.ts +16 -4
  316. package/dist/storage/domains/work-items/base.d.ts.map +1 -1
  317. package/dist/storage/domains/work-items/base.js +28 -1
  318. package/dist/storage/domains/work-items/base.js.map +1 -1
  319. package/dist/timing.d.ts +8 -1
  320. package/dist/timing.d.ts.map +1 -1
  321. package/dist/timing.js +10 -2
  322. package/dist/timing.js.map +1 -1
  323. package/dist/tools/approval-tools.d.ts +20 -0
  324. package/dist/tools/approval-tools.d.ts.map +1 -1
  325. package/dist/tools/approval-tools.js +79 -30
  326. package/dist/tools/approval-tools.js.map +1 -1
  327. package/dist/tools/audit-events-tool.d.ts +1 -1
  328. package/dist/tools/messaging-tools.d.ts.map +1 -1
  329. package/dist/tools/messaging-tools.js +1 -1
  330. package/dist/tools/messaging-tools.js.map +1 -1
  331. package/dist/tools/read-tools.d.ts +0 -2
  332. package/dist/tools/read-tools.d.ts.map +1 -1
  333. package/dist/tools/read-tools.js +2 -7
  334. package/dist/tools/read-tools.js.map +1 -1
  335. package/dist/tools/reports.d.ts +3 -0
  336. package/dist/tools/reports.d.ts.map +1 -1
  337. package/dist/tools/reports.js +3 -3
  338. package/dist/tools/reports.js.map +1 -1
  339. package/dist/tools/run-watch.d.ts +14 -2
  340. package/dist/tools/run-watch.d.ts.map +1 -1
  341. package/dist/tools/run-watch.js +24 -4
  342. package/dist/tools/run-watch.js.map +1 -1
  343. package/dist/tools/session-tools.d.ts.map +1 -1
  344. package/dist/tools/session-tools.js +17 -6
  345. package/dist/tools/session-tools.js.map +1 -1
  346. package/dist/tools/side-sessions.d.ts.map +1 -1
  347. package/dist/tools/side-sessions.js +1 -1
  348. package/dist/tools/side-sessions.js.map +1 -1
  349. package/dist/tools/work-item-tools.d.ts.map +1 -1
  350. package/dist/tools/work-item-tools.js +12 -2
  351. package/dist/tools/work-item-tools.js.map +1 -1
  352. package/dist/work-item-branch.d.ts +1 -1
  353. package/dist/work-item-branch.d.ts.map +1 -1
  354. package/dist/work-item-branch.js +2 -0
  355. package/dist/work-item-branch.js.map +1 -1
  356. package/dist/work-items/board-filter-options.d.ts +5 -0
  357. package/dist/work-items/board-filter-options.d.ts.map +1 -0
  358. package/dist/work-items/board-filter-options.js +27 -0
  359. package/dist/work-items/board-filter-options.js.map +1 -0
  360. package/dist/work-items/board-phases.d.ts +28 -0
  361. package/dist/work-items/board-phases.d.ts.map +1 -0
  362. package/dist/work-items/board-phases.js +165 -0
  363. package/dist/work-items/board-phases.js.map +1 -0
  364. package/dist/work-items/card-facts.d.ts +24 -0
  365. package/dist/work-items/card-facts.d.ts.map +1 -0
  366. package/dist/work-items/card-facts.js +75 -0
  367. package/dist/work-items/card-facts.js.map +1 -0
  368. package/dist/work-items/card-labels.d.ts +5 -0
  369. package/dist/work-items/card-labels.d.ts.map +1 -0
  370. package/dist/work-items/card-labels.js +13 -0
  371. package/dist/work-items/card-labels.js.map +1 -0
  372. package/dist/work-items/card-number.d.ts +10 -0
  373. package/dist/work-items/card-number.d.ts.map +1 -0
  374. package/dist/work-items/card-number.js +15 -0
  375. package/dist/work-items/card-number.js.map +1 -0
  376. package/dist/work-items/card-people.d.ts +25 -0
  377. package/dist/work-items/card-people.d.ts.map +1 -0
  378. package/dist/work-items/card-people.js +100 -0
  379. package/dist/work-items/card-people.js.map +1 -0
  380. package/dist/work-items/card-search-text.d.ts +4 -0
  381. package/dist/work-items/card-search-text.d.ts.map +1 -0
  382. package/dist/work-items/card-search-text.js +15 -0
  383. package/dist/work-items/card-search-text.js.map +1 -0
  384. package/dist/work-items/card-source-filters.d.ts +23 -0
  385. package/dist/work-items/card-source-filters.d.ts.map +1 -0
  386. package/dist/work-items/card-source-filters.js +25 -0
  387. package/dist/work-items/card-source-filters.js.map +1 -0
  388. package/dist/work-items/create-work-item.d.ts +0 -6
  389. package/dist/work-items/create-work-item.d.ts.map +1 -1
  390. package/dist/work-items/create-work-item.js +2 -7
  391. package/dist/work-items/create-work-item.js.map +1 -1
  392. package/dist/work-items/list-related-cards.d.ts +4 -0
  393. package/dist/work-items/list-related-cards.d.ts.map +1 -0
  394. package/dist/work-items/list-related-cards.js +24 -0
  395. package/dist/work-items/list-related-cards.js.map +1 -0
  396. package/dist/work-items/search-words.d.ts +5 -0
  397. package/dist/work-items/search-words.d.ts.map +1 -0
  398. package/dist/work-items/search-words.js +12 -0
  399. package/dist/work-items/search-words.js.map +1 -0
  400. package/dist/work-items/source-external-id.d.ts +4 -0
  401. package/dist/work-items/source-external-id.d.ts.map +1 -0
  402. package/dist/work-items/source-external-id.js +9 -0
  403. package/dist/work-items/source-external-id.js.map +1 -0
  404. package/dist/workspace.d.ts.map +1 -1
  405. package/dist/workspace.js +92 -47
  406. package/dist/workspace.js.map +1 -1
  407. package/package.json +9 -8
@@ -7,6 +7,13 @@ const REPOSITORIES_PER_TOKEN = 10;
7
7
  * group would add requests exactly when there is no budget for them.
8
8
  */
9
9
  const GROUP_RETRY_AFTER_MS = 6e4;
10
+ /** Split repository ids into the groups one token each can name, keeping order and dropping repeats. */
11
+ function groupRepositoryIds(repositoryIds) {
12
+ const ids = [...new Set(repositoryIds)];
13
+ const groups = [];
14
+ for (let i = 0; i < ids.length; i += REPOSITORIES_PER_TOKEN) groups.push(ids.slice(i, i + REPOSITORIES_PER_TOKEN));
15
+ return groups;
16
+ }
10
17
  /**
11
18
  * Access to each of an environment's repositories, minted a group at a time.
12
19
  * Asking for one repository asks for its group of up to ten, so a provider
@@ -18,9 +25,7 @@ const GROUP_RETRY_AFTER_MS = 6e4;
18
25
  * repository's own token.
19
26
  */
20
27
  function groupedRepositoryAccess(versionControl, orgId, repositoryIds, now = Date.now) {
21
- const ids = [...new Set(repositoryIds)];
22
- const groups = [];
23
- for (let i = 0; i < ids.length; i += REPOSITORIES_PER_TOKEN) groups.push(ids.slice(i, i + REPOSITORIES_PER_TOKEN));
28
+ const groups = groupRepositoryIds(repositoryIds);
24
29
  const skipUntil = /* @__PURE__ */ new Map();
25
30
  const pending = /* @__PURE__ */ new Map();
26
31
  const groupAccess = (group, getRepositoriesAccess) => {
@@ -50,6 +55,6 @@ function groupedRepositoryAccess(versionControl, orgId, repositoryIds, now = Dat
50
55
  });
51
56
  };
52
57
  }
53
- export { groupedRepositoryAccess };
58
+ export { groupRepositoryIds, groupedRepositoryAccess };
54
59
 
55
60
  //# sourceMappingURL=repository-access.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"repository-access.js","names":[],"sources":["../../src/environment/repository-access.ts"],"sourcesContent":["import type { RepositoriesAccess, RepositoryAccess, VersionControl } from '../capabilities/version-control.js';\n\ntype GetRepositoriesAccess = NonNullable<VersionControl['getRepositoriesAccess']>;\n\n/** The most repositories one Platform GitHub token can name. */\nconst REPOSITORIES_PER_TOKEN = 10;\n/**\n * How long a group the provider refused or failed to mint is skipped. A failed\n * group mint is often a rate limit, so retrying it for every repository in the\n * group would add requests exactly when there is no budget for them.\n */\nconst GROUP_RETRY_AFTER_MS = 60_000;\n\n/**\n * Access to each of an environment's repositories, minted a group at a time.\n * Asking for one repository asks for its group of up to ten, so a provider\n * that can grant a group mints one token for it and serves every repository in\n * it from that token, instead of minting one per repository (eleven\n * repositories: two mints, not eleven). The group token stays with these\n * callers: a plain `getRepositoryAccess` elsewhere still gets a token for its\n * own repository only. A group the provider can't grant falls back to the\n * repository's own token.\n */\nexport function groupedRepositoryAccess(\n versionControl: Pick<VersionControl, 'getRepositoryAccess' | 'getRepositoriesAccess'>,\n orgId: string,\n repositoryIds: readonly string[],\n now: () => number = Date.now,\n): (repositoryId: string) => Promise<RepositoryAccess> {\n const ids = [...new Set(repositoryIds)];\n const groups: string[][] = [];\n for (let i = 0; i < ids.length; i += REPOSITORIES_PER_TOKEN) groups.push(ids.slice(i, i + REPOSITORIES_PER_TOKEN));\n const skipUntil = new Map<string[], number>();\n const pending = new Map<string[], Promise<RepositoriesAccess | undefined>>();\n const groupAccess = (group: string[], getRepositoriesAccess: GetRepositoriesAccess) => {\n let request = pending.get(group);\n if (!request) {\n // Best-effort: the repository's own token still works without it.\n request = getRepositoriesAccess({ orgId, repositoryIds: group })\n .catch(() => undefined)\n .then(access => {\n if (!access) skipUntil.set(group, now() + GROUP_RETRY_AFTER_MS);\n return access;\n })\n .finally(() => pending.delete(group));\n pending.set(group, request);\n }\n return request;\n };\n return async repositoryId => {\n const group = groups.find(candidate => candidate.includes(repositoryId));\n const getRepositoriesAccess = versionControl.getRepositoriesAccess?.bind(versionControl);\n if (group && group.length > 1 && getRepositoriesAccess && (skipUntil.get(group) ?? 0) <= now()) {\n // Parallel callers share one group request.\n const own = (await groupAccess(group, getRepositoriesAccess))?.repositories?.[repositoryId];\n if (own) return own;\n }\n return versionControl.getRepositoryAccess({ orgId, repositoryId });\n };\n}\n"],"mappings":";;AAKA,MAAM,yBAAyB;;;;;;AAM/B,MAAM,uBAAuB;;;;;;;;;;;AAY7B,SAAgB,wBACd,gBACA,OACA,eACA,MAAoB,KAAK,KAC4B;CACrD,MAAM,MAAM,CAAC,GAAG,IAAI,IAAI,aAAa,CAAC;CACtC,MAAM,SAAqB,CAAC;CAC5B,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK,wBAAwB,OAAO,KAAK,IAAI,MAAM,GAAG,IAAI,sBAAsB,CAAC;CACjH,MAAM,4BAAY,IAAI,IAAsB;CAC5C,MAAM,0BAAU,IAAI,IAAuD;CAC3E,MAAM,eAAe,OAAiB,0BAAiD;EACrF,IAAI,UAAU,QAAQ,IAAI,KAAK;EAC/B,IAAI,CAAC,SAAS;GAEZ,UAAU,sBAAsB;IAAE;IAAO,eAAe;GAAM,CAAC,CAAC,CAC7D,YAAY,KAAA,CAAS,CAAC,CACtB,MAAK,WAAU;IACd,IAAI,CAAC,QAAQ,UAAU,IAAI,OAAO,IAAI,IAAI,oBAAoB;IAC9D,OAAO;GACT,CAAC,CAAC,CACD,cAAc,QAAQ,OAAO,KAAK,CAAC;GACtC,QAAQ,IAAI,OAAO,OAAO;EAC5B;EACA,OAAO;CACT;CACA,OAAO,OAAM,iBAAgB;EAC3B,MAAM,QAAQ,OAAO,MAAK,cAAa,UAAU,SAAS,YAAY,CAAC;EACvE,MAAM,wBAAwB,eAAe,uBAAuB,KAAK,cAAc;EACvF,IAAI,SAAS,MAAM,SAAS,KAAK,0BAA0B,UAAU,IAAI,KAAK,KAAK,MAAM,IAAI,GAAG;GAE9F,MAAM,OAAO,MAAM,YAAY,OAAO,qBAAqB,EAAA,EAAI,eAAe;GAC9E,IAAI,KAAK,OAAO;EAClB;EACA,OAAO,eAAe,oBAAoB;GAAE;GAAO;EAAa,CAAC;CACnE;AACF"}
1
+ {"version":3,"file":"repository-access.js","names":[],"sources":["../../src/environment/repository-access.ts"],"sourcesContent":["import type { RepositoriesAccess, RepositoryAccess, VersionControl } from '../capabilities/version-control.js';\n\ntype GetRepositoriesAccess = NonNullable<VersionControl['getRepositoriesAccess']>;\n\n/** The most repositories one Platform GitHub token can name. */\nconst REPOSITORIES_PER_TOKEN = 10;\n/**\n * How long a group the provider refused or failed to mint is skipped. A failed\n * group mint is often a rate limit, so retrying it for every repository in the\n * group would add requests exactly when there is no budget for them.\n */\nconst GROUP_RETRY_AFTER_MS = 60_000;\n\n/** Split repository ids into the groups one token each can name, keeping order and dropping repeats. */\nexport function groupRepositoryIds(repositoryIds: readonly string[]): string[][] {\n const ids = [...new Set(repositoryIds)];\n const groups: string[][] = [];\n for (let i = 0; i < ids.length; i += REPOSITORIES_PER_TOKEN) groups.push(ids.slice(i, i + REPOSITORIES_PER_TOKEN));\n return groups;\n}\n\n/**\n * Access to each of an environment's repositories, minted a group at a time.\n * Asking for one repository asks for its group of up to ten, so a provider\n * that can grant a group mints one token for it and serves every repository in\n * it from that token, instead of minting one per repository (eleven\n * repositories: two mints, not eleven). The group token stays with these\n * callers: a plain `getRepositoryAccess` elsewhere still gets a token for its\n * own repository only. A group the provider can't grant falls back to the\n * repository's own token.\n */\nexport function groupedRepositoryAccess(\n versionControl: Pick<VersionControl, 'getRepositoryAccess' | 'getRepositoriesAccess'>,\n orgId: string,\n repositoryIds: readonly string[],\n now: () => number = Date.now,\n): (repositoryId: string) => Promise<RepositoryAccess> {\n const groups = groupRepositoryIds(repositoryIds);\n const skipUntil = new Map<string[], number>();\n const pending = new Map<string[], Promise<RepositoriesAccess | undefined>>();\n const groupAccess = (group: string[], getRepositoriesAccess: GetRepositoriesAccess) => {\n let request = pending.get(group);\n if (!request) {\n // Best-effort: the repository's own token still works without it.\n request = getRepositoriesAccess({ orgId, repositoryIds: group })\n .catch(() => undefined)\n .then(access => {\n if (!access) skipUntil.set(group, now() + GROUP_RETRY_AFTER_MS);\n return access;\n })\n .finally(() => pending.delete(group));\n pending.set(group, request);\n }\n return request;\n };\n return async repositoryId => {\n const group = groups.find(candidate => candidate.includes(repositoryId));\n const getRepositoriesAccess = versionControl.getRepositoriesAccess?.bind(versionControl);\n if (group && group.length > 1 && getRepositoriesAccess && (skipUntil.get(group) ?? 0) <= now()) {\n // Parallel callers share one group request.\n const own = (await groupAccess(group, getRepositoriesAccess))?.repositories?.[repositoryId];\n if (own) return own;\n }\n return versionControl.getRepositoryAccess({ orgId, repositoryId });\n };\n}\n"],"mappings":";;AAKA,MAAM,yBAAyB;;;;;;AAM/B,MAAM,uBAAuB;;AAG7B,SAAgB,mBAAmB,eAA8C;CAC/E,MAAM,MAAM,CAAC,GAAG,IAAI,IAAI,aAAa,CAAC;CACtC,MAAM,SAAqB,CAAC;CAC5B,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK,wBAAwB,OAAO,KAAK,IAAI,MAAM,GAAG,IAAI,sBAAsB,CAAC;CACjH,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,wBACd,gBACA,OACA,eACA,MAAoB,KAAK,KAC4B;CACrD,MAAM,SAAS,mBAAmB,aAAa;CAC/C,MAAM,4BAAY,IAAI,IAAsB;CAC5C,MAAM,0BAAU,IAAI,IAAuD;CAC3E,MAAM,eAAe,OAAiB,0BAAiD;EACrF,IAAI,UAAU,QAAQ,IAAI,KAAK;EAC/B,IAAI,CAAC,SAAS;GAEZ,UAAU,sBAAsB;IAAE;IAAO,eAAe;GAAM,CAAC,CAAC,CAC7D,YAAY,KAAA,CAAS,CAAC,CACtB,MAAK,WAAU;IACd,IAAI,CAAC,QAAQ,UAAU,IAAI,OAAO,IAAI,IAAI,oBAAoB;IAC9D,OAAO;GACT,CAAC,CAAC,CACD,cAAc,QAAQ,OAAO,KAAK,CAAC;GACtC,QAAQ,IAAI,OAAO,OAAO;EAC5B;EACA,OAAO;CACT;CACA,OAAO,OAAM,iBAAgB;EAC3B,MAAM,QAAQ,OAAO,MAAK,cAAa,UAAU,SAAS,YAAY,CAAC;EACvE,MAAM,wBAAwB,eAAe,uBAAuB,KAAK,cAAc;EACvF,IAAI,SAAS,MAAM,SAAS,KAAK,0BAA0B,UAAU,IAAI,KAAK,KAAK,MAAM,IAAI,GAAG;GAE9F,MAAM,OAAO,MAAM,YAAY,OAAO,qBAAqB,EAAA,EAAI,eAAe;GAC9E,IAAI,KAAK,OAAO;EAClB;EACA,OAAO,eAAe,oBAAoB;GAAE;GAAO;EAAa,CAAC;CACnE;AACF"}
package/dist/factory.d.ts CHANGED
@@ -18,6 +18,7 @@
18
18
  * Integration readiness is derived from each instance's declared capabilities
19
19
  * and the storage domains those capabilities require.
20
20
  */
21
+ import type { MastraCodeConfig } from '@mastra/code-sdk';
21
22
  import type { BuiltinToolId } from '@mastra/core/agent-controller';
22
23
  import type { MastraBrowser } from '@mastra/core/browser';
23
24
  import type { PubSub } from '@mastra/core/events';
@@ -70,6 +71,8 @@ export interface MastraFactoryConfig {
70
71
  * one connection, every feature on.
71
72
  */
72
73
  storage: FactoryStorage;
74
+ /** Scorers for the mounted code agent. None run by default. */
75
+ scorers?: MastraCodeConfig['scorers'];
73
76
  /** Disable persistence of rich scorer results. Default: true. */
74
77
  disableScoreStorage?: boolean;
75
78
  /**
@@ -253,6 +256,7 @@ export type { FactorySandboxStart } from './workspace.js';
253
256
  * limit shared across deployments.
254
257
  */
255
258
  export interface MastraFactoryDispatcherConfig {
259
+ /** Automated agent runs one server process holds at once. Defaults to 10; runs past it wait in the run queue. */
256
260
  maxInFlight?: number;
257
261
  }
258
262
  export declare class MastraFactory {
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sour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,CAAC,IAAI,CAAC,CA4C9B;CACF"}
package/dist/factory.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { buildAuthDisabledRoutes, buildAuthRoutes, createFactoryAuthGate, createFactoryInteractiveMarker, createFactoryRouteAuth, getFactoryAuthOrgId, getFactoryAuthUserFromContext, getFactoryAuthUserId } from "./auth.js";
2
+ import { publishBoardChange, subscribeBoardChanges } from "./board-changes.js";
2
3
  import { BoardWriteError, BoardWrites } from "./boards/board-writes.js";
3
4
  import { isDefinedBoard } from "./boards/define-board.js";
4
5
  import "./boards/index.js";
@@ -14,10 +15,13 @@ import { boardForWorkItem, boundChangeRequestNumber, isTerminalWorkItem } from "
14
15
  import { createGithubReviewStatusReporter, reviewStatusAnimationFromEnv } from "./integrations/github/review-status-reporter.js";
15
16
  import { isFactoryGithubLogin, trustedCollaborator } from "./integrations/github/rules.js";
16
17
  import { dismissStaleFactoryReviews } from "./integrations/github/stale-reviews.js";
18
+ import { KeptCards } from "./integrations/kept-cards.js";
17
19
  import { PlatformApiClient, platformApiClientConfigFromEnv } from "./integrations/platform/api-client.js";
18
20
  import { buildConnectToolsRoute, buildPlatformConnectRoutes } from "./integrations/platform/connect/routes.js";
19
21
  import { platformConnectTools } from "./integrations/platform/connect/session-tools.js";
22
+ import { logIntegrationSummary } from "./integrations/startup-summary.js";
20
23
  import { createSessionAsRowOwner, prepareSessionRunContext } from "./integrations/subscription-session.js";
24
+ import { shareLinkedRepositoryChanges } from "./linked-repositories-changed.js";
21
25
  import { buildFactoryMcpRoutes, resolveMcpAuthorizationServers } from "./mcp/routes.js";
22
26
  import { resolveDeploymentModelProviders } from "./routes/config.js";
23
27
  import { createCustomProvidersPrimer, primeCustomProvidersForRequestContext, registerCustomProvidersSource } from "./routes/custom-provider-source.js";
@@ -39,8 +43,8 @@ import { createFactoryTransitionTools } from "./rules/tools.js";
39
43
  import { FactoryTransitionService } from "./rules/transition-service.js";
40
44
  import { assertFactoryConfigVersion } from "./rules/validation.js";
41
45
  import { CallbackFactorySandbox } from "./sandbox/callback-factory-sandbox.js";
42
- import { resolveFactoryToolScope } from "./tools/scope.js";
43
46
  import { controllerRunInFlight, createContextSandboxStops, createTerminalSandboxStops } from "./sandbox/context-sandboxes.js";
47
+ import { resolveFactoryToolScope } from "./tools/scope.js";
44
48
  import { isValidGitRef } from "./sandbox/git-ref.js";
45
49
  import { LocalFactorySandbox } from "./sandbox/local-factory-sandbox.js";
46
50
  import { CachedSandboxEnvs } from "./sandbox/sandbox-env-cache.js";
@@ -92,7 +96,7 @@ import { SkillOverridesStorage } from "./storage/domains/skill-overrides/base.js
92
96
  import { SourceControlStorage } from "./storage/domains/source-control/base.js";
93
97
  import { VoiceSettingsStorage } from "./storage/domains/voice-settings/base.js";
94
98
  import { WorkItemSplitModeError, WorkItemsStorage } from "./storage/domains/work-items/base.js";
95
- import { createRequestTimingMiddleware, factoryTimingEnabled, instrumentAsyncMethods, logTiming, timedPhase } from "./timing.js";
99
+ import { bootDiagnosticsEnabled, createRequestTimingMiddleware, factoryTimingEnabled, instrumentAsyncMethods, logTiming, timedPhase } from "./timing.js";
96
100
  import { deliverFactorySessionNotification } from "./tools/deliver.js";
97
101
  import { createFactoryTools } from "./tools/index.js";
98
102
  import { createSessionApprovalNotifier, createSessionRunEndReporter, createStageChangeNotifier, createWorkItemRunEndReporter } from "./tools/reports.js";
@@ -252,7 +256,10 @@ var MastraFactory = class {
252
256
  /** Names this replica on the dispatch-wake topic so it can skip its own echoes. */
253
257
  #dispatchWakeOrigin = globalThis.crypto.randomUUID();
254
258
  #unsubscribeDispatchWakes;
259
+ #unsubscribeBoardChanges;
260
+ #keptCards;
255
261
  #unsubscribeSandboxEnvChanges;
262
+ #unsubscribeLinkedRepositoryChanges;
256
263
  #startCoordinator;
257
264
  #factoryProcessor;
258
265
  #channelShutdowns = [];
@@ -263,6 +270,7 @@ var MastraFactory = class {
263
270
  #sessionResourceMigration;
264
271
  #workItemSplitBackfill;
265
272
  #prepareStartedAt;
273
+ #integrations = [];
266
274
  #reviewedChangeRequest;
267
275
  #preparing = false;
268
276
  constructor(config) {
@@ -441,6 +449,10 @@ var MastraFactory = class {
441
449
  const { PlatformLinearIntegration } = await import("./integrations/platform/linear/integration.js");
442
450
  integrations.push(new PlatformLinearIntegration());
443
451
  }
452
+ if (!integrations.some((integration) => integration.id === "vanta")) {
453
+ const { PlatformVantaIntegration } = await import("./integrations/platform/vanta/integration.js");
454
+ integrations.push(new PlatformVantaIntegration());
455
+ }
444
456
  }
445
457
  if (this.#config.platform?.github && !installedPlatformGithub) console.warn("[factory] 'platform.github' config was provided but the factory installed no GitHub integration of its own " + (explicitGithub ? "(an explicit integration with id 'github' takes precedence, so these options were ignored)." : "(no Platform credentials are configured and no explicit GitHub integration was passed)."));
446
458
  const integrationIds = /* @__PURE__ */ new Set();
@@ -448,11 +460,11 @@ var MastraFactory = class {
448
460
  if (integrationIds.has(integration.id)) throw new Error(`MastraFactory: duplicate integration id '${integration.id}' in 'integrations'.`);
449
461
  integrationIds.add(integration.id);
450
462
  }
463
+ this.#integrations = integrations;
451
464
  const configVersion = this.#configVersion;
452
465
  const intakeStorage = storage.registerDomain(new IntakeStorage());
453
466
  const auditStorage = storage.registerDomain(new AuditStorage());
454
467
  const workItemsStorage = storage.registerDomain(new WorkItemsStorage());
455
- workItemsStorage.onBoardChanged((scope) => touchFeed(eventBus, scope));
456
468
  workItemsStorage.onClaimableWork(() => publishDispatchWake(eventBus, this.#dispatchWakeOrigin));
457
469
  this.#unsubscribeDispatchWakes = subscribeDispatchWakes(eventBus, this.#dispatchWakeOrigin, () => this.#dispatcher?.wake()).catch((error) => {
458
470
  console.warn(`[factory] subscribing to dispatcher wakes failed; other replicas' work waits for this replica's own wakes: ${error instanceof Error ? error.message : error}`);
@@ -473,8 +485,34 @@ var MastraFactory = class {
473
485
  const queueHealthStorage = storage.registerDomain(new QueueHealthStorage());
474
486
  const integrationStorage = storage.registerDomain(new IntegrationStorage(secretEncryption));
475
487
  const factoryProjectsStorage = storage.registerDomain(new FactoryProjectsStorage());
488
+ const keptCards = new KeptCards({
489
+ projects: factoryProjectsStorage,
490
+ workItems: workItemsStorage
491
+ });
492
+ this.#keptCards = keptCards;
493
+ const boardChangeOrigin = globalThis.crypto.randomUUID();
494
+ workItemsStorage.onBoardChanged((scope) => {
495
+ touchFeed(eventBus, scope);
496
+ keptCards.changed(scope);
497
+ publishBoardChange(eventBus, boardChangeOrigin, scope);
498
+ });
499
+ factoryProjectsStorage.onDeleted((project) => {
500
+ const scope = {
501
+ orgId: project.orgId,
502
+ factoryProjectId: project.id
503
+ };
504
+ keptCards.changed(scope);
505
+ publishBoardChange(eventBus, boardChangeOrigin, scope);
506
+ });
507
+ this.#unsubscribeBoardChanges = subscribeBoardChanges(eventBus, boardChangeOrigin, (scope) => keptCards.changed(scope)).then((unsubscribe) => {
508
+ keptCards.trustAnnouncements();
509
+ return unsubscribe;
510
+ }, (error) => {
511
+ console.warn(`[factory] subscribing to board changes failed; background sweeps read every board from the database: ${error instanceof Error ? error.message : error}`);
512
+ });
476
513
  const filesystemStorage = storage.registerDomain(new FilesystemStorage());
477
514
  const sourceControlStorage = storage.registerDomain(new SourceControlStorage());
515
+ this.#unsubscribeLinkedRepositoryChanges = shareLinkedRepositoryChanges(eventBus, sourceControlStorage);
478
516
  const channelIdentityStorage = storage.registerDomain(new ChannelIdentityStorage());
479
517
  const skillOverridesStorage = storage.registerDomain(new SkillOverridesStorage());
480
518
  const domains = {
@@ -1108,6 +1146,7 @@ var MastraFactory = class {
1108
1146
  gitBranch: ""
1109
1147
  },
1110
1148
  storage: storage.getMastraStorage(),
1149
+ ...this.#config.scorers ? { scorers: this.#config.scorers } : {},
1111
1150
  disableScoreStorage: this.#config.disableScoreStorage ?? true,
1112
1151
  ...mastraStorageBackend ? { storageBackend: mastraStorageBackend } : {},
1113
1152
  knowledge: this.#config.knowledge ?? false,
@@ -1335,6 +1374,7 @@ var MastraFactory = class {
1335
1374
  cache: this.#projectBoards
1336
1375
  } } : {},
1337
1376
  factoryTransitionService: transitionService,
1377
+ runSlots: () => this.#dispatcher?.runSlots(),
1338
1378
  onFactoryRuntime: ({ transitionService: runtimeTransitionService, startCoordinator, prepareBinding }) => {
1339
1379
  this.#startCoordinator = startCoordinator;
1340
1380
  this.#dispatcher ??= new FactoryDecisionDispatcher({
@@ -1496,11 +1536,14 @@ var MastraFactory = class {
1496
1536
  threadId: session.thread.getId(),
1497
1537
  outcome,
1498
1538
  since
1499
- }), { onApprovalRequested: (request) => notifyApprovalRequested({
1500
- sessionId: session.identity.getId(),
1501
- threadId: session.thread.getId(),
1502
- ...request
1503
- }) });
1539
+ }), {
1540
+ onApprovalRequested: (request) => notifyApprovalRequested({
1541
+ sessionId: session.identity.getId(),
1542
+ threadId: session.thread.getId(),
1543
+ ...request
1544
+ }),
1545
+ answersItself: (toolCallId) => this.#dispatcher?.autoApproves(toolCallId) ?? false
1546
+ });
1504
1547
  observeSessionThreadStamp(session);
1505
1548
  });
1506
1549
  prepared.base.controller.onSessionCreated((session) => hydrateSessionMemorySettings(session, { sourceControl: { sessions: sourceControlSessions } }), { blocking: true });
@@ -1552,6 +1595,7 @@ var MastraFactory = class {
1552
1595
  integrations: integrationRegistrations,
1553
1596
  configVersion,
1554
1597
  boardRegistry: this.#projectBoards ?? this.#boards,
1598
+ ...this.#keptCards ? { keptCards: this.#keptCards } : {},
1555
1599
  factoryReady,
1556
1600
  domains,
1557
1601
  ...this.#environmentBuilds ? { onRepositoryPush: this.#environmentBuilds.onRepositoryPush } : {},
@@ -1575,7 +1619,8 @@ var MastraFactory = class {
1575
1619
  await this.#environmentBuilds?.probeSchedules();
1576
1620
  this.#sessionResourceMigration?.then((movedRunBindings) => movedRunBindings ? this.#factoryProcessor?.reconcileAllBoundThreads() : void 0).catch((error) => console.warn(`[factory] reconciling bound threads after the session resource migration failed: ${error instanceof Error ? error.message : error}`));
1577
1621
  this.#dispatcher?.start();
1578
- if (this.#prepareStartedAt !== void 0) logTiming(`boot ${Math.round(performance.now() - this.#prepareStartedAt)}ms`);
1622
+ if (bootDiagnosticsEnabled && this.#prepareStartedAt !== void 0) logTiming(`boot ${Math.round(performance.now() - this.#prepareStartedAt)}ms`);
1623
+ if (process.env.MASTRA_FACTORY_DEV === "true") logIntegrationSummary(this.#integrations);
1579
1624
  }
1580
1625
  /** Stop Factory-owned background work and channel transports before the host process shuts down. */
1581
1626
  async shutdown() {
@@ -1587,7 +1632,13 @@ var MastraFactory = class {
1587
1632
  this.#unsubscribeDispatchWakes = void 0;
1588
1633
  const unsubscribeSandboxEnvChanges = this.#unsubscribeSandboxEnvChanges;
1589
1634
  this.#unsubscribeSandboxEnvChanges = void 0;
1635
+ const unsubscribeBoardChanges = this.#unsubscribeBoardChanges;
1636
+ this.#unsubscribeBoardChanges = void 0;
1637
+ await unsubscribeBoardChanges?.then((unsubscribe) => unsubscribe?.()).catch(() => void 0);
1590
1638
  await unsubscribeSandboxEnvChanges?.then((unsubscribe) => unsubscribe?.()).catch(() => void 0);
1639
+ const unsubscribeLinkedRepositoryChanges = this.#unsubscribeLinkedRepositoryChanges;
1640
+ this.#unsubscribeLinkedRepositoryChanges = void 0;
1641
+ await unsubscribeLinkedRepositoryChanges?.then((unsubscribe) => unsubscribe()).catch(() => void 0);
1591
1642
  await unsubscribeDispatchWakes?.then((unsubscribe) => unsubscribe?.()).catch((error) => console.warn(`[factory] unsubscribing from dispatcher wakes failed: ${error instanceof Error ? error.message : error}`));
1592
1643
  const backfill = this.#workItemSplitBackfill;
1593
1644
  backfill?.controller.abort();