@mastra/core 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (438) hide show
  1. package/CHANGELOG.md +202 -0
  2. package/dist/agent/agent.d.ts +22 -3
  3. package/dist/agent/agent.d.ts.map +1 -1
  4. package/dist/agent/index.cjs +13 -13
  5. package/dist/agent/index.js +2 -2
  6. package/dist/agent/message-list/index.cjs +18 -18
  7. package/dist/agent/message-list/index.js +1 -1
  8. package/dist/agent/message-list/message-list.d.ts.map +1 -1
  9. package/dist/{chunk-IOY7Y5GV.js → chunk-3VVNJPTO.js} +602 -187
  10. package/dist/chunk-3VVNJPTO.js.map +1 -0
  11. package/dist/{chunk-VDKWYUGC.cjs → chunk-5WBEMKE2.cjs} +7 -3
  12. package/dist/chunk-5WBEMKE2.cjs.map +1 -0
  13. package/dist/{chunk-H5S4PS44.cjs → chunk-76Q75VI4.cjs} +602 -187
  14. package/dist/chunk-76Q75VI4.cjs.map +1 -0
  15. package/dist/{chunk-ZBESCKPX.cjs → chunk-7AHCLTZZ.cjs} +1572 -36
  16. package/dist/chunk-7AHCLTZZ.cjs.map +1 -0
  17. package/dist/{chunk-SEKQJ447.js → chunk-ACAILOJE.js} +166 -68
  18. package/dist/chunk-ACAILOJE.js.map +1 -0
  19. package/dist/{chunk-YIJZBU54.cjs → chunk-BCSVBOAN.cjs} +240 -463
  20. package/dist/chunk-BCSVBOAN.cjs.map +1 -0
  21. package/dist/{chunk-ZVWVQ6MG.js → chunk-CY4ZWL2X.js} +8 -3
  22. package/dist/chunk-CY4ZWL2X.js.map +1 -0
  23. package/dist/{chunk-ET7GXCHS.js → chunk-DIKRJVK6.js} +5 -5
  24. package/dist/{chunk-ET7GXCHS.js.map → chunk-DIKRJVK6.js.map} +1 -1
  25. package/dist/{chunk-P6ZX7OKT.cjs → chunk-E6I5LBDM.cjs} +7 -7
  26. package/dist/{chunk-P6ZX7OKT.cjs.map → chunk-E6I5LBDM.cjs.map} +1 -1
  27. package/dist/{chunk-BFV3GSGS.js → chunk-FT5Q6XTK.js} +1546 -22
  28. package/dist/chunk-FT5Q6XTK.js.map +1 -0
  29. package/dist/{chunk-K54LFB4P.js → chunk-FXOWXS4O.js} +3 -3
  30. package/dist/{chunk-K54LFB4P.js.map → chunk-FXOWXS4O.js.map} +1 -1
  31. package/dist/{chunk-QNXY3J6B.cjs → chunk-GCRPNAAR.cjs} +22 -19
  32. package/dist/chunk-GCRPNAAR.cjs.map +1 -0
  33. package/dist/{chunk-5M3RMO7U.js → chunk-GTA5BKXZ.js} +8 -8
  34. package/dist/{chunk-5M3RMO7U.js.map → chunk-GTA5BKXZ.js.map} +1 -1
  35. package/dist/{chunk-G5R2755Q.cjs → chunk-HAIQ57YB.cjs} +53 -20
  36. package/dist/chunk-HAIQ57YB.cjs.map +1 -0
  37. package/dist/{chunk-3ZBLD2Y4.cjs → chunk-HH76UOJL.cjs} +2 -2
  38. package/dist/{chunk-3ZBLD2Y4.cjs.map → chunk-HH76UOJL.cjs.map} +1 -1
  39. package/dist/{chunk-HAGCXIBX.cjs → chunk-HNYQITSV.cjs} +9 -9
  40. package/dist/{chunk-HAGCXIBX.cjs.map → chunk-HNYQITSV.cjs.map} +1 -1
  41. package/dist/{chunk-GJTLWOKJ.js → chunk-HQA3IBLZ.js} +51 -18
  42. package/dist/chunk-HQA3IBLZ.js.map +1 -0
  43. package/dist/{chunk-4BXXAZ75.js → chunk-HQTHWVAK.js} +15 -7
  44. package/dist/chunk-HQTHWVAK.js.map +1 -0
  45. package/dist/{chunk-CCLV5CAA.js → chunk-JGOH7RWL.js} +7 -3
  46. package/dist/chunk-JGOH7RWL.js.map +1 -0
  47. package/dist/{chunk-Y6TGIUGL.js → chunk-LSF5WJ6G.js} +2 -2
  48. package/dist/{chunk-Y6TGIUGL.js.map → chunk-LSF5WJ6G.js.map} +1 -1
  49. package/dist/{chunk-D6HO5QAM.cjs → chunk-M26GEN4C.cjs} +14 -9
  50. package/dist/chunk-M26GEN4C.cjs.map +1 -0
  51. package/dist/{chunk-4P35AVPE.cjs → chunk-MEMYFFOL.cjs} +256 -157
  52. package/dist/chunk-MEMYFFOL.cjs.map +1 -0
  53. package/dist/{chunk-BQ355Z3O.js → chunk-NUZWQA4J.js} +4 -4
  54. package/dist/{chunk-BQ355Z3O.js.map → chunk-NUZWQA4J.js.map} +1 -1
  55. package/dist/{chunk-JIRB5LX4.js → chunk-OHX36YXF.js} +5 -3
  56. package/dist/chunk-OHX36YXF.js.map +1 -0
  57. package/dist/{chunk-PKORY4ZZ.cjs → chunk-OOTLMVNN.cjs} +107 -7
  58. package/dist/chunk-OOTLMVNN.cjs.map +1 -0
  59. package/dist/{chunk-D4M6E4OQ.cjs → chunk-OWZ6QT24.cjs} +16 -8
  60. package/dist/chunk-OWZ6QT24.cjs.map +1 -0
  61. package/dist/{chunk-6OHS6ZQ3.js → chunk-PDJCIONR.js} +8 -8
  62. package/dist/{chunk-6OHS6ZQ3.js.map → chunk-PDJCIONR.js.map} +1 -1
  63. package/dist/{chunk-WU2P7XOU.cjs → chunk-PP4G2TZZ.cjs} +20 -20
  64. package/dist/{chunk-WU2P7XOU.cjs.map → chunk-PP4G2TZZ.cjs.map} +1 -1
  65. package/dist/{chunk-VWAK25TU.js → chunk-SBBWRNZA.js} +10 -7
  66. package/dist/chunk-SBBWRNZA.js.map +1 -0
  67. package/dist/{chunk-TU4YMXOQ.js → chunk-TJIFNVPX.js} +6 -6
  68. package/dist/{chunk-TU4YMXOQ.js.map → chunk-TJIFNVPX.js.map} +1 -1
  69. package/dist/{chunk-V5YNS2QO.cjs → chunk-XJNQHPBJ.cjs} +15 -15
  70. package/dist/{chunk-V5YNS2QO.cjs.map → chunk-XJNQHPBJ.cjs.map} +1 -1
  71. package/dist/{chunk-MVYP55NA.js → chunk-YC6Z75K2.js} +113 -336
  72. package/dist/chunk-YC6Z75K2.js.map +1 -0
  73. package/dist/{chunk-3ZF7IC6Q.cjs → chunk-YZMSJKAK.cjs} +5 -3
  74. package/dist/chunk-YZMSJKAK.cjs.map +1 -0
  75. package/dist/{chunk-L3WDI7HP.cjs → chunk-Z2X5VTYJ.cjs} +65 -65
  76. package/dist/{chunk-L3WDI7HP.cjs.map → chunk-Z2X5VTYJ.cjs.map} +1 -1
  77. package/dist/{chunk-BN5MV2QK.cjs → chunk-Z52OAJ73.cjs} +4 -4
  78. package/dist/{chunk-BN5MV2QK.cjs.map → chunk-Z52OAJ73.cjs.map} +1 -1
  79. package/dist/{chunk-WYPSC6CO.js → chunk-ZBU6P4JV.js} +104 -4
  80. package/dist/chunk-ZBU6P4JV.js.map +1 -0
  81. package/dist/datasets/experiment/index.d.ts.map +1 -1
  82. package/dist/datasets/experiment/scorer.d.ts.map +1 -1
  83. package/dist/datasets/index.cjs +17 -17
  84. package/dist/datasets/index.js +2 -2
  85. package/dist/di/index.cjs +4 -4
  86. package/dist/di/index.js +1 -1
  87. package/dist/docs/SKILL.md +1 -1
  88. package/dist/docs/assets/SOURCE_MAP.json +443 -384
  89. package/dist/docs/references/docs-agents-agent-approval.md +61 -31
  90. package/dist/docs/references/docs-agents-supervisor-agents.md +1 -1
  91. package/dist/docs/references/docs-memory-observational-memory.md +9 -0
  92. package/dist/docs/references/docs-memory-semantic-recall.md +17 -1
  93. package/dist/docs/references/docs-workspace-skills.md +7 -5
  94. package/dist/docs/references/reference-agents-agent.md +20 -20
  95. package/dist/docs/references/reference-agents-generate.md +200 -66
  96. package/dist/docs/references/reference-agents-generateLegacy.md +77 -35
  97. package/dist/docs/references/reference-agents-getDefaultGenerateOptions.md +4 -6
  98. package/dist/docs/references/reference-agents-getDefaultOptions.md +4 -6
  99. package/dist/docs/references/reference-agents-getDefaultStreamOptions.md +4 -6
  100. package/dist/docs/references/reference-agents-getDescription.md +1 -1
  101. package/dist/docs/references/reference-agents-getInstructions.md +4 -6
  102. package/dist/docs/references/reference-agents-getLLM.md +6 -8
  103. package/dist/docs/references/reference-agents-getMemory.md +4 -6
  104. package/dist/docs/references/reference-agents-getModel.md +4 -6
  105. package/dist/docs/references/reference-agents-getTools.md +5 -7
  106. package/dist/docs/references/reference-agents-getVoice.md +4 -6
  107. package/dist/docs/references/reference-agents-listAgents.md +4 -6
  108. package/dist/docs/references/reference-agents-listScorers.md +4 -6
  109. package/dist/docs/references/reference-agents-listTools.md +4 -6
  110. package/dist/docs/references/reference-agents-listWorkflows.md +4 -6
  111. package/dist/docs/references/reference-agents-network.md +69 -23
  112. package/dist/docs/references/reference-ai-sdk-chat-route.md +7 -7
  113. package/dist/docs/references/reference-ai-sdk-network-route.md +3 -3
  114. package/dist/docs/references/reference-ai-sdk-to-ai-sdk-stream.md +9 -9
  115. package/dist/docs/references/reference-ai-sdk-with-mastra.md +12 -12
  116. package/dist/docs/references/reference-ai-sdk-workflow-route.md +3 -3
  117. package/dist/docs/references/reference-auth-auth0.md +6 -6
  118. package/dist/docs/references/reference-auth-clerk.md +5 -5
  119. package/dist/docs/references/reference-auth-firebase.md +7 -7
  120. package/dist/docs/references/reference-auth-jwt.md +1 -1
  121. package/dist/docs/references/reference-auth-supabase.md +4 -4
  122. package/dist/docs/references/reference-auth-workos.md +6 -6
  123. package/dist/docs/references/reference-core-addGateway.md +2 -2
  124. package/dist/docs/references/reference-core-getAgent.md +2 -2
  125. package/dist/docs/references/reference-core-getAgentById.md +2 -2
  126. package/dist/docs/references/reference-core-getDeployer.md +1 -1
  127. package/dist/docs/references/reference-core-getGateway.md +2 -2
  128. package/dist/docs/references/reference-core-getGatewayById.md +2 -2
  129. package/dist/docs/references/reference-core-getLogger.md +1 -1
  130. package/dist/docs/references/reference-core-getMCPServer.md +2 -2
  131. package/dist/docs/references/reference-core-getMCPServerById.md +3 -3
  132. package/dist/docs/references/reference-core-getMemory.md +2 -2
  133. package/dist/docs/references/reference-core-getScorer.md +2 -2
  134. package/dist/docs/references/reference-core-getScorerById.md +2 -2
  135. package/dist/docs/references/reference-core-getServer.md +1 -1
  136. package/dist/docs/references/reference-core-getStorage.md +1 -1
  137. package/dist/docs/references/reference-core-getStoredAgentById.md +18 -20
  138. package/dist/docs/references/reference-core-getTelemetry.md +1 -1
  139. package/dist/docs/references/reference-core-getVector.md +2 -2
  140. package/dist/docs/references/reference-core-getWorkflow.md +3 -3
  141. package/dist/docs/references/reference-core-listAgents.md +1 -1
  142. package/dist/docs/references/reference-core-listGateways.md +1 -1
  143. package/dist/docs/references/reference-core-listLogs.md +9 -11
  144. package/dist/docs/references/reference-core-listLogsByRunId.md +9 -9
  145. package/dist/docs/references/reference-core-listMCPServers.md +1 -1
  146. package/dist/docs/references/reference-core-listMemory.md +1 -1
  147. package/dist/docs/references/reference-core-listScorers.md +1 -1
  148. package/dist/docs/references/reference-core-listStoredAgents.md +9 -11
  149. package/dist/docs/references/reference-core-listVectors.md +1 -1
  150. package/dist/docs/references/reference-core-listWorkflows.md +2 -2
  151. package/dist/docs/references/reference-core-mastra-class.md +17 -17
  152. package/dist/docs/references/reference-core-mastra-model-gateway.md +15 -15
  153. package/dist/docs/references/reference-core-setLogger.md +2 -4
  154. package/dist/docs/references/reference-core-setStorage.md +1 -1
  155. package/dist/docs/references/reference-datasets-addItem.md +20 -4
  156. package/dist/docs/references/reference-datasets-addItems.md +8 -2
  157. package/dist/docs/references/reference-datasets-compareExperiments.md +15 -3
  158. package/dist/docs/references/reference-datasets-create.md +6 -6
  159. package/dist/docs/references/reference-datasets-dataset.md +1 -1
  160. package/dist/docs/references/reference-datasets-delete.md +2 -2
  161. package/dist/docs/references/reference-datasets-deleteExperiment.md +2 -2
  162. package/dist/docs/references/reference-datasets-deleteItem.md +2 -2
  163. package/dist/docs/references/reference-datasets-deleteItems.md +2 -2
  164. package/dist/docs/references/reference-datasets-get.md +2 -2
  165. package/dist/docs/references/reference-datasets-getDetails.md +9 -9
  166. package/dist/docs/references/reference-datasets-getExperiment.md +2 -2
  167. package/dist/docs/references/reference-datasets-getItem.md +3 -3
  168. package/dist/docs/references/reference-datasets-getItemHistory.md +22 -2
  169. package/dist/docs/references/reference-datasets-list.md +7 -3
  170. package/dist/docs/references/reference-datasets-listExperimentResults.md +34 -4
  171. package/dist/docs/references/reference-datasets-listExperiments.md +41 -3
  172. package/dist/docs/references/reference-datasets-listItems.md +18 -6
  173. package/dist/docs/references/reference-datasets-listVersions.md +23 -3
  174. package/dist/docs/references/reference-datasets-startExperiment.md +62 -12
  175. package/dist/docs/references/reference-datasets-startExperimentAsync.md +5 -1
  176. package/dist/docs/references/reference-datasets-update.md +6 -6
  177. package/dist/docs/references/reference-datasets-updateItem.md +5 -5
  178. package/dist/docs/references/reference-evals-answer-relevancy.md +11 -11
  179. package/dist/docs/references/reference-evals-answer-similarity.md +17 -19
  180. package/dist/docs/references/reference-evals-bias.md +10 -10
  181. package/dist/docs/references/reference-evals-completeness.md +3 -3
  182. package/dist/docs/references/reference-evals-content-similarity.md +6 -6
  183. package/dist/docs/references/reference-evals-context-precision.md +4 -4
  184. package/dist/docs/references/reference-evals-create-scorer.md +47 -49
  185. package/dist/docs/references/reference-evals-faithfulness.md +11 -11
  186. package/dist/docs/references/reference-evals-hallucination.md +17 -21
  187. package/dist/docs/references/reference-evals-keyword-coverage.md +4 -4
  188. package/dist/docs/references/reference-evals-mastra-scorer.md +14 -14
  189. package/dist/docs/references/reference-evals-run-evals.md +16 -16
  190. package/dist/docs/references/reference-evals-scorer-utils.md +3 -3
  191. package/dist/docs/references/reference-evals-textual-difference.md +3 -3
  192. package/dist/docs/references/reference-evals-tone-consistency.md +3 -3
  193. package/dist/docs/references/reference-evals-toxicity.md +8 -8
  194. package/dist/docs/references/reference-harness-harness-class.md +34 -42
  195. package/dist/docs/references/reference-logging-pino-logger.md +5 -5
  196. package/dist/docs/references/reference-memory-deleteMessages.md +2 -2
  197. package/dist/docs/references/reference-memory-memory-class.md +12 -14
  198. package/dist/docs/references/reference-memory-observational-memory.md +102 -94
  199. package/dist/docs/references/reference-observability-tracing-configuration.md +27 -10
  200. package/dist/docs/references/reference-observability-tracing-exporters-console-exporter.md +4 -7
  201. package/dist/docs/references/reference-processors-batch-parts-processor.md +8 -10
  202. package/dist/docs/references/reference-processors-language-detector.md +14 -16
  203. package/dist/docs/references/reference-processors-message-history-processor.md +7 -9
  204. package/dist/docs/references/reference-processors-moderation-processor.md +13 -15
  205. package/dist/docs/references/reference-processors-pii-detector.md +14 -16
  206. package/dist/docs/references/reference-processors-processor-interface.md +62 -62
  207. package/dist/docs/references/reference-processors-prompt-injection-detector.md +11 -13
  208. package/dist/docs/references/reference-processors-semantic-recall-processor.md +14 -16
  209. package/dist/docs/references/reference-processors-system-prompt-scrubber.md +12 -14
  210. package/dist/docs/references/reference-processors-token-limiter-processor.md +11 -13
  211. package/dist/docs/references/reference-processors-tool-call-filter.md +5 -7
  212. package/dist/docs/references/reference-processors-tool-search-processor.md +9 -11
  213. package/dist/docs/references/reference-processors-unicode-normalizer.md +8 -10
  214. package/dist/docs/references/reference-processors-working-memory-processor.md +14 -18
  215. package/dist/docs/references/reference-rag-database-config.md +11 -7
  216. package/dist/docs/references/reference-rag-embeddings.md +12 -12
  217. package/dist/docs/references/reference-server-mastra-server.md +10 -10
  218. package/dist/docs/references/reference-server-register-api-route.md +13 -13
  219. package/dist/docs/references/reference-storage-cloudflare-d1.md +5 -5
  220. package/dist/docs/references/reference-storage-composite.md +9 -9
  221. package/dist/docs/references/reference-storage-lance.md +3 -3
  222. package/dist/docs/references/reference-storage-libsql.md +2 -2
  223. package/dist/docs/references/reference-storage-mongodb.md +5 -5
  224. package/dist/docs/references/reference-storage-mssql.md +2 -2
  225. package/dist/docs/references/reference-storage-postgresql.md +25 -25
  226. package/dist/docs/references/reference-storage-upstash.md +3 -3
  227. package/dist/docs/references/reference-streaming-ChunkType.md +251 -59
  228. package/dist/docs/references/reference-streaming-agents-MastraModelOutput.md +86 -16
  229. package/dist/docs/references/reference-streaming-agents-streamLegacy.md +79 -39
  230. package/dist/docs/references/reference-streaming-workflows-resumeStream.md +18 -8
  231. package/dist/docs/references/reference-streaming-workflows-stream.md +21 -9
  232. package/dist/docs/references/reference-streaming-workflows-timeTravelStream.md +4 -4
  233. package/dist/docs/references/reference-tools-create-tool.md +25 -21
  234. package/dist/docs/references/reference-tools-graph-rag-tool.md +16 -18
  235. package/dist/docs/references/reference-tools-mcp-client.md +38 -27
  236. package/dist/docs/references/reference-tools-mcp-server.md +45 -45
  237. package/dist/docs/references/reference-tools-vector-query-tool.md +34 -22
  238. package/dist/docs/references/reference-vectors-libsql.md +31 -31
  239. package/dist/docs/references/reference-vectors-mongodb.md +32 -32
  240. package/dist/docs/references/reference-vectors-pg.md +60 -44
  241. package/dist/docs/references/reference-vectors-upstash.md +25 -25
  242. package/dist/docs/references/reference-voice-composite-voice.md +10 -10
  243. package/dist/docs/references/reference-voice-mastra-voice.md +20 -20
  244. package/dist/docs/references/reference-voice-voice.addInstructions.md +1 -1
  245. package/dist/docs/references/reference-voice-voice.addTools.md +1 -1
  246. package/dist/docs/references/reference-voice-voice.connect.md +3 -3
  247. package/dist/docs/references/reference-voice-voice.events.md +11 -11
  248. package/dist/docs/references/reference-voice-voice.listen.md +9 -9
  249. package/dist/docs/references/reference-voice-voice.on.md +2 -2
  250. package/dist/docs/references/reference-voice-voice.speak.md +11 -11
  251. package/dist/docs/references/reference-workflows-run-methods-cancel.md +2 -2
  252. package/dist/docs/references/reference-workflows-run-methods-restart.md +17 -5
  253. package/dist/docs/references/reference-workflows-run-methods-resume.md +23 -9
  254. package/dist/docs/references/reference-workflows-run-methods-start.md +22 -8
  255. package/dist/docs/references/reference-workflows-run-methods-startAsync.md +12 -6
  256. package/dist/docs/references/reference-workflows-run-methods-timeTravel.md +29 -13
  257. package/dist/docs/references/reference-workflows-run.md +12 -12
  258. package/dist/docs/references/reference-workflows-step.md +24 -26
  259. package/dist/docs/references/reference-workflows-workflow-methods-branch.md +2 -2
  260. package/dist/docs/references/reference-workflows-workflow-methods-commit.md +1 -1
  261. package/dist/docs/references/reference-workflows-workflow-methods-create-run.md +4 -4
  262. package/dist/docs/references/reference-workflows-workflow-methods-dountil.md +3 -3
  263. package/dist/docs/references/reference-workflows-workflow-methods-dowhile.md +3 -3
  264. package/dist/docs/references/reference-workflows-workflow-methods-foreach.md +9 -9
  265. package/dist/docs/references/reference-workflows-workflow-methods-map.md +2 -2
  266. package/dist/docs/references/reference-workflows-workflow-methods-parallel.md +2 -2
  267. package/dist/docs/references/reference-workflows-workflow-methods-sleep.md +2 -2
  268. package/dist/docs/references/reference-workflows-workflow-methods-sleepUntil.md +2 -2
  269. package/dist/docs/references/reference-workflows-workflow-methods-then.md +2 -2
  270. package/dist/docs/references/reference-workflows-workflow.md +40 -50
  271. package/dist/docs/references/reference-workspace-filesystem.md +22 -22
  272. package/dist/docs/references/reference-workspace-local-filesystem.md +35 -35
  273. package/dist/docs/references/reference-workspace-local-sandbox.md +26 -26
  274. package/dist/docs/references/reference-workspace-sandbox.md +8 -8
  275. package/dist/docs/references/reference-workspace-workspace-class.md +30 -34
  276. package/dist/editor/types.d.ts +1 -0
  277. package/dist/editor/types.d.ts.map +1 -1
  278. package/dist/evals/index.cjs +20 -20
  279. package/dist/evals/index.js +3 -3
  280. package/dist/evals/scoreTraces/index.cjs +5 -5
  281. package/dist/evals/scoreTraces/index.js +2 -2
  282. package/dist/harness/harness.d.ts.map +1 -1
  283. package/dist/harness/index.cjs +25 -21
  284. package/dist/harness/index.cjs.map +1 -1
  285. package/dist/harness/index.js +15 -11
  286. package/dist/harness/index.js.map +1 -1
  287. package/dist/index.cjs +2 -2
  288. package/dist/index.js +1 -1
  289. package/dist/integration/index.cjs +2 -2
  290. package/dist/integration/index.js +1 -1
  291. package/dist/llm/index.cjs +12 -12
  292. package/dist/llm/index.js +3 -3
  293. package/dist/llm/model/model.d.ts.map +1 -1
  294. package/dist/llm/model/model.loop.d.ts.map +1 -1
  295. package/dist/llm/model/provider-types.generated.d.ts +5 -1
  296. package/dist/loop/index.cjs +14 -14
  297. package/dist/loop/index.js +1 -1
  298. package/dist/loop/workflows/agentic-loop/index.d.ts.map +1 -1
  299. package/dist/mastra/index.cjs +2 -2
  300. package/dist/mastra/index.js +1 -1
  301. package/dist/memory/index.cjs +14 -14
  302. package/dist/memory/index.js +1 -1
  303. package/dist/models-dev-2FJK72J2.cjs +12 -0
  304. package/dist/{models-dev-UVWCKPA2.cjs.map → models-dev-2FJK72J2.cjs.map} +1 -1
  305. package/dist/models-dev-CMQG6EMO.js +3 -0
  306. package/dist/{models-dev-W3LXZTEB.js.map → models-dev-CMQG6EMO.js.map} +1 -1
  307. package/dist/processor-provider/index.cjs +10 -10
  308. package/dist/processor-provider/index.js +1 -1
  309. package/dist/processors/index.cjs +42 -42
  310. package/dist/processors/index.js +1 -1
  311. package/dist/processors/processors/skills.d.ts +9 -42
  312. package/dist/processors/processors/skills.d.ts.map +1 -1
  313. package/dist/provider-registry-EHOAWHFE.cjs +40 -0
  314. package/dist/{provider-registry-4HLP2JRR.cjs.map → provider-registry-EHOAWHFE.cjs.map} +1 -1
  315. package/dist/provider-registry-LVP6T63V.js +3 -0
  316. package/dist/{provider-registry-K3DWQSMH.js.map → provider-registry-LVP6T63V.js.map} +1 -1
  317. package/dist/provider-registry.json +12 -4
  318. package/dist/relevance/index.cjs +3 -3
  319. package/dist/relevance/index.js +1 -1
  320. package/dist/request-context/index.cjs +4 -4
  321. package/dist/request-context/index.d.ts.map +1 -1
  322. package/dist/request-context/index.js +1 -1
  323. package/dist/storage/base.d.ts +34 -1
  324. package/dist/storage/base.d.ts.map +1 -1
  325. package/dist/storage/constants.cjs +56 -56
  326. package/dist/storage/constants.js +1 -1
  327. package/dist/storage/domains/agents/filesystem.d.ts +28 -0
  328. package/dist/storage/domains/agents/filesystem.d.ts.map +1 -0
  329. package/dist/storage/domains/agents/index.d.ts +1 -0
  330. package/dist/storage/domains/agents/index.d.ts.map +1 -1
  331. package/dist/storage/domains/experiments/inmemory.d.ts.map +1 -1
  332. package/dist/storage/domains/mcp-clients/filesystem.d.ts +28 -0
  333. package/dist/storage/domains/mcp-clients/filesystem.d.ts.map +1 -0
  334. package/dist/storage/domains/mcp-clients/index.d.ts +1 -0
  335. package/dist/storage/domains/mcp-clients/index.d.ts.map +1 -1
  336. package/dist/storage/domains/mcp-servers/filesystem.d.ts +28 -0
  337. package/dist/storage/domains/mcp-servers/filesystem.d.ts.map +1 -0
  338. package/dist/storage/domains/mcp-servers/index.d.ts +1 -0
  339. package/dist/storage/domains/mcp-servers/index.d.ts.map +1 -1
  340. package/dist/storage/domains/prompt-blocks/filesystem.d.ts +28 -0
  341. package/dist/storage/domains/prompt-blocks/filesystem.d.ts.map +1 -0
  342. package/dist/storage/domains/prompt-blocks/index.d.ts +1 -0
  343. package/dist/storage/domains/prompt-blocks/index.d.ts.map +1 -1
  344. package/dist/storage/domains/scorer-definitions/filesystem.d.ts +28 -0
  345. package/dist/storage/domains/scorer-definitions/filesystem.d.ts.map +1 -0
  346. package/dist/storage/domains/scorer-definitions/index.d.ts +1 -0
  347. package/dist/storage/domains/scorer-definitions/index.d.ts.map +1 -1
  348. package/dist/storage/domains/skills/filesystem.d.ts +28 -0
  349. package/dist/storage/domains/skills/filesystem.d.ts.map +1 -0
  350. package/dist/storage/domains/skills/index.d.ts +1 -0
  351. package/dist/storage/domains/skills/index.d.ts.map +1 -1
  352. package/dist/storage/domains/workspaces/filesystem.d.ts +28 -0
  353. package/dist/storage/domains/workspaces/filesystem.d.ts.map +1 -0
  354. package/dist/storage/domains/workspaces/index.d.ts +1 -0
  355. package/dist/storage/domains/workspaces/index.d.ts.map +1 -1
  356. package/dist/storage/filesystem-db.d.ts +82 -0
  357. package/dist/storage/filesystem-db.d.ts.map +1 -0
  358. package/dist/storage/filesystem-versioned.d.ts +148 -0
  359. package/dist/storage/filesystem-versioned.d.ts.map +1 -0
  360. package/dist/storage/filesystem.d.ts +39 -0
  361. package/dist/storage/filesystem.d.ts.map +1 -0
  362. package/dist/storage/git-history.d.ts +68 -0
  363. package/dist/storage/git-history.d.ts.map +1 -0
  364. package/dist/storage/index.cjs +208 -160
  365. package/dist/storage/index.d.ts +4 -0
  366. package/dist/storage/index.d.ts.map +1 -1
  367. package/dist/storage/index.js +2 -2
  368. package/dist/storage/types.d.ts +1 -0
  369. package/dist/storage/types.d.ts.map +1 -1
  370. package/dist/stream/RunOutput.d.ts +1 -1
  371. package/dist/stream/aisdk/v5/output-helpers.d.ts +6 -6
  372. package/dist/stream/base/output.d.ts +3 -3
  373. package/dist/stream/base/schema.d.ts +1 -1
  374. package/dist/stream/index.cjs +11 -11
  375. package/dist/stream/index.js +2 -2
  376. package/dist/test-utils/llm-mock.cjs +4 -4
  377. package/dist/test-utils/llm-mock.js +1 -1
  378. package/dist/tool-loop-agent/index.cjs +4 -4
  379. package/dist/tool-loop-agent/index.js +1 -1
  380. package/dist/tools/index.cjs +6 -6
  381. package/dist/tools/index.js +1 -1
  382. package/dist/tools/is-vercel-tool.cjs +2 -2
  383. package/dist/tools/is-vercel-tool.js +1 -1
  384. package/dist/tools/tool-builder/builder.d.ts.map +1 -1
  385. package/dist/tools/tool.d.ts +6 -0
  386. package/dist/tools/tool.d.ts.map +1 -1
  387. package/dist/tools/types.d.ts +27 -0
  388. package/dist/tools/types.d.ts.map +1 -1
  389. package/dist/utils.cjs +23 -23
  390. package/dist/utils.js +1 -1
  391. package/dist/vector/index.cjs +9 -9
  392. package/dist/vector/index.js +2 -2
  393. package/dist/workflows/evented/index.cjs +10 -10
  394. package/dist/workflows/evented/index.js +1 -1
  395. package/dist/workflows/index.cjs +25 -25
  396. package/dist/workflows/index.js +1 -1
  397. package/dist/workspace/index.cjs +70 -66
  398. package/dist/workspace/index.d.ts +1 -0
  399. package/dist/workspace/index.d.ts.map +1 -1
  400. package/dist/workspace/index.js +1 -1
  401. package/dist/workspace/sandbox/execa.d.ts +9 -0
  402. package/dist/workspace/sandbox/execa.d.ts.map +1 -0
  403. package/dist/workspace/sandbox/local-process-manager.d.ts.map +1 -1
  404. package/dist/workspace/skills/index.d.ts +1 -0
  405. package/dist/workspace/skills/index.d.ts.map +1 -1
  406. package/dist/workspace/skills/tools.d.ts +36 -0
  407. package/dist/workspace/skills/tools.d.ts.map +1 -0
  408. package/dist/workspace/tools/execute-command.d.ts.map +1 -1
  409. package/dist/workspace/tools/output-helpers.d.ts +4 -3
  410. package/dist/workspace/tools/output-helpers.d.ts.map +1 -1
  411. package/package.json +9 -9
  412. package/src/llm/model/provider-types.generated.d.ts +5 -1
  413. package/dist/chunk-3ZF7IC6Q.cjs.map +0 -1
  414. package/dist/chunk-4BXXAZ75.js.map +0 -1
  415. package/dist/chunk-4P35AVPE.cjs.map +0 -1
  416. package/dist/chunk-BFV3GSGS.js.map +0 -1
  417. package/dist/chunk-CCLV5CAA.js.map +0 -1
  418. package/dist/chunk-D4M6E4OQ.cjs.map +0 -1
  419. package/dist/chunk-D6HO5QAM.cjs.map +0 -1
  420. package/dist/chunk-G5R2755Q.cjs.map +0 -1
  421. package/dist/chunk-GJTLWOKJ.js.map +0 -1
  422. package/dist/chunk-H5S4PS44.cjs.map +0 -1
  423. package/dist/chunk-IOY7Y5GV.js.map +0 -1
  424. package/dist/chunk-JIRB5LX4.js.map +0 -1
  425. package/dist/chunk-MVYP55NA.js.map +0 -1
  426. package/dist/chunk-PKORY4ZZ.cjs.map +0 -1
  427. package/dist/chunk-QNXY3J6B.cjs.map +0 -1
  428. package/dist/chunk-SEKQJ447.js.map +0 -1
  429. package/dist/chunk-VDKWYUGC.cjs.map +0 -1
  430. package/dist/chunk-VWAK25TU.js.map +0 -1
  431. package/dist/chunk-WYPSC6CO.js.map +0 -1
  432. package/dist/chunk-YIJZBU54.cjs.map +0 -1
  433. package/dist/chunk-ZBESCKPX.cjs.map +0 -1
  434. package/dist/chunk-ZVWVQ6MG.js.map +0 -1
  435. package/dist/models-dev-UVWCKPA2.cjs +0 -12
  436. package/dist/models-dev-W3LXZTEB.js +0 -3
  437. package/dist/provider-registry-4HLP2JRR.cjs +0 -40
  438. package/dist/provider-registry-K3DWQSMH.js +0 -3
