@mastra/core 0.0.0-error-handler-fix-20251020202607 → 0.0.0-export-agent-memory-from-local-studio-20251112153946

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 (815) hide show
  1. package/CHANGELOG.md +1407 -1
  2. package/README.md +2 -3
  3. package/agent/message-list.d.ts +1 -0
  4. package/dist/action/index.d.ts +0 -2
  5. package/dist/action/index.d.ts.map +1 -1
  6. package/dist/agent/__tests__/mock-model.d.ts +3 -1
  7. package/dist/agent/__tests__/mock-model.d.ts.map +1 -1
  8. package/dist/agent/agent-legacy.d.ts +176 -0
  9. package/dist/agent/agent-legacy.d.ts.map +1 -0
  10. package/dist/agent/agent.d.ts +93 -228
  11. package/dist/agent/agent.d.ts.map +1 -1
  12. package/dist/agent/agent.types.d.ts +16 -26
  13. package/dist/agent/agent.types.d.ts.map +1 -1
  14. package/dist/agent/index.cjs +10 -26
  15. package/dist/agent/index.d.ts +1 -2
  16. package/dist/agent/index.d.ts.map +1 -1
  17. package/dist/agent/index.js +2 -2
  18. package/dist/agent/message-list/index.cjs +16 -0
  19. package/dist/agent/message-list/index.d.ts +107 -85
  20. package/dist/agent/message-list/index.d.ts.map +1 -1
  21. package/dist/agent/message-list/index.js +3 -0
  22. package/dist/agent/message-list/prompt/attachments-to-parts.d.ts +2 -2
  23. package/dist/agent/message-list/prompt/attachments-to-parts.d.ts.map +1 -1
  24. package/dist/agent/message-list/prompt/convert-to-mastra-v1.d.ts +2 -2
  25. package/dist/agent/message-list/prompt/download-assets.d.ts.map +1 -1
  26. package/dist/agent/message-list/prompt/invalid-content-error.d.ts +1 -1
  27. package/dist/agent/message-list/prompt/invalid-content-error.d.ts.map +1 -1
  28. package/dist/agent/message-list/types.d.ts +2 -1
  29. package/dist/agent/message-list/types.d.ts.map +1 -1
  30. package/dist/agent/message-list/utils/ai-v4-v5/core-model-message.d.ts +3 -2
  31. package/dist/agent/message-list/utils/ai-v4-v5/core-model-message.d.ts.map +1 -1
  32. package/dist/agent/message-list/utils/ai-v4-v5/ui-message.d.ts +3 -2
  33. package/dist/agent/message-list/utils/ai-v4-v5/ui-message.d.ts.map +1 -1
  34. package/dist/agent/message-list/utils/ai-v5/gemini-compatibility.d.ts +1 -1
  35. package/dist/agent/message-list/utils/ai-v5/gemini-compatibility.d.ts.map +1 -1
  36. package/dist/agent/message-list/utils/convert-messages.d.ts +4 -4
  37. package/dist/agent/message-list/utils/convert-messages.d.ts.map +1 -1
  38. package/dist/agent/test-utils.d.ts +2 -78
  39. package/dist/agent/test-utils.d.ts.map +1 -1
  40. package/dist/agent/trip-wire.d.ts +1 -1
  41. package/dist/agent/trip-wire.d.ts.map +1 -1
  42. package/dist/agent/types.d.ts +29 -38
  43. package/dist/agent/types.d.ts.map +1 -1
  44. package/dist/agent/utils.d.ts +16 -71
  45. package/dist/agent/utils.d.ts.map +1 -1
  46. package/dist/agent/workflows/prepare-stream/index.d.ts +21 -21
  47. package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
  48. package/dist/agent/workflows/prepare-stream/map-results-step.d.ts +5 -7
  49. package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
  50. package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts +14 -18
  51. package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts.map +1 -1
  52. package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts +6 -6
  53. package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts.map +1 -1
  54. package/dist/agent/workflows/prepare-stream/schema.d.ts +10 -12
  55. package/dist/agent/workflows/prepare-stream/schema.d.ts.map +1 -1
  56. package/dist/agent/workflows/prepare-stream/stream-step.d.ts +8 -8
  57. package/dist/agent/workflows/prepare-stream/stream-step.d.ts.map +1 -1
  58. package/dist/ai-sdk.types.d.ts +4705 -0
  59. package/dist/base.cjs +2 -2
  60. package/dist/base.d.ts +0 -16
  61. package/dist/base.d.ts.map +1 -1
  62. package/dist/base.js +1 -1
  63. package/dist/bundler/index.cjs +2 -2
  64. package/dist/bundler/index.d.ts +2 -1
  65. package/dist/bundler/index.d.ts.map +1 -1
  66. package/dist/bundler/index.js +1 -1
  67. package/dist/cache/index.cjs +3 -3
  68. package/dist/cache/index.js +1 -1
  69. package/dist/chunk-377B6NIM.cjs +2081 -0
  70. package/dist/chunk-377B6NIM.cjs.map +1 -0
  71. package/dist/chunk-4CDL2QJT.js +649 -0
  72. package/dist/chunk-4CDL2QJT.js.map +1 -0
  73. package/dist/chunk-5WRI5ZAA.js +29 -0
  74. package/dist/{chunk-3HXBPDKN.js.map → chunk-5WRI5ZAA.js.map} +1 -1
  75. package/dist/{chunk-2PQWCKU6.js → chunk-76K3IYWM.js} +5 -5
  76. package/dist/chunk-76K3IYWM.js.map +1 -0
  77. package/dist/{chunk-MHRMVYW3.js → chunk-77PRMZ44.js} +345 -415
  78. package/dist/chunk-77PRMZ44.js.map +1 -0
  79. package/dist/chunk-7AHYOMHJ.js +149 -0
  80. package/dist/chunk-7AHYOMHJ.js.map +1 -0
  81. package/dist/{chunk-354M64D6.cjs → chunk-BMAFVZ2D.cjs} +5 -5
  82. package/dist/chunk-BMAFVZ2D.cjs.map +1 -0
  83. package/dist/chunk-CB575O6L.cjs +12432 -0
  84. package/dist/chunk-CB575O6L.cjs.map +1 -0
  85. package/dist/{chunk-6TEQIYXV.cjs → chunk-CBAB7GOD.cjs} +15 -15
  86. package/dist/chunk-CBAB7GOD.cjs.map +1 -0
  87. package/dist/{chunk-A5KDVZDL.cjs → chunk-DSNPWVIG.cjs} +9 -9
  88. package/dist/chunk-DSNPWVIG.cjs.map +1 -0
  89. package/dist/chunk-DZUJEN5N.cjs +32 -0
  90. package/dist/{chunk-EBVYYC2Q.cjs.map → chunk-DZUJEN5N.cjs.map} +1 -1
  91. package/dist/chunk-E7K4FTLN.cjs +273 -0
  92. package/dist/chunk-E7K4FTLN.cjs.map +1 -0
  93. package/dist/{chunk-5F7MATUC.cjs → chunk-ECFXGXWO.cjs} +660 -644
  94. package/dist/chunk-ECFXGXWO.cjs.map +1 -0
  95. package/dist/chunk-ET6UOTTU.cjs +154 -0
  96. package/dist/chunk-ET6UOTTU.cjs.map +1 -0
  97. package/dist/{chunk-HLRWYUFN.js → chunk-GRBGQ2GE.js} +5 -5
  98. package/dist/{chunk-HLRWYUFN.js.map → chunk-GRBGQ2GE.js.map} +1 -1
  99. package/dist/chunk-HCVK5LKS.js +2052 -0
  100. package/dist/chunk-HCVK5LKS.js.map +1 -0
  101. package/dist/chunk-HDJFSJCK.js +2237 -0
  102. package/dist/chunk-HDJFSJCK.js.map +1 -0
  103. package/dist/{chunk-GD7XNW2E.cjs → chunk-HR5ESJHP.cjs} +774 -560
  104. package/dist/chunk-HR5ESJHP.cjs.map +1 -0
  105. package/dist/{chunk-VQLW7LPO.js → chunk-I4CXL4SR.js} +6 -9
  106. package/dist/chunk-I4CXL4SR.js.map +1 -0
  107. package/dist/{chunk-YGL6E6PD.cjs → chunk-IQO7ANVS.cjs} +18 -21
  108. package/dist/chunk-IQO7ANVS.cjs.map +1 -0
  109. package/dist/{chunk-GPWMM745.cjs → chunk-J7O6WENZ.cjs} +5 -5
  110. package/dist/{chunk-GPWMM745.cjs.map → chunk-J7O6WENZ.cjs.map} +1 -1
  111. package/dist/chunk-JFUQM7AI.cjs +16025 -0
  112. package/dist/chunk-JFUQM7AI.cjs.map +1 -0
  113. package/dist/{chunk-T3JFFQH2.js → chunk-JJ5O45LH.js} +72 -4
  114. package/dist/chunk-JJ5O45LH.js.map +1 -0
  115. package/dist/chunk-JPGVRWWL.js +12385 -0
  116. package/dist/chunk-JPGVRWWL.js.map +1 -0
  117. package/dist/{chunk-QRYRUZWZ.js → chunk-JV2KH24V.js} +650 -633
  118. package/dist/chunk-JV2KH24V.js.map +1 -0
  119. package/dist/chunk-KEXGB7FK.cjs +29 -0
  120. package/dist/chunk-KEXGB7FK.cjs.map +1 -0
  121. package/dist/chunk-KIZIOFZC.js +265 -0
  122. package/dist/chunk-KIZIOFZC.js.map +1 -0
  123. package/dist/{chunk-UXG7PYML.js → chunk-KJ2SW6VA.js} +9 -9
  124. package/dist/chunk-KJ2SW6VA.js.map +1 -0
  125. package/dist/{chunk-TTELJD4F.js → chunk-L54GIUCB.js} +2 -2
  126. package/dist/chunk-L54GIUCB.js.map +1 -0
  127. package/dist/chunk-LGT5WX6T.js +15961 -0
  128. package/dist/chunk-LGT5WX6T.js.map +1 -0
  129. package/dist/{chunk-6PQXZBBT.js → chunk-LT2MFKA5.js} +751 -539
  130. package/dist/chunk-LT2MFKA5.js.map +1 -0
  131. package/dist/chunk-LWBQ4P4N.cjs +2240 -0
  132. package/dist/chunk-LWBQ4P4N.cjs.map +1 -0
  133. package/dist/{chunk-TSNDVBUU.cjs → chunk-MR7ZWBL6.cjs} +2 -2
  134. package/dist/chunk-MR7ZWBL6.cjs.map +1 -0
  135. package/dist/{chunk-3NTOFNIU.js → chunk-OJNJA5ZI.js} +3 -3
  136. package/dist/{chunk-3NTOFNIU.js.map → chunk-OJNJA5ZI.js.map} +1 -1
  137. package/dist/{chunk-A4PALPHY.js → chunk-PNGUCI3U.js} +45 -32
  138. package/dist/chunk-PNGUCI3U.js.map +1 -0
  139. package/dist/chunk-QM5SRDJX.js +9022 -0
  140. package/dist/chunk-QM5SRDJX.js.map +1 -0
  141. package/dist/{chunk-I7KJDXUK.cjs → chunk-QUKUN6NR.cjs} +32 -66
  142. package/dist/chunk-QUKUN6NR.cjs.map +1 -0
  143. package/dist/chunk-S6URFGCZ.js +27 -0
  144. package/dist/chunk-S6URFGCZ.js.map +1 -0
  145. package/dist/chunk-SVLMF4UZ.cjs +9033 -0
  146. package/dist/chunk-SVLMF4UZ.cjs.map +1 -0
  147. package/dist/{chunk-ZMELUU72.js → chunk-TQTAMPSC.js} +3 -3
  148. package/dist/chunk-TQTAMPSC.js.map +1 -0
  149. package/dist/{chunk-WM4VQWOZ.cjs → chunk-TWH4PTDG.cjs} +72 -4
  150. package/dist/chunk-TWH4PTDG.cjs.map +1 -0
  151. package/dist/{chunk-LBEV3YZ2.js → chunk-UIZSWUKP.js} +15 -50
  152. package/dist/chunk-UIZSWUKP.js.map +1 -0
  153. package/dist/{chunk-HVNCJ6ED.cjs → chunk-VOY2RXOC.cjs} +69 -92
  154. package/dist/chunk-VOY2RXOC.cjs.map +1 -0
  155. package/dist/chunk-WM6CK2F3.cjs +674 -0
  156. package/dist/chunk-WM6CK2F3.cjs.map +1 -0
  157. package/dist/{chunk-YJVDEYZS.js → chunk-WWOLYOH3.js} +1653 -1406
  158. package/dist/chunk-WWOLYOH3.js.map +1 -0
  159. package/dist/{chunk-PFXXH2RP.js → chunk-X7JMA3IY.js} +15 -15
  160. package/dist/chunk-X7JMA3IY.js.map +1 -0
  161. package/dist/{chunk-SPZ7SY6U.js → chunk-XEVG546F.js} +47 -70
  162. package/dist/chunk-XEVG546F.js.map +1 -0
  163. package/dist/{chunk-ZZHNF46L.cjs → chunk-XEZ7QW4P.cjs} +1663 -1416
  164. package/dist/chunk-XEZ7QW4P.cjs.map +1 -0
  165. package/dist/{chunk-RJG3COK3.cjs → chunk-Y24C4D2D.cjs} +63 -50
  166. package/dist/chunk-Y24C4D2D.cjs.map +1 -0
  167. package/dist/{chunk-QFF5JUKT.cjs → chunk-Y63IFHEZ.cjs} +4 -4
  168. package/dist/chunk-Y63IFHEZ.cjs.map +1 -0
  169. package/dist/{chunk-B7V6NYWH.cjs → chunk-Y6ROD72V.cjs} +4 -4
  170. package/dist/{chunk-B7V6NYWH.cjs.map → chunk-Y6ROD72V.cjs.map} +1 -1
  171. package/dist/{chunk-L7JDWJQA.cjs → chunk-Y7Z433VC.cjs} +359 -429
  172. package/dist/chunk-Y7Z433VC.cjs.map +1 -0
  173. package/dist/deployer/index.cjs +8 -6
  174. package/dist/deployer/index.cjs.map +1 -1
  175. package/dist/deployer/index.js +10 -1
  176. package/dist/deployer/index.js.map +1 -1
  177. package/dist/di/index.cjs +3 -3
  178. package/dist/di/index.d.ts +1 -1
  179. package/dist/di/index.js +1 -1
  180. package/dist/error/index.cjs +9 -5
  181. package/dist/error/index.d.ts +1 -2
  182. package/dist/error/index.d.ts.map +1 -1
  183. package/dist/error/index.js +1 -1
  184. package/dist/error/utils.d.ts +28 -0
  185. package/dist/error/utils.d.ts.map +1 -1
  186. package/dist/{scores → evals}/base.d.ts +20 -18
  187. package/dist/evals/base.d.ts.map +1 -0
  188. package/dist/{scores → evals}/base.test-utils.d.ts +25 -25
  189. package/dist/evals/base.test-utils.d.ts.map +1 -0
  190. package/dist/{scores → evals}/hooks.d.ts +3 -3
  191. package/dist/evals/hooks.d.ts.map +1 -0
  192. package/dist/evals/index.cjs +37 -0
  193. package/dist/evals/index.d.ts +4 -0
  194. package/dist/evals/index.d.ts.map +1 -0
  195. package/dist/evals/index.js +4 -0
  196. package/dist/{scores/run-experiment → evals/run}/index.d.ts +18 -18
  197. package/dist/evals/run/index.d.ts.map +1 -0
  198. package/dist/evals/run/scorerAccumulator.d.ts.map +1 -0
  199. package/dist/{scores → evals}/scoreTraces/index.cjs +81 -101
  200. package/dist/evals/scoreTraces/index.cjs.map +1 -0
  201. package/dist/evals/scoreTraces/index.d.ts.map +1 -0
  202. package/dist/{scores → evals}/scoreTraces/index.js +74 -94
  203. package/dist/evals/scoreTraces/index.js.map +1 -0
  204. package/dist/{scores → evals}/scoreTraces/scoreTraces.d.ts +2 -2
  205. package/dist/evals/scoreTraces/scoreTraces.d.ts.map +1 -0
  206. package/dist/{scores → evals}/scoreTraces/scoreTracesWorkflow.d.ts +11 -11
  207. package/dist/evals/scoreTraces/scoreTracesWorkflow.d.ts.map +1 -0
  208. package/dist/{scores → evals}/scoreTraces/utils.d.ts +7 -7
  209. package/dist/evals/scoreTraces/utils.d.ts.map +1 -0
  210. package/dist/{scores → evals}/types.d.ts +22 -22
  211. package/dist/evals/types.d.ts.map +1 -0
  212. package/dist/features/index.cjs +8 -0
  213. package/dist/features/index.cjs.map +1 -0
  214. package/dist/features/index.d.ts +17 -0
  215. package/dist/features/index.d.ts.map +1 -0
  216. package/dist/features/index.js +6 -0
  217. package/dist/features/index.js.map +1 -0
  218. package/dist/hooks/index.cjs +4 -4
  219. package/dist/hooks/index.d.ts +1 -27
  220. package/dist/hooks/index.d.ts.map +1 -1
  221. package/dist/hooks/index.js +1 -1
  222. package/dist/index.cjs +2 -332
  223. package/dist/index.cjs.map +1 -1
  224. package/dist/index.d.ts +1 -18
  225. package/dist/index.d.ts.map +1 -1
  226. package/dist/index.js +1 -113
  227. package/dist/index.js.map +1 -1
  228. package/dist/integration/index.cjs +87 -10
  229. package/dist/integration/index.cjs.map +1 -1
  230. package/dist/integration/index.js +88 -1
  231. package/dist/integration/index.js.map +1 -1
  232. package/dist/integration/integration.d.ts +3 -3
  233. package/dist/integration/integration.d.ts.map +1 -1
  234. package/dist/llm/index.cjs +7 -7
  235. package/dist/llm/index.d.ts +5 -6
  236. package/dist/llm/index.d.ts.map +1 -1
  237. package/dist/llm/index.js +1 -1
  238. package/dist/llm/model/base.types.d.ts +6 -7
  239. package/dist/llm/model/base.types.d.ts.map +1 -1
  240. package/dist/llm/model/gateways/constants.d.ts.map +1 -1
  241. package/dist/llm/model/gateways/models-dev.d.ts.map +1 -1
  242. package/dist/llm/model/model.d.ts +7 -7
  243. package/dist/llm/model/model.d.ts.map +1 -1
  244. package/dist/llm/model/model.loop.d.ts +1 -1
  245. package/dist/llm/model/model.loop.d.ts.map +1 -1
  246. package/dist/llm/model/model.loop.types.d.ts +3 -3
  247. package/dist/llm/model/model.loop.types.d.ts.map +1 -1
  248. package/dist/llm/model/provider-registry.d.ts.map +1 -1
  249. package/dist/llm/model/provider-types.generated.d.ts +656 -568
  250. package/dist/llm/model/resolve-model.d.ts +8 -8
  251. package/dist/llm/model/shared.types.d.ts +2 -2
  252. package/dist/llm/model/shared.types.d.ts.map +1 -1
  253. package/dist/logger/constants.d.ts +1 -1
  254. package/dist/logger/default-logger.d.ts +2 -2
  255. package/dist/logger/default-logger.d.ts.map +1 -1
  256. package/dist/logger/index.cjs +11 -11
  257. package/dist/logger/index.js +2 -2
  258. package/dist/logger/logger.d.ts +4 -4
  259. package/dist/logger/logger.d.ts.map +1 -1
  260. package/dist/logger/multi-logger.d.ts +2 -2
  261. package/dist/logger/multi-logger.d.ts.map +1 -1
  262. package/dist/logger/transport.d.ts +3 -3
  263. package/dist/logger/transport.d.ts.map +1 -1
  264. package/dist/loop/index.cjs +2 -2
  265. package/dist/loop/index.js +1 -1
  266. package/dist/loop/loop.d.ts +1 -1
  267. package/dist/loop/loop.d.ts.map +1 -1
  268. package/dist/loop/network/index.d.ts +15 -15
  269. package/dist/loop/network/index.d.ts.map +1 -1
  270. package/dist/loop/test-utils/generateText.d.ts.map +1 -1
  271. package/dist/loop/test-utils/options.d.ts.map +1 -1
  272. package/dist/loop/test-utils/resultObject.d.ts.map +1 -1
  273. package/dist/loop/test-utils/streamObject.d.ts.map +1 -1
  274. package/dist/loop/types.d.ts +10 -9
  275. package/dist/loop/types.d.ts.map +1 -1
  276. package/dist/loop/workflows/agentic-execution/index.d.ts +55 -55
  277. package/dist/loop/workflows/agentic-execution/index.d.ts.map +1 -1
  278. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +38 -38
  279. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
  280. package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts +20 -20
  281. package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts.map +1 -1
  282. package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts +2 -2
  283. package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
  284. package/dist/loop/workflows/agentic-loop/index.d.ts +56 -55
  285. package/dist/loop/workflows/agentic-loop/index.d.ts.map +1 -1
  286. package/dist/loop/workflows/schema.d.ts +19 -20
  287. package/dist/loop/workflows/schema.d.ts.map +1 -1
  288. package/dist/loop/workflows/stream.d.ts +1 -1
  289. package/dist/loop/workflows/stream.d.ts.map +1 -1
  290. package/dist/mastra/hooks.d.ts +2 -2
  291. package/dist/mastra/hooks.d.ts.map +1 -1
  292. package/dist/mastra/index.cjs +2 -2
  293. package/dist/mastra/index.d.ts +392 -181
  294. package/dist/mastra/index.d.ts.map +1 -1
  295. package/dist/mastra/index.js +1 -1
  296. package/dist/mcp/index.cjs +41 -4
  297. package/dist/mcp/index.cjs.map +1 -1
  298. package/dist/mcp/index.d.ts +6 -4
  299. package/dist/mcp/index.d.ts.map +1 -1
  300. package/dist/mcp/index.js +39 -2
  301. package/dist/mcp/index.js.map +1 -1
  302. package/dist/mcp/types.d.ts +0 -15
  303. package/dist/mcp/types.d.ts.map +1 -1
  304. package/dist/memory/index.cjs +327 -13
  305. package/dist/memory/index.cjs.map +1 -1
  306. package/dist/memory/index.d.ts +1 -0
  307. package/dist/memory/index.d.ts.map +1 -1
  308. package/dist/memory/index.js +327 -1
  309. package/dist/memory/index.js.map +1 -1
  310. package/dist/memory/memory.d.ts +33 -56
  311. package/dist/memory/memory.d.ts.map +1 -1
  312. package/dist/memory/mock.d.ts +61 -0
  313. package/dist/memory/mock.d.ts.map +1 -0
  314. package/dist/memory/types.d.ts +48 -45
  315. package/dist/memory/types.d.ts.map +1 -1
  316. package/dist/models-dev-DNBKXHT4.js +3 -0
  317. package/dist/{models-dev-4VGIWYS3.js.map → models-dev-DNBKXHT4.js.map} +1 -1
  318. package/dist/models-dev-YBEEQIX6.cjs +12 -0
  319. package/dist/{models-dev-AXZASLL2.cjs.map → models-dev-YBEEQIX6.cjs.map} +1 -1
  320. package/dist/netlify-7G2L5VSH.js +3 -0
  321. package/dist/{netlify-26MMY5X4.js.map → netlify-7G2L5VSH.js.map} +1 -1
  322. package/dist/netlify-GWNGSIRZ.cjs +12 -0
  323. package/dist/{netlify-F3MVGV4Y.cjs.map → netlify-GWNGSIRZ.cjs.map} +1 -1
  324. package/dist/{ai-tracing → observability}/context.d.ts +5 -5
  325. package/dist/observability/context.d.ts.map +1 -0
  326. package/dist/observability/index.cjs +36 -0
  327. package/dist/observability/index.d.ts +11 -0
  328. package/dist/observability/index.d.ts.map +1 -0
  329. package/dist/observability/index.js +3 -0
  330. package/dist/observability/no-op.d.ts +22 -0
  331. package/dist/observability/no-op.d.ts.map +1 -0
  332. package/dist/observability/types/index.d.ts +2 -0
  333. package/dist/observability/types/index.d.ts.map +1 -0
  334. package/dist/{ai-tracing/types.d.ts → observability/types/tracing.d.ts} +242 -114
  335. package/dist/observability/types/tracing.d.ts.map +1 -0
  336. package/dist/observability/utils.d.ts +12 -0
  337. package/dist/observability/utils.d.ts.map +1 -0
  338. package/dist/processors/index.cjs +11 -11
  339. package/dist/processors/index.d.ts +10 -9
  340. package/dist/processors/index.d.ts.map +1 -1
  341. package/dist/processors/index.js +1 -1
  342. package/dist/processors/processors/batch-parts.d.ts +2 -1
  343. package/dist/processors/processors/batch-parts.d.ts.map +1 -1
  344. package/dist/processors/processors/language-detector.d.ts +11 -10
  345. package/dist/processors/processors/language-detector.d.ts.map +1 -1
  346. package/dist/processors/processors/moderation.d.ts +25 -23
  347. package/dist/processors/processors/moderation.d.ts.map +1 -1
  348. package/dist/processors/processors/pii-detector.d.ts +27 -27
  349. package/dist/processors/processors/pii-detector.d.ts.map +1 -1
  350. package/dist/processors/processors/prompt-injection-detector.d.ts +26 -19
  351. package/dist/processors/processors/prompt-injection-detector.d.ts.map +1 -1
  352. package/dist/processors/processors/structured-output.d.ts +3 -2
  353. package/dist/processors/processors/structured-output.d.ts.map +1 -1
  354. package/dist/processors/processors/system-prompt-scrubber.d.ts +22 -11
  355. package/dist/processors/processors/system-prompt-scrubber.d.ts.map +1 -1
  356. package/dist/processors/processors/token-limiter.d.ts +5 -4
  357. package/dist/processors/processors/token-limiter.d.ts.map +1 -1
  358. package/dist/processors/processors/unicode-normalizer.d.ts +5 -4
  359. package/dist/processors/processors/unicode-normalizer.d.ts.map +1 -1
  360. package/dist/processors/runner.d.ts +5 -5
  361. package/dist/processors/runner.d.ts.map +1 -1
  362. package/dist/provider-registry.json +1701 -1502
  363. package/dist/{registry-generator-DXRSYYYT.js → registry-generator-H4YNODDH.js} +2 -2
  364. package/dist/{registry-generator-DXRSYYYT.js.map → registry-generator-H4YNODDH.js.map} +1 -1
  365. package/dist/{registry-generator-6WVOHM2L.cjs → registry-generator-MK63POJO.cjs} +2 -2
  366. package/dist/{registry-generator-6WVOHM2L.cjs.map → registry-generator-MK63POJO.cjs.map} +1 -1
  367. package/dist/relevance/index.cjs +47 -13
  368. package/dist/relevance/index.cjs.map +1 -1
  369. package/dist/relevance/index.d.ts +0 -1
  370. package/dist/relevance/index.d.ts.map +1 -1
  371. package/dist/relevance/index.js +49 -1
  372. package/dist/relevance/index.js.map +1 -1
  373. package/dist/relevance/mastra-agent/index.d.ts.map +1 -1
  374. package/dist/request-context/index.cjs +12 -0
  375. package/dist/{runtime-context → request-context}/index.d.ts +1 -1
  376. package/dist/{runtime-context → request-context}/index.d.ts.map +1 -1
  377. package/dist/request-context/index.js +3 -0
  378. package/dist/server/auth.d.ts.map +1 -1
  379. package/dist/server/index.cjs +9 -25
  380. package/dist/server/index.cjs.map +1 -1
  381. package/dist/server/index.js +4 -21
  382. package/dist/server/index.js.map +1 -1
  383. package/dist/server/types.d.ts +3 -3
  384. package/dist/server/types.d.ts.map +1 -1
  385. package/dist/storage/base.d.ts +75 -143
  386. package/dist/storage/base.d.ts.map +1 -1
  387. package/dist/storage/constants.d.ts +3 -4
  388. package/dist/storage/constants.d.ts.map +1 -1
  389. package/dist/storage/domains/index.d.ts +0 -2
  390. package/dist/storage/domains/index.d.ts.map +1 -1
  391. package/dist/storage/domains/memory/base.d.ts +19 -56
  392. package/dist/storage/domains/memory/base.d.ts.map +1 -1
  393. package/dist/storage/domains/memory/inmemory.d.ts +15 -35
  394. package/dist/storage/domains/memory/inmemory.d.ts.map +1 -1
  395. package/dist/storage/domains/observability/base.d.ts +24 -24
  396. package/dist/storage/domains/observability/base.d.ts.map +1 -1
  397. package/dist/storage/domains/observability/inmemory.d.ts +18 -18
  398. package/dist/storage/domains/observability/inmemory.d.ts.map +1 -1
  399. package/dist/storage/domains/operations/inmemory.d.ts.map +1 -1
  400. package/dist/storage/domains/scores/base.d.ts +5 -5
  401. package/dist/storage/domains/scores/base.d.ts.map +1 -1
  402. package/dist/storage/domains/scores/inmemory.d.ts +5 -5
  403. package/dist/storage/domains/scores/inmemory.d.ts.map +1 -1
  404. package/dist/storage/domains/workflows/base.d.ts +4 -11
  405. package/dist/storage/domains/workflows/base.d.ts.map +1 -1
  406. package/dist/storage/domains/workflows/inmemory.d.ts +4 -11
  407. package/dist/storage/domains/workflows/inmemory.d.ts.map +1 -1
  408. package/dist/storage/index.cjs +74 -1775
  409. package/dist/storage/index.cjs.map +1 -1
  410. package/dist/storage/index.js +1 -1744
  411. package/dist/storage/index.js.map +1 -1
  412. package/dist/storage/mock.d.ts +35 -92
  413. package/dist/storage/mock.d.ts.map +1 -1
  414. package/dist/storage/types.d.ts +79 -76
  415. package/dist/storage/types.d.ts.map +1 -1
  416. package/dist/stream/MastraAgentNetworkStream.d.ts +4 -2
  417. package/dist/stream/MastraAgentNetworkStream.d.ts.map +1 -1
  418. package/dist/stream/MastraWorkflowStream.d.ts +1 -1
  419. package/dist/stream/MastraWorkflowStream.d.ts.map +1 -1
  420. package/dist/stream/RunOutput.d.ts +73 -0
  421. package/dist/stream/RunOutput.d.ts.map +1 -0
  422. package/dist/stream/aisdk/v4/input.d.ts +1 -1
  423. package/dist/stream/aisdk/v4/input.d.ts.map +1 -1
  424. package/dist/stream/aisdk/v5/execute.d.ts +4 -11
  425. package/dist/stream/aisdk/v5/execute.d.ts.map +1 -1
  426. package/dist/stream/aisdk/v5/output.d.ts +5 -11
  427. package/dist/stream/aisdk/v5/output.d.ts.map +1 -1
  428. package/dist/stream/base/base.d.ts +7 -0
  429. package/dist/stream/base/base.d.ts.map +1 -0
  430. package/dist/stream/base/consume-stream.d.ts +5 -0
  431. package/dist/stream/base/consume-stream.d.ts.map +1 -0
  432. package/dist/stream/base/output.d.ts +32 -14
  433. package/dist/stream/base/output.d.ts.map +1 -1
  434. package/dist/stream/index.cjs +14 -10
  435. package/dist/stream/index.d.ts +2 -1
  436. package/dist/stream/index.d.ts.map +1 -1
  437. package/dist/stream/index.js +2 -2
  438. package/dist/stream/types.d.ts +7 -7
  439. package/dist/stream/types.d.ts.map +1 -1
  440. package/dist/test-utils/llm-mock.cjs +8 -8
  441. package/dist/test-utils/llm-mock.cjs.map +1 -1
  442. package/dist/test-utils/llm-mock.d.ts +1 -1
  443. package/dist/test-utils/llm-mock.d.ts.map +1 -1
  444. package/dist/test-utils/llm-mock.js +3 -3
  445. package/dist/test-utils/llm-mock.js.map +1 -1
  446. package/dist/tools/index.cjs +4 -4
  447. package/dist/tools/index.js +1 -1
  448. package/dist/tools/is-vercel-tool.cjs +2 -2
  449. package/dist/tools/is-vercel-tool.js +1 -1
  450. package/dist/tools/tool-builder/builder.d.ts +7 -2
  451. package/dist/tools/tool-builder/builder.d.ts.map +1 -1
  452. package/dist/tools/tool.d.ts +25 -25
  453. package/dist/tools/tool.d.ts.map +1 -1
  454. package/dist/tools/types.d.ts +118 -21
  455. package/dist/tools/types.d.ts.map +1 -1
  456. package/dist/tools/validation.d.ts +4 -3
  457. package/dist/tools/validation.d.ts.map +1 -1
  458. package/dist/tts/index.cjs +12 -6
  459. package/dist/tts/index.cjs.map +1 -1
  460. package/dist/tts/index.d.ts +0 -1
  461. package/dist/tts/index.d.ts.map +1 -1
  462. package/dist/tts/index.js +14 -1
  463. package/dist/tts/index.js.map +1 -1
  464. package/dist/types/dynamic-argument.d.ts +3 -3
  465. package/dist/utils/fetchWithRetry.d.ts +9 -0
  466. package/dist/utils/fetchWithRetry.d.ts.map +1 -0
  467. package/dist/utils.cjs +33 -17
  468. package/dist/utils.d.ts +39 -5
  469. package/dist/utils.d.ts.map +1 -1
  470. package/dist/utils.js +1 -1
  471. package/dist/vector/embed.d.ts +1 -1
  472. package/dist/vector/embed.d.ts.map +1 -1
  473. package/dist/vector/index.cjs +80 -8
  474. package/dist/vector/index.cjs.map +1 -1
  475. package/dist/vector/index.js +80 -1
  476. package/dist/vector/index.js.map +1 -1
  477. package/dist/vector/vector.d.ts +5 -2
  478. package/dist/vector/vector.d.ts.map +1 -1
  479. package/dist/voice/composite-voice.d.ts +1 -7
  480. package/dist/voice/composite-voice.d.ts.map +1 -1
  481. package/dist/voice/index.cjs +4 -4
  482. package/dist/voice/index.js +1 -1
  483. package/dist/voice/voice.d.ts +0 -1
  484. package/dist/voice/voice.d.ts.map +1 -1
  485. package/dist/workflows/default.d.ts +69 -47
  486. package/dist/workflows/default.d.ts.map +1 -1
  487. package/dist/workflows/evented/execution-engine.d.ts +7 -3
  488. package/dist/workflows/evented/execution-engine.d.ts.map +1 -1
  489. package/dist/workflows/evented/index.cjs +10 -10
  490. package/dist/workflows/evented/index.js +1 -1
  491. package/dist/workflows/evented/step-executor.d.ts +15 -13
  492. package/dist/workflows/evented/step-executor.d.ts.map +1 -1
  493. package/dist/workflows/evented/workflow-event-processor/index.d.ts +5 -5
  494. package/dist/workflows/evented/workflow-event-processor/index.d.ts.map +1 -1
  495. package/dist/workflows/evented/workflow-event-processor/loop.d.ts +3 -3
  496. package/dist/workflows/evented/workflow-event-processor/loop.d.ts.map +1 -1
  497. package/dist/workflows/evented/workflow-event-processor/parallel.d.ts +2 -2
  498. package/dist/workflows/evented/workflow-event-processor/sleep.d.ts +2 -2
  499. package/dist/workflows/evented/workflow-event-processor/utils.d.ts +2 -7
  500. package/dist/workflows/evented/workflow-event-processor/utils.d.ts.map +1 -1
  501. package/dist/workflows/evented/workflow.d.ts +12 -12
  502. package/dist/workflows/evented/workflow.d.ts.map +1 -1
  503. package/dist/workflows/execution-engine.d.ts +12 -7
  504. package/dist/workflows/execution-engine.d.ts.map +1 -1
  505. package/dist/workflows/index.cjs +28 -12
  506. package/dist/workflows/index.js +1 -1
  507. package/dist/workflows/step.d.ts +8 -7
  508. package/dist/workflows/step.d.ts.map +1 -1
  509. package/dist/workflows/types.d.ts +68 -55
  510. package/dist/workflows/types.d.ts.map +1 -1
  511. package/dist/workflows/utils.d.ts +23 -0
  512. package/dist/workflows/utils.d.ts.map +1 -1
  513. package/dist/workflows/workflow.d.ts +125 -82
  514. package/dist/workflows/workflow.d.ts.map +1 -1
  515. package/evals/scoreTraces.d.ts +1 -0
  516. package/evals.d.ts +1 -0
  517. package/features.d.ts +1 -0
  518. package/observability.d.ts +1 -0
  519. package/package.json +52 -57
  520. package/request-context.d.ts +1 -0
  521. package/src/_types/ai-sdk.types.d.ts +4705 -0
  522. package/src/llm/model/provider-types.generated.d.ts +656 -568
  523. package/agent/input-processor/processors.d.ts +0 -1
  524. package/ai-tracing.d.ts +0 -1
  525. package/dist/agent/index.warning.d.ts +0 -13
  526. package/dist/agent/index.warning.d.ts.map +0 -1
  527. package/dist/agent/input-processor/index.cjs +0 -28
  528. package/dist/agent/input-processor/index.d.ts +0 -10
  529. package/dist/agent/input-processor/index.d.ts.map +0 -1
  530. package/dist/agent/input-processor/index.js +0 -3
  531. package/dist/agent/input-processor/processors/index.d.ts +0 -6
  532. package/dist/agent/input-processor/processors/index.d.ts.map +0 -1
  533. package/dist/agent/input-processor/processors/language-detector.d.ts +0 -18
  534. package/dist/agent/input-processor/processors/language-detector.d.ts.map +0 -1
  535. package/dist/agent/input-processor/processors/moderation.d.ts +0 -18
  536. package/dist/agent/input-processor/processors/moderation.d.ts.map +0 -1
  537. package/dist/agent/input-processor/processors/pii-detector.d.ts +0 -18
  538. package/dist/agent/input-processor/processors/pii-detector.d.ts.map +0 -1
  539. package/dist/agent/input-processor/processors/prompt-injection-detector.d.ts +0 -18
  540. package/dist/agent/input-processor/processors/prompt-injection-detector.d.ts.map +0 -1
  541. package/dist/agent/input-processor/processors/unicode-normalizer.d.ts +0 -18
  542. package/dist/agent/input-processor/processors/unicode-normalizer.d.ts.map +0 -1
  543. package/dist/ai-tracing/context.d.ts.map +0 -1
  544. package/dist/ai-tracing/exporters/cloud.d.ts +0 -32
  545. package/dist/ai-tracing/exporters/cloud.d.ts.map +0 -1
  546. package/dist/ai-tracing/exporters/console.d.ts +0 -10
  547. package/dist/ai-tracing/exporters/console.d.ts.map +0 -1
  548. package/dist/ai-tracing/exporters/default.d.ts +0 -98
  549. package/dist/ai-tracing/exporters/default.d.ts.map +0 -1
  550. package/dist/ai-tracing/exporters/index.d.ts +0 -8
  551. package/dist/ai-tracing/exporters/index.d.ts.map +0 -1
  552. package/dist/ai-tracing/index.cjs +0 -132
  553. package/dist/ai-tracing/index.d.ts +0 -12
  554. package/dist/ai-tracing/index.d.ts.map +0 -1
  555. package/dist/ai-tracing/index.js +0 -3
  556. package/dist/ai-tracing/registry.d.ts +0 -51
  557. package/dist/ai-tracing/registry.d.ts.map +0 -1
  558. package/dist/ai-tracing/span_processors/index.d.ts +0 -5
  559. package/dist/ai-tracing/span_processors/index.d.ts.map +0 -1
  560. package/dist/ai-tracing/span_processors/sensitive-data-filter.d.ts +0 -85
  561. package/dist/ai-tracing/span_processors/sensitive-data-filter.d.ts.map +0 -1
  562. package/dist/ai-tracing/spans/base.d.ts +0 -62
  563. package/dist/ai-tracing/spans/base.d.ts.map +0 -1
  564. package/dist/ai-tracing/spans/default.d.ts +0 -13
  565. package/dist/ai-tracing/spans/default.d.ts.map +0 -1
  566. package/dist/ai-tracing/spans/index.d.ts +0 -7
  567. package/dist/ai-tracing/spans/index.d.ts.map +0 -1
  568. package/dist/ai-tracing/spans/no-op.d.ts +0 -15
  569. package/dist/ai-tracing/spans/no-op.d.ts.map +0 -1
  570. package/dist/ai-tracing/tracers/base.d.ts +0 -91
  571. package/dist/ai-tracing/tracers/base.d.ts.map +0 -1
  572. package/dist/ai-tracing/tracers/default.d.ts +0 -7
  573. package/dist/ai-tracing/tracers/default.d.ts.map +0 -1
  574. package/dist/ai-tracing/tracers/index.d.ts +0 -6
  575. package/dist/ai-tracing/tracers/index.d.ts.map +0 -1
  576. package/dist/ai-tracing/types.d.ts.map +0 -1
  577. package/dist/ai-tracing/utils.d.ts +0 -54
  578. package/dist/ai-tracing/utils.d.ts.map +0 -1
  579. package/dist/base.warning.d.ts +0 -9
  580. package/dist/base.warning.d.ts.map +0 -1
  581. package/dist/bundler/index.warning.d.ts +0 -9
  582. package/dist/bundler/index.warning.d.ts.map +0 -1
  583. package/dist/chunk-2DVGQK2L.js +0 -596
  584. package/dist/chunk-2DVGQK2L.js.map +0 -1
  585. package/dist/chunk-2JUDZXVI.cjs +0 -603
  586. package/dist/chunk-2JUDZXVI.cjs.map +0 -1
  587. package/dist/chunk-2PQWCKU6.js.map +0 -1
  588. package/dist/chunk-354M64D6.cjs.map +0 -1
  589. package/dist/chunk-3HXBPDKN.js +0 -105
  590. package/dist/chunk-4R2TBRS7.cjs +0 -191
  591. package/dist/chunk-4R2TBRS7.cjs.map +0 -1
  592. package/dist/chunk-576KDLXN.cjs +0 -75
  593. package/dist/chunk-576KDLXN.cjs.map +0 -1
  594. package/dist/chunk-5F7MATUC.cjs.map +0 -1
  595. package/dist/chunk-6KJK5BVX.cjs +0 -2440
  596. package/dist/chunk-6KJK5BVX.cjs.map +0 -1
  597. package/dist/chunk-6OLRLZJ3.js +0 -145
  598. package/dist/chunk-6OLRLZJ3.js.map +0 -1
  599. package/dist/chunk-6PQXZBBT.js.map +0 -1
  600. package/dist/chunk-6TEQIYXV.cjs.map +0 -1
  601. package/dist/chunk-6VOPKVYH.cjs +0 -57
  602. package/dist/chunk-6VOPKVYH.cjs.map +0 -1
  603. package/dist/chunk-A4PALPHY.js.map +0 -1
  604. package/dist/chunk-A5KDVZDL.cjs.map +0 -1
  605. package/dist/chunk-ACLXEQX7.cjs +0 -91
  606. package/dist/chunk-ACLXEQX7.cjs.map +0 -1
  607. package/dist/chunk-ACV7PFXB.js +0 -1176
  608. package/dist/chunk-ACV7PFXB.js.map +0 -1
  609. package/dist/chunk-EBVYYC2Q.cjs +0 -111
  610. package/dist/chunk-FE3OT3W7.js +0 -87
  611. package/dist/chunk-FE3OT3W7.js.map +0 -1
  612. package/dist/chunk-GB5BIA4V.js +0 -167
  613. package/dist/chunk-GB5BIA4V.js.map +0 -1
  614. package/dist/chunk-GD7XNW2E.cjs.map +0 -1
  615. package/dist/chunk-GL6ON5O6.cjs +0 -271
  616. package/dist/chunk-GL6ON5O6.cjs.map +0 -1
  617. package/dist/chunk-H4KO46HZ.js +0 -90
  618. package/dist/chunk-H4KO46HZ.js.map +0 -1
  619. package/dist/chunk-HF3GZRFP.cjs +0 -9
  620. package/dist/chunk-HF3GZRFP.cjs.map +0 -1
  621. package/dist/chunk-HVNCJ6ED.cjs.map +0 -1
  622. package/dist/chunk-I7KJDXUK.cjs.map +0 -1
  623. package/dist/chunk-IQGDOBME.cjs +0 -82
  624. package/dist/chunk-IQGDOBME.cjs.map +0 -1
  625. package/dist/chunk-KDX3ZMQ2.js +0 -12
  626. package/dist/chunk-KDX3ZMQ2.js.map +0 -1
  627. package/dist/chunk-L5A4MRCK.cjs +0 -93
  628. package/dist/chunk-L5A4MRCK.cjs.map +0 -1
  629. package/dist/chunk-L7JDWJQA.cjs.map +0 -1
  630. package/dist/chunk-LBEV3YZ2.js.map +0 -1
  631. package/dist/chunk-LZUSZT7R.cjs +0 -170
  632. package/dist/chunk-LZUSZT7R.cjs.map +0 -1
  633. package/dist/chunk-M4AX46DS.js +0 -72
  634. package/dist/chunk-M4AX46DS.js.map +0 -1
  635. package/dist/chunk-MHRMVYW3.js.map +0 -1
  636. package/dist/chunk-MJTSYIDC.js +0 -267
  637. package/dist/chunk-MJTSYIDC.js.map +0 -1
  638. package/dist/chunk-NFIADRH5.js +0 -39
  639. package/dist/chunk-NFIADRH5.js.map +0 -1
  640. package/dist/chunk-OG4TO6AI.cjs +0 -1260
  641. package/dist/chunk-OG4TO6AI.cjs.map +0 -1
  642. package/dist/chunk-PFXXH2RP.js.map +0 -1
  643. package/dist/chunk-QFF5JUKT.cjs.map +0 -1
  644. package/dist/chunk-QRYRUZWZ.js.map +0 -1
  645. package/dist/chunk-RBO5BUGG.js +0 -431
  646. package/dist/chunk-RBO5BUGG.js.map +0 -1
  647. package/dist/chunk-RJG3COK3.cjs.map +0 -1
  648. package/dist/chunk-RKXWLG33.js +0 -7
  649. package/dist/chunk-RKXWLG33.js.map +0 -1
  650. package/dist/chunk-ROBLMWF6.cjs +0 -39
  651. package/dist/chunk-ROBLMWF6.cjs.map +0 -1
  652. package/dist/chunk-SE4PA467.cjs +0 -150
  653. package/dist/chunk-SE4PA467.cjs.map +0 -1
  654. package/dist/chunk-SJMKDSRF.js +0 -179
  655. package/dist/chunk-SJMKDSRF.js.map +0 -1
  656. package/dist/chunk-SPZ7SY6U.js.map +0 -1
  657. package/dist/chunk-SSULK22X.cjs +0 -14
  658. package/dist/chunk-SSULK22X.cjs.map +0 -1
  659. package/dist/chunk-T3JFFQH2.js.map +0 -1
  660. package/dist/chunk-TKYKL7Y4.cjs +0 -436
  661. package/dist/chunk-TKYKL7Y4.cjs.map +0 -1
  662. package/dist/chunk-TSNDVBUU.cjs.map +0 -1
  663. package/dist/chunk-TTELJD4F.js.map +0 -1
  664. package/dist/chunk-UXG7PYML.js.map +0 -1
  665. package/dist/chunk-UZNEQTDA.js +0 -2388
  666. package/dist/chunk-UZNEQTDA.js.map +0 -1
  667. package/dist/chunk-VQASQG5D.js +0 -55
  668. package/dist/chunk-VQASQG5D.js.map +0 -1
  669. package/dist/chunk-VQLW7LPO.js.map +0 -1
  670. package/dist/chunk-WM4VQWOZ.cjs.map +0 -1
  671. package/dist/chunk-YGL6E6PD.cjs.map +0 -1
  672. package/dist/chunk-YJVDEYZS.js.map +0 -1
  673. package/dist/chunk-Z2OK2JM2.js +0 -72
  674. package/dist/chunk-Z2OK2JM2.js.map +0 -1
  675. package/dist/chunk-ZMELUU72.js.map +0 -1
  676. package/dist/chunk-ZZHNF46L.cjs.map +0 -1
  677. package/dist/deployer/index.warning.d.ts +0 -9
  678. package/dist/deployer/index.warning.d.ts.map +0 -1
  679. package/dist/eval/evaluation.d.ts +0 -14
  680. package/dist/eval/evaluation.d.ts.map +0 -1
  681. package/dist/eval/index.cjs +0 -16
  682. package/dist/eval/index.d.ts +0 -4
  683. package/dist/eval/index.d.ts.map +0 -1
  684. package/dist/eval/index.js +0 -3
  685. package/dist/eval/metric.d.ts +0 -8
  686. package/dist/eval/metric.d.ts.map +0 -1
  687. package/dist/eval/types.d.ts +0 -9
  688. package/dist/eval/types.d.ts.map +0 -1
  689. package/dist/integration/index.warning.d.ts +0 -3
  690. package/dist/integration/index.warning.d.ts.map +0 -1
  691. package/dist/integration/integration.warning.d.ts +0 -5
  692. package/dist/integration/integration.warning.d.ts.map +0 -1
  693. package/dist/integration/openapi-toolset.warning.d.ts +0 -5
  694. package/dist/integration/openapi-toolset.warning.d.ts.map +0 -1
  695. package/dist/loop/telemetry/index.d.ts +0 -36
  696. package/dist/loop/telemetry/index.d.ts.map +0 -1
  697. package/dist/loop/telemetry/noop.d.ts +0 -3
  698. package/dist/loop/telemetry/noop.d.ts.map +0 -1
  699. package/dist/loop/test-utils/mockTracer.d.ts +0 -47
  700. package/dist/loop/test-utils/mockTracer.d.ts.map +0 -1
  701. package/dist/loop/test-utils/telemetry.d.ts +0 -6
  702. package/dist/loop/test-utils/telemetry.d.ts.map +0 -1
  703. package/dist/memory/index.warning.d.ts +0 -6
  704. package/dist/memory/index.warning.d.ts.map +0 -1
  705. package/dist/models-dev-4VGIWYS3.js +0 -3
  706. package/dist/models-dev-AXZASLL2.cjs +0 -12
  707. package/dist/netlify-26MMY5X4.js +0 -3
  708. package/dist/netlify-F3MVGV4Y.cjs +0 -12
  709. package/dist/relevance/cohere/index.d.ts +0 -9
  710. package/dist/relevance/cohere/index.d.ts.map +0 -1
  711. package/dist/runtime-context/index.cjs +0 -12
  712. package/dist/runtime-context/index.js +0 -3
  713. package/dist/scores/base.d.ts.map +0 -1
  714. package/dist/scores/base.test-utils.d.ts.map +0 -1
  715. package/dist/scores/hooks.d.ts.map +0 -1
  716. package/dist/scores/index.cjs +0 -37
  717. package/dist/scores/index.cjs.map +0 -1
  718. package/dist/scores/index.d.ts +0 -4
  719. package/dist/scores/index.d.ts.map +0 -1
  720. package/dist/scores/index.js +0 -4
  721. package/dist/scores/index.js.map +0 -1
  722. package/dist/scores/run-experiment/index.d.ts.map +0 -1
  723. package/dist/scores/run-experiment/scorerAccumulator.d.ts.map +0 -1
  724. package/dist/scores/scoreTraces/index.cjs.map +0 -1
  725. package/dist/scores/scoreTraces/index.d.ts.map +0 -1
  726. package/dist/scores/scoreTraces/index.js.map +0 -1
  727. package/dist/scores/scoreTraces/scoreTraces.d.ts.map +0 -1
  728. package/dist/scores/scoreTraces/scoreTracesWorkflow.d.ts.map +0 -1
  729. package/dist/scores/scoreTraces/utils.d.ts.map +0 -1
  730. package/dist/scores/types.d.ts.map +0 -1
  731. package/dist/storage/base.warning.d.ts +0 -8
  732. package/dist/storage/base.warning.d.ts.map +0 -1
  733. package/dist/storage/domains/legacy-evals/base.d.ts +0 -13
  734. package/dist/storage/domains/legacy-evals/base.d.ts.map +0 -1
  735. package/dist/storage/domains/legacy-evals/index.d.ts +0 -2
  736. package/dist/storage/domains/legacy-evals/index.d.ts.map +0 -1
  737. package/dist/storage/domains/legacy-evals/inmemory.d.ts +0 -17
  738. package/dist/storage/domains/legacy-evals/inmemory.d.ts.map +0 -1
  739. package/dist/storage/domains/traces/base.d.ts +0 -14
  740. package/dist/storage/domains/traces/base.d.ts.map +0 -1
  741. package/dist/storage/domains/traces/index.d.ts +0 -3
  742. package/dist/storage/domains/traces/index.d.ts.map +0 -1
  743. package/dist/storage/domains/traces/inmemory.d.ts +0 -22
  744. package/dist/storage/domains/traces/inmemory.d.ts.map +0 -1
  745. package/dist/storage/index.warning.d.ts +0 -3
  746. package/dist/storage/index.warning.d.ts.map +0 -1
  747. package/dist/telemetry/composite-exporter.d.ts +0 -10
  748. package/dist/telemetry/composite-exporter.d.ts.map +0 -1
  749. package/dist/telemetry/index.cjs +0 -32
  750. package/dist/telemetry/index.cjs.map +0 -1
  751. package/dist/telemetry/index.d.ts +0 -6
  752. package/dist/telemetry/index.d.ts.map +0 -1
  753. package/dist/telemetry/index.js +0 -3
  754. package/dist/telemetry/index.js.map +0 -1
  755. package/dist/telemetry/otel-vendor.cjs +0 -105
  756. package/dist/telemetry/otel-vendor.cjs.map +0 -1
  757. package/dist/telemetry/otel-vendor.d.ts +0 -11
  758. package/dist/telemetry/otel-vendor.d.ts.map +0 -1
  759. package/dist/telemetry/otel-vendor.js +0 -59
  760. package/dist/telemetry/otel-vendor.js.map +0 -1
  761. package/dist/telemetry/storage-exporter.d.ts +0 -21
  762. package/dist/telemetry/storage-exporter.d.ts.map +0 -1
  763. package/dist/telemetry/telemetry.d.ts +0 -59
  764. package/dist/telemetry/telemetry.d.ts.map +0 -1
  765. package/dist/telemetry/telemetry.decorators.d.ts +0 -15
  766. package/dist/telemetry/telemetry.decorators.d.ts.map +0 -1
  767. package/dist/telemetry/types.d.ts +0 -74
  768. package/dist/telemetry/types.d.ts.map +0 -1
  769. package/dist/telemetry/utility.d.ts +0 -15
  770. package/dist/telemetry/utility.d.ts.map +0 -1
  771. package/dist/tools/index.warning.d.ts +0 -8
  772. package/dist/tools/index.warning.d.ts.map +0 -1
  773. package/dist/tts/index.warning.d.ts +0 -7
  774. package/dist/tts/index.warning.d.ts.map +0 -1
  775. package/dist/vector/index.warning.d.ts +0 -6
  776. package/dist/vector/index.warning.d.ts.map +0 -1
  777. package/dist/workflows/index.warning.d.ts +0 -6
  778. package/dist/workflows/index.warning.d.ts.map +0 -1
  779. package/dist/workflows/legacy/index.cjs +0 -92
  780. package/dist/workflows/legacy/index.cjs.map +0 -1
  781. package/dist/workflows/legacy/index.d.ts +0 -5
  782. package/dist/workflows/legacy/index.d.ts.map +0 -1
  783. package/dist/workflows/legacy/index.js +0 -3
  784. package/dist/workflows/legacy/index.js.map +0 -1
  785. package/dist/workflows/legacy/machine.d.ts +0 -386
  786. package/dist/workflows/legacy/machine.d.ts.map +0 -1
  787. package/dist/workflows/legacy/step.d.ts +0 -15
  788. package/dist/workflows/legacy/step.d.ts.map +0 -1
  789. package/dist/workflows/legacy/types.d.ts +0 -397
  790. package/dist/workflows/legacy/types.d.ts.map +0 -1
  791. package/dist/workflows/legacy/utils.d.ts +0 -68
  792. package/dist/workflows/legacy/utils.d.ts.map +0 -1
  793. package/dist/workflows/legacy/workflow-instance.d.ts +0 -97
  794. package/dist/workflows/legacy/workflow-instance.d.ts.map +0 -1
  795. package/dist/workflows/legacy/workflow.d.ts +0 -109
  796. package/dist/workflows/legacy/workflow.d.ts.map +0 -1
  797. package/dist/workflows/workflow.warning.d.ts +0 -9
  798. package/dist/workflows/workflow.warning.d.ts.map +0 -1
  799. package/eval.d.ts +0 -1
  800. package/runtime-context.d.ts +0 -1
  801. package/scores/scoreTraces.d.ts +0 -1
  802. package/scores.d.ts +0 -1
  803. package/telemetry/otel-vendor.d.ts +0 -1
  804. package/telemetry.d.ts +0 -1
  805. package/workflows/legacy.d.ts +0 -1
  806. /package/dist/agent/{input-processor → message-list}/index.cjs.map +0 -0
  807. /package/dist/agent/{input-processor → message-list}/index.js.map +0 -0
  808. /package/dist/{ai-tracing → evals}/index.cjs.map +0 -0
  809. /package/dist/{ai-tracing → evals}/index.js.map +0 -0
  810. /package/dist/{scores/run-experiment → evals/run}/scorerAccumulator.d.ts +0 -0
  811. /package/dist/{scores → evals}/scoreTraces/index.d.ts +0 -0
  812. /package/dist/{eval → observability}/index.cjs.map +0 -0
  813. /package/dist/{eval → observability}/index.js.map +0 -0
  814. /package/dist/{runtime-context → request-context}/index.cjs.map +0 -0
  815. /package/dist/{runtime-context → request-context}/index.js.map +0 -0
