@mastra/server 0.0.0-span-scorring-test-20251124132129 → 0.0.0-standard-schema-20260126101119

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 (402) hide show
  1. package/CHANGELOG.md +1811 -32
  2. package/README.md +2 -2
  3. package/a2a/store.d.ts +1 -0
  4. package/auth.d.ts +1 -0
  5. package/dist/{chunk-SHWNNZBL.js → chunk-24SISJRB.js} +13 -17
  6. package/dist/chunk-24SISJRB.js.map +1 -0
  7. package/dist/chunk-2VUOF2MV.cjs +190 -0
  8. package/dist/chunk-2VUOF2MV.cjs.map +1 -0
  9. package/dist/chunk-3JOHBO6Z.cjs +603 -0
  10. package/dist/chunk-3JOHBO6Z.cjs.map +1 -0
  11. package/dist/chunk-3W67K7YE.js +13 -0
  12. package/dist/chunk-3W67K7YE.js.map +1 -0
  13. package/dist/{chunk-ASZUOBKV.js → chunk-47MMB22J.js} +42 -20
  14. package/dist/chunk-47MMB22J.js.map +1 -0
  15. package/dist/chunk-4HFYR562.cjs +82 -0
  16. package/dist/chunk-4HFYR562.cjs.map +1 -0
  17. package/dist/chunk-55TH4ME5.js +170 -0
  18. package/dist/chunk-55TH4ME5.js.map +1 -0
  19. package/dist/chunk-5WFQ4ZBQ.cjs +31787 -0
  20. package/dist/chunk-5WFQ4ZBQ.cjs.map +1 -0
  21. package/dist/{chunk-QU6N55W6.cjs → chunk-6G2RQWKA.cjs} +17 -21
  22. package/dist/chunk-6G2RQWKA.cjs.map +1 -0
  23. package/dist/{chunk-ZLRTFRL4.js → chunk-6GFG23PC.js} +407 -91
  24. package/dist/chunk-6GFG23PC.js.map +1 -0
  25. package/dist/{chunk-UXGQZUYZ.js → chunk-7AINN3FK.js} +13 -3
  26. package/dist/chunk-7AINN3FK.js.map +1 -0
  27. package/dist/chunk-7D3UAMQM.cjs +82 -0
  28. package/dist/chunk-7D3UAMQM.cjs.map +1 -0
  29. package/dist/chunk-ASLDC3OZ.cjs +450 -0
  30. package/dist/chunk-ASLDC3OZ.cjs.map +1 -0
  31. package/dist/{chunk-QGWCNTG6.cjs → chunk-C3FFJPAW.cjs} +493 -172
  32. package/dist/chunk-C3FFJPAW.cjs.map +1 -0
  33. package/dist/{chunk-3R5EV3HV.js → chunk-C7GSYEQP.js} +36 -29
  34. package/dist/chunk-C7GSYEQP.js.map +1 -0
  35. package/dist/chunk-CK632IRI.cjs +47 -0
  36. package/dist/chunk-CK632IRI.cjs.map +1 -0
  37. package/dist/{chunk-R4M3BSUG.js → chunk-DOU5IGJB.js} +26 -10
  38. package/dist/chunk-DOU5IGJB.js.map +1 -0
  39. package/dist/{chunk-6DTV6NEW.js → chunk-DP474KY4.js} +11 -8
  40. package/dist/chunk-DP474KY4.js.map +1 -0
  41. package/dist/{chunk-FXDZLX2Y.js → chunk-DUVMVT64.js} +37 -26
  42. package/dist/chunk-DUVMVT64.js.map +1 -0
  43. package/dist/chunk-F2IYPGYA.cjs +322 -0
  44. package/dist/chunk-F2IYPGYA.cjs.map +1 -0
  45. package/dist/{chunk-VQAT5HX6.js → chunk-FDSHHJRG.js} +458 -116
  46. package/dist/chunk-FDSHHJRG.js.map +1 -0
  47. package/dist/chunk-FRRHYZR6.cjs +88 -0
  48. package/dist/chunk-FRRHYZR6.cjs.map +1 -0
  49. package/dist/{chunk-ZULZ2752.js → chunk-FXW7MD4U.js} +3 -3
  50. package/dist/chunk-FXW7MD4U.js.map +1 -0
  51. package/dist/chunk-G2F73L4P.js +45 -0
  52. package/dist/chunk-G2F73L4P.js.map +1 -0
  53. package/dist/{chunk-UOFV2ZCI.js → chunk-G3C3UIEK.js} +316 -96
  54. package/dist/chunk-G3C3UIEK.js.map +1 -0
  55. package/dist/chunk-GIMXFF2O.js +31748 -0
  56. package/dist/chunk-GIMXFF2O.js.map +1 -0
  57. package/dist/{chunk-YJ3VDL3Z.cjs → chunk-GZFULNC5.cjs} +37 -31
  58. package/dist/chunk-GZFULNC5.cjs.map +1 -0
  59. package/dist/{chunk-4ECGVOJZ.cjs → chunk-HAZKO3MH.cjs} +40 -33
  60. package/dist/chunk-HAZKO3MH.cjs.map +1 -0
  61. package/dist/{chunk-KB5NSROG.cjs → chunk-HKK5WZO5.cjs} +47 -42
  62. package/dist/chunk-HKK5WZO5.cjs.map +1 -0
  63. package/dist/{chunk-UZ6CYAOG.cjs → chunk-HQHCI62G.cjs} +62 -15
  64. package/dist/chunk-HQHCI62G.cjs.map +1 -0
  65. package/dist/{chunk-PKRHEXX7.js → chunk-HT4LP3BO.js} +19 -18
  66. package/dist/chunk-HT4LP3BO.js.map +1 -0
  67. package/dist/chunk-HZINLMHL.cjs +252 -0
  68. package/dist/chunk-HZINLMHL.cjs.map +1 -0
  69. package/dist/{chunk-RQK4FQUD.js → chunk-IGXRQWNN.js} +6 -48
  70. package/dist/chunk-IGXRQWNN.js.map +1 -0
  71. package/dist/chunk-IS3HHGL4.js +250 -0
  72. package/dist/chunk-IS3HHGL4.js.map +1 -0
  73. package/dist/chunk-JW2MKBAS.js +246 -0
  74. package/dist/chunk-JW2MKBAS.js.map +1 -0
  75. package/dist/chunk-K4HSW5ZF.js +77 -0
  76. package/dist/chunk-K4HSW5ZF.js.map +1 -0
  77. package/dist/chunk-LJ6YRVDI.cjs +15 -0
  78. package/dist/chunk-LJ6YRVDI.cjs.map +1 -0
  79. package/dist/{chunk-I5VZ5SKG.js → chunk-LNWEFD7L.js} +17 -11
  80. package/dist/chunk-LNWEFD7L.js.map +1 -0
  81. package/dist/{chunk-2NW6POYK.cjs → chunk-MCYD5LW7.cjs} +19 -18
  82. package/dist/chunk-MCYD5LW7.cjs.map +1 -0
  83. package/dist/{chunk-UJNHKFBR.cjs → chunk-N2HDS7BY.cjs} +83 -13
  84. package/dist/chunk-N2HDS7BY.cjs.map +1 -0
  85. package/dist/{chunk-FAQICBMH.js → chunk-N5RGHD5P.js} +81 -14
  86. package/dist/chunk-N5RGHD5P.js.map +1 -0
  87. package/dist/{chunk-MWQQRVQC.cjs → chunk-OD6Y7FEM.cjs} +34 -13
  88. package/dist/chunk-OD6Y7FEM.cjs.map +1 -0
  89. package/dist/chunk-OEF6DYI4.js +177 -0
  90. package/dist/chunk-OEF6DYI4.js.map +1 -0
  91. package/dist/chunk-OGFXTALR.js +312 -0
  92. package/dist/chunk-OGFXTALR.js.map +1 -0
  93. package/dist/{chunk-ICANWSEW.js → chunk-OJWVANX3.js} +25 -20
  94. package/dist/chunk-OJWVANX3.js.map +1 -0
  95. package/dist/chunk-OS7SAIRA.js +250 -0
  96. package/dist/chunk-OS7SAIRA.js.map +1 -0
  97. package/dist/chunk-OSJ3HUP2.js +184 -0
  98. package/dist/chunk-OSJ3HUP2.js.map +1 -0
  99. package/dist/chunk-PWXUI3OG.cjs +252 -0
  100. package/dist/chunk-PWXUI3OG.cjs.map +1 -0
  101. package/dist/{chunk-Z36N2OQA.cjs → chunk-PXQDIUYD.cjs} +358 -137
  102. package/dist/chunk-PXQDIUYD.cjs.map +1 -0
  103. package/dist/{chunk-NDFAQBQD.cjs → chunk-PXTREZVA.cjs} +514 -166
  104. package/dist/chunk-PXTREZVA.cjs.map +1 -0
  105. package/dist/chunk-Q3SOCUG3.js +576 -0
  106. package/dist/chunk-Q3SOCUG3.js.map +1 -0
  107. package/dist/chunk-QHJ75L3U.cjs +252 -0
  108. package/dist/chunk-QHJ75L3U.cjs.map +1 -0
  109. package/dist/chunk-RIX6WEJ2.js +83 -0
  110. package/dist/chunk-RIX6WEJ2.js.map +1 -0
  111. package/dist/{chunk-ZODCSH2W.cjs → chunk-RYU5JLTE.cjs} +54 -32
  112. package/dist/chunk-RYU5JLTE.cjs.map +1 -0
  113. package/dist/{chunk-35NT4TMQ.cjs → chunk-SI45XQYH.cjs} +66 -55
  114. package/dist/chunk-SI45XQYH.cjs.map +1 -0
  115. package/dist/{chunk-LPM6BBAX.cjs → chunk-SLDAFSKJ.cjs} +5 -56
  116. package/dist/chunk-SLDAFSKJ.cjs.map +1 -0
  117. package/dist/{chunk-2PLXW4ZX.cjs → chunk-T6YYVQHJ.cjs} +74 -74
  118. package/dist/chunk-T6YYVQHJ.cjs.map +1 -0
  119. package/dist/chunk-TF4LSD27.cjs +180 -0
  120. package/dist/chunk-TF4LSD27.cjs.map +1 -0
  121. package/dist/{chunk-V5WWQN7P.cjs → chunk-UWYAL2Z3.cjs} +13 -2
  122. package/dist/chunk-UWYAL2Z3.cjs.map +1 -0
  123. package/dist/chunk-WNI2WZML.js +442 -0
  124. package/dist/chunk-WNI2WZML.js.map +1 -0
  125. package/dist/{chunk-5PONYNYP.cjs → chunk-WTF4ECYJ.cjs} +20 -17
  126. package/dist/chunk-WTF4ECYJ.cjs.map +1 -0
  127. package/dist/chunk-XKLJYRAA.js +77 -0
  128. package/dist/chunk-XKLJYRAA.js.map +1 -0
  129. package/dist/{dist-G2BYZJOC.cjs → dist-2GQKYJ34.cjs} +28 -28
  130. package/dist/dist-2GQKYJ34.cjs.map +1 -0
  131. package/dist/{dist-X7XR3M3Z.js → dist-C6BUHOEE.js} +3 -3
  132. package/dist/dist-C6BUHOEE.js.map +1 -0
  133. package/dist/dist-DGOEFPQD.cjs +16 -0
  134. package/dist/{dist-P4MXBQ3U.cjs.map → dist-DGOEFPQD.cjs.map} +1 -1
  135. package/dist/dist-FT2OR7OS.js +3 -0
  136. package/dist/{dist-YREX2TJT.js.map → dist-FT2OR7OS.js.map} +1 -1
  137. package/dist/{dist-XVBSOGFK.js → dist-G4CR4WYY.js} +3 -3
  138. package/dist/dist-G4CR4WYY.js.map +1 -0
  139. package/dist/{dist-PQZUVLPC.js → dist-G5QFRYLQ.js} +3 -3
  140. package/dist/dist-G5QFRYLQ.js.map +1 -0
  141. package/dist/{dist-4MVGNSRL.cjs → dist-JPQK5S4K.cjs} +20 -20
  142. package/dist/dist-JPQK5S4K.cjs.map +1 -0
  143. package/dist/{dist-R7WYX6LC.js → dist-MIDN25GT.js} +3 -3
  144. package/dist/dist-MIDN25GT.js.map +1 -0
  145. package/dist/{dist-RFMYFILX.cjs → dist-SNKH6NS2.cjs} +30 -30
  146. package/dist/dist-SNKH6NS2.cjs.map +1 -0
  147. package/dist/{dist-FZYCV3VB.cjs → dist-XBQPKAO4.cjs} +26 -26
  148. package/dist/dist-XBQPKAO4.cjs.map +1 -0
  149. package/dist/docs/README.md +31 -0
  150. package/dist/docs/SKILL.md +32 -0
  151. package/dist/docs/SOURCE_MAP.json +6 -0
  152. package/dist/docs/server/01-custom-adapters.md +380 -0
  153. package/dist/docs/server/02-reference.md +819 -0
  154. package/dist/server/auth/defaults.d.ts +3 -0
  155. package/dist/server/auth/defaults.d.ts.map +1 -0
  156. package/dist/server/auth/helpers.d.ts +14 -0
  157. package/dist/server/auth/helpers.d.ts.map +1 -0
  158. package/dist/server/auth/index.cjs +44 -0
  159. package/dist/server/auth/index.cjs.map +1 -0
  160. package/dist/server/auth/index.d.ts +3 -0
  161. package/dist/server/auth/index.d.ts.map +1 -0
  162. package/dist/server/auth/index.js +3 -0
  163. package/dist/server/auth/index.js.map +1 -0
  164. package/dist/server/auth/path-pattern.d.ts +43 -0
  165. package/dist/server/auth/path-pattern.d.ts.map +1 -0
  166. package/dist/server/handlers/a2a.cjs +9 -9
  167. package/dist/server/handlers/a2a.d.ts +34 -420
  168. package/dist/server/handlers/a2a.d.ts.map +1 -1
  169. package/dist/server/handlers/a2a.js +1 -1
  170. package/dist/server/handlers/agent-builder.cjs +16 -28
  171. package/dist/server/handlers/agent-builder.d.ts +154 -460
  172. package/dist/server/handlers/agent-builder.d.ts.map +1 -1
  173. package/dist/server/handlers/agent-builder.js +1 -1
  174. package/dist/server/handlers/agent-versions.cjs +60 -0
  175. package/dist/server/handlers/agent-versions.cjs.map +1 -0
  176. package/dist/server/handlers/agent-versions.d.ts +425 -0
  177. package/dist/server/handlers/agent-versions.d.ts.map +1 -0
  178. package/dist/server/handlers/agent-versions.js +3 -0
  179. package/dist/server/handlers/agent-versions.js.map +1 -0
  180. package/dist/server/handlers/agents.cjs +43 -23
  181. package/dist/server/handlers/agents.d.ts +362 -2912
  182. package/dist/server/handlers/agents.d.ts.map +1 -1
  183. package/dist/server/handlers/agents.js +1 -1
  184. package/dist/server/handlers/error.cjs +6 -2
  185. package/dist/server/handlers/error.d.ts +22 -0
  186. package/dist/server/handlers/error.d.ts.map +1 -1
  187. package/dist/server/handlers/error.js +1 -1
  188. package/dist/server/handlers/logs.cjs +4 -4
  189. package/dist/server/handlers/logs.d.ts +63 -111
  190. package/dist/server/handlers/logs.d.ts.map +1 -1
  191. package/dist/server/handlers/logs.js +1 -1
  192. package/dist/server/handlers/mcp.cjs +40 -0
  193. package/dist/server/handlers/mcp.cjs.map +1 -0
  194. package/dist/server/handlers/mcp.d.ts +92 -0
  195. package/dist/server/handlers/mcp.d.ts.map +1 -0
  196. package/dist/server/handlers/mcp.js +3 -0
  197. package/dist/server/handlers/mcp.js.map +1 -0
  198. package/dist/server/handlers/memory.cjs +28 -24
  199. package/dist/server/handlers/memory.d.ts +244 -756
  200. package/dist/server/handlers/memory.d.ts.map +1 -1
  201. package/dist/server/handlers/memory.js +1 -1
  202. package/dist/server/handlers/observability.cjs +7 -23
  203. package/dist/server/handlers/observability.d.ts +97 -114
  204. package/dist/server/handlers/observability.d.ts.map +1 -1
  205. package/dist/server/handlers/observability.js +1 -1
  206. package/dist/server/handlers/processors.cjs +20 -0
  207. package/dist/server/handlers/processors.cjs.map +1 -0
  208. package/dist/server/handlers/processors.d.ts +90 -0
  209. package/dist/server/handlers/processors.d.ts.map +1 -0
  210. package/dist/server/handlers/processors.js +3 -0
  211. package/dist/server/handlers/processors.js.map +1 -0
  212. package/dist/server/handlers/scores.cjs +7 -7
  213. package/dist/server/handlers/scores.d.ts +18 -54
  214. package/dist/server/handlers/scores.d.ts.map +1 -1
  215. package/dist/server/handlers/scores.js +1 -1
  216. package/dist/server/handlers/stored-agents.cjs +28 -0
  217. package/dist/server/handlers/stored-agents.cjs.map +1 -0
  218. package/dist/server/handlers/stored-agents.d.ts +214 -0
  219. package/dist/server/handlers/stored-agents.d.ts.map +1 -0
  220. package/dist/server/handlers/stored-agents.js +3 -0
  221. package/dist/server/handlers/stored-agents.js.map +1 -0
  222. package/dist/server/handlers/system.cjs +12 -0
  223. package/dist/server/handlers/system.cjs.map +1 -0
  224. package/dist/server/handlers/system.d.ts +7 -0
  225. package/dist/server/handlers/system.d.ts.map +1 -0
  226. package/dist/server/handlers/system.js +3 -0
  227. package/dist/server/handlers/system.js.map +1 -0
  228. package/dist/server/handlers/test-utils.cjs +2 -2
  229. package/dist/server/handlers/test-utils.cjs.map +1 -1
  230. package/dist/server/handlers/test-utils.d.ts +3 -3
  231. package/dist/server/handlers/test-utils.d.ts.map +1 -1
  232. package/dist/server/handlers/test-utils.js +2 -2
  233. package/dist/server/handlers/test-utils.js.map +1 -1
  234. package/dist/server/handlers/tools.cjs +6 -6
  235. package/dist/server/handlers/tools.d.ts +7 -36
  236. package/dist/server/handlers/tools.d.ts.map +1 -1
  237. package/dist/server/handlers/tools.js +1 -1
  238. package/dist/server/handlers/vector.cjs +13 -13
  239. package/dist/server/handlers/vector.d.ts +16 -57
  240. package/dist/server/handlers/vector.d.ts.map +1 -1
  241. package/dist/server/handlers/vector.js +1 -1
  242. package/dist/server/handlers/voice.cjs +8 -8
  243. package/dist/server/handlers/voice.d.ts +18 -56
  244. package/dist/server/handlers/voice.d.ts.map +1 -1
  245. package/dist/server/handlers/voice.js +1 -1
  246. package/dist/server/handlers/workflows.cjs +46 -26
  247. package/dist/server/handlers/workflows.d.ts +358 -533
  248. package/dist/server/handlers/workflows.d.ts.map +1 -1
  249. package/dist/server/handlers/workflows.js +1 -1
  250. package/dist/server/handlers.cjs +36 -31
  251. package/dist/server/handlers.d.ts +1 -0
  252. package/dist/server/handlers.d.ts.map +1 -1
  253. package/dist/server/handlers.js +12 -11
  254. package/dist/server/schemas/a2a.d.ts +56 -700
  255. package/dist/server/schemas/a2a.d.ts.map +1 -1
  256. package/dist/server/schemas/agent-builder.d.ts +26 -143
  257. package/dist/server/schemas/agent-builder.d.ts.map +1 -1
  258. package/dist/server/schemas/agent-versions.d.ts +379 -0
  259. package/dist/server/schemas/agent-versions.d.ts.map +1 -0
  260. package/dist/server/schemas/agents.d.ts +152 -1031
  261. package/dist/server/schemas/agents.d.ts.map +1 -1
  262. package/dist/server/schemas/common.d.ts +37 -103
  263. package/dist/server/schemas/common.d.ts.map +1 -1
  264. package/dist/server/schemas/logs.d.ts +38 -106
  265. package/dist/server/schemas/logs.d.ts.map +1 -1
  266. package/dist/server/schemas/mcp.d.ts +91 -0
  267. package/dist/server/schemas/mcp.d.ts.map +1 -0
  268. package/dist/server/schemas/memory.d.ts +288 -831
  269. package/dist/server/schemas/memory.d.ts.map +1 -1
  270. package/dist/server/schemas/processors.d.ts +162 -0
  271. package/dist/server/schemas/processors.d.ts.map +1 -0
  272. package/dist/server/schemas/scores.d.ts +31 -213
  273. package/dist/server/schemas/scores.d.ts.map +1 -1
  274. package/dist/server/schemas/stored-agents.d.ts +274 -0
  275. package/dist/server/schemas/stored-agents.d.ts.map +1 -0
  276. package/dist/server/schemas/system.d.ts +14 -0
  277. package/dist/server/schemas/system.d.ts.map +1 -0
  278. package/dist/server/schemas/vectors.d.ts +21 -81
  279. package/dist/server/schemas/vectors.d.ts.map +1 -1
  280. package/dist/server/schemas/workflows.d.ts +248 -382
  281. package/dist/server/schemas/workflows.d.ts.map +1 -1
  282. package/dist/server/server-adapter/index.cjs +441 -137
  283. package/dist/server/server-adapter/index.cjs.map +1 -1
  284. package/dist/server/server-adapter/index.d.ts +94 -16
  285. package/dist/server/server-adapter/index.d.ts.map +1 -1
  286. package/dist/server/server-adapter/index.js +325 -35
  287. package/dist/server/server-adapter/index.js.map +1 -1
  288. package/dist/server/server-adapter/openapi-utils.d.ts +9 -9
  289. package/dist/server/server-adapter/openapi-utils.d.ts.map +1 -1
  290. package/dist/server/server-adapter/redact.d.ts +26 -0
  291. package/dist/server/server-adapter/redact.d.ts.map +1 -0
  292. package/dist/server/server-adapter/routes/agent-builder.d.ts.map +1 -1
  293. package/dist/server/server-adapter/routes/agents.d.ts.map +1 -1
  294. package/dist/server/server-adapter/routes/index.d.ts +18 -7
  295. package/dist/server/server-adapter/routes/index.d.ts.map +1 -1
  296. package/dist/server/server-adapter/routes/mcp.d.ts +9 -0
  297. package/dist/server/server-adapter/routes/mcp.d.ts.map +1 -0
  298. package/dist/server/server-adapter/routes/memory.d.ts.map +1 -1
  299. package/dist/server/server-adapter/routes/processors.d.ts +3 -0
  300. package/dist/server/server-adapter/routes/processors.d.ts.map +1 -0
  301. package/dist/server/server-adapter/routes/route-builder.d.ts +66 -6
  302. package/dist/server/server-adapter/routes/route-builder.d.ts.map +1 -1
  303. package/dist/server/server-adapter/routes/stored-agents.d.ts +8 -0
  304. package/dist/server/server-adapter/routes/stored-agents.d.ts.map +1 -0
  305. package/dist/server/server-adapter/routes/system.d.ts +12 -0
  306. package/dist/server/server-adapter/routes/system.d.ts.map +1 -0
  307. package/dist/server/server-adapter/routes/workflows.d.ts.map +1 -1
  308. package/dist/server/utils.d.ts +1 -1
  309. package/dist/server/utils.d.ts.map +1 -1
  310. package/dist/{token-375W3LEI.cjs → token-6GSAFR2W-ABXTQD64-MC4IMVOB.cjs} +11 -12
  311. package/dist/token-6GSAFR2W-ABXTQD64-MC4IMVOB.cjs.map +1 -0
  312. package/dist/{token-C3IMNCC4.js → token-6GSAFR2W-ABXTQD64-Z6U2TA2C.js} +8 -9
  313. package/dist/token-6GSAFR2W-ABXTQD64-Z6U2TA2C.js.map +1 -0
  314. package/dist/token-6GSAFR2W-F2L44NEJ-B3QIV63M.cjs +63 -0
  315. package/dist/token-6GSAFR2W-F2L44NEJ-B3QIV63M.cjs.map +1 -0
  316. package/dist/token-6GSAFR2W-F2L44NEJ-GFZ37A2V.js +61 -0
  317. package/dist/token-6GSAFR2W-F2L44NEJ-GFZ37A2V.js.map +1 -0
  318. package/dist/token-6GSAFR2W-WGTMOPEU-6HSZQUFZ.cjs +63 -0
  319. package/dist/token-6GSAFR2W-WGTMOPEU-6HSZQUFZ.cjs.map +1 -0
  320. package/dist/token-6GSAFR2W-WGTMOPEU-JKP67ZX4.js +61 -0
  321. package/dist/token-6GSAFR2W-WGTMOPEU-JKP67ZX4.js.map +1 -0
  322. package/dist/token-util-NEHG7TUY-4YJ4EPCL-MBTAVIJ3.js +8 -0
  323. package/dist/token-util-NEHG7TUY-4YJ4EPCL-MBTAVIJ3.js.map +1 -0
  324. package/dist/token-util-NEHG7TUY-4YJ4EPCL-SQ4NADRW.cjs +10 -0
  325. package/dist/token-util-NEHG7TUY-4YJ4EPCL-SQ4NADRW.cjs.map +1 -0
  326. package/dist/token-util-NEHG7TUY-TV2H7N56-GGCGMPDG.js +8 -0
  327. package/dist/token-util-NEHG7TUY-TV2H7N56-GGCGMPDG.js.map +1 -0
  328. package/dist/token-util-NEHG7TUY-TV2H7N56-R7OENTCJ.cjs +10 -0
  329. package/dist/token-util-NEHG7TUY-TV2H7N56-R7OENTCJ.cjs.map +1 -0
  330. package/dist/token-util-NEHG7TUY-XQP3QSPX-BL5O5N7R.cjs +10 -0
  331. package/dist/token-util-NEHG7TUY-XQP3QSPX-BL5O5N7R.cjs.map +1 -0
  332. package/dist/token-util-NEHG7TUY-XQP3QSPX-YCJRRNXO.js +8 -0
  333. package/dist/token-util-NEHG7TUY-XQP3QSPX-YCJRRNXO.js.map +1 -0
  334. package/handlers/server/handlers.d.ts +1 -0
  335. package/handlers.d.ts +1 -0
  336. package/package.json +29 -17
  337. package/server-adapter.d.ts +1 -0
  338. package/dist/chunk-2NW6POYK.cjs.map +0 -1
  339. package/dist/chunk-2PLXW4ZX.cjs.map +0 -1
  340. package/dist/chunk-35NT4TMQ.cjs.map +0 -1
  341. package/dist/chunk-3R5EV3HV.js.map +0 -1
  342. package/dist/chunk-4ECGVOJZ.cjs.map +0 -1
  343. package/dist/chunk-5PONYNYP.cjs.map +0 -1
  344. package/dist/chunk-6BISSAIF.js +0 -23494
  345. package/dist/chunk-6BISSAIF.js.map +0 -1
  346. package/dist/chunk-6DTV6NEW.js.map +0 -1
  347. package/dist/chunk-AEO6IHLK.cjs +0 -368
  348. package/dist/chunk-AEO6IHLK.cjs.map +0 -1
  349. package/dist/chunk-ASZUOBKV.js.map +0 -1
  350. package/dist/chunk-ECIVTQ4E.js +0 -354
  351. package/dist/chunk-ECIVTQ4E.js.map +0 -1
  352. package/dist/chunk-FAQICBMH.js.map +0 -1
  353. package/dist/chunk-FXDZLX2Y.js.map +0 -1
  354. package/dist/chunk-G7BPNX2V.js +0 -130
  355. package/dist/chunk-G7BPNX2V.js.map +0 -1
  356. package/dist/chunk-I5VZ5SKG.js.map +0 -1
  357. package/dist/chunk-ICANWSEW.js.map +0 -1
  358. package/dist/chunk-KB5NSROG.cjs.map +0 -1
  359. package/dist/chunk-LPM6BBAX.cjs.map +0 -1
  360. package/dist/chunk-MWQQRVQC.cjs.map +0 -1
  361. package/dist/chunk-NDFAQBQD.cjs.map +0 -1
  362. package/dist/chunk-PKRHEXX7.js.map +0 -1
  363. package/dist/chunk-QGWCNTG6.cjs.map +0 -1
  364. package/dist/chunk-QU6N55W6.cjs.map +0 -1
  365. package/dist/chunk-R4M3BSUG.js.map +0 -1
  366. package/dist/chunk-RQK4FQUD.js.map +0 -1
  367. package/dist/chunk-SHWNNZBL.js.map +0 -1
  368. package/dist/chunk-TBVUN4XN.cjs +0 -23536
  369. package/dist/chunk-TBVUN4XN.cjs.map +0 -1
  370. package/dist/chunk-TOCYBDP2.js +0 -46
  371. package/dist/chunk-TOCYBDP2.js.map +0 -1
  372. package/dist/chunk-UJNHKFBR.cjs.map +0 -1
  373. package/dist/chunk-UOFV2ZCI.js.map +0 -1
  374. package/dist/chunk-UXGQZUYZ.js.map +0 -1
  375. package/dist/chunk-UZ6CYAOG.cjs.map +0 -1
  376. package/dist/chunk-V5WWQN7P.cjs.map +0 -1
  377. package/dist/chunk-VQAT5HX6.js.map +0 -1
  378. package/dist/chunk-X6C7BUWN.cjs +0 -48
  379. package/dist/chunk-X6C7BUWN.cjs.map +0 -1
  380. package/dist/chunk-YJ3VDL3Z.cjs.map +0 -1
  381. package/dist/chunk-Z36N2OQA.cjs.map +0 -1
  382. package/dist/chunk-ZLRTFRL4.js.map +0 -1
  383. package/dist/chunk-ZODCSH2W.cjs.map +0 -1
  384. package/dist/chunk-ZULZ2752.js.map +0 -1
  385. package/dist/dist-4MVGNSRL.cjs.map +0 -1
  386. package/dist/dist-FZYCV3VB.cjs.map +0 -1
  387. package/dist/dist-G2BYZJOC.cjs.map +0 -1
  388. package/dist/dist-P4MXBQ3U.cjs +0 -16
  389. package/dist/dist-PQZUVLPC.js.map +0 -1
  390. package/dist/dist-R7WYX6LC.js.map +0 -1
  391. package/dist/dist-RFMYFILX.cjs.map +0 -1
  392. package/dist/dist-X7XR3M3Z.js.map +0 -1
  393. package/dist/dist-XVBSOGFK.js.map +0 -1
  394. package/dist/dist-YREX2TJT.js +0 -3
  395. package/dist/server/schemas/observability.d.ts +0 -402
  396. package/dist/server/schemas/observability.d.ts.map +0 -1
  397. package/dist/token-375W3LEI.cjs.map +0 -1
  398. package/dist/token-C3IMNCC4.js.map +0 -1
  399. package/dist/token-util-CV3RRG6K.cjs +0 -9
  400. package/dist/token-util-CV3RRG6K.cjs.map +0 -1
  401. package/dist/token-util-E5QO2RCL.js +0 -7
  402. package/dist/token-util-E5QO2RCL.js.map +0 -1
