@mastra/server 1.82.0 → 1.83.0-alpha.0

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 (287) hide show
  1. package/dist/_types/@internal_core@0.1.4/dist/storage/index.d.ts +24 -2
  2. package/dist/_types/@mastra_schema-compat@1.3.17/dist/_types/@internal_ai-v6@0.0.95/dist/index.d.ts +96 -15
  3. package/dist/{a2a-CoiG3TAj.js → a2a-DCpd3CTv.js} +4 -4
  4. package/dist/{a2a-CoiG3TAj.js.map → a2a-DCpd3CTv.js.map} +1 -1
  5. package/dist/{a2a-DvqRdny6.cjs → a2a-kz7NjjCg.cjs} +4 -4
  6. package/dist/{a2a-DvqRdny6.cjs.map → a2a-kz7NjjCg.cjs.map} +1 -1
  7. package/dist/{agent-builder-C_L1i2eE.js → agent-builder-CocfOSi8.js} +7 -7
  8. package/dist/{agent-builder-C_L1i2eE.js.map → agent-builder-CocfOSi8.js.map} +1 -1
  9. package/dist/{agent-builder-D0Up9Fw1.cjs → agent-builder-uDstZROq.cjs} +7 -7
  10. package/dist/{agent-builder-D0Up9Fw1.cjs.map → agent-builder-uDstZROq.cjs.map} +1 -1
  11. package/dist/{agents-CgcW6lHt.js → agents-BI8ez-FT.js} +7 -7
  12. package/dist/{agents-CgcW6lHt.js.map → agents-BI8ez-FT.js.map} +1 -1
  13. package/dist/{agents-DOHGWXDa.cjs → agents-DsfsDhIT.cjs} +7 -7
  14. package/dist/{agents-DOHGWXDa.cjs.map → agents-DsfsDhIT.cjs.map} +1 -1
  15. package/dist/{api-schema-manifest-Ci2qUYHc.js → api-schema-manifest-ChxbN16M.js} +3 -3
  16. package/dist/{api-schema-manifest-Ci2qUYHc.js.map → api-schema-manifest-ChxbN16M.js.map} +1 -1
  17. package/dist/{api-schema-manifest-DCHOlOuJ.cjs → api-schema-manifest-DtYTPvh9.cjs} +3 -3
  18. package/dist/{api-schema-manifest-DCHOlOuJ.cjs.map → api-schema-manifest-DtYTPvh9.cjs.map} +1 -1
  19. package/dist/{background-tasks-BHhn4YZA.js → background-tasks-BIuEr2of.js} +3 -3
  20. package/dist/{background-tasks-BHhn4YZA.js.map → background-tasks-BIuEr2of.js.map} +1 -1
  21. package/dist/{background-tasks-Ci2tlxJC.cjs → background-tasks-BXTIp0QV.cjs} +3 -3
  22. package/dist/{background-tasks-Ci2tlxJC.cjs.map → background-tasks-BXTIp0QV.cjs.map} +1 -1
  23. package/dist/{builder-registry-m_gHCe12.js → builder-registry-Dd7pbJ5A.js} +4 -4
  24. package/dist/{builder-registry-m_gHCe12.js.map → builder-registry-Dd7pbJ5A.js.map} +1 -1
  25. package/dist/{builder-registry-D1_hGKCJ.cjs → builder-registry-DrBUA6EZ.cjs} +4 -4
  26. package/dist/{builder-registry-D1_hGKCJ.cjs.map → builder-registry-DrBUA6EZ.cjs.map} +1 -1
  27. package/dist/{channels-hhQ3vD30.js → channels-B6hwVMbV.js} +4 -4
  28. package/dist/{channels-hhQ3vD30.js.map → channels-B6hwVMbV.js.map} +1 -1
  29. package/dist/{channels-Bfkp5vYI.cjs → channels-DbfSH5O2.cjs} +4 -4
  30. package/dist/{channels-Bfkp5vYI.cjs.map → channels-DbfSH5O2.cjs.map} +1 -1
  31. package/dist/{conversations-xS7yHuG1.js → conversations-BbZYXKIa.js} +5 -5
  32. package/dist/{conversations-xS7yHuG1.js.map → conversations-BbZYXKIa.js.map} +1 -1
  33. package/dist/{conversations-Ch_VuVwY.cjs → conversations-QuKJVEFe.cjs} +5 -5
  34. package/dist/{conversations-Ch_VuVwY.cjs.map → conversations-QuKJVEFe.cjs.map} +1 -1
  35. package/dist/{dist-BKNKucT9.cjs → dist-Ctfk9X6u.cjs} +208 -247
  36. package/dist/dist-Ctfk9X6u.cjs.map +1 -0
  37. package/dist/dist-DJjVMQiv.js +1 -0
  38. package/dist/{dist-CIYZuix4.js → dist-OKFDPspq.js} +208 -247
  39. package/dist/dist-OKFDPspq.js.map +1 -0
  40. package/dist/{dist-DgKeISkr.cjs → dist-ZYvqJK9p.cjs} +1 -1
  41. package/dist/docs/SKILL.md +3 -1
  42. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  43. package/dist/docs/references/docs-knowledge-overview.md +106 -0
  44. package/dist/docs/references/docs-server-custom-adapters.md +4 -0
  45. package/dist/docs/references/docs-studio-knowledge.md +45 -24
  46. package/dist/docs/references/reference-server-invoke-route.md +86 -0
  47. package/dist/docs/references/reference-server-routes.md +63 -0
  48. package/dist/{dynamic-workflows-DDauBnDt.js → dynamic-workflows-CyaZLmHX.js} +2 -2
  49. package/dist/{dynamic-workflows-DDauBnDt.js.map → dynamic-workflows-CyaZLmHX.js.map} +1 -1
  50. package/dist/{dynamic-workflows-CpCkqM1g.cjs → dynamic-workflows-ZmzWJXxG.cjs} +2 -2
  51. package/dist/{dynamic-workflows-CpCkqM1g.cjs.map → dynamic-workflows-ZmzWJXxG.cjs.map} +1 -1
  52. package/dist/{editor-builder-Ceen28s8.js → editor-builder-CbfX5bvL.js} +4 -4
  53. package/dist/{editor-builder-Ceen28s8.js.map → editor-builder-CbfX5bvL.js.map} +1 -1
  54. package/dist/{editor-builder-CKfy5eZY.cjs → editor-builder-CjJlqR9a.cjs} +4 -4
  55. package/dist/{editor-builder-CKfy5eZY.cjs.map → editor-builder-CjJlqR9a.cjs.map} +1 -1
  56. package/dist/{helpers-DNq3LtLq.js → helpers-B29a1nM3.js} +51 -48
  57. package/dist/helpers-B29a1nM3.js.map +1 -0
  58. package/dist/{helpers-BKtUXhz2.cjs → helpers-CylvUIZm.cjs} +56 -47
  59. package/dist/helpers-CylvUIZm.cjs.map +1 -0
  60. package/dist/{knowledge-Ba74qr0v.js → knowledge-Cd2cCq-Y.js} +4 -4
  61. package/dist/{knowledge-Ba74qr0v.js.map → knowledge-Cd2cCq-Y.js.map} +1 -1
  62. package/dist/{knowledge-urR7FFG8.cjs → knowledge-Q_SCnD9m.cjs} +4 -4
  63. package/dist/{knowledge-urR7FFG8.cjs.map → knowledge-Q_SCnD9m.cjs.map} +1 -1
  64. package/dist/{logs-B57_NKDn.js → logs-C5L6gRGr.js} +4 -4
  65. package/dist/{logs-B57_NKDn.js.map → logs-C5L6gRGr.js.map} +1 -1
  66. package/dist/{logs-BJN3M88A.cjs → logs-DWIbFIw6.cjs} +4 -4
  67. package/dist/{logs-BJN3M88A.cjs.map → logs-DWIbFIw6.cjs.map} +1 -1
  68. package/dist/{mcp-B9BILfJP.cjs → mcp-CKvOVfHn.cjs} +3 -3
  69. package/dist/{mcp-B9BILfJP.cjs.map → mcp-CKvOVfHn.cjs.map} +1 -1
  70. package/dist/{mcp-BkmWZD6M.js → mcp-CntC59iU.js} +3 -3
  71. package/dist/{mcp-BkmWZD6M.js.map → mcp-CntC59iU.js.map} +1 -1
  72. package/dist/{memory-Dqod_AK9.cjs → memory-DIos0BE-.cjs} +57 -15
  73. package/dist/{memory-Dqod_AK9.cjs.map → memory-DIos0BE-.cjs.map} +1 -1
  74. package/dist/{memory-ipOCmg0C.js → memory-JzgWJevA.js} +57 -15
  75. package/dist/{memory-ipOCmg0C.js.map → memory-JzgWJevA.js.map} +1 -1
  76. package/dist/{observability-DBtyAJnb.js → observability-BCTkIhJT.js} +3 -3
  77. package/dist/{observability-DBtyAJnb.js.map → observability-BCTkIhJT.js.map} +1 -1
  78. package/dist/{observability-BtdW6mjq.cjs → observability-mnHHbnoc.cjs} +3 -3
  79. package/dist/{observability-BtdW6mjq.cjs.map → observability-mnHHbnoc.cjs.map} +1 -1
  80. package/dist/{observability-new-endpoints-jjCgXuTF.cjs → observability-new-endpoints-B6fo20v5.cjs} +129 -955
  81. package/dist/observability-new-endpoints-B6fo20v5.cjs.map +1 -0
  82. package/dist/{observability-new-endpoints-Di7m_-xc.js → observability-new-endpoints-DHn8uKyr.js} +51 -877
  83. package/dist/observability-new-endpoints-DHn8uKyr.js.map +1 -0
  84. package/dist/observability-signal-context-BYOFtbM_.cjs +1317 -0
  85. package/dist/observability-signal-context-BYOFtbM_.cjs.map +1 -0
  86. package/dist/observability-signal-context-CL5-rCWM.js +952 -0
  87. package/dist/observability-signal-context-CL5-rCWM.js.map +1 -0
  88. package/dist/{plans-nHOnlGzr.js → plans-9hdkc-t8.js} +4 -4
  89. package/dist/{plans-nHOnlGzr.js.map → plans-9hdkc-t8.js.map} +1 -1
  90. package/dist/{plans-Djcp3C0d.cjs → plans-DMs8SVBG.cjs} +4 -4
  91. package/dist/{plans-Djcp3C0d.cjs.map → plans-DMs8SVBG.cjs.map} +1 -1
  92. package/dist/{probe-image-size-DGTRKrgq.js → probe-image-size-Cxm5QtwO.js} +2 -2
  93. package/dist/{probe-image-size-DGTRKrgq.js.map → probe-image-size-Cxm5QtwO.js.map} +1 -1
  94. package/dist/{probe-image-size-BAwk1h6w.cjs → probe-image-size-bDuzMW0E.cjs} +2 -2
  95. package/dist/{probe-image-size-BAwk1h6w.cjs.map → probe-image-size-bDuzMW0E.cjs.map} +1 -1
  96. package/dist/{responses-CEet9y8G.js → responses-B5_syoSo.js} +5 -5
  97. package/dist/{responses-CEet9y8G.js.map → responses-B5_syoSo.js.map} +1 -1
  98. package/dist/{responses-BdOStKtX.cjs → responses-CNKJoC5a.cjs} +5 -5
  99. package/dist/{responses-BdOStKtX.cjs.map → responses-CNKJoC5a.cjs.map} +1 -1
  100. package/dist/{route-builder-BxPrwNog.js → route-builder-BKEzjw_M.js} +2 -2
  101. package/dist/{route-builder-BxPrwNog.js.map → route-builder-BKEzjw_M.js.map} +1 -1
  102. package/dist/{route-builder-CvARmqnA.cjs → route-builder-DHqDrSSy.cjs} +2 -2
  103. package/dist/{route-builder-CvARmqnA.cjs.map → route-builder-DHqDrSSy.cjs.map} +1 -1
  104. package/dist/{routes-DU_FlwJP.cjs → routes-BYQ38dFx.cjs} +32 -32
  105. package/dist/{routes-DU_FlwJP.cjs.map → routes-BYQ38dFx.cjs.map} +1 -1
  106. package/dist/{routes-5FpkkzND.js → routes-C0pgNcG-.js} +32 -32
  107. package/dist/{routes-5FpkkzND.js.map → routes-C0pgNcG-.js.map} +1 -1
  108. package/dist/{schedules-D8ShgpY3.cjs → schedules-CvWX2yKR.cjs} +3 -3
  109. package/dist/{schedules-D8ShgpY3.cjs.map → schedules-CvWX2yKR.cjs.map} +1 -1
  110. package/dist/{schedules-CGViSLZC.js → schedules-D9CKB18-.js} +3 -3
  111. package/dist/{schedules-CGViSLZC.js.map → schedules-D9CKB18-.js.map} +1 -1
  112. package/dist/{schema-Bf12g7KC-DBc4NSds.js → schema-Bf12g7KC-5EUrrnSf.js} +96 -96
  113. package/dist/{schema-Bf12g7KC-DBc4NSds.js.map → schema-Bf12g7KC-5EUrrnSf.js.map} +1 -1
  114. package/dist/{schema-Bf12g7KC-plP4Ir6h.cjs → schema-Bf12g7KC-C5XzpQxe.cjs} +96 -96
  115. package/dist/{schema-Bf12g7KC-plP4Ir6h.cjs.map → schema-Bf12g7KC-C5XzpQxe.cjs.map} +1 -1
  116. package/dist/{scores-BaDFGpmr.js → scores-B3mS6vqB.js} +4 -4
  117. package/dist/{scores-BaDFGpmr.js.map → scores-B3mS6vqB.js.map} +1 -1
  118. package/dist/{scores-Bw6Tuga5.cjs → scores-Dxa8dDfV.cjs} +4 -4
  119. package/dist/{scores-Bw6Tuga5.cjs.map → scores-Dxa8dDfV.cjs.map} +1 -1
  120. package/dist/server/auth/helpers.d.ts +20 -0
  121. package/dist/server/auth/helpers.d.ts.map +1 -1
  122. package/dist/server/auth/index.cjs +2 -1
  123. package/dist/server/auth/index.js +2 -2
  124. package/dist/server/handlers/a2a.cjs +1 -1
  125. package/dist/server/handlers/a2a.js +1 -1
  126. package/dist/server/handlers/agent-builder.cjs +1 -1
  127. package/dist/server/handlers/agent-builder.js +1 -1
  128. package/dist/server/handlers/agent-controller.cjs +4 -4
  129. package/dist/server/handlers/agent-controller.js +4 -4
  130. package/dist/server/handlers/agent-versions.cjs +4 -4
  131. package/dist/server/handlers/agent-versions.js +4 -4
  132. package/dist/server/handlers/agents.cjs +1 -1
  133. package/dist/server/handlers/agents.js +1 -1
  134. package/dist/server/handlers/auth.cjs +4 -4
  135. package/dist/server/handlers/auth.js +4 -4
  136. package/dist/server/handlers/authorship.cjs +1 -1
  137. package/dist/server/handlers/authorship.js +1 -1
  138. package/dist/server/handlers/background-tasks.cjs +1 -1
  139. package/dist/server/handlers/background-tasks.js +1 -1
  140. package/dist/server/handlers/builder-registry.cjs +1 -1
  141. package/dist/server/handlers/builder-registry.js +1 -1
  142. package/dist/server/handlers/channels.cjs +1 -1
  143. package/dist/server/handlers/channels.js +1 -1
  144. package/dist/server/handlers/conversations.cjs +1 -1
  145. package/dist/server/handlers/conversations.js +1 -1
  146. package/dist/server/handlers/datasets.cjs +3 -3
  147. package/dist/server/handlers/datasets.js +3 -3
  148. package/dist/server/handlers/dynamic-workflows.cjs +1 -1
  149. package/dist/server/handlers/dynamic-workflows.js +1 -1
  150. package/dist/server/handlers/editor-builder.cjs +1 -1
  151. package/dist/server/handlers/editor-builder.js +1 -1
  152. package/dist/server/handlers/favorites-enrichment.cjs +1 -1
  153. package/dist/server/handlers/favorites-enrichment.js +1 -1
  154. package/dist/server/handlers/gateway-memory-client.cjs +4 -1
  155. package/dist/server/handlers/gateway-memory-client.cjs.map +1 -1
  156. package/dist/server/handlers/gateway-memory-client.d.ts.map +1 -1
  157. package/dist/server/handlers/gateway-memory-client.js +4 -1
  158. package/dist/server/handlers/gateway-memory-client.js.map +1 -1
  159. package/dist/server/handlers/knowledge.cjs +1 -1
  160. package/dist/server/handlers/knowledge.js +1 -1
  161. package/dist/server/handlers/logs.cjs +1 -1
  162. package/dist/server/handlers/logs.js +1 -1
  163. package/dist/server/handlers/mcp-client-versions.cjs +3 -3
  164. package/dist/server/handlers/mcp-client-versions.js +3 -3
  165. package/dist/server/handlers/mcp.cjs +1 -1
  166. package/dist/server/handlers/mcp.js +1 -1
  167. package/dist/server/handlers/memory.cjs +1 -1
  168. package/dist/server/handlers/memory.d.ts.map +1 -1
  169. package/dist/server/handlers/memory.js +1 -1
  170. package/dist/server/handlers/observability-new-endpoints.cjs +1 -1
  171. package/dist/server/handlers/observability-new-endpoints.d.ts +84 -8
  172. package/dist/server/handlers/observability-new-endpoints.d.ts.map +1 -1
  173. package/dist/server/handlers/observability-new-endpoints.js +1 -1
  174. package/dist/server/handlers/observability-shared.cjs +1 -1
  175. package/dist/server/handlers/observability-shared.js +1 -1
  176. package/dist/server/handlers/observability-signal-context.cjs +4 -0
  177. package/dist/server/handlers/observability-signal-context.d.ts +42 -0
  178. package/dist/server/handlers/observability-signal-context.d.ts.map +1 -0
  179. package/dist/server/handlers/observability-signal-context.js +1 -0
  180. package/dist/server/handlers/observability.cjs +2 -2
  181. package/dist/server/handlers/observability.js +2 -2
  182. package/dist/server/handlers/plans.cjs +1 -1
  183. package/dist/server/handlers/plans.js +1 -1
  184. package/dist/server/handlers/processor-providers.cjs +2 -2
  185. package/dist/server/handlers/processor-providers.js +2 -2
  186. package/dist/server/handlers/processors.cjs +2 -2
  187. package/dist/server/handlers/processors.js +2 -2
  188. package/dist/server/handlers/prompt-block-versions.cjs +3 -3
  189. package/dist/server/handlers/prompt-block-versions.js +3 -3
  190. package/dist/server/handlers/responses.cjs +1 -1
  191. package/dist/server/handlers/responses.js +1 -1
  192. package/dist/server/handlers/responses.storage.cjs +1 -1
  193. package/dist/server/handlers/responses.storage.js +1 -1
  194. package/dist/server/handlers/schedules.cjs +1 -1
  195. package/dist/server/handlers/schedules.js +1 -1
  196. package/dist/server/handlers/scorer-versions.cjs +3 -3
  197. package/dist/server/handlers/scorer-versions.js +3 -3
  198. package/dist/server/handlers/scores.cjs +1 -1
  199. package/dist/server/handlers/scores.js +1 -1
  200. package/dist/server/handlers/stored-agent-favorites.cjs +5 -5
  201. package/dist/server/handlers/stored-agent-favorites.js +5 -5
  202. package/dist/server/handlers/stored-agents.cjs +7 -7
  203. package/dist/server/handlers/stored-agents.js +7 -7
  204. package/dist/server/handlers/stored-mcp-clients.cjs +3 -3
  205. package/dist/server/handlers/stored-mcp-clients.js +3 -3
  206. package/dist/server/handlers/stored-prompt-blocks.cjs +3 -3
  207. package/dist/server/handlers/stored-prompt-blocks.js +3 -3
  208. package/dist/server/handlers/stored-scorers.cjs +3 -3
  209. package/dist/server/handlers/stored-scorers.js +3 -3
  210. package/dist/server/handlers/stored-skill-favorites.cjs +5 -5
  211. package/dist/server/handlers/stored-skill-favorites.js +5 -5
  212. package/dist/server/handlers/stored-skills.cjs +5 -5
  213. package/dist/server/handlers/stored-skills.js +5 -5
  214. package/dist/server/handlers/stored-workspaces.cjs +3 -3
  215. package/dist/server/handlers/stored-workspaces.js +3 -3
  216. package/dist/server/handlers/system.cjs +3 -3
  217. package/dist/server/handlers/system.js +3 -3
  218. package/dist/server/handlers/tool-providers.cjs +3 -3
  219. package/dist/server/handlers/tool-providers.js +3 -3
  220. package/dist/server/handlers/tools.cjs +1 -1
  221. package/dist/server/handlers/tools.js +1 -1
  222. package/dist/server/handlers/utils.cjs +1 -1
  223. package/dist/server/handlers/utils.js +1 -1
  224. package/dist/server/handlers/validate-agent-instructions.cjs +1 -1
  225. package/dist/server/handlers/validate-agent-instructions.js +1 -1
  226. package/dist/server/handlers/vector.cjs +1 -1
  227. package/dist/server/handlers/vector.js +1 -1
  228. package/dist/server/handlers/workflow-builder.cjs +1 -1
  229. package/dist/server/handlers/workflow-builder.js +1 -1
  230. package/dist/server/handlers/workflows.cjs +1 -1
  231. package/dist/server/handlers/workflows.d.ts.map +1 -1
  232. package/dist/server/handlers/workflows.js +1 -1
  233. package/dist/server/handlers/workspace.cjs +1 -1
  234. package/dist/server/handlers/workspace.d.ts +23 -23
  235. package/dist/server/handlers/workspace.js +1 -1
  236. package/dist/server/handlers.cjs +16 -16
  237. package/dist/server/handlers.js +16 -16
  238. package/dist/server/schemas/index.cjs +20 -20
  239. package/dist/server/schemas/index.js +20 -20
  240. package/dist/server/server-adapter/index.cjs +231 -61
  241. package/dist/server/server-adapter/index.cjs.map +1 -1
  242. package/dist/server/server-adapter/index.d.ts +67 -1
  243. package/dist/server/server-adapter/index.d.ts.map +1 -1
  244. package/dist/server/server-adapter/index.js +226 -63
  245. package/dist/server/server-adapter/index.js.map +1 -1
  246. package/dist/server/server-adapter/mcp-auth.d.ts +16 -1
  247. package/dist/server/server-adapter/mcp-auth.d.ts.map +1 -1
  248. package/dist/server/server-adapter/routes/observability.d.ts +42 -4
  249. package/dist/server/server-adapter/routes/observability.d.ts.map +1 -1
  250. package/dist/{tools-CI5oeJWT.cjs → tools-C9W7WvyI.cjs} +7 -7
  251. package/dist/{tools-CI5oeJWT.cjs.map → tools-C9W7WvyI.cjs.map} +1 -1
  252. package/dist/{tools-BAmCNGM5.js → tools-Ce7SFoT1.js} +7 -7
  253. package/dist/{tools-BAmCNGM5.js.map → tools-Ce7SFoT1.js.map} +1 -1
  254. package/dist/{utils-9PRHHTGC.cjs → utils-BXEJ6FZC.cjs} +2 -2
  255. package/dist/{utils-9PRHHTGC.cjs.map → utils-BXEJ6FZC.cjs.map} +1 -1
  256. package/dist/{utils-BhBJHsqX.cjs → utils-CL-m2SWZ.cjs} +3 -3
  257. package/dist/{utils-BhBJHsqX.cjs.map → utils-CL-m2SWZ.cjs.map} +1 -1
  258. package/dist/{utils-B15w-1hm.js → utils-CTYtskHa.js} +2 -2
  259. package/dist/{utils-B15w-1hm.js.map → utils-CTYtskHa.js.map} +1 -1
  260. package/dist/{utils-Dy_dQTlK.js → utils-y-cW3mQU.js} +3 -3
  261. package/dist/{utils-Dy_dQTlK.js.map → utils-y-cW3mQU.js.map} +1 -1
  262. package/dist/{vector-BZ1bKtwM.cjs → vector-6k7Ft7EX.cjs} +3 -3
  263. package/dist/{vector-BZ1bKtwM.cjs.map → vector-6k7Ft7EX.cjs.map} +1 -1
  264. package/dist/{vector-BAs5o6mH.js → vector-BWFSDXvg.js} +3 -3
  265. package/dist/{vector-BAs5o6mH.js.map → vector-BWFSDXvg.js.map} +1 -1
  266. package/dist/{workflow-builder-CaSfD6oL.js → workflow-builder-BNk301jl.js} +4 -4
  267. package/dist/{workflow-builder-CaSfD6oL.js.map → workflow-builder-BNk301jl.js.map} +1 -1
  268. package/dist/{workflow-builder-tr_D_ZDN.cjs → workflow-builder-CsOEskDo.cjs} +4 -4
  269. package/dist/{workflow-builder-tr_D_ZDN.cjs.map → workflow-builder-CsOEskDo.cjs.map} +1 -1
  270. package/dist/{workflows-BxXS5AfE.js → workflows-BAFGmHCW.js} +24 -13
  271. package/dist/workflows-BAFGmHCW.js.map +1 -0
  272. package/dist/{workflows-Cdi6w8JW.cjs → workflows-CJz5Eh0B.cjs} +76 -65
  273. package/dist/workflows-CJz5Eh0B.cjs.map +1 -0
  274. package/dist/{workspace-BU6sQpbV.cjs → workspace-C7PytFzz.cjs} +3 -3
  275. package/dist/{workspace-BU6sQpbV.cjs.map → workspace-C7PytFzz.cjs.map} +1 -1
  276. package/dist/{workspace-CS-GYTve.js → workspace-CYwDvH0G.js} +3 -3
  277. package/dist/{workspace-CS-GYTve.js.map → workspace-CYwDvH0G.js.map} +1 -1
  278. package/package.json +5 -5
  279. package/dist/dist-BKNKucT9.cjs.map +0 -1
  280. package/dist/dist-CIYZuix4.js.map +0 -1
  281. package/dist/dist-mNQb9_wX.js +0 -1
  282. package/dist/helpers-BKtUXhz2.cjs.map +0 -1
  283. package/dist/helpers-DNq3LtLq.js.map +0 -1
  284. package/dist/observability-new-endpoints-Di7m_-xc.js.map +0 -1
  285. package/dist/observability-new-endpoints-jjCgXuTF.cjs.map +0 -1
  286. package/dist/workflows-BxXS5AfE.js.map +0 -1
  287. package/dist/workflows-Cdi6w8JW.cjs.map +0 -1