package/CHANGELOG.md CHANGED
@@ -1,6 +1,1274 @@
1
1
  # @mastra/core
2
2
 
3
- ## 0.0.0-error-handler-fix-20251020202607
3
+ ## 0.0.0-export-agent-memory-from-local-studio-20251112153946
4
+
5
+ ### Major Changes
6
+
7
+ - Moving scorers under the eval domain, api method consistency, prebuilt evals, scorers require ids. ([#9589](https://github.com/mastra-ai/mastra/pull/9589))
8
+
9
+ - **BREAKING CHANGE**: Scorers for Agents will now use `MastraDBMessage` instead of `UIMessage` ([#9702](https://github.com/mastra-ai/mastra/pull/9702))
10
+ - Scorer input/output types now use `MastraDBMessage[]` with nested `content` object structure
11
+ - Added `getTextContentFromMastraDBMessage()` helper function to extract text content from `MastraDBMessage` objects
12
+ - Added `createTestMessage()` helper function for creating `MastraDBMessage` objects in tests with optional tool invocations support
13
+ - Updated `extractToolCalls()` to access tool invocations from nested `content` structure
14
+ - Updated `getUserMessageFromRunInput()` and `getAssistantMessageFromRunOutput()` to use new message structure
15
+ - Removed `createUIMessage()`
16
+
17
+ - Every Mastra primitive (agent, MCPServer, workflow, tool, processor, scorer, and vector) now has a get, list, and add method associated with it. Each primitive also now requires an id to be set. ([#9675](https://github.com/mastra-ai/mastra/pull/9675))
18
+
19
+ Primitives that are added to other primitives are also automatically added to the Mastra instance
20
+
21
+ - Update handlers to use `listWorkflowRuns` instead of `getWorkflowRuns`. Fix type names from `StoragelistThreadsByResourceIdInput/Output` to `StorageListThreadsByResourceIdInput/Output`. ([#9507](https://github.com/mastra-ai/mastra/pull/9507))
22
+
23
+ - **BREAKING:** Remove `getMessagesPaginated()` and add `perPage: false` support ([#9670](https://github.com/mastra-ai/mastra/pull/9670))
24
+
25
+ Removes deprecated `getMessagesPaginated()` method. The `listMessages()` API and score handlers now support `perPage: false` to fetch all records without pagination limits.
26
+
27
+ **Storage changes:**
28
+ - `StoragePagination.perPage` type changed from `number` to `number | false`
29
+ - All storage implementations support `perPage: false`:
30
+ - Memory: `listMessages()`
31
+ - Scores: `listScoresBySpan()`, `listScoresByRunId()`, `listScoresByExecutionId()`
32
+ - HTTP query parser accepts `"false"` string (e.g., `?perPage=false`)
33
+
34
+ **Memory changes:**
35
+ - `memory.query()` parameter type changed from `StorageGetMessagesArg` to `StorageListMessagesInput`
36
+ - Uses flat parameters (`page`, `perPage`, `include`, `filter`, `vectorSearchString`) instead of `selectBy` object
37
+
38
+ **Stricter validation:**
39
+ - `listMessages()` requires non-empty, non-whitespace `threadId` (throws error instead of returning empty results)
40
+
41
+ **Migration:**
42
+
43
+ ```typescript
44
+ // Storage/Memory: Replace getMessagesPaginated with listMessages
45
+ - storage.getMessagesPaginated({ threadId, selectBy: { pagination: { page: 0, perPage: 20 } } })
46
+ + storage.listMessages({ threadId, page: 0, perPage: 20 })
47
+ + storage.listMessages({ threadId, page: 0, perPage: false }) // Fetch all
48
+
49
+ // Memory: Replace selectBy with flat parameters
50
+ - memory.query({ threadId, selectBy: { last: 20, include: [...] } })
51
+ + memory.query({ threadId, perPage: 20, include: [...] })
52
+
53
+ // Client SDK
54
+ - thread.getMessagesPaginated({ selectBy: { pagination: { page: 0 } } })
55
+ + thread.listMessages({ page: 0, perPage: 20 })
56
+ ```
57
+
58
+ - # Major Changes ([#9695](https://github.com/mastra-ai/mastra/pull/9695))
59
+
60
+ ## Storage Layer
61
+
62
+ ### BREAKING: Removed `storage.getMessages()`
63
+
64
+ The `getMessages()` method has been removed from all storage implementations. Use `listMessages()` instead, which provides pagination support.
65
+
66
+ **Migration:**
67
+
68
+ ```typescript
69
+ // Before
70
+ const messages = await storage.getMessages({ threadId: 'thread-1' });
71
+
72
+ // After
73
+ const result = await storage.listMessages({
74
+ threadId: 'thread-1',
75
+ page: 0,
76
+ perPage: 50,
77
+ });
78
+ const messages = result.messages; // Access messages array
79
+ console.log(result.total); // Total count
80
+ console.log(result.hasMore); // Whether more pages exist
81
+ ```
82
+
83
+ ### Message ordering default
84
+
85
+ `listMessages()` defaults to ASC (oldest first) ordering by `createdAt`, matching the previous `getMessages()` behavior.
86
+
87
+ **To use DESC ordering (newest first):**
88
+
89
+ ```typescript
90
+ const result = await storage.listMessages({
91
+ threadId: 'thread-1',
92
+ orderBy: { field: 'createdAt', direction: 'DESC' },
93
+ });
94
+ ```
95
+
96
+ ## Client SDK
97
+
98
+ ### BREAKING: Renamed `client.getThreadMessages()` → `client.listThreadMessages()`
99
+
100
+ **Migration:**
101
+
102
+ ```typescript
103
+ // Before
104
+ const response = await client.getThreadMessages(threadId, { agentId });
105
+
106
+ // After
107
+ const response = await client.listThreadMessages(threadId, { agentId });
108
+ ```
109
+
110
+ The response format remains the same.
111
+
112
+ ## Type Changes
113
+
114
+ ### BREAKING: Removed `StorageGetMessagesArg` type
115
+
116
+ Use `StorageListMessagesInput` instead:
117
+
118
+ ```typescript
119
+ // Before
120
+ import type { StorageGetMessagesArg } from '@mastra/core';
121
+
122
+ // After
123
+ import type { StorageListMessagesInput } from '@mastra/core';
124
+ ```
125
+
126
+ - - Removes modelSettings.abortSignal in favour of top-level abortSignal only. Also removes the deprecated output field - use structuredOutput.schema instead. ([`9e1911d`](https://github.com/mastra-ai/mastra/commit/9e1911db2b4db85e0e768c3f15e0d61e319869f6))
127
+ - The deprecated generateVNext() and streamVNext() methods have been removed since they're now the stable generate() and stream() methods.
128
+ - The deprecated `output` option has been removed entirely, in favour of `structuredOutput`.
129
+
130
+ Method renames to clarify the API surface:
131
+ - getDefaultGenerateOptions → getDefaultGenerateOptionsLegacy
132
+ - getDefaultStreamOptions → getDefaultStreamOptionsLegacy
133
+ - getDefaultVNextStreamOptions → getDefaultStreamOptions
134
+
135
+ - Bump minimum required Node.js version to 22.13.0 ([#9706](https://github.com/mastra-ai/mastra/pull/9706))
136
+
137
+ - Replace `getThreadsByResourceIdPaginated` with `listThreadsByResourceId` across memory handlers. Update client SDK to use `listThreads()` with `offset`/`limit` parameters instead of deprecated `getMemoryThreads()`. Consolidate `/api/memory/threads` routes to single paginated endpoint. ([#9508](https://github.com/mastra-ai/mastra/pull/9508))
138
+
139
+ - Add new list methods to storage API: `listMessages`, `listMessagesById`, `listThreadsByResourceId`, and `listWorkflowRuns`. Most methods are currently wrappers around existing methods. Full implementations will be added when migrating away from legacy methods. ([#9489](https://github.com/mastra-ai/mastra/pull/9489))
140
+
141
+ - Update tool execution signature ([#9587](https://github.com/mastra-ai/mastra/pull/9587))
142
+
143
+ Consolidated the 3 different execution contexts to one
144
+
145
+ ```typescript
146
+ // before depending on the context the tool was executed in
147
+ tool.execute({ context: data });
148
+ tool.execute({ context: { inputData: data } });
149
+ tool.execute(data);
150
+
151
+ // now, for all contexts
152
+ tool.execute(data, context);
153
+ ```
154
+
155
+ **Before:**
156
+
157
+ ```typescript
158
+ inputSchema: z.object({ something: z.string() }),
159
+ execute: async ({ context, tracingContext, runId, ... }) => {
160
+ return doSomething(context.string);
161
+ }
162
+ ```
163
+
164
+ **After:**
165
+
166
+ ```typescript
167
+ inputSchema: z.object({ something: z.string() }),
168
+ execute: async (inputData, context) => {
169
+ const { agent, mcp, workflow, ...sharedContext } = context
170
+
171
+ // context that only an agent would get like toolCallId, messages, suspend, resume, etc
172
+ if (agent) {
173
+ doSomething(inputData.something, agent)
174
+ // context that only a workflow would get like runId, state, suspend, resume, etc
175
+ } else if (workflow) {
176
+ doSomething(inputData.something, workflow)
177
+ // context that only a workflow would get like "extra", "elicitation"
178
+ } else if (mcp) {
179
+ doSomething(inputData.something, mcp)
180
+ } else {
181
+ // Running a tool in no execution context
182
+ return doSomething(inputData.something);
183
+ }
184
+ }
185
+ ```
186
+
187
+ - The `@mastra/core` package no longer allows top-level imports except for `Mastra` and `type Config`. You must use subpath imports for all other imports. ([#9544](https://github.com/mastra-ai/mastra/pull/9544))
188
+
189
+ For example:
190
+
191
+ ```diff
192
+ import { Mastra, type Config } from "@mastra/core";
193
+ - import { Agent } from "@mastra/core";
194
+ - import { createTool } from "@mastra/core";
195
+ - import { createStep } from "@mastra/core";
196
+
197
+ + import { Agent } from "@mastra/core/agent";
198
+ + import { createTool } from "@mastra/core/tools";
199
+ + import { createStep } from "@mastra/core/workflows";
200
+ ```
201
+
202
+ - This simplifies the Memory API by removing the confusing rememberMessages method and renaming query to recall for better clarity. ([#9701](https://github.com/mastra-ai/mastra/pull/9701))
203
+
204
+ The rememberMessages method name implied it might persist data when it was actually just retrieving messages, same as query. Having two methods that did essentially the same thing was unnecessary.
205
+
206
+ Before:
207
+
208
+ ```typescript
209
+ // Two methods that did the same thing
210
+ memory.rememberMessages({ threadId, resourceId, config, vectorMessageSearch });
211
+ memory.query({ threadId, resourceId, perPage, vectorSearchString });
212
+ ```
213
+
214
+ After:
215
+
216
+ ```typescript
217
+ // Single unified method with clear purpose
218
+ memory.recall({ threadId, resourceId, perPage, vectorMessageSearch, threadConfig });
219
+ ```
220
+
221
+ All usages have been updated across the codebase including tests. The agent now calls recall directly with the appropriate parameters.
222
+
223
+ - Rename RuntimeContext to RequestContext ([#9511](https://github.com/mastra-ai/mastra/pull/9511))
224
+
225
+ - Implement listMessages API for replacing previous methods ([#9531](https://github.com/mastra-ai/mastra/pull/9531))
226
+
227
+ - Rename `defaultVNextStreamOptions` to `defaultOptions`. Add "Legacy" suffix to v1 option properties and methods (`defaultGenerateOptions` → `defaultGenerateOptionsLegacy`, `defaultStreamOptions` → `defaultStreamOptionsLegacy`). ([#9535](https://github.com/mastra-ai/mastra/pull/9535))
228
+
229
+ - Remove `getThreadsByResourceId` and `getThreadsByResourceIdPaginated` methods from storage interfaces in favor of `listThreadsByResourceId`. The new method uses `offset`/`limit` pagination and a nested `orderBy` object structure (`{ field, direction }`). ([#9536](https://github.com/mastra-ai/mastra/pull/9536))
230
+
231
+ - Remove `getMessagesById` method from storage interfaces in favor of `listMessagesById`. The new method only returns V2-format messages and removes the format parameter, simplifying the API surface. Users should migrate from `getMessagesById({ messageIds, format })` to `listMessagesById({ messageIds })`. ([#9534](https://github.com/mastra-ai/mastra/pull/9534))
232
+
233
+ - Experimental auth -> auth ([#9660](https://github.com/mastra-ai/mastra/pull/9660))
234
+
235
+ - Renamed a bunch of observability/tracing-related things to drop the AI prefix. ([#9744](https://github.com/mastra-ai/mastra/pull/9744))
236
+
237
+ - Removed MastraMessageV3 intermediary format, now we go from MastraDBMessage->aiv5 formats and back directly ([#9094](https://github.com/mastra-ai/mastra/pull/9094))
238
+
239
+ - **Breaking Change**: Remove legacy v1 watch events and consolidate on v2 implementation. ([#9252](https://github.com/mastra-ai/mastra/pull/9252))
240
+
241
+ This change simplifies the workflow watching API by removing the legacy v1 event system and promoting v2 as the standard (renamed to just `watch`).
242
+
243
+ ### What's Changed
244
+ - Removed legacy v1 watch event handlers and types
245
+ - Renamed `watch-v2` to `watch` throughout the codebase
246
+ - Removed `.watch()` method from client-js SDK (`Workflow` and `AgentBuilder` classes)
247
+ - Removed `/watch` HTTP endpoints from server and deployer
248
+ - Removed `WorkflowWatchResult` and v1 `WatchEvent` types
249
+
250
+ - Remove various deprecated APIs from agent class. ([#9257](https://github.com/mastra-ai/mastra/pull/9257))
251
+ - `agent.llm` → `agent.getLLM()`
252
+ - `agent.tools` → `agent.getTools()`
253
+ - `agent.instructions` → `agent.getInstructions()`
254
+ - `agent.speak()` → `agent.voice.speak()`
255
+ - `agent.getSpeakers()` → `agent.voice.getSpeakers()`
256
+ - `agent.listen` → `agent.voice.listen()`
257
+ - `agent.fetchMemory` → `(await agent.getMemory()).query()`
258
+ - `agent.toStep` → Add agent directly to the step, workflows handle the transformation
259
+
260
+ - **BREAKING CHANGE**: Pagination APIs now use `page`/`perPage` instead of `offset`/`limit` ([#9592](https://github.com/mastra-ai/mastra/pull/9592))
261
+
262
+ All storage and memory pagination APIs have been updated to use `page` (0-indexed) and `perPage` instead of `offset` and `limit`, aligning with standard REST API patterns.
263
+
264
+ **Affected APIs:**
265
+ - `Memory.listThreadsByResourceId()`
266
+ - `Memory.listMessages()`
267
+ - `Storage.listWorkflowRuns()`
268
+
269
+ **Migration:**
270
+
271
+ ```typescript
272
+ // Before
273
+ await memory.listThreadsByResourceId({
274
+ resourceId: 'user-123',
275
+ offset: 20,
276
+ limit: 10,
277
+ });
278
+
279
+ // After
280
+ await memory.listThreadsByResourceId({
281
+ resourceId: 'user-123',
282
+ page: 2, // page = Math.floor(offset / limit)
283
+ perPage: 10,
284
+ });
285
+
286
+ // Before
287
+ await memory.listMessages({
288
+ threadId: 'thread-456',
289
+ offset: 20,
290
+ limit: 10,
291
+ });
292
+
293
+ // After
294
+ await memory.listMessages({
295
+ threadId: 'thread-456',
296
+ page: 2,
297
+ perPage: 10,
298
+ });
299
+
300
+ // Before
301
+ await storage.listWorkflowRuns({
302
+ workflowName: 'my-workflow',
303
+ offset: 20,
304
+ limit: 10,
305
+ });
306
+
307
+ // After
308
+ await storage.listWorkflowRuns({
309
+ workflowName: 'my-workflow',
310
+ page: 2,
311
+ perPage: 10,
312
+ });
313
+ ```
314
+
315
+ **Additional improvements:**
316
+ - Added validation for negative `page` values in all storage implementations
317
+ - Improved `perPage` validation to handle edge cases (negative values, `0`, `false`)
318
+ - Added reusable query parser utilities for consistent validation in handlers
319
+
320
+ - ```([#9709](https://github.com/mastra-ai/mastra/pull/9709))
321
+ import { Mastra } from '@mastra/core';
322
+ import { Observability } from '@mastra/observability'; // Explicit import
323
+
324
+ const mastra = new Mastra({
325
+ ...other_config,
326
+ observability: new Observability({
327
+ default: { enabled: true }
328
+ }) // Instance
329
+ });
330
+ ```
331
+
332
+ Instead of:
333
+
334
+ ```
335
+ import { Mastra } from '@mastra/core';
336
+ import '@mastra/observability/init'; // Explicit import
337
+
338
+ const mastra = new Mastra({
339
+ ...other_config,
340
+ observability: {
341
+ default: { enabled: true }
342
+ }
343
+ });
344
+ ```
345
+
346
+ Also renamed a bunch of:
347
+ - `Tracing` things to `Observability` things.
348
+ - `AI-` things to just things.
349
+
350
+ - Changing getAgents -> listAgents, getTools -> listTools, getWorkflows -> listWorkflows ([#9495](https://github.com/mastra-ai/mastra/pull/9495))
351
+
352
+ - Removed old tracing code based on OpenTelemetry ([#9237](https://github.com/mastra-ai/mastra/pull/9237))
353
+
354
+ - Remove deprecated vector prompts and cohere provider from code ([#9596](https://github.com/mastra-ai/mastra/pull/9596))
355
+
356
+ - Mark as stable ([`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc))
357
+
358
+ - Enforcing id required on Processor primitive ([#9591](https://github.com/mastra-ai/mastra/pull/9591))
359
+
360
+ - **Breaking Changes:** ([#9045](https://github.com/mastra-ai/mastra/pull/9045))
361
+ - Moved `generateTitle` from `threads.generateTitle` to top-level memory option
362
+ - Changed default value from `true` to `false`
363
+ - Using `threads.generateTitle` now throws an error
364
+
365
+ **Migration:**
366
+ Replace `threads: { generateTitle: true }` with `generateTitle: true` at the top level of memory options.
367
+
368
+ **Playground:**
369
+ The playground UI now displays thread IDs instead of "Chat from" when titles aren't generated.
370
+
371
+ - Renamed `MastraMessageV2` to `MastraDBMessage` ([#9255](https://github.com/mastra-ai/mastra/pull/9255))
372
+ Made the return format of all methods that return db messages consistent. It's always `{ messages: MastraDBMessage[] }` now, and messages can be converted after that using `@mastra/ai-sdk/ui`'s `toAISdkV4/5Messages()` function
373
+
374
+ - moved ai-tracing code into @mastra/observability ([#9661](https://github.com/mastra-ai/mastra/pull/9661))
375
+
376
+ - Remove legacy evals from Mastra ([#9491](https://github.com/mastra-ai/mastra/pull/9491))
377
+
378
+ - Removes deprecated input-processor type and processors. ([#9200](https://github.com/mastra-ai/mastra/pull/9200))
379
+
380
+ ### Minor Changes
381
+
382
+ - **BREAKING CHANGE**: Memory scope defaults changed from 'thread' to 'resource' ([#8983](https://github.com/mastra-ai/mastra/pull/8983))
383
+
384
+ Both `workingMemory.scope` and `semanticRecall.scope` now default to `'resource'` instead of `'thread'`. This means:
385
+ - Working memory persists across all conversations for the same user/resource
386
+ - Semantic recall searches across all threads for the same user/resource
387
+
388
+ **Migration**: To maintain the previous thread-scoped behavior, explicitly set `scope: 'thread'`:
389
+
390
+ ```typescript
391
+ memory: new Memory({
392
+ storage,
393
+ workingMemory: {
394
+ enabled: true,
395
+ scope: 'thread', // Explicitly set for thread-scoped behavior
396
+ },
397
+ semanticRecall: {
398
+ scope: 'thread', // Explicitly set for thread-scoped behavior
399
+ },
400
+ }),
401
+ ```
402
+
403
+ See the [migration guide](https://mastra.ai/docs/guides/migrations/memory-scope-defaults) for more details.
404
+
405
+ Also fixed issues where playground semantic recall search could show missing or incorrect results in certain cases.
406
+
407
+ - Rename LLM span types and attributes to use Model prefix ([#9105](https://github.com/mastra-ai/mastra/pull/9105))
408
+
409
+ BREAKING CHANGE: This release renames tracing span types and attribute interfaces to use the "Model" prefix instead of "LLM":
410
+ - `AISpanType.LLM_GENERATION` → `AISpanType.MODEL_GENERATION`
411
+ - `AISpanType.LLM_STEP` → `AISpanType.MODEL_STEP`
412
+ - `AISpanType.LLM_CHUNK` → `AISpanType.MODEL_CHUNK`
413
+ - `LLMGenerationAttributes` → `ModelGenerationAttributes`
414
+ - `LLMStepAttributes` → `ModelStepAttributes`
415
+ - `LLMChunkAttributes` → `ModelChunkAttributes`
416
+ - `InternalSpans.LLM` → `InternalSpans.MODEL`
417
+
418
+ This change better reflects that these span types apply to all AI models, not just Large Language Models.
419
+
420
+ Migration guide:
421
+ - Update all imports: `import { ModelGenerationAttributes } from '@mastra/core/ai-tracing'`
422
+ - Update span type references: `AISpanType.MODEL_GENERATION`
423
+ - Update InternalSpans usage: `InternalSpans.MODEL`
424
+
425
+ ### Patch Changes
426
+
427
+ - Add exponential backoff to model retry logic to prevent cascading failures ([#9798](https://github.com/mastra-ai/mastra/pull/9798))
428
+
429
+ When AI model calls fail, the system now implements exponential backoff (1s, 2s, 4s, 8s, max 10s) before retrying instead of immediately hammering the API. This prevents:
430
+ - Rate limit violations from getting worse
431
+ - Cascading failures across all fallback models
432
+ - Wasted API quota by burning through retries instantly
433
+ - Production outages when all models fail due to rate limits
434
+
435
+ The backoff gives APIs time to recover from transient failures and rate limiting.
436
+
437
+ - Update provider registry and model documentation with latest models and providers ([`f743dbb`](https://github.com/mastra-ai/mastra/commit/f743dbb8b40d1627b5c10c0e6fc154f4ebb6e394))
438
+
439
+ - Fix agent onChunk callback receiving wrapped chunk instead of direct chunk ([#9350](https://github.com/mastra-ai/mastra/pull/9350))
440
+
441
+ - Deprecate `runCount` parameter in favor of `retryCount` for better naming clarity. The name `runCount` was misleading as it doesn't represent the total number of times a step has run, but rather the number of retry attempts made for a step. ([#9153](https://github.com/mastra-ai/mastra/pull/9153))
442
+
443
+ `runCount` is available in `execute()` functions and methods that interact with the step execution. This also applies to condition functions and loop condition functions that use this parameter. If your code uses `runCount`, change the name to `retryCount`.
444
+
445
+ Here's an example migration:
446
+
447
+ ```diff
448
+ const myStep = createStep({
449
+ // Rest of step...
450
+ - execute: async ({ runCount, ...params }) => {
451
+ + execute: async ({ retryCount, ...params }) => {
452
+ // ... rest of your logic
453
+ }
454
+ });
455
+ ```
456
+
457
+ - Set correct peer dependency range for `@mastra/observability` ([#9908](https://github.com/mastra-ai/mastra/pull/9908))
458
+
459
+ - Add requestContext column if it does not exist ([#9786](https://github.com/mastra-ai/mastra/pull/9786))
460
+
461
+ - Add serializedStepGraph to runExecutionResult response ([#10004](https://github.com/mastra-ai/mastra/pull/10004))
462
+
463
+ - Track usage in workflow and agent network ([#9649](https://github.com/mastra-ai/mastra/pull/9649))
464
+
465
+ - Allow resuming nested workflow step with chained id ([#9459](https://github.com/mastra-ai/mastra/pull/9459))
466
+
467
+ Example, you have a workflow like this
468
+
469
+ ```
470
+ export const supportWorkflow = mainWorkflow.then(nestedWorkflow).commit();
471
+ ```
472
+
473
+ And a step in `nestedWorkflow` is supsended, you can now also resume it any of these ways:
474
+
475
+ ```
476
+ run.resume({
477
+ step: "nestedWorkflow.suspendedStep", //chained nested workflow step id and suspended step id
478
+ //other resume params
479
+ })
480
+ ```
481
+
482
+ OR
483
+
484
+ ```
485
+ run.resume({
486
+ step: "nestedWorkflow", // just the nested workflow step/step id
487
+ //other resume params
488
+ })
489
+ ```
490
+
491
+ - Fix OpenAI schema validation errors in processors ([#9093](https://github.com/mastra-ai/mastra/pull/9093))
492
+
493
+ - Breaking change to move mcp related tool execute arguments nested under an `mcp` argument that is only populated if the tool is passed to an MCPServer. This simpliflies tool definitions and gives you the correct types when working with tools meant for MCP servers. ([#9134](https://github.com/mastra-ai/mastra/pull/9134))
494
+
495
+ - Ensure model_generation spans end before agent_run spans. ([#9251](https://github.com/mastra-ai/mastra/pull/9251))
496
+
497
+ - Fix workflow input property preservation after resume from snapshot ([#9380](https://github.com/mastra-ai/mastra/pull/9380))
498
+
499
+ Ensure that when resuming a workflow from a snapshot, the input property is correctly set from the snapshot's context input rather than from resume data. This prevents the loss of original workflow input data during suspend/resume cycles.
500
+
501
+ - Add tool call approval ([#8649](https://github.com/mastra-ai/mastra/pull/8649))
502
+
503
+ - Fix error handling and serialization in agent streaming to ensure errors are consistently exposed and preserved. ([#9144](https://github.com/mastra-ai/mastra/pull/9144))
504
+
505
+ - Fixes issue where clicking the reset button in the model picker would fail to restore the original LanguageModelV2 (or any other types) object that was passed during agent construction. ([#9481](https://github.com/mastra-ai/mastra/pull/9481))
506
+
507
+ - Fix a bug where streaming didn't output the final chunk ([#9546](https://github.com/mastra-ai/mastra/pull/9546))
508
+
509
+ - Don't call `os.homedir()` at top level (but lazy invoke it) to accommodate sandboxed environments ([#9211](https://github.com/mastra-ai/mastra/pull/9211))
510
+
511
+ - Fix: Don't download unsupported media ([#9209](https://github.com/mastra-ai/mastra/pull/9209))
512
+
513
+ - Detect thenable objects returned by AI model providers ([#8905](https://github.com/mastra-ai/mastra/pull/8905))
514
+
515
+ - Fixes incorrect tool invocation format in message list that was causing client tools to fail during message format conversions. ([#9590](https://github.com/mastra-ai/mastra/pull/9590))
516
+
517
+ - Bug fix: Use input processors that are passed in generate or stream agent options rather than always defaulting to the processors set on the Agent class. ([#9407](https://github.com/mastra-ai/mastra/pull/9407))
518
+
519
+ - Fix tool input validation to use schema-compat transformed schemas ([#9258](https://github.com/mastra-ai/mastra/pull/9258))
520
+
521
+ Previously, tool input validation used the original Zod schema while the LLM received a schema-compat transformed version. This caused validation failures when LLMs (like OpenAI o3 or Claude 3.5 Haiku) sent arguments matching the transformed schema but not the original.
522
+
523
+ For example:
524
+ - OpenAI o3 reasoning models convert `.optional()` to `.nullable()`, sending `null` values
525
+ - Claude 3.5 Haiku strips `min`/`max` string constraints, sending shorter strings
526
+ - Validation would reject these valid responses because it checked against the original schema
527
+
528
+ The fix ensures validation uses the same schema-compat processed schema that was sent to the LLM, eliminating this mismatch.
529
+
530
+ - Add import for WriteableStream in execution-engine and dedupe llm.getModel in agent.ts ([#9185](https://github.com/mastra-ai/mastra/pull/9185))
531
+
532
+ - Use a shared `getAllToolPaths()` method from the bundler to discover tool paths. ([#9204](https://github.com/mastra-ai/mastra/pull/9204))
533
+
534
+ - Added support for .streamVNext and .stream that uses it in the inngest execution engine ([#9434](https://github.com/mastra-ai/mastra/pull/9434))
535
+
536
+ - pass writableStream parameter to workflow execution ([#9139](https://github.com/mastra-ai/mastra/pull/9139))
537
+
538
+ - Remove tools passed to the Routing Agent in .network() ([#9374](https://github.com/mastra-ai/mastra/pull/9374))
539
+
540
+ - Fix agent network iteration counter bug causing infinite loops ([#9762](https://github.com/mastra-ai/mastra/pull/9762))
541
+
542
+ The iteration counter in agent networks was stuck at 0 due to a faulty ternary operator that treated 0 as falsy. This prevented `maxSteps` from working correctly, causing infinite loops when the routing agent kept selecting primitives instead of returning "none".
543
+
544
+ **Changes:**
545
+ - Fixed iteration counter logic in `loop/network/index.ts` from `(inputData.iteration ? inputData.iteration : -1) + 1` to `(inputData.iteration ?? -1) + 1`
546
+ - Changed initial iteration value from `0` to `-1` so first iteration correctly starts at 0
547
+ - Added `checkIterations()` helper to validate iteration counting in all network tests
548
+
549
+ Fixes #9314
550
+
551
+ - Fix types from ai v4 ([#9818](https://github.com/mastra-ai/mastra/pull/9818))
552
+
553
+ - Add restart method to workflow run that allows restarting an active workflow run ([#9750](https://github.com/mastra-ai/mastra/pull/9750))
554
+ Add status filter to `listWorkflowRuns`
555
+ Add automatic restart to restart active workflow runs when server starts
556
+
557
+ - Save correct status in snapshot for all workflow parallel steps. ([#9379](https://github.com/mastra-ai/mastra/pull/9379))
558
+ This ensures when you poll workflow run result using `getWorkflowRunExecutionResult(runId)`, you get the right status for all parallel steps
559
+
560
+ - Prevent changing workflow status to suspended when some parallel steps are still running ([#9431](https://github.com/mastra-ai/mastra/pull/9431))
561
+
562
+ - Add ability to pass agent options when wrapping an agent with createStep. This allows configuring agent execution settings when using agents as workflow steps. ([#9199](https://github.com/mastra-ai/mastra/pull/9199))
563
+
564
+ - Fix MCP server registration ([#9802](https://github.com/mastra-ai/mastra/pull/9802))
565
+
566
+ - Fix network loop iteration counter and usage promise handling: ([#9408](https://github.com/mastra-ai/mastra/pull/9408))
567
+ - Fixed iteration counter in network loop that was stuck at 0 due to falsy check. Properly handled zero values to ensure maxSteps is correctly enforced.
568
+ - Fixed usage promise resolution in RunOutput stream by properly resolving or rejecting the promise on stream close, preventing hanging promises when streams complete.
569
+
570
+ - Remove `waitForEvent` from workflows. `waitForEvent` is now removed, please use suspend & resume flow instead. See https://mastra.ai/en/docs/workflows/suspend-and-resume for more details on suspend & resume flow. ([#9214](https://github.com/mastra-ai/mastra/pull/9214))
571
+
572
+ - Workflow validation zod v4 support ([#9319](https://github.com/mastra-ai/mastra/pull/9319))
573
+
574
+ - Use memory mock in server tests ([#9486](https://github.com/mastra-ai/mastra/pull/9486))
575
+
576
+ - Fix network routing agent smoothstreaming ([#9247](https://github.com/mastra-ai/mastra/pull/9247))
577
+
578
+ - Remove format from stream/generate ([#9577](https://github.com/mastra-ai/mastra/pull/9577))
579
+
580
+ - Fix agent network working memory tool routing. Memory tools are now included in routing agent instructions but excluded from its direct tool calls, allowing the routing agent to properly route to tool execution steps for memory updates. ([#9428](https://github.com/mastra-ai/mastra/pull/9428))
581
+
582
+ - Fix creating system messages from inside processors using processInput. ([#9469](https://github.com/mastra-ai/mastra/pull/9469))
583
+
584
+ - Fix usage tracking with agent network ([#9226](https://github.com/mastra-ai/mastra/pull/9226))
585
+
586
+ - Fix message conversion for incomplete client-side tool calls ([#9749](https://github.com/mastra-ai/mastra/pull/9749))
587
+
588
+ Fixed handling of `input-available` tool state in `sanitizeV5UIMessages()` to differentiate between two use cases:
589
+ 1. **Response messages FROM the LLM**: Keep `input-available` states (tool calls waiting for client-side execution) in `response.messages` for proper message history.
590
+ 2. **Prompt messages TO the LLM**: Filter out `input-available` states when sending historical messages back to the LLM, as these incomplete tool calls (without results) cause errors in the OpenAI Responses API.
591
+
592
+ The fix adds a `filterIncompleteToolCalls` parameter to control this behavior based on whether messages are being sent to or received from the LLM.
593
+
594
+ - Make suspendPayload optional when calling `suspend()` ([#9926](https://github.com/mastra-ai/mastra/pull/9926))
595
+ Save value returned as `suspendOutput` if user returns data still after calling `suspend()`
596
+ Automatically call `commit()` on uncommitted workflows when registering in Mastra instance
597
+ Show actual suspendPayload on Studio in suspend/resume flow
598
+
599
+ - Add `initialState` and `outputOptions` to run.stream() call. ([#9238](https://github.com/mastra-ai/mastra/pull/9238))
600
+
601
+ Example code
602
+
603
+ ```
604
+ const run = await workflow.createRunAsync();
605
+
606
+ const streamResult = run.stream({
607
+ inputData: {},
608
+ initialState: { value: 'test-state', otherValue: 'test-other-state' },
609
+ outputOptions: { includeState: true },
610
+ });
611
+ ```
612
+
613
+ Then the result from the stream will include the final state information
614
+
615
+ ```
616
+ const executionResult = await streamResult.result;
617
+ console.log(executionResult.state)
618
+ ```
619
+
620
+ - Add visual styles and labels for more workflow node types ([#9777](https://github.com/mastra-ai/mastra/pull/9777))
621
+
622
+ - Updated dependencies [[`b9b7ffd`](https://github.com/mastra-ai/mastra/commit/b9b7ffdad6936a7d50b6b814b5bbe54e19087f66), [`dd1c38d`](https://github.com/mastra-ai/mastra/commit/dd1c38d1b75f1b695c27b40d8d9d6ed00d5e0f6f), [`83b08dc`](https://github.com/mastra-ai/mastra/commit/83b08dcf1bfcc915efab23c09207df90fa247908), [`f0f8f12`](https://github.com/mastra-ai/mastra/commit/f0f8f125c308f2d0fd36942ef652fd852df7522f), [`f111eac`](https://github.com/mastra-ai/mastra/commit/f111eac5de509b2e5fccfc1882e7f74cda264c74), [`51acef9`](https://github.com/mastra-ai/mastra/commit/51acef95b5977826594fe3ee24475842bd3d5780), [`eb09742`](https://github.com/mastra-ai/mastra/commit/eb09742197f66c4c38154c3beec78313e69760b2), [`354ad0b`](https://github.com/mastra-ai/mastra/commit/354ad0b7b1b8183ac567f236a884fc7ede6d7138), [`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc), [`a0c8c1b`](https://github.com/mastra-ai/mastra/commit/a0c8c1b87d4fee252aebda73e8637fbe01d761c9)]:
623
+ - @mastra/schema-compat@0.0.0-export-agent-memory-from-local-studio-20251112153946
624
+ - @mastra/observability@0.0.0-export-agent-memory-from-local-studio-20251112153946
625
+
626
+ ## 1.0.0-beta.2
627
+
628
+ ### Patch Changes
629
+
630
+ - Make suspendPayload optional when calling `suspend()` ([#9926](https://github.com/mastra-ai/mastra/pull/9926))
631
+ Save value returned as `suspendOutput` if user returns data still after calling `suspend()`
632
+ Automatically call `commit()` on uncommitted workflows when registering in Mastra instance
633
+ Show actual suspendPayload on Studio in suspend/resume flow
634
+
635
+ ## 1.0.0-beta.1
636
+
637
+ ### Patch Changes
638
+
639
+ - Set correct peer dependency range for `@mastra/observability` ([#9908](https://github.com/mastra-ai/mastra/pull/9908))
640
+
641
+ - Add visual styles and labels for more workflow node types ([#9777](https://github.com/mastra-ai/mastra/pull/9777))
642
+
643
+ ## 1.0.0-beta.0
644
+
645
+ ### Major Changes
646
+
647
+ - Moving scorers under the eval domain, api method consistency, prebuilt evals, scorers require ids. ([#9589](https://github.com/mastra-ai/mastra/pull/9589))
648
+
649
+ - **BREAKING CHANGE**: Scorers for Agents will now use `MastraDBMessage` instead of `UIMessage` ([#9702](https://github.com/mastra-ai/mastra/pull/9702))
650
+ - Scorer input/output types now use `MastraDBMessage[]` with nested `content` object structure
651
+ - Added `getTextContentFromMastraDBMessage()` helper function to extract text content from `MastraDBMessage` objects
652
+ - Added `createTestMessage()` helper function for creating `MastraDBMessage` objects in tests with optional tool invocations support
653
+ - Updated `extractToolCalls()` to access tool invocations from nested `content` structure
654
+ - Updated `getUserMessageFromRunInput()` and `getAssistantMessageFromRunOutput()` to use new message structure
655
+ - Removed `createUIMessage()`
656
+
657
+ - Every Mastra primitive (agent, MCPServer, workflow, tool, processor, scorer, and vector) now has a get, list, and add method associated with it. Each primitive also now requires an id to be set. ([#9675](https://github.com/mastra-ai/mastra/pull/9675))
658
+
659
+ Primitives that are added to other primitives are also automatically added to the Mastra instance
660
+
661
+ - Update handlers to use `listWorkflowRuns` instead of `getWorkflowRuns`. Fix type names from `StoragelistThreadsByResourceIdInput/Output` to `StorageListThreadsByResourceIdInput/Output`. ([#9507](https://github.com/mastra-ai/mastra/pull/9507))
662
+
663
+ - **BREAKING:** Remove `getMessagesPaginated()` and add `perPage: false` support ([#9670](https://github.com/mastra-ai/mastra/pull/9670))
664
+
665
+ Removes deprecated `getMessagesPaginated()` method. The `listMessages()` API and score handlers now support `perPage: false` to fetch all records without pagination limits.
666
+
667
+ **Storage changes:**
668
+ - `StoragePagination.perPage` type changed from `number` to `number | false`
669
+ - All storage implementations support `perPage: false`:
670
+ - Memory: `listMessages()`
671
+ - Scores: `listScoresBySpan()`, `listScoresByRunId()`, `listScoresByExecutionId()`
672
+ - HTTP query parser accepts `"false"` string (e.g., `?perPage=false`)
673
+
674
+ **Memory changes:**
675
+ - `memory.query()` parameter type changed from `StorageGetMessagesArg` to `StorageListMessagesInput`
676
+ - Uses flat parameters (`page`, `perPage`, `include`, `filter`, `vectorSearchString`) instead of `selectBy` object
677
+
678
+ **Stricter validation:**
679
+ - `listMessages()` requires non-empty, non-whitespace `threadId` (throws error instead of returning empty results)
680
+
681
+ **Migration:**
682
+
683
+ ```typescript
684
+ // Storage/Memory: Replace getMessagesPaginated with listMessages
685
+ - storage.getMessagesPaginated({ threadId, selectBy: { pagination: { page: 0, perPage: 20 } } })
686
+ + storage.listMessages({ threadId, page: 0, perPage: 20 })
687
+ + storage.listMessages({ threadId, page: 0, perPage: false }) // Fetch all
688
+
689
+ // Memory: Replace selectBy with flat parameters
690
+ - memory.query({ threadId, selectBy: { last: 20, include: [...] } })
691
+ + memory.query({ threadId, perPage: 20, include: [...] })
692
+
693
+ // Client SDK
694
+ - thread.getMessagesPaginated({ selectBy: { pagination: { page: 0 } } })
695
+ + thread.listMessages({ page: 0, perPage: 20 })
696
+ ```
697
+
698
+ - # Major Changes ([#9695](https://github.com/mastra-ai/mastra/pull/9695))
699
+
700
+ ## Storage Layer
701
+
702
+ ### BREAKING: Removed `storage.getMessages()`
703
+
704
+ The `getMessages()` method has been removed from all storage implementations. Use `listMessages()` instead, which provides pagination support.
705
+
706
+ **Migration:**
707
+
708
+ ```typescript
709
+ // Before
710
+ const messages = await storage.getMessages({ threadId: 'thread-1' });
711
+
712
+ // After
713
+ const result = await storage.listMessages({
714
+ threadId: 'thread-1',
715
+ page: 0,
716
+ perPage: 50,
717
+ });
718
+ const messages = result.messages; // Access messages array
719
+ console.log(result.total); // Total count
720
+ console.log(result.hasMore); // Whether more pages exist
721
+ ```
722
+
723
+ ### Message ordering default
724
+
725
+ `listMessages()` defaults to ASC (oldest first) ordering by `createdAt`, matching the previous `getMessages()` behavior.
726
+
727
+ **To use DESC ordering (newest first):**
728
+
729
+ ```typescript
730
+ const result = await storage.listMessages({
731
+ threadId: 'thread-1',
732
+ orderBy: { field: 'createdAt', direction: 'DESC' },
733
+ });
734
+ ```
735
+
736
+ ## Client SDK
737
+
738
+ ### BREAKING: Renamed `client.getThreadMessages()` → `client.listThreadMessages()`
739
+
740
+ **Migration:**
741
+
742
+ ```typescript
743
+ // Before
744
+ const response = await client.getThreadMessages(threadId, { agentId });
745
+
746
+ // After
747
+ const response = await client.listThreadMessages(threadId, { agentId });
748
+ ```
749
+
750
+ The response format remains the same.
751
+
752
+ ## Type Changes
753
+
754
+ ### BREAKING: Removed `StorageGetMessagesArg` type
755
+
756
+ Use `StorageListMessagesInput` instead:
757
+
758
+ ```typescript
759
+ // Before
760
+ import type { StorageGetMessagesArg } from '@mastra/core';
761
+
762
+ // After
763
+ import type { StorageListMessagesInput } from '@mastra/core';
764
+ ```
765
+
766
+ - - Removes modelSettings.abortSignal in favour of top-level abortSignal only. Also removes the deprecated output field - use structuredOutput.schema instead. ([`9e1911d`](https://github.com/mastra-ai/mastra/commit/9e1911db2b4db85e0e768c3f15e0d61e319869f6))
767
+ - The deprecated generateVNext() and streamVNext() methods have been removed since they're now the stable generate() and stream() methods.
768
+ - The deprecated `output` option has been removed entirely, in favour of `structuredOutput`.
769
+
770
+ Method renames to clarify the API surface:
771
+ - getDefaultGenerateOptions → getDefaultGenerateOptionsLegacy
772
+ - getDefaultStreamOptions → getDefaultStreamOptionsLegacy
773
+ - getDefaultVNextStreamOptions → getDefaultStreamOptions
774
+
775
+ - Bump minimum required Node.js version to 22.13.0 ([#9706](https://github.com/mastra-ai/mastra/pull/9706))
776
+
777
+ - Replace `getThreadsByResourceIdPaginated` with `listThreadsByResourceId` across memory handlers. Update client SDK to use `listThreads()` with `offset`/`limit` parameters instead of deprecated `getMemoryThreads()`. Consolidate `/api/memory/threads` routes to single paginated endpoint. ([#9508](https://github.com/mastra-ai/mastra/pull/9508))
778
+
779
+ - Add new list methods to storage API: `listMessages`, `listMessagesById`, `listThreadsByResourceId`, and `listWorkflowRuns`. Most methods are currently wrappers around existing methods. Full implementations will be added when migrating away from legacy methods. ([#9489](https://github.com/mastra-ai/mastra/pull/9489))
780
+
781
+ - Update tool execution signature ([#9587](https://github.com/mastra-ai/mastra/pull/9587))
782
+
783
+ Consolidated the 3 different execution contexts to one
784
+
785
+ ```typescript
786
+ // before depending on the context the tool was executed in
787
+ tool.execute({ context: data });
788
+ tool.execute({ context: { inputData: data } });
789
+ tool.execute(data);
790
+
791
+ // now, for all contexts
792
+ tool.execute(data, context);
793
+ ```
794
+
795
+ **Before:**
796
+
797
+ ```typescript
798
+ inputSchema: z.object({ something: z.string() }),
799
+ execute: async ({ context, tracingContext, runId, ... }) => {
800
+ return doSomething(context.string);
801
+ }
802
+ ```
803
+
804
+ **After:**
805
+
806
+ ```typescript
807
+ inputSchema: z.object({ something: z.string() }),
808
+ execute: async (inputData, context) => {
809
+ const { agent, mcp, workflow, ...sharedContext } = context
810
+
811
+ // context that only an agent would get like toolCallId, messages, suspend, resume, etc
812
+ if (agent) {
813
+ doSomething(inputData.something, agent)
814
+ // context that only a workflow would get like runId, state, suspend, resume, etc
815
+ } else if (workflow) {
816
+ doSomething(inputData.something, workflow)
817
+ // context that only a workflow would get like "extra", "elicitation"
818
+ } else if (mcp) {
819
+ doSomething(inputData.something, mcp)
820
+ } else {
821
+ // Running a tool in no execution context
822
+ return doSomething(inputData.something);
823
+ }
824
+ }
825
+ ```
826
+
827
+ - The `@mastra/core` package no longer allows top-level imports except for `Mastra` and `type Config`. You must use subpath imports for all other imports. ([#9544](https://github.com/mastra-ai/mastra/pull/9544))
828
+
829
+ For example:
830
+
831
+ ```diff
832
+ import { Mastra, type Config } from "@mastra/core";
833
+ - import { Agent } from "@mastra/core";
834
+ - import { createTool } from "@mastra/core";
835
+ - import { createStep } from "@mastra/core";
836
+
837
+ + import { Agent } from "@mastra/core/agent";
838
+ + import { createTool } from "@mastra/core/tools";
839
+ + import { createStep } from "@mastra/core/workflows";
840
+ ```
841
+
842
+ - This simplifies the Memory API by removing the confusing rememberMessages method and renaming query to recall for better clarity. ([#9701](https://github.com/mastra-ai/mastra/pull/9701))
843
+
844
+ The rememberMessages method name implied it might persist data when it was actually just retrieving messages, same as query. Having two methods that did essentially the same thing was unnecessary.
845
+
846
+ Before:
847
+
848
+ ```typescript
849
+ // Two methods that did the same thing
850
+ memory.rememberMessages({ threadId, resourceId, config, vectorMessageSearch });
851
+ memory.query({ threadId, resourceId, perPage, vectorSearchString });
852
+ ```
853
+
854
+ After:
855
+
856
+ ```typescript
857
+ // Single unified method with clear purpose
858
+ memory.recall({ threadId, resourceId, perPage, vectorMessageSearch, threadConfig });
859
+ ```
860
+
861
+ All usages have been updated across the codebase including tests. The agent now calls recall directly with the appropriate parameters.
862
+
863
+ - Rename RuntimeContext to RequestContext ([#9511](https://github.com/mastra-ai/mastra/pull/9511))
864
+
865
+ - Implement listMessages API for replacing previous methods ([#9531](https://github.com/mastra-ai/mastra/pull/9531))
866
+
867
+ - Rename `defaultVNextStreamOptions` to `defaultOptions`. Add "Legacy" suffix to v1 option properties and methods (`defaultGenerateOptions` → `defaultGenerateOptionsLegacy`, `defaultStreamOptions` → `defaultStreamOptionsLegacy`). ([#9535](https://github.com/mastra-ai/mastra/pull/9535))
868
+
869
+ - Remove `getThreadsByResourceId` and `getThreadsByResourceIdPaginated` methods from storage interfaces in favor of `listThreadsByResourceId`. The new method uses `offset`/`limit` pagination and a nested `orderBy` object structure (`{ field, direction }`). ([#9536](https://github.com/mastra-ai/mastra/pull/9536))
870
+
871
+ - Remove `getMessagesById` method from storage interfaces in favor of `listMessagesById`. The new method only returns V2-format messages and removes the format parameter, simplifying the API surface. Users should migrate from `getMessagesById({ messageIds, format })` to `listMessagesById({ messageIds })`. ([#9534](https://github.com/mastra-ai/mastra/pull/9534))
872
+
873
+ - Experimental auth -> auth ([#9660](https://github.com/mastra-ai/mastra/pull/9660))
874
+
875
+ - Renamed a bunch of observability/tracing-related things to drop the AI prefix. ([#9744](https://github.com/mastra-ai/mastra/pull/9744))
876
+
877
+ - Removed MastraMessageV3 intermediary format, now we go from MastraDBMessage->aiv5 formats and back directly ([#9094](https://github.com/mastra-ai/mastra/pull/9094))
878
+
879
+ - **Breaking Change**: Remove legacy v1 watch events and consolidate on v2 implementation. ([#9252](https://github.com/mastra-ai/mastra/pull/9252))
880
+
881
+ This change simplifies the workflow watching API by removing the legacy v1 event system and promoting v2 as the standard (renamed to just `watch`).
882
+
883
+ ### What's Changed
884
+ - Removed legacy v1 watch event handlers and types
885
+ - Renamed `watch-v2` to `watch` throughout the codebase
886
+ - Removed `.watch()` method from client-js SDK (`Workflow` and `AgentBuilder` classes)
887
+ - Removed `/watch` HTTP endpoints from server and deployer
888
+ - Removed `WorkflowWatchResult` and v1 `WatchEvent` types
889
+
890
+ - Remove various deprecated APIs from agent class. ([#9257](https://github.com/mastra-ai/mastra/pull/9257))
891
+ - `agent.llm` → `agent.getLLM()`
892
+ - `agent.tools` → `agent.getTools()`
893
+ - `agent.instructions` → `agent.getInstructions()`
894
+ - `agent.speak()` → `agent.voice.speak()`
895
+ - `agent.getSpeakers()` → `agent.voice.getSpeakers()`
896
+ - `agent.listen` → `agent.voice.listen()`
897
+ - `agent.fetchMemory` → `(await agent.getMemory()).query()`
898
+ - `agent.toStep` → Add agent directly to the step, workflows handle the transformation
899
+
900
+ - **BREAKING CHANGE**: Pagination APIs now use `page`/`perPage` instead of `offset`/`limit` ([#9592](https://github.com/mastra-ai/mastra/pull/9592))
901
+
902
+ All storage and memory pagination APIs have been updated to use `page` (0-indexed) and `perPage` instead of `offset` and `limit`, aligning with standard REST API patterns.
903
+
904
+ **Affected APIs:**
905
+ - `Memory.listThreadsByResourceId()`
906
+ - `Memory.listMessages()`
907
+ - `Storage.listWorkflowRuns()`
908
+
909
+ **Migration:**
910
+
911
+ ```typescript
912
+ // Before
913
+ await memory.listThreadsByResourceId({
914
+ resourceId: 'user-123',
915
+ offset: 20,
916
+ limit: 10,
917
+ });
918
+
919
+ // After
920
+ await memory.listThreadsByResourceId({
921
+ resourceId: 'user-123',
922
+ page: 2, // page = Math.floor(offset / limit)
923
+ perPage: 10,
924
+ });
925
+
926
+ // Before
927
+ await memory.listMessages({
928
+ threadId: 'thread-456',
929
+ offset: 20,
930
+ limit: 10,
931
+ });
932
+
933
+ // After
934
+ await memory.listMessages({
935
+ threadId: 'thread-456',
936
+ page: 2,
937
+ perPage: 10,
938
+ });
939
+
940
+ // Before
941
+ await storage.listWorkflowRuns({
942
+ workflowName: 'my-workflow',
943
+ offset: 20,
944
+ limit: 10,
945
+ });
946
+
947
+ // After
948
+ await storage.listWorkflowRuns({
949
+ workflowName: 'my-workflow',
950
+ page: 2,
951
+ perPage: 10,
952
+ });
953
+ ```
954
+
955
+ **Additional improvements:**
956
+ - Added validation for negative `page` values in all storage implementations
957
+ - Improved `perPage` validation to handle edge cases (negative values, `0`, `false`)
958
+ - Added reusable query parser utilities for consistent validation in handlers
959
+
960
+ - ```([#9709](https://github.com/mastra-ai/mastra/pull/9709))
961
+ import { Mastra } from '@mastra/core';
962
+ import { Observability } from '@mastra/observability'; // Explicit import
963
+
964
+ const mastra = new Mastra({
965
+ ...other_config,
966
+ observability: new Observability({
967
+ default: { enabled: true }
968
+ }) // Instance
969
+ });
970
+ ```
971
+
972
+ Instead of:
973
+
974
+ ```
975
+ import { Mastra } from '@mastra/core';
976
+ import '@mastra/observability/init'; // Explicit import
977
+
978
+ const mastra = new Mastra({
979
+ ...other_config,
980
+ observability: {
981
+ default: { enabled: true }
982
+ }
983
+ });
984
+ ```
985
+
986
+ Also renamed a bunch of:
987
+ - `Tracing` things to `Observability` things.
988
+ - `AI-` things to just things.
989
+
990
+ - Changing getAgents -> listAgents, getTools -> listTools, getWorkflows -> listWorkflows ([#9495](https://github.com/mastra-ai/mastra/pull/9495))
991
+
992
+ - Removed old tracing code based on OpenTelemetry ([#9237](https://github.com/mastra-ai/mastra/pull/9237))
993
+
994
+ - Remove deprecated vector prompts and cohere provider from code ([#9596](https://github.com/mastra-ai/mastra/pull/9596))
995
+
996
+ - Mark as stable ([`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc))
997
+
998
+ - Enforcing id required on Processor primitive ([#9591](https://github.com/mastra-ai/mastra/pull/9591))
999
+
1000
+ - **Breaking Changes:** ([#9045](https://github.com/mastra-ai/mastra/pull/9045))
1001
+ - Moved `generateTitle` from `threads.generateTitle` to top-level memory option
1002
+ - Changed default value from `true` to `false`
1003
+ - Using `threads.generateTitle` now throws an error
1004
+
1005
+ **Migration:**
1006
+ Replace `threads: { generateTitle: true }` with `generateTitle: true` at the top level of memory options.
1007
+
1008
+ **Playground:**
1009
+ The playground UI now displays thread IDs instead of "Chat from" when titles aren't generated.
1010
+
1011
+ - Renamed `MastraMessageV2` to `MastraDBMessage` ([#9255](https://github.com/mastra-ai/mastra/pull/9255))
1012
+ Made the return format of all methods that return db messages consistent. It's always `{ messages: MastraDBMessage[] }` now, and messages can be converted after that using `@mastra/ai-sdk/ui`'s `toAISdkV4/5Messages()` function
1013
+
1014
+ - moved ai-tracing code into @mastra/observability ([#9661](https://github.com/mastra-ai/mastra/pull/9661))
1015
+
1016
+ - Remove legacy evals from Mastra ([#9491](https://github.com/mastra-ai/mastra/pull/9491))
1017
+
1018
+ - Removes deprecated input-processor type and processors. ([#9200](https://github.com/mastra-ai/mastra/pull/9200))
1019
+
1020
+ ### Minor Changes
1021
+
1022
+ - **BREAKING CHANGE**: Memory scope defaults changed from 'thread' to 'resource' ([#8983](https://github.com/mastra-ai/mastra/pull/8983))
1023
+
1024
+ Both `workingMemory.scope` and `semanticRecall.scope` now default to `'resource'` instead of `'thread'`. This means:
1025
+ - Working memory persists across all conversations for the same user/resource
1026
+ - Semantic recall searches across all threads for the same user/resource
1027
+
1028
+ **Migration**: To maintain the previous thread-scoped behavior, explicitly set `scope: 'thread'`:
1029
+
1030
+ ```typescript
1031
+ memory: new Memory({
1032
+ storage,
1033
+ workingMemory: {
1034
+ enabled: true,
1035
+ scope: 'thread', // Explicitly set for thread-scoped behavior
1036
+ },
1037
+ semanticRecall: {
1038
+ scope: 'thread', // Explicitly set for thread-scoped behavior
1039
+ },
1040
+ }),
1041
+ ```
1042
+
1043
+ See the [migration guide](https://mastra.ai/docs/guides/migrations/memory-scope-defaults) for more details.
1044
+
1045
+ Also fixed issues where playground semantic recall search could show missing or incorrect results in certain cases.
1046
+
1047
+ - Rename LLM span types and attributes to use Model prefix ([#9105](https://github.com/mastra-ai/mastra/pull/9105))
1048
+
1049
+ BREAKING CHANGE: This release renames tracing span types and attribute interfaces to use the "Model" prefix instead of "LLM":
1050
+ - `AISpanType.LLM_GENERATION` → `AISpanType.MODEL_GENERATION`
1051
+ - `AISpanType.LLM_STEP` → `AISpanType.MODEL_STEP`
1052
+ - `AISpanType.LLM_CHUNK` → `AISpanType.MODEL_CHUNK`
1053
+ - `LLMGenerationAttributes` → `ModelGenerationAttributes`
1054
+ - `LLMStepAttributes` → `ModelStepAttributes`
1055
+ - `LLMChunkAttributes` → `ModelChunkAttributes`
1056
+ - `InternalSpans.LLM` → `InternalSpans.MODEL`
1057
+
1058
+ This change better reflects that these span types apply to all AI models, not just Large Language Models.
1059
+
1060
+ Migration guide:
1061
+ - Update all imports: `import { ModelGenerationAttributes } from '@mastra/core/ai-tracing'`
1062
+ - Update span type references: `AISpanType.MODEL_GENERATION`
1063
+ - Update InternalSpans usage: `InternalSpans.MODEL`
1064
+
1065
+ ### Patch Changes
1066
+
1067
+ - Add exponential backoff to model retry logic to prevent cascading failures ([#9798](https://github.com/mastra-ai/mastra/pull/9798))
1068
+
1069
+ When AI model calls fail, the system now implements exponential backoff (1s, 2s, 4s, 8s, max 10s) before retrying instead of immediately hammering the API. This prevents:
1070
+ - Rate limit violations from getting worse
1071
+ - Cascading failures across all fallback models
1072
+ - Wasted API quota by burning through retries instantly
1073
+ - Production outages when all models fail due to rate limits
1074
+
1075
+ The backoff gives APIs time to recover from transient failures and rate limiting.
1076
+
1077
+ - Update provider registry and model documentation with latest models and providers ([`f743dbb`](https://github.com/mastra-ai/mastra/commit/f743dbb8b40d1627b5c10c0e6fc154f4ebb6e394))
1078
+
1079
+ - Fix agent onChunk callback receiving wrapped chunk instead of direct chunk ([#9350](https://github.com/mastra-ai/mastra/pull/9350))
1080
+
1081
+ - Deprecate `runCount` parameter in favor of `retryCount` for better naming clarity. The name `runCount` was misleading as it doesn't represent the total number of times a step has run, but rather the number of retry attempts made for a step. ([#9153](https://github.com/mastra-ai/mastra/pull/9153))
1082
+
1083
+ `runCount` is available in `execute()` functions and methods that interact with the step execution. This also applies to condition functions and loop condition functions that use this parameter. If your code uses `runCount`, change the name to `retryCount`.
1084
+
1085
+ Here's an example migration:
1086
+
1087
+ ```diff
1088
+ const myStep = createStep({
1089
+ // Rest of step...
1090
+ - execute: async ({ runCount, ...params }) => {
1091
+ + execute: async ({ retryCount, ...params }) => {
1092
+ // ... rest of your logic
1093
+ }
1094
+ });
1095
+ ```
1096
+
1097
+ - Add requestContext column if it does not exist ([#9786](https://github.com/mastra-ai/mastra/pull/9786))
1098
+
1099
+ - Track usage in workflow and agent network ([#9649](https://github.com/mastra-ai/mastra/pull/9649))
1100
+
1101
+ - Allow resuming nested workflow step with chained id ([#9459](https://github.com/mastra-ai/mastra/pull/9459))
1102
+
1103
+ Example, you have a workflow like this
1104
+
1105
+ ```
1106
+ export const supportWorkflow = mainWorkflow.then(nestedWorkflow).commit();
1107
+ ```
1108
+
1109
+ And a step in `nestedWorkflow` is supsended, you can now also resume it any of these ways:
1110
+
1111
+ ```
1112
+ run.resume({
1113
+ step: "nestedWorkflow.suspendedStep", //chained nested workflow step id and suspended step id
1114
+ //other resume params
1115
+ })
1116
+ ```
1117
+
1118
+ OR
1119
+
1120
+ ```
1121
+ run.resume({
1122
+ step: "nestedWorkflow", // just the nested workflow step/step id
1123
+ //other resume params
1124
+ })
1125
+ ```
1126
+
1127
+ - Fix OpenAI schema validation errors in processors ([#9093](https://github.com/mastra-ai/mastra/pull/9093))
1128
+
1129
+ - Breaking change to move mcp related tool execute arguments nested under an `mcp` argument that is only populated if the tool is passed to an MCPServer. This simpliflies tool definitions and gives you the correct types when working with tools meant for MCP servers. ([#9134](https://github.com/mastra-ai/mastra/pull/9134))
1130
+
1131
+ - Ensure model_generation spans end before agent_run spans. ([#9251](https://github.com/mastra-ai/mastra/pull/9251))
1132
+
1133
+ - Fix workflow input property preservation after resume from snapshot ([#9380](https://github.com/mastra-ai/mastra/pull/9380))
1134
+
1135
+ Ensure that when resuming a workflow from a snapshot, the input property is correctly set from the snapshot's context input rather than from resume data. This prevents the loss of original workflow input data during suspend/resume cycles.
1136
+
1137
+ - Add tool call approval ([#8649](https://github.com/mastra-ai/mastra/pull/8649))
1138
+
1139
+ - Fix error handling and serialization in agent streaming to ensure errors are consistently exposed and preserved. ([#9144](https://github.com/mastra-ai/mastra/pull/9144))
1140
+
1141
+ - Fixes issue where clicking the reset button in the model picker would fail to restore the original LanguageModelV2 (or any other types) object that was passed during agent construction. ([#9481](https://github.com/mastra-ai/mastra/pull/9481))
1142
+
1143
+ - Fix a bug where streaming didn't output the final chunk ([#9546](https://github.com/mastra-ai/mastra/pull/9546))
1144
+
1145
+ - Don't call `os.homedir()` at top level (but lazy invoke it) to accommodate sandboxed environments ([#9211](https://github.com/mastra-ai/mastra/pull/9211))
1146
+
1147
+ - Fix: Don't download unsupported media ([#9209](https://github.com/mastra-ai/mastra/pull/9209))
1148
+
1149
+ - Detect thenable objects returned by AI model providers ([#8905](https://github.com/mastra-ai/mastra/pull/8905))
1150
+
1151
+ - Fixes incorrect tool invocation format in message list that was causing client tools to fail during message format conversions. ([#9590](https://github.com/mastra-ai/mastra/pull/9590))
1152
+
1153
+ - Bug fix: Use input processors that are passed in generate or stream agent options rather than always defaulting to the processors set on the Agent class. ([#9407](https://github.com/mastra-ai/mastra/pull/9407))
1154
+
1155
+ - Fix tool input validation to use schema-compat transformed schemas ([#9258](https://github.com/mastra-ai/mastra/pull/9258))
1156
+
1157
+ Previously, tool input validation used the original Zod schema while the LLM received a schema-compat transformed version. This caused validation failures when LLMs (like OpenAI o3 or Claude 3.5 Haiku) sent arguments matching the transformed schema but not the original.
1158
+
1159
+ For example:
1160
+ - OpenAI o3 reasoning models convert `.optional()` to `.nullable()`, sending `null` values
1161
+ - Claude 3.5 Haiku strips `min`/`max` string constraints, sending shorter strings
1162
+ - Validation would reject these valid responses because it checked against the original schema
1163
+
1164
+ The fix ensures validation uses the same schema-compat processed schema that was sent to the LLM, eliminating this mismatch.
1165
+
1166
+ - Add import for WriteableStream in execution-engine and dedupe llm.getModel in agent.ts ([#9185](https://github.com/mastra-ai/mastra/pull/9185))
1167
+
1168
+ - Use a shared `getAllToolPaths()` method from the bundler to discover tool paths. ([#9204](https://github.com/mastra-ai/mastra/pull/9204))
1169
+
1170
+ - Added support for .streamVNext and .stream that uses it in the inngest execution engine ([#9434](https://github.com/mastra-ai/mastra/pull/9434))
1171
+
1172
+ - pass writableStream parameter to workflow execution ([#9139](https://github.com/mastra-ai/mastra/pull/9139))
1173
+
1174
+ - Remove tools passed to the Routing Agent in .network() ([#9374](https://github.com/mastra-ai/mastra/pull/9374))
1175
+
1176
+ - Fix agent network iteration counter bug causing infinite loops ([#9762](https://github.com/mastra-ai/mastra/pull/9762))
1177
+
1178
+ The iteration counter in agent networks was stuck at 0 due to a faulty ternary operator that treated 0 as falsy. This prevented `maxSteps` from working correctly, causing infinite loops when the routing agent kept selecting primitives instead of returning "none".
1179
+
1180
+ **Changes:**
1181
+ - Fixed iteration counter logic in `loop/network/index.ts` from `(inputData.iteration ? inputData.iteration : -1) + 1` to `(inputData.iteration ?? -1) + 1`
1182
+ - Changed initial iteration value from `0` to `-1` so first iteration correctly starts at 0
1183
+ - Added `checkIterations()` helper to validate iteration counting in all network tests
1184
+
1185
+ Fixes #9314
1186
+
1187
+ - Fix types from ai v4 ([#9818](https://github.com/mastra-ai/mastra/pull/9818))
1188
+
1189
+ - Save correct status in snapshot for all workflow parallel steps. ([#9379](https://github.com/mastra-ai/mastra/pull/9379))
1190
+ This ensures when you poll workflow run result using `getWorkflowRunExecutionResult(runId)`, you get the right status for all parallel steps
1191
+
1192
+ - Prevent changing workflow status to suspended when some parallel steps are still running ([#9431](https://github.com/mastra-ai/mastra/pull/9431))
1193
+
1194
+ - Add ability to pass agent options when wrapping an agent with createStep. This allows configuring agent execution settings when using agents as workflow steps. ([#9199](https://github.com/mastra-ai/mastra/pull/9199))
1195
+
1196
+ - Fix MCP server registration ([#9802](https://github.com/mastra-ai/mastra/pull/9802))
1197
+
1198
+ - Fix network loop iteration counter and usage promise handling: ([#9408](https://github.com/mastra-ai/mastra/pull/9408))
1199
+ - Fixed iteration counter in network loop that was stuck at 0 due to falsy check. Properly handled zero values to ensure maxSteps is correctly enforced.
1200
+ - Fixed usage promise resolution in RunOutput stream by properly resolving or rejecting the promise on stream close, preventing hanging promises when streams complete.
1201
+
1202
+ - Remove `waitForEvent` from workflows. `waitForEvent` is now removed, please use suspend & resume flow instead. See https://mastra.ai/en/docs/workflows/suspend-and-resume for more details on suspend & resume flow. ([#9214](https://github.com/mastra-ai/mastra/pull/9214))
1203
+
1204
+ - Workflow validation zod v4 support ([#9319](https://github.com/mastra-ai/mastra/pull/9319))
1205
+
1206
+ - Use memory mock in server tests ([#9486](https://github.com/mastra-ai/mastra/pull/9486))
1207
+
1208
+ - Fix network routing agent smoothstreaming ([#9247](https://github.com/mastra-ai/mastra/pull/9247))
1209
+
1210
+ - Remove format from stream/generate ([#9577](https://github.com/mastra-ai/mastra/pull/9577))
1211
+
1212
+ - Fix agent network working memory tool routing. Memory tools are now included in routing agent instructions but excluded from its direct tool calls, allowing the routing agent to properly route to tool execution steps for memory updates. ([#9428](https://github.com/mastra-ai/mastra/pull/9428))
1213
+
1214
+ - Fix creating system messages from inside processors using processInput. ([#9469](https://github.com/mastra-ai/mastra/pull/9469))
1215
+
1216
+ - Fix usage tracking with agent network ([#9226](https://github.com/mastra-ai/mastra/pull/9226))
1217
+
1218
+ - Fix message conversion for incomplete client-side tool calls ([#9749](https://github.com/mastra-ai/mastra/pull/9749))
1219
+
1220
+ Fixed handling of `input-available` tool state in `sanitizeV5UIMessages()` to differentiate between two use cases:
1221
+ 1. **Response messages FROM the LLM**: Keep `input-available` states (tool calls waiting for client-side execution) in `response.messages` for proper message history.
1222
+ 2. **Prompt messages TO the LLM**: Filter out `input-available` states when sending historical messages back to the LLM, as these incomplete tool calls (without results) cause errors in the OpenAI Responses API.
1223
+
1224
+ The fix adds a `filterIncompleteToolCalls` parameter to control this behavior based on whether messages are being sent to or received from the LLM.
1225
+
1226
+ - Add `initialState` and `outputOptions` to run.stream() call. ([#9238](https://github.com/mastra-ai/mastra/pull/9238))
1227
+
1228
+ Example code
1229
+
1230
+ ```
1231
+ const run = await workflow.createRunAsync();
1232
+
1233
+ const streamResult = run.stream({
1234
+ inputData: {},
1235
+ initialState: { value: 'test-state', otherValue: 'test-other-state' },
1236
+ outputOptions: { includeState: true },
1237
+ });
1238
+ ```
1239
+
1240
+ Then the result from the stream will include the final state information
1241
+
1242
+ ```
1243
+ const executionResult = await streamResult.result;
1244
+ console.log(executionResult.state)
1245
+ ```
1246
+
1247
+ - Updated dependencies [[`b9b7ffd`](https://github.com/mastra-ai/mastra/commit/b9b7ffdad6936a7d50b6b814b5bbe54e19087f66), [`dd1c38d`](https://github.com/mastra-ai/mastra/commit/dd1c38d1b75f1b695c27b40d8d9d6ed00d5e0f6f), [`83b08dc`](https://github.com/mastra-ai/mastra/commit/83b08dcf1bfcc915efab23c09207df90fa247908), [`f0f8f12`](https://github.com/mastra-ai/mastra/commit/f0f8f125c308f2d0fd36942ef652fd852df7522f), [`f111eac`](https://github.com/mastra-ai/mastra/commit/f111eac5de509b2e5fccfc1882e7f74cda264c74), [`51acef9`](https://github.com/mastra-ai/mastra/commit/51acef95b5977826594fe3ee24475842bd3d5780), [`eb09742`](https://github.com/mastra-ai/mastra/commit/eb09742197f66c4c38154c3beec78313e69760b2), [`354ad0b`](https://github.com/mastra-ai/mastra/commit/354ad0b7b1b8183ac567f236a884fc7ede6d7138), [`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc), [`a0c8c1b`](https://github.com/mastra-ai/mastra/commit/a0c8c1b87d4fee252aebda73e8637fbe01d761c9)]:
1248
+ - @mastra/schema-compat@1.0.0-beta.0
1249
+ - @mastra/observability@1.0.0-beta.0
1250
+
1251
+ ## 0.22.2
1252
+
1253
+ ### Patch Changes
1254
+
1255
+ - Fix nested workflow events and networks ([#9132](https://github.com/mastra-ai/mastra/pull/9132))
1256
+
1257
+ ## 0.22.2-alpha.0
1258
+
1259
+ ### Patch Changes
1260
+
1261
+ - Fix nested workflow events and networks ([#9132](https://github.com/mastra-ai/mastra/pull/9132))
1262
+
1263
+ ## 0.22.1
1264
+
1265
+ ## 0.22.1-alpha.0
1266
+
1267
+ ## 0.22.0
1268
+
1269
+ ### Minor Changes
1270
+
1271
+ - Consolidate streamVNext logic into stream, move old stream function into streamLegacy ([#9092](https://github.com/mastra-ai/mastra/pull/9092))
4
1272
 
5
1273
  ### Patch Changes
6
1274
 
@@ -14,6 +1282,8 @@
14
1282
 
15
1283
  - Support writing custom top level stream chunks ([#8922](https://github.com/mastra-ai/mastra/pull/8922))
16
1284
 
1285
+ - Fix incorrect type assertions in Tool class. Created `MastraToolInvocationOptions` type to properly extend AI SDK's `ToolInvocationOptions` with Mastra-specific properties (`suspend`, `resumeData`, `writableStream`). Removed unsafe type assertions from tool execution code. ([#9033](https://github.com/mastra-ai/mastra/pull/9033))
1286
+
17
1287
  - fix(core): Fix Gemini message ordering validation errors (#7287, #8053) ([#8069](https://github.com/mastra-ai/mastra/pull/8069))
18
1288
 
19
1289
  Fixes Gemini API "single turn requests" validation error by ensuring the first non-system message is from the user role. This resolves errors when:
@@ -24,6 +1294,18 @@
24
1294
 
25
1295
  This fix handles both issue #7287 (tool-call ordering) and #8053 (single-turn validation) by inserting a placeholder user message when needed.
26
1296
 
1297
+ - Add support for external trace and parent span IDs in TracingOptions. This enables integration with external tracing systems by allowing new AI traces to be started with existing traceId and parentSpanId values. The implementation includes OpenTelemetry-compatible ID validation (32 hex chars for trace IDs, 16 hex chars for span IDs). ([#9053](https://github.com/mastra-ai/mastra/pull/9053))
1298
+
1299
+ - Updated `watch` and `watchAsync` methods to use proper function overloads instead of generic conditional types, ensuring compatibility with the base Run class signatures. ([#9048](https://github.com/mastra-ai/mastra/pull/9048))
1300
+
1301
+ - Fix tracing context propagation to agent steps in workflows ([#9074](https://github.com/mastra-ai/mastra/pull/9074))
1302
+
1303
+ When creating a workflow step from an agent using `createStep(myAgent)`, the tracing context was not being passed to the agent's `stream()` and `streamLegacy()` methods. This caused tracing spans to break in the workflow chain.
1304
+
1305
+ This fix ensures that `tracingContext` is properly propagated to both agent.stream() and agent.streamLegacy() calls, matching the behavior of tool steps which already propagate tracingContext correctly.
1306
+
1307
+ - Fixes how reasoning chunks are stored in memory to prevent data loss and ensure they are consolidated as single message parts rather than split into word-level fragments. ([#9041](https://github.com/mastra-ai/mastra/pull/9041))
1308
+
27
1309
  - fixes an issue where input processors couldn't add system or assistant messages. Previously all messages from input processors were forced to be user messages, causing an error when trying to add other role types. ([#8835](https://github.com/mastra-ai/mastra/pull/8835))
28
1310
 
29
1311
  - fix(core): Validate structured output at text-end instead of flush ([#8934](https://github.com/mastra-ai/mastra/pull/8934))
@@ -32,26 +1314,150 @@
32
1314
 
33
1315
  - fix model.loop.test.ts tests to use structuredOutput.schema and add assertions ([#8926](https://github.com/mastra-ai/mastra/pull/8926))
34
1316
 
1317
+ - Add `initialState` as an option to `.streamVNext()` ([#9071](https://github.com/mastra-ai/mastra/pull/9071))
1318
+
35
1319
  - added resourceId and runId to workflow_run metadata in ai tracing ([#9031](https://github.com/mastra-ai/mastra/pull/9031))
36
1320
 
37
1321
  - When using OpenAI models with JSON response format, automatically enable strict schema validation. ([#8924](https://github.com/mastra-ai/mastra/pull/8924))
38
1322
 
1323
+ - Fix custom metadata preservation in UIMessages when loading threads. The `getMessagesHandler` now converts `messagesV2` (V2 format with metadata) instead of `messages` (V1 format without metadata) to AIV5.UI format. Also updates the abstract `MastraMemory.query()` return type to include `messagesV2` for proper type safety. ([#9029](https://github.com/mastra-ai/mastra/pull/9029))
1324
+
1325
+ - Fix TypeScript type errors when using provider-defined tools from external AI SDK packages. ([#8940](https://github.com/mastra-ai/mastra/pull/8940))
1326
+
1327
+ Agents can now accept provider tools like `google.tools.googleSearch()` without type errors. Creates new `@internal/external-types` package to centralize AI SDK type re-exports and adds `ProviderDefinedTool` structural type to handle tools from different package versions/instances due to TypeScript's module path discrimination.
1328
+
1329
+ - feat(ai-tracing): Add automatic metadata extraction from RuntimeContext to spans ([#9072](https://github.com/mastra-ai/mastra/pull/9072))
1330
+
1331
+ Enables automatic extraction of RuntimeContext values as metadata for AI tracing spans across entire traces.
1332
+
1333
+ Key features:
1334
+ - Configure `runtimeContextKeys` in TracingConfig to extract specific keys from RuntimeContext
1335
+ - Add per-request keys via `tracingOptions.runtimeContextKeys` for trace-specific additions
1336
+ - Supports dot notation for nested values (e.g., 'user.id', 'session.data.experimentId')
1337
+ - TraceState computed once at root span and inherited by all child spans
1338
+ - Explicit metadata in span options takes precedence over extracted metadata
1339
+
1340
+ Example:
1341
+
1342
+ ```typescript
1343
+ const mastra = new Mastra({
1344
+ observability: {
1345
+ configs: {
1346
+ default: {
1347
+ runtimeContextKeys: ['userId', 'environment', 'tenantId'],
1348
+ },
1349
+ },
1350
+ },
1351
+ });
1352
+
1353
+ await agent.generate({
1354
+ messages,
1355
+ runtimeContext,
1356
+ tracingOptions: {
1357
+ runtimeContextKeys: ['experimentId'], // Adds to configured keys
1358
+ },
1359
+ });
1360
+ ```
1361
+
39
1362
  - Fix provider tools for popular providers and add support for anthropic/claude skills. ([#9038](https://github.com/mastra-ai/mastra/pull/9038))
40
1363
 
1364
+ - Refactor workflowstream into workflow output with fullStream property ([#9048](https://github.com/mastra-ai/mastra/pull/9048))
1365
+
41
1366
  - Added the ability to use model router configs for embedders (eg "openai/text-embedding-ada-002") ([#8992](https://github.com/mastra-ai/mastra/pull/8992))
42
1367
 
43
1368
  - Always set supportsStructuredOutputs true for openai compatible provider. ([#8933](https://github.com/mastra-ai/mastra/pull/8933))
44
1369
 
45
1370
  - Support for custom resume labels mapping to step to be resumed ([#8941](https://github.com/mastra-ai/mastra/pull/8941))
46
1371
 
1372
+ - added tracing of LLM steps & chunks ([#9058](https://github.com/mastra-ai/mastra/pull/9058))
1373
+
47
1374
  - Fixed an issue where a custom URL in model router still validated unknown providers against the known providers list. Custom URL means we don't necessarily know the provider. This allows local providers like Ollama to work properly ([#8989](https://github.com/mastra-ai/mastra/pull/8989))
48
1375
 
1376
+ - Show agent tool output better in playground ([#9021](https://github.com/mastra-ai/mastra/pull/9021))
1377
+
49
1378
  - feat: inject schema context into main agent for processor mode structured output ([#8886](https://github.com/mastra-ai/mastra/pull/8886))
50
1379
 
51
1380
  - Added providerOptions types to generate/stream for main builtin model router providers (openai/anthropic/google/xai) ([#8995](https://github.com/mastra-ai/mastra/pull/8995))
52
1381
 
53
1382
  - Generate a title for Agent.network() threads ([#8853](https://github.com/mastra-ai/mastra/pull/8853))
54
1383
 
1384
+ ## 0.22.0-alpha.1
1385
+
1386
+ ### Minor Changes
1387
+
1388
+ - Consolidate streamVNext logic into stream, move old stream function into streamLegacy ([#9092](https://github.com/mastra-ai/mastra/pull/9092))
1389
+
1390
+ ### Patch Changes
1391
+
1392
+ - Update provider registry and model documentation with latest models and providers ([`efb5ed9`](https://github.com/mastra-ai/mastra/commit/efb5ed946ae7f410bc68c9430beb4b010afd25ec))
1393
+
1394
+ - Fix incorrect type assertions in Tool class. Created `MastraToolInvocationOptions` type to properly extend AI SDK's `ToolInvocationOptions` with Mastra-specific properties (`suspend`, `resumeData`, `writableStream`). Removed unsafe type assertions from tool execution code. ([#9033](https://github.com/mastra-ai/mastra/pull/9033))
1395
+
1396
+ - Add support for external trace and parent span IDs in TracingOptions. This enables integration with external tracing systems by allowing new AI traces to be started with existing traceId and parentSpanId values. The implementation includes OpenTelemetry-compatible ID validation (32 hex chars for trace IDs, 16 hex chars for span IDs). ([#9053](https://github.com/mastra-ai/mastra/pull/9053))
1397
+
1398
+ - Updated `watch` and `watchAsync` methods to use proper function overloads instead of generic conditional types, ensuring compatibility with the base Run class signatures. ([#9048](https://github.com/mastra-ai/mastra/pull/9048))
1399
+
1400
+ - Fix tracing context propagation to agent steps in workflows ([#9074](https://github.com/mastra-ai/mastra/pull/9074))
1401
+
1402
+ When creating a workflow step from an agent using `createStep(myAgent)`, the tracing context was not being passed to the agent's `stream()` and `streamLegacy()` methods. This caused tracing spans to break in the workflow chain.
1403
+
1404
+ This fix ensures that `tracingContext` is properly propagated to both agent.stream() and agent.streamLegacy() calls, matching the behavior of tool steps which already propagate tracingContext correctly.
1405
+
1406
+ - Fixes how reasoning chunks are stored in memory to prevent data loss and ensure they are consolidated as single message parts rather than split into word-level fragments. ([#9041](https://github.com/mastra-ai/mastra/pull/9041))
1407
+
1408
+ - fixes an issue where input processors couldn't add system or assistant messages. Previously all messages from input processors were forced to be user messages, causing an error when trying to add other role types. ([#8835](https://github.com/mastra-ai/mastra/pull/8835))
1409
+
1410
+ - Add `initialState` as an option to `.streamVNext()` ([#9071](https://github.com/mastra-ai/mastra/pull/9071))
1411
+
1412
+ - added resourceId and runId to workflow_run metadata in ai tracing ([#9031](https://github.com/mastra-ai/mastra/pull/9031))
1413
+
1414
+ - Fix custom metadata preservation in UIMessages when loading threads. The `getMessagesHandler` now converts `messagesV2` (V2 format with metadata) instead of `messages` (V1 format without metadata) to AIV5.UI format. Also updates the abstract `MastraMemory.query()` return type to include `messagesV2` for proper type safety. ([#9029](https://github.com/mastra-ai/mastra/pull/9029))
1415
+
1416
+ - Fix TypeScript type errors when using provider-defined tools from external AI SDK packages. ([#8940](https://github.com/mastra-ai/mastra/pull/8940))
1417
+
1418
+ Agents can now accept provider tools like `google.tools.googleSearch()` without type errors. Creates new `@internal/external-types` package to centralize AI SDK type re-exports and adds `ProviderDefinedTool` structural type to handle tools from different package versions/instances due to TypeScript's module path discrimination.
1419
+
1420
+ - feat(ai-tracing): Add automatic metadata extraction from RuntimeContext to spans ([#9072](https://github.com/mastra-ai/mastra/pull/9072))
1421
+
1422
+ Enables automatic extraction of RuntimeContext values as metadata for AI tracing spans across entire traces.
1423
+
1424
+ Key features:
1425
+ - Configure `runtimeContextKeys` in TracingConfig to extract specific keys from RuntimeContext
1426
+ - Add per-request keys via `tracingOptions.runtimeContextKeys` for trace-specific additions
1427
+ - Supports dot notation for nested values (e.g., 'user.id', 'session.data.experimentId')
1428
+ - TraceState computed once at root span and inherited by all child spans
1429
+ - Explicit metadata in span options takes precedence over extracted metadata
1430
+
1431
+ Example:
1432
+
1433
+ ```typescript
1434
+ const mastra = new Mastra({
1435
+ observability: {
1436
+ configs: {
1437
+ default: {
1438
+ runtimeContextKeys: ['userId', 'environment', 'tenantId'],
1439
+ },
1440
+ },
1441
+ },
1442
+ });
1443
+
1444
+ await agent.generate({
1445
+ messages,
1446
+ runtimeContext,
1447
+ tracingOptions: {
1448
+ runtimeContextKeys: ['experimentId'], // Adds to configured keys
1449
+ },
1450
+ });
1451
+ ```
1452
+
1453
+ - Fix provider tools for popular providers and add support for anthropic/claude skills. ([#9038](https://github.com/mastra-ai/mastra/pull/9038))
1454
+
1455
+ - Refactor workflowstream into workflow output with fullStream property ([#9048](https://github.com/mastra-ai/mastra/pull/9048))
1456
+
1457
+ - added tracing of LLM steps & chunks ([#9058](https://github.com/mastra-ai/mastra/pull/9058))
1458
+
1459
+ - Show agent tool output better in playground ([#9021](https://github.com/mastra-ai/mastra/pull/9021))
1460
+
55
1461
  ## 0.21.2-alpha.0
56
1462
 
57
1463
  ### Patch Changes