@mastra/mcp-docs-server 1.0.0-beta.13 → 1.0.0-beta.15

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 (321) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +27 -27
  2. package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +78 -78
  3. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +195 -195
  4. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +173 -173
  5. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +195 -195
  6. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +195 -195
  7. package/.docs/organized/changelogs/%40mastra%2Fconvex.md +248 -0
  8. package/.docs/organized/changelogs/%40mastra%2Fcore.md +338 -338
  9. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +33 -33
  10. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +16 -16
  11. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +41 -41
  12. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +195 -195
  13. package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
  14. package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +6 -0
  15. package/.docs/organized/changelogs/%40mastra%2Flance.md +195 -195
  16. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +195 -195
  17. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +17 -17
  18. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +139 -139
  19. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +219 -219
  20. package/.docs/organized/changelogs/%40mastra%2Fmssql.md +219 -219
  21. package/.docs/organized/changelogs/%40mastra%2Fpg.md +235 -235
  22. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +102 -102
  23. package/.docs/organized/changelogs/%40mastra%2Frag.md +17 -17
  24. package/.docs/organized/changelogs/%40mastra%2Freact.md +77 -70
  25. package/.docs/organized/changelogs/%40mastra%2Fserver.md +218 -218
  26. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +195 -195
  27. package/.docs/organized/changelogs/create-mastra.md +13 -13
  28. package/.docs/organized/changelogs/mastra.md +56 -56
  29. package/.docs/organized/code-examples/agent-v6.md +210 -0
  30. package/.docs/organized/code-examples/ai-elements.md +1 -1
  31. package/.docs/organized/code-examples/client-side-tools.md +1 -1
  32. package/.docs/raw/agents/adding-voice.mdx +10 -6
  33. package/.docs/raw/agents/agent-approval.mdx +5 -6
  34. package/.docs/raw/agents/agent-memory.mdx +22 -30
  35. package/.docs/raw/agents/guardrails.mdx +60 -50
  36. package/.docs/raw/agents/networks.mdx +8 -12
  37. package/.docs/raw/agents/overview.mdx +39 -23
  38. package/.docs/raw/agents/processors.mdx +20 -19
  39. package/.docs/raw/agents/structured-output.mdx +11 -7
  40. package/.docs/raw/agents/using-tools.mdx +4 -5
  41. package/.docs/raw/deployment/mastra-server.mdx +3 -3
  42. package/.docs/raw/deployment/overview.mdx +7 -1
  43. package/.docs/raw/deployment/web-framework.mdx +4 -6
  44. package/.docs/raw/deployment/workflow-runners.mdx +14 -0
  45. package/.docs/raw/evals/custom-scorers.mdx +9 -6
  46. package/.docs/raw/evals/overview.mdx +3 -6
  47. package/.docs/raw/evals/running-in-ci.mdx +2 -2
  48. package/.docs/raw/getting-started/manual-install.mdx +20 -20
  49. package/.docs/raw/getting-started/mcp-docs-server.mdx +2 -2
  50. package/.docs/raw/getting-started/studio.mdx +1 -1
  51. package/.docs/raw/guides/agent-frameworks/ai-sdk.mdx +4 -4
  52. package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +30 -30
  53. package/.docs/raw/guides/build-your-ui/assistant-ui.mdx +8 -8
  54. package/.docs/raw/guides/build-your-ui/copilotkit.mdx +11 -11
  55. package/.docs/raw/guides/deployment/amazon-ec2.mdx +9 -9
  56. package/.docs/raw/guides/deployment/aws-lambda.mdx +11 -11
  57. package/.docs/raw/guides/deployment/azure-app-services.mdx +2 -2
  58. package/.docs/raw/guides/deployment/cloudflare-deployer.mdx +5 -6
  59. package/.docs/raw/guides/deployment/digital-ocean.mdx +10 -10
  60. package/.docs/raw/guides/deployment/index.mdx +1 -1
  61. package/.docs/raw/guides/deployment/inngest.mdx +444 -0
  62. package/.docs/raw/guides/deployment/netlify-deployer.mdx +4 -4
  63. package/.docs/raw/guides/deployment/vercel-deployer.mdx +5 -6
  64. package/.docs/raw/guides/getting-started/astro.mdx +292 -451
  65. package/.docs/raw/guides/getting-started/express.mdx +7 -7
  66. package/.docs/raw/guides/getting-started/hono.mdx +18 -18
  67. package/.docs/raw/guides/getting-started/next-js.mdx +19 -20
  68. package/.docs/raw/guides/getting-started/quickstart.mdx +4 -4
  69. package/.docs/raw/guides/getting-started/sveltekit.mdx +238 -409
  70. package/.docs/raw/guides/getting-started/vite-react.mdx +21 -21
  71. package/.docs/raw/guides/guide/ai-recruiter.mdx +10 -10
  72. package/.docs/raw/guides/guide/chef-michel.mdx +9 -11
  73. package/.docs/raw/guides/guide/notes-mcp-server.mdx +15 -15
  74. package/.docs/raw/guides/guide/research-assistant.mdx +13 -13
  75. package/.docs/raw/guides/guide/stock-agent.mdx +5 -5
  76. package/.docs/raw/guides/guide/web-search.mdx +8 -8
  77. package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +7 -7
  78. package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +2 -2
  79. package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +1 -1
  80. package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +11 -3
  81. package/.docs/raw/guides/migrations/upgrade-to-v1/processors.mdx +11 -0
  82. package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +41 -0
  83. package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +0 -2
  84. package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +21 -23
  85. package/.docs/raw/index.mdx +2 -2
  86. package/.docs/raw/mastra-cloud/deployment.mdx +39 -0
  87. package/.docs/raw/mastra-cloud/observability.mdx +9 -15
  88. package/.docs/raw/mastra-cloud/overview.mdx +14 -44
  89. package/.docs/raw/mastra-cloud/setup.mdx +64 -0
  90. package/.docs/raw/mastra-cloud/studio.mdx +35 -0
  91. package/.docs/raw/mcp/overview.mdx +31 -13
  92. package/.docs/raw/mcp/publishing-mcp-server.mdx +2 -2
  93. package/.docs/raw/memory/memory-processors.mdx +9 -9
  94. package/.docs/raw/memory/message-history.mdx +69 -0
  95. package/.docs/raw/memory/overview.mdx +34 -76
  96. package/.docs/raw/memory/semantic-recall.mdx +58 -49
  97. package/.docs/raw/memory/storage.mdx +188 -0
  98. package/.docs/raw/memory/working-memory.mdx +7 -7
  99. package/.docs/raw/observability/logging.mdx +9 -10
  100. package/.docs/raw/observability/overview.mdx +0 -1
  101. package/.docs/raw/observability/tracing/bridges/otel.mdx +2 -2
  102. package/.docs/raw/observability/tracing/exporters/default.mdx +3 -3
  103. package/.docs/raw/observability/tracing/exporters/langfuse.mdx +1 -2
  104. package/.docs/raw/observability/tracing/overview.mdx +23 -25
  105. package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +3 -3
  106. package/.docs/raw/rag/chunking-and-embedding.mdx +6 -6
  107. package/.docs/raw/rag/graph-rag.mdx +7 -7
  108. package/.docs/raw/rag/overview.mdx +1 -1
  109. package/.docs/raw/rag/retrieval.mdx +21 -22
  110. package/.docs/raw/rag/vector-databases.mdx +22 -22
  111. package/.docs/raw/reference/agents/agent.mdx +3 -3
  112. package/.docs/raw/reference/agents/generate.mdx +1 -1
  113. package/.docs/raw/reference/agents/generateLegacy.mdx +2 -2
  114. package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +2 -2
  115. package/.docs/raw/reference/agents/getDefaultOptions.mdx +2 -2
  116. package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +2 -2
  117. package/.docs/raw/reference/agents/getDescription.mdx +1 -1
  118. package/.docs/raw/reference/agents/getInstructions.mdx +2 -2
  119. package/.docs/raw/reference/agents/getLLM.mdx +2 -2
  120. package/.docs/raw/reference/agents/getMemory.mdx +2 -2
  121. package/.docs/raw/reference/agents/getModel.mdx +2 -2
  122. package/.docs/raw/reference/agents/getTools.mdx +2 -2
  123. package/.docs/raw/reference/agents/getVoice.mdx +2 -2
  124. package/.docs/raw/reference/agents/listAgents.mdx +2 -2
  125. package/.docs/raw/reference/agents/listScorers.mdx +2 -2
  126. package/.docs/raw/reference/agents/listTools.mdx +2 -2
  127. package/.docs/raw/reference/agents/listWorkflows.mdx +2 -2
  128. package/.docs/raw/reference/agents/network.mdx +1 -1
  129. package/.docs/raw/reference/ai-sdk/chat-route.mdx +2 -2
  130. package/.docs/raw/reference/ai-sdk/handle-chat-stream.mdx +1 -1
  131. package/.docs/raw/reference/ai-sdk/handle-network-stream.mdx +1 -1
  132. package/.docs/raw/reference/ai-sdk/handle-workflow-stream.mdx +1 -1
  133. package/.docs/raw/reference/ai-sdk/network-route.mdx +2 -2
  134. package/.docs/raw/reference/ai-sdk/to-ai-sdk-stream.mdx +6 -6
  135. package/.docs/raw/reference/ai-sdk/to-ai-sdk-v4-messages.mdx +3 -3
  136. package/.docs/raw/reference/ai-sdk/to-ai-sdk-v5-messages.mdx +3 -3
  137. package/.docs/raw/reference/ai-sdk/with-mastra.mdx +1 -1
  138. package/.docs/raw/reference/ai-sdk/workflow-route.mdx +2 -2
  139. package/.docs/raw/reference/auth/auth0.mdx +1 -2
  140. package/.docs/raw/reference/auth/clerk.mdx +1 -2
  141. package/.docs/raw/reference/auth/firebase.mdx +2 -4
  142. package/.docs/raw/reference/auth/jwt.mdx +1 -2
  143. package/.docs/raw/reference/auth/supabase.mdx +1 -2
  144. package/.docs/raw/reference/auth/workos.mdx +1 -2
  145. package/.docs/raw/reference/cli/create-mastra.mdx +10 -10
  146. package/.docs/raw/reference/cli/mastra.mdx +9 -9
  147. package/.docs/raw/reference/client-js/agents.mdx +1 -2
  148. package/.docs/raw/reference/client-js/mastra-client.mdx +1 -1
  149. package/.docs/raw/reference/core/getAgent.mdx +1 -1
  150. package/.docs/raw/reference/core/getAgentById.mdx +1 -1
  151. package/.docs/raw/reference/core/getDeployer.mdx +1 -1
  152. package/.docs/raw/reference/core/getLogger.mdx +1 -1
  153. package/.docs/raw/reference/core/getMCPServer.mdx +1 -1
  154. package/.docs/raw/reference/core/getMCPServerById.mdx +1 -1
  155. package/.docs/raw/reference/core/getMemory.mdx +2 -2
  156. package/.docs/raw/reference/core/getServer.mdx +1 -1
  157. package/.docs/raw/reference/core/getStorage.mdx +2 -2
  158. package/.docs/raw/reference/core/getStoredAgentById.mdx +3 -3
  159. package/.docs/raw/reference/core/getTelemetry.mdx +1 -1
  160. package/.docs/raw/reference/core/getVector.mdx +1 -1
  161. package/.docs/raw/reference/core/getWorkflow.mdx +1 -1
  162. package/.docs/raw/reference/core/listAgents.mdx +1 -1
  163. package/.docs/raw/reference/core/listLogs.mdx +1 -1
  164. package/.docs/raw/reference/core/listLogsByRunId.mdx +1 -1
  165. package/.docs/raw/reference/core/listMCPServers.mdx +1 -1
  166. package/.docs/raw/reference/core/listMemory.mdx +2 -2
  167. package/.docs/raw/reference/core/listStoredAgents.mdx +4 -4
  168. package/.docs/raw/reference/core/listVectors.mdx +1 -1
  169. package/.docs/raw/reference/core/listWorkflows.mdx +1 -1
  170. package/.docs/raw/reference/core/setLogger.mdx +1 -1
  171. package/.docs/raw/reference/core/setStorage.mdx +2 -2
  172. package/.docs/raw/reference/core/setTelemetry.mdx +1 -1
  173. package/.docs/raw/reference/deployer/cloudflare.mdx +1 -2
  174. package/.docs/raw/reference/deployer/deployer.mdx +0 -1
  175. package/.docs/raw/reference/deployer/netlify.mdx +1 -1
  176. package/.docs/raw/reference/deployer/vercel.mdx +2 -4
  177. package/.docs/raw/reference/evals/answer-relevancy.mdx +1 -1
  178. package/.docs/raw/reference/evals/answer-similarity.mdx +1 -1
  179. package/.docs/raw/reference/evals/bias.mdx +1 -1
  180. package/.docs/raw/reference/evals/completeness.mdx +1 -1
  181. package/.docs/raw/reference/evals/content-similarity.mdx +1 -1
  182. package/.docs/raw/reference/evals/context-precision.mdx +1 -1
  183. package/.docs/raw/reference/evals/faithfulness.mdx +1 -1
  184. package/.docs/raw/reference/evals/hallucination.mdx +1 -1
  185. package/.docs/raw/reference/evals/keyword-coverage.mdx +1 -1
  186. package/.docs/raw/reference/evals/prompt-alignment.mdx +7 -7
  187. package/.docs/raw/reference/evals/textual-difference.mdx +1 -1
  188. package/.docs/raw/reference/evals/tone-consistency.mdx +1 -1
  189. package/.docs/raw/reference/evals/tool-call-accuracy.mdx +10 -10
  190. package/.docs/raw/reference/evals/toxicity.mdx +1 -1
  191. package/.docs/raw/reference/logging/pino-logger.mdx +7 -8
  192. package/.docs/raw/reference/memory/createThread.mdx +2 -2
  193. package/.docs/raw/reference/memory/deleteMessages.mdx +2 -2
  194. package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +2 -2
  195. package/.docs/raw/reference/memory/memory-class.mdx +3 -3
  196. package/.docs/raw/reference/memory/query.mdx +2 -2
  197. package/.docs/raw/reference/memory/recall.mdx +2 -2
  198. package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +1 -1
  199. package/.docs/raw/reference/processors/batch-parts-processor.mdx +2 -2
  200. package/.docs/raw/reference/processors/language-detector.mdx +2 -2
  201. package/.docs/raw/reference/processors/message-history-processor.mdx +2 -2
  202. package/.docs/raw/reference/processors/moderation-processor.mdx +3 -3
  203. package/.docs/raw/reference/processors/pii-detector.mdx +3 -3
  204. package/.docs/raw/reference/processors/processor-interface.mdx +13 -13
  205. package/.docs/raw/reference/processors/prompt-injection-detector.mdx +2 -2
  206. package/.docs/raw/reference/processors/semantic-recall-processor.mdx +2 -2
  207. package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +2 -2
  208. package/.docs/raw/reference/processors/token-limiter-processor.mdx +40 -19
  209. package/.docs/raw/reference/processors/tool-call-filter.mdx +3 -3
  210. package/.docs/raw/reference/processors/unicode-normalizer.mdx +2 -2
  211. package/.docs/raw/reference/processors/working-memory-processor.mdx +3 -3
  212. package/.docs/raw/reference/rag/chunk.mdx +1 -1
  213. package/.docs/raw/reference/rag/extract-params.mdx +2 -2
  214. package/.docs/raw/reference/rag/metadata-filters.mdx +7 -7
  215. package/.docs/raw/reference/server/create-route.mdx +13 -13
  216. package/.docs/raw/reference/server/express-adapter.mdx +6 -7
  217. package/.docs/raw/reference/server/hono-adapter.mdx +6 -7
  218. package/.docs/raw/reference/server/mastra-server.mdx +20 -20
  219. package/.docs/raw/reference/storage/cloudflare-d1.mdx +7 -5
  220. package/.docs/raw/reference/storage/cloudflare.mdx +2 -2
  221. package/.docs/raw/reference/storage/convex.mdx +6 -6
  222. package/.docs/raw/reference/storage/dynamodb.mdx +4 -4
  223. package/.docs/raw/reference/storage/lance.mdx +6 -5
  224. package/.docs/raw/reference/storage/libsql.mdx +72 -54
  225. package/.docs/raw/reference/storage/mongodb.mdx +84 -9
  226. package/.docs/raw/reference/storage/mssql.mdx +8 -6
  227. package/.docs/raw/{memory → reference}/storage/overview.mdx +12 -110
  228. package/.docs/raw/reference/storage/postgresql.mdx +82 -9
  229. package/.docs/raw/reference/storage/upstash.mdx +74 -2
  230. package/.docs/raw/reference/streaming/agents/stream.mdx +5 -5
  231. package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +2 -2
  232. package/.docs/raw/reference/streaming/workflows/observeStream.mdx +1 -1
  233. package/.docs/raw/reference/streaming/workflows/resumeStream.mdx +1 -1
  234. package/.docs/raw/reference/streaming/workflows/stream.mdx +2 -2
  235. package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +4 -4
  236. package/.docs/raw/reference/templates/overview.mdx +1 -2
  237. package/.docs/raw/reference/tools/create-tool.mdx +1 -4
  238. package/.docs/raw/reference/tools/vector-query-tool.mdx +1 -1
  239. package/.docs/raw/reference/vectors/astra.mdx +3 -3
  240. package/.docs/raw/reference/vectors/chroma.mdx +3 -3
  241. package/.docs/raw/reference/vectors/convex.mdx +12 -12
  242. package/.docs/raw/reference/vectors/couchbase.mdx +5 -5
  243. package/.docs/raw/reference/vectors/duckdb.mdx +10 -10
  244. package/.docs/raw/reference/vectors/elasticsearch.mdx +4 -4
  245. package/.docs/raw/reference/vectors/lance.mdx +4 -4
  246. package/.docs/raw/reference/vectors/libsql.mdx +61 -11
  247. package/.docs/raw/reference/vectors/mongodb.mdx +58 -5
  248. package/.docs/raw/reference/vectors/pg.mdx +53 -6
  249. package/.docs/raw/reference/vectors/pinecone.mdx +3 -3
  250. package/.docs/raw/reference/vectors/qdrant.mdx +3 -3
  251. package/.docs/raw/reference/vectors/s3vectors.mdx +6 -6
  252. package/.docs/raw/reference/vectors/turbopuffer.mdx +4 -4
  253. package/.docs/raw/reference/vectors/upstash.mdx +55 -6
  254. package/.docs/raw/reference/vectors/vectorize.mdx +3 -3
  255. package/.docs/raw/reference/workflows/run-methods/cancel.mdx +2 -2
  256. package/.docs/raw/reference/workflows/run-methods/restart.mdx +1 -3
  257. package/.docs/raw/reference/workflows/run-methods/resume.mdx +2 -2
  258. package/.docs/raw/reference/workflows/run-methods/start.mdx +2 -2
  259. package/.docs/raw/reference/workflows/run-methods/startAsync.mdx +2 -2
  260. package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +5 -5
  261. package/.docs/raw/reference/workflows/run.mdx +1 -1
  262. package/.docs/raw/reference/workflows/step.mdx +3 -3
  263. package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +1 -1
  264. package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +1 -1
  265. package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +3 -3
  266. package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +1 -1
  267. package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +1 -1
  268. package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +6 -6
  269. package/.docs/raw/reference/workflows/workflow-methods/map.mdx +7 -7
  270. package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +1 -1
  271. package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +2 -2
  272. package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +2 -2
  273. package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +2 -2
  274. package/.docs/raw/reference/workflows/workflow-methods/then.mdx +1 -1
  275. package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +2 -2
  276. package/.docs/raw/reference/workflows/workflow.mdx +3 -3
  277. package/.docs/raw/server/auth/auth0.mdx +20 -14
  278. package/.docs/raw/server/auth/clerk.mdx +16 -9
  279. package/.docs/raw/server/auth/firebase.mdx +21 -15
  280. package/.docs/raw/server/auth/jwt.mdx +14 -7
  281. package/.docs/raw/server/auth/supabase.mdx +16 -9
  282. package/.docs/raw/server/auth/workos.mdx +19 -13
  283. package/.docs/raw/server/custom-adapters.mdx +10 -10
  284. package/.docs/raw/server/custom-api-routes.mdx +2 -4
  285. package/.docs/raw/server/mastra-client.mdx +24 -13
  286. package/.docs/raw/server/mastra-server.mdx +3 -3
  287. package/.docs/raw/server/middleware.mdx +7 -7
  288. package/.docs/raw/server/request-context.mdx +31 -30
  289. package/.docs/raw/server/server-adapters.mdx +6 -6
  290. package/.docs/raw/streaming/events.mdx +14 -7
  291. package/.docs/raw/streaming/overview.mdx +21 -10
  292. package/.docs/raw/streaming/tool-streaming.mdx +6 -6
  293. package/.docs/raw/streaming/workflow-streaming.mdx +6 -8
  294. package/.docs/raw/tools-mcp/advanced-usage.mdx +2 -2
  295. package/.docs/raw/tools-mcp/mcp-overview.mdx +31 -12
  296. package/.docs/raw/tools-mcp/overview.mdx +9 -10
  297. package/.docs/raw/voice/overview.mdx +2 -2
  298. package/.docs/raw/workflows/agents-and-tools.mdx +28 -19
  299. package/.docs/raw/workflows/control-flow.mdx +27 -40
  300. package/.docs/raw/workflows/error-handling.mdx +15 -22
  301. package/.docs/raw/workflows/human-in-the-loop.mdx +6 -7
  302. package/.docs/raw/workflows/input-data-mapping.mdx +7 -7
  303. package/.docs/raw/workflows/overview.mdx +34 -23
  304. package/.docs/raw/workflows/snapshots.mdx +16 -45
  305. package/.docs/raw/workflows/suspend-and-resume.mdx +7 -7
  306. package/.docs/raw/workflows/time-travel.mdx +16 -16
  307. package/.docs/raw/workflows/workflow-state.mdx +5 -8
  308. package/CHANGELOG.md +16 -0
  309. package/dist/logger.d.ts +3 -0
  310. package/dist/logger.d.ts.map +1 -1
  311. package/dist/stdio.js +53 -0
  312. package/package.json +3 -3
  313. package/.docs/raw/mastra-cloud/dashboard.mdx +0 -96
  314. package/.docs/raw/mastra-cloud/setting-up.mdx +0 -102
  315. package/.docs/raw/memory/conversation-history.mdx +0 -24
  316. package/.docs/raw/memory/storage/memory-with-libsql.mdx +0 -140
  317. package/.docs/raw/memory/storage/memory-with-mongodb.mdx +0 -150
  318. package/.docs/raw/memory/storage/memory-with-pg.mdx +0 -138
  319. package/.docs/raw/memory/storage/memory-with-upstash.mdx +0 -146
  320. package/.docs/raw/memory/threads-and-resources.mdx +0 -95
  321. package/.docs/raw/workflows/inngest-workflow.mdx +0 -363
