@mastra/mcp-docs-server 1.0.0-beta.11 → 1.0.0-beta.14

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 (345) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +29 -29
  2. package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +51 -51
  3. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +45 -45
  4. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +180 -180
  5. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +39 -39
  6. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +39 -39
  7. package/.docs/organized/changelogs/%40mastra%2Fconvex.md +68 -0
  8. package/.docs/organized/changelogs/%40mastra%2Fcore.md +331 -331
  9. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +31 -31
  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 +39 -39
  13. package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +6 -0
  14. package/.docs/organized/changelogs/%40mastra%2Flance.md +39 -39
  15. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +45 -45
  16. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +24 -24
  17. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +24 -24
  18. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +39 -39
  19. package/.docs/organized/changelogs/%40mastra%2Fmssql.md +39 -39
  20. package/.docs/organized/changelogs/%40mastra%2Fpg.md +45 -45
  21. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +96 -96
  22. package/.docs/organized/changelogs/%40mastra%2Frag.md +17 -17
  23. package/.docs/organized/changelogs/%40mastra%2Freact.md +49 -2
  24. package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +6 -0
  25. package/.docs/organized/changelogs/%40mastra%2Fserver.md +122 -122
  26. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +39 -39
  27. package/.docs/organized/changelogs/create-mastra.md +31 -31
  28. package/.docs/organized/changelogs/mastra.md +51 -51
  29. package/.docs/organized/code-examples/agent-v6.md +151 -0
  30. package/.docs/organized/code-examples/ai-elements.md +1 -1
  31. package/.docs/organized/code-examples/quick-start.md +0 -4
  32. package/.docs/organized/code-examples/stock-price-tool.md +21 -2
  33. package/.docs/raw/agents/adding-voice.mdx +2 -3
  34. package/.docs/raw/agents/agent-approval.mdx +139 -6
  35. package/.docs/raw/agents/agent-memory.mdx +24 -32
  36. package/.docs/raw/agents/guardrails.mdx +61 -51
  37. package/.docs/raw/agents/networks.mdx +9 -13
  38. package/.docs/raw/agents/overview.mdx +40 -24
  39. package/.docs/raw/agents/processors.mdx +20 -19
  40. package/.docs/raw/agents/structured-output.mdx +11 -7
  41. package/.docs/raw/agents/using-tools.mdx +5 -6
  42. package/.docs/raw/course/01-first-agent/07-creating-your-agent.md +1 -2
  43. package/.docs/raw/course/01-first-agent/12-connecting-tool-to-agent.md +1 -1
  44. package/.docs/raw/course/01-first-agent/16-adding-memory-to-agent.md +1 -2
  45. package/.docs/raw/course/02-agent-tools-mcp/05-updating-your-agent.md +1 -1
  46. package/.docs/raw/course/02-agent-tools-mcp/10-updating-agent-instructions-zapier.md +1 -1
  47. package/.docs/raw/course/02-agent-tools-mcp/16-updating-agent-instructions-github.md +1 -1
  48. package/.docs/raw/course/02-agent-tools-mcp/21-updating-agent-instructions-hackernews.md +1 -1
  49. package/.docs/raw/course/02-agent-tools-mcp/27-updating-agent-instructions-filesystem.md +1 -1
  50. package/.docs/raw/course/02-agent-tools-mcp/31-enhancing-memory-configuration.md +2 -2
  51. package/.docs/raw/course/03-agent-memory/04-creating-basic-memory-agent.md +1 -2
  52. package/.docs/raw/course/03-agent-memory/08-configuring-conversation-history.md +1 -2
  53. package/.docs/raw/course/03-agent-memory/16-configuring-semantic-recall.md +3 -4
  54. package/.docs/raw/course/03-agent-memory/21-configuring-working-memory.md +2 -3
  55. package/.docs/raw/course/03-agent-memory/22-custom-working-memory-templates.md +2 -3
  56. package/.docs/raw/course/03-agent-memory/25-combining-memory-features.md +1 -2
  57. package/.docs/raw/course/03-agent-memory/27-creating-learning-assistant.md +2 -3
  58. package/.docs/raw/course/04-workflows/11-creating-an-ai-agent.md +2 -3
  59. package/.docs/raw/deployment/cloud-providers.mdx +20 -0
  60. package/.docs/raw/deployment/{building-mastra.mdx → mastra-server.mdx} +5 -5
  61. package/.docs/raw/deployment/monorepo.mdx +23 -44
  62. package/.docs/raw/deployment/overview.mdx +32 -50
  63. package/.docs/raw/deployment/web-framework.mdx +15 -19
  64. package/.docs/raw/evals/custom-scorers.mdx +9 -6
  65. package/.docs/raw/evals/overview.mdx +3 -6
  66. package/.docs/raw/evals/running-in-ci.mdx +2 -2
  67. package/.docs/raw/getting-started/manual-install.mdx +20 -20
  68. package/.docs/raw/getting-started/mcp-docs-server.mdx +2 -2
  69. package/.docs/raw/getting-started/start.mdx +10 -1
  70. package/.docs/raw/getting-started/studio.mdx +1 -1
  71. package/.docs/raw/guides/agent-frameworks/ai-sdk.mdx +4 -4
  72. package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +1033 -79
  73. package/.docs/raw/guides/build-your-ui/assistant-ui.mdx +8 -8
  74. package/.docs/raw/guides/build-your-ui/copilotkit.mdx +11 -11
  75. package/.docs/raw/{deployment/cloud-providers → guides/deployment}/amazon-ec2.mdx +9 -9
  76. package/.docs/raw/{deployment/cloud-providers → guides/deployment}/aws-lambda.mdx +13 -16
  77. package/.docs/raw/{deployment/cloud-providers → guides/deployment}/azure-app-services.mdx +5 -7
  78. package/.docs/raw/{deployment/cloud-providers → guides/deployment}/cloudflare-deployer.mdx +8 -5
  79. package/.docs/raw/{deployment/cloud-providers → guides/deployment}/digital-ocean.mdx +12 -15
  80. package/.docs/raw/guides/deployment/index.mdx +32 -0
  81. package/.docs/raw/guides/deployment/inngest.mdx +386 -0
  82. package/.docs/raw/{deployment/cloud-providers → guides/deployment}/netlify-deployer.mdx +7 -3
  83. package/.docs/raw/{deployment/cloud-providers → guides/deployment}/vercel-deployer.mdx +8 -5
  84. package/.docs/raw/guides/getting-started/astro.mdx +292 -451
  85. package/.docs/raw/guides/getting-started/express.mdx +72 -153
  86. package/.docs/raw/guides/getting-started/hono.mdx +227 -0
  87. package/.docs/raw/guides/getting-started/next-js.mdx +170 -61
  88. package/.docs/raw/guides/getting-started/quickstart.mdx +4 -4
  89. package/.docs/raw/guides/getting-started/sveltekit.mdx +238 -409
  90. package/.docs/raw/guides/getting-started/vite-react.mdx +317 -147
  91. package/.docs/raw/guides/guide/ai-recruiter.mdx +10 -10
  92. package/.docs/raw/guides/guide/chef-michel.mdx +9 -11
  93. package/.docs/raw/guides/guide/notes-mcp-server.mdx +15 -15
  94. package/.docs/raw/guides/guide/research-assistant.mdx +17 -17
  95. package/.docs/raw/guides/guide/stock-agent.mdx +5 -5
  96. package/.docs/raw/guides/guide/web-search.mdx +8 -8
  97. package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +7 -7
  98. package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +2 -2
  99. package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +1 -1
  100. package/.docs/raw/guides/migrations/upgrade-to-v1/client.mdx +17 -0
  101. package/.docs/raw/guides/migrations/upgrade-to-v1/overview.mdx +6 -0
  102. package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +0 -2
  103. package/.docs/raw/guides/migrations/vnext-to-standard-apis.mdx +21 -23
  104. package/.docs/raw/index.mdx +2 -2
  105. package/.docs/raw/{deployment/mastra-cloud → mastra-cloud}/dashboard.mdx +2 -6
  106. package/.docs/raw/{deployment/mastra-cloud → mastra-cloud}/observability.mdx +1 -5
  107. package/.docs/raw/{deployment/mastra-cloud → mastra-cloud}/overview.mdx +2 -6
  108. package/.docs/raw/{deployment/mastra-cloud → mastra-cloud}/setting-up.mdx +8 -7
  109. package/.docs/raw/mcp/overview.mdx +31 -13
  110. package/.docs/raw/mcp/publishing-mcp-server.mdx +2 -2
  111. package/.docs/raw/memory/memory-processors.mdx +9 -9
  112. package/.docs/raw/memory/message-history.mdx +69 -0
  113. package/.docs/raw/memory/overview.mdx +34 -76
  114. package/.docs/raw/memory/semantic-recall.mdx +58 -49
  115. package/.docs/raw/memory/storage.mdx +188 -0
  116. package/.docs/raw/memory/working-memory.mdx +7 -7
  117. package/.docs/raw/observability/logging.mdx +10 -11
  118. package/.docs/raw/observability/overview.mdx +0 -1
  119. package/.docs/raw/observability/tracing/bridges/otel.mdx +2 -2
  120. package/.docs/raw/observability/tracing/exporters/cloud.mdx +1 -1
  121. package/.docs/raw/observability/tracing/exporters/default.mdx +3 -3
  122. package/.docs/raw/observability/tracing/exporters/langfuse.mdx +1 -2
  123. package/.docs/raw/observability/tracing/overview.mdx +23 -25
  124. package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +3 -3
  125. package/.docs/raw/rag/chunking-and-embedding.mdx +18 -31
  126. package/.docs/raw/rag/graph-rag.mdx +220 -0
  127. package/.docs/raw/rag/overview.mdx +2 -3
  128. package/.docs/raw/rag/retrieval.mdx +34 -51
  129. package/.docs/raw/rag/vector-databases.mdx +29 -25
  130. package/.docs/raw/reference/agents/agent.mdx +3 -3
  131. package/.docs/raw/reference/agents/generate.mdx +1 -1
  132. package/.docs/raw/reference/agents/generateLegacy.mdx +2 -2
  133. package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +3 -3
  134. package/.docs/raw/reference/agents/getDefaultOptions.mdx +3 -3
  135. package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +3 -3
  136. package/.docs/raw/reference/agents/getDescription.mdx +1 -1
  137. package/.docs/raw/reference/agents/getInstructions.mdx +3 -3
  138. package/.docs/raw/reference/agents/getLLM.mdx +3 -3
  139. package/.docs/raw/reference/agents/getMemory.mdx +3 -3
  140. package/.docs/raw/reference/agents/getModel.mdx +3 -3
  141. package/.docs/raw/reference/agents/getTools.mdx +2 -2
  142. package/.docs/raw/reference/agents/getVoice.mdx +2 -2
  143. package/.docs/raw/reference/agents/listAgents.mdx +2 -2
  144. package/.docs/raw/reference/agents/listScorers.mdx +3 -3
  145. package/.docs/raw/reference/agents/listTools.mdx +2 -2
  146. package/.docs/raw/reference/agents/listWorkflows.mdx +2 -2
  147. package/.docs/raw/reference/agents/network.mdx +1 -1
  148. package/.docs/raw/reference/ai-sdk/chat-route.mdx +3 -3
  149. package/.docs/raw/reference/ai-sdk/handle-chat-stream.mdx +2 -2
  150. package/.docs/raw/reference/ai-sdk/handle-network-stream.mdx +2 -2
  151. package/.docs/raw/reference/ai-sdk/handle-workflow-stream.mdx +2 -2
  152. package/.docs/raw/reference/ai-sdk/network-route.mdx +3 -3
  153. package/.docs/raw/reference/ai-sdk/to-ai-sdk-stream.mdx +6 -6
  154. package/.docs/raw/reference/ai-sdk/to-ai-sdk-v4-messages.mdx +127 -0
  155. package/.docs/raw/reference/ai-sdk/to-ai-sdk-v5-messages.mdx +107 -0
  156. package/.docs/raw/reference/ai-sdk/with-mastra.mdx +1 -1
  157. package/.docs/raw/reference/ai-sdk/workflow-route.mdx +3 -3
  158. package/.docs/raw/reference/auth/auth0.mdx +2 -3
  159. package/.docs/raw/reference/auth/clerk.mdx +2 -3
  160. package/.docs/raw/reference/auth/firebase.mdx +3 -5
  161. package/.docs/raw/reference/auth/jwt.mdx +2 -3
  162. package/.docs/raw/reference/auth/supabase.mdx +2 -3
  163. package/.docs/raw/reference/auth/workos.mdx +2 -3
  164. package/.docs/raw/reference/cli/create-mastra.mdx +10 -10
  165. package/.docs/raw/reference/cli/mastra.mdx +10 -10
  166. package/.docs/raw/reference/client-js/agents.mdx +1 -2
  167. package/.docs/raw/reference/client-js/mastra-client.mdx +2 -2
  168. package/.docs/raw/reference/client-js/workflows.mdx +20 -0
  169. package/.docs/raw/reference/core/getAgent.mdx +1 -1
  170. package/.docs/raw/reference/core/getAgentById.mdx +1 -1
  171. package/.docs/raw/reference/core/getDeployer.mdx +1 -1
  172. package/.docs/raw/reference/core/getLogger.mdx +1 -1
  173. package/.docs/raw/reference/core/getMCPServer.mdx +1 -1
  174. package/.docs/raw/reference/core/getMCPServerById.mdx +1 -1
  175. package/.docs/raw/reference/core/getMemory.mdx +2 -2
  176. package/.docs/raw/reference/core/getServer.mdx +3 -3
  177. package/.docs/raw/reference/core/getStorage.mdx +2 -2
  178. package/.docs/raw/reference/core/getStoredAgentById.mdx +3 -3
  179. package/.docs/raw/reference/core/getTelemetry.mdx +1 -1
  180. package/.docs/raw/reference/core/getVector.mdx +1 -1
  181. package/.docs/raw/reference/core/getWorkflow.mdx +1 -1
  182. package/.docs/raw/reference/core/listAgents.mdx +1 -1
  183. package/.docs/raw/reference/core/listLogs.mdx +1 -1
  184. package/.docs/raw/reference/core/listLogsByRunId.mdx +1 -1
  185. package/.docs/raw/reference/core/listMCPServers.mdx +1 -1
  186. package/.docs/raw/reference/core/listMemory.mdx +2 -2
  187. package/.docs/raw/reference/core/listStoredAgents.mdx +4 -4
  188. package/.docs/raw/reference/core/listVectors.mdx +1 -1
  189. package/.docs/raw/reference/core/listWorkflows.mdx +1 -1
  190. package/.docs/raw/reference/core/setLogger.mdx +1 -1
  191. package/.docs/raw/reference/core/setStorage.mdx +2 -2
  192. package/.docs/raw/reference/core/setTelemetry.mdx +1 -1
  193. package/.docs/raw/reference/deployer/cloudflare.mdx +1 -2
  194. package/.docs/raw/reference/deployer/deployer.mdx +0 -1
  195. package/.docs/raw/reference/deployer/netlify.mdx +1 -1
  196. package/.docs/raw/reference/deployer/vercel.mdx +2 -4
  197. package/.docs/raw/reference/evals/answer-relevancy.mdx +1 -1
  198. package/.docs/raw/reference/evals/answer-similarity.mdx +1 -1
  199. package/.docs/raw/reference/evals/bias.mdx +1 -1
  200. package/.docs/raw/reference/evals/completeness.mdx +1 -1
  201. package/.docs/raw/reference/evals/content-similarity.mdx +1 -1
  202. package/.docs/raw/reference/evals/context-precision.mdx +1 -1
  203. package/.docs/raw/reference/evals/faithfulness.mdx +1 -1
  204. package/.docs/raw/reference/evals/hallucination.mdx +1 -1
  205. package/.docs/raw/reference/evals/keyword-coverage.mdx +1 -1
  206. package/.docs/raw/reference/evals/prompt-alignment.mdx +7 -7
  207. package/.docs/raw/reference/evals/textual-difference.mdx +1 -1
  208. package/.docs/raw/reference/evals/tone-consistency.mdx +1 -1
  209. package/.docs/raw/reference/evals/tool-call-accuracy.mdx +10 -10
  210. package/.docs/raw/reference/evals/toxicity.mdx +1 -1
  211. package/.docs/raw/reference/logging/pino-logger.mdx +7 -8
  212. package/.docs/raw/reference/memory/createThread.mdx +2 -2
  213. package/.docs/raw/reference/memory/deleteMessages.mdx +2 -2
  214. package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +2 -2
  215. package/.docs/raw/reference/memory/memory-class.mdx +3 -3
  216. package/.docs/raw/reference/memory/query.mdx +2 -2
  217. package/.docs/raw/reference/memory/recall.mdx +2 -2
  218. package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +1 -1
  219. package/.docs/raw/reference/processors/batch-parts-processor.mdx +2 -2
  220. package/.docs/raw/reference/processors/language-detector.mdx +2 -2
  221. package/.docs/raw/reference/processors/message-history-processor.mdx +2 -2
  222. package/.docs/raw/reference/processors/moderation-processor.mdx +3 -3
  223. package/.docs/raw/reference/processors/pii-detector.mdx +3 -3
  224. package/.docs/raw/reference/processors/processor-interface.mdx +13 -13
  225. package/.docs/raw/reference/processors/prompt-injection-detector.mdx +2 -2
  226. package/.docs/raw/reference/processors/semantic-recall-processor.mdx +2 -2
  227. package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +2 -2
  228. package/.docs/raw/reference/processors/token-limiter-processor.mdx +2 -2
  229. package/.docs/raw/reference/processors/tool-call-filter.mdx +3 -3
  230. package/.docs/raw/reference/processors/unicode-normalizer.mdx +2 -2
  231. package/.docs/raw/reference/processors/working-memory-processor.mdx +3 -3
  232. package/.docs/raw/reference/rag/chunk.mdx +1 -1
  233. package/.docs/raw/reference/rag/database-config.mdx +1 -1
  234. package/.docs/raw/reference/rag/extract-params.mdx +2 -2
  235. package/.docs/raw/reference/rag/metadata-filters.mdx +7 -7
  236. package/.docs/raw/reference/server/create-route.mdx +14 -14
  237. package/.docs/raw/reference/server/express-adapter.mdx +10 -11
  238. package/.docs/raw/reference/server/hono-adapter.mdx +10 -11
  239. package/.docs/raw/reference/server/mastra-server.mdx +22 -22
  240. package/.docs/raw/reference/server/routes.mdx +28 -1
  241. package/.docs/raw/reference/storage/cloudflare-d1.mdx +3 -3
  242. package/.docs/raw/reference/storage/cloudflare.mdx +2 -2
  243. package/.docs/raw/reference/storage/convex.mdx +6 -6
  244. package/.docs/raw/reference/storage/dynamodb.mdx +4 -4
  245. package/.docs/raw/reference/storage/lance.mdx +3 -3
  246. package/.docs/raw/reference/storage/libsql.mdx +69 -54
  247. package/.docs/raw/reference/storage/mongodb.mdx +80 -7
  248. package/.docs/raw/reference/storage/mssql.mdx +4 -4
  249. package/.docs/raw/{server-db/storage.mdx → reference/storage/overview.mdx} +13 -111
  250. package/.docs/raw/reference/storage/postgresql.mdx +78 -7
  251. package/.docs/raw/reference/storage/upstash.mdx +74 -2
  252. package/.docs/raw/reference/streaming/agents/stream.mdx +27 -5
  253. package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +2 -2
  254. package/.docs/raw/reference/streaming/workflows/observeStream.mdx +1 -1
  255. package/.docs/raw/reference/streaming/workflows/resumeStream.mdx +1 -1
  256. package/.docs/raw/reference/streaming/workflows/stream.mdx +35 -22
  257. package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +4 -4
  258. package/.docs/raw/reference/templates/overview.mdx +1 -2
  259. package/.docs/raw/reference/tools/create-tool.mdx +24 -5
  260. package/.docs/raw/reference/tools/graph-rag-tool.mdx +3 -3
  261. package/.docs/raw/reference/tools/vector-query-tool.mdx +4 -4
  262. package/.docs/raw/reference/vectors/astra.mdx +3 -3
  263. package/.docs/raw/reference/vectors/chroma.mdx +3 -3
  264. package/.docs/raw/reference/vectors/convex.mdx +12 -12
  265. package/.docs/raw/reference/vectors/couchbase.mdx +5 -5
  266. package/.docs/raw/reference/vectors/duckdb.mdx +10 -10
  267. package/.docs/raw/reference/vectors/elasticsearch.mdx +4 -4
  268. package/.docs/raw/reference/vectors/lance.mdx +4 -4
  269. package/.docs/raw/reference/vectors/libsql.mdx +61 -11
  270. package/.docs/raw/reference/vectors/mongodb.mdx +58 -5
  271. package/.docs/raw/reference/vectors/pg.mdx +53 -6
  272. package/.docs/raw/reference/vectors/pinecone.mdx +3 -3
  273. package/.docs/raw/reference/vectors/qdrant.mdx +3 -3
  274. package/.docs/raw/reference/vectors/s3vectors.mdx +6 -6
  275. package/.docs/raw/reference/vectors/turbopuffer.mdx +4 -4
  276. package/.docs/raw/reference/vectors/upstash.mdx +55 -6
  277. package/.docs/raw/reference/vectors/vectorize.mdx +3 -3
  278. package/.docs/raw/reference/workflows/run-methods/cancel.mdx +2 -2
  279. package/.docs/raw/reference/workflows/run-methods/restart.mdx +1 -3
  280. package/.docs/raw/reference/workflows/run-methods/resume.mdx +2 -2
  281. package/.docs/raw/reference/workflows/run-methods/start.mdx +2 -2
  282. package/.docs/raw/reference/workflows/run-methods/startAsync.mdx +143 -0
  283. package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +5 -5
  284. package/.docs/raw/reference/workflows/run.mdx +1 -1
  285. package/.docs/raw/reference/workflows/step.mdx +3 -3
  286. package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +1 -1
  287. package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +1 -1
  288. package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +37 -2
  289. package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +1 -1
  290. package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +1 -1
  291. package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +6 -6
  292. package/.docs/raw/reference/workflows/workflow-methods/map.mdx +7 -7
  293. package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +1 -1
  294. package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +2 -2
  295. package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +2 -2
  296. package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +2 -2
  297. package/.docs/raw/reference/workflows/workflow-methods/then.mdx +1 -1
  298. package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +2 -2
  299. package/.docs/raw/reference/workflows/workflow.mdx +17 -3
  300. package/.docs/raw/{auth → server/auth}/auth0.mdx +20 -14
  301. package/.docs/raw/{auth → server/auth}/clerk.mdx +16 -9
  302. package/.docs/raw/{auth → server/auth}/firebase.mdx +21 -15
  303. package/.docs/raw/{auth → server/auth}/index.mdx +6 -6
  304. package/.docs/raw/{auth → server/auth}/jwt.mdx +14 -7
  305. package/.docs/raw/{auth → server/auth}/supabase.mdx +16 -9
  306. package/.docs/raw/{auth → server/auth}/workos.mdx +19 -13
  307. package/.docs/raw/{server-db → server}/custom-adapters.mdx +13 -13
  308. package/.docs/raw/{server-db → server}/custom-api-routes.mdx +3 -5
  309. package/.docs/raw/{server-db → server}/mastra-client.mdx +26 -15
  310. package/.docs/raw/{server-db → server}/mastra-server.mdx +8 -8
  311. package/.docs/raw/{server-db → server}/middleware.mdx +9 -9
  312. package/.docs/raw/{server-db → server}/request-context.mdx +33 -32
  313. package/.docs/raw/{server-db → server}/server-adapters.mdx +12 -12
  314. package/.docs/raw/streaming/events.mdx +14 -7
  315. package/.docs/raw/streaming/overview.mdx +21 -10
  316. package/.docs/raw/streaming/tool-streaming.mdx +6 -6
  317. package/.docs/raw/streaming/workflow-streaming.mdx +6 -8
  318. package/.docs/raw/tools-mcp/advanced-usage.mdx +2 -2
  319. package/.docs/raw/tools-mcp/mcp-overview.mdx +31 -12
  320. package/.docs/raw/tools-mcp/overview.mdx +10 -11
  321. package/.docs/raw/voice/overview.mdx +1 -1
  322. package/.docs/raw/workflows/agents-and-tools.mdx +28 -19
  323. package/.docs/raw/workflows/control-flow.mdx +27 -40
  324. package/.docs/raw/workflows/error-handling.mdx +172 -18
  325. package/.docs/raw/workflows/human-in-the-loop.mdx +6 -7
  326. package/.docs/raw/workflows/inngest-workflow.mdx +8 -9
  327. package/.docs/raw/workflows/input-data-mapping.mdx +7 -7
  328. package/.docs/raw/workflows/overview.mdx +34 -23
  329. package/.docs/raw/workflows/snapshots.mdx +14 -44
  330. package/.docs/raw/workflows/suspend-and-resume.mdx +7 -7
  331. package/.docs/raw/workflows/time-travel.mdx +16 -16
  332. package/.docs/raw/workflows/workflow-state.mdx +5 -8
  333. package/CHANGELOG.md +23 -0
  334. package/dist/logger.d.ts +3 -0
  335. package/dist/logger.d.ts.map +1 -1
  336. package/dist/stdio.js +53 -0
  337. package/package.json +4 -4
  338. package/.docs/organized/changelogs/%40internal%2Fai-sdk-v4.md +0 -1
  339. package/.docs/raw/deployment/cloud-providers/index.mdx +0 -55
  340. package/.docs/raw/memory/conversation-history.mdx +0 -24
  341. package/.docs/raw/memory/storage/memory-with-libsql.mdx +0 -140
  342. package/.docs/raw/memory/storage/memory-with-mongodb.mdx +0 -150
  343. package/.docs/raw/memory/storage/memory-with-pg.mdx +0 -138
  344. package/.docs/raw/memory/storage/memory-with-upstash.mdx +0 -146
  345. package/.docs/raw/memory/threads-and-resources.mdx +0 -95