@@ -1,35 +1,52 @@
1
- import { getWorkflowInfo, WorkflowRegistry } from './chunk-G7BPNX2V.js';
2
- import { streamResponseSchema } from './chunk-R4M3BSUG.js';
3
- import { createOffsetPaginationSchema, tracingOptionsSchema, optionalRunIdSchema, runIdSchema, messageResponseSchema } from './chunk-PKRHEXX7.js';
4
- import { createRoute } from './chunk-FAQICBMH.js';
5
- import { handleError } from './chunk-UXGQZUYZ.js';
1
+ import { getWorkflowInfo, WorkflowRegistry } from './chunk-OEF6DYI4.js';
2
+ import { streamResponseSchema } from './chunk-DOU5IGJB.js';
3
+ import { createCombinedPaginationSchema, tracingOptionsSchema, messageResponseSchema, optionalRunIdSchema, runIdSchema } from './chunk-HT4LP3BO.js';
4
+ import { handleError } from './chunk-7AINN3FK.js';
6
5
  import { HTTPException } from './chunk-6QWQZI4Q.js';
6
+ import { createRoute } from './chunk-N5RGHD5P.js';
7
7
  import { __export } from './chunk-PR4QN5HX.js';
8
8
  import { TransformStream, ReadableStream } from 'stream/web';
