@mastra/server 1.79.0-alpha.10 → 1.79.0-alpha.12

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 (401) hide show
  1. package/dist/{a2a-CHBSYHxu.js → a2a-BqLB3McP.js} +17 -16
  2. package/dist/a2a-BqLB3McP.js.map +1 -0
  3. package/dist/{a2a-B465DD1u.cjs → a2a-Uood_0DN.cjs} +19 -18
  4. package/dist/a2a-Uood_0DN.cjs.map +1 -0
  5. package/dist/agent-builder-CuBD1tpv.cjs +728 -0
  6. package/dist/agent-builder-CuBD1tpv.cjs.map +1 -0
  7. package/dist/agent-builder-VhM8ADW-.js +627 -0
  8. package/dist/agent-builder-VhM8ADW-.js.map +1 -0
  9. package/dist/{agents-X1E7fW3p.js → agents-BHLTMBff.js} +2 -2
  10. package/dist/{agents-X1E7fW3p.js.map → agents-BHLTMBff.js.map} +1 -1
  11. package/dist/agents-BOWEUKyV.cjs +3127 -0
  12. package/dist/agents-BOWEUKyV.cjs.map +1 -0
  13. package/dist/agents-DRQ3ScbX.js +2828 -0
  14. package/dist/agents-DRQ3ScbX.js.map +1 -0
  15. package/dist/{agents-DoNMSCMt.cjs → agents-T-OIM9IK.cjs} +2 -2
  16. package/dist/{agents-DoNMSCMt.cjs.map → agents-T-OIM9IK.cjs.map} +1 -1
  17. package/dist/{api-schema-manifest-CWRIJP-B.js → api-schema-manifest-CI90M4sX.js} +3 -3
  18. package/dist/{api-schema-manifest-CWRIJP-B.js.map → api-schema-manifest-CI90M4sX.js.map} +1 -1
  19. package/dist/{api-schema-manifest-DUseI2VG.cjs → api-schema-manifest-DIlNfbyw.cjs} +4 -4
  20. package/dist/{api-schema-manifest-DUseI2VG.cjs.map → api-schema-manifest-DIlNfbyw.cjs.map} +1 -1
  21. package/dist/{background-tasks-CabImVak.cjs → background-tasks-B3VAKTJh.cjs} +3 -3
  22. package/dist/{background-tasks-CabImVak.cjs.map → background-tasks-B3VAKTJh.cjs.map} +1 -1
  23. package/dist/{background-tasks-oBaLtnCn.js → background-tasks-Du2zYOPl.js} +2 -2
  24. package/dist/{background-tasks-oBaLtnCn.js.map → background-tasks-Du2zYOPl.js.map} +1 -1
  25. package/dist/{builder-registry-DOkLe8ES.js → builder-registry-DLdu9bWH.js} +3 -3
  26. package/dist/{builder-registry-DOkLe8ES.js.map → builder-registry-DLdu9bWH.js.map} +1 -1
  27. package/dist/{builder-registry-D0frV8lQ.cjs → builder-registry-DaFAaMTf.cjs} +3 -3
  28. package/dist/{builder-registry-D0frV8lQ.cjs.map → builder-registry-DaFAaMTf.cjs.map} +1 -1
  29. package/dist/{channels-CBIopVWd.cjs → channels-BnVRmnzK.cjs} +6 -3
  30. package/dist/{channels-CBIopVWd.cjs.map → channels-BnVRmnzK.cjs.map} +1 -1
  31. package/dist/{channels-BOxgHvzI.js → channels-Db-4pXVZ.js} +6 -3
  32. package/dist/{channels-BOxgHvzI.js.map → channels-Db-4pXVZ.js.map} +1 -1
  33. package/dist/conversations-8BWryNlF.js +165 -0
  34. package/dist/conversations-8BWryNlF.js.map +1 -0
  35. package/dist/conversations-C5MkQBB8.cjs +194 -0
  36. package/dist/conversations-C5MkQBB8.cjs.map +1 -0
  37. package/dist/{conversations-Bj5TLNqF.cjs → conversations-DasqEDCF.cjs} +3 -3
  38. package/dist/{conversations-Bj5TLNqF.cjs.map → conversations-DasqEDCF.cjs.map} +1 -1
  39. package/dist/{dist-9c3PXXpk.cjs → dist-B-bEVWlJ.cjs} +4733 -1251
  40. package/dist/dist-B-bEVWlJ.cjs.map +1 -0
  41. package/dist/dist-B3kC8Yd0.cjs +3 -0
  42. package/dist/{dist-CQ3FSKT-.cjs → dist-B9ery9Zw.cjs} +38 -35
  43. package/dist/{dist-CQ3FSKT-.cjs.map → dist-B9ery9Zw.cjs.map} +1 -1
  44. package/dist/{dist-BxMmGD3n.js → dist-BBOnrL_A.js} +10 -12
  45. package/dist/{dist-BxMmGD3n.js.map → dist-BBOnrL_A.js.map} +1 -1
  46. package/dist/{dist-DOWsEmo6.js → dist-BIrQLUV9.js} +20 -20
  47. package/dist/{dist-DOWsEmo6.js.map → dist-BIrQLUV9.js.map} +1 -1
  48. package/dist/dist-BM9J-PTK.js +1 -0
  49. package/dist/{dist-DC1Pewf5.cjs → dist-Bo3GdQwf.cjs} +21 -21
  50. package/dist/{dist-DC1Pewf5.cjs.map → dist-Bo3GdQwf.cjs.map} +1 -1
  51. package/dist/{dist-BwYL7Ykb.js → dist-CREG82cy.js} +37 -34
  52. package/dist/{dist-BwYL7Ykb.js.map → dist-CREG82cy.js.map} +1 -1
  53. package/dist/{dist-rDRetJVY.cjs → dist-CeTLA-e5.cjs} +2 -3
  54. package/dist/{dist-rDRetJVY.cjs.map → dist-CeTLA-e5.cjs.map} +1 -1
  55. package/dist/{dist-CBRJax5e.js → dist-DLld1qjf.js} +25 -31
  56. package/dist/{dist-CBRJax5e.js.map → dist-DLld1qjf.js.map} +1 -1
  57. package/dist/{dist-B_bet8uz.js → dist-DjkPkAzV.js} +2 -3
  58. package/dist/{dist-B_bet8uz.js.map → dist-DjkPkAzV.js.map} +1 -1
  59. package/dist/{dist-UKEksCGq.cjs → dist-DsrJXwic.cjs} +11 -13
  60. package/dist/{dist-UKEksCGq.cjs.map → dist-DsrJXwic.cjs.map} +1 -1
  61. package/dist/{dist-DGCnbhNe.js → dist-k77XQGUn.js} +4493 -1043
  62. package/dist/dist-k77XQGUn.js.map +1 -0
  63. package/dist/{dist-3FPW9nVj.cjs → dist-lT2rqyY9.cjs} +26 -32
  64. package/dist/{dist-3FPW9nVj.cjs.map → dist-lT2rqyY9.cjs.map} +1 -1
  65. package/dist/docs/SKILL.md +1 -1
  66. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  67. package/dist/{dynamic-workflows-Rr_6ac1y.js → dynamic-workflows-CTUO0SFu.js} +3 -3
  68. package/dist/{dynamic-workflows-Rr_6ac1y.js.map → dynamic-workflows-CTUO0SFu.js.map} +1 -1
  69. package/dist/{dynamic-workflows-DXlkr-jK.cjs → dynamic-workflows-HwPX3mcf.cjs} +3 -3
  70. package/dist/{dynamic-workflows-DXlkr-jK.cjs.map → dynamic-workflows-HwPX3mcf.cjs.map} +1 -1
  71. package/dist/{editor-builder-BclcHxN6.cjs → editor-builder-BDtiWw0f.cjs} +2 -2
  72. package/dist/{editor-builder-BclcHxN6.cjs.map → editor-builder-BDtiWw0f.cjs.map} +1 -1
  73. package/dist/{editor-builder-D16kc1P6.js → editor-builder-ClFlGXoX.js} +4 -4
  74. package/dist/{editor-builder-D16kc1P6.js.map → editor-builder-ClFlGXoX.js.map} +1 -1
  75. package/dist/{editor-builder-s9WqPJgA.js → editor-builder-DnLCfqnY.js} +2 -2
  76. package/dist/{editor-builder-s9WqPJgA.js.map → editor-builder-DnLCfqnY.js.map} +1 -1
  77. package/dist/{editor-builder-DXHiPX1A.cjs → editor-builder-DtpP1FtW.cjs} +5 -5
  78. package/dist/{editor-builder-DXHiPX1A.cjs.map → editor-builder-DtpP1FtW.cjs.map} +1 -1
  79. package/dist/{helpers-ElhPeCSK.cjs → helpers-CAcEhq38.cjs} +21 -17
  80. package/dist/{helpers-ElhPeCSK.cjs.map → helpers-CAcEhq38.cjs.map} +1 -1
  81. package/dist/{helpers-DLhX1fqc.js → helpers-vrqddDd5.js} +21 -17
  82. package/dist/{helpers-DLhX1fqc.js.map → helpers-vrqddDd5.js.map} +1 -1
  83. package/dist/index.cjs +1 -1
  84. package/dist/logs-CiSw7r0s.cjs +119 -0
  85. package/dist/logs-CiSw7r0s.cjs.map +1 -0
  86. package/dist/logs-CxfPk-iL.js +96 -0
  87. package/dist/logs-CxfPk-iL.js.map +1 -0
  88. package/dist/mcp-CWDfSu7w.js +474 -0
  89. package/dist/mcp-CWDfSu7w.js.map +1 -0
  90. package/dist/mcp-CWGJRqkC.cjs +563 -0
  91. package/dist/mcp-CWGJRqkC.cjs.map +1 -0
  92. package/dist/{mcp-DzpwLXEY.js → mcp-Drqt0GqD.js} +79 -4
  93. package/dist/mcp-Drqt0GqD.js.map +1 -0
  94. package/dist/{mcp-ShaKO7gA.cjs → mcp-ziWVk7Ol.cjs} +126 -3
  95. package/dist/mcp-ziWVk7Ol.cjs.map +1 -0
  96. package/dist/memory-BHtTSzvJ.js +1739 -0
  97. package/dist/memory-BHtTSzvJ.js.map +1 -0
  98. package/dist/memory-CwwkVDh1.cjs +1906 -0
  99. package/dist/memory-CwwkVDh1.cjs.map +1 -0
  100. package/dist/observability-BBMCMeT-.cjs +502 -0
  101. package/dist/observability-BBMCMeT-.cjs.map +1 -0
  102. package/dist/observability-ZRgRcvoX.js +431 -0
  103. package/dist/observability-ZRgRcvoX.js.map +1 -0
  104. package/dist/{observability-new-endpoints-BU8JYPfh.js → observability-new-endpoints-fjoZzEtk.js} +10 -9
  105. package/dist/{observability-new-endpoints-BU8JYPfh.js.map → observability-new-endpoints-fjoZzEtk.js.map} +1 -1
  106. package/dist/{observability-new-endpoints-AMp9bnMV.cjs → observability-new-endpoints-tG3-odLa.cjs} +11 -10
  107. package/dist/observability-new-endpoints-tG3-odLa.cjs.map +1 -0
  108. package/dist/plans-CiPgWBhO.cjs +68 -0
  109. package/dist/plans-CiPgWBhO.cjs.map +1 -0
  110. package/dist/plans-DCepEY7n.js +57 -0
  111. package/dist/plans-DCepEY7n.js.map +1 -0
  112. package/dist/{probe-image-size-DBGjhUtJ.cjs → probe-image-size-Alv3gwKl.cjs} +194 -184
  113. package/dist/probe-image-size-Alv3gwKl.cjs.map +1 -0
  114. package/dist/{probe-image-size-Dmoxv93t.js → probe-image-size-BdfbUHxx.js} +158 -148
  115. package/dist/probe-image-size-BdfbUHxx.js.map +1 -0
  116. package/dist/responses-4FwMNxoJ.js +628 -0
  117. package/dist/responses-4FwMNxoJ.js.map +1 -0
  118. package/dist/responses-CCRijwDF.cjs +651 -0
  119. package/dist/responses-CCRijwDF.cjs.map +1 -0
  120. package/dist/{responses-CKNdSRkS.cjs → responses-CfcIc53b.cjs} +2 -2
  121. package/dist/{responses-CKNdSRkS.cjs.map → responses-CfcIc53b.cjs.map} +1 -1
  122. package/dist/{rolldown-runtime-Bd6kNlEP.cjs → rolldown-runtime-BwC_XMyb.cjs} +2 -2
  123. package/dist/{rolldown-runtime-maW3aOIk.js → rolldown-runtime-D3Hj5m0v.js} +2 -2
  124. package/dist/{route-builder-BNZs643f.cjs → route-builder-B2Qhhd7C.cjs} +52 -66
  125. package/dist/route-builder-B2Qhhd7C.cjs.map +1 -0
  126. package/dist/{route-builder-BfQYtclb.js → route-builder-CjkWxv4E.js} +51 -65
  127. package/dist/route-builder-CjkWxv4E.js.map +1 -0
  128. package/dist/{routes-rwufkyUe.js → routes-BC20mdNN.js} +30 -26
  129. package/dist/routes-BC20mdNN.js.map +1 -0
  130. package/dist/{routes-Dl6_kWm7.js → routes-CKfXiwRc.js} +5 -3
  131. package/dist/routes-CKfXiwRc.js.map +1 -0
  132. package/dist/{routes-DPojsNf1.cjs → routes-DGLJyqjD.cjs} +203 -199
  133. package/dist/routes-DGLJyqjD.cjs.map +1 -0
  134. package/dist/{routes-BULZI-PU.cjs → routes-jXksmX9G.cjs} +5 -3
  135. package/dist/routes-jXksmX9G.cjs.map +1 -0
  136. package/dist/{schedules-Bj-giFbc.cjs → schedules-GokZKBYg.cjs} +6 -4
  137. package/dist/schedules-GokZKBYg.cjs.map +1 -0
  138. package/dist/{schedules-BQYgaz66.js → schedules-_3zPKyqm.js} +5 -3
  139. package/dist/schedules-_3zPKyqm.js.map +1 -0
  140. package/dist/{schema-e0VHpMt0-C0452jOk.cjs → schema-CzbEIyhE-20gGIWkz.cjs} +83 -88
  141. package/dist/schema-CzbEIyhE-20gGIWkz.cjs.map +1 -0
  142. package/dist/{schema-e0VHpMt0-CVP5Hnxy.js → schema-CzbEIyhE-BsMcj9Ws.js} +82 -87
  143. package/dist/schema-CzbEIyhE-BsMcj9Ws.js.map +1 -0
  144. package/dist/scores-D9UgETt_.js +288 -0
  145. package/dist/scores-D9UgETt_.js.map +1 -0
  146. package/dist/scores-DRdtS7NT.cjs +329 -0
  147. package/dist/scores-DRdtS7NT.cjs.map +1 -0
  148. package/dist/server/a2a/store.cjs +1 -1
  149. package/dist/server/auth/index.cjs +2 -2
  150. package/dist/server/auth/index.js +1 -1
  151. package/dist/server/browser-stream/index.cjs +9 -11
  152. package/dist/server/browser-stream/index.cjs.map +1 -1
  153. package/dist/server/browser-stream/index.js +8 -10
  154. package/dist/server/browser-stream/index.js.map +1 -1
  155. package/dist/server/handlers/a2a.cjs +2 -2
  156. package/dist/server/handlers/a2a.js +1 -2
  157. package/dist/server/handlers/agent-builder.cjs +18 -648
  158. package/dist/server/handlers/agent-builder.js +1 -627
  159. package/dist/server/handlers/agent-controller.cjs +5 -5
  160. package/dist/server/handlers/agent-controller.cjs.map +1 -1
  161. package/dist/server/handlers/agent-controller.js +11 -9
  162. package/dist/server/handlers/agent-controller.js.map +1 -1
  163. package/dist/server/handlers/agent-versions.cjs +15 -8
  164. package/dist/server/handlers/agent-versions.cjs.map +1 -1
  165. package/dist/server/handlers/agent-versions.js +14 -7
  166. package/dist/server/handlers/agent-versions.js.map +1 -1
  167. package/dist/server/handlers/agents.cjs +51 -2860
  168. package/dist/server/handlers/agents.js +1 -2806
  169. package/dist/server/handlers/auth.cjs +14 -12
  170. package/dist/server/handlers/auth.cjs.map +1 -1
  171. package/dist/server/handlers/auth.js +20 -16
  172. package/dist/server/handlers/auth.js.map +1 -1
  173. package/dist/server/handlers/author-enrichment.cjs +1 -1
  174. package/dist/server/handlers/authorship.cjs +1 -1
  175. package/dist/server/handlers/authorship.cjs.map +1 -1
  176. package/dist/server/handlers/background-tasks.cjs +2 -2
  177. package/dist/server/handlers/background-tasks.js +1 -2
  178. package/dist/server/handlers/builder-registry.cjs +2 -2
  179. package/dist/server/handlers/builder-registry.js +1 -2
  180. package/dist/server/handlers/channels.cjs +2 -2
  181. package/dist/server/handlers/channels.js +1 -2
  182. package/dist/server/handlers/conversations.cjs +6 -171
  183. package/dist/server/handlers/conversations.js +1 -162
  184. package/dist/server/handlers/datasets.cjs +2 -2
  185. package/dist/server/handlers/datasets.cjs.map +1 -1
  186. package/dist/server/handlers/datasets.js +1 -1
  187. package/dist/server/handlers/dynamic-workflows.cjs +2 -2
  188. package/dist/server/handlers/dynamic-workflows.js +1 -2
  189. package/dist/server/handlers/editor-builder.cjs +2 -2
  190. package/dist/server/handlers/editor-builder.js +1 -2
  191. package/dist/server/handlers/error.cjs +18 -13
  192. package/dist/server/handlers/error.cjs.map +1 -1
  193. package/dist/server/handlers/error.js +17 -12
  194. package/dist/server/handlers/error.js.map +1 -1
  195. package/dist/server/handlers/favorites-enrichment.cjs +2 -2
  196. package/dist/server/handlers/favorites-enrichment.js +1 -1
  197. package/dist/server/handlers/gateway-memory-client.cjs +1 -1
  198. package/dist/server/handlers/logs.cjs +5 -104
  199. package/dist/server/handlers/logs.js +1 -96
  200. package/dist/server/handlers/mcp-client-versions.cjs +15 -8
  201. package/dist/server/handlers/mcp-client-versions.cjs.map +1 -1
  202. package/dist/server/handlers/mcp-client-versions.js +14 -7
  203. package/dist/server/handlers/mcp-client-versions.js.map +1 -1
  204. package/dist/server/handlers/mcp.cjs +16 -289
  205. package/dist/server/handlers/mcp.d.ts +219 -0
  206. package/dist/server/handlers/mcp.d.ts.map +1 -1
  207. package/dist/server/handlers/mcp.js +1 -274
  208. package/dist/server/handlers/memory.cjs +29 -1763
  209. package/dist/server/handlers/memory.js +1 -1731
  210. package/dist/server/handlers/observability-list-query-schemas.cjs +1 -1
  211. package/dist/server/handlers/observability-new-endpoints.cjs +2 -2
  212. package/dist/server/handlers/observability-new-endpoints.js +1 -2
  213. package/dist/server/handlers/observability-shared.cjs +2 -2
  214. package/dist/server/handlers/observability-shared.js +1 -1
  215. package/dist/server/handlers/observability-storage-schemas.cjs +1 -1
  216. package/dist/server/handlers/observability.cjs +14 -445
  217. package/dist/server/handlers/observability.js +3 -429
  218. package/dist/server/handlers/plans.cjs +3 -63
  219. package/dist/server/handlers/plans.js +1 -57
  220. package/dist/server/handlers/processor-providers.cjs +2 -2
  221. package/dist/server/handlers/processor-providers.cjs.map +1 -1
  222. package/dist/server/handlers/processor-providers.js +1 -1
  223. package/dist/server/handlers/processors.cjs +13 -15
  224. package/dist/server/handlers/processors.cjs.map +1 -1
  225. package/dist/server/handlers/processors.js +12 -14
  226. package/dist/server/handlers/processors.js.map +1 -1
  227. package/dist/server/handlers/prompt-block-versions.cjs +15 -8
  228. package/dist/server/handlers/prompt-block-versions.cjs.map +1 -1
  229. package/dist/server/handlers/prompt-block-versions.js +14 -7
  230. package/dist/server/handlers/prompt-block-versions.js.map +1 -1
  231. package/dist/server/handlers/responses.adapter.cjs +1 -1
  232. package/dist/server/handlers/responses.adapter.cjs.map +1 -1
  233. package/dist/server/handlers/responses.cjs +5 -632
  234. package/dist/server/handlers/responses.js +1 -624
  235. package/dist/server/handlers/responses.storage.cjs +2 -2
  236. package/dist/server/handlers/schedules-workflows-shim.cjs +1 -1
  237. package/dist/server/handlers/schedules.cjs +2 -2
  238. package/dist/server/handlers/schedules.d.ts +16 -0
  239. package/dist/server/handlers/schedules.d.ts.map +1 -1
  240. package/dist/server/handlers/schedules.js +1 -2
  241. package/dist/server/handlers/scorer-versions.cjs +15 -8
  242. package/dist/server/handlers/scorer-versions.cjs.map +1 -1
  243. package/dist/server/handlers/scorer-versions.js +14 -7
  244. package/dist/server/handlers/scorer-versions.js.map +1 -1
  245. package/dist/server/handlers/scores.cjs +8 -299
  246. package/dist/server/handlers/scores.js +1 -288
  247. package/dist/server/handlers/skills-sh-shared.cjs +1 -1
  248. package/dist/server/handlers/stored-agent-favorites.cjs +4 -4
  249. package/dist/server/handlers/stored-agent-favorites.js +3 -3
  250. package/dist/server/handlers/stored-agents.cjs +19 -13
  251. package/dist/server/handlers/stored-agents.cjs.map +1 -1
  252. package/dist/server/handlers/stored-agents.js +18 -12
  253. package/dist/server/handlers/stored-agents.js.map +1 -1
  254. package/dist/server/handlers/stored-mcp-clients.cjs +8 -6
  255. package/dist/server/handlers/stored-mcp-clients.cjs.map +1 -1
  256. package/dist/server/handlers/stored-mcp-clients.js +7 -5
  257. package/dist/server/handlers/stored-mcp-clients.js.map +1 -1
  258. package/dist/server/handlers/stored-prompt-blocks.cjs +3 -3
  259. package/dist/server/handlers/stored-prompt-blocks.js +2 -2
  260. package/dist/server/handlers/stored-scorers.cjs +3 -3
  261. package/dist/server/handlers/stored-scorers.js +2 -2
  262. package/dist/server/handlers/stored-skill-favorites.cjs +4 -4
  263. package/dist/server/handlers/stored-skill-favorites.js +3 -3
  264. package/dist/server/handlers/stored-skills.cjs +6 -5
  265. package/dist/server/handlers/stored-skills.cjs.map +1 -1
  266. package/dist/server/handlers/stored-skills.js +5 -4
  267. package/dist/server/handlers/stored-skills.js.map +1 -1
  268. package/dist/server/handlers/stored-workspaces.cjs +3 -3
  269. package/dist/server/handlers/stored-workspaces.js +2 -2
  270. package/dist/server/handlers/system.cjs +3 -3
  271. package/dist/server/handlers/system.cjs.map +1 -1
  272. package/dist/server/handlers/system.js +2 -2
  273. package/dist/server/handlers/test-utils.cjs +1 -1
  274. package/dist/server/handlers/tool-providers.cjs +2 -2
  275. package/dist/server/handlers/tool-providers.js +1 -1
  276. package/dist/server/handlers/tool-schema-overrides.cjs +1 -1
  277. package/dist/server/handlers/tools.cjs +7 -267
  278. package/dist/server/handlers/tools.js +1 -257
  279. package/dist/server/handlers/utils.cjs +2 -2
  280. package/dist/server/handlers/utils.js +1 -2
  281. package/dist/server/handlers/validate-agent-instructions.cjs +2 -2
  282. package/dist/server/handlers/validate-agent-instructions.js +1 -1
  283. package/dist/server/handlers/validate-avatar.cjs +2 -2
  284. package/dist/server/handlers/validate-avatar.cjs.map +1 -1
  285. package/dist/server/handlers/validate-avatar.js +1 -1
  286. package/dist/server/handlers/validate-avatar.js.map +1 -1
  287. package/dist/server/handlers/vector.cjs +17 -334
  288. package/dist/server/handlers/vector.js +1 -314
  289. package/dist/server/handlers/version-helpers.cjs +1 -1
  290. package/dist/server/handlers/voice.cjs +9 -35
  291. package/dist/server/handlers/voice.js +1 -23
  292. package/dist/server/handlers/workflow-builder.cjs +2 -2
  293. package/dist/server/handlers/workflow-builder.js +1 -2
  294. package/dist/server/handlers/workflows.cjs +30 -1293
  295. package/dist/server/handlers/workflows.js +1 -1257
  296. package/dist/server/handlers/workspace.cjs +27 -1176
  297. package/dist/server/handlers/workspace.js +1 -1146
  298. package/dist/server/handlers.cjs +33 -33
  299. package/dist/server/handlers.js +17 -17
  300. package/dist/server/schemas/index.cjs +7 -7
  301. package/dist/server/schemas/index.js +4 -4
  302. package/dist/server/schemas/mcp.d.ts +102 -0
  303. package/dist/server/schemas/mcp.d.ts.map +1 -1
  304. package/dist/server/schemas/schedules.d.ts +5 -0
  305. package/dist/server/schemas/schedules.d.ts.map +1 -1
  306. package/dist/server/server-adapter/index.cjs +5 -5
  307. package/dist/server/server-adapter/index.cjs.map +1 -1
  308. package/dist/server/server-adapter/index.js +4 -4
  309. package/dist/server/server-adapter/index.js.map +1 -1
  310. package/dist/server/server-adapter/routes/mcp.d.ts +214 -0
  311. package/dist/server/server-adapter/routes/mcp.d.ts.map +1 -1
  312. package/dist/tools-CmFSfDMn.js +256 -0
  313. package/dist/tools-CmFSfDMn.js.map +1 -0
  314. package/dist/tools-SPJtxG9N.cjs +291 -0
  315. package/dist/tools-SPJtxG9N.cjs.map +1 -0
  316. package/dist/{utils-DCgeTrq2.cjs → utils-CF76qzZR.cjs} +12 -17
  317. package/dist/{utils-DCgeTrq2.cjs.map → utils-CF76qzZR.cjs.map} +1 -1
  318. package/dist/{utils-DCAUeb6M.js → utils-aoLN3Wfi.js} +11 -16
  319. package/dist/{utils-DCAUeb6M.js.map → utils-aoLN3Wfi.js.map} +1 -1
  320. package/dist/{utils-Du-EpvDs.cjs → utils-dDLIDg8O.cjs} +2 -2
  321. package/dist/{utils-Du-EpvDs.cjs.map → utils-dDLIDg8O.cjs.map} +1 -1
  322. package/dist/vector-BKDD1kwc.cjs +409 -0
  323. package/dist/vector-BKDD1kwc.cjs.map +1 -0
  324. package/dist/vector-TWv4t-4g.js +314 -0
  325. package/dist/vector-TWv4t-4g.js.map +1 -0
  326. package/dist/voice-BnGwlZ75.cjs +70 -0
  327. package/dist/voice-BnGwlZ75.cjs.map +1 -0
  328. package/dist/voice-DjG8tBAD.js +23 -0
  329. package/dist/voice-DjG8tBAD.js.map +1 -0
  330. package/dist/{workflow-builder-Brj3IArM.cjs → workflow-builder-C9-8ZOWF.cjs} +5 -5
  331. package/dist/{workflow-builder-Brj3IArM.cjs.map → workflow-builder-C9-8ZOWF.cjs.map} +1 -1
  332. package/dist/{workflow-builder-DOa1Vx6w.js → workflow-builder-CjlLoQvo.js} +10 -8
  333. package/dist/{workflow-builder-DOa1Vx6w.js.map → workflow-builder-CjlLoQvo.js.map} +1 -1
  334. package/dist/workflows-DjqeJcdJ.cjs +1446 -0
  335. package/dist/workflows-DjqeJcdJ.cjs.map +1 -0
  336. package/dist/workflows-bb-otd2o.js +1273 -0
  337. package/dist/workflows-bb-otd2o.js.map +1 -0
  338. package/dist/workspace-B6kzp-bo.js +1154 -0
  339. package/dist/workspace-B6kzp-bo.js.map +1 -0
  340. package/dist/workspace-COKR1SxH.cjs +1309 -0
  341. package/dist/workspace-COKR1SxH.cjs.map +1 -0
  342. package/package.json +4 -4
  343. package/dist/a2a-B465DD1u.cjs.map +0 -1
  344. package/dist/a2a-CHBSYHxu.js.map +0 -1
  345. package/dist/dist-9c3PXXpk.cjs.map +0 -1
  346. package/dist/dist-B5OwHWTo.cjs +0 -2294
  347. package/dist/dist-B5OwHWTo.cjs.map +0 -1
  348. package/dist/dist-DGCnbhNe.js.map +0 -1
  349. package/dist/dist-DcoIg_tp.js +0 -2293
  350. package/dist/dist-DcoIg_tp.js.map +0 -1
  351. package/dist/mcp-DzpwLXEY.js.map +0 -1
  352. package/dist/mcp-ShaKO7gA.cjs.map +0 -1
  353. package/dist/observability-new-endpoints-AMp9bnMV.cjs.map +0 -1
  354. package/dist/probe-image-size-DBGjhUtJ.cjs.map +0 -1
  355. package/dist/probe-image-size-Dmoxv93t.js.map +0 -1
  356. package/dist/route-builder-BNZs643f.cjs.map +0 -1
  357. package/dist/route-builder-BfQYtclb.js.map +0 -1
  358. package/dist/routes-BULZI-PU.cjs.map +0 -1
  359. package/dist/routes-DPojsNf1.cjs.map +0 -1
  360. package/dist/routes-Dl6_kWm7.js.map +0 -1
  361. package/dist/routes-rwufkyUe.js.map +0 -1
  362. package/dist/schedules-BQYgaz66.js.map +0 -1
  363. package/dist/schedules-Bj-giFbc.cjs.map +0 -1
  364. package/dist/schema-Drf2W04o.js +0 -2
  365. package/dist/schema-EQanefYq.cjs +0 -1
  366. package/dist/schema-e0VHpMt0-C0452jOk.cjs.map +0 -1
  367. package/dist/schema-e0VHpMt0-CVP5Hnxy.js.map +0 -1
  368. package/dist/server/handlers/agent-builder.cjs.map +0 -1
  369. package/dist/server/handlers/agent-builder.js.map +0 -1
  370. package/dist/server/handlers/agents.cjs.map +0 -1
  371. package/dist/server/handlers/agents.js.map +0 -1
  372. package/dist/server/handlers/conversations.cjs.map +0 -1
  373. package/dist/server/handlers/conversations.js.map +0 -1
  374. package/dist/server/handlers/logs.cjs.map +0 -1
  375. package/dist/server/handlers/logs.js.map +0 -1
  376. package/dist/server/handlers/mcp.cjs.map +0 -1
  377. package/dist/server/handlers/mcp.js.map +0 -1
  378. package/dist/server/handlers/memory.cjs.map +0 -1
  379. package/dist/server/handlers/memory.js.map +0 -1
  380. package/dist/server/handlers/observability.cjs.map +0 -1
  381. package/dist/server/handlers/observability.js.map +0 -1
  382. package/dist/server/handlers/plans.cjs.map +0 -1
  383. package/dist/server/handlers/plans.js.map +0 -1
  384. package/dist/server/handlers/responses.cjs.map +0 -1
  385. package/dist/server/handlers/responses.js.map +0 -1
  386. package/dist/server/handlers/scores.cjs.map +0 -1
  387. package/dist/server/handlers/scores.js.map +0 -1
  388. package/dist/server/handlers/tools.cjs.map +0 -1
  389. package/dist/server/handlers/tools.js.map +0 -1
  390. package/dist/server/handlers/vector.cjs.map +0 -1
  391. package/dist/server/handlers/vector.js.map +0 -1
  392. package/dist/server/handlers/voice.cjs.map +0 -1
  393. package/dist/server/handlers/voice.js.map +0 -1
  394. package/dist/server/handlers/workflows.cjs.map +0 -1
  395. package/dist/server/handlers/workflows.js.map +0 -1
  396. package/dist/server/handlers/workspace.cjs.map +0 -1
  397. package/dist/server/handlers/workspace.js.map +0 -1
  398. package/dist/sync-Ai_ZDz7U.js +0 -1700
  399. package/dist/sync-Ai_ZDz7U.js.map +0 -1
  400. package/dist/sync-BrO5MtSe.cjs +0 -1729
  401. package/dist/sync-BrO5MtSe.cjs.map +0 -1