@@ -1,502 +1,502 @@
1
1
  # @mastra/core
2
2
 
3
- ## 1.0.0-beta.13
3
+ ## 1.0.0-beta.15
4
4
 
5
- ### Patch Changes
5
+ ### Minor Changes
6
6
 
7
- - Add `onFinish` and `onError` lifecycle callbacks to workflow options ([#11200](https://github.com/mastra-ai/mastra/pull/11200))
7
+ - Introduce StorageDomain base class for composite storage support ([#11249](https://github.com/mastra-ai/mastra/pull/11249))
8
8
 
9
- Workflows now support lifecycle callbacks for server-side handling of workflow completion and errors:
10
- - `onFinish`: Called when workflow completes with any status (success, failed, suspended, tripwire)
11
- - `onError`: Called only when workflow fails (failed or tripwire status)
9
+ Storage adapters now use a domain-based architecture where each domain (memory, workflows, scores, observability, agents) extends a `StorageDomain` base class with `init()` and `dangerouslyClearAll()` methods.
10
+
11
+ **Key changes:**
12
+ - Add `StorageDomain` abstract base class that all domain storage classes extend
13
+ - Add `InMemoryDB` class for shared state across in-memory domain implementations
14
+ - All storage domains now implement `dangerouslyClearAll()` for test cleanup
15
+ - Remove `operations` from public `StorageDomains` type (now internal to each adapter)
16
+ - Add flexible client/config patterns - domains accept either an existing database client or config to create one internally
17
+
18
+ **Why this matters:**
19
+
20
+ This enables composite storage where you can use different database adapters per domain:
12
21
 
13
22
  ```typescript
14
- const workflow = createWorkflow({
15
- id: 'my-workflow',
16
- inputSchema: z.object({ ... }),
17
- outputSchema: z.object({ ... }),
18
- options: {
19
- onFinish: async (result) => {
20
- // Handle any workflow completion
21
- await updateJobStatus(result.status);
22
- },
23
- onError: async (errorInfo) => {
24
- // Handle workflow failures
25
- await logError(errorInfo.error);
26
- },
27
- },
23
+ import { Mastra } from '@mastra/core';
24
+ import { PostgresStore } from '@mastra/pg';
25
+ import { ClickhouseStore } from '@mastra/clickhouse';
26
+
27
+ // Use Postgres for most domains but Clickhouse for observability
28
+ const mastra = new Mastra({
29
+ storage: new PostgresStore({
30
+ connectionString: 'postgres://...',
31
+ }),
32
+ // Future: override specific domains
33
+ // observability: new ClickhouseStore({ ... }).getStore('observability'),
28
34
  });
29
35
  ```
30
36
 
31
- Both callbacks support sync and async functions. Callback errors are caught and logged, not propagated to the workflow result.
37
+ **Standalone domain usage:**
32
38
 
33
- ## 1.0.0-beta.12
39
+ Domains can now be used independently with flexible configuration:
34
40
 
35
- ### Patch Changes
41
+ ```typescript
42
+ import { MemoryLibSQL } from '@mastra/libsql/memory';
36
43
 
37
- - Remove redundant toolCalls from network agent finalResult ([#11189](https://github.com/mastra-ai/mastra/pull/11189))
44
+ // Option 1: Pass config to create client internally
45
+ const memory = new MemoryLibSQL({
46
+ url: 'file:./local.db',
47
+ });
38
48
 
39
- The network agent's `finalResult` was storing `toolCalls` separately even though all tool call information is already present in the `messages` array (as `tool-call` and `tool-result` type messages). This caused significant token waste since the routing agent reads this data from memory on every iteration.
49
+ // Option 2: Pass existing client for shared connections
50
+ import { createClient } from '@libsql/client';
51
+ const client = createClient({ url: 'file:./local.db' });
52
+ const memory = new MemoryLibSQL({ client });
53
+ ```
40
54
 
41
- **Before:** `finalResult: { text, toolCalls, messages }`
42
- **After:** `finalResult: { text, messages }`
55
+ **Breaking changes:**
56
+ - `StorageDomains` type no longer includes `operations` - access via `getStore()` instead
57
+ - Domain base classes now require implementing `dangerouslyClearAll()` method
43
58
 
44
- +**Migration:** If you were accessing `finalResult.toolCalls`, retrieve tool calls from `finalResult.messages` by filtering for messages with `type: 'tool-call'`.
59
+ - Refactor storage architecture to use domain-specific stores via `getStore()` pattern ([#11361](https://github.com/mastra-ai/mastra/pull/11361))
45
60
 
46
- Updated `@mastra/react` to extract tool calls directly from the `messages` array instead of the removed `toolCalls` field when resolving initial messages from memory.
61
+ ### Summary
47
62
 
48
- Fixes #11059
63
+ This release introduces a new storage architecture that replaces passthrough methods on `MastraStorage` with domain-specific storage interfaces accessed via `getStore()`. This change reduces code duplication across storage adapters and provides a cleaner, more modular API.
49
64
 
50
- - Embed AI types to fix peerdeps mismatches ([`9650cce`](https://github.com/mastra-ai/mastra/commit/9650cce52a1d917ff9114653398e2a0f5c3ba808))
65
+ ### Migration Guide
51
66
 
52
- - Fix invalid state: Controller is already closed ([`932d63d`](https://github.com/mastra-ai/mastra/commit/932d63dd51be9c8bf1e00e3671fe65606c6fb9cd))
67
+ All direct method calls on storage instances should be updated to use `getStore()`:
53
68
 
54
- Fixes #11005
69
+ ```typescript
70
+ // Before
71
+ const thread = await storage.getThreadById({ threadId });
72
+ await storage.persistWorkflowSnapshot({ workflowName, runId, snapshot });
73
+ await storage.createSpan(span);
55
74
 
56
- - Fix HITL (Human-In-The-Loop) tool execution bug when mixing tools with and without execute functions. ([#11178](https://github.com/mastra-ai/mastra/pull/11178))
75
+ // After
76
+ const memory = await storage.getStore('memory');
77
+ const thread = await memory?.getThreadById({ threadId });
57
78
 
58
- When an agent called multiple tools simultaneously where some had `execute` functions and others didn't (HITL tools expecting `addToolResult` from the frontend), the HITL tools would incorrectly receive `result: undefined` and be marked as "output-available" instead of "input-available". This caused the agent to continue instead of pausing for user input.
79
+ const workflows = await storage.getStore('workflows');
80
+ await workflows?.persistWorkflowSnapshot({ workflowName, runId, snapshot });
59
81
 
60
- - Add resourceId to workflow routes ([#11166](https://github.com/mastra-ai/mastra/pull/11166))
82
+ const observability = await storage.getStore('observability');
83
+ await observability?.createSpan(span);
84
+ ```
61
85
 
62
- - Auto resume suspended tools if `autoResumeSuspendedTools: true` ([#11157](https://github.com/mastra-ai/mastra/pull/11157))
86
+ ### Available Domains
87
+ - **`memory`**: Thread and message operations (`getThreadById`, `saveThread`, `saveMessages`, etc.)
88
+ - **`workflows`**: Workflow state persistence (`persistWorkflowSnapshot`, `loadWorkflowSnapshot`, `getWorkflowRunById`, etc.)
89
+ - **`scores`**: Evaluation scores (`saveScore`, `listScoresByScorerId`, etc.)
90
+ - **`observability`**: Tracing and spans (`createSpan`, `updateSpan`, `getTrace`, etc.)
91
+ - **`agents`**: Stored agent configurations (`createAgent`, `getAgentById`, `listAgents`, etc.)
63
92
 
64
- The flag can be added to `defaultAgentOptions` when creating the agent or to options in `agent.stream` or `agent.generate`
93
+ ### Breaking Changes
94
+ - Passthrough methods have been removed from `MastraStorage` base class
95
+ - All storage adapters now require accessing domains via `getStore()`
96
+ - The `stores` property on storage instances is now the canonical way to access domain storage
65
97
 
66
- ```typescript
67
- const agent = new Agent({
68
- //...agent information,
69
- defaultAgentOptions: {
70
- autoResumeSuspendedTools: true,
71
- },
72
- });
73
- ```
98
+ ### Internal Changes
99
+ - Each storage adapter now initializes domain-specific stores in its constructor
100
+ - Domain stores share database connections and handle their own table initialization
74
101
 
75
- - Preserve error details when thrown from workflow steps ([#10992](https://github.com/mastra-ai/mastra/pull/10992))
76
- - Errors thrown in workflow steps now preserve full error details including `cause` chain and custom properties
77
- - Added `SerializedError` type with proper cause chain support
78
- - Added `SerializedStepResult` and `SerializedStepFailure` types for handling errors loaded from storage
79
- - Enhanced `addErrorToJSON` to recursively serialize error cause chains with max depth protection
80
- - Added `hydrateSerializedStepErrors` to convert serialized errors back to Error instances
81
- - Fixed Inngest workflow error handling to extract original error from `NonRetriableError.cause`
102
+ - Add support for AI SDK v6 ToolLoopAgent in Mastra ([#11254](https://github.com/mastra-ai/mastra/pull/11254))
82
103
 
83
- - Move `@ai-sdk/azure` to devDependencies ([#10218](https://github.com/mastra-ai/mastra/pull/10218))
104
+ You can now pass an AI SDK v6 `ToolLoopAgent` directly to Mastra's agents configuration. The agent will be automatically converted to a Mastra Agent while preserving all ToolLoopAgent lifecycle hooks:
105
+ - `prepareCall` - Called once at the start of generate/stream
106
+ - `prepareStep` - Called before each step in the agentic loop
107
+ - `stopWhen` - Custom stop conditions for the loop
84
108
 
85
- - Refactor internal event system from Emitter to PubSub abstraction for workflow event handling. This change replaces the EventEmitter-based event system with a pluggable PubSub interface, enabling support for distributed workflow execution backends like Inngest. Adds `close()` method to PubSub implementations for proper cleanup. ([#11052](https://github.com/mastra-ai/mastra/pull/11052))
109
+ Example:
86
110
 
87
- - Add `startAsync()` method and fix Inngest duplicate workflow execution bug ([#11093](https://github.com/mastra-ai/mastra/pull/11093))
111
+ ```typescript
112
+ import { ToolLoopAgent } from 'ai';
113
+ import { Mastra } from '@mastra/core/mastra';
114
+
115
+ const toolLoopAgent = new ToolLoopAgent({
116
+ model: openai('gpt-4o'),
117
+ instructions: 'You are a helpful assistant.',
118
+ tools: { weather: weatherTool },
119
+ prepareStep: async ({ stepNumber }) => {
120
+ if (stepNumber === 0) {
121
+ return { toolChoice: 'required' };
122
+ }
123
+ },
124
+ });
88
125
 
89
- **New Feature: `startAsync()` for fire-and-forget workflow execution**
90
- - Add `Run.startAsync()` to base workflow class - starts workflow in background and returns `{ runId }` immediately
91
- - Add `EventedRun.startAsync()` - publishes workflow start event without subscribing for completion
92
- - Add `InngestRun.startAsync()` - sends Inngest event without polling for result
126
+ const mastra = new Mastra({
127
+ agents: { toolLoopAgent },
128
+ });
93
129
 
94
- **Bug Fix: Prevent duplicate Inngest workflow executions**
95
- - Fix `getRuns()` to properly handle rate limits (429), empty responses, and JSON parse errors with retry logic and exponential backoff
96
- - Fix `getRunOutput()` to throw `NonRetriableError` when polling fails, preventing Inngest from retrying the parent function and re-triggering the workflow
97
- - Add timeout to `getRunOutput()` polling (default 5 minutes) with `NonRetriableError` on timeout
130
+ // Use like any other Mastra agent
131
+ const agent = mastra.getAgent('toolLoopAgent');
132
+ const result = await agent.generate('What is the weather?');
133
+ ```
98
134
 
99
- This fixes a production issue where polling failures after successful workflow completion caused Inngest to retry the parent function, which fired a new workflow event and resulted in duplicate executions (e.g., duplicate Slack messages).
135
+ - Unified observability schema with entity-based span identification ([#11132](https://github.com/mastra-ai/mastra/pull/11132))
100
136
 
101
- - Preserve error details when thrown from workflow steps ([#10992](https://github.com/mastra-ai/mastra/pull/10992))
137
+ ## What changed
102
138
 
103
- Workflow errors now retain custom properties like `statusCode`, `responseHeaders`, and `cause` chains. This enables error-specific recovery logic in your applications.
139
+ Spans now use a unified identification model with `entityId`, `entityType`, and `entityName` instead of separate `agentId`, `toolId`, `workflowId` fields.
104
140
 
105
141
  **Before:**
106
142
 
107
143
  ```typescript
108
- const result = await workflow.execute({ input });
109
- if (result.status === 'failed') {
110
- // Custom error properties were lost
111
- console.log(result.error); // "Step execution failed" (just a string)
112
- }
144
+ // Old span structure
145
+ span.agentId; // 'my-agent'
146
+ span.toolId; // undefined
147
+ span.workflowId; // undefined
113
148
  ```
114
149
 
115
150
  **After:**
116
151
 
117
152
  ```typescript
118
- const result = await workflow.execute({ input });
119
- if (result.status === 'failed') {
120
- // Custom properties are preserved
121
- console.log(result.error.message); // "Step execution failed"
122
- console.log(result.error.statusCode); // 429
123
- console.log(result.error.cause?.name); // "RateLimitError"
124
- }
153
+ // New span structure
154
+ span.entityType; // EntityType.AGENT
155
+ span.entityId; // 'my-agent'
156
+ span.entityName; // 'My Agent'
125
157
  ```
126
158
 
127
- **Type change:** `WorkflowState.error` and `WorkflowRunState.error` types changed from `string | Error` to `SerializedError`.
128
-
129
- Other changes:
130
- - Added `UpdateWorkflowStateOptions` type for workflow state updates
131
-
132
- - Fix Zod 4 compatibility issue with structuredOutput in agent.generate() ([#11133](https://github.com/mastra-ai/mastra/pull/11133))
133
-
134
- Users with Zod 4 installed would see `TypeError: undefined is not an object (evaluating 'def.valueType._zod')` when using `structuredOutput` with agent.generate(). This happened because ProcessorStepSchema contains `z.custom()` fields that hold user-provided Zod schemas, and the workflow validation was trying to deeply validate these schemas causing version conflicts.
159
+ ## New `listTraces()` API
135
160
 
136
- The fix disables input validation for processor workflows since `z.custom()` fields are meant to pass through arbitrary types without deep validation.
161
+ Query traces with filtering, pagination, and sorting:
137
162
 
138
- - Truncate map config when too long ([#11175](https://github.com/mastra-ai/mastra/pull/11175))
139
-
140
- - Add helpful JSDoc comments to `BundlerConfig` properties (used with `bundler` option) ([#10218](https://github.com/mastra-ai/mastra/pull/10218))
141
-
142
- - Fixes .network() method ignores MASTRA_RESOURCE_ID_KEY from requestContext ([`4524734`](https://github.com/mastra-ai/mastra/commit/45247343e384717a7c8404296275c56201d6470f))
143
-
144
- - fix: make getSqlType consistent across storage adapters ([#11112](https://github.com/mastra-ai/mastra/pull/11112))
145
- - PostgreSQL: use `getSqlType()` in `createTable` instead of `toUpperCase()`
146
- - LibSQL: use `getSqlType()` in `createTable`, return `JSONB` for jsonb type (matches SQLite 3.45+ support)
147
- - ClickHouse: use `getSqlType()` in `createTable` instead of `COLUMN_TYPES` constant, add missing types (uuid, float, boolean)
148
- - Remove unused `getSqlType()` and `getDefaultValue()` from `MastraStorage` base class (all stores use `StoreOperations` versions)
149
-
150
- - Fix workflow cancel not updating status when workflow is suspended ([#11139](https://github.com/mastra-ai/mastra/pull/11139))
151
- - `Run.cancel()` now updates workflow status to 'canceled' in storage, resolving the issue where suspended workflows remained in 'suspended' status after cancellation
152
- - Cancellation status is immediately persisted and reflected to observers
163
+ ```typescript
164
+ const { spans, pagination } = await storage.listTraces({
165
+ filters: {
166
+ entityType: EntityType.AGENT,
167
+ entityId: 'my-agent',
168
+ userId: 'user-123',
169
+ environment: 'production',
170
+ status: TraceStatus.SUCCESS,
171
+ startedAt: { start: new Date('2024-01-01'), end: new Date('2024-01-31') },
172
+ },
173
+ pagination: { page: 0, perPage: 50 },
174
+ orderBy: { field: 'startedAt', direction: 'DESC' },
175
+ });
176
+ ```
153
177
 
154
- - What changed: ([#10998](https://github.com/mastra-ai/mastra/pull/10998))
178
+ **Available filters:** date ranges (`startedAt`, `endedAt`), entity (`entityType`, `entityId`, `entityName`), identity (`userId`, `organizationId`), correlation IDs (`runId`, `sessionId`, `threadId`), deployment (`environment`, `source`, `serviceName`), `tags`, `metadata`, and `status`.
155
179
 
156
- Support for sequential tool execution was added. Tool call concurrency is now set conditionally, defaulting to 1 when sequential execution is needed (to avoid race conditions that interfere with human-in-the-loop approval during the workflow) rather than the default of 10 when concurrency is acceptable.
180
+ ## New retrieval methods
181
+ - `getSpan({ traceId, spanId })` - Get a single span
182
+ - `getRootSpan({ traceId })` - Get the root span of a trace
183
+ - `getTrace({ traceId })` - Get all spans for a trace
157
184
 
158
- How it was changed:
185
+ ## Backward compatibility
159
186
 
160
- A `sequentialExecutionRequired` constant was set to a boolean depending on whether any of the tools involved in a returned agentic execution workflow would require approval. If any tool has a 'suspendSchema' property (used for conditionally suspending execution and waiting for human input), or if they have their `requireApproval` property set to `true`, then the concurrency property used in the toolCallStep is set to 1, causing sequential execution. The old default of 10 remains otherwise.
187
+ The legacy `getTraces()` method continues to work. When you pass `name: "agent run: my-agent"`, it automatically transforms to `entityId: "my-agent", entityType: AGENT`.
161
188
 
162
- - Fixed duplicate assistant messages appearing when using `useChat` with memory enabled. ([#11195](https://github.com/mastra-ai/mastra/pull/11195))
189
+ ## Migration
163
190
 
164
- **What was happening:** When using `useChat` with `chatRoute` and memory, assistant messages were being duplicated in storage after multiple conversation turns. This occurred because the backend-generated message ID wasn't being sent back to `useChat`, causing ID mismatches during deduplication.
191
+ **Automatic:** SQL-based stores (PostgreSQL, LibSQL, MSSQL) automatically add new columns to existing `spans` tables on initialization. Existing data is preserved with new columns set to `NULL`.
165
192
 
166
- **What changed:**
167
- - The backend now sends the assistant message ID in the stream's start event, so `useChat` uses the same ID as storage
168
- - Custom `data-*` parts (from `writer.custom()`) are now preserved when messages contain V5 tool parts
193
+ **No action required:** Your existing code continues to work. Adopt the new fields and `listTraces()` API at your convenience.
169
194
 
170
- Fixes #11091
195
+ ### Patch Changes
171
196
 
172
- - Updated dependencies [[`9650cce`](https://github.com/mastra-ai/mastra/commit/9650cce52a1d917ff9114653398e2a0f5c3ba808), [`5a632bd`](https://github.com/mastra-ai/mastra/commit/5a632bdf7b78953b664f5e038e98d4ba5f971e47)]:
173
- - @mastra/schema-compat@1.0.0-beta.3
174
- - @mastra/observability@1.0.0-beta.5
197
+ - When calling `abort()` inside a `processInputStep` processor, the TripWire was being caught by the model retry logic instead of emitting a tripwire chunk to the stream. ([#11343](https://github.com/mastra-ai/mastra/pull/11343))
175
198
 
176
- ## 1.0.0-beta.11
199
+ Before this fix, processors using `processInputStep` with abort would see errors like:
177
200
 
178
- ### Minor Changes
201
+ ```
202
+ Error executing model gpt-4o-mini, attempt 1==== TripWire [Error]: Potentially harmful content detected
203
+ ```
179
204
 
180
- - Respect structured outputs for v2 models so tool schemas aren’t stripped ([#11038](https://github.com/mastra-ai/mastra/pull/11038))
205
+ Now the TripWire is properly handled - it emits a tripwire chunk and signals the abort correctly,
181
206
 
182
- ### Patch Changes
207
+ - Consolidate memory integration tests and fix working memory filtering in MessageHistory processor ([#11367](https://github.com/mastra-ai/mastra/pull/11367))
183
208
 
184
- - Fix type safety for message ordering - restrict `orderBy` to only accept `'createdAt'` field ([#11069](https://github.com/mastra-ai/mastra/pull/11069))
209
+ Moved `extractWorkingMemoryTags`, `removeWorkingMemoryTags`, and `extractWorkingMemoryContent` utilities from `@mastra/memory` to `@mastra/core/memory` so they can be used by the `MessageHistory` processor.
185
210
 
186
- Messages don't have an `updatedAt` field, but the previous type allowed ordering by it, which would return empty results. This change adds compile-time type safety by making `StorageOrderBy` generic and restricting `StorageListMessagesInput.orderBy` to only accept `'createdAt'`. The API validation schemas have also been updated to reject invalid orderBy values at runtime.
211
+ Updated `MessageHistory.filterMessagesForPersistence()` to properly filter out `updateWorkingMemory` tool invocations and strip working memory tags from text content, fixing an issue where working memory tool call arguments were polluting saved message history for v5+ models.
187
212
 
188
- - Loosen tools types in processInputStep / prepareStep. ([#11071](https://github.com/mastra-ai/mastra/pull/11071))
213
+ Also consolidated integration tests for agent-memory, working-memory, and pg-storage into shared test functions that can run against multiple model versions (v4, v5, v6).
189
214
 
190
- - Added the ability to provide a base path for Mastra Studio. ([#10441](https://github.com/mastra-ai/mastra/pull/10441))
215
+ - Add support for AI SDK's `needsApproval` in tools. ([#11388](https://github.com/mastra-ai/mastra/pull/11388))
191
216
 
192
- ```ts
193
- import { Mastra } from '@mastra/core';
217
+ **AI SDK tools with static approval:**
194
218
 
195
- export const mastra = new Mastra({
196
- server: {
197
- studioBase: '/my-mastra-studio',
219
+ ```typescript
220
+ import { tool } from 'ai';
221
+ import { z } from 'zod';
222
+
223
+ const weatherTool = tool({
224
+ description: 'Get weather information',
225
+ inputSchema: z.object({ city: z.string() }),
226
+ needsApproval: true,
227
+ execute: async ({ city }) => {
228
+ return { weather: 'sunny', temp: 72 };
198
229
  },
199
230
  });
200
231
  ```
201
232
 
202
- This will make Mastra Studio available at `http://localhost:4111/my-mastra-studio`.
203
-
204
- - Expand `processInputStep` processor method and integrate `prepareStep` as a processor ([#10774](https://github.com/mastra-ai/mastra/pull/10774))
205
-
206
- **New Features:**
207
- - `prepareStep` callback now runs through the standard `processInputStep` pipeline
208
- - Processors can now modify per-step: `model`, `tools`, `toolChoice`, `activeTools`, `messages`, `systemMessages`, `providerOptions`, `modelSettings`, and `structuredOutput`
209
- - Processor chaining: each processor receives accumulated state from previous processors
210
- - System messages are isolated per-step (reset at start of each step)
211
-
212
- **Breaking Change:**
213
- - `prepareStep` messages format changed from AI SDK v5 model messages to `MastraDBMessage` format
214
- - Migration: Use `messageList.get.all.aiV5.model()` if you need the old format
233
+ **AI SDK tools with dynamic approval:**
215
234
 
216
- - Multiple Processor improvements including: ([#10947](https://github.com/mastra-ai/mastra/pull/10947))
217
- - Workflows can now return tripwires, they bubble up from agents that return tripwires in a step
218
- - You can write processors as workflows using the existing Workflow primitive, every processor flow is now a workflow.
219
- - tripwires that you throw can now return additional information including ability to retry the step
220
- - New processor method `processOutputStep` added which runs after every step.
221
-
222
- **What's new:**
235
+ ```typescript
236
+ const paymentTool = tool({
237
+ description: 'Process payment',
238
+ inputSchema: z.object({ amount: z.number() }),
239
+ needsApproval: async ({ amount }) => amount > 1000,
240
+ execute: async ({ amount }) => {
241
+ return { success: true, amount };
242
+ },
243
+ });
244
+ ```
223
245
 
224
- **1. Retry mechanism with LLM feedback** - Processors can now request retries with feedback that gets sent back to the LLM:
246
+ **Mastra tools continue to work with `requireApproval`:**
225
247
 
226
248
  ```typescript
227
- processOutputStep: async ({ text, abort, retryCount }) => {
228
- if (isLowQuality(text)) {
229
- abort('Response quality too low', { retry: true, metadata: { score: 0.6 } });
230
- }
231
- return [];
232
- };
249
+ import { createTool } from '@mastra/core';
250
+
251
+ const deleteTool = createTool({
252
+ id: 'delete-file',
253
+ description: 'Delete a file',
254
+ requireApproval: true,
255
+ inputSchema: z.object({ path: z.string() }),
256
+ execute: async ({ path }) => {
257
+ return { deleted: true };
258
+ },
259
+ });
233
260
  ```
234
261
 
235
- Configure with `maxProcessorRetries` (default: 3). Rejected steps are preserved in `result.steps[n].tripwire`. Retries are only available in `processOutputStep` and `processInputStep`. It will replay the step with additional context added.
262
+ - Fix stopWhen type to accept AI SDK v6 StopCondition functions like `stepCountIs()` ([#11402](https://github.com/mastra-ai/mastra/pull/11402))
236
263
 
237
- **2. Workflow orchestration for processors** - Processors can now be composed using workflow primitives:
238
-
239
- ```typescript
240
- import { createStep, createWorkflow } from '@mastra/core/workflows';
241
- import {
242
- ProcessorStepSchema,
243
- } from '@mastra/core/processors';
264
+ - Fix missing `title` field in Convex threads table schema ([#11356](https://github.com/mastra-ai/mastra/pull/11356))
244
265
 
245
- const moderationWorkflow = createWorkflow({ id: 'moderation', inputSchema: ProcessorStepSchema, outputSchema: ProcessorStepSchema })
246
- .then(createStep(new lengthValidator({...})))
247
- .parallel([createStep(new piiDetector({...}), createStep(new toxicityChecker({...}))])
248
- .commit();
266
+ The Convex schema was hardcoded and out of sync with the core `TABLE_SCHEMAS`, causing errors when creating threads:
249
267
 
250
- const agent = new Agent({ inputProcessors: [moderationWorkflow] });
268
+ ```
269
+ Error: Failed to insert or update a document in table "mastra_threads"
270
+ because it does not match the schema: Object contains extra field `title`
271
+ that is not in the validator.
251
272
  ```
252
273
 
253
- Every processor array that gets passed to an agent gets added as a workflow
254
- <img width="614" height="673" alt="image" src="https://github.com/user-attachments/assets/0d79f1fd-8fca-4d86-8b45-22fddea984a8" />
255
-
256
- **3. Extended tripwire API** - `abort()` now accepts options for retry control and typed metadata:
274
+ Now the Convex schema dynamically builds from `TABLE_SCHEMAS` via a new `@mastra/core/storage/constants` export path that doesn't pull in Node.js dependencies (safe for Convex's sandboxed schema evaluation).
257
275
 
258
276
  ```typescript
259
- abort('reason', { retry: true, metadata: { score: 0.8, category: 'quality' } });
260
- ```
277
+ // Users can now import schema tables without Node.js dependency issues
278
+ import { mastraThreadsTable, mastraMessagesTable } from '@mastra/convex/schema';
261
279
 
262
- **4. New `processOutputStep` method** - Per-step output processing with access to step number, finish reason, tool calls, and retry count.
263
-
264
- **5. Workflow tripwire status** - Workflows now have a `'tripwire'` status distinct from `'failed'`, properly bubbling up processor rejections.
280
+ export default defineSchema({
281
+ mastra_threads: mastraThreadsTable,
282
+ mastra_messages: mastraMessagesTable,
283
+ });
284
+ ```
265
285
 
266
- ## 1.0.0-beta.10
286
+ Fixes #11319
267
287
 
268
- ### Patch Changes
288
+ - Added support for AI SDK v6 embedding models (specification version v3) in memory and vector modules. Fixed TypeScript error where `ModelRouterEmbeddingModel` was trying to implement a union type instead of `EmbeddingModelV2` directly. ([#11362](https://github.com/mastra-ai/mastra/pull/11362))
269
289
 
270
- - Add support for typed structured output in agent workflow steps ([#11014](https://github.com/mastra-ai/mastra/pull/11014))
290
+ - fix: support gs:// and s3:// cloud storage URLs in attachmentsToParts ([#11398](https://github.com/mastra-ai/mastra/pull/11398))
271
291
 
272
- When wrapping an agent with `createStep()` and providing a `structuredOutput.schema`, the step's `outputSchema` is now correctly inferred from the provided schema instead of defaulting to `{ text: string }`.
292
+ - Add validation to detect when a function is passed as a tool instead of a tool object. Previously, passing a tool factory function (e.g., `tools: { myTool }` instead of `tools: { myTool: myTool() }`) would silently fail - the LLM would request tool calls but nothing would execute. Now throws a clear error with guidance on how to fix it. ([#11288](https://github.com/mastra-ai/mastra/pull/11288))
273
293
 
274
- This enables type-safe chaining of agent steps with structured output to subsequent steps:
294
+ - Fix reasoning providerMetadata leaking into text parts when using memory with OpenAI reasoning models. The runState.providerOptions is now cleared after reasoning-end to prevent text parts from inheriting the reasoning's itemId. ([#11380](https://github.com/mastra-ai/mastra/pull/11380))
275
295
 
276
- ```typescript
277
- const articleSchema = z.object({
278
- title: z.string(),
279
- summary: z.string(),
280
- tags: z.array(z.string()),
281
- });
296
+ - Upgrade AI SDK v6 from beta to stable (6.0.1) and fix finishReason breaking change. ([#11351](https://github.com/mastra-ai/mastra/pull/11351))
282
297
 
283
- // Agent step with structured output - outputSchema is now articleSchema
284
- const agentStep = createStep(agent, {
285
- structuredOutput: { schema: articleSchema },
286
- });
298
+ AI SDK v6 stable changed finishReason from a string to an object with `unified` and `raw` properties. Added `normalizeFinishReason()` helper to handle both v5 (string) and v6 (object) formats at the stream transform layer
287
299
 
288
- // Next step can receive the structured output directly
289
- const processStep = createStep({
290
- id: 'process',
291
- inputSchema: articleSchema, // Matches agent's outputSchema
292
- outputSchema: z.object({ tagCount: z.number() }),
293
- execute: async ({ inputData }) => ({
294
- tagCount: inputData.tags.length, // Fully typed!
295
- }),
296
- });
300
+ - Improve autoResumeSuspendedTools instruction for tool approval ([#11338](https://github.com/mastra-ai/mastra/pull/11338))
297
301
 
298
- workflow.then(agentStep).then(processStep).commit();
299
- ```
302
+ - Add debugger-like click-through UI to workflow graph ([#11350](https://github.com/mastra-ai/mastra/pull/11350))
300
303
 
301
- When `structuredOutput` is not provided, the agent step continues to use the default `{ text: string }` output schema.
304
+ - Add `perStep` option to workflow run methods, allowing a workflow to run just a step instead of all the workflow steps ([#11276](https://github.com/mastra-ai/mastra/pull/11276))
302
305
 
303
- - Fixed a bug where multiple tools streaming output simultaneously could fail with "WritableStreamDefaultWriter is locked" errors. Tool streaming now works reliably during concurrent tool executions. ([#10830](https://github.com/mastra-ai/mastra/pull/10830))
306
+ - Fix workflow throwing error when using .map after .foreach ([#11352](https://github.com/mastra-ai/mastra/pull/11352))
304
307
 
305
- - Add delete workflow run API ([#10991](https://github.com/mastra-ai/mastra/pull/10991))
308
+ - Bump @ai-sdk/openai from 3.0.0-beta.102 to 3.0.1 ([#11377](https://github.com/mastra-ai/mastra/pull/11377))
306
309
 
307
- ```typescript
308
- await workflow.deleteWorkflowRunById(runId);
309
- ```
310
+ ## 1.0.0-beta.14
310
311
 
311
- - Fixed CachedToken tracking in all Observability Exporters. Also fixed TimeToFirstToken in Langfuse, Braintrust, PostHog exporters. Fixed trace formatting in Posthog Exporter. ([#11029](https://github.com/mastra-ai/mastra/pull/11029))
312
+ ### Minor Changes
312
313
 
313
- - fix: persist data-\* chunks from writer.custom() to memory storage ([#10884](https://github.com/mastra-ai/mastra/pull/10884))
314
- - Add persistence for custom data chunks (`data-*` parts) emitted via `writer.custom()` in tools
315
- - Data chunks are now saved to message storage so they survive page refreshes
316
- - Update `@assistant-ui/react` to v0.11.47 with native `DataMessagePart` support
317
- - Convert `data-*` parts to `DataMessagePart` format (`{ type: 'data', name: string, data: T }`)
318
- - Update related `@assistant-ui/*` packages for compatibility
314
+ - Add support for AI SDK v6 (LanguageModelV3) ([#11191](https://github.com/mastra-ai/mastra/pull/11191))
319
315
 
320
- - Fixed double validation bug that prevented Zod transforms from working correctly in tool schemas. ([#11025](https://github.com/mastra-ai/mastra/pull/11025))
316
+ Agents can now use `LanguageModelV3` models from AI SDK v6 beta providers like `@ai-sdk/openai@^3.0.0-beta`.
321
317
 
322
- When tools with Zod `.transform()` or `.pipe()` in their `outputSchema` were executed through the Agent pipeline, validation was happening twice - once in Tool.execute() (correct) and again in CoreToolBuilder (incorrect). The second validation received already-transformed data but expected pre-transform data, causing validation errors.
318
+ **New features:**
319
+ - Usage normalization: V3's nested usage format is normalized to Mastra's flat format with `reasoningTokens`, `cachedInputTokens`, and raw data preserved in a `raw` field
323
320
 
324
- This fix enables proper use of Zod transforms in both `inputSchema` (for normalizing/cleaning input data) and `outputSchema` (for transforming output data to be LLM-friendly).
321
+ **Backward compatible:** All existing V1 and V2 models continue to work unchanged.
325
322
 
326
- - Updated dependencies [[`5d7000f`](https://github.com/mastra-ai/mastra/commit/5d7000f757cd65ea9dc5b05e662fd83dfd44e932)]:
327
- - @mastra/observability@1.0.0-beta.4
323
+ ### Patch Changes
328
324
 
329
- ## 1.0.0-beta.9
325
+ - Fix model-level and runtime header support for LLM calls ([#11275](https://github.com/mastra-ai/mastra/pull/11275))
330
326
 
331
- ### Minor Changes
327
+ This fixes a bug where custom headers configured on models (like `anthropic-beta`) were not being passed through to the underlying AI SDK calls. The fix properly handles headers from multiple sources with correct priority:
332
328
 
333
- - Add stored agents support ([#10953](https://github.com/mastra-ai/mastra/pull/10953))
329
+ **Header Priority (low to high):**
330
+ 1. Model config headers - Headers set in model configuration
331
+ 2. ModelSettings headers - Runtime headers that override model config
332
+ 3. Provider-level headers - Headers baked into AI SDK providers (not overridden)
334
333
 
335
- Agents can now be stored in the database and loaded at runtime. This lets you persist agent configurations and dynamically create executable Agent instances from storage.
334
+ **Examples that now work:**
336
335
 
337
336
  ```typescript
338
- import { Mastra } from '@mastra/core';
339
- import { LibSQLStore } from '@mastra/libsql';
340
-
341
- const mastra = new Mastra({
342
- storage: new LibSQLStore({ url: ':memory:' }),
343
- tools: { myTool },
344
- scorers: { myScorer },
345
- });
346
-
347
- // Create agent in storage via API or directly
348
- await mastra.getStorage().createAgent({
349
- agent: {
350
- id: 'my-agent',
351
- name: 'My Agent',
352
- instructions: 'You are helpful',
353
- model: { provider: 'openai', name: 'gpt-4' },
354
- tools: { myTool: {} },
355
- scorers: { myScorer: { sampling: { type: 'ratio', rate: 0.5 } } },
337
+ // Model config headers
338
+ new Agent({
339
+ model: {
340
+ id: 'anthropic/claude-4-5-sonnet',
341
+ headers: { 'anthropic-beta': 'context-1m-2025-08-07' },
356
342
  },
357
343
  });
358
344
 
359
- // Load and use the agent
360
- const agent = await mastra.getStoredAgentById('my-agent');
361
- const response = await agent.generate({ messages: 'Hello!' });
362
-
363
- // List all stored agents with pagination
364
- const { agents, total, hasMore } = await mastra.listStoredAgents({
365
- page: 0,
366
- perPage: 10,
345
+ // Runtime headers override config
346
+ agent.generate('...', {
347
+ modelSettings: { headers: { 'x-custom': 'runtime-value' } },
367
348
  });
368
- ```
369
349
 
370
- Also adds a memory registry to Mastra so stored agents can reference memory instances by key.
350
+ // Provider-level headers preserved
351
+ const openai = createOpenAI({ headers: { 'openai-organization': 'org-123' } });
352
+ new Agent({ model: openai('gpt-4o-mini') });
353
+ ```
371
354
 
372
- ### Patch Changes
355
+ - Fixed AbortSignal not propagating from parent workflows to nested sub-workflows in the evented workflow engine. ([#11142](https://github.com/mastra-ai/mastra/pull/11142))
373
356
 
374
- - Add agentId and agentName attributes to MODEL_GENERATION spans. This allows users to correlate gen_ai.usage metrics with specific agents when analyzing LLM operation spans. The attributes are exported as gen_ai.agent.id and gen_ai.agent.name in the OtelExporter. ([#10984](https://github.com/mastra-ai/mastra/pull/10984))
357
+ Previously, canceling a parent workflow did not stop nested sub-workflows, causing them to continue running and consuming resources after the parent was canceled.
375
358
 
376
- - Fix JSON parsing errors when LLMs output unescaped newlines in structured output strings ([#10965](https://github.com/mastra-ai/mastra/pull/10965))
359
+ Now, when you cancel a parent workflow, all nested sub-workflows are automatically canceled as well, ensuring clean termination of the entire workflow tree.
377
360
 
378
- Some LLMs (particularly when not using native JSON mode) output actual newline characters inside JSON string values instead of properly escaped `\n` sequences. This breaks JSON parsing and causes structured output to fail.
361
+ **Example:**
379
362
 
380
- This change adds preprocessing to escape unescaped control characters (`\n`, `\r`, `\t`) within JSON string values before parsing, making structured output more robust across different LLM providers.
363
+ ```typescript
364
+ const parentWorkflow = createWorkflow({ id: 'parent-workflow' }).then(someStep).then(nestedChildWorkflow).commit();
381
365
 
382
- - Fix toolCallId propagation in agent network tool execution. The toolCallId property was undefined at runtime despite being required by TypeScript type definitions in AgentToolExecutionContext. Now properly passes the toolCallId through to the tool's context during network tool execution. ([#10951](https://github.com/mastra-ai/mastra/pull/10951))
366
+ const run = await parentWorkflow.createRun();
367
+ const resultPromise = run.start({ inputData: { value: 5 } });
383
368
 
384
- - Exports `convertFullStreamChunkToMastra` from the stream module for AI SDK stream chunk transformations. ([#10911](https://github.com/mastra-ai/mastra/pull/10911))
369
+ // Cancel the parent workflow - nested workflows will also be canceled
370
+ await run.cancel();
371
+ // or use: run.abortController.abort();
385
372
 
386
- ## 1.0.0-beta.8
373
+ const result = await resultPromise;
374
+ // result.status === 'canceled'
375
+ // All nested child workflows are also canceled
376
+ ```
387
377
 
388
- ### Patch Changes
378
+ Related to #11063
389
379
 
390
- - Fix saveScore not persisting ID correctly, breaking getScoreById retrieval ([#10915](https://github.com/mastra-ai/mastra/pull/10915))
380
+ - Fix empty overrideScorers causing error instead of skipping scoring ([#11257](https://github.com/mastra-ai/mastra/pull/11257))
391
381
 
392
- **What Changed**
393
- - saveScore now correctly returns scores that can be retrieved with getScoreById
394
- - Validation errors now include contextual information (scorer, entity, trace details) for easier debugging
382
+ When `overrideScorers` was passed as an empty object `{}`, the agent would throw a "No scorers found" error. Now an empty object explicitly skips scoring, while `undefined` continues to use default scorers.
395
383
 
396
- **Impact**
397
- Previously, calling getScoreById after saveScore would return null because the generated ID wasn't persisted to the database. This is now fixed across all store implementations, ensuring consistent behavior and data integrity.
384
+ - feat: Add field filtering and nested workflow control to workflow execution result endpoint ([#11246](https://github.com/mastra-ai/mastra/pull/11246))
398
385
 
399
- - `setState` is now async ([#10944](https://github.com/mastra-ai/mastra/pull/10944))
400
- - `setState` must now be awaited: `await setState({ key: value })`
401
- - State updates are merged automatically—no need to spread the previous state
402
- - State data is validated against the step's `stateSchema` when `validateInputs` is enabled (default: `true`)
386
+ Adds two optional query parameters to `/api/workflows/:workflowId/runs/:runId/execution-result` endpoint:
387
+ - `fields`: Request only specific fields (e.g., `status`, `result`, `error`)
388
+ - `withNestedWorkflows`: Control whether to fetch nested workflow data
403
389
 
404
- - Add human-in-the-loop support for workflows used in agent ([#10871](https://github.com/mastra-ai/mastra/pull/10871))
390
+ This significantly reduces response payload size and improves response times for large workflows.
405
391
 
406
- ## 1.0.0-beta.7
392
+ ## Server Endpoint Usage
407
393
 
408
- ### Minor Changes
394
+ ```http
395
+ # Get only status (minimal payload - fastest)
396
+ GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status
409
397
 
410
- - Add `disableInit` option to all storage adapters ([#10851](https://github.com/mastra-ai/mastra/pull/10851))
398
+ # Get status and result
399
+ GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status,result
411
400
 
412
- Adds a new `disableInit` config option to all storage providers that allows users to disable automatic table creation/migrations at runtime. This is useful for CI/CD pipelines where you want to run migrations during deployment with elevated credentials, then run the application with `disableInit: true` so it doesn't attempt schema changes at runtime.
401
+ # Get all fields but without nested workflow data (faster)
402
+ GET /api/workflows/:workflowId/runs/:runId/execution-result?withNestedWorkflows=false
413
403
 
414
- ```typescript
415
- // CI/CD script - run migrations
416
- const storage = new PostgresStore({
417
- connectionString: DATABASE_URL,
418
- id: 'pg-storage',
419
- });
420
- await storage.init();
404
+ # Get only specific fields without nested workflow data
405
+ GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status,steps&withNestedWorkflows=false
421
406
 
422
- // Runtime - skip auto-init
423
- const storage = new PostgresStore({
424
- connectionString: DATABASE_URL,
425
- id: 'pg-storage',
426
- disableInit: true,
427
- });
407
+ # Get full data (default behavior)
408
+ GET /api/workflows/:workflowId/runs/:runId/execution-result
428
409
  ```
429
410
 
430
- ### Patch Changes
411
+ ## Client SDK Usage
431
412
 
432
- - Add time-to-first-token (TTFT) support for Langfuse integration ([#10781](https://github.com/mastra-ai/mastra/pull/10781))
413
+ ```typescript
414
+ import { MastraClient } from '@mastra/client-js';
433
415
 
434
- Adds `completionStartTime` to model generation spans, which Langfuse uses to calculate TTFT metrics. The timestamp is automatically captured when the first content chunk arrives during streaming.
416
+ const client = new MastraClient({ baseUrl: 'http://localhost:4111' });
417
+ const workflow = client.getWorkflow('myWorkflow');
435
418
 
436
- ```typescript
437
- // completionStartTime is now automatically captured and sent to Langfuse
438
- // enabling TTFT metrics in your Langfuse dashboard
439
- const result = await agent.stream('Hello');
440
- ```
419
+ // Get only status (minimal payload - fastest)
420
+ const statusOnly = await workflow.runExecutionResult(runId, {
421
+ fields: ['status'],
422
+ });
423
+ console.log(statusOnly.status); // 'success' | 'failed' | 'running' | etc.
441
424
 
442
- - Updated OtelExporters, Bridge, and Arize packages to better implement GenAI v1.38.0 Otel Semantic Conventions. See: ([#10591](https://github.com/mastra-ai/mastra/pull/10591))
443
- https://github.com/open-telemetry/semantic-conventions/blob/v1.38.0/docs/gen-ai/README.md
425
+ // Get status and result
426
+ const statusAndResult = await workflow.runExecutionResult(runId, {
427
+ fields: ['status', 'result'],
428
+ });
444
429
 
445
- - Standardize error IDs across all storage and vector stores using centralized helper functions (`createStorageErrorId` and `createVectorErrorId`). This ensures consistent error ID patterns (`MASTRA_STORAGE_{STORE}_{OPERATION}_{STATUS}` and `MASTRA_VECTOR_{STORE}_{OPERATION}_{STATUS}`) across the codebase for better error tracking and debugging. ([#10913](https://github.com/mastra-ai/mastra/pull/10913))
430
+ // Get all fields but without nested workflow data (faster)
431
+ const resultWithoutNested = await workflow.runExecutionResult(runId, {
432
+ withNestedWorkflows: false,
433
+ });
446
434
 
447
- - fix: generate unique text IDs for Anthropic/Google providers ([#10740](https://github.com/mastra-ai/mastra/pull/10740))
435
+ // Get specific fields without nested workflow data
436
+ const optimized = await workflow.runExecutionResult(runId, {
437
+ fields: ['status', 'steps'],
438
+ withNestedWorkflows: false,
439
+ });
448
440
 
449
- Workaround for duplicate text-start/text-end IDs in multi-step agentic flows.
441
+ // Get full execution result (default behavior)
442
+ const fullResult = await workflow.runExecutionResult(runId);
443
+ ```
450
444
 
451
- The `@ai-sdk/anthropic` and `@ai-sdk/google` providers use numeric indices ("0", "1", etc.) for text block IDs that reset for each LLM call. This caused duplicate IDs when an agent does TEXT → TOOL → TEXT, breaking message ordering and storage.
445
+ ## Core API Changes
452
446
 
453
- The fix replaces numeric IDs with UUIDs, maintaining a map per step so text-start, text-delta, and text-end chunks for the same block share the same UUID. OpenAI's UUIDs pass through unchanged.
447
+ The `Workflow.getWorkflowRunExecutionResult` method now accepts an options object:
454
448
 
455
- Related: #9909
449
+ ```typescript
450
+ await workflow.getWorkflowRunExecutionResult(runId, {
451
+ withNestedWorkflows: false, // default: true, set to false to skip nested workflow data
452
+ fields: ['status', 'result'], // optional field filtering
453
+ });
454
+ ```
456
455
 
457
- - Fix sub-agent requestContext propagation in listAgentTools ([#10844](https://github.com/mastra-ai/mastra/pull/10844))
456
+ ## Inngest Compatibility
458
457
 
459
- Sub-agents with dynamic model configurations were broken because `requestContext` was not being passed to `getModel()` when creating agent tools. This caused sub-agents using function-based model configurations to receive an empty context instead of the parent's context.
458
+ The `@mastra/inngest` package has been updated to use the new options object API. This is a non-breaking internal change - no action required from inngest workflow users.
460
459
 
461
- No code changes required for consumers - this fix restores expected behavior for dynamic model configurations in sub-agents.
460
+ ## Performance Impact
462
461
 
463
- - Fix ToolStream type error when piping streams with different types ([#10845](https://github.com/mastra-ai/mastra/pull/10845))
462
+ For workflows with large step outputs:
463
+ - Requesting only `status`: ~99% reduction in payload size
464
+ - Requesting `status,result,error`: ~95% reduction in payload size
465
+ - Using `withNestedWorkflows=false`: Avoids expensive nested workflow data fetching
466
+ - Combining both: Maximum performance optimization
464
467
 
465
- Changes `ToolStream` to extend `WritableStream<unknown>` instead of `WritableStream<T>`. This fixes the TypeScript error when piping `objectStream` or `fullStream` to `writer` in workflow steps.
468
+ - Removed a debug log that printed large Zod schemas, resulting in cleaner console output when using agents with memory enabled. ([#11279](https://github.com/mastra-ai/mastra/pull/11279))
466
469
 
467
- Before:
470
+ - Set `externals: true` as the default for `mastra build` and cloud-deployer to reduce bundle issues with native dependencies. ([`0dbf199`](https://github.com/mastra-ai/mastra/commit/0dbf199110f22192ce5c95b1c8148d4872b4d119))
468
471
 
469
- ```typescript
470
- // TypeError: ToolStream<ChunkType> is not assignable to WritableStream<Partial<StoryPlan>>
471
- await response.objectStream.pipeTo(writer);
472
- ```
472
+ **Note:** If you previously relied on the default bundling behavior (all dependencies bundled), you can explicitly set `externals: false` in your bundler configuration.
473
473
 
474
- After:
474
+ - Fix delayed promises rejecting when stream suspends on tool-call-approval ([#11278](https://github.com/mastra-ai/mastra/pull/11278))
475
475
 
476
- ```typescript
477
- // Works without type errors
478
- await response.objectStream.pipeTo(writer);
479
- ```
476
+ When a stream ends in suspended state (e.g., requiring tool approval), the delayed promises like `toolResults`, `toolCalls`, `text`, etc. now resolve with partial results instead of rejecting with an error. This allows consumers to access data that was produced before the suspension.
480
477
 
481
- - feat: add native Perplexity provider support ([#10885](https://github.com/mastra-ai/mastra/pull/10885))
478
+ Also improves generic type inference for `LLMStepResult` and related types throughout the streaming infrastructure.
482
479
 
483
- - When sending the first message to a new thread with PostgresStore, users would get a "Thread not found" error. This happened because the thread was created in memory but not persisted to the database before the MessageHistory output processor tried to save messages. ([#10881](https://github.com/mastra-ai/mastra/pull/10881))
480
+ ## 1.0.0-beta.13
484
481
 
485
- **Before:**
482
+ ### Patch Changes
486
483
 
487
- ```ts
488
- threadObject = await memory.createThread({
489
- // ...
490
- saveThread: false, // thread not in DB yet
491
- });
492
- // Later: MessageHistory calls saveMessages() -> PostgresStore throws "Thread not found"
493
- ```
484
+ - Add `onFinish` and `onError` lifecycle callbacks to workflow options ([#11200](https://github.com/mastra-ai/mastra/pull/11200))
494
485
 
495
- **After:**
486
+ Workflows now support lifecycle callbacks for server-side handling of workflow completion and errors:
487
+ - `onFinish`: Called when workflow completes with any status (success, failed, suspended, tripwire)
488
+ - `onError`: Called only when workflow fails (failed or tripwire status)
496
489
 
497
- ```ts
498
- threadObject = await memory.createThread({
499
- // ...
500
- saveThread: true, // thread persisted immediately
490
+ ```typescript
491
+ const workflow = createWorkflow({
492
+ id: 'my-workflow',
493
+ inputSchema: z.object({ ... }),
494
+ outputSchema: z.object({ ... }),
495
+ options: {
496
+ onFinish: async (result) => {
497
+ // Handle any workflow completion
498
+ await updateJobStatus(result.status);
499
+ },
500
+ onError: async (errorInfo) => {
501
501
 
502
- ... 6319 more lines hidden. See full changelog in package directory.
502
+ ... 6796 more lines hidden. See full changelog in package directory.