@mastra/server 1.81.0 → 1.82.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/dist/{a2a-eUB3oDRN.cjs → a2a-CIq9dtbC.cjs} +3 -3
  2. package/dist/{a2a-eUB3oDRN.cjs.map → a2a-CIq9dtbC.cjs.map} +1 -1
  3. package/dist/{a2a-UYs7rzN2.js → a2a-DULF2hBd.js} +3 -3
  4. package/dist/{a2a-UYs7rzN2.js.map → a2a-DULF2hBd.js.map} +1 -1
  5. package/dist/{agent-builder-GXBcYWdC.cjs → agent-builder-C1SGph1p.cjs} +4 -4
  6. package/dist/{agent-builder-GXBcYWdC.cjs.map → agent-builder-C1SGph1p.cjs.map} +1 -1
  7. package/dist/{agent-builder-TJmawAJj.js → agent-builder-Cq-jo2FP.js} +4 -4
  8. package/dist/{agent-builder-TJmawAJj.js.map → agent-builder-Cq-jo2FP.js.map} +1 -1
  9. package/dist/{agents-BuI0JjjX.js → agents-NRBk4JAs.js} +4 -4
  10. package/dist/{agents-BuI0JjjX.js.map → agents-NRBk4JAs.js.map} +1 -1
  11. package/dist/{agents-BjdRPzyV.cjs → agents-SvkxJW48.cjs} +4 -4
  12. package/dist/{agents-BjdRPzyV.cjs.map → agents-SvkxJW48.cjs.map} +1 -1
  13. package/dist/{api-schema-manifest-Br2vHUvR.js → api-schema-manifest-C8E9EB-q.js} +2 -2
  14. package/dist/{api-schema-manifest-Br2vHUvR.js.map → api-schema-manifest-C8E9EB-q.js.map} +1 -1
  15. package/dist/{api-schema-manifest-Bop13oUv.cjs → api-schema-manifest-CNjDZrQ8.cjs} +2 -2
  16. package/dist/{api-schema-manifest-Bop13oUv.cjs.map → api-schema-manifest-CNjDZrQ8.cjs.map} +1 -1
  17. package/dist/{background-tasks-BkYNmUcf.js → background-tasks-DhQ6upHK.js} +2 -2
  18. package/dist/{background-tasks-BkYNmUcf.js.map → background-tasks-DhQ6upHK.js.map} +1 -1
  19. package/dist/{background-tasks-Civclnuq.cjs → background-tasks-Kcx2YtW0.cjs} +2 -2
  20. package/dist/{background-tasks-Civclnuq.cjs.map → background-tasks-Kcx2YtW0.cjs.map} +1 -1
  21. package/dist/{builder-registry-DHVK50Ba.js → builder-registry-6TFaV4oT.js} +2 -2
  22. package/dist/{builder-registry-DHVK50Ba.js.map → builder-registry-6TFaV4oT.js.map} +1 -1
  23. package/dist/{builder-registry-CamBJItc.cjs → builder-registry-CkPRx_vx.cjs} +2 -2
  24. package/dist/{builder-registry-CamBJItc.cjs.map → builder-registry-CkPRx_vx.cjs.map} +1 -1
  25. package/dist/{channels-EqvuQQbv.cjs → channels-Bfkp5vYI.cjs} +2 -2
  26. package/dist/{channels-EqvuQQbv.cjs.map → channels-Bfkp5vYI.cjs.map} +1 -1
  27. package/dist/{channels-LNR2QIkc.js → channels-hhQ3vD30.js} +2 -2
  28. package/dist/{channels-LNR2QIkc.js.map → channels-hhQ3vD30.js.map} +1 -1
  29. package/dist/{constants-ohUUT3Vg.js → constants-CXAvBYcz.js} +9 -2
  30. package/dist/constants-CXAvBYcz.js.map +1 -0
  31. package/dist/{constants-Co1XjPjd.cjs → constants-DMg8hUOR.cjs} +14 -1
  32. package/dist/constants-DMg8hUOR.cjs.map +1 -0
  33. package/dist/{conversations-fdXV9K0J.js → conversations-CVvZOu1K.js} +3 -3
  34. package/dist/{conversations-fdXV9K0J.js.map → conversations-CVvZOu1K.js.map} +1 -1
  35. package/dist/{conversations-ORTpTqBg.cjs → conversations-Ds6aiCMU.cjs} +3 -3
  36. package/dist/{conversations-ORTpTqBg.cjs.map → conversations-Ds6aiCMU.cjs.map} +1 -1
  37. package/dist/{dist-D-z2svUf.cjs → dist-CPj7ZQaO.cjs} +534 -3525
  38. package/dist/dist-CPj7ZQaO.cjs.map +1 -0
  39. package/dist/{dist-BWRCbA7Z.cjs → dist-Ch5YGldj.cjs} +1 -1
  40. package/dist/{dist-BOXHlYtd.js → dist-DC2mND12.js} +536 -3527
  41. package/dist/dist-DC2mND12.js.map +1 -0
  42. package/dist/dist-DDpKEjMk.js +1 -0
  43. package/dist/docs/SKILL.md +2 -1
  44. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  45. package/dist/docs/references/docs-studio-knowledge.md +81 -0
  46. package/dist/docs/references/reference-observability-tracing-advanced-queries.md +58 -14
  47. package/dist/{editor-builder-DxGZ7IN5.js → editor-builder-BG38irXi.js} +2 -2
  48. package/dist/{editor-builder-DxGZ7IN5.js.map → editor-builder-BG38irXi.js.map} +1 -1
  49. package/dist/{editor-builder-6l27BFzD.cjs → editor-builder-CcSeAW18.cjs} +2 -2
  50. package/dist/{editor-builder-6l27BFzD.cjs.map → editor-builder-CcSeAW18.cjs.map} +1 -1
  51. package/dist/{helpers-CE1fJdLM.cjs → helpers-BKtUXhz2.cjs} +26 -3
  52. package/dist/helpers-BKtUXhz2.cjs.map +1 -0
  53. package/dist/{helpers-CMCXsowL.js → helpers-DNq3LtLq.js} +26 -3
  54. package/dist/helpers-DNq3LtLq.js.map +1 -0
  55. package/dist/knowledge-DykIi0wH.js +431 -0
  56. package/dist/knowledge-DykIi0wH.js.map +1 -0
  57. package/dist/knowledge-qu0om3W7.cjs +474 -0
  58. package/dist/knowledge-qu0om3W7.cjs.map +1 -0
  59. package/dist/{logs-BbaBP2LD.js → logs-B57_NKDn.js} +2 -2
  60. package/dist/{logs-BbaBP2LD.js.map → logs-B57_NKDn.js.map} +1 -1
  61. package/dist/{logs-DI-h9uHR.cjs → logs-BJN3M88A.cjs} +2 -2
  62. package/dist/{logs-DI-h9uHR.cjs.map → logs-BJN3M88A.cjs.map} +1 -1
  63. package/dist/{mcp-CMw0sq0y.cjs → mcp-B9BILfJP.cjs} +2 -2
  64. package/dist/{mcp-CMw0sq0y.cjs.map → mcp-B9BILfJP.cjs.map} +1 -1
  65. package/dist/{mcp-DN9mT9q4.js → mcp-BkmWZD6M.js} +2 -2
  66. package/dist/{mcp-DN9mT9q4.js.map → mcp-BkmWZD6M.js.map} +1 -1
  67. package/dist/{memory-Buhi6kZ-.cjs → memory-Dqod_AK9.cjs} +2 -2
  68. package/dist/{memory-Buhi6kZ-.cjs.map → memory-Dqod_AK9.cjs.map} +1 -1
  69. package/dist/{memory-BTR95ujT.js → memory-ipOCmg0C.js} +2 -2
  70. package/dist/{memory-BTR95ujT.js.map → memory-ipOCmg0C.js.map} +1 -1
  71. package/dist/{observability-pX3wmG8T.js → observability-BS5rmyEH.js} +2 -2
  72. package/dist/{observability-pX3wmG8T.js.map → observability-BS5rmyEH.js.map} +1 -1
  73. package/dist/{observability-DRbDeN1X.cjs → observability-dUv60Mzz.cjs} +2 -2
  74. package/dist/{observability-DRbDeN1X.cjs.map → observability-dUv60Mzz.cjs.map} +1 -1
  75. package/dist/{observability-new-endpoints-CQNVjYYq.js → observability-new-endpoints-BORkWc9f.js} +7 -5
  76. package/dist/observability-new-endpoints-BORkWc9f.js.map +1 -0
  77. package/dist/{observability-new-endpoints-BrB2CKix.cjs → observability-new-endpoints-KJCQZLZr.cjs} +6 -4
  78. package/dist/observability-new-endpoints-KJCQZLZr.cjs.map +1 -0
  79. package/dist/{plans-D9BGMVkL.js → plans-BRf1-Sch.js} +3 -3
  80. package/dist/{plans-D9BGMVkL.js.map → plans-BRf1-Sch.js.map} +1 -1
  81. package/dist/{plans-BHQFsFRU.cjs → plans-Cq23qQ48.cjs} +3 -3
  82. package/dist/{plans-BHQFsFRU.cjs.map → plans-Cq23qQ48.cjs.map} +1 -1
  83. package/dist/{probe-image-size-BFW5qaoE.cjs → probe-image-size-CSrQj2gm.cjs} +2 -2
  84. package/dist/{probe-image-size-BFW5qaoE.cjs.map → probe-image-size-CSrQj2gm.cjs.map} +1 -1
  85. package/dist/{probe-image-size-BrhIVT5B.js → probe-image-size-ssYltjkF.js} +2 -2
  86. package/dist/{probe-image-size-BrhIVT5B.js.map → probe-image-size-ssYltjkF.js.map} +1 -1
  87. package/dist/{responses-Cb-9JV9A.js → responses-CGy87E_N.js} +3 -3
  88. package/dist/{responses-Cb-9JV9A.js.map → responses-CGy87E_N.js.map} +1 -1
  89. package/dist/{responses-4_RCBNJB.cjs → responses-CPTdr5VE.cjs} +3 -3
  90. package/dist/{responses-4_RCBNJB.cjs.map → responses-CPTdr5VE.cjs.map} +1 -1
  91. package/dist/{routes-B1plJpJS.cjs → routes-DSBYmGyo.cjs} +79 -22
  92. package/dist/routes-DSBYmGyo.cjs.map +1 -0
  93. package/dist/{routes-BZ1CkJV4.js → routes-X0Gh3f3T.js} +62 -23
  94. package/dist/routes-X0Gh3f3T.js.map +1 -0
  95. package/dist/{schedules-CQPodXrR.js → schedules-CGViSLZC.js} +2 -2
  96. package/dist/{schedules-CQPodXrR.js.map → schedules-CGViSLZC.js.map} +1 -1
  97. package/dist/{schedules-CL4IU7kS.cjs → schedules-D8ShgpY3.cjs} +2 -2
  98. package/dist/{schedules-CL4IU7kS.cjs.map → schedules-D8ShgpY3.cjs.map} +1 -1
  99. package/dist/{scores-DnEcBe2i.cjs → scores-BZ0Iz_0O.cjs} +2 -2
  100. package/dist/{scores-DnEcBe2i.cjs.map → scores-BZ0Iz_0O.cjs.map} +1 -1
  101. package/dist/{scores-DqImg-o-.js → scores-DqSDYRs0.js} +2 -2
  102. package/dist/{scores-DqImg-o-.js.map → scores-DqSDYRs0.js.map} +1 -1
  103. package/dist/server/auth/helpers.d.ts.map +1 -1
  104. package/dist/server/auth/index.cjs +2 -2
  105. package/dist/server/auth/index.js +2 -2
  106. package/dist/server/constants.d.ts +7 -1
  107. package/dist/server/constants.d.ts.map +1 -1
  108. package/dist/server/fga-permissions.d.ts.map +1 -1
  109. package/dist/server/handlers/a2a.cjs +1 -1
  110. package/dist/server/handlers/a2a.js +1 -1
  111. package/dist/server/handlers/agent-builder.cjs +1 -1
  112. package/dist/server/handlers/agent-builder.js +1 -1
  113. package/dist/server/handlers/agent-controller.cjs +2 -2
  114. package/dist/server/handlers/agent-controller.js +2 -2
  115. package/dist/server/handlers/agent-versions.cjs +1 -1
  116. package/dist/server/handlers/agent-versions.js +1 -1
  117. package/dist/server/handlers/agents.cjs +1 -1
  118. package/dist/server/handlers/agents.js +1 -1
  119. package/dist/server/handlers/auth.cjs +2 -2
  120. package/dist/server/handlers/auth.js +2 -2
  121. package/dist/server/handlers/authorship.cjs +1 -1
  122. package/dist/server/handlers/authorship.js +1 -1
  123. package/dist/server/handlers/background-tasks.cjs +1 -1
  124. package/dist/server/handlers/background-tasks.js +1 -1
  125. package/dist/server/handlers/builder-registry.cjs +1 -1
  126. package/dist/server/handlers/builder-registry.js +1 -1
  127. package/dist/server/handlers/channels.cjs +1 -1
  128. package/dist/server/handlers/channels.js +1 -1
  129. package/dist/server/handlers/conversations.cjs +1 -1
  130. package/dist/server/handlers/conversations.js +1 -1
  131. package/dist/server/handlers/datasets.cjs +1 -1
  132. package/dist/server/handlers/datasets.js +1 -1
  133. package/dist/server/handlers/editor-builder.cjs +1 -1
  134. package/dist/server/handlers/editor-builder.js +1 -1
  135. package/dist/server/handlers/favorites-enrichment.cjs +1 -1
  136. package/dist/server/handlers/favorites-enrichment.js +1 -1
  137. package/dist/server/handlers/knowledge.cjs +10 -0
  138. package/dist/server/handlers/knowledge.d.ts +237 -0
  139. package/dist/server/handlers/knowledge.d.ts.map +1 -0
  140. package/dist/server/handlers/knowledge.js +1 -0
  141. package/dist/server/handlers/logs.cjs +1 -1
  142. package/dist/server/handlers/logs.js +1 -1
  143. package/dist/server/handlers/mcp-client-versions.cjs +1 -1
  144. package/dist/server/handlers/mcp-client-versions.js +1 -1
  145. package/dist/server/handlers/mcp.cjs +1 -1
  146. package/dist/server/handlers/mcp.js +1 -1
  147. package/dist/server/handlers/memory.cjs +1 -1
  148. package/dist/server/handlers/memory.js +1 -1
  149. package/dist/server/handlers/observability-new-endpoints.cjs +1 -1
  150. package/dist/server/handlers/observability-new-endpoints.d.ts +77 -6
  151. package/dist/server/handlers/observability-new-endpoints.d.ts.map +1 -1
  152. package/dist/server/handlers/observability-new-endpoints.js +1 -1
  153. package/dist/server/handlers/observability-shared.cjs +22 -0
  154. package/dist/server/handlers/observability-shared.cjs.map +1 -1
  155. package/dist/server/handlers/observability-shared.d.ts +13 -0
  156. package/dist/server/handlers/observability-shared.d.ts.map +1 -1
  157. package/dist/server/handlers/observability-shared.js +20 -1
  158. package/dist/server/handlers/observability-shared.js.map +1 -1
  159. package/dist/server/handlers/observability.cjs +2 -2
  160. package/dist/server/handlers/observability.js +2 -2
  161. package/dist/server/handlers/plans.cjs +1 -1
  162. package/dist/server/handlers/plans.js +1 -1
  163. package/dist/server/handlers/prompt-block-versions.cjs +1 -1
  164. package/dist/server/handlers/prompt-block-versions.js +1 -1
  165. package/dist/server/handlers/responses.cjs +1 -1
  166. package/dist/server/handlers/responses.js +1 -1
  167. package/dist/server/handlers/responses.storage.cjs +1 -1
  168. package/dist/server/handlers/responses.storage.js +1 -1
  169. package/dist/server/handlers/schedules.cjs +1 -1
  170. package/dist/server/handlers/schedules.js +1 -1
  171. package/dist/server/handlers/scorer-versions.cjs +1 -1
  172. package/dist/server/handlers/scorer-versions.js +1 -1
  173. package/dist/server/handlers/scores.cjs +1 -1
  174. package/dist/server/handlers/scores.js +1 -1
  175. package/dist/server/handlers/stored-agent-favorites.cjs +2 -2
  176. package/dist/server/handlers/stored-agent-favorites.js +2 -2
  177. package/dist/server/handlers/stored-agents.cjs +2 -2
  178. package/dist/server/handlers/stored-agents.js +2 -2
  179. package/dist/server/handlers/stored-mcp-clients.cjs +1 -1
  180. package/dist/server/handlers/stored-mcp-clients.js +1 -1
  181. package/dist/server/handlers/stored-prompt-blocks.cjs +1 -1
  182. package/dist/server/handlers/stored-prompt-blocks.js +1 -1
  183. package/dist/server/handlers/stored-scorers.cjs +1 -1
  184. package/dist/server/handlers/stored-scorers.js +1 -1
  185. package/dist/server/handlers/stored-skill-favorites.cjs +2 -2
  186. package/dist/server/handlers/stored-skill-favorites.js +2 -2
  187. package/dist/server/handlers/stored-skills.cjs +2 -2
  188. package/dist/server/handlers/stored-skills.js +2 -2
  189. package/dist/server/handlers/stored-workspaces.cjs +1 -1
  190. package/dist/server/handlers/stored-workspaces.js +1 -1
  191. package/dist/server/handlers/system.cjs +2 -2
  192. package/dist/server/handlers/system.d.ts +2 -0
  193. package/dist/server/handlers/system.d.ts.map +1 -1
  194. package/dist/server/handlers/system.js +2 -2
  195. package/dist/server/handlers/tool-providers.cjs +1 -1
  196. package/dist/server/handlers/tool-providers.js +1 -1
  197. package/dist/server/handlers/tools.cjs +1 -1
  198. package/dist/server/handlers/tools.js +1 -1
  199. package/dist/server/handlers/utils.cjs +1 -1
  200. package/dist/server/handlers/utils.js +1 -1
  201. package/dist/server/handlers/validate-agent-instructions.cjs +1 -1
  202. package/dist/server/handlers/validate-agent-instructions.js +1 -1
  203. package/dist/server/handlers/workflow-builder.cjs +1 -1
  204. package/dist/server/handlers/workflow-builder.js +1 -1
  205. package/dist/server/handlers/workflows.cjs +1 -1
  206. package/dist/server/handlers/workflows.js +1 -1
  207. package/dist/server/handlers/workspace.d.ts +23 -23
  208. package/dist/server/handlers.cjs +13 -13
  209. package/dist/server/handlers.js +13 -13
  210. package/dist/server/schemas/index.cjs +1 -1
  211. package/dist/server/schemas/index.js +1 -1
  212. package/dist/server/schemas/knowledge.d.ts +58 -0
  213. package/dist/server/schemas/knowledge.d.ts.map +1 -0
  214. package/dist/server/schemas/system.d.ts +2 -0
  215. package/dist/server/schemas/system.d.ts.map +1 -1
  216. package/dist/server/server-adapter/index.cjs +21 -6
  217. package/dist/server/server-adapter/index.cjs.map +1 -1
  218. package/dist/server/server-adapter/index.d.ts +1 -1
  219. package/dist/server/server-adapter/index.d.ts.map +1 -1
  220. package/dist/server/server-adapter/index.js +18 -7
  221. package/dist/server/server-adapter/index.js.map +1 -1
  222. package/dist/server/server-adapter/routes/fga-manifest.d.ts.map +1 -1
  223. package/dist/server/server-adapter/routes/index.d.ts +29 -0
  224. package/dist/server/server-adapter/routes/index.d.ts.map +1 -1
  225. package/dist/server/server-adapter/routes/knowledge.d.ts +231 -0
  226. package/dist/server/server-adapter/routes/knowledge.d.ts.map +1 -0
  227. package/dist/server/server-adapter/routes/observability.d.ts +75 -6
  228. package/dist/server/server-adapter/routes/observability.d.ts.map +1 -1
  229. package/dist/server/server-adapter/routes/system.d.ts +2 -0
  230. package/dist/server/server-adapter/routes/system.d.ts.map +1 -1
  231. package/dist/{system-DOwo7OGf.js → system-B0_hRqFE.js} +2 -1
  232. package/dist/system-B0_hRqFE.js.map +1 -0
  233. package/dist/{system-CHCn8IQ3.cjs → system-iruN6xnj.cjs} +2 -1
  234. package/dist/system-iruN6xnj.cjs.map +1 -0
  235. package/dist/{tools-BFpuzQsz.js → tools-CtELrYsA.js} +4 -4
  236. package/dist/{tools-BFpuzQsz.js.map → tools-CtELrYsA.js.map} +1 -1
  237. package/dist/{tools-Dy_j6URC.cjs → tools-DtRHH9Hr.cjs} +4 -4
  238. package/dist/{tools-Dy_j6URC.cjs.map → tools-DtRHH9Hr.cjs.map} +1 -1
  239. package/dist/{utils-BbYUI6Yn.cjs → utils-9PRHHTGC.cjs} +7 -3
  240. package/dist/utils-9PRHHTGC.cjs.map +1 -0
  241. package/dist/{utils-DHxjw4Tn.js → utils-B15w-1hm.js} +7 -3
  242. package/dist/utils-B15w-1hm.js.map +1 -0
  243. package/dist/{utils-BnH77wPf.cjs → utils-bQ6Jhog6.cjs} +2 -2
  244. package/dist/{utils-BnH77wPf.cjs.map → utils-bQ6Jhog6.cjs.map} +1 -1
  245. package/dist/{utils-YEuwVEc2.js → utils-qaBKOShQ.js} +2 -2
  246. package/dist/{utils-YEuwVEc2.js.map → utils-qaBKOShQ.js.map} +1 -1
  247. package/dist/{workflow-builder--W9PMW13.js → workflow-builder-6I2HiKcF.js} +2 -2
  248. package/dist/{workflow-builder--W9PMW13.js.map → workflow-builder-6I2HiKcF.js.map} +1 -1
  249. package/dist/{workflow-builder-CT7JOoW6.cjs → workflow-builder-CQzvZvwC.cjs} +2 -2
  250. package/dist/{workflow-builder-CT7JOoW6.cjs.map → workflow-builder-CQzvZvwC.cjs.map} +1 -1
  251. package/dist/{workflows-DPIRVRN9.js → workflows-ClfVyB1p.js} +3 -3
  252. package/dist/{workflows-DPIRVRN9.js.map → workflows-ClfVyB1p.js.map} +1 -1
  253. package/dist/{workflows-BAOfWBkr.cjs → workflows-DgSo-eBG.cjs} +3 -3
  254. package/dist/{workflows-BAOfWBkr.cjs.map → workflows-DgSo-eBG.cjs.map} +1 -1
  255. package/package.json +4 -4
  256. package/dist/constants-Co1XjPjd.cjs.map +0 -1
  257. package/dist/constants-ohUUT3Vg.js.map +0 -1
  258. package/dist/dist-BOXHlYtd.js.map +0 -1
  259. package/dist/dist-D-z2svUf.cjs.map +0 -1
  260. package/dist/dist-Z-lfSvwy.js +0 -1
  261. package/dist/helpers-CE1fJdLM.cjs.map +0 -1
  262. package/dist/helpers-CMCXsowL.js.map +0 -1
  263. package/dist/observability-new-endpoints-BrB2CKix.cjs.map +0 -1
  264. package/dist/observability-new-endpoints-CQNVjYYq.js.map +0 -1
  265. package/dist/routes-B1plJpJS.cjs.map +0 -1
  266. package/dist/routes-BZ1CkJV4.js.map +0 -1
  267. package/dist/system-CHCn8IQ3.cjs.map +0 -1
  268. package/dist/system-DOwo7OGf.js.map +0 -1
  269. package/dist/utils-BbYUI6Yn.cjs.map +0 -1
  270. package/dist/utils-DHxjw4Tn.js.map +0 -1