@@ -1,1294 +1,31 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("../../rolldown-runtime-Bd6kNlEP.cjs");
3
- const require_http_exception = require("../../http-exception-CKDHupKw.cjs");
4
- const require_common = require("../../common-DhKNoXGp.cjs");
5
- const require_workflows = require("../../workflows-C8rDpHyY.cjs");
6
- const require_agents = require("../../agents-DoNMSCMt.cjs");
7
- const require_route_builder = require("../../route-builder-BNZs643f.cjs");
8
- const require_utils = require("../../utils-DCgeTrq2.cjs");
9
- const require_server_handlers_error = require("./error.cjs");
10
- const require_utils$1 = require("../../utils-Du-EpvDs.cjs");
11
- let zod_v4 = require("zod/v4");
12
- let _mastra_core_stream = require("@mastra/core/stream");
13
- //#region src/server/handlers/workflows.ts
14
- var workflows_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
15
- CANCEL_WORKFLOW_RUN_ROUTE: () => CANCEL_WORKFLOW_RUN_ROUTE,
16
- CREATE_WORKFLOW_RUN_ROUTE: () => CREATE_WORKFLOW_RUN_ROUTE,
17
- DELETE_WORKFLOW_RUN_BY_ID_ROUTE: () => DELETE_WORKFLOW_RUN_BY_ID_ROUTE,
18
- EXECUTE_WORKFLOW_STEP_ROUTE: () => EXECUTE_WORKFLOW_STEP_ROUTE,
19
- GET_WORKFLOW_BY_ID_ROUTE: () => GET_WORKFLOW_BY_ID_ROUTE,
20
- GET_WORKFLOW_RUN_BY_ID_ROUTE: () => GET_WORKFLOW_RUN_BY_ID_ROUTE,
21
- LIST_WORKFLOWS_ROUTE: () => LIST_WORKFLOWS_ROUTE,
22
- LIST_WORKFLOW_RUNS_ROUTE: () => LIST_WORKFLOW_RUNS_ROUTE,
23
- LIST_WORKFLOW_RUN_COUNTS_ROUTE: () => LIST_WORKFLOW_RUN_COUNTS_ROUTE,
24
- OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE: () => OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE,
25
- OBSERVE_STREAM_WORKFLOW_ROUTE: () => OBSERVE_STREAM_WORKFLOW_ROUTE,
26
- RECEIVE_WORKFLOW_EVENT_ROUTE: () => RECEIVE_WORKFLOW_EVENT_ROUTE,
27
- RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE: () => RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE,
28
- RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE: () => RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE,
29
- RESTART_ASYNC_WORKFLOW_ROUTE: () => RESTART_ASYNC_WORKFLOW_ROUTE,
30
- RESTART_WORKFLOW_ROUTE: () => RESTART_WORKFLOW_ROUTE,
31
- RESUME_ASYNC_WORKFLOW_ROUTE: () => RESUME_ASYNC_WORKFLOW_ROUTE,
32
- RESUME_NO_WAIT_WORKFLOW_ROUTE: () => RESUME_NO_WAIT_WORKFLOW_ROUTE,
33
- RESUME_STREAM_WORKFLOW_ROUTE: () => RESUME_STREAM_WORKFLOW_ROUTE,
34
- RESUME_WORKFLOW_ROUTE: () => RESUME_WORKFLOW_ROUTE,
35
- START_ASYNC_WORKFLOW_ROUTE: () => START_ASYNC_WORKFLOW_ROUTE,
36
- START_WORKFLOW_RUN_ROUTE: () => START_WORKFLOW_RUN_ROUTE,
37
- STREAM_LEGACY_WORKFLOW_ROUTE: () => STREAM_LEGACY_WORKFLOW_ROUTE,
38
- STREAM_WORKFLOW_ROUTE: () => STREAM_WORKFLOW_ROUTE,
39
- TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE: () => TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE,
40
- TIME_TRAVEL_STREAM_WORKFLOW_ROUTE: () => TIME_TRAVEL_STREAM_WORKFLOW_ROUTE,
41
- TIME_TRAVEL_WORKFLOW_ROUTE: () => TIME_TRAVEL_WORKFLOW_ROUTE,
42
- __setWorkflowRunCountsNow: () => __setWorkflowRunCountsNow
43
- });
44
- /**
45
- * Statuses a run cannot come back from. Streaming one of these runIds again would
46
- * start a fresh execution under the same runId and overwrite its stored snapshot —
47
- * the in-memory de-dupe that protects concurrent streams only covers runs still held
48
- * in the workflow's run map, and a finished run has already been dropped from it.
49
- */
50
- const TERMINAL_RUN_STATUSES = [
51
- "success",
52
- "failed",
53
- "canceled",
54
- "tripwire"
55
- ];
56
- /**
57
- * Runs whose chunks are already being written to the cache in this process,
58
- * keyed by runId. A run has exactly one writer: without this, two concurrent
59
- * requests for the same runId each cache every chunk and the replayed history
60
- * comes back duplicated.
61
- */
62
- const activeRunStreamCachers = /* @__PURE__ */ new Set();
63
- /**
64
- * Cache a run's chunks for later replay and return the stream to hand the client.
65
- *
66
- * The cached history belongs to the run, not to whoever happens to be watching,
67
- * so the caching side is driven by its own reader rather than by the client's
68
- * consumption. If the client disconnects mid-run its branch is cancelled while
69
- * this reader keeps draining, so `/observe` still replays a complete history —
70
- * the failure that makes reconnection necessary is exactly the one the cache has
71
- * to survive. Chunks buffer in the tee while a client lags, bounded by the run's
72
- * own length.
73
- */
74
- function cacheRunStream({ cache, runId, source }) {
75
- if (activeRunStreamCachers.has(runId)) return source;
76
- const [toCache, toClient] = source.tee();
77
- activeRunStreamCachers.add(runId);
78
- (async () => {
79
- const reader = toCache.getReader();
80
- try {
81
- while (true) {
82
- const { done, value } = await reader.read();
83
- if (done) break;
84
- await cache.listPush(runId, value).catch(() => {});
85
- }
86
- } catch {} finally {
87
- reader.releaseLock();
88
- activeRunStreamCachers.delete(runId);
89
- }
90
- })();
91
- return toClient;
92
- }
93
- async function listWorkflowsFromSystem({ mastra, workflowId }) {
94
- const logger = mastra.getLogger();
95
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
96
- let workflow;
97
- workflow = require_utils.WorkflowRegistry.getWorkflow(workflowId);
98
- if (!workflow) workflow = require_utils$1.getPublicWorkflowById(mastra, workflowId);
99
- if (!workflow) {
100
- logger.debug("Workflow not found, searching agents for workflow", { workflowId });
101
- const agents = mastra.listAgents();
102
- if (Object.keys(agents || {}).length) for (const [_, agent] of Object.entries(agents)) try {
103
- const workflows = await agent.listWorkflows();
104
- if (workflows[workflowId]) {
105
- workflow = workflows[workflowId];
106
- break;
107
- }
108
- } catch (error) {
109
- logger.debug("Error getting workflow from agent", error);
110
- }
111
- }
112
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
113
- return { workflow };
114
- }
115
- const LIST_WORKFLOWS_ROUTE = require_route_builder.createRoute({
116
- method: "GET",
117
- path: "/workflows",
118
- responseType: "json",
119
- queryParamSchema: zod_v4.z.object({ partial: zod_v4.z.string().optional() }),
120
- responseSchema: require_workflows.listWorkflowsResponseSchema,
121
- summary: "List all workflows",
122
- description: "Returns a list of all available workflows in the system",
123
- tags: ["Workflows"],
124
- requiresAuth: true,
125
- handler: (async ({ mastra, partial, requestContext }) => {
126
- try {
127
- const workflows = mastra.listWorkflows({ serialized: false });
128
- const isPartial = partial === "true";
129
- const _workflows = Object.entries(workflows).reduce((acc, [key, workflow]) => {
130
- acc[key] = require_utils.getWorkflowInfo(workflow, isPartial);
131
- return acc;
132
- }, {});
133
- const fgaProvider = mastra.getServer?.()?.fga;
134
- const user = requestContext?.get("user");
135
- if (fgaProvider) {
136
- if (!user) return {};
137
- const workflowList = Object.entries(_workflows).map(([id, w]) => ({
138
- id,
139
- ...w
140
- }));
141
- const accessible = await fgaProvider.filterAccessible(user, workflowList, "workflow", require_utils$1.MastraFGAPermissions.WORKFLOWS_READ);
142
- const accessibleSet = new Set(accessible.map((w) => w.id));
143
- for (const id of Object.keys(_workflows)) if (!accessibleSet.has(id)) delete _workflows[id];
144
- }
145
- return _workflows;
146
- } catch (error) {
147
- return require_server_handlers_error.handleError(error, "Error getting workflows");
148
- }
149
- })
150
- });
151
- const RUN_COUNTS_CACHE_TTL_MS = 5e3;
152
- const runCountsCache = /* @__PURE__ */ new WeakMap();
153
- let runCountsNow = () => Date.now();
154
- /** Test seam — lets TTL expiry be tested without wall-clock waits. */
155
- function __setWorkflowRunCountsNow(now) {
156
- runCountsNow = now ?? (() => Date.now());
157
- }
158
- const LIST_WORKFLOW_RUN_COUNTS_ROUTE = require_route_builder.createRoute({
159
- method: "GET",
160
- path: "/workflows/run-counts",
161
- responseType: "json",
162
- responseSchema: require_workflows.workflowRunCountsResponseSchema,
163
- summary: "List workflow run counts",
164
- description: "Returns per-workflow counts of currently running and suspended (awaiting resume) runs, keyed by the workflow registry key used in the Mastra config",
165
- tags: ["Workflows"],
166
- requiresAuth: true,
167
- handler: (async ({ mastra, requestContext }) => {
168
- try {
169
- const fgaProvider = mastra.getServer?.()?.fga;
170
- const user = requestContext?.get("user");
171
- if (fgaProvider && !user) return {};
172
- const workflows = mastra.listWorkflows({ serialized: false });
173
- const counts = {};
174
- const workflowIdToRegistryKey = /* @__PURE__ */ new Map();
175
- for (const [registryKey, workflow] of Object.entries(workflows)) {
176
- counts[registryKey] = {
177
- running: 0,
178
- suspended: 0
179
- };
180
- workflowIdToRegistryKey.set(workflow.id, registryKey);
181
- }
182
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
183
- const cacheable = !fgaProvider && !effectiveResourceId;
184
- if (cacheable) {
185
- const cached = runCountsCache.get(mastra);
186
- if (cached && runCountsNow() - cached.at < RUN_COUNTS_CACHE_TTL_MS) return cached.value;
187
- }
188
- const storage = mastra.getStorage();
189
- const workflowsStore = storage ? await storage.getStore("workflows") : void 0;
190
- if (workflowsStore) {
191
- const [running, suspended] = await Promise.all([workflowsStore.listWorkflowRuns({
192
- status: "running",
193
- resourceId: effectiveResourceId
194
- }), workflowsStore.listWorkflowRuns({
195
- status: "suspended",
196
- resourceId: effectiveResourceId
197
- })]);
198
- for (const run of running.runs) {
199
- const registryKey = workflowIdToRegistryKey.get(run.workflowName);
200
- const entry = registryKey ? counts[registryKey] : void 0;
201
- if (entry) entry.running++;
202
- }
203
- for (const run of suspended.runs) {
204
- const registryKey = workflowIdToRegistryKey.get(run.workflowName);
205
- const entry = registryKey ? counts[registryKey] : void 0;
206
- if (entry) entry.suspended++;
207
- }
208
- }
209
- if (fgaProvider) {
210
- const workflowList = Object.keys(counts).map((id) => ({ id }));
211
- const accessible = await fgaProvider.filterAccessible(user, workflowList, "workflow", require_utils$1.MastraFGAPermissions.WORKFLOWS_READ);
212
- const accessibleSet = new Set(accessible.map((w) => w.id));
213
- for (const id of Object.keys(counts)) if (!accessibleSet.has(id)) delete counts[id];
214
- return counts;
215
- }
216
- if (cacheable) runCountsCache.set(mastra, {
217
- at: runCountsNow(),
218
- value: counts
219
- });
220
- return counts;
221
- } catch (error) {
222
- return require_server_handlers_error.handleError(error, "Error getting workflow run counts");
223
- }
224
- })
225
- });
226
- const GET_WORKFLOW_BY_ID_ROUTE = require_route_builder.createRoute({
227
- method: "GET",
228
- path: "/workflows/:workflowId",
229
- responseType: "json",
230
- pathParamSchema: require_workflows.workflowIdPathParams,
231
- responseSchema: require_workflows.workflowInfoSchema,
232
- summary: "Get workflow by ID",
233
- description: "Returns details for a specific workflow",
234
- tags: ["Workflows"],
235
- requiresAuth: true,
236
- handler: (async ({ mastra, workflowId }) => {
237
- try {
238
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
239
- const { workflow } = await listWorkflowsFromSystem({
240
- mastra,
241
- workflowId
242
- });
243
- return require_utils.getWorkflowInfo(workflow, false);
244
- } catch (error) {
245
- return require_server_handlers_error.handleError(error, "Error getting workflow");
246
- }
247
- })
248
- });
249
- const LIST_WORKFLOW_RUNS_ROUTE = require_route_builder.createRoute({
250
- method: "GET",
251
- path: "/workflows/:workflowId/runs",
252
- responseType: "json",
253
- pathParamSchema: require_workflows.workflowIdPathParams,
254
- queryParamSchema: require_workflows.listWorkflowRunsQuerySchema,
255
- responseSchema: require_workflows.workflowRunsResponseSchema,
256
- summary: "List workflow runs",
257
- description: "Returns a paginated list of execution runs for the specified workflow",
258
- tags: ["Workflows"],
259
- requiresAuth: true,
260
- handler: async ({ mastra, workflowId, fromDate, toDate, page, perPage, limit, offset, resourceId, status, summary, requestContext }) => {
261
- try {
262
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, resourceId);
263
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
264
- let finalPage = page;
265
- let finalPerPage = perPage;
266
- if (finalPerPage === void 0 && limit !== void 0) finalPerPage = limit;
267
- if (finalPage === void 0 && offset !== void 0 && finalPerPage !== void 0 && finalPerPage > 0) finalPage = Math.floor(offset / finalPerPage);
268
- if (finalPerPage !== void 0 && (typeof finalPerPage !== "number" || !Number.isInteger(finalPerPage) || finalPerPage <= 0)) throw new require_http_exception.HTTPException(400, { message: "perPage must be a positive integer" });
269
- if (finalPage !== void 0 && (!Number.isInteger(finalPage) || finalPage < 0)) throw new require_http_exception.HTTPException(400, { message: "page must be a non-negative integer" });
270
- const { workflow } = await listWorkflowsFromSystem({
271
- mastra,
272
- workflowId
273
- });
274
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
275
- const workflowRuns = await workflow.listWorkflowRuns({
276
- fromDate: fromDate ? typeof fromDate === "string" ? new Date(fromDate) : fromDate : void 0,
277
- toDate: toDate ? typeof toDate === "string" ? new Date(toDate) : toDate : void 0,
278
- perPage: finalPerPage,
279
- page: finalPage,
280
- resourceId: effectiveResourceId,
281
- status,
282
- ...summary ? { summary: true } : {}
283
- }) || {
284
- runs: [],
285
- total: 0
286
- };
287
- if (summary) return {
288
- ...workflowRuns,
289
- runs: workflowRuns.runs.map((run) => ({
290
- ...run,
291
- snapshot: toSummarySnapshot(run.snapshot)
292
- }))
293
- };
294
- return workflowRuns;
295
- } catch (error) {
296
- return require_server_handlers_error.handleError(error, "Error getting workflow runs");
297
- }
298
- }
299
- });
300
- function toSummarySnapshot(snapshot) {
301
- let parsed;
302
- if (typeof snapshot === "string") try {
303
- parsed = JSON.parse(snapshot);
304
- } catch {
305
- return "";
306
- }
307
- else parsed = snapshot;
308
- if (!parsed || typeof parsed !== "object") return "";
309
- const { status, timestamp } = parsed;
310
- return {
311
- status,
312
- timestamp
313
- };
314
- }
315
- const GET_WORKFLOW_RUN_BY_ID_ROUTE = require_route_builder.createRoute({
316
- method: "GET",
317
- path: "/workflows/:workflowId/runs/:runId",
318
- responseType: "json",
319
- pathParamSchema: require_workflows.workflowRunPathParams,
320
- queryParamSchema: require_workflows.workflowRunResultQuerySchema,
321
- responseSchema: require_workflows.workflowRunResultSchema,
322
- summary: "Get workflow run by ID",
323
- description: "Returns a workflow run with metadata and processed execution state. Use the fields query parameter to reduce payload size by requesting only specific fields (e.g., ?fields=result,steps). Available fields: result, error, payload, steps, activeStepsPath, serializedStepGraph. Metadata fields (runId, workflowName, resourceId, createdAt, updatedAt) and status are always included.",
324
- tags: ["Workflows"],
325
- requiresAuth: true,
326
- handler: async ({ mastra, workflowId, runId, fields, withNestedWorkflows, requestContext }) => {
327
- try {
328
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
329
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
330
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "Run ID is required" });
331
- const { workflow } = await listWorkflowsFromSystem({
332
- mastra,
333
- workflowId
334
- });
335
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
336
- const fieldList = fields ? fields.split(",").map((f) => f.trim()) : void 0;
337
- const run = await workflow.getWorkflowRunById(runId, {
338
- withNestedWorkflows: withNestedWorkflows !== "false",
339
- fields: fieldList
340
- });
341
- if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
342
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra);
343
- return run;
344
- } catch (error) {
345
- return require_server_handlers_error.handleError(error, "Error getting workflow run");
346
- }
347
- }
348
- });
349
- const DELETE_WORKFLOW_RUN_BY_ID_ROUTE = require_route_builder.createRoute({
350
- method: "DELETE",
351
- path: "/workflows/:workflowId/runs/:runId",
352
- responseType: "json",
353
- pathParamSchema: require_workflows.workflowRunPathParams,
354
- responseSchema: require_workflows.workflowControlResponseSchema,
355
- summary: "Delete workflow run by ID",
356
- description: "Deletes a specific workflow run by ID",
357
- tags: ["Workflows"],
358
- requiresAuth: true,
359
- handler: async ({ mastra, workflowId, runId, requestContext }) => {
360
- try {
361
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
362
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
363
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "Run ID is required" });
364
- const { workflow } = await listWorkflowsFromSystem({
365
- mastra,
366
- workflowId
367
- });
368
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
369
- const run = await workflow.getWorkflowRunById(runId);
370
- if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
371
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra);
372
- await workflow.deleteWorkflowRunById(runId);
373
- return { message: "Workflow run deleted" };
374
- } catch (error) {
375
- return require_server_handlers_error.handleError(error, "Error deleting workflow run");
376
- }
377
- }
378
- });
379
- const CREATE_WORKFLOW_RUN_ROUTE = require_route_builder.createRoute({
380
- method: "POST",
381
- path: "/workflows/:workflowId/create-run",
382
- responseType: "json",
383
- pathParamSchema: require_workflows.workflowIdPathParams,
384
- queryParamSchema: require_common.optionalRunIdSchema,
385
- bodySchema: require_workflows.createWorkflowRunBodySchema,
386
- responseSchema: require_workflows.createWorkflowRunResponseSchema,
387
- summary: "Create workflow run",
388
- description: "Creates a new workflow execution instance with an optional custom run ID",
389
- tags: ["Workflows"],
390
- requiresAuth: true,
391
- requiresPermission: ["workflows:write", "workflows:execute"],
392
- handler: async ({ mastra, workflowId, runId, resourceId, disableScorers, requestContext }) => {
393
- try {
394
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, resourceId);
395
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
396
- const { workflow } = await listWorkflowsFromSystem({
397
- mastra,
398
- workflowId
399
- });
400
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
401
- if (runId) await require_utils$1.validateRunOwnership(await workflow.getWorkflowRunById(runId, { withNestedWorkflows: false }), require_utils$1.getEffectiveResourceId(requestContext, void 0), mastra);
402
- return { runId: (await workflow.createRun({
403
- runId,
404
- resourceId: effectiveResourceId,
405
- disableScorers
406
- })).runId };
407
- } catch (error) {
408
- return require_server_handlers_error.handleError(error, "Error creating workflow run");
409
- }
410
- }
411
- });
412
- const STREAM_WORKFLOW_ROUTE = require_route_builder.createRoute({
413
- method: "POST",
414
- path: "/workflows/:workflowId/stream",
415
- responseType: "stream",
416
- pathParamSchema: require_workflows.workflowIdPathParams,
417
- queryParamSchema: require_common.runIdSchema,
418
- bodySchema: require_workflows.streamWorkflowBodySchema,
419
- summary: "Stream workflow execution",
420
- description: "Executes a workflow and streams the results in real-time",
421
- tags: ["Workflows"],
422
- requiresAuth: true,
423
- handler: async ({ mastra, workflowId, runId, resourceId, requestContext, ...params }) => {
424
- try {
425
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, resourceId);
426
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
427
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to stream workflow" });
428
- const { workflow } = await listWorkflowsFromSystem({
429
- mastra,
430
- workflowId
431
- });
432
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
433
- const existingRun = await workflow.getWorkflowRunById(runId, { withNestedWorkflows: false });
434
- await require_utils$1.validateRunOwnership(existingRun, require_utils$1.getEffectiveResourceId(requestContext, void 0), mastra);
435
- if (existingRun && TERMINAL_RUN_STATUSES.includes(existingRun.status)) throw new require_http_exception.HTTPException(409, { message: `Workflow run ${runId} already finished with status "${existingRun.status}". Use /observe to read its stream back, or stream a new runId.` });
436
- const serverCache = mastra.getServerCache();
437
- const result = (await workflow.createRun({
438
- runId,
439
- resourceId: effectiveResourceId
440
- })).stream({
441
- ...params,
442
- requestContext
443
- });
444
- if (serverCache) return cacheRunStream({
445
- cache: serverCache,
446
- runId,
447
- source: result.fullStream
448
- });
449
- return result.fullStream;
450
- } catch (error) {
451
- return require_server_handlers_error.handleError(error, "Error streaming workflow");
452
- }
453
- }
454
- });
455
- const RESUME_STREAM_WORKFLOW_ROUTE = require_route_builder.createRoute({
456
- method: "POST",
457
- path: "/workflows/:workflowId/resume-stream",
458
- responseType: "stream",
459
- pathParamSchema: require_workflows.workflowIdPathParams,
460
- queryParamSchema: require_common.runIdSchema,
461
- bodySchema: require_workflows.resumeBodySchema,
462
- responseSchema: require_agents.streamResponseSchema,
463
- summary: "Resume workflow stream",
464
- description: "Resumes a suspended workflow execution and continues streaming results",
465
- tags: ["Workflows"],
466
- requiresAuth: true,
467
- handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
468
- try {
469
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
470
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
471
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to resume workflow" });
472
- const { workflow } = await listWorkflowsFromSystem({
473
- mastra,
474
- workflowId
475
- });
476
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
477
- const run = await workflow.getWorkflowRunById(runId);
478
- if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
479
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra);
480
- const _run = await workflow.createRun({
481
- runId,
482
- resourceId: run.resourceId
483
- });
484
- const serverCache = mastra.getServerCache();
485
- const resumeResult = _run.resumeStream({
486
- ...params,
487
- requestContext
488
- });
489
- if (serverCache) return cacheRunStream({
490
- cache: serverCache,
491
- runId,
492
- source: resumeResult.fullStream
493
- });
494
- return resumeResult.fullStream;
495
- } catch (error) {
496
- return require_server_handlers_error.handleError(error, "Error resuming workflow");
497
- }
498
- }
499
- });
500
- const START_ASYNC_WORKFLOW_ROUTE = require_route_builder.createRoute({
501
- method: "POST",
502
- path: "/workflows/:workflowId/start-async",
503
- responseType: "json",
504
- pathParamSchema: require_workflows.workflowIdPathParams,
505
- queryParamSchema: require_common.optionalRunIdSchema,
506
- bodySchema: require_workflows.startAsyncWorkflowBodySchema,
507
- responseSchema: require_workflows.workflowExecutionResultSchema,
508
- summary: "Start workflow asynchronously",
509
- description: "Starts a workflow execution asynchronously without streaming results",
510
- tags: ["Workflows"],
511
- requiresAuth: true,
512
- handler: async ({ mastra, workflowId, runId, resourceId, requestContext, ...params }) => {
513
- try {
514
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, resourceId);
515
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
516
- const { workflow } = await listWorkflowsFromSystem({
517
- mastra,
518
- workflowId
519
- });
520
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
521
- if (runId) await require_utils$1.validateRunOwnership(await workflow.getWorkflowRunById(runId, { withNestedWorkflows: false }), require_utils$1.getEffectiveResourceId(requestContext, void 0), mastra);
522
- return await (await workflow.createRun({
523
- runId,
524
- resourceId: effectiveResourceId
525
- })).start({
526
- ...params,
527
- requestContext
528
- });
529
- } catch (error) {
530
- return require_server_handlers_error.handleError(error, "Error starting async workflow");
531
- }
532
- }
533
- });
534
- const START_WORKFLOW_RUN_ROUTE = require_route_builder.createRoute({
535
- method: "POST",
536
- path: "/workflows/:workflowId/start",
537
- responseType: "json",
538
- pathParamSchema: require_workflows.workflowIdPathParams,
539
- queryParamSchema: require_common.runIdSchema,
540
- bodySchema: require_workflows.startAsyncWorkflowBodySchema,
541
- responseSchema: require_workflows.workflowControlResponseSchema,
542
- summary: "Start specific workflow run",
543
- description: "Starts execution of a specific workflow run by ID",
544
- tags: ["Workflows"],
545
- requiresAuth: true,
546
- handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
547
- try {
548
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
549
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
550
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to start run" });
551
- const { workflow } = await listWorkflowsFromSystem({
552
- mastra,
553
- workflowId
554
- });
555
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
556
- const run = await workflow.getWorkflowRunById(runId);
557
- if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
558
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra);
559
- (await workflow.createRun({
560
- runId,
561
- resourceId: run.resourceId
562
- })).start({
563
- ...params,
564
- requestContext
565
- }).catch((error) => {
566
- mastra.getLogger().error("Failed to start workflow run", {
567
- error,
568
- workflowId,
569
- runId
570
- });
571
- });
572
- return { message: "Workflow run started" };
573
- } catch (e) {
574
- return require_server_handlers_error.handleError(e, "Error starting workflow run");
575
- }
576
- }
577
- });
578
- const OBSERVE_STREAM_WORKFLOW_ROUTE = require_route_builder.createRoute({
579
- method: "POST",
580
- path: "/workflows/:workflowId/observe",
581
- responseType: "stream",
582
- pathParamSchema: require_workflows.workflowIdPathParams,
583
- queryParamSchema: require_workflows.observeWorkflowQuerySchema,
584
- responseSchema: require_agents.streamResponseSchema,
585
- summary: "Observe workflow stream",
586
- description: "Observes and streams updates from an already running workflow execution. Supports position-based resume with offset for efficient reconnection.",
587
- tags: ["Workflows"],
588
- requiresAuth: true,
589
- handler: async ({ mastra, workflowId, runId, offset, requestContext }) => {
590
- try {
591
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
592
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
593
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to observe workflow stream" });
594
- const { workflow } = await listWorkflowsFromSystem({
595
- mastra,
596
- workflowId
597
- });
598
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
599
- const run = await workflow.getWorkflowRunById(runId);
600
- if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
601
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra);
602
- const _run = await workflow.createRun({
603
- runId,
604
- resourceId: run.resourceId
605
- });
606
- const serverCache = mastra.getServerCache();
607
- if (!serverCache) throw new require_http_exception.HTTPException(500, { message: "Server cache not found" });
608
- const startIndex = offset ?? 0;
609
- return (0, _mastra_core_stream.createReplayStream)({
610
- history: await serverCache.listFromTo(runId, startIndex),
611
- liveSource: _run.observeStream()
612
- });
613
- } catch (error) {
614
- return require_server_handlers_error.handleError(error, "Error observing workflow stream");
615
- }
616
- }
617
- });
618
- const RESUME_ASYNC_WORKFLOW_ROUTE = require_route_builder.createRoute({
619
- method: "POST",
620
- path: "/workflows/:workflowId/resume-async",
621
- responseType: "json",
622
- pathParamSchema: require_workflows.workflowIdPathParams,
623
- queryParamSchema: require_common.runIdSchema,
624
- bodySchema: require_workflows.resumeBodySchema,
625
- responseSchema: require_workflows.workflowExecutionResultSchema,
626
- summary: "Resume workflow asynchronously",
627
- description: "Resumes a suspended workflow execution asynchronously without streaming",
628
- tags: ["Workflows"],
629
- requiresAuth: true,
630
- handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
631
- try {
632
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
633
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
634
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to resume workflow" });
635
- const { workflow } = await listWorkflowsFromSystem({
636
- mastra,
637
- workflowId
638
- });
639
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
640
- const run = await workflow.getWorkflowRunById(runId);
641
- if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
642
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra);
643
- return await (await workflow.createRun({
644
- runId,
645
- resourceId: run.resourceId
646
- })).resume({
647
- ...params,
648
- requestContext
649
- });
650
- } catch (error) {
651
- return require_server_handlers_error.handleError(error, "Error resuming workflow step");
652
- }
653
- }
654
- });
655
- /**
656
- * Fire-and-forget resume: dispatches the resume and returns immediately with the runId,
657
- * without waiting for the workflow to complete. For Inngest-backed workflows this avoids
658
- * the `getRunOutput()` polling race that the awaiting `resume-async` route can hit.
659
- *
660
- * TODO(v2): in Mastra v2 this fire-and-forget behavior should become the behavior of the
661
- * `resume-async` route (and `Run.resumeAsync()`), and this route should be removed. It is
662
- * kept separate in v1 to avoid a breaking change to the existing `resume-async` response
663
- * contract (which returns the full workflow result).
664
- */
665
- const RESUME_NO_WAIT_WORKFLOW_ROUTE = require_route_builder.createRoute({
666
- method: "POST",
667
- path: "/workflows/:workflowId/resume-no-wait",
668
- responseType: "json",
669
- pathParamSchema: require_workflows.workflowIdPathParams,
670
- queryParamSchema: require_common.runIdSchema,
671
- bodySchema: require_workflows.resumeBodySchema,
672
- responseSchema: require_workflows.createWorkflowRunResponseSchema,
673
- summary: "Resume workflow without waiting",
674
- description: "Resumes a suspended workflow execution without waiting (fire-and-forget) and returns immediately with the runId. The workflow continues executing in the background.",
675
- tags: ["Workflows"],
676
- requiresAuth: true,
677
- handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
678
- try {
679
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
680
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
681
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to resume workflow" });
682
- const { workflow } = await listWorkflowsFromSystem({
683
- mastra,
684
- workflowId
685
- });
686
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
687
- const run = await workflow.getWorkflowRunById(runId);
688
- if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
689
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra);
690
- return await (await workflow.createRun({
691
- runId,
692
- resourceId: run.resourceId
693
- })).resumeAsync({
694
- ...params,
695
- requestContext
696
- });
697
- } catch (error) {
698
- return require_server_handlers_error.handleError(error, "Error resuming workflow step");
699
- }
700
- }
701
- });
702
- const RESUME_WORKFLOW_ROUTE = require_route_builder.createRoute({
703
- method: "POST",
704
- path: "/workflows/:workflowId/resume",
705
- responseType: "json",
706
- pathParamSchema: require_workflows.workflowIdPathParams,
707
- queryParamSchema: require_common.runIdSchema,
708
- bodySchema: require_workflows.resumeBodySchema,
709
- responseSchema: require_workflows.workflowControlResponseSchema,
710
- summary: "Resume workflow",
711
- description: "Resumes a suspended workflow execution from a specific step",
712
- tags: ["Workflows"],
713
- requiresAuth: true,
714
- handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
715
- try {
716
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
717
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
718
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to resume workflow" });
719
- const { workflow } = await listWorkflowsFromSystem({
720
- mastra,
721
- workflowId
722
- });
723
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
724
- const run = await workflow.getWorkflowRunById(runId);
725
- if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
726
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra);
727
- (await workflow.createRun({
728
- runId,
729
- resourceId: run.resourceId
730
- })).resume({
731
- ...params,
732
- requestContext
733
- }).catch((error) => {
734
- mastra.getLogger().error("Failed to resume workflow run", {
735
- error,
736
- workflowId,
737
- runId
738
- });
739
- });
740
- return { message: "Workflow run resumed" };
741
- } catch (error) {
742
- return require_server_handlers_error.handleError(error, "Error resuming workflow");
743
- }
744
- }
745
- });
746
- const RESTART_ASYNC_WORKFLOW_ROUTE = require_route_builder.createRoute({
747
- method: "POST",
748
- path: "/workflows/:workflowId/restart-async",
749
- responseType: "json",
750
- pathParamSchema: require_workflows.workflowIdPathParams,
751
- queryParamSchema: require_common.runIdSchema,
752
- bodySchema: require_workflows.restartBodySchema,
753
- responseSchema: require_workflows.workflowExecutionResultSchema,
754
- summary: "Restart workflow asynchronously",
755
- description: "Restarts an active workflow execution asynchronously",
756
- tags: ["Workflows"],
757
- requiresAuth: true,
758
- handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
759
- try {
760
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
761
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
762
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to restart workflow" });
763
- const { workflow } = await listWorkflowsFromSystem({
764
- mastra,
765
- workflowId
766
- });
767
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
768
- const run = await workflow.getWorkflowRunById(runId);
769
- if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
770
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra);
771
- return await (await workflow.createRun({
772
- runId,
773
- resourceId: run.resourceId
774
- })).restart({
775
- ...params,
776
- requestContext
777
- });
778
- } catch (error) {
779
- return require_server_handlers_error.handleError(error, "Error restarting workflow");
780
- }
781
- }
782
- });
783
- const RESTART_WORKFLOW_ROUTE = require_route_builder.createRoute({
784
- method: "POST",
785
- path: "/workflows/:workflowId/restart",
786
- responseType: "json",
787
- pathParamSchema: require_workflows.workflowIdPathParams,
788
- queryParamSchema: require_common.runIdSchema,
789
- bodySchema: require_workflows.restartBodySchema,
790
- responseSchema: require_workflows.workflowControlResponseSchema,
791
- summary: "Restart workflow",
792
- description: "Restarts an active workflow execution",
793
- tags: ["Workflows"],
794
- requiresAuth: true,
795
- handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
796
- try {
797
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
798
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
799
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to restart workflow" });
800
- const { workflow } = await listWorkflowsFromSystem({
801
- mastra,
802
- workflowId
803
- });
804
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
805
- const run = await workflow.getWorkflowRunById(runId);
806
- if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
807
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra);
808
- (await workflow.createRun({
809
- runId,
810
- resourceId: run.resourceId
811
- })).restart({
812
- ...params,
813
- requestContext
814
- }).catch((error) => {
815
- mastra.getLogger().error("Failed to restart workflow run in background", {
816
- error,
817
- workflowId,
818
- runId
819
- });
820
- });
821
- return { message: "Workflow run restarted" };
822
- } catch (error) {
823
- return require_server_handlers_error.handleError(error, "Error restarting workflow");
824
- }
825
- }
826
- });
827
- const RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE = require_route_builder.createRoute({
828
- method: "POST",
829
- path: "/workflows/:workflowId/restart-all-active-workflow-runs-async",
830
- responseType: "json",
831
- pathParamSchema: require_workflows.workflowIdPathParams,
832
- responseSchema: require_workflows.workflowControlResponseSchema,
833
- summary: "Restart all active workflow runs asynchronously",
834
- description: "Restarts all active workflow runs asynchronously",
835
- tags: ["Workflows"],
836
- requiresAuth: true,
837
- handler: async ({ mastra, workflowId, requestContext }) => {
838
- try {
839
- await require_utils$1.validateRunOwnership({ resourceId: null }, require_utils$1.getEffectiveResourceId(requestContext, void 0), mastra);
840
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
841
- const { workflow } = await listWorkflowsFromSystem({
842
- mastra,
843
- workflowId
844
- });
845
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
846
- await workflow.restartAllActiveWorkflowRuns();
847
- return { message: "All active workflow runs restarted" };
848
- } catch (error) {
849
- return require_server_handlers_error.handleError(error, "Error restarting workflow");
850
- }
851
- }
852
- });
853
- const RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE = require_route_builder.createRoute({
854
- method: "POST",
855
- path: "/workflows/:workflowId/restart-all-active-workflow-runs",
856
- responseType: "json",
857
- pathParamSchema: require_workflows.workflowIdPathParams,
858
- responseSchema: require_workflows.workflowControlResponseSchema,
859
- summary: "Restart all active workflow runs",
860
- description: "Restarts all active workflow runs",
861
- tags: ["Workflows"],
862
- requiresAuth: true,
863
- handler: async ({ mastra, workflowId, requestContext }) => {
864
- try {
865
- await require_utils$1.validateRunOwnership({ resourceId: null }, require_utils$1.getEffectiveResourceId(requestContext, void 0), mastra);
866
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
867
- const { workflow } = await listWorkflowsFromSystem({
868
- mastra,
869
- workflowId
870
- });
871
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
872
- workflow.restartAllActiveWorkflowRuns().catch((error) => {
873
- mastra.getLogger().error("Failed to restart active workflow runs", {
874
- error,
875
- workflowId
876
- });
877
- });
878
- return { message: "All active workflow runs restarted" };
879
- } catch (error) {
880
- return require_server_handlers_error.handleError(error, "Error restarting workflow");
881
- }
882
- }
883
- });
884
- const TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE = require_route_builder.createRoute({
885
- method: "POST",
886
- path: "/workflows/:workflowId/time-travel-async",
887
- responseType: "json",
888
- pathParamSchema: require_workflows.workflowIdPathParams,
889
- queryParamSchema: require_common.runIdSchema,
890
- bodySchema: require_workflows.timeTravelBodySchema,
891
- responseSchema: require_workflows.workflowExecutionResultSchema,
892
- summary: "Time travel workflow asynchronously",
893
- description: "Time travels a workflow run asynchronously without streaming",
894
- tags: ["Workflows"],
895
- requiresAuth: true,
896
- handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
897
- try {
898
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
899
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
900
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to time travel workflow" });
901
- const { workflow } = await listWorkflowsFromSystem({
902
- mastra,
903
- workflowId
904
- });
905
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
906
- const run = await workflow.getWorkflowRunById(runId);
907
- if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
908
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra);
909
- return await (await workflow.createRun({
910
- runId,
911
- resourceId: run.resourceId
912
- })).timeTravel({
913
- ...params,
914
- requestContext
915
- });
916
- } catch (error) {
917
- return require_server_handlers_error.handleError(error, "Error time traveling workflow");
918
- }
919
- }
920
- });
921
- const TIME_TRAVEL_WORKFLOW_ROUTE = require_route_builder.createRoute({
922
- method: "POST",
923
- path: "/workflows/:workflowId/time-travel",
924
- responseType: "json",
925
- pathParamSchema: require_workflows.workflowIdPathParams,
926
- queryParamSchema: require_common.runIdSchema,
927
- bodySchema: require_workflows.timeTravelBodySchema,
928
- responseSchema: require_workflows.workflowControlResponseSchema,
929
- summary: "Time travel workflow",
930
- description: "Time travels a workflow run, starting from a specific step",
931
- tags: ["Workflows"],
932
- requiresAuth: true,
933
- handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
934
- try {
935
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
936
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
937
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to time travel workflow" });
938
- const { workflow } = await listWorkflowsFromSystem({
939
- mastra,
940
- workflowId
941
- });
942
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
943
- const run = await workflow.getWorkflowRunById(runId);
944
- if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
945
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra);
946
- (await workflow.createRun({
947
- runId,
948
- resourceId: run.resourceId
949
- })).timeTravel({
950
- ...params,
951
- requestContext
952
- }).catch((error) => {
953
- mastra.getLogger().error("Failed to time travel workflow run", {
954
- error,
955
- workflowId,
956
- runId
957
- });
958
- });
959
- return { message: "Workflow run time travel started" };
960
- } catch (error) {
961
- return require_server_handlers_error.handleError(error, "Error time traveling workflow");
962
- }
963
- }
964
- });
965
- const TIME_TRAVEL_STREAM_WORKFLOW_ROUTE = require_route_builder.createRoute({
966
- method: "POST",
967
- path: "/workflows/:workflowId/time-travel-stream",
968
- responseType: "stream",
969
- pathParamSchema: require_workflows.workflowIdPathParams,
970
- queryParamSchema: require_common.runIdSchema,
971
- bodySchema: require_workflows.timeTravelBodySchema,
972
- summary: "Time travel workflow stream",
973
- description: "Time travels a workflow run, starting from a specific step, and streams the results in real-time",
974
- tags: ["Workflows"],
975
- requiresAuth: true,
976
- handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
977
- try {
978
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
979
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
980
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to time travel workflow stream" });
981
- const { workflow } = await listWorkflowsFromSystem({
982
- mastra,
983
- workflowId
984
- });
985
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
986
- const existingRun = await workflow.getWorkflowRunById(runId);
987
- if (!existingRun) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
988
- await require_utils$1.validateRunOwnership(existingRun, effectiveResourceId, mastra);
989
- const serverCache = mastra.getServerCache();
990
- const result = (await workflow.createRun({
991
- runId,
992
- resourceId: existingRun.resourceId
993
- })).timeTravelStream({
994
- ...params,
995
- requestContext
996
- });
997
- if (serverCache) return cacheRunStream({
998
- cache: serverCache,
999
- runId,
1000
- source: result.fullStream
1001
- });
1002
- return result.fullStream;
1003
- } catch (error) {
1004
- return require_server_handlers_error.handleError(error, "Error time traveling workflow stream");
1005
- }
1006
- }
1007
- });
1008
- const CANCEL_WORKFLOW_RUN_ROUTE = require_route_builder.createRoute({
1009
- method: "POST",
1010
- path: "/workflows/:workflowId/runs/:runId/cancel",
1011
- responseType: "json",
1012
- pathParamSchema: require_workflows.workflowRunPathParams,
1013
- responseSchema: require_workflows.workflowControlResponseSchema,
1014
- summary: "Cancel workflow run",
1015
- description: "Cancels an in-progress workflow execution",
1016
- tags: ["Workflows"],
1017
- requiresAuth: true,
1018
- handler: async ({ mastra, workflowId, runId, requestContext }) => {
1019
- try {
1020
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
1021
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
1022
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to cancel workflow run" });
1023
- const { workflow } = await listWorkflowsFromSystem({
1024
- mastra,
1025
- workflowId
1026
- });
1027
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
1028
- const run = await workflow.getWorkflowRunById(runId);
1029
- if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
1030
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra);
1031
- await (await workflow.createRun({
1032
- runId,
1033
- resourceId: run.resourceId
1034
- })).cancel();
1035
- return { message: "Workflow run cancelled" };
1036
- } catch (error) {
1037
- return require_server_handlers_error.handleError(error, "Error canceling workflow run");
1038
- }
1039
- }
1040
- });
1041
- const STREAM_LEGACY_WORKFLOW_ROUTE = require_route_builder.createRoute({
1042
- method: "POST",
1043
- path: "/workflows/:workflowId/stream-legacy",
1044
- responseType: "stream",
1045
- pathParamSchema: require_workflows.workflowIdPathParams,
1046
- queryParamSchema: require_common.runIdSchema,
1047
- bodySchema: require_workflows.streamWorkflowBodySchema,
1048
- responseSchema: require_agents.streamResponseSchema,
1049
- summary: "[DEPRECATED] Stream workflow with legacy format",
1050
- description: "Legacy endpoint for streaming workflow execution. Use /workflows/:workflowId/stream instead.",
1051
- tags: ["Workflows", "Legacy"],
1052
- requiresAuth: true,
1053
- handler: async ({ mastra, workflowId, runId, resourceId, requestContext, ...params }) => {
1054
- try {
1055
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, resourceId);
1056
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
1057
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to resume workflow" });
1058
- const { workflow } = await listWorkflowsFromSystem({
1059
- mastra,
1060
- workflowId
1061
- });
1062
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
1063
- const serverCache = mastra.getServerCache();
1064
- if (runId) await require_utils$1.validateRunOwnership(await workflow.getWorkflowRunById(runId, { withNestedWorkflows: false }), require_utils$1.getEffectiveResourceId(requestContext, void 0), mastra);
1065
- return (await workflow.createRun({
1066
- runId,
1067
- resourceId: effectiveResourceId
1068
- })).streamLegacy({
1069
- ...params,
1070
- requestContext,
1071
- onChunk: async (chunk) => {
1072
- if (serverCache) {
1073
- const cacheKey = runId;
1074
- await serverCache.listPush(cacheKey, chunk);
1075
- }
1076
- }
1077
- }).stream;
1078
- } catch (error) {
1079
- return require_server_handlers_error.handleError(error, "Error executing workflow");
1080
- }
1081
- }
1082
- });
1083
- const OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE = require_route_builder.createRoute({
1084
- method: "POST",
1085
- path: "/workflows/:workflowId/observe-stream-legacy",
1086
- responseType: "stream",
1087
- pathParamSchema: require_workflows.workflowIdPathParams,
1088
- queryParamSchema: require_common.runIdSchema,
1089
- responseSchema: require_agents.streamResponseSchema,
1090
- summary: "[DEPRECATED] Observe workflow stream with legacy format",
1091
- description: "Legacy endpoint for observing workflow stream. Use /workflows/:workflowId/observe instead.",
1092
- tags: ["Workflows", "Legacy"],
1093
- requiresAuth: true,
1094
- handler: async ({ mastra, workflowId, runId, requestContext }) => {
1095
- try {
1096
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
1097
- if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
1098
- if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to observe workflow stream" });
1099
- const { workflow } = await listWorkflowsFromSystem({
1100
- mastra,
1101
- workflowId
1102
- });
1103
- if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
1104
- const run = await workflow.getWorkflowRunById(runId);
1105
- if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
1106
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra);
1107
- const _run = await workflow.createRun({
1108
- runId,
1109
- resourceId: run.resourceId
1110
- });
1111
- const serverCache = mastra.getServerCache();
1112
- if (!serverCache) throw new require_http_exception.HTTPException(500, { message: "Server cache not found" });
1113
- const cachedRunChunks = await serverCache.listFromTo(runId, 0);
1114
- const result = _run.observeStreamLegacy();
1115
- if (!result.stream) throw new require_http_exception.HTTPException(500, { message: "Failed to create observe stream" });
1116
- return (0, _mastra_core_stream.createReplayStream)({
1117
- history: cachedRunChunks,
1118
- liveSource: result.stream
1119
- });
1120
- } catch (error) {
1121
- return require_server_handlers_error.handleError(error, "Error observing workflow stream");
1122
- }
1123
- }
1124
- });
1125
- const stepExecutionParentWorkflowSchema = zod_v4.z.lazy(() => zod_v4.z.object({
1126
- workflowId: zod_v4.z.string(),
1127
- runId: zod_v4.z.string(),
1128
- executionPath: zod_v4.z.array(zod_v4.z.number().int().nonnegative()),
1129
- parentWorkflow: stepExecutionParentWorkflowSchema.optional()
1130
- }));
1131
- const stepExecutionBodySchema = zod_v4.z.object({
1132
- stepId: zod_v4.z.string(),
1133
- executionPath: zod_v4.z.array(zod_v4.z.number().int().nonnegative()),
1134
- parentWorkflow: stepExecutionParentWorkflowSchema.optional(),
1135
- stepResults: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.unknown()),
1136
- state: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.unknown()),
1137
- requestContext: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.unknown()),
1138
- input: zod_v4.z.unknown().optional(),
1139
- resumeData: zod_v4.z.unknown().optional(),
1140
- retryCount: zod_v4.z.number().int().nonnegative().optional(),
1141
- foreachIdx: zod_v4.z.number().int().nonnegative().optional(),
1142
- format: zod_v4.z.enum(["legacy", "vnext"]).optional(),
1143
- perStep: zod_v4.z.boolean().optional(),
1144
- validateInputs: zod_v4.z.boolean().optional()
1145
- });
1146
- const strategyByMastra = /* @__PURE__ */ new WeakMap();
1147
- async function getStepStrategy(mastra) {
1148
- let cached = strategyByMastra.get(mastra);
1149
- if (!cached) {
1150
- const { InProcessStrategy } = await import("@mastra/core/worker");
1151
- cached = new InProcessStrategy({ mastra });
1152
- strategyByMastra.set(mastra, cached);
1153
- }
1154
- return cached;
1155
- }
1156
- const stepExecutionResponseSchema = zod_v4.z.unknown();
1157
- const EXECUTE_WORKFLOW_STEP_ROUTE = require_route_builder.createRoute({
1158
- method: "POST",
1159
- path: "/workflows/:workflowId/runs/:runId/steps/execute",
1160
- responseType: "json",
1161
- pathParamSchema: require_workflows.workflowRunPathParams,
1162
- bodySchema: stepExecutionBodySchema,
1163
- responseSchema: stepExecutionResponseSchema,
1164
- summary: "Execute a workflow step",
1165
- description: "Internal endpoint used by standalone OrchestrationWorker instances to execute workflow steps remotely via HttpRemoteStrategy.",
1166
- tags: ["Workflows", "Worker"],
1167
- requiresAuth: true,
1168
- handler: (async ({ mastra, workflowId, runId, ...body }) => {
1169
- try {
1170
- const candidate = body.requestContext;
1171
- const serverRequestContext = typeof candidate?.get === "function" ? candidate : void 0;
1172
- await require_utils$1.validateRunOwnership(await (await mastra.getStorage()?.getStore("workflows"))?.getWorkflowRunById({
1173
- runId,
1174
- workflowName: workflowId
1175
- }), require_utils$1.getEffectiveResourceId(serverRequestContext, void 0), mastra);
1176
- return await (await getStepStrategy(mastra)).executeStep({
1177
- workflowId,
1178
- runId,
1179
- stepId: body.stepId,
1180
- executionPath: body.executionPath,
1181
- parentWorkflow: body.parentWorkflow,
1182
- stepResults: body.stepResults,
1183
- state: body.state,
1184
- requestContext: body.requestContext,
1185
- input: body.input,
1186
- resumeData: body.resumeData,
1187
- retryCount: body.retryCount,
1188
- foreachIdx: body.foreachIdx,
1189
- format: body.format,
1190
- perStep: body.perStep,
1191
- validateInputs: body.validateInputs
1192
- });
1193
- } catch (error) {
1194
- return require_server_handlers_error.handleError(error, "Error executing workflow step");
1195
- }
1196
- })
1197
- });
1198
- const workflowEventSchema = zod_v4.z.object({
1199
- id: zod_v4.z.string(),
1200
- type: zod_v4.z.string(),
1201
- data: zod_v4.z.unknown(),
1202
- runId: zod_v4.z.string(),
1203
- createdAt: zod_v4.z.string(),
1204
- index: zod_v4.z.number().optional(),
1205
- deliveryAttempt: zod_v4.z.number().optional()
1206
- });
1207
- const receiveWorkflowEventBodySchema = zod_v4.z.object({ event: workflowEventSchema.passthrough() });
1208
- const receiveWorkflowEventResponseSchema = zod_v4.z.object({
1209
- ok: zod_v4.z.boolean(),
1210
- retry: zod_v4.z.boolean().optional()
1211
- });
1212
- /**
1213
- * Generic push receive endpoint for workflow events. A push-mode broker
1214
- * (GCP Pub/Sub push subscription, SNS, EventBridge) — or a per-broker adapter
1215
- * that decodes the broker's envelope first — POSTs each event here and the
1216
- * response code tells the broker whether to retry:
1217
- *
1218
- * - 200/204 → ack
1219
- * - 5xx → transient, retry with backoff
1220
- * - 4xx → poison, drop / send to DLQ
1221
- *
1222
- * Auth is enforced through the framework's standard `requiresAuth` flow.
1223
- * Operators MUST configure an `authenticateToken` provider that recognizes
1224
- * whatever credential the broker attaches (e.g. a Google-signed OIDC token
1225
- * for GCP Pub/Sub push). Without an auth provider the endpoint is effectively
1226
- * public — same caveat as `EXECUTE_WORKFLOW_STEP_ROUTE`.
1227
- */
1228
- const RECEIVE_WORKFLOW_EVENT_ROUTE = require_route_builder.createRoute({
1229
- method: "POST",
1230
- path: "/workflows/events",
1231
- responseType: "json",
1232
- bodySchema: receiveWorkflowEventBodySchema,
1233
- responseSchema: receiveWorkflowEventResponseSchema,
1234
- summary: "Receive a workflow event from a push-mode broker",
1235
- description: "Push-mode entry point for workflow events. Brokers (GCP Pub/Sub push, SNS, EventBridge) POST each event here; Mastra processes it through the same pipeline as pull-mode workers.",
1236
- tags: ["Workflows", "Worker"],
1237
- requiresAuth: true,
1238
- requiresPermission: ["workflows:write", "workflows:execute"],
1239
- handler: (async ({ mastra, event, requestContext }) => {
1240
- try {
1241
- const workflowName = event.data?.workflowId;
1242
- await require_utils$1.validateRunOwnership(await (await mastra.getStorage()?.getStore("workflows"))?.getWorkflowRunById({
1243
- runId: event.runId,
1244
- ...typeof workflowName === "string" ? { workflowName } : {}
1245
- }), require_utils$1.getEffectiveResourceId(requestContext, void 0), mastra);
1246
- const rawCreatedAt = event.createdAt;
1247
- const createdAt = rawCreatedAt instanceof Date ? rawCreatedAt : new Date(rawCreatedAt);
1248
- if (Number.isNaN(createdAt.getTime())) throw new require_http_exception.HTTPException(400, { message: "Invalid createdAt" });
1249
- return await mastra.handleWorkflowEvent({
1250
- ...event,
1251
- createdAt
1252
- });
1253
- } catch (error) {
1254
- return require_server_handlers_error.handleError(error, "Error receiving workflow event");
1255
- }
1256
- })
1257
- });
1258
- //#endregion
1259
- exports.CANCEL_WORKFLOW_RUN_ROUTE = CANCEL_WORKFLOW_RUN_ROUTE;
1260
- exports.CREATE_WORKFLOW_RUN_ROUTE = CREATE_WORKFLOW_RUN_ROUTE;
1261
- exports.DELETE_WORKFLOW_RUN_BY_ID_ROUTE = DELETE_WORKFLOW_RUN_BY_ID_ROUTE;
1262
- exports.EXECUTE_WORKFLOW_STEP_ROUTE = EXECUTE_WORKFLOW_STEP_ROUTE;
1263
- exports.GET_WORKFLOW_BY_ID_ROUTE = GET_WORKFLOW_BY_ID_ROUTE;
1264
- exports.GET_WORKFLOW_RUN_BY_ID_ROUTE = GET_WORKFLOW_RUN_BY_ID_ROUTE;
1265
- exports.LIST_WORKFLOWS_ROUTE = LIST_WORKFLOWS_ROUTE;
1266
- exports.LIST_WORKFLOW_RUNS_ROUTE = LIST_WORKFLOW_RUNS_ROUTE;
1267
- exports.LIST_WORKFLOW_RUN_COUNTS_ROUTE = LIST_WORKFLOW_RUN_COUNTS_ROUTE;
1268
- exports.OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE = OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE;
1269
- exports.OBSERVE_STREAM_WORKFLOW_ROUTE = OBSERVE_STREAM_WORKFLOW_ROUTE;
1270
- exports.RECEIVE_WORKFLOW_EVENT_ROUTE = RECEIVE_WORKFLOW_EVENT_ROUTE;
1271
- exports.RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE = RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE;
1272
- exports.RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE = RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE;
1273
- exports.RESTART_ASYNC_WORKFLOW_ROUTE = RESTART_ASYNC_WORKFLOW_ROUTE;
1274
- exports.RESTART_WORKFLOW_ROUTE = RESTART_WORKFLOW_ROUTE;
1275
- exports.RESUME_ASYNC_WORKFLOW_ROUTE = RESUME_ASYNC_WORKFLOW_ROUTE;
1276
- exports.RESUME_NO_WAIT_WORKFLOW_ROUTE = RESUME_NO_WAIT_WORKFLOW_ROUTE;
1277
- exports.RESUME_STREAM_WORKFLOW_ROUTE = RESUME_STREAM_WORKFLOW_ROUTE;
1278
- exports.RESUME_WORKFLOW_ROUTE = RESUME_WORKFLOW_ROUTE;
1279
- exports.START_ASYNC_WORKFLOW_ROUTE = START_ASYNC_WORKFLOW_ROUTE;
1280
- exports.START_WORKFLOW_RUN_ROUTE = START_WORKFLOW_RUN_ROUTE;
1281
- exports.STREAM_LEGACY_WORKFLOW_ROUTE = STREAM_LEGACY_WORKFLOW_ROUTE;
1282
- exports.STREAM_WORKFLOW_ROUTE = STREAM_WORKFLOW_ROUTE;
1283
- exports.TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE = TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE;
1284
- exports.TIME_TRAVEL_STREAM_WORKFLOW_ROUTE = TIME_TRAVEL_STREAM_WORKFLOW_ROUTE;
1285
- exports.TIME_TRAVEL_WORKFLOW_ROUTE = TIME_TRAVEL_WORKFLOW_ROUTE;
1286
- exports.__setWorkflowRunCountsNow = __setWorkflowRunCountsNow;
1287
- Object.defineProperty(exports, "workflows_exports", {
1288
- enumerable: true,
1289
- get: function() {
1290
- return workflows_exports;
1291
- }
1292
- });
1293
-
1294
- //# sourceMappingURL=workflows.cjs.map
2
+ require("../../rolldown-runtime-BwC_XMyb.cjs");
3
+ const require_workflows = require("../../workflows-DjqeJcdJ.cjs");
4
+ exports.CANCEL_WORKFLOW_RUN_ROUTE = require_workflows.CANCEL_WORKFLOW_RUN_ROUTE;
5
+ exports.CREATE_WORKFLOW_RUN_ROUTE = require_workflows.CREATE_WORKFLOW_RUN_ROUTE;
6
+ exports.DELETE_WORKFLOW_RUN_BY_ID_ROUTE = require_workflows.DELETE_WORKFLOW_RUN_BY_ID_ROUTE;
7
+ exports.EXECUTE_WORKFLOW_STEP_ROUTE = require_workflows.EXECUTE_WORKFLOW_STEP_ROUTE;
8
+ exports.GET_WORKFLOW_BY_ID_ROUTE = require_workflows.GET_WORKFLOW_BY_ID_ROUTE;
9
+ exports.GET_WORKFLOW_RUN_BY_ID_ROUTE = require_workflows.GET_WORKFLOW_RUN_BY_ID_ROUTE;
10
+ exports.LIST_WORKFLOWS_ROUTE = require_workflows.LIST_WORKFLOWS_ROUTE;
11
+ exports.LIST_WORKFLOW_RUNS_ROUTE = require_workflows.LIST_WORKFLOW_RUNS_ROUTE;
12
+ exports.LIST_WORKFLOW_RUN_COUNTS_ROUTE = require_workflows.LIST_WORKFLOW_RUN_COUNTS_ROUTE;
13
+ exports.OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE = require_workflows.OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE;
14
+ exports.OBSERVE_STREAM_WORKFLOW_ROUTE = require_workflows.OBSERVE_STREAM_WORKFLOW_ROUTE;
15
+ exports.RECEIVE_WORKFLOW_EVENT_ROUTE = require_workflows.RECEIVE_WORKFLOW_EVENT_ROUTE;
16
+ exports.RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE = require_workflows.RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE;
17
+ exports.RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE = require_workflows.RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE;
18
+ exports.RESTART_ASYNC_WORKFLOW_ROUTE = require_workflows.RESTART_ASYNC_WORKFLOW_ROUTE;
19
+ exports.RESTART_WORKFLOW_ROUTE = require_workflows.RESTART_WORKFLOW_ROUTE;
20
+ exports.RESUME_ASYNC_WORKFLOW_ROUTE = require_workflows.RESUME_ASYNC_WORKFLOW_ROUTE;
21
+ exports.RESUME_NO_WAIT_WORKFLOW_ROUTE = require_workflows.RESUME_NO_WAIT_WORKFLOW_ROUTE;
22
+ exports.RESUME_STREAM_WORKFLOW_ROUTE = require_workflows.RESUME_STREAM_WORKFLOW_ROUTE;
23
+ exports.RESUME_WORKFLOW_ROUTE = require_workflows.RESUME_WORKFLOW_ROUTE;
24
+ exports.START_ASYNC_WORKFLOW_ROUTE = require_workflows.START_ASYNC_WORKFLOW_ROUTE;
25
+ exports.START_WORKFLOW_RUN_ROUTE = require_workflows.START_WORKFLOW_RUN_ROUTE;
26
+ exports.STREAM_LEGACY_WORKFLOW_ROUTE = require_workflows.STREAM_LEGACY_WORKFLOW_ROUTE;
27
+ exports.STREAM_WORKFLOW_ROUTE = require_workflows.STREAM_WORKFLOW_ROUTE;
28
+ exports.TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE = require_workflows.TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE;
29
+ exports.TIME_TRAVEL_STREAM_WORKFLOW_ROUTE = require_workflows.TIME_TRAVEL_STREAM_WORKFLOW_ROUTE;
30
+ exports.TIME_TRAVEL_WORKFLOW_ROUTE = require_workflows.TIME_TRAVEL_WORKFLOW_ROUTE;
31
+ exports.__setWorkflowRunCountsNow = require_workflows.__setWorkflowRunCountsNow;