@@ -6,11 +6,19 @@ The `ChunkType` type defines the mastra format of stream chunks that can be emit
6
6
 
7
7
  All chunks include these base properties:
8
8
 
9
- **type:** (`string`): The specific chunk type identifier
9
+ **type** (`string`): The specific chunk type identifier
10
10
 
11
- **runId:** (`string`): Unique identifier for this execution run
11
+ **runId** (`string`): Unique identifier for this execution run
12
12
 
13
- **from:** (`ChunkFrom`): enumAGENT:'AGENT'Chunk from agent executionUSER:'USER'Chunk from user inputSYSTEM:'SYSTEM'Chunk from system processesWORKFLOW:'WORKFLOW'Chunk from workflow execution
13
+ **from** (`ChunkFrom`): Source of the chunk
14
+
15
+ **from.AGENT** (`'AGENT'`): Chunk from agent execution
16
+
17
+ **from.USER** (`'USER'`): Chunk from user input
18
+
19
+ **from.SYSTEM** (`'SYSTEM'`): Chunk from system processes
20
+
21
+ **from.WORKFLOW** (`'WORKFLOW'`): Chunk from workflow execution
14
22
 
15
23
  ## Text Chunks
16
24
 
@@ -18,25 +26,39 @@ All chunks include these base properties:
18
26
 
