@mastra/core 1.0.0-beta.11 → 1.0.0-beta.13

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 (394) hide show
  1. package/CHANGELOG.md +173 -0
  2. package/dist/_types/@internal_ai-sdk-v4/dist/index.d.ts +7549 -0
  3. package/dist/_types/@internal_ai-sdk-v4/dist/test.d.ts +65 -0
  4. package/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +8396 -0
  5. package/dist/_types/@internal_ai-sdk-v5/dist/test.d.ts +1708 -0
  6. package/dist/_types/@internal_external-types/dist/index.d.ts +858 -0
  7. package/dist/agent/agent-legacy.d.ts +1 -1
  8. package/dist/agent/agent.d.ts +1 -1
  9. package/dist/agent/agent.d.ts.map +1 -1
  10. package/dist/agent/agent.types.d.ts +5 -1
  11. package/dist/agent/agent.types.d.ts.map +1 -1
  12. package/dist/agent/index.cjs +9 -9
  13. package/dist/agent/index.js +2 -2
  14. package/dist/agent/message-list/index.cjs +3 -3
  15. package/dist/agent/message-list/index.d.ts +4 -3
  16. package/dist/agent/message-list/index.d.ts.map +1 -1
  17. package/dist/agent/message-list/index.js +1 -1
  18. package/dist/agent/message-list/prompt/attachments-to-parts.d.ts +1 -1
  19. package/dist/agent/message-list/prompt/invalid-content-error.d.ts +1 -1
  20. package/dist/agent/message-list/types.d.ts +3 -3
  21. package/dist/agent/message-list/types.d.ts.map +1 -1
  22. package/dist/agent/message-list/utils/ai-v4-v5/core-model-message.d.ts +1 -1
  23. package/dist/agent/message-list/utils/ai-v4-v5/ui-message.d.ts +1 -1
  24. package/dist/agent/message-list/utils/ai-v5/gemini-compatibility.d.ts +2 -2
  25. package/dist/agent/message-list/utils/ai-v5/gemini-compatibility.d.ts.map +1 -1
  26. package/dist/agent/message-list/utils/convert-messages.d.ts +2 -2
  27. package/dist/agent/message-list/utils/convert-messages.d.ts.map +1 -1
  28. package/dist/agent/types.d.ts +3 -3
  29. package/dist/agent/utils.d.ts +3 -3
  30. package/dist/agent/utils.d.ts.map +1 -1
  31. package/dist/agent/workflows/prepare-stream/index.d.ts +2 -1
  32. package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
  33. package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts.map +1 -1
  34. package/dist/agent/workflows/prepare-stream/stream-step.d.ts +3 -1
  35. package/dist/agent/workflows/prepare-stream/stream-step.d.ts.map +1 -1
  36. package/dist/bundler/types.d.ts +14 -1
  37. package/dist/bundler/types.d.ts.map +1 -1
  38. package/dist/{chunk-U3XOLEPX.js → chunk-2IU4RGU5.js} +6 -32
  39. package/dist/chunk-2IU4RGU5.js.map +1 -0
  40. package/dist/chunk-2SQB3WBT.js +4574 -0
  41. package/dist/chunk-2SQB3WBT.js.map +1 -0
  42. package/dist/{chunk-THZTRBFS.js → chunk-373OC54J.js} +8 -8
  43. package/dist/chunk-373OC54J.js.map +1 -0
  44. package/dist/{chunk-F2GAJSBI.js → chunk-4BC5FUAO.js} +8 -6
  45. package/dist/{chunk-F2GAJSBI.js.map → chunk-4BC5FUAO.js.map} +1 -1
  46. package/dist/chunk-55VPMN3N.js +250 -0
  47. package/dist/chunk-55VPMN3N.js.map +1 -0
  48. package/dist/{chunk-QM5SRDJX.js → chunk-5PTZG26U.js} +66 -84
  49. package/dist/chunk-5PTZG26U.js.map +1 -0
  50. package/dist/chunk-5VZGJTPR.js +4837 -0
  51. package/dist/chunk-5VZGJTPR.js.map +1 -0
  52. package/dist/{chunk-C36YRTZ6.js → chunk-62Q7K656.js} +6 -7
  53. package/dist/chunk-62Q7K656.js.map +1 -0
  54. package/dist/chunk-6PMMP3FR.js +7 -0
  55. package/dist/chunk-6PMMP3FR.js.map +1 -0
  56. package/dist/{chunk-DZUJEN5N.cjs → chunk-6SZKM6EC.cjs} +10 -3
  57. package/dist/{chunk-DZUJEN5N.cjs.map → chunk-6SZKM6EC.cjs.map} +1 -1
  58. package/dist/{chunk-5WRI5ZAA.js → chunk-7D4SUZUM.js} +10 -4
  59. package/dist/{chunk-5WRI5ZAA.js.map → chunk-7D4SUZUM.js.map} +1 -1
  60. package/dist/{chunk-YWMMBIOM.cjs → chunk-7HEAVZRS.cjs} +15 -15
  61. package/dist/{chunk-YWMMBIOM.cjs.map → chunk-7HEAVZRS.cjs.map} +1 -1
  62. package/dist/{chunk-BUKY6CTR.cjs → chunk-AGHLXC4I.cjs} +106 -36
  63. package/dist/chunk-AGHLXC4I.cjs.map +1 -0
  64. package/dist/{chunk-PK2A5WBG.js → chunk-ARAQIW6E.js} +222 -604
  65. package/dist/chunk-ARAQIW6E.js.map +1 -0
  66. package/dist/{chunk-US2U7ECW.js → chunk-BQDZIQ3G.js} +156 -90
  67. package/dist/chunk-BQDZIQ3G.js.map +1 -0
  68. package/dist/chunk-D22XABFZ.js +79 -0
  69. package/dist/chunk-D22XABFZ.js.map +1 -0
  70. package/dist/{chunk-2ULLRN4Y.js → chunk-E5BQRAJK.js} +943 -626
  71. package/dist/chunk-E5BQRAJK.js.map +1 -0
  72. package/dist/chunk-FST2G2FQ.cjs +84 -0
  73. package/dist/chunk-FST2G2FQ.cjs.map +1 -0
  74. package/dist/chunk-FVQTJUBD.cjs +2120 -0
  75. package/dist/chunk-FVQTJUBD.cjs.map +1 -0
  76. package/dist/chunk-G6E6V2Z4.js +2070 -0
  77. package/dist/chunk-G6E6V2Z4.js.map +1 -0
  78. package/dist/{chunk-7P6BNIJH.js → chunk-GIWC35YQ.js} +105 -35
  79. package/dist/chunk-GIWC35YQ.js.map +1 -0
  80. package/dist/{chunk-4JKEUSCC.cjs → chunk-H4VUIOWU.cjs} +22 -20
  81. package/dist/chunk-H4VUIOWU.cjs.map +1 -0
  82. package/dist/{chunk-TWH4PTDG.cjs → chunk-HWMMIRIF.cjs} +32 -27
  83. package/dist/chunk-HWMMIRIF.cjs.map +1 -0
  84. package/dist/chunk-IXZ2T2QX.cjs +448 -0
  85. package/dist/chunk-IXZ2T2QX.cjs.map +1 -0
  86. package/dist/chunk-L3NKIMF5.cjs +10 -0
  87. package/dist/chunk-L3NKIMF5.cjs.map +1 -0
  88. package/dist/chunk-L4JCRWDY.cjs +252 -0
  89. package/dist/chunk-L4JCRWDY.cjs.map +1 -0
  90. package/dist/{chunk-BJXKH4LG.cjs → chunk-LGB4VNZI.cjs} +43 -78
  91. package/dist/chunk-LGB4VNZI.cjs.map +1 -0
  92. package/dist/{chunk-PG5H6QIO.cjs → chunk-MLKE7HRS.cjs} +41 -21
  93. package/dist/chunk-MLKE7HRS.cjs.map +1 -0
  94. package/dist/{chunk-OEIVMCWX.js → chunk-MRRFTNF4.js} +2537 -84
  95. package/dist/chunk-MRRFTNF4.js.map +1 -0
  96. package/dist/chunk-MXBVP7HX.cjs +4842 -0
  97. package/dist/chunk-MXBVP7HX.cjs.map +1 -0
  98. package/dist/chunk-NESKUIRE.cjs +4586 -0
  99. package/dist/chunk-NESKUIRE.cjs.map +1 -0
  100. package/dist/{chunk-SVLMF4UZ.cjs → chunk-NIOEY3N3.cjs} +66 -85
  101. package/dist/chunk-NIOEY3N3.cjs.map +1 -0
  102. package/dist/{chunk-CZEJQSWB.cjs → chunk-OWIEOL55.cjs} +295 -677
  103. package/dist/chunk-OWIEOL55.cjs.map +1 -0
  104. package/dist/{chunk-WTSZBHIZ.cjs → chunk-PJAK4U6R.cjs} +24 -24
  105. package/dist/{chunk-WTSZBHIZ.cjs.map → chunk-PJAK4U6R.cjs.map} +1 -1
  106. package/dist/{chunk-52RSUALV.cjs → chunk-R5AJGM55.cjs} +1314 -995
  107. package/dist/chunk-R5AJGM55.cjs.map +1 -0
  108. package/dist/{chunk-IVV5TOMD.js → chunk-RCJLMMTO.js} +32 -12
  109. package/dist/chunk-RCJLMMTO.js.map +1 -0
  110. package/dist/{chunk-S73Z3PBJ.cjs → chunk-SZYSDJTN.cjs} +27 -28
  111. package/dist/chunk-SZYSDJTN.cjs.map +1 -0
  112. package/dist/{chunk-YC6PJEPH.cjs → chunk-U4CSOY6T.cjs} +188 -122
  113. package/dist/chunk-U4CSOY6T.cjs.map +1 -0
  114. package/dist/chunk-UBSPZTQX.js +434 -0
  115. package/dist/chunk-UBSPZTQX.js.map +1 -0
  116. package/dist/{chunk-SCUWP4II.cjs → chunk-VEPP75C4.cjs} +47 -74
  117. package/dist/chunk-VEPP75C4.cjs.map +1 -0
  118. package/dist/{chunk-JIGDJK2O.js → chunk-VETAQUW3.js} +4 -39
  119. package/dist/chunk-VETAQUW3.js.map +1 -0
  120. package/dist/{chunk-Z57R5WS4.js → chunk-WPTTKULS.js} +4 -4
  121. package/dist/{chunk-Z57R5WS4.js.map → chunk-WPTTKULS.js.map} +1 -1
  122. package/dist/{chunk-O2BJW7YA.js → chunk-WYGUWVTF.js} +5 -5
  123. package/dist/{chunk-O2BJW7YA.js.map → chunk-WYGUWVTF.js.map} +1 -1
  124. package/dist/{chunk-SXNQRJQD.js → chunk-WYWRMIQC.js} +127 -22
  125. package/dist/chunk-WYWRMIQC.js.map +1 -0
  126. package/dist/{chunk-5Q6WAYEY.cjs → chunk-X6IBA7FP.cjs} +137 -50
  127. package/dist/chunk-X6IBA7FP.cjs.map +1 -0
  128. package/dist/{chunk-MRFUISXC.cjs → chunk-Y7MZ5LJT.cjs} +2632 -179
  129. package/dist/chunk-Y7MZ5LJT.cjs.map +1 -0
  130. package/dist/{chunk-JJ5O45LH.js → chunk-YPLZDWG7.js} +32 -27
  131. package/dist/chunk-YPLZDWG7.js.map +1 -0
  132. package/dist/{chunk-MGCGWPQJ.cjs → chunk-Z55SJVEC.cjs} +8 -8
  133. package/dist/chunk-Z55SJVEC.cjs.map +1 -0
  134. package/dist/error/index.cjs +6 -6
  135. package/dist/error/index.d.ts +26 -20
  136. package/dist/error/index.d.ts.map +1 -1
  137. package/dist/error/index.js +1 -1
  138. package/dist/error/utils.d.ts +19 -5
  139. package/dist/error/utils.d.ts.map +1 -1
  140. package/dist/evals/index.cjs +4 -4
  141. package/dist/evals/index.js +1 -1
  142. package/dist/evals/run/index.d.ts +1 -1
  143. package/dist/evals/scoreTraces/index.cjs +8 -8
  144. package/dist/evals/scoreTraces/index.js +2 -2
  145. package/dist/evals/types.d.ts +1 -1
  146. package/dist/events/event-emitter.d.ts +6 -1
  147. package/dist/events/event-emitter.d.ts.map +1 -1
  148. package/dist/index.cjs +2 -2
  149. package/dist/index.js +1 -1
  150. package/dist/integration/index.cjs +2 -2
  151. package/dist/integration/index.js +1 -1
  152. package/dist/llm/index.cjs +15 -15
  153. package/dist/llm/index.d.ts +2 -2
  154. package/dist/llm/index.d.ts.map +1 -1
  155. package/dist/llm/index.js +5 -5
  156. package/dist/llm/model/aisdk/v5/model.d.ts +1 -1
  157. package/dist/llm/model/base.types.d.ts +2 -2
  158. package/dist/llm/model/model.d.ts +1 -1
  159. package/dist/llm/model/model.d.ts.map +1 -1
  160. package/dist/llm/model/model.loop.d.ts +2 -2
  161. package/dist/llm/model/model.loop.d.ts.map +1 -1
  162. package/dist/llm/model/model.loop.types.d.ts +1 -1
  163. package/dist/llm/model/model.loop.types.d.ts.map +1 -1
  164. package/dist/llm/model/provider-types.generated.d.ts +51 -11
  165. package/dist/llm/model/shared.types.d.ts +1 -1
  166. package/dist/loop/index.cjs +2 -2
  167. package/dist/loop/index.js +1 -1
  168. package/dist/loop/loop.d.ts +2 -2
  169. package/dist/loop/loop.d.ts.map +1 -1
  170. package/dist/loop/test-utils/MastraLanguageModelV2Mock.d.ts +1 -1
  171. package/dist/loop/test-utils/MastraLanguageModelV2Mock.d.ts.map +1 -1
  172. package/dist/loop/test-utils/options.d.ts.map +1 -1
  173. package/dist/loop/test-utils/streamObject.d.ts +1 -1
  174. package/dist/loop/test-utils/streamObject.d.ts.map +1 -1
  175. package/dist/loop/test-utils/tools.d.ts.map +1 -1
  176. package/dist/loop/types.d.ts +3 -1
  177. package/dist/loop/types.d.ts.map +1 -1
  178. package/dist/loop/workflows/agentic-execution/index.d.ts +13 -13
  179. package/dist/loop/workflows/agentic-execution/index.d.ts.map +1 -1
  180. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +10 -10
  181. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
  182. package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts +5 -5
  183. package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts.map +1 -1
  184. package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts +22 -21
  185. package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
  186. package/dist/loop/workflows/agentic-loop/index.d.ts +13 -13
  187. package/dist/loop/workflows/agentic-loop/index.d.ts.map +1 -1
  188. package/dist/loop/workflows/schema.d.ts +6 -6
  189. package/dist/loop/workflows/schema.d.ts.map +1 -1
  190. package/dist/loop/workflows/stream.d.ts +2 -2
  191. package/dist/loop/workflows/stream.d.ts.map +1 -1
  192. package/dist/mastra/index.cjs +2 -2
  193. package/dist/mastra/index.js +1 -1
  194. package/dist/mcp/index.cjs +4 -4
  195. package/dist/mcp/index.js +1 -1
  196. package/dist/memory/index.cjs +6 -6
  197. package/dist/memory/index.js +1 -1
  198. package/dist/memory/memory.d.ts +1 -1
  199. package/dist/memory/types.d.ts +3 -3
  200. package/dist/memory/types.d.ts.map +1 -1
  201. package/dist/models-dev-D3EKFGAO.cjs +12 -0
  202. package/dist/{models-dev-EO3SUIY2.cjs.map → models-dev-D3EKFGAO.cjs.map} +1 -1
  203. package/dist/models-dev-EO22XOXQ.js +3 -0
  204. package/dist/{models-dev-23RN2WHG.js.map → models-dev-EO22XOXQ.js.map} +1 -1
  205. package/dist/netlify-AE4LNCAI.js +3 -0
  206. package/dist/{netlify-GXJ5D5DD.js.map → netlify-AE4LNCAI.js.map} +1 -1
  207. package/dist/netlify-WE42TZIT.cjs +12 -0
  208. package/dist/{netlify-KJLY3GFS.cjs.map → netlify-WE42TZIT.cjs.map} +1 -1
  209. package/dist/processors/index.cjs +37 -37
  210. package/dist/processors/index.d.ts +2 -2
  211. package/dist/processors/index.d.ts.map +1 -1
  212. package/dist/processors/index.js +1 -1
  213. package/dist/processors/step-schema.d.ts +1267 -1267
  214. package/dist/processors/step-schema.d.ts.map +1 -1
  215. package/dist/provider-registry-6LF3NGC5.js +3 -0
  216. package/dist/{provider-registry-F67Y6OF2.js.map → provider-registry-6LF3NGC5.js.map} +1 -1
  217. package/dist/provider-registry-73FKMXJV.cjs +40 -0
  218. package/dist/{provider-registry-3TG2KUD2.cjs.map → provider-registry-73FKMXJV.cjs.map} +1 -1
  219. package/dist/provider-registry.json +100 -30
  220. package/dist/{registry-generator-UMTNPBJX.js → registry-generator-AVQXI3GX.js} +2 -2
  221. package/dist/{registry-generator-UMTNPBJX.js.map → registry-generator-AVQXI3GX.js.map} +1 -1
  222. package/dist/{registry-generator-34SC4TAU.cjs → registry-generator-KOFNIIWJ.cjs} +2 -2
  223. package/dist/{registry-generator-34SC4TAU.cjs.map → registry-generator-KOFNIIWJ.cjs.map} +1 -1
  224. package/dist/relevance/index.cjs +2 -2
  225. package/dist/relevance/index.js +1 -1
  226. package/dist/server/index.cjs +5 -5
  227. package/dist/server/index.js +1 -1
  228. package/dist/storage/base.d.ts +2 -10
  229. package/dist/storage/base.d.ts.map +1 -1
  230. package/dist/storage/domains/workflows/base.d.ts +2 -8
  231. package/dist/storage/domains/workflows/base.d.ts.map +1 -1
  232. package/dist/storage/domains/workflows/inmemory.d.ts +2 -8
  233. package/dist/storage/domains/workflows/inmemory.d.ts.map +1 -1
  234. package/dist/storage/index.cjs +38 -38
  235. package/dist/storage/index.js +1 -1
  236. package/dist/storage/mock.d.ts +2 -8
  237. package/dist/storage/mock.d.ts.map +1 -1
  238. package/dist/storage/types.d.ts +9 -1
  239. package/dist/storage/types.d.ts.map +1 -1
  240. package/dist/stream/RunOutput.d.ts +1 -1
  241. package/dist/stream/aisdk/v4/input.d.ts +1 -1
  242. package/dist/stream/aisdk/v5/compat/content.d.ts +1 -1
  243. package/dist/stream/aisdk/v5/compat/content.d.ts.map +1 -1
  244. package/dist/stream/aisdk/v5/compat/prepare-tools.d.ts +1 -1
  245. package/dist/stream/aisdk/v5/compat/prepare-tools.d.ts.map +1 -1
  246. package/dist/stream/aisdk/v5/compat/ui-message.d.ts +1 -1
  247. package/dist/stream/aisdk/v5/compat/ui-message.d.ts.map +1 -1
  248. package/dist/stream/aisdk/v5/compat/validation.d.ts +1 -1
  249. package/dist/stream/aisdk/v5/compat/validation.d.ts.map +1 -1
  250. package/dist/stream/aisdk/v5/execute.d.ts +2 -2
  251. package/dist/stream/aisdk/v5/execute.d.ts.map +1 -1
  252. package/dist/stream/aisdk/v5/input.d.ts +1 -1
  253. package/dist/stream/aisdk/v5/input.d.ts.map +1 -1
  254. package/dist/stream/aisdk/v5/output-helpers.d.ts +12 -27
  255. package/dist/stream/aisdk/v5/output-helpers.d.ts.map +1 -1
  256. package/dist/stream/aisdk/v5/output.d.ts +41 -91
  257. package/dist/stream/aisdk/v5/output.d.ts.map +1 -1
  258. package/dist/stream/aisdk/v5/transform.d.ts +1 -1
  259. package/dist/stream/aisdk/v5/transform.d.ts.map +1 -1
  260. package/dist/stream/base/input.d.ts +1 -1
  261. package/dist/stream/base/output.d.ts +9 -31
  262. package/dist/stream/base/output.d.ts.map +1 -1
  263. package/dist/stream/base/schema.d.ts +2 -2
  264. package/dist/stream/base/schema.d.ts.map +1 -1
  265. package/dist/stream/index.cjs +12 -12
  266. package/dist/stream/index.js +2 -2
  267. package/dist/stream/types.d.ts +3 -2
  268. package/dist/stream/types.d.ts.map +1 -1
  269. package/dist/test-utils/llm-mock.cjs +14587 -14
  270. package/dist/test-utils/llm-mock.cjs.map +1 -1
  271. package/dist/test-utils/llm-mock.d.ts +3 -3
  272. package/dist/test-utils/llm-mock.d.ts.map +1 -1
  273. package/dist/test-utils/llm-mock.js +14577 -4
  274. package/dist/test-utils/llm-mock.js.map +1 -1
  275. package/dist/token-6GSAFR2W-SGVIXFCP.cjs +63 -0
  276. package/dist/token-6GSAFR2W-SGVIXFCP.cjs.map +1 -0
  277. package/dist/token-6GSAFR2W-SPYPLMBM.js +61 -0
  278. package/dist/token-6GSAFR2W-SPYPLMBM.js.map +1 -0
  279. package/dist/token-util-NEHG7TUY-7GMW5FXI.cjs +10 -0
  280. package/dist/token-util-NEHG7TUY-7GMW5FXI.cjs.map +1 -0
  281. package/dist/token-util-NEHG7TUY-JRJTGTAB.js +8 -0
  282. package/dist/token-util-NEHG7TUY-JRJTGTAB.js.map +1 -0
  283. package/dist/tools/index.cjs +4 -4
  284. package/dist/tools/index.js +1 -1
  285. package/dist/tools/is-vercel-tool.cjs +2 -2
  286. package/dist/tools/is-vercel-tool.js +1 -1
  287. package/dist/tools/tool-builder/builder.d.ts +2 -1
  288. package/dist/tools/tool-builder/builder.d.ts.map +1 -1
  289. package/dist/tools/tool.d.ts.map +1 -1
  290. package/dist/tools/types.d.ts +5 -5
  291. package/dist/tools/types.d.ts.map +1 -1
  292. package/dist/utils.cjs +22 -22
  293. package/dist/utils.d.ts +3 -3
  294. package/dist/utils.d.ts.map +1 -1
  295. package/dist/utils.js +1 -1
  296. package/dist/vector/embed.d.ts +2 -2
  297. package/dist/vector/embed.d.ts.map +1 -1
  298. package/dist/vector/index.cjs +11 -11
  299. package/dist/vector/index.js +3 -3
  300. package/dist/vector/vector.d.ts +1 -1
  301. package/dist/voice/aisdk/speech.d.ts +1 -1
  302. package/dist/voice/aisdk/speech.d.ts.map +1 -1
  303. package/dist/voice/aisdk/transcription.d.ts +1 -1
  304. package/dist/voice/aisdk/transcription.d.ts.map +1 -1
  305. package/dist/voice/composite-voice.d.ts +1 -1
  306. package/dist/voice/composite-voice.d.ts.map +1 -1
  307. package/dist/voice/index.cjs +6 -6
  308. package/dist/voice/index.js +1 -1
  309. package/dist/workflows/constants.cjs +4 -4
  310. package/dist/workflows/constants.d.ts +1 -1
  311. package/dist/workflows/constants.d.ts.map +1 -1
  312. package/dist/workflows/constants.js +1 -1
  313. package/dist/workflows/default.d.ts +9 -16
  314. package/dist/workflows/default.d.ts.map +1 -1
  315. package/dist/workflows/evented/execution-engine.d.ts +3 -2
  316. package/dist/workflows/evented/execution-engine.d.ts.map +1 -1
  317. package/dist/workflows/evented/index.cjs +10 -10
  318. package/dist/workflows/evented/index.js +1 -1
  319. package/dist/workflows/evented/step-executor.d.ts +1 -1
  320. package/dist/workflows/evented/step-executor.d.ts.map +1 -1
  321. package/dist/workflows/evented/workflow-event-processor/index.d.ts +1 -1
  322. package/dist/workflows/evented/workflow-event-processor/index.d.ts.map +1 -1
  323. package/dist/workflows/evented/workflow.d.ts +15 -0
  324. package/dist/workflows/evented/workflow.d.ts.map +1 -1
  325. package/dist/workflows/execution-engine.d.ts +25 -2
  326. package/dist/workflows/execution-engine.d.ts.map +1 -1
  327. package/dist/workflows/handlers/control-flow.d.ts +6 -5
  328. package/dist/workflows/handlers/control-flow.d.ts.map +1 -1
  329. package/dist/workflows/handlers/entry.d.ts +5 -3
  330. package/dist/workflows/handlers/entry.d.ts.map +1 -1
  331. package/dist/workflows/handlers/sleep.d.ts +4 -3
  332. package/dist/workflows/handlers/sleep.d.ts.map +1 -1
  333. package/dist/workflows/handlers/step.d.ts +5 -3
  334. package/dist/workflows/handlers/step.d.ts.map +1 -1
  335. package/dist/workflows/index.cjs +26 -22
  336. package/dist/workflows/index.js +1 -1
  337. package/dist/workflows/step.d.ts +5 -4
  338. package/dist/workflows/step.d.ts.map +1 -1
  339. package/dist/workflows/types.d.ts +66 -14
  340. package/dist/workflows/types.d.ts.map +1 -1
  341. package/dist/workflows/utils.d.ts +11 -0
  342. package/dist/workflows/utils.d.ts.map +1 -1
  343. package/dist/workflows/workflow.d.ts +26 -8
  344. package/dist/workflows/workflow.d.ts.map +1 -1
  345. package/package.json +12 -11
  346. package/src/llm/model/provider-types.generated.d.ts +51 -11
  347. package/dist/agent/__tests__/mock-model.d.ts +0 -8
  348. package/dist/agent/__tests__/mock-model.d.ts.map +0 -1
  349. package/dist/agent/agent-types.test-d.d.ts +0 -2
  350. package/dist/agent/agent-types.test-d.d.ts.map +0 -1
  351. package/dist/ai-sdk.types.d.ts +0 -4705
  352. package/dist/chunk-2ULLRN4Y.js.map +0 -1
  353. package/dist/chunk-3E3ILV6T.cjs +0 -518
  354. package/dist/chunk-3E3ILV6T.cjs.map +0 -1
  355. package/dist/chunk-4JKEUSCC.cjs.map +0 -1
  356. package/dist/chunk-52RSUALV.cjs.map +0 -1
  357. package/dist/chunk-5PAEYE3Q.js +0 -513
  358. package/dist/chunk-5PAEYE3Q.js.map +0 -1
  359. package/dist/chunk-5Q6WAYEY.cjs.map +0 -1
  360. package/dist/chunk-7P6BNIJH.js.map +0 -1
  361. package/dist/chunk-ABJOUEVA.cjs +0 -10
  362. package/dist/chunk-ABJOUEVA.cjs.map +0 -1
  363. package/dist/chunk-BJXKH4LG.cjs.map +0 -1
  364. package/dist/chunk-BUKY6CTR.cjs.map +0 -1
  365. package/dist/chunk-C36YRTZ6.js.map +0 -1
  366. package/dist/chunk-CZEJQSWB.cjs.map +0 -1
  367. package/dist/chunk-IVV5TOMD.js.map +0 -1
  368. package/dist/chunk-JIGDJK2O.js.map +0 -1
  369. package/dist/chunk-JJ5O45LH.js.map +0 -1
  370. package/dist/chunk-MGCGWPQJ.cjs.map +0 -1
  371. package/dist/chunk-MRFUISXC.cjs.map +0 -1
  372. package/dist/chunk-NLNKQD2T.js +0 -7
  373. package/dist/chunk-NLNKQD2T.js.map +0 -1
  374. package/dist/chunk-OEIVMCWX.js.map +0 -1
  375. package/dist/chunk-PG5H6QIO.cjs.map +0 -1
  376. package/dist/chunk-PK2A5WBG.js.map +0 -1
  377. package/dist/chunk-QM5SRDJX.js.map +0 -1
  378. package/dist/chunk-S73Z3PBJ.cjs.map +0 -1
  379. package/dist/chunk-SCUWP4II.cjs.map +0 -1
  380. package/dist/chunk-SVLMF4UZ.cjs.map +0 -1
  381. package/dist/chunk-SXNQRJQD.js.map +0 -1
  382. package/dist/chunk-THZTRBFS.js.map +0 -1
  383. package/dist/chunk-TWH4PTDG.cjs.map +0 -1
  384. package/dist/chunk-U3XOLEPX.js.map +0 -1
  385. package/dist/chunk-US2U7ECW.js.map +0 -1
  386. package/dist/chunk-YC6PJEPH.cjs.map +0 -1
  387. package/dist/models-dev-23RN2WHG.js +0 -3
  388. package/dist/models-dev-EO3SUIY2.cjs +0 -12
  389. package/dist/netlify-GXJ5D5DD.js +0 -3
  390. package/dist/netlify-KJLY3GFS.cjs +0 -12
  391. package/dist/provider-registry-3TG2KUD2.cjs +0 -40
  392. package/dist/provider-registry-F67Y6OF2.js +0 -3
  393. package/dist/tools/tool-stream-types.test-d.d.ts +0 -2
  394. package/dist/tools/tool-stream-types.test-d.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,178 @@