@@ -5,9 +5,9 @@ const require_workflows = require("./workflows-CKcjXfXk.cjs");
5
5
  const require_agent_builder = require("./agent-builder-DSKjD22s.cjs");
6
6
  const require_agents = require("./agents-Cel1sffU.cjs");
7
7
  const require_route_builder = require("./route-builder-CvARmqnA.cjs");
8
- const require_utils = require("./utils-BnH77wPf.cjs");
8
+ const require_utils = require("./utils-bQ6Jhog6.cjs");
9
9
  const require_server_handlers_error = require("./server/handlers/error.cjs");
10
- const require_workflows$1 = require("./workflows-BAOfWBkr.cjs");
10
+ const require_workflows$1 = require("./workflows-DgSo-eBG.cjs");
11
11
  // src/server/handlers/agent-builder.ts
12
12
  var agent_builder_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
13
13
  CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE: () => CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE,
@@ -29,7 +29,7 @@ var agent_builder_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll
29
29
  });
30
30
  let agentBuilderWorkflowsPromise;
31
31
  async function loadAgentBuilderWorkflows() {
32
- agentBuilderWorkflowsPromise ??= Promise.resolve().then(() => require("./dist-D-z2svUf.cjs")).then((mod) => mod.agentBuilderWorkflows);
32
+ agentBuilderWorkflowsPromise ??= Promise.resolve().then(() => require("./dist-CPj7ZQaO.cjs")).then((mod) => mod.agentBuilderWorkflows);
33
33
  return agentBuilderWorkflowsPromise;
34
34
  }