19
27
  Signals the beginning of text generation.
20
28
 
21
- **type:** (`"text-start"`): Chunk type identifier
29
+ **type** (`"text-start"`): Chunk type identifier
30
+
31
+ **payload** (`TextStartPayload`): Text start information
32
+
33
+ **payload.id** (`string`): Unique identifier for this text generation
22
34
 
23
- **payload:** (`TextStartPayload`): TextStartPayloadid:stringUnique identifier for this text generationproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
35
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
24
36
 
25
37
  ### text-delta
26
38
 
27
39
  Incremental text content during generation.
28
40
 
29
- **type:** (`"text-delta"`): Chunk type identifier
41
+ **type** (`"text-delta"`): Chunk type identifier
30
42
 
31
- **payload:** (`TextDeltaPayload`): TextDeltaPayloadid:stringUnique identifier for this text generationtext:stringThe incremental text contentproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
43
+ **payload** (`TextDeltaPayload`): Incremental text content
44
+
45
+ **payload.id** (`string`): Unique identifier for this text generation
46
+
47
+ **payload.text** (`string`): The incremental text content
48
+
49
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
32
50
 
33
51
  ### text-end
34
52
 
35
53
  Signals the end of text generation.
36
54
 
37
- **type:** (`"text-end"`): Chunk type identifier
55
+ **type** (`"text-end"`): Chunk type identifier
38
56
 