1
1
  # @mastra/core
2
2
 
3
+ ## 1.0.0-beta.13
4
+
5
+ ### Patch Changes
6
+
7
+ - Add `onFinish` and `onError` lifecycle callbacks to workflow options ([#11200](https://github.com/mastra-ai/mastra/pull/11200))
8
+
9
+ Workflows now support lifecycle callbacks for server-side handling of workflow completion and errors:
10
+ - `onFinish`: Called when workflow completes with any status (success, failed, suspended, tripwire)
11
+ - `onError`: Called only when workflow fails (failed or tripwire status)
12
+
13
+ ```typescript
14
+ const workflow = createWorkflow({
15
+ id: 'my-workflow',
16
+ inputSchema: z.object({ ... }),
17
+ outputSchema: z.object({ ... }),
18
+ options: {
19
+ onFinish: async (result) => {
20
+ // Handle any workflow completion
21
+ await updateJobStatus(result.status);
22
+ },
23
+ onError: async (errorInfo) => {
24
+ // Handle workflow failures
25
+ await logError(errorInfo.error);
26
+ },
27
+ },
28
+ });
29
+ ```
30
+
31
+ Both callbacks support sync and async functions. Callback errors are caught and logged, not propagated to the workflow result.
32
+
33
+ ## 1.0.0-beta.12
34
+
35
+ ### Patch Changes
36
+
37
+ - Remove redundant toolCalls from network agent finalResult ([#11189](https://github.com/mastra-ai/mastra/pull/11189))
38
+
39
+ The network agent's `finalResult` was storing `toolCalls` separately even though all tool call information is already present in the `messages` array (as `tool-call` and `tool-result` type messages). This caused significant token waste since the routing agent reads this data from memory on every iteration.
40
+
41
+ **Before:** `finalResult: { text, toolCalls, messages }`
42
+ **After:** `finalResult: { text, messages }`
43
+
44
+ +**Migration:** If you were accessing `finalResult.toolCalls`, retrieve tool calls from `finalResult.messages` by filtering for messages with `type: 'tool-call'`.
45
+
46
+ Updated `@mastra/react` to extract tool calls directly from the `messages` array instead of the removed `toolCalls` field when resolving initial messages from memory.
47
+
48
+ Fixes #11059
49
+
50
+ - Embed AI types to fix peerdeps mismatches ([`9650cce`](https://github.com/mastra-ai/mastra/commit/9650cce52a1d917ff9114653398e2a0f5c3ba808))
51
+
52
+ - Fix invalid state: Controller is already closed ([`932d63d`](https://github.com/mastra-ai/mastra/commit/932d63dd51be9c8bf1e00e3671fe65606c6fb9cd))
53
+
54
+ Fixes #11005
55
+
56
+ - Fix HITL (Human-In-The-Loop) tool execution bug when mixing tools with and without execute functions. ([#11178](https://github.com/mastra-ai/mastra/pull/11178))
57
+
58
+ When an agent called multiple tools simultaneously where some had `execute` functions and others didn't (HITL tools expecting `addToolResult` from the frontend), the HITL tools would incorrectly receive `result: undefined` and be marked as "output-available" instead of "input-available". This caused the agent to continue instead of pausing for user input.
59
+
60
+ - Add resourceId to workflow routes ([#11166](https://github.com/mastra-ai/mastra/pull/11166))
61
+
62
+ - Auto resume suspended tools if `autoResumeSuspendedTools: true` ([#11157](https://github.com/mastra-ai/mastra/pull/11157))
63
+
64
+ The flag can be added to `defaultAgentOptions` when creating the agent or to options in `agent.stream` or `agent.generate`
65
+
66
+ ```typescript
67
+ const agent = new Agent({
68
+ //...agent information,
69
+ defaultAgentOptions: {
70
+ autoResumeSuspendedTools: true,
71
+ },
72
+ });
73
+ ```
74
+
75
+ - Preserve error details when thrown from workflow steps ([#10992](https://github.com/mastra-ai/mastra/pull/10992))
76
+ - Errors thrown in workflow steps now preserve full error details including `cause` chain and custom properties
77
+ - Added `SerializedError` type with proper cause chain support
78
+ - Added `SerializedStepResult` and `SerializedStepFailure` types for handling errors loaded from storage
79
+ - Enhanced `addErrorToJSON` to recursively serialize error cause chains with max depth protection
80
+ - Added `hydrateSerializedStepErrors` to convert serialized errors back to Error instances
81
+ - Fixed Inngest workflow error handling to extract original error from `NonRetriableError.cause`
82
+
83
+ - Move `@ai-sdk/azure` to devDependencies ([#10218](https://github.com/mastra-ai/mastra/pull/10218))
84
+
85
+ - Refactor internal event system from Emitter to PubSub abstraction for workflow event handling. This change replaces the EventEmitter-based event system with a pluggable PubSub interface, enabling support for distributed workflow execution backends like Inngest. Adds `close()` method to PubSub implementations for proper cleanup. ([#11052](https://github.com/mastra-ai/mastra/pull/11052))
86
+
87
+ - Add `startAsync()` method and fix Inngest duplicate workflow execution bug ([#11093](https://github.com/mastra-ai/mastra/pull/11093))
88
+
89
+ **New Feature: `startAsync()` for fire-and-forget workflow execution**
90
+ - Add `Run.startAsync()` to base workflow class - starts workflow in background and returns `{ runId }` immediately
91
+ - Add `EventedRun.startAsync()` - publishes workflow start event without subscribing for completion
92
+ - Add `InngestRun.startAsync()` - sends Inngest event without polling for result
93
+
94
+ **Bug Fix: Prevent duplicate Inngest workflow executions**
95
+ - Fix `getRuns()` to properly handle rate limits (429), empty responses, and JSON parse errors with retry logic and exponential backoff
96
+ - Fix `getRunOutput()` to throw `NonRetriableError` when polling fails, preventing Inngest from retrying the parent function and re-triggering the workflow
97
+ - Add timeout to `getRunOutput()` polling (default 5 minutes) with `NonRetriableError` on timeout
98
+
99
+ This fixes a production issue where polling failures after successful workflow completion caused Inngest to retry the parent function, which fired a new workflow event and resulted in duplicate executions (e.g., duplicate Slack messages).
100
+
101
+ - Preserve error details when thrown from workflow steps ([#10992](https://github.com/mastra-ai/mastra/pull/10992))
102
+
103
+ Workflow errors now retain custom properties like `statusCode`, `responseHeaders`, and `cause` chains. This enables error-specific recovery logic in your applications.
104
+
105
+ **Before:**
106
+
107
+ ```typescript
108
+ const result = await workflow.execute({ input });
109
+ if (result.status === 'failed') {
110
+ // Custom error properties were lost
111
+ console.log(result.error); // "Step execution failed" (just a string)
112
+ }
113
+ ```
114
+
115
+ **After:**
116
+
117
+ ```typescript
118
+ const result = await workflow.execute({ input });
119
+ if (result.status === 'failed') {
120
+ // Custom properties are preserved
121
+ console.log(result.error.message); // "Step execution failed"
122
+ console.log(result.error.statusCode); // 429
123
+ console.log(result.error.cause?.name); // "RateLimitError"
124
+ }
125
+ ```
126
+
127
+ **Type change:** `WorkflowState.error` and `WorkflowRunState.error` types changed from `string | Error` to `SerializedError`.
128
+
129
+ Other changes:
130
+ - Added `UpdateWorkflowStateOptions` type for workflow state updates
131
+
132
+ - Fix Zod 4 compatibility issue with structuredOutput in agent.generate() ([#11133](https://github.com/mastra-ai/mastra/pull/11133))
133
+
134
+ Users with Zod 4 installed would see `TypeError: undefined is not an object (evaluating 'def.valueType._zod')` when using `structuredOutput` with agent.generate(). This happened because ProcessorStepSchema contains `z.custom()` fields that hold user-provided Zod schemas, and the workflow validation was trying to deeply validate these schemas causing version conflicts.
135
+
136
+ The fix disables input validation for processor workflows since `z.custom()` fields are meant to pass through arbitrary types without deep validation.
137
+
138
+ - Truncate map config when too long ([#11175](https://github.com/mastra-ai/mastra/pull/11175))
139
+
140
+ - Add helpful JSDoc comments to `BundlerConfig` properties (used with `bundler` option) ([#10218](https://github.com/mastra-ai/mastra/pull/10218))
141
+
142
+ - Fixes .network() method ignores MASTRA_RESOURCE_ID_KEY from requestContext ([`4524734`](https://github.com/mastra-ai/mastra/commit/45247343e384717a7c8404296275c56201d6470f))
143
+
144
+ - fix: make getSqlType consistent across storage adapters ([#11112](https://github.com/mastra-ai/mastra/pull/11112))
145
+ - PostgreSQL: use `getSqlType()` in `createTable` instead of `toUpperCase()`
146
+ - LibSQL: use `getSqlType()` in `createTable`, return `JSONB` for jsonb type (matches SQLite 3.45+ support)
147
+ - ClickHouse: use `getSqlType()` in `createTable` instead of `COLUMN_TYPES` constant, add missing types (uuid, float, boolean)
148
+ - Remove unused `getSqlType()` and `getDefaultValue()` from `MastraStorage` base class (all stores use `StoreOperations` versions)
149
+
150
+ - Fix workflow cancel not updating status when workflow is suspended ([#11139](https://github.com/mastra-ai/mastra/pull/11139))
151
+ - `Run.cancel()` now updates workflow status to 'canceled' in storage, resolving the issue where suspended workflows remained in 'suspended' status after cancellation
152
+ - Cancellation status is immediately persisted and reflected to observers
153
+
154
+ - What changed: ([#10998](https://github.com/mastra-ai/mastra/pull/10998))
155
+
156
+ Support for sequential tool execution was added. Tool call concurrency is now set conditionally, defaulting to 1 when sequential execution is needed (to avoid race conditions that interfere with human-in-the-loop approval during the workflow) rather than the default of 10 when concurrency is acceptable.
157
+
158
+ How it was changed:
159
+
160
+ A `sequentialExecutionRequired` constant was set to a boolean depending on whether any of the tools involved in a returned agentic execution workflow would require approval. If any tool has a 'suspendSchema' property (used for conditionally suspending execution and waiting for human input), or if they have their `requireApproval` property set to `true`, then the concurrency property used in the toolCallStep is set to 1, causing sequential execution. The old default of 10 remains otherwise.
161
+
162
+ - Fixed duplicate assistant messages appearing when using `useChat` with memory enabled. ([#11195](https://github.com/mastra-ai/mastra/pull/11195))
163
+
164
+ **What was happening:** When using `useChat` with `chatRoute` and memory, assistant messages were being duplicated in storage after multiple conversation turns. This occurred because the backend-generated message ID wasn't being sent back to `useChat`, causing ID mismatches during deduplication.
165
+
166
+ **What changed:**
167
+ - The backend now sends the assistant message ID in the stream's start event, so `useChat` uses the same ID as storage
168
+ - Custom `data-*` parts (from `writer.custom()`) are now preserved when messages contain V5 tool parts
169
+
170
+ Fixes #11091
171
+
172
+ - Updated dependencies [[`9650cce`](https://github.com/mastra-ai/mastra/commit/9650cce52a1d917ff9114653398e2a0f5c3ba808), [`5a632bd`](https://github.com/mastra-ai/mastra/commit/5a632bdf7b78953b664f5e038e98d4ba5f971e47)]:
173
+ - @mastra/schema-compat@1.0.0-beta.3
174
+ - @mastra/observability@1.0.0-beta.5
175
+
3
176
  ## 1.0.0-beta.11
4
177
 
5
178
  ### Minor Changes