9
- import z from 'zod';
9
+ import z, { z as z$1 } from 'zod';
10
10
 
11
11
  // src/server/handlers/workflows.ts
12
12
  var workflows_exports = {};
13
13
  __export(workflows_exports, {
14
14
  CANCEL_WORKFLOW_RUN_ROUTE: () => CANCEL_WORKFLOW_RUN_ROUTE,
15
15
  CREATE_WORKFLOW_RUN_ROUTE: () => CREATE_WORKFLOW_RUN_ROUTE,
16
+ DELETE_WORKFLOW_RUN_BY_ID_ROUTE: () => DELETE_WORKFLOW_RUN_BY_ID_ROUTE,
16
17
  GET_WORKFLOW_BY_ID_ROUTE: () => GET_WORKFLOW_BY_ID_ROUTE,
17
18
  GET_WORKFLOW_RUN_BY_ID_ROUTE: () => GET_WORKFLOW_RUN_BY_ID_ROUTE,
18
- GET_WORKFLOW_RUN_EXECUTION_RESULT_ROUTE: () => GET_WORKFLOW_RUN_EXECUTION_RESULT_ROUTE,
19
19
  LIST_WORKFLOWS_ROUTE: () => LIST_WORKFLOWS_ROUTE,
20
20
  LIST_WORKFLOW_RUNS_ROUTE: () => LIST_WORKFLOW_RUNS_ROUTE,
21
21
  OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE: () => OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE,
22
- OBSERVE_STREAM_VNEXT_WORKFLOW_ROUTE: () => OBSERVE_STREAM_VNEXT_WORKFLOW_ROUTE,
23
22
  OBSERVE_STREAM_WORKFLOW_ROUTE: () => OBSERVE_STREAM_WORKFLOW_ROUTE,
23
+ RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE: () => RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE,
24
+ RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE: () => RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE,
25
+ RESTART_ASYNC_WORKFLOW_ROUTE: () => RESTART_ASYNC_WORKFLOW_ROUTE,
26
+ RESTART_WORKFLOW_ROUTE: () => RESTART_WORKFLOW_ROUTE,
24
27
  RESUME_ASYNC_WORKFLOW_ROUTE: () => RESUME_ASYNC_WORKFLOW_ROUTE,
25
28
  RESUME_STREAM_WORKFLOW_ROUTE: () => RESUME_STREAM_WORKFLOW_ROUTE,
26
29
  RESUME_WORKFLOW_ROUTE: () => RESUME_WORKFLOW_ROUTE,
27
30
  START_ASYNC_WORKFLOW_ROUTE: () => START_ASYNC_WORKFLOW_ROUTE,
28
31
  START_WORKFLOW_RUN_ROUTE: () => START_WORKFLOW_RUN_ROUTE,
29
32
  STREAM_LEGACY_WORKFLOW_ROUTE: () => STREAM_LEGACY_WORKFLOW_ROUTE,
30
- STREAM_VNEXT_WORKFLOW_ROUTE: () => STREAM_VNEXT_WORKFLOW_ROUTE,
31
- STREAM_WORKFLOW_ROUTE: () => STREAM_WORKFLOW_ROUTE
33
+ STREAM_WORKFLOW_ROUTE: () => STREAM_WORKFLOW_ROUTE,
34
+ TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE: () => TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE,
35
+ TIME_TRAVEL_STREAM_WORKFLOW_ROUTE: () => TIME_TRAVEL_STREAM_WORKFLOW_ROUTE,
36
+ TIME_TRAVEL_WORKFLOW_ROUTE: () => TIME_TRAVEL_WORKFLOW_ROUTE
32
37
  });