39
- **payload:** (`TextEndPayload`): TextEndPayloadid:stringUnique identifier for this text generationproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
57
+ **payload** (`TextEndPayload`): Text end information
58
+
59
+ **payload.id** (`string`): Unique identifier for this text generation
60
+
61
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
40
62
 
41
63
  ## Reasoning Chunks
42
64
 
@@ -44,33 +66,57 @@ Signals the end of text generation.
44
66
 
45
67
  Signals the beginning of reasoning generation (for models that support reasoning).
46
68
 
47
- **type:** (`"reasoning-start"`): Chunk type identifier
69
+ **type** (`"reasoning-start"`): Chunk type identifier
70
+
71
+ **payload** (`ReasoningStartPayload`): Reasoning start information
48
72
 
49
- **payload:** (`ReasoningStartPayload`): ReasoningStartPayloadid:stringUnique identifier for this reasoning generationsignature?:stringReasoning signature if availableproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
73
+ **payload.id** (`string`): Unique identifier for this reasoning generation
74
+
75
+ **payload.signature** (`string`): Reasoning signature if available
76
+
77
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
50
78
 
51
79
  ### reasoning-delta
52
80
 
53
81
  Incremental reasoning text during generation.
54
82
 
55
- **type:** (`"reasoning-delta"`): Chunk type identifier
83
+ **type** (`"reasoning-delta"`): Chunk type identifier
84
+
85
+ **payload** (`ReasoningDeltaPayload`): Incremental reasoning content
56
86
 