@@ -1,12 +1,12 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-10nMEhjP.cjs");
2
+ const require_utils = require("./utils-BXEJ6FZC.cjs");
2
3
  const require_http_exception = require("./http-exception-Co3MbFUf.cjs");
4
+ const require_agents = require("./agents-DbnPZXIN.cjs");
3
5
  const require_common = require("./common-D5XxSuvu.cjs");
4
6
  const require_workflows = require("./workflows-CKcjXfXk.cjs");
5
- const require_agents = require("./agents-DbnPZXIN.cjs");
6
- const require_route_builder = require("./route-builder-CvARmqnA.cjs");
7
- const require_utils = require("./utils-BhBJHsqX.cjs");
7
+ const require_route_builder = require("./route-builder-DHqDrSSy.cjs");
8
+ const require_utils$1 = require("./utils-CL-m2SWZ.cjs");
8
9
  const require_server_handlers_error = require("./server/handlers/error.cjs");
9
- const require_utils$1 = require("./utils-9PRHHTGC.cjs");
10
10
  let zod_v4 = require("zod/v4");
11
11
  let _mastra_core_stream = require("@mastra/core/stream");
12
12
  // src/server/handlers/workflows.ts
@@ -53,6 +53,17 @@ const TERMINAL_RUN_STATUSES = [
53
53
  "tripwire"
54
54
  ];