@@ -1,502 +1,502 @@
1
1
  # @mastra/core
2
2
 
3
- ## 1.0.0-beta.11
3
+ ## 1.0.0-beta.14
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - Respect structured outputs for v2 models so tool schemas aren’t stripped ([#11038](https://github.com/mastra-ai/mastra/pull/11038))
7
+ - Add support for AI SDK v6 (LanguageModelV3) ([#11191](https://github.com/mastra-ai/mastra/pull/11191))
8
8
 
9
- ### Patch Changes
9
+ Agents can now use `LanguageModelV3` models from AI SDK v6 beta providers like `@ai-sdk/openai@^3.0.0-beta`.
10
10
 
11
- - Fix type safety for message ordering - restrict `orderBy` to only accept `'createdAt'` field ([#11069](https://github.com/mastra-ai/mastra/pull/11069))
11
+ **New features:**
12
+ - 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
12
13
 
13
- 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.
14
+ **Backward compatible:** All existing V1 and V2 models continue to work unchanged.
14
15
 
15
- - Loosen tools types in processInputStep / prepareStep. ([#11071](https://github.com/mastra-ai/mastra/pull/11071))
16
+ ### Patch Changes
16
17
 
17
- - Added the ability to provide a base path for Mastra Studio. ([#10441](https://github.com/mastra-ai/mastra/pull/10441))
18
+ - Fix model-level and runtime header support for LLM calls ([#11275](https://github.com/mastra-ai/mastra/pull/11275))
18
19
 
19
- ```ts
20
- import { Mastra } from '@mastra/core';
20
+ 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:
21
21
 
22
- export const mastra = new Mastra({
23
- server: {
24
- studioBase: '/my-mastra-studio',
22
+ **Header Priority (low to high):**
23
+ 1. Model config headers - Headers set in model configuration
24
+ 2. ModelSettings headers - Runtime headers that override model config
25
+ 3. Provider-level headers - Headers baked into AI SDK providers (not overridden)
26
+
27
+ **Examples that now work:**
28
+
29
+ ```typescript
30
+ // Model config headers
31
+ new Agent({
32
+ model: {
33
+ id: 'anthropic/claude-4-5-sonnet',
34
+ headers: { 'anthropic-beta': 'context-1m-2025-08-07' },
25
35
  },
26
36
  });
37
+
38
+ // Runtime headers override config
39
+ agent.generate('...', {
40
+ modelSettings: { headers: { 'x-custom': 'runtime-value' } },
41
+ });
42
+
43
+ // Provider-level headers preserved
44
+ const openai = createOpenAI({ headers: { 'openai-organization': 'org-123' } });
45
+ new Agent({ model: openai('gpt-4o-mini') });
27
46
  ```
28
47
 
29
- This will make Mastra Studio available at `http://localhost:4111/my-mastra-studio`.
48
+ - 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))
30
49
 
31
- - Expand `processInputStep` processor method and integrate `prepareStep` as a processor ([#10774](https://github.com/mastra-ai/mastra/pull/10774))
50
+ Previously, canceling a parent workflow did not stop nested sub-workflows, causing them to continue running and consuming resources after the parent was canceled.
32
51
 
33
- **New Features:**
34
- - `prepareStep` callback now runs through the standard `processInputStep` pipeline
35
- - Processors can now modify per-step: `model`, `tools`, `toolChoice`, `activeTools`, `messages`, `systemMessages`, `providerOptions`, `modelSettings`, and `structuredOutput`
36
- - Processor chaining: each processor receives accumulated state from previous processors
37
- - System messages are isolated per-step (reset at start of each step)
52
+ Now, when you cancel a parent workflow, all nested sub-workflows are automatically canceled as well, ensuring clean termination of the entire workflow tree.
38
53
 
39
- **Breaking Change:**
40
- - `prepareStep` messages format changed from AI SDK v5 model messages to `MastraDBMessage` format
41
- - Migration: Use `messageList.get.all.aiV5.model()` if you need the old format
54
+ **Example:**
42
55
 
43
- - Multiple Processor improvements including: ([#10947](https://github.com/mastra-ai/mastra/pull/10947))
44
- - Workflows can now return tripwires, they bubble up from agents that return tripwires in a step
45
- - You can write processors as workflows using the existing Workflow primitive, every processor flow is now a workflow.
46
- - tripwires that you throw can now return additional information including ability to retry the step
47
- - New processor method `processOutputStep` added which runs after every step.
56
+ ```typescript
57
+ const parentWorkflow = createWorkflow({ id: 'parent-workflow' }).then(someStep).then(nestedChildWorkflow).commit();
48
58
 
49
- **What's new:**
59
+ const run = await parentWorkflow.createRun();
60
+ const resultPromise = run.start({ inputData: { value: 5 } });
50
61
 
51
- **1. Retry mechanism with LLM feedback** - Processors can now request retries with feedback that gets sent back to the LLM:
62
+ // Cancel the parent workflow - nested workflows will also be canceled
63
+ await run.cancel();
64
+ // or use: run.abortController.abort();
52
65
 
53
- ```typescript
54
- processOutputStep: async ({ text, abort, retryCount }) => {
55
- if (isLowQuality(text)) {
56
- abort('Response quality too low', { retry: true, metadata: { score: 0.6 } });
57
- }
58
- return [];
59
- };
66
+ const result = await resultPromise;
67
+ // result.status === 'canceled'
68
+ // All nested child workflows are also canceled
60
69
  ```
61
70
 
62
- 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.
71
+ Related to #11063
63
72
 
64
- **2. Workflow orchestration for processors** - Processors can now be composed using workflow primitives:
73
+ - Fix empty overrideScorers causing error instead of skipping scoring ([#11257](https://github.com/mastra-ai/mastra/pull/11257))
65
74
 
66
- ```typescript
67
- import { createStep, createWorkflow } from '@mastra/core/workflows';
68
- import {
69
- ProcessorStepSchema,
70
- } from '@mastra/core/processors';
75
+ 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.
71
76
 
72
- const moderationWorkflow = createWorkflow({ id: 'moderation', inputSchema: ProcessorStepSchema, outputSchema: ProcessorStepSchema })
73
- .then(createStep(new lengthValidator({...})))
74
- .parallel([createStep(new piiDetector({...}), createStep(new toxicityChecker({...}))])
75
- .commit();
77
+ - feat: Add field filtering and nested workflow control to workflow execution result endpoint ([#11246](https://github.com/mastra-ai/mastra/pull/11246))
76
78
 
77
- const agent = new Agent({ inputProcessors: [moderationWorkflow] });
78
- ```
79
+ Adds two optional query parameters to `/api/workflows/:workflowId/runs/:runId/execution-result` endpoint:
80
+ - `fields`: Request only specific fields (e.g., `status`, `result`, `error`)
81
+ - `withNestedWorkflows`: Control whether to fetch nested workflow data
79
82
 
80
- Every processor array that gets passed to an agent gets added as a workflow
81
- <img width="614" height="673" alt="image" src="https://github.com/user-attachments/assets/0d79f1fd-8fca-4d86-8b45-22fddea984a8" />
83
+ This significantly reduces response payload size and improves response times for large workflows.
82
84
 
83
- **3. Extended tripwire API** - `abort()` now accepts options for retry control and typed metadata:
85
+ ## Server Endpoint Usage
84
86
 
85
- ```typescript
86
- abort('reason', { retry: true, metadata: { score: 0.8, category: 'quality' } });
87
- ```
87
+ ```http
88
+ # Get only status (minimal payload - fastest)
89
+ GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status
88
90
 
89
- **4. New `processOutputStep` method** - Per-step output processing with access to step number, finish reason, tool calls, and retry count.
91
+ # Get status and result
92
+ GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status,result
90
93
 
91
- **5. Workflow tripwire status** - Workflows now have a `'tripwire'` status distinct from `'failed'`, properly bubbling up processor rejections.
94
+ # Get all fields but without nested workflow data (faster)
95
+ GET /api/workflows/:workflowId/runs/:runId/execution-result?withNestedWorkflows=false
92
96
 
93
- ## 1.0.0-beta.10
97
+ # Get only specific fields without nested workflow data
98
+ GET /api/workflows/:workflowId/runs/:runId/execution-result?fields=status,steps&withNestedWorkflows=false
94
99
 
95
- ### Patch Changes
100
+ # Get full data (default behavior)
101
+ GET /api/workflows/:workflowId/runs/:runId/execution-result
102
+ ```
96
103
 
97
- - Add support for typed structured output in agent workflow steps ([#11014](https://github.com/mastra-ai/mastra/pull/11014))
104
+ ## Client SDK Usage
98
105
 
99
- 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 }`.
106
+ ```typescript
107
+ import { MastraClient } from '@mastra/client-js';
100
108
 
101
- This enables type-safe chaining of agent steps with structured output to subsequent steps:
109
+ const client = new MastraClient({ baseUrl: 'http://localhost:4111' });
110
+ const workflow = client.getWorkflow('myWorkflow');
102
111
 
103
- ```typescript
104
- const articleSchema = z.object({
105
- title: z.string(),
106
- summary: z.string(),
107
- tags: z.array(z.string()),
112
+ // Get only status (minimal payload - fastest)
113
+ const statusOnly = await workflow.runExecutionResult(runId, {
114
+ fields: ['status'],
108
115
  });
116
+ console.log(statusOnly.status); // 'success' | 'failed' | 'running' | etc.
109
117
 
110
- // Agent step with structured output - outputSchema is now articleSchema
111
- const agentStep = createStep(agent, {
112
- structuredOutput: { schema: articleSchema },
118
+ // Get status and result
119
+ const statusAndResult = await workflow.runExecutionResult(runId, {
120
+ fields: ['status', 'result'],
113
121
  });
114
122
 
115
- // Next step can receive the structured output directly
116
- const processStep = createStep({
117
- id: 'process',
118
- inputSchema: articleSchema, // Matches agent's outputSchema
119
- outputSchema: z.object({ tagCount: z.number() }),
120
- execute: async ({ inputData }) => ({
121
- tagCount: inputData.tags.length, // Fully typed!
122
- }),
123
+ // Get all fields but without nested workflow data (faster)
124
+ const resultWithoutNested = await workflow.runExecutionResult(runId, {
125
+ withNestedWorkflows: false,
123
126
  });
124
127
 
125
- workflow.then(agentStep).then(processStep).commit();
126
- ```
128
+ // Get specific fields without nested workflow data
129
+ const optimized = await workflow.runExecutionResult(runId, {
130
+ fields: ['status', 'steps'],
131
+ withNestedWorkflows: false,
132
+ });
127
133
 
128
- When `structuredOutput` is not provided, the agent step continues to use the default `{ text: string }` output schema.
134
+ // Get full execution result (default behavior)
135
+ const fullResult = await workflow.runExecutionResult(runId);
136
+ ```
129
137
 
130
- - 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))
138
+ ## Core API Changes
131
139
 
132
- - Add delete workflow run API ([#10991](https://github.com/mastra-ai/mastra/pull/10991))
140
+ The `Workflow.getWorkflowRunExecutionResult` method now accepts an options object:
133
141
 
134
142
  ```typescript
135
- await workflow.deleteWorkflowRunById(runId);
143
+ await workflow.getWorkflowRunExecutionResult(runId, {
144
+ withNestedWorkflows: false, // default: true, set to false to skip nested workflow data
145
+ fields: ['status', 'result'], // optional field filtering
146
+ });
136
147
  ```
137
148
 
138
- - 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))
149
+ ## Inngest Compatibility
139
150
 
140
- - fix: persist data-\* chunks from writer.custom() to memory storage ([#10884](https://github.com/mastra-ai/mastra/pull/10884))
141
- - Add persistence for custom data chunks (`data-*` parts) emitted via `writer.custom()` in tools
142
- - Data chunks are now saved to message storage so they survive page refreshes
143
- - Update `@assistant-ui/react` to v0.11.47 with native `DataMessagePart` support
144
- - Convert `data-*` parts to `DataMessagePart` format (`{ type: 'data', name: string, data: T }`)
145
- - Update related `@assistant-ui/*` packages for compatibility
151
+ 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.
146
152
 
147
- - Fixed double validation bug that prevented Zod transforms from working correctly in tool schemas. ([#11025](https://github.com/mastra-ai/mastra/pull/11025))
153
+ ## Performance Impact
148
154
 
149
- 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.
155
+ For workflows with large step outputs:
156
+ - Requesting only `status`: ~99% reduction in payload size
157
+ - Requesting `status,result,error`: ~95% reduction in payload size
158
+ - Using `withNestedWorkflows=false`: Avoids expensive nested workflow data fetching
159
+ - Combining both: Maximum performance optimization
150
160
 
151
- 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).
161
+ - 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))
152
162
 
153
- - Updated dependencies [[`5d7000f`](https://github.com/mastra-ai/mastra/commit/5d7000f757cd65ea9dc5b05e662fd83dfd44e932)]:
154
- - @mastra/observability@1.0.0-beta.4
163
+ - 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))
155
164
 
156
- ## 1.0.0-beta.9
165
+ **Note:** If you previously relied on the default bundling behavior (all dependencies bundled), you can explicitly set `externals: false` in your bundler configuration.
157
166
 
158
- ### Minor Changes
167
+ - Fix delayed promises rejecting when stream suspends on tool-call-approval ([#11278](https://github.com/mastra-ai/mastra/pull/11278))
159
168
 
160
- - Add stored agents support ([#10953](https://github.com/mastra-ai/mastra/pull/10953))
169
+ 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.
161
170
 
162
- 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.
171
+ Also improves generic type inference for `LLMStepResult` and related types throughout the streaming infrastructure.
163
172
 
164
- ```typescript
165
- import { Mastra } from '@mastra/core';
166
- import { LibSQLStore } from '@mastra/libsql';
173
+ ## 1.0.0-beta.13
167
174
 
168
- const mastra = new Mastra({
169
- storage: new LibSQLStore({ url: ':memory:' }),
170
- tools: { myTool },
171
- scorers: { myScorer },
172
- });
175
+ ### Patch Changes
173
176
 
174
- // Create agent in storage via API or directly
175
- await mastra.getStorage().createAgent({
176
- agent: {
177
- id: 'my-agent',
178
- name: 'My Agent',
179
- instructions: 'You are helpful',
180
- model: { provider: 'openai', name: 'gpt-4' },
181
- tools: { myTool: {} },
182
- scorers: { myScorer: { sampling: { type: 'ratio', rate: 0.5 } } },
183
- },
184
- });
177
+ - Add `onFinish` and `onError` lifecycle callbacks to workflow options ([#11200](https://github.com/mastra-ai/mastra/pull/11200))
185
178
 
186
- // Load and use the agent
187
- const agent = await mastra.getStoredAgentById('my-agent');
188
- const response = await agent.generate({ messages: 'Hello!' });
179
+ Workflows now support lifecycle callbacks for server-side handling of workflow completion and errors:
180
+ - `onFinish`: Called when workflow completes with any status (success, failed, suspended, tripwire)
181
+ - `onError`: Called only when workflow fails (failed or tripwire status)
189
182
 
190
- // List all stored agents with pagination
191
- const { agents, total, hasMore } = await mastra.listStoredAgents({
192
- page: 0,
193
- perPage: 10,
183
+ ```typescript
184
+ const workflow = createWorkflow({
185
+ id: 'my-workflow',
186
+ inputSchema: z.object({ ... }),
187
+ outputSchema: z.object({ ... }),
188
+ options: {
189
+ onFinish: async (result) => {
190
+ // Handle any workflow completion
191
+ await updateJobStatus(result.status);
192
+ },
193
+ onError: async (errorInfo) => {
194
+ // Handle workflow failures
195
+ await logError(errorInfo.error);
196
+ },
197
+ },
194
198
  });
195
199
  ```
196
200
 
197
- Also adds a memory registry to Mastra so stored agents can reference memory instances by key.
201
+ Both callbacks support sync and async functions. Callback errors are caught and logged, not propagated to the workflow result.
202
+
203
+ ## 1.0.0-beta.12
198
204
 
199
205
  ### Patch Changes
200
206
 
201
- - 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))
207
+ - Remove redundant toolCalls from network agent finalResult ([#11189](https://github.com/mastra-ai/mastra/pull/11189))
202
208
 
203
- - Fix JSON parsing errors when LLMs output unescaped newlines in structured output strings ([#10965](https://github.com/mastra-ai/mastra/pull/10965))
209
+ 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.
204
210
 
205
- 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.
211
+ **Before:** `finalResult: { text, toolCalls, messages }`
212
+ **After:** `finalResult: { text, messages }`
206
213
 
207
- 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.
214
+ +**Migration:** If you were accessing `finalResult.toolCalls`, retrieve tool calls from `finalResult.messages` by filtering for messages with `type: 'tool-call'`.
208
215
 
209
- - 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))
216
+ Updated `@mastra/react` to extract tool calls directly from the `messages` array instead of the removed `toolCalls` field when resolving initial messages from memory.
210
217
 
211
- - Exports `convertFullStreamChunkToMastra` from the stream module for AI SDK stream chunk transformations. ([#10911](https://github.com/mastra-ai/mastra/pull/10911))
218
+ Fixes #11059
212
219
 
213
- ## 1.0.0-beta.8
220
+ - Embed AI types to fix peerdeps mismatches ([`9650cce`](https://github.com/mastra-ai/mastra/commit/9650cce52a1d917ff9114653398e2a0f5c3ba808))
214
221
 
215
- ### Patch Changes
222
+ - Fix invalid state: Controller is already closed ([`932d63d`](https://github.com/mastra-ai/mastra/commit/932d63dd51be9c8bf1e00e3671fe65606c6fb9cd))
216
223
 
217
- - Fix saveScore not persisting ID correctly, breaking getScoreById retrieval ([#10915](https://github.com/mastra-ai/mastra/pull/10915))
224
+ Fixes #11005
218
225
 
219
- **What Changed**
220
- - saveScore now correctly returns scores that can be retrieved with getScoreById
221
- - Validation errors now include contextual information (scorer, entity, trace details) for easier debugging
226
+ - 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))
222
227
 
223
- **Impact**
224
- 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.
228
+ 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.
225
229
 
226
- - `setState` is now async ([#10944](https://github.com/mastra-ai/mastra/pull/10944))
227
- - `setState` must now be awaited: `await setState({ key: value })`
228
- - State updates are merged automatically—no need to spread the previous state
229
- - State data is validated against the step's `stateSchema` when `validateInputs` is enabled (default: `true`)
230
+ - Add resourceId to workflow routes ([#11166](https://github.com/mastra-ai/mastra/pull/11166))
230
231
 
231
- - Add human-in-the-loop support for workflows used in agent ([#10871](https://github.com/mastra-ai/mastra/pull/10871))
232
+ - Auto resume suspended tools if `autoResumeSuspendedTools: true` ([#11157](https://github.com/mastra-ai/mastra/pull/11157))
232
233
 
233
- ## 1.0.0-beta.7
234
-
235
- ### Minor Changes
236
-
237
- - Add `disableInit` option to all storage adapters ([#10851](https://github.com/mastra-ai/mastra/pull/10851))
238
-
239
- 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.
234
+ The flag can be added to `defaultAgentOptions` when creating the agent or to options in `agent.stream` or `agent.generate`
240
235
 
241
236
  ```typescript
242
- // CI/CD script - run migrations
243
- const storage = new PostgresStore({
244
- connectionString: DATABASE_URL,
245
- id: 'pg-storage',
246
- });
247
- await storage.init();
248
-
249
- // Runtime - skip auto-init
250
- const storage = new PostgresStore({
251
- connectionString: DATABASE_URL,
252
- id: 'pg-storage',
253
- disableInit: true,
237
+ const agent = new Agent({
238
+ //...agent information,
239
+ defaultAgentOptions: {
240
+ autoResumeSuspendedTools: true,
241
+ },
254
242
  });
255
243
  ```
256
244
 
257
- ### Patch Changes
245
+ - Preserve error details when thrown from workflow steps ([#10992](https://github.com/mastra-ai/mastra/pull/10992))
246
+ - Errors thrown in workflow steps now preserve full error details including `cause` chain and custom properties
247
+ - Added `SerializedError` type with proper cause chain support
248
+ - Added `SerializedStepResult` and `SerializedStepFailure` types for handling errors loaded from storage
249
+ - Enhanced `addErrorToJSON` to recursively serialize error cause chains with max depth protection
250
+ - Added `hydrateSerializedStepErrors` to convert serialized errors back to Error instances
251
+ - Fixed Inngest workflow error handling to extract original error from `NonRetriableError.cause`
258
252
 
259
- - Add time-to-first-token (TTFT) support for Langfuse integration ([#10781](https://github.com/mastra-ai/mastra/pull/10781))
253
+ - Move `@ai-sdk/azure` to devDependencies ([#10218](https://github.com/mastra-ai/mastra/pull/10218))
260
254
 
261
- 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.
255
+ - 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))
262
256
 
263
- ```typescript
264
- // completionStartTime is now automatically captured and sent to Langfuse
265
- // enabling TTFT metrics in your Langfuse dashboard
266
- const result = await agent.stream('Hello');
267
- ```
257
+ - Add `startAsync()` method and fix Inngest duplicate workflow execution bug ([#11093](https://github.com/mastra-ai/mastra/pull/11093))
268
258
 
269
- - 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))
270
- https://github.com/open-telemetry/semantic-conventions/blob/v1.38.0/docs/gen-ai/README.md
259
+ **New Feature: `startAsync()` for fire-and-forget workflow execution**
260
+ - Add `Run.startAsync()` to base workflow class - starts workflow in background and returns `{ runId }` immediately
261
+ - Add `EventedRun.startAsync()` - publishes workflow start event without subscribing for completion
262
+ - Add `InngestRun.startAsync()` - sends Inngest event without polling for result
271
263
 
272
- - 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))
264
+ **Bug Fix: Prevent duplicate Inngest workflow executions**
265
+ - Fix `getRuns()` to properly handle rate limits (429), empty responses, and JSON parse errors with retry logic and exponential backoff
266
+ - Fix `getRunOutput()` to throw `NonRetriableError` when polling fails, preventing Inngest from retrying the parent function and re-triggering the workflow
267
+ - Add timeout to `getRunOutput()` polling (default 5 minutes) with `NonRetriableError` on timeout
273
268
 
274
- - fix: generate unique text IDs for Anthropic/Google providers ([#10740](https://github.com/mastra-ai/mastra/pull/10740))
269
+ 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).
275
270
 
276
- Workaround for duplicate text-start/text-end IDs in multi-step agentic flows.
271
+ - Preserve error details when thrown from workflow steps ([#10992](https://github.com/mastra-ai/mastra/pull/10992))
277
272
 
278
- 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.
273
+ Workflow errors now retain custom properties like `statusCode`, `responseHeaders`, and `cause` chains. This enables error-specific recovery logic in your applications.
279
274
 
280
- 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.
275
+ **Before:**
276
+
277
+ ```typescript
278
+ const result = await workflow.execute({ input });
279
+ if (result.status === 'failed') {
280
+ // Custom error properties were lost
281
+ console.log(result.error); // "Step execution failed" (just a string)
282
+ }
283
+ ```
281
284
 
282
- Related: #9909
285
+ **After:**
283
286
 
284
- - Fix sub-agent requestContext propagation in listAgentTools ([#10844](https://github.com/mastra-ai/mastra/pull/10844))
287
+ ```typescript
288
+ const result = await workflow.execute({ input });
289
+ if (result.status === 'failed') {
290
+ // Custom properties are preserved
291
+ console.log(result.error.message); // "Step execution failed"
292
+ console.log(result.error.statusCode); // 429
293
+ console.log(result.error.cause?.name); // "RateLimitError"
294
+ }
295
+ ```
285
296
 
286
- 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.
297
+ **Type change:** `WorkflowState.error` and `WorkflowRunState.error` types changed from `string | Error` to `SerializedError`.
287
298
 
288
- No code changes required for consumers - this fix restores expected behavior for dynamic model configurations in sub-agents.
299
+ Other changes:
300
+ - Added `UpdateWorkflowStateOptions` type for workflow state updates
289
301
 
290
- - Fix ToolStream type error when piping streams with different types ([#10845](https://github.com/mastra-ai/mastra/pull/10845))
302
+ - Fix Zod 4 compatibility issue with structuredOutput in agent.generate() ([#11133](https://github.com/mastra-ai/mastra/pull/11133))
291
303
 
292
- 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.
304
+ 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.
293
305
 
294
- Before:
306
+ The fix disables input validation for processor workflows since `z.custom()` fields are meant to pass through arbitrary types without deep validation.
295
307
 
296
- ```typescript
297
- // TypeError: ToolStream<ChunkType> is not assignable to WritableStream<Partial<StoryPlan>>
298
- await response.objectStream.pipeTo(writer);
299
- ```
308
+ - Truncate map config when too long ([#11175](https://github.com/mastra-ai/mastra/pull/11175))
300
309
 
301
- After:
310
+ - Add helpful JSDoc comments to `BundlerConfig` properties (used with `bundler` option) ([#10218](https://github.com/mastra-ai/mastra/pull/10218))
302
311
 
303
- ```typescript
304
- // Works without type errors
305
- await response.objectStream.pipeTo(writer);
306
- ```
312
+ - Fixes .network() method ignores MASTRA_RESOURCE_ID_KEY from requestContext ([`4524734`](https://github.com/mastra-ai/mastra/commit/45247343e384717a7c8404296275c56201d6470f))
307
313
 
308
- - feat: add native Perplexity provider support ([#10885](https://github.com/mastra-ai/mastra/pull/10885))
314
+ - fix: make getSqlType consistent across storage adapters ([#11112](https://github.com/mastra-ai/mastra/pull/11112))
315
+ - PostgreSQL: use `getSqlType()` in `createTable` instead of `toUpperCase()`
316
+ - LibSQL: use `getSqlType()` in `createTable`, return `JSONB` for jsonb type (matches SQLite 3.45+ support)
317
+ - ClickHouse: use `getSqlType()` in `createTable` instead of `COLUMN_TYPES` constant, add missing types (uuid, float, boolean)
318
+ - Remove unused `getSqlType()` and `getDefaultValue()` from `MastraStorage` base class (all stores use `StoreOperations` versions)
309
319
 
310
- - 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))
320
+ - Fix workflow cancel not updating status when workflow is suspended ([#11139](https://github.com/mastra-ai/mastra/pull/11139))
321
+ - `Run.cancel()` now updates workflow status to 'canceled' in storage, resolving the issue where suspended workflows remained in 'suspended' status after cancellation
322
+ - Cancellation status is immediately persisted and reflected to observers
311
323
 
312
- **Before:**
324
+ - What changed: ([#10998](https://github.com/mastra-ai/mastra/pull/10998))
313
325
 
314
- ```ts
315
- threadObject = await memory.createThread({
316
- // ...
317
- saveThread: false, // thread not in DB yet
318
- });
319
- // Later: MessageHistory calls saveMessages() -> PostgresStore throws "Thread not found"
320
- ```
326
+ 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.
321
327
 
322
- **After:**
328
+ How it was changed:
323
329
 
324
- ```ts
325
- threadObject = await memory.createThread({
326
- // ...
327
- saveThread: true, // thread persisted immediately
328
- });
329
- // MessageHistory can now save messages without error
330
- ```
330
+ 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.
331
331
 
332
- - Emit error chunk and call onError when agent workflow step fails ([#10907](https://github.com/mastra-ai/mastra/pull/10907))
332
+ - Fixed duplicate assistant messages appearing when using `useChat` with memory enabled. ([#11195](https://github.com/mastra-ai/mastra/pull/11195))
333
333
 
334
- When a workflow step fails (e.g., tool not found), the error is now properly emitted as an error chunk to the stream and the onError callback is called. This fixes the issue where agent.generate() would throw "promise 'text' was not resolved or rejected" instead of the actual error message.
334
+ **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.
335
335
 
336
- - fix(core): use agent description when converting agent to tool ([#10879](https://github.com/mastra-ai/mastra/pull/10879))
336
+ **What changed:**
337
+ - The backend now sends the assistant message ID in the stream's start event, so `useChat` uses the same ID as storage
338
+ - Custom `data-*` parts (from `writer.custom()`) are now preserved when messages contain V5 tool parts
337
339
 
338
- - Adds native @ai-sdk/deepseek provider support instead of using the OpenAI-compatible fallback. ([#10822](https://github.com/mastra-ai/mastra/pull/10822))
340
+ Fixes #11091
339
341
 
340
- ```typescript
341
- const agent = new Agent({
342
- model: 'deepseek/deepseek-reasoner',
343
- });
342
+ - Updated dependencies [[`9650cce`](https://github.com/mastra-ai/mastra/commit/9650cce52a1d917ff9114653398e2a0f5c3ba808), [`5a632bd`](https://github.com/mastra-ai/mastra/commit/5a632bdf7b78953b664f5e038e98d4ba5f971e47)]:
343
+ - @mastra/schema-compat@1.0.0-beta.3
344
+ - @mastra/observability@1.0.0-beta.5
344
345
 
345
- // With provider options for reasoning
346
- const response = await agent.generate('Solve this problem', {
347
- providerOptions: {
348
- deepseek: {
349
- thinking: { type: 'enabled' },
350
- },
351
- },
352
- });
353
- ```
346
+ ## 1.0.0-beta.11
354
347
 
355
- Also updates the doc generation scripts so DeepSeek provider options show up in the generated docs.
348
+ ### Minor Changes
356
349
 
357
- - Return state too if `includeState: true` is in `outputOptions` and workflow run is not successful ([#10806](https://github.com/mastra-ai/mastra/pull/10806))
350
+ - Respect structured outputs for v2 models so tool schemas aren’t stripped ([#11038](https://github.com/mastra-ai/mastra/pull/11038))
358
351
 
359
- - feat: Add partial response support for agent and workflow list endpoints ([#10886](https://github.com/mastra-ai/mastra/pull/10886))
352
+ ### Patch Changes
360
353
 
361
- Add optional `partial` query parameter to `/api/agents` and `/api/workflows` endpoints to return minimal data without schemas, reducing payload size for list views:
362
- - When `partial=true`: tool schemas (inputSchema, outputSchema) are omitted
363
- - When `partial=true`: workflow steps are replaced with stepCount integer
364
- - When `partial=true`: workflow root schemas (inputSchema, outputSchema) are omitted
365
- - Maintains backward compatibility when partial parameter is not provided
354
+ - Fix type safety for message ordering - restrict `orderBy` to only accept `'createdAt'` field ([#11069](https://github.com/mastra-ai/mastra/pull/11069))
366
355
 
367
- ## Server Endpoint Usage
356
+ 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.
368
357
 
369
- ```http
370
- # Get partial agent data (no tool schemas)
371
- GET /api/agents?partial=true
358
+ - Loosen tools types in processInputStep / prepareStep. ([#11071](https://github.com/mastra-ai/mastra/pull/11071))
372
359
 
373
- # Get full agent data (default behavior)
374
- GET /api/agents
360
+ - Added the ability to provide a base path for Mastra Studio. ([#10441](https://github.com/mastra-ai/mastra/pull/10441))
375
361
 
376
- # Get partial workflow data (stepCount instead of steps, no schemas)
377
- GET /api/workflows?partial=true
362
+ ```ts
363
+ import { Mastra } from '@mastra/core';
378
364
 
379
- # Get full workflow data (default behavior)
380
- GET /api/workflows
365
+ export const mastra = new Mastra({
366
+ server: {
367
+ studioBase: '/my-mastra-studio',
368
+ },
369
+ });
381
370
  ```
382
371
 
383
- ## Client SDK Usage
372
+ This will make Mastra Studio available at `http://localhost:4111/my-mastra-studio`.
384
373
 
385
- ```typescript
386
- import { MastraClient } from '@mastra/client-js';
374
+ - Expand `processInputStep` processor method and integrate `prepareStep` as a processor ([#10774](https://github.com/mastra-ai/mastra/pull/10774))
387
375
 
388
- const client = new MastraClient({ baseUrl: 'http://localhost:4111' });
376
+ **New Features:**
377
+ - `prepareStep` callback now runs through the standard `processInputStep` pipeline
378
+ - Processors can now modify per-step: `model`, `tools`, `toolChoice`, `activeTools`, `messages`, `systemMessages`, `providerOptions`, `modelSettings`, and `structuredOutput`
379
+ - Processor chaining: each processor receives accumulated state from previous processors
380
+ - System messages are isolated per-step (reset at start of each step)
381
+
382
+ **Breaking Change:**
383
+ - `prepareStep` messages format changed from AI SDK v5 model messages to `MastraDBMessage` format
384
+ - Migration: Use `messageList.get.all.aiV5.model()` if you need the old format
389
385
 
390
- // Get partial agent list (smaller payload)
391
- const partialAgents = await client.listAgents({ partial: true });
386
+ - Multiple Processor improvements including: ([#10947](https://github.com/mastra-ai/mastra/pull/10947))
387
+ - Workflows can now return tripwires, they bubble up from agents that return tripwires in a step
388
+ - You can write processors as workflows using the existing Workflow primitive, every processor flow is now a workflow.
389
+ - tripwires that you throw can now return additional information including ability to retry the step
390
+ - New processor method `processOutputStep` added which runs after every step.
392
391
 
393
- // Get full agent list with tool schemas
394
- const fullAgents = await client.listAgents();
392
+ **What's new:**
395
393
 
396
- // Get partial workflow list (smaller payload)
397
- const partialWorkflows = await client.listWorkflows({ partial: true });
394
+ **1. Retry mechanism with LLM feedback** - Processors can now request retries with feedback that gets sent back to the LLM:
398
395
 
399
- // Get full workflow list with steps and schemas
400
- const fullWorkflows = await client.listWorkflows();
396
+ ```typescript
397
+ processOutputStep: async ({ text, abort, retryCount }) => {
398
+ if (isLowQuality(text)) {
399
+ abort('Response quality too low', { retry: true, metadata: { score: 0.6 } });
400
+ }
401
+ return [];
402
+ };
401
403
  ```
402
404
 
403
- - Fix processInputStep so it runs correctly. ([#10909](https://github.com/mastra-ai/mastra/pull/10909))
405
+ 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.
404
406
 
405
- - Updated dependencies [[`6c59a40`](https://github.com/mastra-ai/mastra/commit/6c59a40e0ad160467bd13d63a8a287028d75b02d), [`3076c67`](https://github.com/mastra-ai/mastra/commit/3076c6778b18988ae7d5c4c5c466366974b2d63f), [`0bada2f`](https://github.com/mastra-ai/mastra/commit/0bada2f2c1234932cf30c1c47a719ffb64b801c5), [`cc60ff6`](https://github.com/mastra-ai/mastra/commit/cc60ff616541a3b0fb531a7e469bf9ae7bb90528)]:
406
- - @mastra/observability@1.0.0-beta.3
407
+ **2. Workflow orchestration for processors** - Processors can now be composed using workflow primitives:
407
408
 
408
- ## 1.0.0-beta.6
409
+ ```typescript
410
+ import { createStep, createWorkflow } from '@mastra/core/workflows';
411
+ import {
412
+ ProcessorStepSchema,
413
+ } from '@mastra/core/processors';
409
414
 
410
- ### Major Changes
415
+ const moderationWorkflow = createWorkflow({ id: 'moderation', inputSchema: ProcessorStepSchema, outputSchema: ProcessorStepSchema })
416
+ .then(createStep(new lengthValidator({...})))
417
+ .parallel([createStep(new piiDetector({...}), createStep(new toxicityChecker({...}))])
418
+ .commit();
411
419
 
412
- - Changed `.branch()` result schema to make all branch output fields optional. ([#10693](https://github.com/mastra-ai/mastra/pull/10693))
420
+ const agent = new Agent({ inputProcessors: [moderationWorkflow] });
421
+ ```
413
422
 
414
- **Breaking change**: Branch outputs are now optional since only one branch executes at runtime. Update your workflow schemas to handle optional branch results.
423
+ Every processor array that gets passed to an agent gets added as a workflow
424
+ <img width="614" height="673" alt="image" src="https://github.com/user-attachments/assets/0d79f1fd-8fca-4d86-8b45-22fddea984a8" />
415
425
 
416
- **Before:**
426
+ **3. Extended tripwire API** - `abort()` now accepts options for retry control and typed metadata:
417
427
 
418
428
  ```typescript
419
- const workflow = createWorkflow({...})
420
- .branch([
421
- [condition1, stepA], // outputSchema: { result: z.string() }
422
- [condition2, stepB], // outputSchema: { data: z.number() }
423
- ])
424
- .map({
425
- finalResult: { step: stepA, path: 'result' } // Expected non-optional
426
- });
429
+ abort('reason', { retry: true, metadata: { score: 0.8, category: 'quality' } });
427
430
  ```
428
431
 
429
- **After:**
432
+ **4. New `processOutputStep` method** - Per-step output processing with access to step number, finish reason, tool calls, and retry count.
430
433
 
431
- ```typescript
432
- const workflow = createWorkflow({...})
433
- .branch([
434
- [condition1, stepA],
435
- [condition2, stepB],
436
- ])
437
- .map({
438
- finalResult: {
439
- step: stepA,
440
- path: 'result' // Now optional - provide fallback
441
- }
442
- });
443
- ```
434
+ **5. Workflow tripwire status** - Workflows now have a `'tripwire'` status distinct from `'failed'`, properly bubbling up processor rejections.
444
435
 
445
- **Why**: Branch conditionals execute only one path, so non-executed branches don't produce outputs. The type system now correctly reflects this runtime behavior.
436
+ ## 1.0.0-beta.10
446
437
 
447
- Related issue: https://github.com/mastra-ai/mastra/issues/10642
438
+ ### Patch Changes
448
439
 
449
- ### Minor Changes
440
+ - Add support for typed structured output in agent workflow steps ([#11014](https://github.com/mastra-ai/mastra/pull/11014))
441
+
442
+ 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 }`.
443
+
444
+ This enables type-safe chaining of agent steps with structured output to subsequent steps:
450
445
 
451
- - Memory system now uses processors. Memory processors (`MessageHistory`, `SemanticRecall`, `WorkingMemory`) are now exported from `@mastra/memory/processors` and automatically added to the agent pipeline based on your memory config. Core processors (`ToolCallFilter`, `TokenLimiter`) remain in `@mastra/core/processors`. ([#9254](https://github.com/mastra-ai/mastra/pull/9254))
446
+ ```typescript
447
+ const articleSchema = z.object({
448
+ title: z.string(),
449
+ summary: z.string(),
450
+ tags: z.array(z.string()),
451
+ });
452
452
 
453
- - Add reserved keys in RequestContext for secure resourceId/threadId setting from middleware ([#10657](https://github.com/mastra-ai/mastra/pull/10657))
453
+ // Agent step with structured output - outputSchema is now articleSchema
454
+ const agentStep = createStep(agent, {
455
+ structuredOutput: { schema: articleSchema },
456
+ });
454
457
 
455
- This allows middleware to securely set `resourceId` and `threadId` via reserved keys in RequestContext (`MASTRA_RESOURCE_ID_KEY` and `MASTRA_THREAD_ID_KEY`), which take precedence over client-provided values for security.
458
+ // Next step can receive the structured output directly
459
+ const processStep = createStep({
460
+ id: 'process',
461
+ inputSchema: articleSchema, // Matches agent's outputSchema
462
+ outputSchema: z.object({ tagCount: z.number() }),
463
+ execute: async ({ inputData }) => ({
464
+ tagCount: inputData.tags.length, // Fully typed!
465
+ }),
466
+ });
456
467
 
457
- - feat(workflows): add suspendData parameter to step execute function ([#10734](https://github.com/mastra-ai/mastra/pull/10734))
468
+ workflow.then(agentStep).then(processStep).commit();
469
+ ```
458
470
 
459
- Adds a new `suspendData` parameter to workflow step execute functions that provides access to the data originally passed to `suspend()` when the step was suspended. This enables steps to access context about why they were suspended when they are later resumed.
471
+ When `structuredOutput` is not provided, the agent step continues to use the default `{ text: string }` output schema.
460
472
 
461
- **New Features:**
462
- - `suspendData` parameter automatically populated in step execute function when resuming
463
- - Type-safe access to suspend data matching the step's `suspendSchema`
464
- - Backward compatible - existing workflows continue to work unchanged
473
+ - 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))
465
474
 
466
- **Example:**
475
+ - Add delete workflow run API ([#10991](https://github.com/mastra-ai/mastra/pull/10991))
467
476
 
468
477
  ```typescript
469
- const step = createStep({
470
- suspendSchema: z.object({ reason: z.string() }),
471
- resumeSchema: z.object({ approved: z.boolean() }),
472
- execute: async ({ suspend, suspendData, resumeData }) => {
473
- if (!resumeData?.approved) {
474
- return await suspend({ reason: 'Approval required' });
475
- }
476
-
477
- // Access original suspend data when resuming
478
- console.log(`Resuming after: ${suspendData?.reason}`);
479
- return { result: 'Approved' };
480
- },
481
- });
478
+ await workflow.deleteWorkflowRunById(runId);
482
479
  ```
483
480
 
484
- - feat(storage): support querying messages from multiple threads ([#10663](https://github.com/mastra-ai/mastra/pull/10663))
485
- - Fixed TypeScript errors where `threadId: string | string[]` was being passed to places expecting `Scalar` type
486
- - Added proper multi-thread support for `listMessages` across all adapters when `threadId` is an array
487
- - Updated `_getIncludedMessages` to look up message threadId by ID (since message IDs are globally unique)
488
- - **upstash**: Added `msg-idx:{messageId}` index for O(1) message lookups (backwards compatible with fallback to scan for old messages, with automatic backfill)
481
+ - 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))
482
+
483
+ - fix: persist data-\* chunks from writer.custom() to memory storage ([#10884](https://github.com/mastra-ai/mastra/pull/10884))
484
+ - Add persistence for custom data chunks (`data-*` parts) emitted via `writer.custom()` in tools
485
+ - Data chunks are now saved to message storage so they survive page refreshes
486
+ - Update `@assistant-ui/react` to v0.11.47 with native `DataMessagePart` support
487
+ - Convert `data-*` parts to `DataMessagePart` format (`{ type: 'data', name: string, data: T }`)
488
+ - Update related `@assistant-ui/*` packages for compatibility
489
+
490
+ - Fixed double validation bug that prevented Zod transforms from working correctly in tool schemas. ([#11025](https://github.com/mastra-ai/mastra/pull/11025))
489
491
 
490
- - Adds trace tagging support to the BrainTrust and Langfuse tracing exporters. ([#10765](https://github.com/mastra-ai/mastra/pull/10765))
492
+ 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.
491
493
 
492
- - Add `messageList` parameter to `processOutputStream` for accessing remembered messages during streaming ([#10608](https://github.com/mastra-ai/mastra/pull/10608))
494
+ 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).
493
495
 
494
- - Unify transformScoreRow functions across storage adapters ([#10648](https://github.com/mastra-ai/mastra/pull/10648))
496
+ - Updated dependencies [[`5d7000f`](https://github.com/mastra-ai/mastra/commit/5d7000f757cd65ea9dc5b05e662fd83dfd44e932)]:
497
+ - @mastra/observability@1.0.0-beta.4
498
+
499
+ ## 1.0.0-beta.9
495
500
 
496
- Added a unified `transformScoreRow` function in `@mastra/core/storage` that provides schema-driven row transformation for score data. This eliminates code duplication across 10 storage adapters while maintaining store-specific behavior through configurable options:
497
- - `preferredTimestampFields`: Preferred source fields for timestamps (PostgreSQL, Cloudflare D1)
498
- - `convertTimestamps`: Convert timestamp strings to Date objects (MSSQL, MongoDB, ClickHouse)
499
- - `nullValuePattern`: Skip values matching pattern (ClickHouse's `'_null_'`)
500
- - `fieldMappings`: Map source column names to schema fields (LibSQL's `additionalLLMContext`)
501
501
 
502
- ... 6146 more lines hidden. See full changelog in package directory.
502
+ ... 6489 more lines hidden. See full changelog in package directory.