35
35
  async function registerAgentBuilderWorkflows(mastra) {
@@ -724,4 +724,4 @@ Object.defineProperty(exports, "agent_builder_exports", {
724
724
  }
725
725
  });
726
726
 
727
- //# sourceMappingURL=agent-builder-GXBcYWdC.cjs.map
727
+ //# sourceMappingURL=agent-builder-C1SGph1p.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-builder-GXBcYWdC.cjs","names":["createRoute","listWorkflowsResponseSchema","handleError","actionIdPathParams","workflowInfoSchema","WorkflowRegistry","HTTPException","listWorkflowRunsQuerySchema","workflowRunsResponseSchema","actionRunPathParams","workflowRunResultQuerySchema","workflowRunResultSchema","optionalRunIdSchema","createWorkflowRunResponseSchema","runIdSchema","streamAgentBuilderBodySchema","streamResponseSchema","startAsyncAgentBuilderBodySchema","workflowExecutionResultSchema","workflowControlResponseSchema","resumeAgentBuilderBodySchema","streamLegacyAgentBuilderBodySchema"],"sources":["../src/server/handlers/agent-builder.ts"],"sourcesContent":["import type { agentBuilderWorkflows as agentBuilderWorkflowsType } from '@mastra/agent-builder';\nimport { HTTPException } from '../http-exception';\nimport {\n actionIdPathParams,\n actionRunPathParams,\n createWorkflowRunResponseSchema,\n listWorkflowRunsQuerySchema,\n resumeAgentBuilderBodySchema,\n streamAgentBuilderBodySchema,\n startAsyncAgentBuilderBodySchema,\n workflowExecutionResultSchema,\n workflowControlResponseSchema,\n workflowRunsResponseSchema,\n workflowInfoSchema,\n listWorkflowsResponseSchema,\n streamLegacyAgentBuilderBodySchema,\n workflowRunResultSchema,\n workflowRunResultQuerySchema,\n} from '../schemas/agent-builder';\nimport { streamResponseSchema } from '../schemas/agents';\nimport { optionalRunIdSchema, runIdSchema } from '../schemas/common';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { WorkflowRegistry } from '../utils';\nimport { handleError } from './error';\nimport * as workflows from './workflows';\n\ntype AgentBuilderWorkflows = typeof agentBuilderWorkflowsType;\n\nlet agentBuilderWorkflowsPromise: Promise<AgentBuilderWorkflows> | undefined;\n\nasync function loadAgentBuilderWorkflows(): Promise<AgentBuilderWorkflows> {\n agentBuilderWorkflowsPromise ??= import('@mastra/agent-builder').then(mod => mod.agentBuilderWorkflows);\n return agentBuilderWorkflowsPromise;\n}\n\nasync function registerAgentBuilderWorkflows(\n mastra: Parameters<typeof WorkflowRegistry.registerTemporaryWorkflows>[1],\n) {\n const agentBuilderWorkflows = await loadAgentBuilderWorkflows();\n WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);\n return agentBuilderWorkflows;\n}\n\n// ============================================================================\n// Route Definitions (handlers call workflow route handlers with transformed parameters)\n// ============================================================================\n\nexport const LIST_AGENT_BUILDER_ACTIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder',\n responseType: 'json',\n responseSchema: listWorkflowsResponseSchema,\n summary: 'List agent-builder actions',\n description: 'Returns a list of all available agent-builder actions',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n logger.info('Listing agent builder actions');\n\n // Call workflow list handler\n return await workflows.LIST_WORKFLOWS_ROUTE.handler(ctx);\n } catch (error) {\n logger.error('Error listing agent builder actions', { error });\n return handleError(error, 'Error getting agent builder workflows');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder/:actionId',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n responseSchema: workflowInfoSchema,\n summary: 'Get action by ID',\n description: 'Returns details for a specific agent-builder action',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId } = ctx;\n const logger = mastra.getLogger();\n try {\n const agentBuilderWorkflows = await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, {\n message: `Invalid agent-builder action: ${actionId}. Valid actions are: ${Object.keys(agentBuilderWorkflows).join(', ')}`,\n });\n }\n\n logger.info('Getting agent builder action by ID', { actionId });\n\n return await workflows.GET_WORKFLOW_BY_ID_ROUTE.handler({ ...ctx, workflowId: actionId });\n } catch (error) {\n logger.error('Error getting agent builder action by ID', { error, actionId });\n return handleError(error, 'Error getting agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder/:actionId/runs',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: listWorkflowRunsQuerySchema,\n responseSchema: workflowRunsResponseSchema,\n summary: 'List action runs',\n description: 'Returns a paginated list of execution runs for the specified action',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Listing agent builder action runs', { actionId });\n\n return await workflows.LIST_WORKFLOW_RUNS_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error listing agent builder action runs', { error, actionId });\n return handleError(error, 'Error getting agent builder action runs');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder/:actionId/runs/:runId',\n responseType: 'json',\n pathParamSchema: actionRunPathParams,\n queryParamSchema: workflowRunResultQuerySchema,\n responseSchema: workflowRunResultSchema,\n summary: 'Get action run by ID',\n description:\n 'Returns details for a specific action run with metadata and processed execution state. Use the fields query parameter to reduce payload size.',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Getting agent builder action run by ID', { actionId, runId });\n\n return await workflows.GET_WORKFLOW_RUN_BY_ID_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error getting agent builder action run', { error, actionId, runId });\n return handleError(error, 'Error getting agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/create-run',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: optionalRunIdSchema,\n responseSchema: createWorkflowRunResponseSchema,\n summary: 'Create action run',\n description: 'Creates a new action execution instance with an optional custom run ID',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Creating agent builder action run', { actionId, runId });\n\n return await workflows.CREATE_WORKFLOW_RUN_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error creating agent builder action run', { error, actionId });\n return handleError(error, 'Error creating agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const STREAM_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/stream',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: streamAgentBuilderBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Stream action execution',\n description: 'Executes an action and streams the results in real-time',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Streaming agent builder action', { actionId, runId });\n\n return await workflows.STREAM_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error streaming agent builder action', { error, actionId });\n return handleError(error, 'Error streaming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const START_ASYNC_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/start-async',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: optionalRunIdSchema,\n bodySchema: startAsyncAgentBuilderBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Start action asynchronously',\n description: 'Starts an action execution asynchronously without streaming results',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Starting agent builder action asynchronously', { actionId, runId });\n\n return await workflows.START_ASYNC_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error starting agent builder action asynchronously', { error, actionId });\n return handleError(error, 'Error starting agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const START_AGENT_BUILDER_ACTION_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/start',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: startAsyncAgentBuilderBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Start specific action run',\n description: 'Starts execution of a specific action run by ID',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Starting specific agent builder action run', { actionId, runId });\n\n return await workflows.START_WORKFLOW_RUN_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error starting agent builder action run', { error, actionId });\n return handleError(error, 'Error starting agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/observe',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n responseSchema: streamResponseSchema,\n summary: 'Observe action stream',\n description: 'Observes and streams updates from an already running action execution',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Observing agent builder action stream', { actionId, runId });\n\n return await workflows.OBSERVE_STREAM_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error observing agent builder action stream', { error, actionId });\n return handleError(error, 'Error observing agent builder action stream');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume-async',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Resume action asynchronously',\n description: 'Resumes a suspended action execution asynchronously without streaming',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action asynchronously', { actionId, runId, step });\n\n return await workflows.RESUME_ASYNC_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action asynchronously', { error, actionId });\n return handleError(error, 'Error resuming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\n/**\n * Fire-and-forget resume for agent-builder actions: returns immediately with the runId without\n * waiting for completion. Delegates to the workflows `resume-no-wait` route.\n *\n * TODO(v2): fold this behavior into the `resume-async` route in Mastra v2 and remove this route.\n * Kept separate in v1 to avoid breaking the existing `resume-async` response contract.\n */\nexport const RESUME_NO_WAIT_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume-no-wait',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: createWorkflowRunResponseSchema,\n summary: 'Resume action without waiting',\n description:\n 'Resumes a suspended action execution without waiting (fire-and-forget) and returns immediately with the runId. The action continues executing in the background.',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action without waiting', { actionId, runId, step });\n\n return await workflows.RESUME_NO_WAIT_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action without waiting', { error, actionId });\n return handleError(error, 'Error resuming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const RESUME_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Resume action',\n description: 'Resumes a suspended action execution from a specific step',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action', { actionId, runId, step });\n\n return await workflows.RESUME_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action', { error, actionId });\n return handleError(error, 'Error resuming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume-stream',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Resume action stream',\n description: 'Resumes a suspended action execution and continues streaming results',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action stream', { actionId, runId, step });\n\n return await workflows.RESUME_STREAM_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action stream', { error, actionId });\n return handleError(error, 'Error resuming agent builder action stream');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/runs/:runId/cancel',\n responseType: 'json',\n pathParamSchema: actionRunPathParams,\n responseSchema: workflowControlResponseSchema,\n summary: 'Cancel action run',\n description: 'Cancels an in-progress action execution',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Cancelling agent builder action run', { actionId, runId });\n\n return await workflows.CANCEL_WORKFLOW_RUN_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error cancelling agent builder action run', { error, actionId });\n return handleError(error, 'Error cancelling agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\n// Legacy routes (deprecated)\nexport const STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/stream-legacy',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: streamLegacyAgentBuilderBodySchema,\n responseSchema: streamResponseSchema,\n summary: '[DEPRECATED] Stream agent-builder action with legacy format',\n description:\n 'Legacy endpoint for streaming agent-builder action execution. Use /agent-builder/:actionId/stream instead.',\n tags: ['Agent Builder', 'Legacy'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Streaming agent builder action (legacy)', { actionId, runId });\n\n return await workflows.STREAM_LEGACY_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error streaming agent builder action (legacy)', { error, actionId });\n return handleError(error, 'Error streaming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/observe-stream-legacy',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n responseSchema: streamResponseSchema,\n summary: '[DEPRECATED] Observe agent-builder action stream with legacy format',\n description:\n 'Legacy endpoint for observing agent-builder action stream. Use /agent-builder/:actionId/observe instead.',\n tags: ['Agent Builder', 'Legacy'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Observing agent builder action stream (legacy)', { actionId, runId });\n\n return await workflows.OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error observing agent builder action stream (legacy)', { error, actionId });\n return handleError(error, 'Error observing agent builder action stream');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,IAAI;AAEJ,eAAe,4BAA4D;CACzE,iCAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAiC,qBAAA,CAAA,CAAA,CAAgC,MAAK,QAAO,IAAI,qBAAqB;CACtG,OAAO;AACT;AAEA,eAAe,8BACb,QACA;CACA,MAAM,wBAAwB,MAAM,0BAA0B;CAC9D,cAAA,iBAAiB,2BAA2B,uBAAuB,MAAM;CACzE,OAAO;AACT;AAMA,MAAa,mCAAmCA,sBAAAA,YAAY;CAC1D,QAAQ;CACR,MAAM;CACN,cAAc;CACd,gBAAgBC,kBAAAA;CAChB,SAAS;CACT,aAAa;CACb,MAAM,CAAC,eAAe;CACtB,cAAc;CACd,SAAS,OAAM,QAAO;EACpB,MAAM,EAAE,WAAW;EACnB,MAAM,S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,MAAM,iDAAiD;IAAE;IAAO;GAAS,CAAC;GACjF,OAAOJ,8BAAAA,YAAY,OAAO,sCAAsC;EAClE,UAAU;GACR,cAAA,iBAAiB,QAAQ;EAC3B;CACF;AACF,CAAC;AAED,MAAa,mDAAmDF,sBAAAA,YAAY;CAC1E,QAAQ;CACR,MAAM;CACN,cAAc;CACd,iBAAiBG,sBAAAA;CACjB,kBAAkBW,eAAAA;CAClB,gBAAgBE,eAAAA;CAChB,SAAS;CACT,aACE;CACF,MAAM,CAAC,iBAAiB,QAAQ;CAChC,cAAc;CACd,SAAS,OAAM,QAAO;EACpB,MAAM,EAAE,QAAQ,UAAU,UAAU;EACpC,MAAM,SAAS,OAAO,UAAU;EAChC,IAAI;GACF,MAAM,8BAA8B,MAAM;GAE1C,IAAI,YAAY,CAACX,cAAAA,iBAAiB,uBAAuB,QAAQ,GAC/D,MAAM,IAAIC,uBAAAA,cAAc,KAAK,EAAE,SAAS,iCAAiC,WAAW,CAAC;GAGvF,OAAO,KAAK,kDAAkD;IAAE;IAAU;GAAM,CAAC;GAEjF,OAAO,MAAA,oBAAA,qCAAqD,QAAQ;IAClE,GAAG;IACH,YAAY;GACd,CAAC;EACH,SAAS,OAAO;GACd,OAAO,MAAM,wDAAwD;IAAE;IAAO;GAAS,CAAC;GACxF,OAAOJ,8BAAAA,YAAY,OAAO,6CAA6C;EACzE,UAAU;GACR,cAAA,iBAAiB,QAAQ;EAC3B;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"agent-builder-C1SGph1p.cjs","names":["createRoute","listWorkflowsResponseSchema","handleError","actionIdPathParams","workflowInfoSchema","WorkflowRegistry","HTTPException","listWorkflowRunsQuerySchema","workflowRunsResponseSchema","actionRunPathParams","workflowRunResultQuerySchema","workflowRunResultSchema","optionalRunIdSchema","createWorkflowRunResponseSchema","runIdSchema","streamAgentBuilderBodySchema","streamResponseSchema","startAsyncAgentBuilderBodySchema","workflowExecutionResultSchema","workflowControlResponseSchema","resumeAgentBuilderBodySchema","streamLegacyAgentBuilderBodySchema"],"sources":["../src/server/handlers/agent-builder.ts"],"sourcesContent":["import type { agentBuilderWorkflows as agentBuilderWorkflowsType } from '@mastra/agent-builder';\nimport { HTTPException } from '../http-exception';\nimport {\n actionIdPathParams,\n actionRunPathParams,\n createWorkflowRunResponseSchema,\n listWorkflowRunsQuerySchema,\n resumeAgentBuilderBodySchema,\n streamAgentBuilderBodySchema,\n startAsyncAgentBuilderBodySchema,\n workflowExecutionResultSchema,\n workflowControlResponseSchema,\n workflowRunsResponseSchema,\n workflowInfoSchema,\n listWorkflowsResponseSchema,\n streamLegacyAgentBuilderBodySchema,\n workflowRunResultSchema,\n workflowRunResultQuerySchema,\n} from '../schemas/agent-builder';\nimport { streamResponseSchema } from '../schemas/agents';\nimport { optionalRunIdSchema, runIdSchema } from '../schemas/common';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { WorkflowRegistry } from '../utils';\nimport { handleError } from './error';\nimport * as workflows from './workflows';\n\ntype AgentBuilderWorkflows = typeof agentBuilderWorkflowsType;\n\nlet agentBuilderWorkflowsPromise: Promise<AgentBuilderWorkflows> | undefined;\n\nasync function loadAgentBuilderWorkflows(): Promise<AgentBuilderWorkflows> {\n agentBuilderWorkflowsPromise ??= import('@mastra/agent-builder').then(mod => mod.agentBuilderWorkflows);\n return agentBuilderWorkflowsPromise;\n}\n\nasync function registerAgentBuilderWorkflows(\n mastra: Parameters<typeof WorkflowRegistry.registerTemporaryWorkflows>[1],\n) {\n const agentBuilderWorkflows = await loadAgentBuilderWorkflows();\n WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);\n return agentBuilderWorkflows;\n}\n\n// ============================================================================\n// Route Definitions (handlers call workflow route handlers with transformed parameters)\n// ============================================================================\n\nexport const LIST_AGENT_BUILDER_ACTIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder',\n responseType: 'json',\n responseSchema: listWorkflowsResponseSchema,\n summary: 'List agent-builder actions',\n description: 'Returns a list of all available agent-builder actions',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n logger.info('Listing agent builder actions');\n\n // Call workflow list handler\n return await workflows.LIST_WORKFLOWS_ROUTE.handler(ctx);\n } catch (error) {\n logger.error('Error listing agent builder actions', { error });\n return handleError(error, 'Error getting agent builder workflows');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder/:actionId',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n responseSchema: workflowInfoSchema,\n summary: 'Get action by ID',\n description: 'Returns details for a specific agent-builder action',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId } = ctx;\n const logger = mastra.getLogger();\n try {\n const agentBuilderWorkflows = await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, {\n message: `Invalid agent-builder action: ${actionId}. Valid actions are: ${Object.keys(agentBuilderWorkflows).join(', ')}`,\n });\n }\n\n logger.info('Getting agent builder action by ID', { actionId });\n\n return await workflows.GET_WORKFLOW_BY_ID_ROUTE.handler({ ...ctx, workflowId: actionId });\n } catch (error) {\n logger.error('Error getting agent builder action by ID', { error, actionId });\n return handleError(error, 'Error getting agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder/:actionId/runs',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: listWorkflowRunsQuerySchema,\n responseSchema: workflowRunsResponseSchema,\n summary: 'List action runs',\n description: 'Returns a paginated list of execution runs for the specified action',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Listing agent builder action runs', { actionId });\n\n return await workflows.LIST_WORKFLOW_RUNS_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error listing agent builder action runs', { error, actionId });\n return handleError(error, 'Error getting agent builder action runs');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder/:actionId/runs/:runId',\n responseType: 'json',\n pathParamSchema: actionRunPathParams,\n queryParamSchema: workflowRunResultQuerySchema,\n responseSchema: workflowRunResultSchema,\n summary: 'Get action run by ID',\n description:\n 'Returns details for a specific action run with metadata and processed execution state. Use the fields query parameter to reduce payload size.',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Getting agent builder action run by ID', { actionId, runId });\n\n return await workflows.GET_WORKFLOW_RUN_BY_ID_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error getting agent builder action run', { error, actionId, runId });\n return handleError(error, 'Error getting agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/create-run',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: optionalRunIdSchema,\n responseSchema: createWorkflowRunResponseSchema,\n summary: 'Create action run',\n description: 'Creates a new action execution instance with an optional custom run ID',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Creating agent builder action run', { actionId, runId });\n\n return await workflows.CREATE_WORKFLOW_RUN_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error creating agent builder action run', { error, actionId });\n return handleError(error, 'Error creating agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const STREAM_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/stream',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: streamAgentBuilderBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Stream action execution',\n description: 'Executes an action and streams the results in real-time',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Streaming agent builder action', { actionId, runId });\n\n return await workflows.STREAM_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error streaming agent builder action', { error, actionId });\n return handleError(error, 'Error streaming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const START_ASYNC_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/start-async',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: optionalRunIdSchema,\n bodySchema: startAsyncAgentBuilderBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Start action asynchronously',\n description: 'Starts an action execution asynchronously without streaming results',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Starting agent builder action asynchronously', { actionId, runId });\n\n return await workflows.START_ASYNC_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error starting agent builder action asynchronously', { error, actionId });\n return handleError(error, 'Error starting agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const START_AGENT_BUILDER_ACTION_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/start',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: startAsyncAgentBuilderBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Start specific action run',\n description: 'Starts execution of a specific action run by ID',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Starting specific agent builder action run', { actionId, runId });\n\n return await workflows.START_WORKFLOW_RUN_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error starting agent builder action run', { error, actionId });\n return handleError(error, 'Error starting agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/observe',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n responseSchema: streamResponseSchema,\n summary: 'Observe action stream',\n description: 'Observes and streams updates from an already running action execution',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Observing agent builder action stream', { actionId, runId });\n\n return await workflows.OBSERVE_STREAM_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error observing agent builder action stream', { error, actionId });\n return handleError(error, 'Error observing agent builder action stream');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume-async',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Resume action asynchronously',\n description: 'Resumes a suspended action execution asynchronously without streaming',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action asynchronously', { actionId, runId, step });\n\n return await workflows.RESUME_ASYNC_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action asynchronously', { error, actionId });\n return handleError(error, 'Error resuming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\n/**\n * Fire-and-forget resume for agent-builder actions: returns immediately with the runId without\n * waiting for completion. Delegates to the workflows `resume-no-wait` route.\n *\n * TODO(v2): fold this behavior into the `resume-async` route in Mastra v2 and remove this route.\n * Kept separate in v1 to avoid breaking the existing `resume-async` response contract.\n */\nexport const RESUME_NO_WAIT_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume-no-wait',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: createWorkflowRunResponseSchema,\n summary: 'Resume action without waiting',\n description:\n 'Resumes a suspended action execution without waiting (fire-and-forget) and returns immediately with the runId. The action continues executing in the background.',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action without waiting', { actionId, runId, step });\n\n return await workflows.RESUME_NO_WAIT_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action without waiting', { error, actionId });\n return handleError(error, 'Error resuming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const RESUME_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Resume action',\n description: 'Resumes a suspended action execution from a specific step',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action', { actionId, runId, step });\n\n return await workflows.RESUME_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action', { error, actionId });\n return handleError(error, 'Error resuming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume-stream',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Resume action stream',\n description: 'Resumes a suspended action execution and continues streaming results',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action stream', { actionId, runId, step });\n\n return await workflows.RESUME_STREAM_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action stream', { error, actionId });\n return handleError(error, 'Error resuming agent builder action stream');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/runs/:runId/cancel',\n responseType: 'json',\n pathParamSchema: actionRunPathParams,\n responseSchema: workflowControlResponseSchema,\n summary: 'Cancel action run',\n description: 'Cancels an in-progress action execution',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Cancelling agent builder action run', { actionId, runId });\n\n return await workflows.CANCEL_WORKFLOW_RUN_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error cancelling agent builder action run', { error, actionId });\n return handleError(error, 'Error cancelling agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\n// Legacy routes (deprecated)\nexport const STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/stream-legacy',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: streamLegacyAgentBuilderBodySchema,\n responseSchema: streamResponseSchema,\n summary: '[DEPRECATED] Stream agent-builder action with legacy format',\n description:\n 'Legacy endpoint for streaming agent-builder action execution. Use /agent-builder/:actionId/stream instead.',\n tags: ['Agent Builder', 'Legacy'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Streaming agent builder action (legacy)', { actionId, runId });\n\n return await workflows.STREAM_LEGACY_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error streaming agent builder action (legacy)', { error, actionId });\n return handleError(error, 'Error streaming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/observe-stream-legacy',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n responseSchema: streamResponseSchema,\n summary: '[DEPRECATED] Observe agent-builder action stream with legacy format',\n description:\n 'Legacy endpoint for observing agent-builder action stream. Use /agent-builder/:actionId/observe instead.',\n tags: ['Agent Builder', 'Legacy'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Observing agent builder action stream (legacy)', { actionId, runId });\n\n return await workflows.OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error observing agent builder action stream (legacy)', { error, actionId });\n return handleError(error, 'Error observing agent builder action stream');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,IAAI;AAEJ,eAAe,4BAA4D;CACzE,iCAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAiC,qBAAA,CAAA,CAAA,CAAgC,MAAK,QAAO,IAAI,qBAAqB;CACtG,OAAO;AACT;AAEA,eAAe,8BACb,QACA;CACA,MAAM,wBAAwB,MAAM,0BAA0B;CAC9D,cAAA,iBAAiB,2BAA2B,uBAAuB,MAAM;CACzE,OAAO;AACT;AAMA,MAAa,mCAAmCA,sBAAAA,YAA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AAiC,WAAW,CAAC;GAGvF,OAAO,KAAK,2CAA2C;IAAE;IAAU;GAAM,CAAC;GAE1E,OAAO,MAAA,oBAAA,6BAA6C,QAAQ;IAC1D,GAAG;IACH,YAAY;IACZ;GACF,CAAC;EACH,SAAS,OAAO;GACd,OAAO,MAAM,iDAAiD;IAAE;IAAO;GAAS,CAAC;GACjF,OAAOJ,8BAAAA,YAAY,OAAO,sCAAsC;EAClE,UAAU;GACR,cAAA,iBAAiB,QAAQ;EAC3B;CACF;AACF,CAAC;AAED,MAAa,mDAAmDF,sBAAAA,YAAY;CAC1E,QAAQ;CACR,MAAM;CACN,cAAc;CACd,iBAAiBG,sBAAAA;CACjB,kBAAkBW,eAAAA;CAClB,gBAAgBE,eAAAA;CAChB,SAAS;CACT,aACE;CACF,MAAM,CAAC,iBAAiB,QAAQ;CAChC,cAAc;CACd,SAAS,OAAM,QAAO;EACpB,MAAM,EAAE,QAAQ,UAAU,UAAU;EACpC,MAAM,SAAS,OAAO,UAAU;EAChC,IAAI;GACF,MAAM,8BAA8B,MAAM;GAE1C,IAAI,YAAY,CAACX,cAAAA,iBAAiB,uBAAuB,QAAQ,GAC/D,MAAM,IAAIC,uBAAAA,cAAc,KAAK,EAAE,SAAS,iCAAiC,WAAW,CAAC;GAGvF,OAAO,KAAK,kDAAkD;IAAE;IAAU;GAAM,CAAC;GAEjF,OAAO,MAAA,oBAAA,qCAAqD,QAAQ;IAClE,GAAG;IACH,YAAY;GACd,CAAC;EACH,SAAS,OAAO;GACd,OAAO,MAAM,wDAAwD;IAAE;IAAO;GAAS,CAAC;GACxF,OAAOJ,8BAAAA,YAAY,OAAO,6CAA6C;EACzE,UAAU;GACR,cAAA,iBAAiB,QAAQ;EAC3B;CACF;AACF,CAAC"}
@@ -5,9 +5,9 @@ import { b as workflowRunResultSchema, g as workflowInfoSchema, i as listWorkflo
5
5
  import { a as streamAgentBuilderBodySchema, i as startAsyncAgentBuilderBodySchema, n as actionRunPathParams, o as streamLegacyAgentBuilderBodySchema, r as resumeAgentBuilderBodySchema, t as actionIdPathParams } from "./agent-builder-CSnA_l6K.js";
6
6
  import { X as streamResponseSchema } from "./agents-B5kq2QEV.js";
7
7
  import { n as createRoute } from "./route-builder-BxPrwNog.js";
8
- import { t as WorkflowRegistry } from "./utils-YEuwVEc2.js";
8
+ import { t as WorkflowRegistry } from "./utils-qaBKOShQ.js";
9
9
  import { handleError } from "./server/handlers/error.js";
10
- import { C as STREAM_LEGACY_WORKFLOW_ROUTE, S as START_WORKFLOW_RUN_ROUTE, _ as RESUME_ASYNC_WORKFLOW_ROUTE, a as GET_WORKFLOW_BY_ID_ROUTE, b as RESUME_WORKFLOW_ROUTE, c as LIST_WORKFLOW_RUNS_ROUTE, d as OBSERVE_STREAM_WORKFLOW_ROUTE, n as CREATE_WORKFLOW_RUN_ROUTE, o as GET_WORKFLOW_RUN_BY_ID_ROUTE, s as LIST_WORKFLOWS_ROUTE, t as CANCEL_WORKFLOW_RUN_ROUTE, u as OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE, v as RESUME_NO_WAIT_WORKFLOW_ROUTE, w as STREAM_WORKFLOW_ROUTE, x as START_ASYNC_WORKFLOW_ROUTE, y as RESUME_STREAM_WORKFLOW_ROUTE } from "./workflows-DPIRVRN9.js";
10
+ import { C as STREAM_LEGACY_WORKFLOW_ROUTE, S as START_WORKFLOW_RUN_ROUTE, _ as RESUME_ASYNC_WORKFLOW_ROUTE, a as GET_WORKFLOW_BY_ID_ROUTE, b as RESUME_WORKFLOW_ROUTE, c as LIST_WORKFLOW_RUNS_ROUTE, d as OBSERVE_STREAM_WORKFLOW_ROUTE, n as CREATE_WORKFLOW_RUN_ROUTE, o as GET_WORKFLOW_RUN_BY_ID_ROUTE, s as LIST_WORKFLOWS_ROUTE, t as CANCEL_WORKFLOW_RUN_ROUTE, u as OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE, v as RESUME_NO_WAIT_WORKFLOW_ROUTE, w as STREAM_WORKFLOW_ROUTE, x as START_ASYNC_WORKFLOW_ROUTE, y as RESUME_STREAM_WORKFLOW_ROUTE } from "./workflows-ClfVyB1p.js";
11
11
  // src/server/handlers/agent-builder.ts
12
12
  var agent_builder_exports = /* @__PURE__ */ __exportAll({
13
13
  CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE: () => CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE,
@@ -29,7 +29,7 @@ var agent_builder_exports = /* @__PURE__ */ __exportAll({
29
29
  });
30
30
  let agentBuilderWorkflowsPromise;
31
31
  async function loadAgentBuilderWorkflows() {
32
- agentBuilderWorkflowsPromise ??= import("./dist-BOXHlYtd.js").then((mod) => mod.agentBuilderWorkflows);
32
+ agentBuilderWorkflowsPromise ??= import("./dist-DC2mND12.js").then((mod) => mod.agentBuilderWorkflows);
33
33
  return agentBuilderWorkflowsPromise;
34
34
  }
35
35
  async function registerAgentBuilderWorkflows(mastra) {
@@ -623,4 +623,4 @@ const OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = createRoute({
623
623
  });
624
624
  export { agent_builder_exports as _, LIST_AGENT_BUILDER_ACTIONS_ROUTE as a, OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE as c, RESUME_NO_WAIT_AGENT_BUILDER_ACTION_ROUTE as d, RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE as f, STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE as g, STREAM_AGENT_BUILDER_ACTION_ROUTE as h, GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE as i, RESUME_AGENT_BUILDER_ACTION_ROUTE as l, START_ASYNC_AGENT_BUILDER_ACTION_ROUTE as m, CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE as n, LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE as o, START_AGENT_BUILDER_ACTION_RUN_ROUTE as p, GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE as r, OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE as s, CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE as t, RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE as u };
625
625
 
626
- //# sourceMappingURL=agent-builder-TJmawAJj.js.map
626
+ //# sourceMappingURL=agent-builder-Cq-jo2FP.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-builder-TJmawAJj.js","names":[],"sources":["../src/server/handlers/agent-builder.ts"],"sourcesContent":["import type { agentBuilderWorkflows as agentBuilderWorkflowsType } from '@mastra/agent-builder';\nimport { HTTPException } from '../http-exception';\nimport {\n actionIdPathParams,\n actionRunPathParams,\n createWorkflowRunResponseSchema,\n listWorkflowRunsQuerySchema,\n resumeAgentBuilderBodySchema,\n streamAgentBuilderBodySchema,\n startAsyncAgentBuilderBodySchema,\n workflowExecutionResultSchema,\n workflowControlResponseSchema,\n workflowRunsResponseSchema,\n workflowInfoSchema,\n listWorkflowsResponseSchema,\n streamLegacyAgentBuilderBodySchema,\n workflowRunResultSchema,\n workflowRunResultQuerySchema,\n} from '../schemas/agent-builder';\nimport { streamResponseSchema } from '../schemas/agents';\nimport { optionalRunIdSchema, runIdSchema } from '../schemas/common';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { WorkflowRegistry } from '../utils';\nimport { handleError } from './error';\nimport * as workflows from './workflows';\n\ntype AgentBuilderWorkflows = typeof agentBuilderWorkflowsType;\n\nlet agentBuilderWorkflowsPromise: Promise<AgentBuilderWorkflows> | undefined;\n\nasync function loadAgentBuilderWorkflows(): Promise<AgentBuilderWorkflows> {\n agentBuilderWorkflowsPromise ??= import('@mastra/agent-builder').then(mod => mod.agentBuilderWorkflows);\n return agentBuilderWorkflowsPromise;\n}\n\nasync function registerAgentBuilderWorkflows(\n mastra: Parameters<typeof WorkflowRegistry.registerTemporaryWorkflows>[1],\n) {\n const agentBuilderWorkflows = await loadAgentBuilderWorkflows();\n WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);\n return agentBuilderWorkflows;\n}\n\n// ============================================================================\n// Route Definitions (handlers call workflow route handlers with transformed parameters)\n// ============================================================================\n\nexport const LIST_AGENT_BUILDER_ACTIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder',\n responseType: 'json',\n responseSchema: listWorkflowsResponseSchema,\n summary: 'List agent-builder actions',\n description: 'Returns a list of all available agent-builder actions',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n logger.info('Listing agent builder actions');\n\n // Call workflow list handler\n return await workflows.LIST_WORKFLOWS_ROUTE.handler(ctx);\n } catch (error) {\n logger.error('Error listing agent builder actions', { error });\n return handleError(error, 'Error getting agent builder workflows');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder/:actionId',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n responseSchema: workflowInfoSchema,\n summary: 'Get action by ID',\n description: 'Returns details for a specific agent-builder action',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId } = ctx;\n const logger = mastra.getLogger();\n try {\n const agentBuilderWorkflows = await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, {\n message: `Invalid agent-builder action: ${actionId}. Valid actions are: ${Object.keys(agentBuilderWorkflows).join(', ')}`,\n });\n }\n\n logger.info('Getting agent builder action by ID', { actionId });\n\n return await workflows.GET_WORKFLOW_BY_ID_ROUTE.handler({ ...ctx, workflowId: actionId });\n } catch (error) {\n logger.error('Error getting agent builder action by ID', { error, actionId });\n return handleError(error, 'Error getting agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder/:actionId/runs',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: listWorkflowRunsQuerySchema,\n responseSchema: workflowRunsResponseSchema,\n summary: 'List action runs',\n description: 'Returns a paginated list of execution runs for the specified action',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Listing agent builder action runs', { actionId });\n\n return await workflows.LIST_WORKFLOW_RUNS_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error listing agent builder action runs', { error, actionId });\n return handleError(error, 'Error getting agent builder action runs');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder/:actionId/runs/:runId',\n responseType: 'json',\n pathParamSchema: actionRunPathParams,\n queryParamSchema: workflowRunResultQuerySchema,\n responseSchema: workflowRunResultSchema,\n summary: 'Get action run by ID',\n description:\n 'Returns details for a specific action run with metadata and processed execution state. Use the fields query parameter to reduce payload size.',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Getting agent builder action run by ID', { actionId, runId });\n\n return await workflows.GET_WORKFLOW_RUN_BY_ID_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error getting agent builder action run', { error, actionId, runId });\n return handleError(error, 'Error getting agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/create-run',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: optionalRunIdSchema,\n responseSchema: createWorkflowRunResponseSchema,\n summary: 'Create action run',\n description: 'Creates a new action execution instance with an optional custom run ID',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Creating agent builder action run', { actionId, runId });\n\n return await workflows.CREATE_WORKFLOW_RUN_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error creating agent builder action run', { error, actionId });\n return handleError(error, 'Error creating agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const STREAM_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/stream',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: streamAgentBuilderBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Stream action execution',\n description: 'Executes an action and streams the results in real-time',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Streaming agent builder action', { actionId, runId });\n\n return await workflows.STREAM_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error streaming agent builder action', { error, actionId });\n return handleError(error, 'Error streaming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const START_ASYNC_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/start-async',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: optionalRunIdSchema,\n bodySchema: startAsyncAgentBuilderBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Start action asynchronously',\n description: 'Starts an action execution asynchronously without streaming results',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Starting agent builder action asynchronously', { actionId, runId });\n\n return await workflows.START_ASYNC_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error starting agent builder action asynchronously', { error, actionId });\n return handleError(error, 'Error starting agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const START_AGENT_BUILDER_ACTION_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/start',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: startAsyncAgentBuilderBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Start specific action run',\n description: 'Starts execution of a specific action run by ID',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Starting specific agent builder action run', { actionId, runId });\n\n return await workflows.START_WORKFLOW_RUN_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error starting agent builder action run', { error, actionId });\n return handleError(error, 'Error starting agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/observe',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n responseSchema: streamResponseSchema,\n summary: 'Observe action stream',\n description: 'Observes and streams updates from an already running action execution',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Observing agent builder action stream', { actionId, runId });\n\n return await workflows.OBSERVE_STREAM_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error observing agent builder action stream', { error, actionId });\n return handleError(error, 'Error observing agent builder action stream');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume-async',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Resume action asynchronously',\n description: 'Resumes a suspended action execution asynchronously without streaming',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action asynchronously', { actionId, runId, step });\n\n return await workflows.RESUME_ASYNC_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action asynchronously', { error, actionId });\n return handleError(error, 'Error resuming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\n/**\n * Fire-and-forget resume for agent-builder actions: returns immediately with the runId without\n * waiting for completion. Delegates to the workflows `resume-no-wait` route.\n *\n * TODO(v2): fold this behavior into the `resume-async` route in Mastra v2 and remove this route.\n * Kept separate in v1 to avoid breaking the existing `resume-async` response contract.\n */\nexport const RESUME_NO_WAIT_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume-no-wait',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: createWorkflowRunResponseSchema,\n summary: 'Resume action without waiting',\n description:\n 'Resumes a suspended action execution without waiting (fire-and-forget) and returns immediately with the runId. The action continues executing in the background.',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action without waiting', { actionId, runId, step });\n\n return await workflows.RESUME_NO_WAIT_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action without waiting', { error, actionId });\n return handleError(error, 'Error resuming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const RESUME_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Resume action',\n description: 'Resumes a suspended action execution from a specific step',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action', { actionId, runId, step });\n\n return await workflows.RESUME_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action', { error, actionId });\n return handleError(error, 'Error resuming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume-stream',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Resume action stream',\n description: 'Resumes a suspended action execution and continues streaming results',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action stream', { actionId, runId, step });\n\n return await workflows.RESUME_STREAM_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action stream', { error, actionId });\n return handleError(error, 'Error resuming agent builder action stream');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/runs/:runId/cancel',\n responseType: 'json',\n pathParamSchema: actionRunPathParams,\n responseSchema: workflowControlResponseSchema,\n summary: 'Cancel action run',\n description: 'Cancels an in-progress action execution',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Cancelling agent builder action run', { actionId, runId });\n\n return await workflows.CANCEL_WORKFLOW_RUN_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error cancelling agent builder action run', { error, actionId });\n return handleError(error, 'Error cancelling agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\n// Legacy routes (deprecated)\nexport const STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/stream-legacy',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: streamLegacyAgentBuilderBodySchema,\n responseSchema: streamResponseSchema,\n summary: '[DEPRECATED] Stream agent-builder action with legacy format',\n description:\n 'Legacy endpoint for streaming agent-builder action execution. Use /agent-builder/:actionId/stream instead.',\n tags: ['Agent Builder', 'Legacy'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Streaming agent builder action (legacy)', { actionId, runId });\n\n return await workflows.STREAM_LEGACY_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error streaming agent builder action (legacy)', { error, actionId });\n return handleError(error, 'Error streaming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/observe-stream-legacy',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n responseSchema: streamResponseSchema,\n summary: '[DEPRECATED] Observe agent-builder action stream with legacy format',\n description:\n 'Legacy endpoint for observing agent-builder action stream. Use /agent-builder/:actionId/observe instead.',\n tags: ['Agent Builder', 'Legacy'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Observing agent builder action stream (legacy)', { actionId, runId });\n\n return await workflows.OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error observing agent builder action stream (legacy)', { error, actionId });\n return handleError(error, 'Error observing agent builder action stream');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,IAAI;AAEJ,eAAe,4BAA4D;CACzE,iCAAiC,OAAO,qBAAwB,CAAC,MAAK,QAAO,IAAI,qBAAqB;CACt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q-jo2FP.js","names":[],"sources":["../src/server/handlers/agent-builder.ts"],"sourcesContent":["import type { agentBuilderWorkflows as agentBuilderWorkflowsType } from '@mastra/agent-builder';\nimport { HTTPException } from '../http-exception';\nimport {\n actionIdPathParams,\n actionRunPathParams,\n createWorkflowRunResponseSchema,\n listWorkflowRunsQuerySchema,\n resumeAgentBuilderBodySchema,\n streamAgentBuilderBodySchema,\n startAsyncAgentBuilderBodySchema,\n workflowExecutionResultSchema,\n workflowControlResponseSchema,\n workflowRunsResponseSchema,\n workflowInfoSchema,\n listWorkflowsResponseSchema,\n streamLegacyAgentBuilderBodySchema,\n workflowRunResultSchema,\n workflowRunResultQuerySchema,\n} from '../schemas/agent-builder';\nimport { streamResponseSchema } from '../schemas/agents';\nimport { optionalRunIdSchema, runIdSchema } from '../schemas/common';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { WorkflowRegistry } from '../utils';\nimport { handleError } from './error';\nimport * as workflows from './workflows';\n\ntype AgentBuilderWorkflows = typeof agentBuilderWorkflowsType;\n\nlet agentBuilderWorkflowsPromise: Promise<AgentBuilderWorkflows> | undefined;\n\nasync function loadAgentBuilderWorkflows(): Promise<AgentBuilderWorkflows> {\n agentBuilderWorkflowsPromise ??= import('@mastra/agent-builder').then(mod => mod.agentBuilderWorkflows);\n return agentBuilderWorkflowsPromise;\n}\n\nasync function registerAgentBuilderWorkflows(\n mastra: Parameters<typeof WorkflowRegistry.registerTemporaryWorkflows>[1],\n) {\n const agentBuilderWorkflows = await loadAgentBuilderWorkflows();\n WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);\n return agentBuilderWorkflows;\n}\n\n// ============================================================================\n// Route Definitions (handlers call workflow route handlers with transformed parameters)\n// ============================================================================\n\nexport const LIST_AGENT_BUILDER_ACTIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder',\n responseType: 'json',\n responseSchema: listWorkflowsResponseSchema,\n summary: 'List agent-builder actions',\n description: 'Returns a list of all available agent-builder actions',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n logger.info('Listing agent builder actions');\n\n // Call workflow list handler\n return await workflows.LIST_WORKFLOWS_ROUTE.handler(ctx);\n } catch (error) {\n logger.error('Error listing agent builder actions', { error });\n return handleError(error, 'Error getting agent builder workflows');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder/:actionId',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n responseSchema: workflowInfoSchema,\n summary: 'Get action by ID',\n description: 'Returns details for a specific agent-builder action',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId } = ctx;\n const logger = mastra.getLogger();\n try {\n const agentBuilderWorkflows = await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, {\n message: `Invalid agent-builder action: ${actionId}. Valid actions are: ${Object.keys(agentBuilderWorkflows).join(', ')}`,\n });\n }\n\n logger.info('Getting agent builder action by ID', { actionId });\n\n return await workflows.GET_WORKFLOW_BY_ID_ROUTE.handler({ ...ctx, workflowId: actionId });\n } catch (error) {\n logger.error('Error getting agent builder action by ID', { error, actionId });\n return handleError(error, 'Error getting agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder/:actionId/runs',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: listWorkflowRunsQuerySchema,\n responseSchema: workflowRunsResponseSchema,\n summary: 'List action runs',\n description: 'Returns a paginated list of execution runs for the specified action',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Listing agent builder action runs', { actionId });\n\n return await workflows.LIST_WORKFLOW_RUNS_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error listing agent builder action runs', { error, actionId });\n return handleError(error, 'Error getting agent builder action runs');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE = createRoute({\n method: 'GET',\n path: '/agent-builder/:actionId/runs/:runId',\n responseType: 'json',\n pathParamSchema: actionRunPathParams,\n queryParamSchema: workflowRunResultQuerySchema,\n responseSchema: workflowRunResultSchema,\n summary: 'Get action run by ID',\n description:\n 'Returns details for a specific action run with metadata and processed execution state. Use the fields query parameter to reduce payload size.',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Getting agent builder action run by ID', { actionId, runId });\n\n return await workflows.GET_WORKFLOW_RUN_BY_ID_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error getting agent builder action run', { error, actionId, runId });\n return handleError(error, 'Error getting agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/create-run',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: optionalRunIdSchema,\n responseSchema: createWorkflowRunResponseSchema,\n summary: 'Create action run',\n description: 'Creates a new action execution instance with an optional custom run ID',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Creating agent builder action run', { actionId, runId });\n\n return await workflows.CREATE_WORKFLOW_RUN_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error creating agent builder action run', { error, actionId });\n return handleError(error, 'Error creating agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const STREAM_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/stream',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: streamAgentBuilderBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Stream action execution',\n description: 'Executes an action and streams the results in real-time',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Streaming agent builder action', { actionId, runId });\n\n return await workflows.STREAM_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error streaming agent builder action', { error, actionId });\n return handleError(error, 'Error streaming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const START_ASYNC_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/start-async',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: optionalRunIdSchema,\n bodySchema: startAsyncAgentBuilderBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Start action asynchronously',\n description: 'Starts an action execution asynchronously without streaming results',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Starting agent builder action asynchronously', { actionId, runId });\n\n return await workflows.START_ASYNC_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error starting agent builder action asynchronously', { error, actionId });\n return handleError(error, 'Error starting agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const START_AGENT_BUILDER_ACTION_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/start',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: startAsyncAgentBuilderBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Start specific action run',\n description: 'Starts execution of a specific action run by ID',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Starting specific agent builder action run', { actionId, runId });\n\n return await workflows.START_WORKFLOW_RUN_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error starting agent builder action run', { error, actionId });\n return handleError(error, 'Error starting agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/observe',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n responseSchema: streamResponseSchema,\n summary: 'Observe action stream',\n description: 'Observes and streams updates from an already running action execution',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Observing agent builder action stream', { actionId, runId });\n\n return await workflows.OBSERVE_STREAM_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error observing agent builder action stream', { error, actionId });\n return handleError(error, 'Error observing agent builder action stream');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume-async',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Resume action asynchronously',\n description: 'Resumes a suspended action execution asynchronously without streaming',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action asynchronously', { actionId, runId, step });\n\n return await workflows.RESUME_ASYNC_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action asynchronously', { error, actionId });\n return handleError(error, 'Error resuming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\n/**\n * Fire-and-forget resume for agent-builder actions: returns immediately with the runId without\n * waiting for completion. Delegates to the workflows `resume-no-wait` route.\n *\n * TODO(v2): fold this behavior into the `resume-async` route in Mastra v2 and remove this route.\n * Kept separate in v1 to avoid breaking the existing `resume-async` response contract.\n */\nexport const RESUME_NO_WAIT_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume-no-wait',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: createWorkflowRunResponseSchema,\n summary: 'Resume action without waiting',\n description:\n 'Resumes a suspended action execution without waiting (fire-and-forget) and returns immediately with the runId. The action continues executing in the background.',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action without waiting', { actionId, runId, step });\n\n return await workflows.RESUME_NO_WAIT_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action without waiting', { error, actionId });\n return handleError(error, 'Error resuming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const RESUME_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume',\n responseType: 'json',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Resume action',\n description: 'Resumes a suspended action execution from a specific step',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action', { actionId, runId, step });\n\n return await workflows.RESUME_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action', { error, actionId });\n return handleError(error, 'Error resuming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/resume-stream',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeAgentBuilderBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Resume action stream',\n description: 'Resumes a suspended action execution and continues streaming results',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, step, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Resuming agent builder action stream', { actionId, runId, step });\n\n return await workflows.RESUME_STREAM_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error resuming agent builder action stream', { error, actionId });\n return handleError(error, 'Error resuming agent builder action stream');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/runs/:runId/cancel',\n responseType: 'json',\n pathParamSchema: actionRunPathParams,\n responseSchema: workflowControlResponseSchema,\n summary: 'Cancel action run',\n description: 'Cancels an in-progress action execution',\n tags: ['Agent Builder'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Cancelling agent builder action run', { actionId, runId });\n\n return await workflows.CANCEL_WORKFLOW_RUN_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error cancelling agent builder action run', { error, actionId });\n return handleError(error, 'Error cancelling agent builder action run');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\n// Legacy routes (deprecated)\nexport const STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/stream-legacy',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: streamLegacyAgentBuilderBodySchema,\n responseSchema: streamResponseSchema,\n summary: '[DEPRECATED] Stream agent-builder action with legacy format',\n description:\n 'Legacy endpoint for streaming agent-builder action execution. Use /agent-builder/:actionId/stream instead.',\n tags: ['Agent Builder', 'Legacy'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId, requestContext } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Streaming agent builder action (legacy)', { actionId, runId });\n\n return await workflows.STREAM_LEGACY_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n requestContext,\n });\n } catch (error) {\n logger.error('Error streaming agent builder action (legacy)', { error, actionId });\n return handleError(error, 'Error streaming agent builder action');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n\nexport const OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = createRoute({\n method: 'POST',\n path: '/agent-builder/:actionId/observe-stream-legacy',\n responseType: 'stream',\n pathParamSchema: actionIdPathParams,\n queryParamSchema: runIdSchema,\n responseSchema: streamResponseSchema,\n summary: '[DEPRECATED] Observe agent-builder action stream with legacy format',\n description:\n 'Legacy endpoint for observing agent-builder action stream. Use /agent-builder/:actionId/observe instead.',\n tags: ['Agent Builder', 'Legacy'],\n requiresAuth: true,\n handler: async ctx => {\n const { mastra, actionId, runId } = ctx;\n const logger = mastra.getLogger();\n try {\n await registerAgentBuilderWorkflows(mastra);\n\n if (actionId && !WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {\n throw new HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });\n }\n\n logger.info('Observing agent builder action stream (legacy)', { actionId, runId });\n\n return await workflows.OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE.handler({\n ...ctx,\n workflowId: actionId,\n });\n } catch (error) {\n logger.error('Error observing agent builder action stream (legacy)', { error, actionId });\n return handleError(error, 'Error observing agent builder action stream');\n } finally {\n WorkflowRegistry.cleanup();\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,IAAI;AAEJ,eAAe,4BAA4D;CACzE,iCAAiC,OAAO,qBAAwB,CAAC,MAAK,QAAO,IAAI,qBAAqB;CACtG,OAAO;AACT;AAEA,eAAe,8BACb,QACA;CACA,MAAM,wBAAwB,MAAM,0BAA0B;CAC9D,iBAAiB,2BAA2B,uBAAuB,MAAM;CACzE,OAAO;AACT;AAMA,MAAa,mCAAmC,YAAY;CAC1D,QAAQ;CACR,MAAM;CACN,cAAc;CACd,gBAAgB;CAChB,SAAS;CACT,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CAAiC,WAAW,CAAC;GAGvF,OAAO,KAAK,2CAA2C;IAAE;IAAU;GAAM,CAAC;GAE1E,OAAO,MAAA,6BAA6C,QAAQ;IAC1D,GAAG;IACH,YAAY;IACZ;GACF,CAAC;EACH,SAAS,OAAO;GACd,OAAO,MAAM,iDAAiD;IAAE;IAAO;GAAS,CAAC;GACjF,OAAO,YAAY,OAAO,sCAAsC;EAClE,UAAU;GACR,iBAAiB,QAAQ;EAC3B;CACF;AACF,CAAC;AAED,MAAa,mDAAmD,YAAY;CAC1E,QAAQ;CACR,MAAM;CACN,cAAc;CACd,iBAAiB;CACjB,kBAAkB;CAClB,gBAAgB;CAChB,SAAS;CACT,aACE;CACF,MAAM,CAAC,iBAAiB,QAAQ;CAChC,cAAc;CACd,SAAS,OAAM,QAAO;EACpB,MAAM,EAAE,QAAQ,UAAU,UAAU;EACpC,MAAM,SAAS,OAAO,UAAU;EAChC,IAAI;GACF,MAAM,8BAA8B,MAAM;GAE1C,IAAI,YAAY,CAAC,iBAAiB,uBAAuB,QAAQ,GAC/D,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,iCAAiC,WAAW,CAAC;GAGvF,OAAO,KAAK,kDAAkD;IAAE;IAAU;GAAM,CAAC;GAEjF,OAAO,MAAA,qCAAqD,QAAQ;IAClE,GAAG;IACH,YAAY;GACd,CAAC;EACH,SAAS,OAAO;GACd,OAAO,MAAM,wDAAwD;IAAE;IAAO;GAAS,CAAC;GACxF,OAAO,YAAY,OAAO,6CAA6C;EACzE,UAAU;GACR,iBAAiB,QAAQ;EAC3B;CACF;AACF,CAAC"}
@@ -3,10 +3,10 @@ import { t as HTTPException } from "./http-exception-CzaWkxMl.js";
3
3
  import { $ as toolCallResponseSchema, A as observeAgentBodySchema, B as sendAgentMessageBodySchema, C as generateResponseSchema, E as listSuspendedRunsResponseSchema, F as queueAgentSignalBodySchema, G as serializedAgentSchema, H as sendToolApprovalBodySchema, I as recoverBodySchema, L as reorderAgentModelListBodySchema, N as providersResponseSchema, O as modelConfigIdPathParams, P as queueAgentMessageBodySchema, Q as subscribeAgentThreadBodySchema, R as resumeStreamBodySchema, T as listSuspendedRunsQuerySchema, U as sendToolApprovalResponseSchema, V as sendAgentSignalBodySchema, X as streamResponseSchema, Z as streamUntilIdleBodySchema, _ as declineToolCallBodySchema, a as agentIdPathParams, c as agentRunPathParams, d as agentVersionQuerySchema, f as approveNetworkToolCallBodySchema, g as declineNetworkToolCallBodySchema, h as cancelPendingAgentSignalsResponseSchema, i as agentExecutionLegacyBodySchema, j as observeAgentResponseSchema, k as modelManagementResponseSchema, l as agentSkillPathParams, m as cancelPendingAgentSignalsBodySchema, n as abortAgentThreadResponseSchema, nt as updateAgentModelInModelListBodySchema, p as approveToolCallBodySchema, r as agentExecutionBodySchema, t as abortAgentThreadBodySchema, tt as updateAgentModelBodySchema, v as enhanceInstructionsBodySchema, w as listAgentsResponseSchema, y as enhanceInstructionsResponseSchema, z as resumeStreamUntilIdleBodySchema } from "./agents-B5kq2QEV.js";
4
4
  import { n as standardSchemaToJSONSchema, r as toStandardSchema } from "./schema-Bf12g7KC-DBc4NSds.js";
5
5
  import { n as createRoute } from "./route-builder-BxPrwNog.js";
6
- import { c as toSlug, l as stringify } from "./utils-YEuwVEc2.js";
7
- import { g as resolveToolConfig, i as MASTRA_IS_STUDIO_KEY, o as MASTRA_RESOURCE_ID_KEY, p as WORKSPACE_TOOLS } from "./constants-ohUUT3Vg.js";
6
+ import { c as toSlug, l as stringify } from "./utils-qaBKOShQ.js";
7
+ import { _ as resolveToolConfig, i as MASTRA_IS_STUDIO_KEY, m as WORKSPACE_TOOLS, s as MASTRA_RESOURCE_ID_KEY } from "./constants-CXAvBYcz.js";
8
8
  import { handleError } from "./server/handlers/error.js";
9
- import { _ as MastraFGAPermissions, a as getEffectiveThreadId, c as mergeBodyRequestContext, d as requireEffectiveResourceId, f as sanitizeBody, g as validateThreadOwnership, h as validateRunOwnership, i as getEffectiveResourceId, m as validateBody, n as enforceThreadAccess, o as getHandlerFGAProvider, p as stripClientCredentialHeaders, r as getContextResourceId, t as applyEffectiveThreadId } from "./utils-DHxjw4Tn.js";
9
+ import { _ as MastraFGAPermissions, a as getEffectiveThreadId, c as mergeBodyRequestContext, d as requireEffectiveResourceId, f as sanitizeBody, g as validateThreadOwnership, h as validateRunOwnership, i as getEffectiveResourceId, m as validateBody, n as enforceThreadAccess, o as getHandlerFGAProvider, p as stripClientCredentialHeaders, r as getContextResourceId, t as applyEffectiveThreadId } from "./utils-B15w-1hm.js";
10
10
  import { r as createStoredAgentResponseSchema } from "./stored-agents-C9zCintA.js";
11
11
  import { O as skillDisambiguationQuerySchema, h as getAgentSkillResponseSchema } from "./workspace-DBDA3UQl.js";
12
12
  import { stripInjectedToolOverrideFields } from "./server/handlers/tool-schema-overrides.js";
@@ -2983,4 +2983,4 @@ const GET_AGENT_SKILL_ROUTE = createRoute({
2983
2983
  });
2984
2984
  export { SEND_TOOL_APPROVAL_ROUTE as A, UPDATE_AGENT_MODEL_IN_MODEL_LIST_ROUTE as B, RECOVER_ROUTE as C, RESUME_STREAM_UNTIL_IDLE_ROUTE as D, RESUME_STREAM_ROUTE as E, STREAM_UI_MESSAGE_DEPRECATED_ROUTE as F, getAgentFromSystem as G, agents_exports as H, STREAM_UI_MESSAGE_VNEXT_DEPRECATED_ROUTE as I, getSerializedProcessors as J, getBrowserToolsFromAgent as K, STREAM_UNTIL_IDLE_GENERATE_ROUTE as L, STREAM_GENERATE_ROUTE as M, STREAM_GENERATE_VNEXT_DEPRECATED_ROUTE as N, SEND_AGENT_MESSAGE_ROUTE as O, STREAM_NETWORK_ROUTE as P, STREAM_VNEXT_DEPRECATED_ROUTE as R, QUEUE_AGENT_SIGNAL_ROUTE as S, RESET_AGENT_MODEL_ROUTE as T, buildProvidersList as U, UPDATE_AGENT_MODEL_ROUTE as V, extractVersionOptions as W, getWorkspaceToolsFromAgent as X, getSerializedSkillsFromAgent as Y, isProviderConnected as Z, GET_PROVIDERS_ROUTE as _, APPROVE_TOOL_CALL_ROUTE as a, OBSERVE_AGENT_STREAM_ROUTE as b, DECLINE_NETWORK_TOOL_CALL_ROUTE as c, ENHANCE_INSTRUCTIONS_ROUTE as d, GENERATE_AGENT_ROUTE as f, GET_AGENT_SKILL_ROUTE as g, GET_AGENT_BY_ID_ROUTE as h, APPROVE_TOOL_CALL_GENERATE_ROUTE as i, STREAM_GENERATE_LEGACY_ROUTE as j, SEND_AGENT_SIGNAL_ROUTE as k, DECLINE_TOOL_CALL_GENERATE_ROUTE as l, GENERATE_LEGACY_ROUTE as m, ABORT_AGENT_THREAD_ROUTE as n, CANCEL_AGENT_PENDING_SIGNALS_ROUTE as o, GENERATE_AGENT_VNEXT_ROUTE as p, getSerializedAgentTools as q, APPROVE_NETWORK_TOOL_CALL_ROUTE as r, CLONE_AGENT_ROUTE as s, ABORT_AGENT_RUN_ROUTE as t, DECLINE_TOOL_CALL_ROUTE as u, LIST_AGENTS_ROUTE as v, REORDER_AGENT_MODEL_LIST_ROUTE as w, QUEUE_AGENT_MESSAGE_ROUTE as x, LIST_SUSPENDED_RUNS_ROUTE as y, SUBSCRIBE_AGENT_THREAD_ROUTE as z };
2985
2985
 
2986
- //# sourceMappingURL=agents-BuI0JjjX.js.map
2986
+ //# sourceMappingURL=agents-NRBk4JAs.js.map