55
55
  /**
56
+ * A run's result with its step results read: a storage v2 result's `steps` is a loader that
57
+ * reads them from storage, which a response can't carry, so it answers with them as for v1.
58
+ */
59
+ async function withLoadedSteps(result) {
60
+ const steps = result.steps;
61
+ return typeof steps === "function" ? {
62
+ ...result,
63
+ steps: await steps()
64
+ } : result;
65
+ }
66
+ /**
56
67
  * Runs whose chunks are already being written to the cache in this process,
57
68
  * keyed by runId. A run has exactly one writer: without this, two concurrent
58
69
  * requests for the same runId each cache every chunk and the replayed history
@@ -93,8 +104,8 @@ async function listWorkflowsFromSystem({ mastra, workflowId }) {
93
104
  const logger = mastra.getLogger();
94
105
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
95
106
  let workflow;
96
- workflow = require_utils.WorkflowRegistry.getWorkflow(workflowId, mastra);
97
- if (!workflow) workflow = require_utils$1.getPublicWorkflowById(mastra, workflowId);
107
+ workflow = require_utils$1.WorkflowRegistry.getWorkflow(workflowId, mastra);
108
+ if (!workflow) workflow = require_utils.getPublicWorkflowById(mastra, workflowId);
98
109
  if (!workflow) {
99
110
  logger.debug("Workflow not found, searching agents for workflow", { workflowId });
100
111
  const agents = mastra.listAgents();
@@ -126,10 +137,10 @@ const LIST_WORKFLOWS_ROUTE = require_route_builder.createRoute({
126
137
  const workflows = mastra.listWorkflows({ serialized: false });
127
138
  const isPartial = partial === "true";
128
139
  const _workflows = Object.entries(workflows).reduce((acc, [key, workflow]) => {
129
- acc[key] = require_utils.getWorkflowInfo(workflow, isPartial);
140
+ acc[key] = require_utils$1.getWorkflowInfo(workflow, isPartial);
130
141
  return acc;
131
142
  }, {});
132
- const fgaProvider = require_utils$1.getHandlerFGAProvider(mastra, requestContext);
143
+ const fgaProvider = require_utils.getHandlerFGAProvider(mastra, requestContext);
133
144
  const user = requestContext?.get("user");
134
145
  if (fgaProvider) {
135
146
  if (!user) return {};
@@ -137,7 +148,7 @@ const LIST_WORKFLOWS_ROUTE = require_route_builder.createRoute({
137
148
  id,
138
149
  ...w
139
150
  }));
140
- const accessible = await fgaProvider.filterAccessible(user, workflowList, "workflow", require_utils$1.MastraFGAPermissions.WORKFLOWS_READ);
151
+ const accessible = await fgaProvider.filterAccessible(user, workflowList, "workflow", require_utils.MastraFGAPermissions.WORKFLOWS_READ);
141
152
  const accessibleSet = new Set(accessible.map((w) => w.id));
142
153
  for (const id of Object.keys(_workflows)) if (!accessibleSet.has(id)) delete _workflows[id];
143
154
  }
@@ -165,7 +176,7 @@ const LIST_WORKFLOW_RUN_COUNTS_ROUTE = require_route_builder.createRoute({
165
176
  requiresAuth: true,
166
177
  handler: (async ({ mastra, requestContext }) => {
167
178
  try {
168
- const fgaProvider = require_utils$1.getHandlerFGAProvider(mastra, requestContext);
179
+ const fgaProvider = require_utils.getHandlerFGAProvider(mastra, requestContext);
169
180
  const user = requestContext?.get("user");
170
181
  if (fgaProvider && !user) return {};
171
182
  const workflows = mastra.listWorkflows({ serialized: false });
@@ -178,7 +189,7 @@ const LIST_WORKFLOW_RUN_COUNTS_ROUTE = require_route_builder.createRoute({
178
189
  };
179
190
  workflowIdToRegistryKey.set(workflow.id, registryKey);
180
191
  }
181
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
192
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
182
193
  const cacheable = !fgaProvider && !effectiveResourceId;
183
194
  if (cacheable) {
184
195
  const cached = runCountsCache.get(mastra);
@@ -207,7 +218,7 @@ const LIST_WORKFLOW_RUN_COUNTS_ROUTE = require_route_builder.createRoute({
207
218
  }
208
219
  if (fgaProvider) {
209
220
  const workflowList = Object.keys(counts).map((id) => ({ id }));
210
- const accessible = await fgaProvider.filterAccessible(user, workflowList, "workflow", require_utils$1.MastraFGAPermissions.WORKFLOWS_READ);
221
+ const accessible = await fgaProvider.filterAccessible(user, workflowList, "workflow", require_utils.MastraFGAPermissions.WORKFLOWS_READ);
211
222
  const accessibleSet = new Set(accessible.map((w) => w.id));
212
223
  for (const id of Object.keys(counts)) if (!accessibleSet.has(id)) delete counts[id];
213
224
  return counts;
@@ -239,7 +250,7 @@ const GET_WORKFLOW_BY_ID_ROUTE = require_route_builder.createRoute({
239
250
  mastra,
240
251
  workflowId
241
252
  });
242
- return require_utils.getWorkflowInfo(workflow, false);
253
+ return require_utils$1.getWorkflowInfo(workflow, false);
243
254
  } catch (error) {
244
255
  return require_server_handlers_error.handleError(error, "Error getting workflow");
245
256
  }
@@ -258,7 +269,7 @@ const LIST_WORKFLOW_RUNS_ROUTE = require_route_builder.createRoute({
258
269
  requiresAuth: true,
259
270
  handler: async ({ mastra, workflowId, fromDate, toDate, page, perPage, limit, offset, resourceId, status, summary, requestContext }) => {
260
271
  try {
261
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, resourceId);
272
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, resourceId);
262
273
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
263
274
  let finalPage = page;
264
275
  let finalPerPage = perPage;
@@ -324,7 +335,7 @@ const GET_WORKFLOW_RUN_BY_ID_ROUTE = require_route_builder.createRoute({
324
335
  requiresAuth: true,
325
336
  handler: async ({ mastra, workflowId, runId, fields, withNestedWorkflows, requestContext }) => {
326
337
  try {
327
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
338
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
328
339
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
329
340
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "Run ID is required" });
330
341
  const { workflow } = await listWorkflowsFromSystem({
@@ -338,7 +349,7 @@ const GET_WORKFLOW_RUN_BY_ID_ROUTE = require_route_builder.createRoute({
338
349
  fields: fieldList
339
350
  });
340
351
  if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
341
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
352
+ await require_utils.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
342
353
  return run;
343
354
  } catch (error) {
344
355
  return require_server_handlers_error.handleError(error, "Error getting workflow run");
@@ -357,7 +368,7 @@ const DELETE_WORKFLOW_RUN_BY_ID_ROUTE = require_route_builder.createRoute({
357
368
  requiresAuth: true,
358
369
  handler: async ({ mastra, workflowId, runId, requestContext }) => {
359
370
  try {
360
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
371
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
361
372
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
362
373
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "Run ID is required" });
363
374
  const { workflow } = await listWorkflowsFromSystem({
@@ -367,7 +378,7 @@ const DELETE_WORKFLOW_RUN_BY_ID_ROUTE = require_route_builder.createRoute({
367
378
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
368
379
  const run = await workflow.getWorkflowRunById(runId);
369
380
  if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
370
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
381
+ await require_utils.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
371
382
  await workflow.deleteWorkflowRunById(runId);
372
383
  return { message: "Workflow run deleted" };
373
384
  } catch (error) {
@@ -390,7 +401,7 @@ const CREATE_WORKFLOW_RUN_ROUTE = require_route_builder.createRoute({
390
401
  requiresPermission: ["workflows:write", "workflows:execute"],
391
402
  handler: async ({ mastra, workflowId, runId, resourceId, disableScorers, requestContext }) => {
392
403
  try {
393
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, resourceId);
404
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, resourceId);
394
405
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
395
406
  const { workflow } = await listWorkflowsFromSystem({
396
407
  mastra,
@@ -399,7 +410,7 @@ const CREATE_WORKFLOW_RUN_ROUTE = require_route_builder.createRoute({
399
410
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
400
411
  if (runId) {
401
412
  const existingRun = await workflow.getWorkflowRunById(runId, { withNestedWorkflows: false });
402
- await require_utils$1.validateRunOwnership(existingRun, require_utils$1.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
413
+ await require_utils.validateRunOwnership(existingRun, require_utils.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
403
414
  }
404
415
  return { runId: (await workflow.createRun({
405
416
  runId,
@@ -424,7 +435,7 @@ const STREAM_WORKFLOW_ROUTE = require_route_builder.createRoute({
424
435
  requiresAuth: true,
425
436
  handler: async ({ mastra, workflowId, runId, resourceId, requestContext, ...params }) => {
426
437
  try {
427
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, resourceId);
438
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, resourceId);
428
439
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
429
440
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to stream workflow" });
430
441
  const { workflow } = await listWorkflowsFromSystem({
@@ -433,7 +444,7 @@ const STREAM_WORKFLOW_ROUTE = require_route_builder.createRoute({
433
444
  });
434
445
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
435
446
  const existingRun = await workflow.getWorkflowRunById(runId, { withNestedWorkflows: false });
436
- await require_utils$1.validateRunOwnership(existingRun, require_utils$1.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
447
+ await require_utils.validateRunOwnership(existingRun, require_utils.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
437
448
  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.` });
438
449
  const serverCache = mastra.getServerCache();
439
450
  const result = (await workflow.createRun({
@@ -468,7 +479,7 @@ const RESUME_STREAM_WORKFLOW_ROUTE = require_route_builder.createRoute({
468
479
  requiresAuth: true,
469
480
  handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
470
481
  try {
471
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
482
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
472
483
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
473
484
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to resume workflow" });
474
485
  const { workflow } = await listWorkflowsFromSystem({
@@ -478,7 +489,7 @@ const RESUME_STREAM_WORKFLOW_ROUTE = require_route_builder.createRoute({
478
489
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
479
490
  const run = await workflow.getWorkflowRunById(runId);
480
491
  if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
481
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
492
+ await require_utils.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
482
493
  const _run = await workflow.createRun({
483
494
  runId,
484
495
  resourceId: run.resourceId
@@ -513,7 +524,7 @@ const START_ASYNC_WORKFLOW_ROUTE = require_route_builder.createRoute({
513
524
  requiresAuth: true,
514
525
  handler: async ({ mastra, workflowId, runId, resourceId, requestContext, ...params }) => {
515
526
  try {
516
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, resourceId);
527
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, resourceId);
517
528
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
518
529
  const { workflow } = await listWorkflowsFromSystem({
519
530
  mastra,
@@ -522,15 +533,15 @@ const START_ASYNC_WORKFLOW_ROUTE = require_route_builder.createRoute({
522
533
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
523
534
  if (runId) {
524
535
  const existingRun = await workflow.getWorkflowRunById(runId, { withNestedWorkflows: false });
525
- await require_utils$1.validateRunOwnership(existingRun, require_utils$1.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
536
+ await require_utils.validateRunOwnership(existingRun, require_utils.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
526
537
  }
527
- return await (await workflow.createRun({
538
+ return await withLoadedSteps(await (await workflow.createRun({
528
539
  runId,
529
540
  resourceId: effectiveResourceId
530
541
  })).start({
531
542
  ...params,
532
543
  requestContext
533
- });
544
+ }));
534
545
  } catch (error) {
535
546
  return require_server_handlers_error.handleError(error, "Error starting async workflow");
536
547
  }
@@ -550,7 +561,7 @@ const START_WORKFLOW_RUN_ROUTE = require_route_builder.createRoute({
550
561
  requiresAuth: true,
551
562
  handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
552
563
  try {
553
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
564
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
554
565
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
555
566
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to start run" });
556
567
  const { workflow } = await listWorkflowsFromSystem({
@@ -560,7 +571,7 @@ const START_WORKFLOW_RUN_ROUTE = require_route_builder.createRoute({
560
571
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
561
572
  const run = await workflow.getWorkflowRunById(runId);
562
573
  if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
563
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
574
+ await require_utils.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
564
575
  (await workflow.createRun({
565
576
  runId,
566
577
  resourceId: run.resourceId
@@ -593,7 +604,7 @@ const OBSERVE_STREAM_WORKFLOW_ROUTE = require_route_builder.createRoute({
593
604
  requiresAuth: true,
594
605
  handler: async ({ mastra, workflowId, runId, offset, requestContext }) => {
595
606
  try {
596
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
607
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
597
608
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
598
609
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to observe workflow stream" });
599
610
  const { workflow } = await listWorkflowsFromSystem({
@@ -603,7 +614,7 @@ const OBSERVE_STREAM_WORKFLOW_ROUTE = require_route_builder.createRoute({
603
614
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
604
615
  const run = await workflow.getWorkflowRunById(runId);
605
616
  if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
606
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
617
+ await require_utils.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
607
618
  const _run = await workflow.createRun({
608
619
  runId,
609
620
  resourceId: run.resourceId
@@ -636,7 +647,7 @@ const RESUME_ASYNC_WORKFLOW_ROUTE = require_route_builder.createRoute({
636
647
  requiresAuth: true,
637
648
  handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
638
649
  try {
639
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
650
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
640
651
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
641
652
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to resume workflow" });
642
653
  const { workflow } = await listWorkflowsFromSystem({
@@ -646,14 +657,14 @@ const RESUME_ASYNC_WORKFLOW_ROUTE = require_route_builder.createRoute({
646
657
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
647
658
  const run = await workflow.getWorkflowRunById(runId);
648
659
  if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
649
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
650
- return await (await workflow.createRun({
660
+ await require_utils.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
661
+ return await withLoadedSteps(await (await workflow.createRun({
651
662
  runId,
652
663
  resourceId: run.resourceId
653
664
  })).resume({
654
665
  ...params,
655
666
  requestContext
656
- });
667
+ }));
657
668
  } catch (error) {
658
669
  return require_server_handlers_error.handleError(error, "Error resuming workflow step");
659
670
  }
@@ -683,7 +694,7 @@ const RESUME_NO_WAIT_WORKFLOW_ROUTE = require_route_builder.createRoute({
683
694
  requiresAuth: true,
684
695
  handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
685
696
  try {
686
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
697
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
687
698
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
688
699
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to resume workflow" });
689
700
  const { workflow } = await listWorkflowsFromSystem({
@@ -693,7 +704,7 @@ const RESUME_NO_WAIT_WORKFLOW_ROUTE = require_route_builder.createRoute({
693
704
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
694
705
  const run = await workflow.getWorkflowRunById(runId);
695
706
  if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
696
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
707
+ await require_utils.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
697
708
  return await (await workflow.createRun({
698
709
  runId,
699
710
  resourceId: run.resourceId
@@ -720,7 +731,7 @@ const RESUME_WORKFLOW_ROUTE = require_route_builder.createRoute({
720
731
  requiresAuth: true,
721
732
  handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
722
733
  try {
723
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
734
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
724
735
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
725
736
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to resume workflow" });
726
737
  const { workflow } = await listWorkflowsFromSystem({
@@ -730,7 +741,7 @@ const RESUME_WORKFLOW_ROUTE = require_route_builder.createRoute({
730
741
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
731
742
  const run = await workflow.getWorkflowRunById(runId);
732
743
  if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
733
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
744
+ await require_utils.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
734
745
  (await workflow.createRun({
735
746
  runId,
736
747
  resourceId: run.resourceId
@@ -764,7 +775,7 @@ const RESTART_ASYNC_WORKFLOW_ROUTE = require_route_builder.createRoute({
764
775
  requiresAuth: true,
765
776
  handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
766
777
  try {
767
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
778
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
768
779
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
769
780
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to restart workflow" });
770
781
  const { workflow } = await listWorkflowsFromSystem({
@@ -774,14 +785,14 @@ const RESTART_ASYNC_WORKFLOW_ROUTE = require_route_builder.createRoute({
774
785
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
775
786
  const run = await workflow.getWorkflowRunById(runId);
776
787
  if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
777
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
778
- return await (await workflow.createRun({
788
+ await require_utils.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
789
+ return await withLoadedSteps(await (await workflow.createRun({
779
790
  runId,
780
791
  resourceId: run.resourceId
781
792
  })).restart({
782
793
  ...params,
783
794
  requestContext
784
- });
795
+ }));
785
796
  } catch (error) {
786
797
  return require_server_handlers_error.handleError(error, "Error restarting workflow");
787
798
  }
@@ -801,7 +812,7 @@ const RESTART_WORKFLOW_ROUTE = require_route_builder.createRoute({
801
812
  requiresAuth: true,
802
813
  handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
803
814
  try {
804
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
815
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
805
816
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
806
817
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to restart workflow" });
807
818
  const { workflow } = await listWorkflowsFromSystem({
@@ -811,7 +822,7 @@ const RESTART_WORKFLOW_ROUTE = require_route_builder.createRoute({
811
822
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
812
823
  const run = await workflow.getWorkflowRunById(runId);
813
824
  if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
814
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
825
+ await require_utils.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
815
826
  (await workflow.createRun({
816
827
  runId,
817
828
  resourceId: run.resourceId
@@ -843,7 +854,7 @@ const RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE = require_route_builder.creat
843
854
  requiresAuth: true,
844
855
  handler: async ({ mastra, workflowId, requestContext }) => {
845
856
  try {
846
- await require_utils$1.validateRunOwnership({ resourceId: null }, require_utils$1.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
857
+ await require_utils.validateRunOwnership({ resourceId: null }, require_utils.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
847
858
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
848
859
  const { workflow } = await listWorkflowsFromSystem({
849
860
  mastra,
@@ -869,7 +880,7 @@ const RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE = require_route_builder.createRoute
869
880
  requiresAuth: true,
870
881
  handler: async ({ mastra, workflowId, requestContext }) => {
871
882
  try {
872
- await require_utils$1.validateRunOwnership({ resourceId: null }, require_utils$1.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
883
+ await require_utils.validateRunOwnership({ resourceId: null }, require_utils.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
873
884
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
874
885
  const { workflow } = await listWorkflowsFromSystem({
875
886
  mastra,
@@ -902,7 +913,7 @@ const TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE = require_route_builder.createRoute({
902
913
  requiresAuth: true,
903
914
  handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
904
915
  try {
905
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
916
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
906
917
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
907
918
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to time travel workflow" });
908
919
  const { workflow } = await listWorkflowsFromSystem({
@@ -912,14 +923,14 @@ const TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE = require_route_builder.createRoute({
912
923
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
913
924
  const run = await workflow.getWorkflowRunById(runId);
914
925
  if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
915
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
916
- return await (await workflow.createRun({
926
+ await require_utils.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
927
+ return await withLoadedSteps(await (await workflow.createRun({
917
928
  runId,
918
929
  resourceId: run.resourceId
919
930
  })).timeTravel({
920
931
  ...params,
921
932
  requestContext
922
- });
933
+ }));
923
934
  } catch (error) {
924
935
  return require_server_handlers_error.handleError(error, "Error time traveling workflow");
925
936
  }
@@ -939,7 +950,7 @@ const TIME_TRAVEL_WORKFLOW_ROUTE = require_route_builder.createRoute({
939
950
  requiresAuth: true,
940
951
  handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
941
952
  try {
942
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
953
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
943
954
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
944
955
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to time travel workflow" });
945
956
  const { workflow } = await listWorkflowsFromSystem({
@@ -949,7 +960,7 @@ const TIME_TRAVEL_WORKFLOW_ROUTE = require_route_builder.createRoute({
949
960
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
950
961
  const run = await workflow.getWorkflowRunById(runId);
951
962
  if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
952
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
963
+ await require_utils.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
953
964
  (await workflow.createRun({
954
965
  runId,
955
966
  resourceId: run.resourceId
@@ -982,7 +993,7 @@ const TIME_TRAVEL_STREAM_WORKFLOW_ROUTE = require_route_builder.createRoute({
982
993
  requiresAuth: true,
983
994
  handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
984
995
  try {
985
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
996
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
986
997
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
987
998
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to time travel workflow stream" });
988
999
  const { workflow } = await listWorkflowsFromSystem({
@@ -992,7 +1003,7 @@ const TIME_TRAVEL_STREAM_WORKFLOW_ROUTE = require_route_builder.createRoute({
992
1003
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
993
1004
  const existingRun = await workflow.getWorkflowRunById(runId);
994
1005
  if (!existingRun) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
995
- await require_utils$1.validateRunOwnership(existingRun, effectiveResourceId, mastra, requestContext);
1006
+ await require_utils.validateRunOwnership(existingRun, effectiveResourceId, mastra, requestContext);
996
1007
  const serverCache = mastra.getServerCache();
997
1008
  const result = (await workflow.createRun({
998
1009
  runId,
@@ -1024,7 +1035,7 @@ const CANCEL_WORKFLOW_RUN_ROUTE = require_route_builder.createRoute({
1024
1035
  requiresAuth: true,
1025
1036
  handler: async ({ mastra, workflowId, runId, requestContext }) => {
1026
1037
  try {
1027
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
1038
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
1028
1039
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
1029
1040
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to cancel workflow run" });
1030
1041
  const { workflow } = await listWorkflowsFromSystem({
@@ -1034,7 +1045,7 @@ const CANCEL_WORKFLOW_RUN_ROUTE = require_route_builder.createRoute({
1034
1045
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
1035
1046
  const run = await workflow.getWorkflowRunById(runId);
1036
1047
  if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
1037
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
1048
+ await require_utils.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
1038
1049
  await (await workflow.createRun({
1039
1050
  runId,
1040
1051
  resourceId: run.resourceId
@@ -1059,7 +1070,7 @@ const STREAM_LEGACY_WORKFLOW_ROUTE = require_route_builder.createRoute({
1059
1070
  requiresAuth: true,
1060
1071
  handler: async ({ mastra, workflowId, runId, resourceId, requestContext, ...params }) => {
1061
1072
  try {
1062
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, resourceId);
1073
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, resourceId);
1063
1074
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
1064
1075
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to resume workflow" });
1065
1076
  const { workflow } = await listWorkflowsFromSystem({
@@ -1070,7 +1081,7 @@ const STREAM_LEGACY_WORKFLOW_ROUTE = require_route_builder.createRoute({
1070
1081
  const serverCache = mastra.getServerCache();
1071
1082
  if (runId) {
1072
1083
  const existingRun = await workflow.getWorkflowRunById(runId, { withNestedWorkflows: false });
1073
- await require_utils$1.validateRunOwnership(existingRun, require_utils$1.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
1084
+ await require_utils.validateRunOwnership(existingRun, require_utils.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
1074
1085
  }
1075
1086
  return (await workflow.createRun({
1076
1087
  runId,
@@ -1103,7 +1114,7 @@ const OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE = require_route_builder.createRoute({
1103
1114
  requiresAuth: true,
1104
1115
  handler: async ({ mastra, workflowId, runId, requestContext }) => {
1105
1116
  try {
1106
- const effectiveResourceId = require_utils$1.getEffectiveResourceId(requestContext, void 0);
1117
+ const effectiveResourceId = require_utils.getEffectiveResourceId(requestContext, void 0);
1107
1118
  if (!workflowId) throw new require_http_exception.HTTPException(400, { message: "Workflow ID is required" });
1108
1119
  if (!runId) throw new require_http_exception.HTTPException(400, { message: "runId required to observe workflow stream" });
1109
1120
  const { workflow } = await listWorkflowsFromSystem({
@@ -1113,7 +1124,7 @@ const OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE = require_route_builder.createRoute({
1113
1124
  if (!workflow) throw new require_http_exception.HTTPException(404, { message: "Workflow not found" });
1114
1125
  const run = await workflow.getWorkflowRunById(runId);
1115
1126
  if (!run) throw new require_http_exception.HTTPException(404, { message: "Workflow run not found" });
1116
- await require_utils$1.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
1127
+ await require_utils.validateRunOwnership(run, effectiveResourceId, mastra, requestContext);
1117
1128
  const _run = await workflow.createRun({
1118
1129
  runId,
1119
1130
  resourceId: run.resourceId
@@ -1183,7 +1194,7 @@ const EXECUTE_WORKFLOW_STEP_ROUTE = require_route_builder.createRoute({
1183
1194
  runId,
1184
1195
  workflowName: workflowId
1185
1196
  });
1186
- await require_utils$1.validateRunOwnership(existingRun, require_utils$1.getEffectiveResourceId(serverRequestContext, void 0), mastra, serverRequestContext);
1197
+ await require_utils.validateRunOwnership(existingRun, require_utils.getEffectiveResourceId(serverRequestContext, void 0), mastra, serverRequestContext);
1187
1198
  return await (await getStepStrategy(mastra)).executeStep({
1188
1199
  workflowId,
1189
1200
  runId,
@@ -1254,7 +1265,7 @@ const RECEIVE_WORKFLOW_EVENT_ROUTE = require_route_builder.createRoute({
1254
1265
  runId: event.runId,
1255
1266
  ...typeof workflowName === "string" ? { workflowName } : {}
1256
1267
  });
1257
- await require_utils$1.validateRunOwnership(existingRun, require_utils$1.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
1268
+ await require_utils.validateRunOwnership(existingRun, require_utils.getEffectiveResourceId(requestContext, void 0), mastra, requestContext);
1258
1269
  const rawCreatedAt = event.createdAt;
1259
1270
  const createdAt = rawCreatedAt instanceof Date ? rawCreatedAt : new Date(rawCreatedAt);
1260
1271
  if (Number.isNaN(createdAt.getTime())) throw new require_http_exception.HTTPException(400, { message: "Invalid createdAt" });
@@ -1442,4 +1453,4 @@ Object.defineProperty(exports, "workflows_exports", {
1442
1453
  }
1443
1454
  });
1444
1455
 
1445
- //# sourceMappingURL=workflows-Cdi6w8JW.cjs.map
1456
+ //# sourceMappingURL=workflows-CJz5Eh0B.cjs.map