38
+ var workflowRunStatusSchema = z.enum([
39
+ "running",
40
+ "waiting",
41
+ "suspended",
42
+ "success",
43
+ "failed",
44
+ "canceled",
45
+ "pending",
46
+ "bailed",
47
+ "tripwire",
48
+ "paused"
49
+ ]);
33
50
  var workflowIdPathParams = z.object({
34
51
  workflowId: z.string().describe("Unique identifier for the workflow")
35
52
  });
@@ -38,7 +55,14 @@ var workflowRunPathParams = workflowIdPathParams.extend({
38
55
  });
39
56
  var serializedStepSchema = z.object({
40
57
  id: z.string(),
41
- description: z.string().optional()
58
+ description: z.string().optional(),
59
+ stateSchema: z.string().optional(),
60
+ inputSchema: z.string().optional(),
61
+ outputSchema: z.string().optional(),
62
+ resumeSchema: z.string().optional(),
63
+ suspendSchema: z.string().optional(),
64
+ component: z.string().optional(),
65
+ isWorkflow: z.boolean().optional()
42
66
  });
43
67
  var serializedStepFlowEntrySchema = z.object({
44
68
  type: z.enum(["step", "sleep", "sleepUntil", "waitForEvent", "parallel", "conditional", "loop", "foreach"])
@@ -51,7 +75,9 @@ var workflowInfoSchema = z.object({
51
75
  stepGraph: z.array(serializedStepFlowEntrySchema),
52
76
  inputSchema: z.string().optional(),
53
77
  outputSchema: z.string().optional(),
54
- options: z.object({}).optional()
78
+ stateSchema: z.string().optional(),
79
+ options: z.object({}).optional(),
80
+ isProcessorWorkflow: z.boolean().optional()
55
81
  });
56
82
  var listWorkflowsResponseSchema = z.record(z.string(), workflowInfoSchema);
57
83
  var workflowRunSchema = z.object({
@@ -66,16 +92,19 @@ var workflowRunsResponseSchema = z.object({
66
92
  runs: z.array(workflowRunSchema),
67
93
  total: z.number()
68
94
  });
69
- var workflowRunResponseSchema = workflowRunSchema;
70
- var listWorkflowRunsQuerySchema = createOffsetPaginationSchema().extend({
95
+ var listWorkflowRunsQuerySchema = createCombinedPaginationSchema().extend({
71
96
  fromDate: z.coerce.date().optional(),
72
97
  toDate: z.coerce.date().optional(),
73
- resourceId: z.string().optional()
98
+ resourceId: z.string().optional(),
99
+ status: workflowRunStatusSchema.optional()
74
100
  });
75
101
  var workflowExecutionBodySchema = z.object({
102
+ resourceId: z.string().optional(),
76
103
  inputData: z.unknown().optional(),
104
+ initialState: z.unknown().optional(),
77
105
  requestContext: z.record(z.string(), z.unknown()).optional(),
78
- tracingOptions: tracingOptionsSchema.optional()
106
+ tracingOptions: tracingOptionsSchema.optional(),
107
+ perStep: z.boolean().optional()
79
108
  });
80
109
  var streamLegacyWorkflowBodySchema = workflowExecutionBodySchema;
81
110
  var streamWorkflowBodySchema = workflowExecutionBodySchema.extend({
@@ -85,23 +114,90 @@ var resumeBodySchema = z.object({
85
114
  step: z.union([z.string(), z.array(z.string())]).optional(),
86
115
  // Optional - workflow can auto-resume all suspended steps
87
116
  resumeData: z.unknown().optional(),
117
+ requestContext: z.record(z.string(), z.unknown()).optional(),
118
+ tracingOptions: tracingOptionsSchema.optional(),
119
+ perStep: z.boolean().optional()
120
+ });
121
+ var restartBodySchema = z.object({
88
122
  requestContext: z.record(z.string(), z.unknown()).optional(),
89
123
  tracingOptions: tracingOptionsSchema.optional()
90
124
  });
125
+ var timeTravelBodySchema = z.object({
126
+ inputData: z.unknown().optional(),
127
+ resumeData: z.unknown().optional(),
128
+ initialState: z.unknown().optional(),
129
+ step: z.union([z.string(), z.array(z.string())]),
130
+ context: z.record(z.string(), z.any()).optional(),
131
+ nestedStepsContext: z.record(z.string(), z.record(z.string(), z.any())).optional(),
132
+ requestContext: z.record(z.string(), z.unknown()).optional(),
133
+ tracingOptions: tracingOptionsSchema.optional(),
134
+ perStep: z.boolean().optional()
135
+ });
91
136
  var startAsyncWorkflowBodySchema = workflowExecutionBodySchema;
92
137
  z.object({
93
138
  event: z.string(),
94
139
  data: z.unknown()
95
140
  });
141
+ var VALID_WORKFLOW_RESULT_FIELDS = /* @__PURE__ */ new Set([
142
+ "result",
143
+ "error",
144
+ "payload",
145
+ "steps",
146
+ "activeStepsPath",
147
+ "serializedStepGraph"
148
+ ]);
149
+ var WORKFLOW_RESULT_FIELDS_ERROR = "Invalid field name. Available fields: result, error, payload, steps, activeStepsPath, serializedStepGraph";
150
+ var createFieldsValidator = (description) => z.string().optional().refine(
151
+ (value) => {
152
+ if (!value) return true;
153
+ const requestedFields = value.split(",").map((f) => f.trim());
154
+ return requestedFields.every((field) => VALID_WORKFLOW_RESULT_FIELDS.has(field));
155
+ },
156
+ { message: WORKFLOW_RESULT_FIELDS_ERROR }
157
+ ).describe(description);
158
+ var withNestedWorkflowsField = z.enum(["true", "false"]).optional().describe("Whether to include nested workflow data in steps. Defaults to true. Set to false for better performance.");
96
159
  var workflowExecutionResultSchema = z.object({
97
- status: z.string(),
160
+ status: workflowRunStatusSchema.optional(),
98
161
  result: z.unknown().optional(),
99
- error: z.unknown().optional()
162
+ error: z.unknown().optional(),
163
+ payload: z.unknown().optional(),
164
+ initialState: z.unknown().optional(),
165
+ steps: z.record(z.string(), z.any()).optional(),
166
+ activeStepsPath: z.record(z.string(), z.array(z.number())).optional(),
167
+ serializedStepGraph: z.array(serializedStepFlowEntrySchema).optional()
168
+ });
169
+ var workflowRunResultQuerySchema = z.object({
170
+ fields: createFieldsValidator(
171
+ "Comma-separated list of fields to return. Available fields: result, error, payload, steps, activeStepsPath, serializedStepGraph. Metadata fields (runId, workflowName, resourceId, createdAt, updatedAt) and status are always included."
172
+ ),
173
+ withNestedWorkflows: withNestedWorkflowsField
174
+ });
175
+ var workflowRunResultSchema = z.object({
176
+ // Metadata - always present
177
+ runId: z.string(),
178
+ workflowName: z.string(),
179
+ resourceId: z.string().optional(),
180
+ createdAt: z.date(),
181
+ updatedAt: z.date(),
182
+ // Execution state
183
+ status: workflowRunStatusSchema,
184
+ initialState: z.record(z.string(), z.any()).optional(),
185
+ result: z.unknown().optional(),
186
+ error: z.unknown().optional(),
187
+ payload: z.unknown().optional(),
188
+ steps: z.record(z.string(), z.any()).optional(),
189
+ // Optional detailed fields
190
+ activeStepsPath: z.record(z.string(), z.array(z.number())).optional(),
191
+ serializedStepGraph: z.array(serializedStepFlowEntrySchema).optional()
100
192
  });
101
193
  var workflowControlResponseSchema = messageResponseSchema;
102
194
  var createWorkflowRunResponseSchema = z.object({
103
195
  runId: z.string()
104
196
  });
197
+ var createWorkflowRunBodySchema = z.object({
198
+ resourceId: z.string().optional(),
199
+ disableScorers: z.boolean().optional()
200
+ });
105
201
 
106
202
  // src/server/handlers/workflows.ts
107
203
  async function listWorkflowsFromSystem({ mastra, workflowId }) {
@@ -143,35 +239,41 @@ async function listWorkflowsFromSystem({ mastra, workflowId }) {
143
239
  }
144
240
  var LIST_WORKFLOWS_ROUTE = createRoute({
145
241
  method: "GET",
146
- path: "/api/workflows",
242
+ path: "/workflows",
147
243
  responseType: "json",
244
+ queryParamSchema: z$1.object({
245
+ partial: z$1.string().optional()
246
+ }),
148
247
  responseSchema: listWorkflowsResponseSchema,
149
248
  summary: "List all workflows",
150
249
  description: "Returns a list of all available workflows in the system",
151
250
  tags: ["Workflows"],
152
- handler: async ({ mastra }) => {
251
+ requiresAuth: true,
252
+ handler: (async ({ mastra, partial }) => {
153
253
  try {
154
254
  const workflows = mastra.listWorkflows({ serialized: false });
255
+ const isPartial = partial === "true";
155
256
  const _workflows = Object.entries(workflows).reduce((acc, [key, workflow]) => {
156
- acc[key] = getWorkflowInfo(workflow);
257
+ acc[key] = getWorkflowInfo(workflow, isPartial);
157
258
  return acc;
158
259
  }, {});
159
260
  return _workflows;
160
261
  } catch (error) {
161
262
  return handleError(error, "Error getting workflows");
162
263
  }
163
- }
264
+ })
164
265
  });
165
266
  var GET_WORKFLOW_BY_ID_ROUTE = createRoute({
166
267
  method: "GET",
167
- path: "/api/workflows/:workflowId",
268
+ path: "/workflows/:workflowId",
168
269
  responseType: "json",
169
270
  pathParamSchema: workflowIdPathParams,
170
271
  responseSchema: workflowInfoSchema,
171
272
  summary: "Get workflow by ID",
172
273
  description: "Returns details for a specific workflow",
173
274
  tags: ["Workflows"],
174
- handler: async ({ mastra, workflowId }) => {
275
+ requiresAuth: true,
276
+ handler: (async ({ mastra, workflowId }) => {
175
277
  try {
176
278
  if (!workflowId) {
177
279
  throw new HTTPException(400, { message: "Workflow ID is required" });
@@ -181,11 +283,11 @@ var GET_WORKFLOW_BY_ID_ROUTE = createRoute({
181
283
  } catch (error) {
182
284
  return handleError(error, "Error getting workflow");
183
285
  }
184
- }
286
+ })
185
287
  });
186
288
  var LIST_WORKFLOW_RUNS_ROUTE = createRoute({
187
289
  method: "GET",
188
- path: "/api/workflows/:workflowId/runs",
290
+ path: "/workflows/:workflowId/runs",
189
291
  responseType: "json",
190
292
  pathParamSchema: workflowIdPathParams,
191
293
  queryParamSchema: listWorkflowRunsQuerySchema,
@@ -193,17 +295,24 @@ var LIST_WORKFLOW_RUNS_ROUTE = createRoute({
193
295
  summary: "List workflow runs",
194
296
  description: "Returns a paginated list of execution runs for the specified workflow",
195
297
  tags: ["Workflows"],
196
- handler: async ({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId }) => {
298
+ requiresAuth: true,
299
+ handler: (async ({ mastra, workflowId, fromDate, toDate, page, perPage, limit, offset, resourceId, status }) => {
197
300
  try {
198
301
  if (!workflowId) {
199
302
  throw new HTTPException(400, { message: "Workflow ID is required" });
200
303
  }
201
- const perPage = limit;
202
- const page = offset !== void 0 && typeof limit === "number" && limit !== 0 ? Math.floor(offset / limit) : 0;
203
- if (perPage !== void 0 && (typeof perPage !== "number" || !Number.isInteger(perPage) || perPage <= 0)) {
204
- throw new HTTPException(400, { message: "limit must be a positive integer" });
304
+ let finalPage = page;
305
+ let finalPerPage = perPage;
306
+ if (finalPerPage === void 0 && limit !== void 0) {
307
+ finalPerPage = limit;
308
+ }
309
+ if (finalPage === void 0 && offset !== void 0 && finalPerPage !== void 0 && finalPerPage > 0) {
310
+ finalPage = Math.floor(offset / finalPerPage);
205
311
  }
206
- if (page !== void 0 && (!Number.isInteger(page) || page < 0)) {
312
+ if (finalPerPage !== void 0 && (typeof finalPerPage !== "number" || !Number.isInteger(finalPerPage) || finalPerPage <= 0)) {
313
+ throw new HTTPException(400, { message: "perPage must be a positive integer" });
314
+ }
315
+ if (finalPage !== void 0 && (!Number.isInteger(finalPage) || finalPage < 0)) {
207
316
  throw new HTTPException(400, { message: "page must be a non-negative integer" });
208
317
  }
209
318
  const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });
@@ -213,9 +322,10 @@ var LIST_WORKFLOW_RUNS_ROUTE = createRoute({
213
322
  const workflowRuns = await workflow.listWorkflowRuns({
214
323
  fromDate: fromDate ? typeof fromDate === "string" ? new Date(fromDate) : fromDate : void 0,
215
324
  toDate: toDate ? typeof toDate === "string" ? new Date(toDate) : toDate : void 0,
216
- perPage,
217
- page,
218
- resourceId
325
+ perPage: finalPerPage,
326
+ page: finalPage,
327
+ resourceId,
328
+ status
219
329
  }) || {
220
330
  runs: [],
221
331
  total: 0
@@ -224,18 +334,20 @@ var LIST_WORKFLOW_RUNS_ROUTE = createRoute({
224
334
  } catch (error) {
225
335
  return handleError(error, "Error getting workflow runs");
226
336
  }
227
- }
337
+ })
228
338
  });
229
339
  var GET_WORKFLOW_RUN_BY_ID_ROUTE = createRoute({
230
340
  method: "GET",
231
- path: "/api/workflows/:workflowId/runs/:runId",
341
+ path: "/workflows/:workflowId/runs/:runId",
232
342
  responseType: "json",
233
343
  pathParamSchema: workflowRunPathParams,
234
- responseSchema: workflowRunResponseSchema,
344
+ queryParamSchema: workflowRunResultQuerySchema,
345
+ responseSchema: workflowRunResultSchema,
235
346
  summary: "Get workflow run by ID",
236
- description: "Returns details for a specific workflow run",
347
+ 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=status,result,metadata)",
237
348
  tags: ["Workflows"],
238
- handler: async ({ mastra, workflowId, runId }) => {
349
+ requiresAuth: true,
350
+ handler: async ({ mastra, workflowId, runId, fields, withNestedWorkflows }) => {
239
351
  try {
240
352
  if (!workflowId) {
241
353
  throw new HTTPException(400, { message: "Workflow ID is required" });
@@ -247,7 +359,12 @@ var GET_WORKFLOW_RUN_BY_ID_ROUTE = createRoute({
247
359
  if (!workflow) {
248
360
  throw new HTTPException(404, { message: "Workflow not found" });
249
361
  }
250
- const run = await workflow.getWorkflowRunById(runId);
362
+ const fieldList = fields ? fields.split(",").map((f) => f.trim()) : void 0;
363
+ const run = await workflow.getWorkflowRunById(runId, {
364
+ withNestedWorkflows: withNestedWorkflows !== "false",
365
+ // Default to true unless explicitly 'false'
366
+ fields: fieldList
367
+ });
251
368
  if (!run) {
252
369
  throw new HTTPException(404, { message: "Workflow run not found" });
253
370
  }
@@ -257,17 +374,48 @@ var GET_WORKFLOW_RUN_BY_ID_ROUTE = createRoute({
257
374
  }
258
375
  }
259
376
  });
377
+ var DELETE_WORKFLOW_RUN_BY_ID_ROUTE = createRoute({
378
+ method: "DELETE",
379
+ path: "/workflows/:workflowId/runs/:runId",
380
+ responseType: "json",
381
+ pathParamSchema: workflowRunPathParams,
382
+ responseSchema: workflowControlResponseSchema,
383
+ summary: "Delete workflow run by ID",
384
+ description: "Deletes a specific workflow run by ID",
385
+ tags: ["Workflows"],
386
+ requiresAuth: true,
387
+ handler: async ({ mastra, workflowId, runId }) => {
388
+ try {
389
+ if (!workflowId) {
390
+ throw new HTTPException(400, { message: "Workflow ID is required" });
391
+ }
392
+ if (!runId) {
393
+ throw new HTTPException(400, { message: "Run ID is required" });
394
+ }
395
+ const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });
396
+ if (!workflow) {
397
+ throw new HTTPException(404, { message: "Workflow not found" });
398
+ }
399
+ await workflow.deleteWorkflowRunById(runId);
400
+ return { message: "Workflow run deleted" };
401
+ } catch (error) {
402
+ return handleError(error, "Error deleting workflow run");
403
+ }
404
+ }
405
+ });
260
406
  var CREATE_WORKFLOW_RUN_ROUTE = createRoute({
261
407
  method: "POST",
262
- path: "/api/workflows/:workflowId/create-run",
408
+ path: "/workflows/:workflowId/create-run",
263
409
  responseType: "json",
264
410
  pathParamSchema: workflowIdPathParams,
265
411
  queryParamSchema: optionalRunIdSchema,
412
+ bodySchema: createWorkflowRunBodySchema,
266
413
  responseSchema: createWorkflowRunResponseSchema,
267
414
  summary: "Create workflow run",
268
415
  description: "Creates a new workflow execution instance with an optional custom run ID",
269
416
  tags: ["Workflows"],
270
- handler: async ({ mastra, workflowId, runId }) => {
417
+ requiresAuth: true,
418
+ handler: async ({ mastra, workflowId, runId, resourceId, disableScorers }) => {
271
419
  try {
272
420
  if (!workflowId) {
273
421
  throw new HTTPException(400, { message: "Workflow ID is required" });
@@ -276,7 +424,7 @@ var CREATE_WORKFLOW_RUN_ROUTE = createRoute({
276
424
  if (!workflow) {
277
425
  throw new HTTPException(404, { message: "Workflow not found" });
278
426
  }
279
- const run = await workflow.createRun({ runId });
427
+ const run = await workflow.createRun({ runId, resourceId, disableScorers });
280
428
  return { runId: run.runId };
281
429
  } catch (error) {
282
430
  return handleError(error, "Error creating workflow run");
@@ -285,7 +433,7 @@ var CREATE_WORKFLOW_RUN_ROUTE = createRoute({
285
433
  });
286
434
  var STREAM_WORKFLOW_ROUTE = createRoute({
287
435
  method: "POST",
288
- path: "/api/workflows/:workflowId/stream",
436
+ path: "/workflows/:workflowId/stream",
289
437
  responseType: "stream",
290
438
  pathParamSchema: workflowIdPathParams,
291
439
  queryParamSchema: runIdSchema,
@@ -293,7 +441,8 @@ var STREAM_WORKFLOW_ROUTE = createRoute({
293
441
  summary: "Stream workflow execution",
294
442
  description: "Executes a workflow and streams the results in real-time",
295
443
  tags: ["Workflows"],
296
- handler: async ({ mastra, workflowId, runId, ...params }) => {
444
+ requiresAuth: true,
445
+ handler: async ({ mastra, workflowId, runId, resourceId, ...params }) => {
297
446
  try {
298
447
  if (!workflowId) {
299
448
  throw new HTTPException(400, { message: "Workflow ID is required" });
@@ -306,7 +455,7 @@ var STREAM_WORKFLOW_ROUTE = createRoute({
306
455
  throw new HTTPException(404, { message: "Workflow not found" });
307
456
  }
308
457
  const serverCache = mastra.getServerCache();
309
- const run = await workflow.createRun({ runId });
458
+ const run = await workflow.createRun({ runId, resourceId });
310
459
  const result = run.stream(params);
311
460
  return result.fullStream.pipeThrough(
312
461
  new TransformStream({
@@ -325,21 +474,9 @@ var STREAM_WORKFLOW_ROUTE = createRoute({
325
474
  }
326
475
  }
327
476
  });
328
- var STREAM_VNEXT_WORKFLOW_ROUTE = createRoute({
329
- method: "POST",
330
- path: "/api/workflows/:workflowId/streamVNext",
331
- responseType: "stream",
332
- pathParamSchema: workflowIdPathParams,
333
- queryParamSchema: runIdSchema,
334
- bodySchema: streamWorkflowBodySchema,
335
- summary: "Stream workflow execution (v2)",
336
- description: "Executes a workflow using the v2 streaming API and streams the results in real-time",
337
- tags: ["Workflows"],
338
- handler: STREAM_WORKFLOW_ROUTE.handler
339
- });
340
477
  var RESUME_STREAM_WORKFLOW_ROUTE = createRoute({
341
478
  method: "POST",
342
- path: "/api/workflows/:workflowId/resume-stream",
479
+ path: "/workflows/:workflowId/resume-stream",
343
480
  responseType: "stream",
344
481
  pathParamSchema: workflowIdPathParams,
345
482
  queryParamSchema: runIdSchema,
@@ -348,6 +485,7 @@ var RESUME_STREAM_WORKFLOW_ROUTE = createRoute({
348
485
  summary: "Resume workflow stream",
349
486
  description: "Resumes a suspended workflow execution and continues streaming results",
350
487
  tags: ["Workflows"],
488
+ requiresAuth: true,
351
489
  handler: async ({ mastra, workflowId, runId, ...params }) => {
352
490
  try {
353
491
  if (!workflowId) {
@@ -384,40 +522,9 @@ var RESUME_STREAM_WORKFLOW_ROUTE = createRoute({
384
522
  }
385
523
  }
386
524
  });
387
- var GET_WORKFLOW_RUN_EXECUTION_RESULT_ROUTE = createRoute({
388
- method: "GET",
389
- path: "/api/workflows/:workflowId/runs/:runId/execution-result",
390
- responseType: "json",
391
- pathParamSchema: workflowRunPathParams,
392
- responseSchema: workflowExecutionResultSchema,
393
- summary: "Get workflow execution result",
394
- description: "Returns the final execution result of a completed workflow run",
395
- tags: ["Workflows"],
396
- handler: async ({ mastra, workflowId, runId }) => {
397
- try {
398
- if (!workflowId) {
399
- throw new HTTPException(400, { message: "Workflow ID is required" });
400
- }
401
- if (!runId) {
402
- throw new HTTPException(400, { message: "Run ID is required" });
403
- }
404
- const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });
405
- if (!workflow) {
406
- throw new HTTPException(404, { message: "Workflow not found" });
407
- }
408
- const executionResult = await workflow.getWorkflowRunExecutionResult(runId);
409
- if (!executionResult) {
410
- throw new HTTPException(404, { message: "Workflow run execution result not found" });
411
- }
412
- return executionResult;
413
- } catch (error) {
414
- return handleError(error, "Error getting workflow run execution result");
415
- }
416
- }
417
- });
418
525
  var START_ASYNC_WORKFLOW_ROUTE = createRoute({
419
526
  method: "POST",
420
- path: "/api/workflows/:workflowId/start-async",
527
+ path: "/workflows/:workflowId/start-async",
421
528
  responseType: "json",
422
529
  pathParamSchema: workflowIdPathParams,
423
530
  queryParamSchema: optionalRunIdSchema,
@@ -426,6 +533,7 @@ var START_ASYNC_WORKFLOW_ROUTE = createRoute({
426
533
  summary: "Start workflow asynchronously",
427
534
  description: "Starts a workflow execution asynchronously without streaming results",
428
535
  tags: ["Workflows"],
536
+ requiresAuth: true,
429
537
  handler: async ({ mastra, workflowId, runId, ...params }) => {
430
538
  try {
431
539
  if (!workflowId) {
@@ -445,7 +553,7 @@ var START_ASYNC_WORKFLOW_ROUTE = createRoute({
445
553
  });
446
554
  var START_WORKFLOW_RUN_ROUTE = createRoute({
447
555
  method: "POST",
448
- path: "/api/workflows/:workflowId/start",
556
+ path: "/workflows/:workflowId/start",
449
557
  responseType: "json",
450
558
  pathParamSchema: workflowIdPathParams,
451
559
  queryParamSchema: runIdSchema,
@@ -454,6 +562,7 @@ var START_WORKFLOW_RUN_ROUTE = createRoute({
454
562
  summary: "Start specific workflow run",
455
563
  description: "Starts execution of a specific workflow run by ID",
456
564
  tags: ["Workflows"],
565
+ requiresAuth: true,
457
566
  handler: async ({ mastra, workflowId, runId, ...params }) => {
458
567
  try {
459
568
  if (!workflowId) {
@@ -482,7 +591,7 @@ var START_WORKFLOW_RUN_ROUTE = createRoute({
482
591
  });
483
592
  var OBSERVE_STREAM_WORKFLOW_ROUTE = createRoute({
484
593
  method: "POST",
485
- path: "/api/workflows/:workflowId/observe",
594
+ path: "/workflows/:workflowId/observe",
486
595
  responseType: "stream",
487
596
  pathParamSchema: workflowIdPathParams,
488
597
  queryParamSchema: runIdSchema,
@@ -490,6 +599,7 @@ var OBSERVE_STREAM_WORKFLOW_ROUTE = createRoute({
490
599
  summary: "Observe workflow stream",
491
600
  description: "Observes and streams updates from an already running workflow execution",
492
601
  tags: ["Workflows"],
602
+ requiresAuth: true,
493
603
  handler: async ({ mastra, workflowId, runId }) => {
494
604
  try {
495
605
  if (!workflowId) {
@@ -550,21 +660,9 @@ var OBSERVE_STREAM_WORKFLOW_ROUTE = createRoute({
550
660
  }
551
661
  }
552
662
  });
553
- var OBSERVE_STREAM_VNEXT_WORKFLOW_ROUTE = createRoute({
554
- method: "POST",
555
- path: "/api/workflows/:workflowId/observe-streamVNext",
556
- responseType: "stream",
557
- pathParamSchema: workflowIdPathParams,
558
- queryParamSchema: runIdSchema,
559
- responseSchema: streamResponseSchema,
560
- summary: "Observe workflow stream (v2)",
561
- description: "Observes and streams updates from an already running workflow execution using v2 streaming API",
562
- tags: ["Workflows"],
563
- handler: OBSERVE_STREAM_WORKFLOW_ROUTE.handler
564
- });
565
663
  var RESUME_ASYNC_WORKFLOW_ROUTE = createRoute({
566
664
  method: "POST",
567
- path: "/api/workflows/:workflowId/resume-async",
665
+ path: "/workflows/:workflowId/resume-async",
568
666
  responseType: "json",
569
667
  pathParamSchema: workflowIdPathParams,
570
668
  queryParamSchema: runIdSchema,
@@ -573,6 +671,7 @@ var RESUME_ASYNC_WORKFLOW_ROUTE = createRoute({
573
671
  summary: "Resume workflow asynchronously",
574
672
  description: "Resumes a suspended workflow execution asynchronously without streaming",
575
673
  tags: ["Workflows"],
674
+ requiresAuth: true,
576
675
  handler: async ({ mastra, workflowId, runId, ...params }) => {
577
676
  try {
578
677
  if (!workflowId) {
@@ -599,7 +698,7 @@ var RESUME_ASYNC_WORKFLOW_ROUTE = createRoute({
599
698
  });
600
699
  var RESUME_WORKFLOW_ROUTE = createRoute({
601
700
  method: "POST",
602
- path: "/api/workflows/:workflowId/resume",
701
+ path: "/workflows/:workflowId/resume",
603
702
  responseType: "json",
604
703
  pathParamSchema: workflowIdPathParams,
605
704
  queryParamSchema: runIdSchema,
@@ -608,6 +707,7 @@ var RESUME_WORKFLOW_ROUTE = createRoute({
608
707
  summary: "Resume workflow",
609
708
  description: "Resumes a suspended workflow execution from a specific step",
610
709
  tags: ["Workflows"],
710
+ requiresAuth: true,
611
711
  handler: async ({ mastra, workflowId, runId, ...params }) => {
612
712
  try {
613
713
  if (!workflowId) {
@@ -632,15 +732,255 @@ var RESUME_WORKFLOW_ROUTE = createRoute({
632
732
  }
633
733
  }
634
734
  });
735
+ var RESTART_ASYNC_WORKFLOW_ROUTE = createRoute({
736
+ method: "POST",
737
+ path: "/workflows/:workflowId/restart-async",
738
+ responseType: "json",
739
+ pathParamSchema: workflowIdPathParams,
740
+ queryParamSchema: runIdSchema,
741
+ bodySchema: restartBodySchema,
742
+ responseSchema: workflowExecutionResultSchema,
743
+ summary: "Restart workflow asynchronously",
744
+ description: "Restarts an active workflow execution asynchronously",
745
+ tags: ["Workflows"],
746
+ requiresAuth: true,
747
+ handler: async ({ mastra, workflowId, runId, ...params }) => {
748
+ try {
749
+ if (!workflowId) {
750
+ throw new HTTPException(400, { message: "Workflow ID is required" });
751
+ }
752
+ if (!runId) {
753
+ throw new HTTPException(400, { message: "runId required to restart workflow" });
754
+ }
755
+ const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });
756
+ if (!workflow) {
757
+ throw new HTTPException(404, { message: "Workflow not found" });
758
+ }
759
+ const run = await workflow.getWorkflowRunById(runId);
760
+ if (!run) {
761
+ throw new HTTPException(404, { message: "Workflow run not found" });
762
+ }
763
+ const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
764
+ const result = await _run.restart(params);
765
+ return result;
766
+ } catch (error) {
767
+ return handleError(error, "Error restarting workflow");
768
+ }
769
+ }
770
+ });
771
+ var RESTART_WORKFLOW_ROUTE = createRoute({
772
+ method: "POST",
773
+ path: "/workflows/:workflowId/restart",
774
+ responseType: "json",
775
+ pathParamSchema: workflowIdPathParams,
776
+ queryParamSchema: runIdSchema,
777
+ bodySchema: restartBodySchema,
778
+ responseSchema: workflowControlResponseSchema,
779
+ summary: "Restart workflow",
780
+ description: "Restarts an active workflow execution",
781
+ tags: ["Workflows"],
782
+ requiresAuth: true,
783
+ handler: async ({ mastra, workflowId, runId, ...params }) => {
784
+ try {
785
+ if (!workflowId) {
786
+ throw new HTTPException(400, { message: "Workflow ID is required" });
787
+ }
788
+ if (!runId) {
789
+ throw new HTTPException(400, { message: "runId required to restart workflow" });
790
+ }
791
+ const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });
792
+ if (!workflow) {
793
+ throw new HTTPException(404, { message: "Workflow not found" });
794
+ }
795
+ const run = await workflow.getWorkflowRunById(runId);
796
+ if (!run) {
797
+ throw new HTTPException(404, { message: "Workflow run not found" });
798
+ }
799
+ const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
800
+ void _run.restart(params);
801
+ return { message: "Workflow run restarted" };
802
+ } catch (error) {
803
+ return handleError(error, "Error restarting workflow");
804
+ }
805
+ }
806
+ });
807
+ var RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE = createRoute({
808
+ method: "POST",
809
+ path: "/workflows/:workflowId/restart-all-active-workflow-runs-async",
810
+ responseType: "json",
811
+ pathParamSchema: workflowIdPathParams,
812
+ responseSchema: workflowControlResponseSchema,
813
+ summary: "Restart all active workflow runs asynchronously",
814
+ description: "Restarts all active workflow runs asynchronously",
815
+ tags: ["Workflows"],
816
+ requiresAuth: true,
817
+ handler: async ({ mastra, workflowId }) => {
818
+ try {
819
+ if (!workflowId) {
820
+ throw new HTTPException(400, { message: "Workflow ID is required" });
821
+ }
822
+ const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });
823
+ if (!workflow) {
824
+ throw new HTTPException(404, { message: "Workflow not found" });
825
+ }
826
+ await workflow.restartAllActiveWorkflowRuns();
827
+ return { message: "All active workflow runs restarted" };
828
+ } catch (error) {
829
+ return handleError(error, "Error restarting workflow");
830
+ }
831
+ }
832
+ });
833
+ var RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE = createRoute({
834
+ method: "POST",
835
+ path: "/workflows/:workflowId/restart-all-active-workflow-runs",
836
+ responseType: "json",
837
+ pathParamSchema: workflowIdPathParams,
838
+ responseSchema: workflowControlResponseSchema,
839
+ summary: "Restart all active workflow runs",
840
+ description: "Restarts all active workflow runs",
841
+ tags: ["Workflows"],
842
+ requiresAuth: true,
843
+ handler: async ({ mastra, workflowId }) => {
844
+ try {
845
+ if (!workflowId) {
846
+ throw new HTTPException(400, { message: "Workflow ID is required" });
847
+ }
848
+ const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });
849
+ if (!workflow) {
850
+ throw new HTTPException(404, { message: "Workflow not found" });
851
+ }
852
+ void workflow.restartAllActiveWorkflowRuns();
853
+ return { message: "All active workflow runs restarted" };
854
+ } catch (error) {
855
+ return handleError(error, "Error restarting workflow");
856
+ }
857
+ }
858
+ });
859
+ var TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE = createRoute({
860
+ method: "POST",
861
+ path: "/workflows/:workflowId/time-travel-async",
862
+ responseType: "json",
863
+ pathParamSchema: workflowIdPathParams,
864
+ queryParamSchema: runIdSchema,
865
+ bodySchema: timeTravelBodySchema,
866
+ responseSchema: workflowExecutionResultSchema,
867
+ summary: "Time travel workflow asynchronously",
868
+ description: "Time travels a workflow run asynchronously without streaming",
869
+ tags: ["Workflows"],
870
+ requiresAuth: true,
871
+ handler: async ({ mastra, workflowId, runId, ...params }) => {
872
+ try {
873
+ if (!workflowId) {
874
+ throw new HTTPException(400, { message: "Workflow ID is required" });
875
+ }
876
+ if (!runId) {
877
+ throw new HTTPException(400, { message: "runId required to time travel workflow" });
878
+ }
879
+ const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });
880
+ if (!workflow) {
881
+ throw new HTTPException(404, { message: "Workflow not found" });
882
+ }
883
+ const run = await workflow.getWorkflowRunById(runId);
884
+ if (!run) {
885
+ throw new HTTPException(404, { message: "Workflow run not found" });
886
+ }
887
+ const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
888
+ const result = await _run.timeTravel(params);
889
+ return result;
890
+ } catch (error) {
891
+ return handleError(error, "Error time traveling workflow");
892
+ }
893
+ }
894
+ });
895
+ var TIME_TRAVEL_WORKFLOW_ROUTE = createRoute({
896
+ method: "POST",
897
+ path: "/workflows/:workflowId/time-travel",
898
+ responseType: "json",
899
+ pathParamSchema: workflowIdPathParams,
900
+ queryParamSchema: runIdSchema,
901
+ bodySchema: timeTravelBodySchema,
902
+ responseSchema: workflowControlResponseSchema,
903
+ summary: "Time travel workflow",
904
+ description: "Time travels a workflow run, starting from a specific step",
905
+ tags: ["Workflows"],
906
+ requiresAuth: true,
907
+ handler: async ({ mastra, workflowId, runId, ...params }) => {
908
+ try {
909
+ if (!workflowId) {
910
+ throw new HTTPException(400, { message: "Workflow ID is required" });
911
+ }
912
+ if (!runId) {
913
+ throw new HTTPException(400, { message: "runId required to time travel workflow" });
914
+ }
915
+ const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });
916
+ if (!workflow) {
917
+ throw new HTTPException(404, { message: "Workflow not found" });
918
+ }
919
+ const run = await workflow.getWorkflowRunById(runId);
920
+ if (!run) {
921
+ throw new HTTPException(404, { message: "Workflow run not found" });
922
+ }
923
+ const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
924
+ void _run.timeTravel(params);
925
+ return { message: "Workflow run time travel started" };
926
+ } catch (error) {
927
+ return handleError(error, "Error time traveling workflow");
928
+ }
929
+ }
930
+ });
931
+ var TIME_TRAVEL_STREAM_WORKFLOW_ROUTE = createRoute({
932
+ method: "POST",
933
+ path: "/workflows/:workflowId/time-travel-stream",
934
+ responseType: "stream",
935
+ pathParamSchema: workflowIdPathParams,
936
+ queryParamSchema: runIdSchema,
937
+ bodySchema: timeTravelBodySchema,
938
+ summary: "Time travel workflow stream",
939
+ description: "Time travels a workflow run, starting from a specific step, and streams the results in real-time",
940
+ tags: ["Workflows"],
941
+ requiresAuth: true,
942
+ handler: async ({ mastra, workflowId, runId, ...params }) => {
943
+ try {
944
+ if (!workflowId) {
945
+ throw new HTTPException(400, { message: "Workflow ID is required" });
946
+ }
947
+ if (!runId) {
948
+ throw new HTTPException(400, { message: "runId required to time travel workflow stream" });
949
+ }
950
+ const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });
951
+ if (!workflow) {
952
+ throw new HTTPException(404, { message: "Workflow not found" });
953
+ }
954
+ const serverCache = mastra.getServerCache();
955
+ const run = await workflow.createRun({ runId });
956
+ const result = run.timeTravelStream(params);
957
+ return result.fullStream.pipeThrough(
958
+ new TransformStream({
959
+ transform(chunk, controller) {
960
+ if (serverCache) {
961
+ const cacheKey = runId;
962
+ serverCache.listPush(cacheKey, chunk).catch(() => {
963
+ });
964
+ }
965
+ controller.enqueue(chunk);
966
+ }
967
+ })
968
+ );
969
+ } catch (error) {
970
+ return handleError(error, "Error time traveling workflow stream");
971
+ }
972
+ }
973
+ });
635
974
  var CANCEL_WORKFLOW_RUN_ROUTE = createRoute({
636
975
  method: "POST",
637
- path: "/api/workflows/:workflowId/runs/:runId/cancel",
976
+ path: "/workflows/:workflowId/runs/:runId/cancel",
638
977
  responseType: "json",
639
978
  pathParamSchema: workflowRunPathParams,
640
979
  responseSchema: workflowControlResponseSchema,
641
980
  summary: "Cancel workflow run",
642
981
  description: "Cancels an in-progress workflow execution",
643
982
  tags: ["Workflows"],
983
+ requiresAuth: true,
644
984
  handler: async ({ mastra, workflowId, runId }) => {
645
985
  try {
646
986
  if (!workflowId) {
@@ -667,15 +1007,16 @@ var CANCEL_WORKFLOW_RUN_ROUTE = createRoute({
667
1007
  });
668
1008
  var STREAM_LEGACY_WORKFLOW_ROUTE = createRoute({
669
1009
  method: "POST",
670
- path: "/api/workflows/:workflowId/stream-legacy",
1010
+ path: "/workflows/:workflowId/stream-legacy",
671
1011
  responseType: "stream",
672
1012
  pathParamSchema: workflowIdPathParams,
673
1013
  queryParamSchema: runIdSchema,
674
1014
  bodySchema: streamWorkflowBodySchema,
675
1015
  responseSchema: streamResponseSchema,
676
1016
  summary: "[DEPRECATED] Stream workflow with legacy format",
677
- description: "Legacy endpoint for streaming workflow execution. Use /api/workflows/:workflowId/stream instead.",
1017
+ description: "Legacy endpoint for streaming workflow execution. Use /workflows/:workflowId/stream instead.",
678
1018
  tags: ["Workflows", "Legacy"],
1019
+ requiresAuth: true,
679
1020
  handler: async ({ mastra, workflowId, runId, ...params }) => {
680
1021
  try {
681
1022
  if (!workflowId) {
@@ -707,14 +1048,15 @@ var STREAM_LEGACY_WORKFLOW_ROUTE = createRoute({
707
1048
  });
708
1049
  var OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE = createRoute({
709
1050
  method: "POST",
710
- path: "/api/workflows/:workflowId/observe-stream-legacy",
1051
+ path: "/workflows/:workflowId/observe-stream-legacy",
711
1052
  responseType: "stream",
712
1053
  pathParamSchema: workflowIdPathParams,
713
1054
  queryParamSchema: runIdSchema,
714
1055
  responseSchema: streamResponseSchema,
715
1056
  summary: "[DEPRECATED] Observe workflow stream with legacy format",
716
- description: "Legacy endpoint for observing workflow stream. Use /api/workflows/:workflowId/observe instead.",
1057
+ description: "Legacy endpoint for observing workflow stream. Use /workflows/:workflowId/observe instead.",
717
1058
  tags: ["Workflows", "Legacy"],
1059
+ requiresAuth: true,
718
1060
  handler: async ({ mastra, workflowId, runId }) => {
719
1061
  try {
720
1062
  if (!workflowId) {
@@ -751,6 +1093,6 @@ var OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE = createRoute({
751
1093
  }
752
1094
  });
753
1095
 
754
- export { CANCEL_WORKFLOW_RUN_ROUTE, CREATE_WORKFLOW_RUN_ROUTE, GET_WORKFLOW_BY_ID_ROUTE, GET_WORKFLOW_RUN_BY_ID_ROUTE, GET_WORKFLOW_RUN_EXECUTION_RESULT_ROUTE, LIST_WORKFLOWS_ROUTE, LIST_WORKFLOW_RUNS_ROUTE, OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE, OBSERVE_STREAM_VNEXT_WORKFLOW_ROUTE, OBSERVE_STREAM_WORKFLOW_ROUTE, RESUME_ASYNC_WORKFLOW_ROUTE, RESUME_STREAM_WORKFLOW_ROUTE, RESUME_WORKFLOW_ROUTE, START_ASYNC_WORKFLOW_ROUTE, START_WORKFLOW_RUN_ROUTE, STREAM_LEGACY_WORKFLOW_ROUTE, STREAM_VNEXT_WORKFLOW_ROUTE, STREAM_WORKFLOW_ROUTE, createWorkflowRunResponseSchema, listWorkflowRunsQuerySchema, listWorkflowsResponseSchema, resumeBodySchema, startAsyncWorkflowBodySchema, streamLegacyWorkflowBodySchema, streamWorkflowBodySchema, workflowControlResponseSchema, workflowExecutionResultSchema, workflowInfoSchema, workflowRunResponseSchema, workflowRunsResponseSchema, workflows_exports };
755
- //# sourceMappingURL=chunk-VQAT5HX6.js.map
756
- //# sourceMappingURL=chunk-VQAT5HX6.js.map
1096
+ export { CANCEL_WORKFLOW_RUN_ROUTE, CREATE_WORKFLOW_RUN_ROUTE, DELETE_WORKFLOW_RUN_BY_ID_ROUTE, GET_WORKFLOW_BY_ID_ROUTE, GET_WORKFLOW_RUN_BY_ID_ROUTE, LIST_WORKFLOWS_ROUTE, LIST_WORKFLOW_RUNS_ROUTE, OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE, OBSERVE_STREAM_WORKFLOW_ROUTE, RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE, RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE, RESTART_ASYNC_WORKFLOW_ROUTE, RESTART_WORKFLOW_ROUTE, RESUME_ASYNC_WORKFLOW_ROUTE, RESUME_STREAM_WORKFLOW_ROUTE, RESUME_WORKFLOW_ROUTE, START_ASYNC_WORKFLOW_ROUTE, START_WORKFLOW_RUN_ROUTE, STREAM_LEGACY_WORKFLOW_ROUTE, STREAM_WORKFLOW_ROUTE, TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE, TIME_TRAVEL_STREAM_WORKFLOW_ROUTE, TIME_TRAVEL_WORKFLOW_ROUTE, createWorkflowRunResponseSchema, listWorkflowRunsQuerySchema, listWorkflowsResponseSchema, resumeBodySchema, startAsyncWorkflowBodySchema, streamLegacyWorkflowBodySchema, streamWorkflowBodySchema, workflowControlResponseSchema, workflowExecutionResultSchema, workflowInfoSchema, workflowRunResultQuerySchema, workflowRunResultSchema, workflowRunsResponseSchema, workflows_exports };
1097
+ //# sourceMappingURL=chunk-FDSHHJRG.js.map
1098
+ //# sourceMappingURL=chunk-FDSHHJRG.js.map