57
- **payload:** (`ReasoningDeltaPayload`): ReasoningDeltaPayloadid:stringUnique identifier for this reasoning generationtext:stringThe incremental reasoning textproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
87
+ **payload.id** (`string`): Unique identifier for this reasoning generation
88
+
89
+ **payload.text** (`string`): The incremental reasoning text
90
+
91
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
58
92
 
59
93
  ### reasoning-end
60
94
 
61
95
  Signals the end of reasoning generation.
62
96
 
63
- **type:** (`"reasoning-end"`): Chunk type identifier
97
+ **type** (`"reasoning-end"`): Chunk type identifier
98
+
99
+ **payload** (`ReasoningEndPayload`): Reasoning end information
64
100
 
65
- **payload:** (`ReasoningEndPayload`): ReasoningEndPayloadid:stringUnique identifier for this reasoning generationsignature?:stringFinal reasoning signature if availableproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
101
+ **payload.id** (`string`): Unique identifier for this reasoning generation
102
+
103
+ **payload.signature** (`string`): Final reasoning signature if available
104
+
105
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
66
106
 
67
107
  ### reasoning-signature
68
108
 
69
109
  Contains the reasoning signature from models that support advanced reasoning (like OpenAI's o1 series). The signature represents metadata about the model's internal reasoning process, such as effort level or reasoning approach, but not the actual reasoning content itself.
70
110
 
71
- **type:** (`"reasoning-signature"`): Chunk type identifier
111
+ **type** (`"reasoning-signature"`): Chunk type identifier
112
+
113
+ **payload** (`ReasoningSignaturePayload`): Metadata about the model's reasoning process characteristics
72
114
 
73
- **payload:** (`ReasoningSignaturePayload`): ReasoningSignaturePayloadid:stringUnique identifier for the reasoning sessionsignature:stringSignature describing the reasoning approach or effort level (e.g., reasoning effort settings)providerMetadata?:SharedV2ProviderMetadataProvider-specific metadata
115
+ **payload.id** (`string`): Unique identifier for the reasoning session
116
+
117
+ **payload.signature** (`string`): Signature describing the reasoning approach or effort level (e.g., reasoning effort settings)
118
+
119
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
74
120
 
75
121
  ## Tool Chunks
76
122
 
@@ -78,49 +124,111 @@ Contains the reasoning signature from models that support advanced reasoning (li
78
124
 
79
125
  A tool is being called.
80
126
 
81
- **type:** (`"tool-call"`): Chunk type identifier
127
+ **type** (`"tool-call"`): Chunk type identifier
128
+
129
+ **payload** (`ToolCallPayload`): Tool call information
82
130
 
83
- **payload:** (`ToolCallPayload`): ToolCallPayloadtoolCallId:stringUnique identifier for this tool calltoolName:stringName of the tool being calledargs?:Record\<string, any>Arguments passed to the toolproviderExecuted?:booleanWhether the provider executed the tooloutput?:anyTool output if availableproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
131
+ **payload.toolCallId** (`string`): Unique identifier for this tool call
132
+
133
+ **payload.toolName** (`string`): Name of the tool being called
134
+
135
+ **payload.args** (`Record<string, any>`): Arguments passed to the tool
136
+
137
+ **payload.providerExecuted** (`boolean`): Whether the provider executed the tool
138
+
139
+ **payload.output** (`any`): Tool output if available
140
+
141
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
84
142
 
85
143
  ### tool-result
86
144
 
87
145
  Result from a tool execution.
88
146
 
89
- **type:** (`"tool-result"`): Chunk type identifier
147
+ **type** (`"tool-result"`): Chunk type identifier
148
+
149
+ **payload** (`ToolResultPayload`): Tool execution result
150
+
151
+ **payload.toolCallId** (`string`): Unique identifier for the tool call
152
+
153
+ **payload.toolName** (`string`): Name of the executed tool
154
+
155
+ **payload.result** (`any`): The result of the tool execution
156
+
157
+ **payload.isError** (`boolean`): Whether the result is an error
158
+
159
+ **payload.providerExecuted** (`boolean`): Whether the provider executed the tool
160
+
161
+ **payload.args** (`Record<string, any>`): Arguments that were passed to the tool
90
162
 
91
- **payload:** (`ToolResultPayload`): ToolResultPayloadtoolCallId:stringUnique identifier for the tool calltoolName:stringName of the executed toolresult:anyThe result of the tool executionisError?:booleanWhether the result is an errorproviderExecuted?:booleanWhether the provider executed the toolargs?:Record\<string, any>Arguments that were passed to the toolproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
163
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
92
164
 
93
165
  ### tool-call-input-streaming-start
94
166
 
95
167
  Signals the start of streaming tool call arguments.
96
168
 
97
- **type:** (`"tool-call-input-streaming-start"`): Chunk type identifier
169
+ **type** (`"tool-call-input-streaming-start"`): Chunk type identifier
98
170
 
99
- **payload:** (`ToolCallInputStreamingStartPayload`): ToolCallInputStreamingStartPayloadtoolCallId:stringUnique identifier for this tool calltoolName:stringName of the tool being calledproviderExecuted?:booleanWhether the provider executed the tooldynamic?:booleanWhether the tool call is dynamicproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
171
+ **payload** (`ToolCallInputStreamingStartPayload`): Tool call input streaming start information
172
+
173
+ **payload.toolCallId** (`string`): Unique identifier for this tool call
174
+
175
+ **payload.toolName** (`string`): Name of the tool being called
176
+
177
+ **payload.providerExecuted** (`boolean`): Whether the provider executed the tool
178
+
179
+ **payload.dynamic** (`boolean`): Whether the tool call is dynamic
180
+
181
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
100
182
 
101
183
  ### tool-call-delta
102
184
 
103
185
  Incremental tool call arguments during streaming.
104
186
 
105
- **type:** (`"tool-call-delta"`): Chunk type identifier
187
+ **type** (`"tool-call-delta"`): Chunk type identifier
188
+
189
+ **payload** (`ToolCallDeltaPayload`): Incremental tool call arguments
106
190
 
107
- **payload:** (`ToolCallDeltaPayload`): ToolCallDeltaPayloadargsTextDelta:stringIncremental text delta for tool argumentstoolCallId:stringUnique identifier for this tool calltoolName?:stringName of the tool being calledproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
191
+ **payload.argsTextDelta** (`string`): Incremental text delta for tool arguments
192
+
193
+ **payload.toolCallId** (`string`): Unique identifier for this tool call
194
+
195
+ **payload.toolName** (`string`): Name of the tool being called
196
+
197
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
108
198
 
109
199
  ### tool-call-input-streaming-end
110
200
 
111
201
  Signals the end of streaming tool call arguments.
112
202
 
113
- **type:** (`"tool-call-input-streaming-end"`): Chunk type identifier
203
+ **type** (`"tool-call-input-streaming-end"`): Chunk type identifier
114
204
 
115
- **payload:** (`ToolCallInputStreamingEndPayload`): ToolCallInputStreamingEndPayloadtoolCallId:stringUnique identifier for this tool callproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
205
+ **payload** (`ToolCallInputStreamingEndPayload`): Tool call input streaming end information
206
+
207
+ **payload.toolCallId** (`string`): Unique identifier for this tool call
208
+
209
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
116
210
 
117
211
  ### tool-error
118
212
 
119
213
  An error occurred during tool execution.
120
214
 
121
- **type:** (`"tool-error"`): Chunk type identifier
215
+ **type** (`"tool-error"`): Chunk type identifier
216
+
217
+ **payload** (`ToolErrorPayload`): Tool error information
122
218
 
123
- **payload:** (`ToolErrorPayload`): ToolErrorPayloadid?:stringOptional identifiertoolCallId:stringUnique identifier for the tool calltoolName:stringName of the tool that failedargs?:Record\<string, any>Arguments that were passed to the toolerror:unknownThe error that occurredproviderExecuted?:booleanWhether the provider executed the toolproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
219
+ **payload.id** (`string`): Optional identifier
220
+
221
+ **payload.toolCallId** (`string`): Unique identifier for the tool call
222
+
223
+ **payload.toolName** (`string`): Name of the tool that failed
224
+
225
+ **payload.args** (`Record<string, any>`): Arguments that were passed to the tool
226
+
227
+ **payload.error** (`unknown`): The error that occurred
228
+
229
+ **payload.providerExecuted** (`boolean`): Whether the provider executed the tool
230
+
231
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
124
232
 
125
233
  ## Source and File Chunks
126
234
 
@@ -128,17 +236,39 @@ An error occurred during tool execution.
128
236
 
129
237
  Contains source information for content.
130
238
 
131
- **type:** (`"source"`): Chunk type identifier
239
+ **type** (`"source"`): Chunk type identifier
240
+
241
+ **payload** (`SourcePayload`): Source information
242
+
243
+ **payload.id** (`string`): Unique identifier
244
+
245
+ **payload.sourceType** (`'url' | 'document'`): Type of source
246
+
247
+ **payload.title** (`string`): Title of the source
248
+
249
+ **payload.mimeType** (`string`): MIME type of the source
250
+
251
+ **payload.filename** (`string`): Filename if applicable
132
252
 
133
- **payload:** (`SourcePayload`): SourcePayloadid:stringUnique identifiersourceType:'url' | 'document'Type of sourcetitle:stringTitle of the sourcemimeType?:stringMIME type of the sourcefilename?:stringFilename if applicableurl?:stringURL if applicableproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
253
+ **payload.url** (`string`): URL if applicable
254
+
255
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
134
256
 
135
257
  ### file
136
258
 
137
259
  Contains file data.
138
260
 
139
- **type:** (`"file"`): Chunk type identifier
261
+ **type** (`"file"`): Chunk type identifier
262
+
263
+ **payload** (`FilePayload`): File data
264
+
265
+ **payload.data** (`string | Uint8Array`): The file data
140
266
 
141
- **payload:** (`FilePayload`): FilePayloaddata:string | Uint8ArrayThe file database64?:stringBase64 encoded data if applicablemimeType:stringMIME type of the fileproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
267
+ **payload.base64** (`string`): Base64 encoded data if applicable
268
+
269
+ **payload.mimeType** (`string`): MIME type of the file
270
+
271
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
142
272
 
143
273
  ## Control Chunks
144
274
 
@@ -146,57 +276,97 @@ Contains file data.
146
276
 
147
277
  Signals the start of streaming.
148
278
 
149
- **type:** (`"start"`): Chunk type identifier
279
+ **type** (`"start"`): Chunk type identifier
280
+
281
+ **payload** (`StartPayload`): Start information
150
282
 
151
- **payload:** (`StartPayload`): StartPayload\[key: string]:anyAdditional start data
283
+ **payload.\[key: string]** (`any`): Additional start data
152
284
 
153
285
  ### step-start
154
286
 
155
287
  Signals the start of a processing step.
156
288
 
157
- **type:** (`"step-start"`): Chunk type identifier
289
+ **type** (`"step-start"`): Chunk type identifier
158
290
 
159
- **payload:** (`StepStartPayload`): StepStartPayloadmessageId?:stringOptional message identifierrequest:objectRequest information including body and other datawarnings?:LanguageModelV2CallWarning\[]Any warnings from the language model call
291
+ **payload** (`StepStartPayload`): Step start information
292
+
293
+ **payload.messageId** (`string`): Optional message identifier
294
+
295
+ **payload.request** (`object`): Request information including body and other data
296
+
297
+ **payload.warnings** (`LanguageModelV2CallWarning[]`): Any warnings from the language model call
160
298
 
161
299
  ### step-finish
162
300
 
163
301
  Signals the completion of a processing step.
164
302
 
165
- **type:** (`"step-finish"`): Chunk type identifier
303
+ **type** (`"step-finish"`): Chunk type identifier
304
+
305
+ **payload** (`StepFinishPayload`): Step completion information
306
+
307
+ **payload.id** (`string`): Optional identifier
308
+
309
+ **payload.messageId** (`string`): Optional message identifier
166
310
 
167
- **payload:** (`StepFinishPayload`): StepFinishPayloadid?:stringOptional identifiermessageId?:stringOptional message identifierstepResult:objectStep execution result with reason, warnings, and continuation infooutput:objectOutput information including usage statisticsmetadata:objectExecution metadata including request and provider infototalUsage?:LanguageModelV2UsageTotal usage statisticsresponse?:LanguageModelV2ResponseMetadataResponse metadataproviderMetadata?:SharedV2ProviderMetadataProvider-specific metadata
311
+ **payload.stepResult** (`object`): Step execution result with reason, warnings, and continuation info
312
+
313
+ **payload.output** (`object`): Output information including usage statistics
314
+
315
+ **payload.metadata** (`object`): Execution metadata including request and provider info
316
+
317
+ **payload.totalUsage** (`LanguageModelV2Usage`): Total usage statistics
318
+
319
+ **payload.response** (`LanguageModelV2ResponseMetadata`): Response metadata
320
+
321
+ **payload.providerMetadata** (`SharedV2ProviderMetadata`): Provider-specific metadata
168
322
 
169
323
  ### raw
170
324
 
171
325
  Contains raw data from the provider.
172
326
 
173
- **type:** (`"raw"`): Chunk type identifier
327
+ **type** (`"raw"`): Chunk type identifier
328
+
329
+ **payload** (`RawPayload`): Raw provider data
174
330
 
175
- **payload:** (`RawPayload`): RawPayload\[key: string]:anyRaw data from the provider
331
+ **payload.\[key: string]** (`any`): Raw data from the provider
176
332
 
177
333
  ### finish
178
334
 
179
335
  Stream has completed successfully.
180
336
 
181
- **type:** (`"finish"`): Chunk type identifier
337
+ **type** (`"finish"`): Chunk type identifier
182
338
 
183
- **payload:** (`FinishPayload`): FinishPayloadstepResult:objectStep execution resultoutput:objectOutput information including usagemetadata:objectExecution metadatamessages:objectMessage historyresponse:objectResponse metadata and messages from the model provider
339
+ **payload** (`FinishPayload`): Completion information
340
+
341
+ **payload.stepResult** (`object`): Step execution result
342
+
343
+ **payload.output** (`object`): Output information including usage
344
+
345
+ **payload.metadata** (`object`): Execution metadata
346
+
347
+ **payload.messages** (`object`): Message history
348
+
349
+ **payload.response** (`object`): Response metadata and messages from the model provider
184
350
 
185
351
  ### error
186
352
 
187
353
  An error occurred during streaming.
188
354
 
189
- **type:** (`"error"`): Chunk type identifier
355
+ **type** (`"error"`): Chunk type identifier
356
+
357
+ **payload** (`ErrorPayload`): Error information
190
358
 
191
- **payload:** (`ErrorPayload`): ErrorPayloaderror:unknownThe error that occurred
359
+ **payload.error** (`unknown`): The error that occurred
192
360
 
193
361
  ### abort
194
362
 
195
363
  Stream was aborted.
196
364
 
197
- **type:** (`"abort"`): Chunk type identifier
365
+ **type** (`"abort"`): Chunk type identifier
198
366
 
199
- **payload:** (`AbortPayload`): AbortPayload\[key: string]:anyAdditional abort data
367
+ **payload** (`AbortPayload`): Abort information
368
+
369
+ **payload.\[key: string]** (`any`): Additional abort data
200
370
 
201
371
  ## Object and Output Chunks
202
372
 
@@ -204,25 +374,29 @@ Stream was aborted.
204
374
 
205
375
  Emitted when using output generation with defined schemas. Contains partial or complete structured data that conforms to the specified Zod or JSON schema. This chunk is typically skipped in some execution contexts and used for streaming structured object generation.
206
376
 
207
- **type:** (`"object"`): Chunk type identifier
377
+ **type** (`"object"`): Chunk type identifier
208
378
 
209
- **object:** (`Partial<OUTPUT>`): Partial or complete structured data matching the defined schema. The type is determined by the OUTPUT schema parameter.
379
+ **object** (`Partial<OUTPUT>`): Partial or complete structured data matching the defined schema. The type is determined by the OUTPUT schema parameter.
210
380
 
211
381
  ### tool-output
212
382
 
213
383
  Contains output from agent or workflow execution, particularly used for tracking usage statistics and completion events. Often wraps other chunk types (like finish chunks) to provide nested execution context.
214
384
 
215
- **type:** (`"tool-output"`): Chunk type identifier
385
+ **type** (`"tool-output"`): Chunk type identifier
386
+
387
+ **payload** (`ToolOutputPayload`): Wrapped execution output with metadata
216
388
 
217
- **payload:** (`ToolOutputPayload`): ToolOutputPayloadoutput:ChunkTypeNested chunk data, often containing finish events with usage statistics
389
+ **payload.output** (`ChunkType`): Nested chunk data, often containing finish events with usage statistics
218
390
 
219
391
  ### step-output
220
392
 
221
393
  Contains output from workflow step execution, used primarily for usage tracking and step completion events. Similar to tool-output but specifically for individual workflow steps.
222
394
 
223
- **type:** (`"step-output"`): Chunk type identifier
395
+ **type** (`"step-output"`): Chunk type identifier
396
+
397
+ **payload** (`StepOutputPayload`): Workflow step execution output with metadata
224
398
 
225
- **payload:** (`StepOutputPayload`): StepOutputPayloadoutput:ChunkTypeNested chunk data from step execution, typically containing finish events or other step results
399
+ **payload.output** (`ChunkType`): Nested chunk data from step execution, typically containing finish events or other step results
226
400
 
227
401
  ## Metadata and Special Chunks
228
402
 
@@ -230,25 +404,43 @@ Contains output from workflow step execution, used primarily for usage tracking
230
404
 
231
405
  Contains metadata about the LLM provider's response. Emitted by some providers after text generation to provide additional context like model ID, timestamps, and response headers. This chunk is used internally for state tracking and doesn't affect message assembly.
232
406
 
233
- **type:** (`"response-metadata"`): Chunk type identifier
407
+ **type** (`"response-metadata"`): Chunk type identifier
234
408
 
235
- **payload:** (`ResponseMetadataPayload`): ResponseMetadataPayloadsignature?:stringResponse signature if available\[key: string]:anyAdditional provider-specific metadata fields (e.g., id, modelId, timestamp, headers)
409
+ **payload** (`ResponseMetadataPayload`): Provider response metadata for tracking and debugging
410
+
411
+ **payload.signature** (`string`): Response signature if available
412
+
413
+ **payload.\[key: string]** (`any`): Additional provider-specific metadata fields (e.g., id, modelId, timestamp, headers)
236
414
 
237
415
  ### watch
238
416
 
239
417
  Contains monitoring and observability data from agent execution. Can include workflow state information, execution progress, or other runtime details depending on the context where `stream()` is used.
240
418
 
241
- **type:** (`"watch"`): Chunk type identifier
419
+ **type** (`"watch"`): Chunk type identifier
420
+
421
+ **payload** (`WatchPayload`): Monitoring data for observability and debugging of agent execution
242
422
 
243
- **payload:** (`WatchPayload`): WatchPayloadworkflowState?:objectCurrent workflow execution state (when used in workflows)eventTimestamp?:numberTimestamp when the event occurred\[key: string]:anyAdditional monitoring and execution data
423
+ **payload.workflowState** (`object`): Current workflow execution state (when used in workflows)
424
+
425
+ **payload.eventTimestamp** (`number`): Timestamp when the event occurred
426
+
427
+ **payload.\[key: string]** (`any`): Additional monitoring and execution data
244
428
 
245
429
  ### tripwire
246
430
 
247
431
  Emitted when the stream is forcibly terminated due to content being blocked by a processor. This acts as a safety mechanism to prevent harmful or inappropriate content from being streamed. The payload includes information about why the content was blocked and whether a retry was requested.
248
432
 
249
- **type:** (`"tripwire"`): Chunk type identifier
433
+ **type** (`"tripwire"`): Chunk type identifier
434
+
435
+ **payload** (`TripwirePayload`): Information about why the stream was terminated by safety mechanisms
436
+
437
+ **payload.reason** (`string`): Explanation of why the content was blocked (e.g., 'Output processor blocked content')
438
+
439
+ **payload.retry** (`boolean`): Whether the processor requested a retry of the step
440
+
441
+ **payload.metadata** (`unknown`): Additional metadata from the processor (e.g., scores, categories)
250
442
 
251
- **payload:** (`TripwirePayload`): TripwirePayloadreason:stringExplanation of why the content was blocked (e.g., 'Output processor blocked content')retry?:booleanWhether the processor requested a retry of the stepmetadata?:unknownAdditional metadata from the processor (e.g., scores, categories)processorId?:stringID of the processor that triggered the tripwire
443
+ **payload.processorId** (`string`): ID of the processor that triggered the tripwire
252
444
 
253
445
  ## Usage Example
254
446
 
@@ -13,45 +13,115 @@ For setup and basic usage, see the [.stream()](https://mastra.ai/reference/strea
13
13
 
14
14
  These properties provide real-time access to model outputs as they're generated:
15
15
 
16
- **fullStream:** (`ReadableStream<ChunkType<OUTPUT>>`): ReadableStreamChunkType:ChunkType\<OUTPUT>All possible chunk types that can be emitted during streaming
16
+ **fullStream** (`ReadableStream<ChunkType<OUTPUT>>`): Complete stream of all chunk types including text, tool calls, reasoning, metadata, and control chunks. Provides granular access to every aspect of the model's response.
17
17
 
18
- **textStream:** (`ReadableStream<string>`): Stream of incremental text content only. Filters out all metadata, tool calls, and control chunks to provide just the text being generated.
18
+ **fullStream.ChunkType** (`ChunkType<OUTPUT>`): All possible chunk types that can be emitted during streaming
19
19
 
20
- **objectStream:** (`ReadableStream<Partial<OUTPUT>>`): ReadableStreamPartialSchemaOutput:Partial\<OUTPUT>Partially completed object matching the defined schema
20
+ **textStream** (`ReadableStream<string>`): Stream of incremental text content only. Filters out all metadata, tool calls, and control chunks to provide just the text being generated.
21
21
 
22
- **elementStream:** (`ReadableStream<OUTPUT extends (infer T)[] ? T : never>`): Stream of individual array elements when the output schema defines an array type. Each element is emitted as it's completed rather than waiting for the entire array.
22
+ **objectStream** (`ReadableStream<Partial<OUTPUT>>`): Stream of progressive structured object updates when using output schemas. Emits partial objects as they're built up, allowing real-time visualization of structured data generation.
23
+
24
+ **objectStream.PartialSchemaOutput** (`Partial<OUTPUT>`): Partially completed object matching the defined schema
25
+
26
+ **elementStream** (`ReadableStream<OUTPUT extends (infer T)[] ? T : never>`): Stream of individual array elements when the output schema defines an array type. Each element is emitted as it's completed rather than waiting for the entire array.
23
27
 
24
28
  ## Promise-based Properties
25
29
 
26
30
  These properties resolve to final values after the stream completes:
27
31
 
28
- **text:** (`Promise<string>`): The complete concatenated text response from the model. Resolves when text generation is finished.
32
+ **text** (`Promise<string>`): The complete concatenated text response from the model. Resolves when text generation is finished.
33
+
34
+ **object** (`Promise<OUTPUT>`): The complete structured object response when using output schemas. Validated against the schema before resolving. Rejects if validation fails.
35
+
36
+ **object.InferSchemaOutput** (`OUTPUT`): Fully typed object matching the exact schema definition
37
+
38
+ **reasoning** (`Promise<string>`): Complete reasoning text for models that support reasoning (like OpenAI's o1 series). Returns empty string for models without reasoning capability.
39
+
40
+ **reasoningText** (`Promise<string | undefined>`): Alternative access to reasoning content. May be undefined for models that don't support reasoning, while 'reasoning' returns empty string.
41
+
42
+ **toolCalls** (`Promise<ToolCallChunk[]>`): Array of all tool call chunks made during execution. Each chunk contains tool metadata and execution details.
43
+
44
+ **toolCalls.type** (`'tool-call'`): Chunk type identifier
45
+
46
+ **toolCalls.runId** (`string`): Execution run identifier
47
+
48
+ **toolCalls.from** (`ChunkFrom`): Source of the chunk (AGENT, WORKFLOW, etc.)
49
+
50
+ **toolCalls.payload** (`ToolCallPayload`): Tool call data including toolCallId, toolName, args, and execution details
51
+
52
+ **toolResults** (`Promise<ToolResultChunk[]>`): Array of all tool result chunks corresponding to the tool calls. Contains execution results and error information.
53
+
54
+ **toolResults.type** (`'tool-result'`): Chunk type identifier
55
+
56
+ **toolResults.runId** (`string`): Execution run identifier
57
+
58
+ **toolResults.from** (`ChunkFrom`): Source of the chunk (AGENT, WORKFLOW, etc.)
59
+
60
+ **toolResults.payload** (`ToolResultPayload`): Tool result data including toolCallId, toolName, result, and error status
61
+
62
+ **usage** (`Promise<LanguageModelUsage>`): Token usage statistics including input tokens, output tokens, total tokens, and reasoning tokens (for reasoning models).
63
+
64
+ **usage.inputTokens** (`number`): Tokens consumed by the input prompt
29
65
 
30
- **object:** (`Promise<OUTPUT>`): PromiseInferSchemaOutput:OUTPUTFully typed object matching the exact schema definition
66
+ **usage.outputTokens** (`number`): Tokens generated in the response
31
67
 
32
- **reasoning:** (`Promise<string>`): Complete reasoning text for models that support reasoning (like OpenAI's o1 series). Returns empty string for models without reasoning capability.
68
+ **usage.totalTokens** (`number`): Sum of input and output tokens
33
69
 
34
- **reasoningText:** (`Promise<string | undefined>`): Alternative access to reasoning content. May be undefined for models that don't support reasoning, while 'reasoning' returns empty string.
70
+ **usage.reasoningTokens** (`number`): Hidden reasoning tokens (for reasoning models)
35
71
 
36
- **toolCalls:** (`Promise<ToolCallChunk[]>`): ToolCallChunktype:'tool-call'Chunk type identifierrunId:stringExecution run identifierfrom:ChunkFromSource of the chunk (AGENT, WORKFLOW, etc.)payload:ToolCallPayloadTool call data including toolCallId, toolName, args, and execution details
72
+ **usage.cachedInputTokens** (`number`): Number of input tokens that were a cache hit
37
73
 
38
- **toolResults:** (`Promise<ToolResultChunk[]>`): ToolResultChunktype:'tool-result'Chunk type identifierrunId:stringExecution run identifierfrom:ChunkFromSource of the chunk (AGENT, WORKFLOW, etc.)payload:ToolResultPayloadTool result data including toolCallId, toolName, result, and error status
74
+ **finishReason** (`Promise<string | undefined>`): Reason why generation stopped (e.g., 'stop', 'length', 'tool\_calls', 'content\_filter'). Undefined if the stream hasn't finished.
39
75
 
40
- **usage:** (`Promise<LanguageModelUsage>`): RecordinputTokens:numberTokens consumed by the input promptoutputTokens:numberTokens generated in the responsetotalTokens:numberSum of input and output tokensreasoningTokens?:numberHidden reasoning tokens (for reasoning models)cachedInputTokens?:numberNumber of input tokens that were a cache hit
76
+ **finishReason.stop** (`'stop'`): Model finished naturally
41
77
 
42
- **finishReason:** (`Promise<string | undefined>`): enumstop:'stop'Model finished naturallylength:'length'Hit maximum token limittool\_calls:'tool\_calls'Model called toolscontent\_filter:'content\_filter'Content was filtered
78
+ **finishReason.length** (`'length'`): Hit maximum token limit
43
79
 
44
- **response:** (`Promise<Response>`): Responseid?:stringResponse ID from the model providertimestamp?:DateResponse timestampmodelId?:stringModel identifier used for this responseheaders?:Record\<string, string>Response headers from the model providermessages?:ResponseMessage\[]Response messages in model formatuiMessages?:UIMessage\[]Response messages in UI format, includes any metadata added by output processors
80
+ **finishReason.tool\_calls** (`'tool_calls'`): Model called tools
81
+
82
+ **finishReason.content\_filter** (`'content_filter'`): Content was filtered
83
+
84
+ **response** (`Promise<Response>`): Response metadata and messages from the model provider.
85
+
86
+ **response.id** (`string`): Response ID from the model provider
87
+
88
+ **response.timestamp** (`Date`): Response timestamp
89
+
90
+ **response.modelId** (`string`): Model identifier used for this response
91
+
92
+ **response.headers** (`Record<string, string>`): Response headers from the model provider
93
+
94
+ **response.messages** (`ResponseMessage[]`): Response messages in model format
95
+
96
+ **response.uiMessages** (`UIMessage[]`): Response messages in UI format, includes any metadata added by output processors
45
97
 
46
98
  ## Error Properties
47
99
 
48
- **error:** (`string | Error | { message: string; stack: string; } | undefined`): Error information if the stream encountered an error. Undefined if no errors occurred. Can be a string message, Error object, or serialized error with stack trace.
100
+ **error** (`string | Error | { message: string; stack: string; } | undefined`): Error information if the stream encountered an error. Undefined if no errors occurred. Can be a string message, Error object, or serialized error with stack trace.
49
101
 
50
102
  ## Methods
51
103
 
52
- **getFullOutput:** (`() => Promise<FullOutput>`): FullOutputtext:stringComplete text responseobject?:OUTPUTStructured output if schema was providedtoolCalls:ToolCallChunk\[]All tool call chunks madetoolResults:ToolResultChunk\[]All tool result chunksusage:Record\<string, number>Token usage statisticsreasoning?:stringReasoning text if availablefinishReason?:stringWhy generation finishedresponse:ResponseResponse metadata and messages from the model provider
104
+ **getFullOutput** (`() => Promise<FullOutput>`): Returns a comprehensive output object containing all results: text, structured object, tool calls, usage statistics, reasoning, and metadata. Convenient single method to access all stream results.
105
+
106
+ **getFullOutput.text** (`string`): Complete text response
107
+
108
+ **getFullOutput.object** (`OUTPUT`): Structured output if schema was provided
109
+
110
+ **getFullOutput.toolCalls** (`ToolCallChunk[]`): All tool call chunks made
111
+
112
+ **getFullOutput.toolResults** (`ToolResultChunk[]`): All tool result chunks
113
+
114
+ **getFullOutput.usage** (`Record<string, number>`): Token usage statistics
115
+
116
+ **getFullOutput.reasoning** (`string`): Reasoning text if available
117
+
118
+ **getFullOutput.finishReason** (`string`): Why generation finished
119
+
120
+ **getFullOutput.response** (`Response`): Response metadata and messages from the model provider
121
+
122
+ **consumeStream** (`(options?: ConsumeStreamOptions) => Promise<void>`): Manually consume the entire stream without processing chunks. Useful when you only need the final promise-based results and want to trigger stream consumption.
53
123
 
54
- **consumeStream:** (`(options?: ConsumeStreamOptions) => Promise<void>`): ConsumeStreamOptionsonError?:(error: Error) => voidCallback for handling stream errors
124
+ **consumeStream.onError** (`(error: Error) => void`): Callback for handling stream errors
55
125
 
56
126
  ## Usage Examples
57
127