@mastra/mcp-docs-server 0.0.0-studio-deploy-20260404182525 → 0.0.0-studio-cli-20260504022012

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 (285) hide show
  1. package/.docs/docs/agents/adding-voice.md +18 -17
  2. package/.docs/docs/agents/background-tasks.md +242 -0
  3. package/.docs/docs/agents/channels.md +2 -1
  4. package/.docs/docs/agents/overview.md +4 -0
  5. package/.docs/docs/agents/processors.md +177 -5
  6. package/.docs/docs/agents/structured-output.md +66 -1
  7. package/.docs/docs/agents/supervisor-agents.md +65 -0
  8. package/.docs/docs/agents/using-tools.md +73 -0
  9. package/.docs/docs/browser/agent-browser.md +78 -0
  10. package/.docs/docs/browser/browser-viewer.md +144 -0
  11. package/.docs/docs/browser/overview.md +168 -0
  12. package/.docs/docs/browser/stagehand.md +129 -0
  13. package/.docs/docs/deployment/cloud-providers.md +5 -1
  14. package/.docs/docs/deployment/mastra-server.md +4 -4
  15. package/.docs/docs/deployment/monorepo.md +3 -3
  16. package/.docs/docs/deployment/overview.md +11 -8
  17. package/.docs/docs/editor/overview.md +290 -0
  18. package/.docs/docs/editor/prompts.md +134 -0
  19. package/.docs/docs/editor/tools.md +152 -0
  20. package/.docs/docs/evals/custom-scorers.md +63 -3
  21. package/.docs/docs/evals/datasets/overview.md +1 -1
  22. package/.docs/docs/index.md +2 -2
  23. package/.docs/docs/mastra-platform/configuration.md +36 -0
  24. package/.docs/docs/mastra-platform/overview.md +78 -0
  25. package/.docs/docs/mcp/overview.md +17 -0
  26. package/.docs/docs/memory/memory-processors.md +3 -3
  27. package/.docs/docs/memory/message-history.md +8 -2
  28. package/.docs/docs/memory/observational-memory.md +65 -8
  29. package/.docs/docs/memory/storage.md +1 -2
  30. package/.docs/docs/memory/working-memory.md +2 -2
  31. package/.docs/docs/observability/logging.md +1 -1
  32. package/.docs/docs/observability/metrics/overview.md +2 -2
  33. package/.docs/docs/observability/overview.md +1 -1
  34. package/.docs/docs/observability/tracing/bridges/datadog.md +217 -0
  35. package/.docs/docs/observability/tracing/bridges/otel.md +2 -2
  36. package/.docs/docs/observability/tracing/exporters/arthur.md +163 -0
  37. package/.docs/docs/observability/tracing/exporters/cloud.md +135 -63
  38. package/.docs/docs/observability/tracing/exporters/datadog.md +3 -1
  39. package/.docs/docs/observability/tracing/exporters/default.md +5 -5
  40. package/.docs/docs/observability/tracing/exporters/laminar.md +22 -14
  41. package/.docs/docs/observability/tracing/exporters/langfuse.md +50 -33
  42. package/.docs/docs/observability/tracing/overview.md +87 -20
  43. package/.docs/docs/server/custom-adapters.md +5 -5
  44. package/.docs/docs/server/custom-api-routes.md +3 -3
  45. package/.docs/docs/server/mastra-client.md +2 -2
  46. package/.docs/docs/server/mastra-server.md +1 -1
  47. package/.docs/docs/server/middleware.md +46 -42
  48. package/.docs/docs/server/request-context.md +13 -2
  49. package/.docs/docs/server/server-adapters.md +91 -8
  50. package/.docs/docs/streaming/background-task-streaming.md +80 -0
  51. package/.docs/docs/streaming/overview.md +3 -0
  52. package/.docs/docs/studio/deployment.md +24 -6
  53. package/.docs/docs/studio/observability.md +1 -1
  54. package/.docs/docs/studio/overview.md +4 -4
  55. package/.docs/docs/voice/overview.md +74 -5
  56. package/.docs/docs/voice/speech-to-speech.md +45 -1
  57. package/.docs/docs/voice/speech-to-text.md +7 -7
  58. package/.docs/docs/voice/text-to-speech.md +10 -10
  59. package/.docs/docs/workflows/agents-and-tools.md +1 -1
  60. package/.docs/docs/workflows/overview.md +105 -4
  61. package/.docs/docs/workflows/scheduled-workflows.md +181 -0
  62. package/.docs/docs/workspace/filesystem.md +64 -6
  63. package/.docs/docs/workspace/lsp.md +76 -4
  64. package/.docs/docs/workspace/overview.md +62 -15
  65. package/.docs/docs/workspace/sandbox.md +3 -1
  66. package/.docs/docs/workspace/search.md +41 -2
  67. package/.docs/docs/workspace/skills.md +19 -19
  68. package/.docs/guides/agent-frameworks/ai-sdk.md +4 -4
  69. package/.docs/guides/build-your-ui/ai-sdk-ui.md +56 -9
  70. package/.docs/guides/build-your-ui/assistant-ui.md +1 -1
  71. package/.docs/guides/deployment/mastra-platform.md +191 -0
  72. package/.docs/guides/deployment/netlify.md +16 -1
  73. package/.docs/guides/getting-started/nestjs.md +238 -0
  74. package/.docs/guides/getting-started/next-js.md +0 -4
  75. package/.docs/guides/guide/code-review-bot.md +2 -2
  76. package/.docs/guides/guide/dev-assistant.md +4 -4
  77. package/.docs/{docs/mcp → guides/guide}/publishing-mcp-server.md +21 -1
  78. package/.docs/guides/guide/slack-assistant.md +191 -0
  79. package/.docs/guides/migrations/mastra-cloud.md +368 -0
  80. package/.docs/guides/migrations/upgrade-to-v1/tracing.md +1 -1
  81. package/.docs/models/embeddings.md +3 -3
  82. package/.docs/models/gateways/azure-openai.md +74 -35
  83. package/.docs/models/gateways/mastra.md +64 -0
  84. package/.docs/models/gateways/netlify.md +7 -3
  85. package/.docs/models/gateways/openrouter.md +28 -12
  86. package/.docs/models/gateways/vercel.md +22 -2
  87. package/.docs/models/gateways.md +1 -0
  88. package/.docs/models/index.md +43 -8
  89. package/.docs/models/providers/302ai.md +37 -4
  90. package/.docs/models/providers/abliteration-ai.md +71 -0
  91. package/.docs/models/providers/alibaba-cn.md +8 -2
  92. package/.docs/models/providers/alibaba-coding-plan-cn.md +3 -2
  93. package/.docs/models/providers/alibaba-coding-plan.md +3 -2
  94. package/.docs/models/providers/alibaba.md +8 -1
  95. package/.docs/models/providers/anthropic.md +18 -5
  96. package/.docs/models/providers/baseten.md +3 -1
  97. package/.docs/models/providers/berget.md +10 -12
  98. package/.docs/models/providers/chutes.md +4 -2
  99. package/.docs/models/providers/cloudflare-workers-ai.md +14 -48
  100. package/.docs/models/providers/cortecs.md +22 -2
  101. package/.docs/models/providers/deepinfra.md +8 -2
  102. package/.docs/models/providers/deepseek.md +6 -4
  103. package/.docs/models/providers/digitalocean.md +133 -0
  104. package/.docs/models/providers/fireworks-ai.md +6 -1
  105. package/.docs/models/providers/firmware.md +12 -10
  106. package/.docs/models/providers/friendli.md +6 -7
  107. package/.docs/models/providers/google.md +9 -3
  108. package/.docs/models/providers/helicone.md +1 -2
  109. package/.docs/models/providers/hpc-ai.md +73 -0
  110. package/.docs/models/providers/huggingface.md +6 -2
  111. package/.docs/models/providers/inception.md +9 -11
  112. package/.docs/models/providers/kilo.md +359 -339
  113. package/.docs/models/providers/kimi-for-coding.md +2 -1
  114. package/.docs/models/providers/llmgateway.md +67 -77
  115. package/.docs/models/providers/mistral.md +3 -2
  116. package/.docs/models/providers/mixlayer.md +75 -0
  117. package/.docs/models/providers/moonshotai-cn.md +3 -2
  118. package/.docs/models/providers/moonshotai.md +3 -2
  119. package/.docs/models/providers/nano-gpt.md +8 -2
  120. package/.docs/models/providers/neuralwatt.md +84 -0
  121. package/.docs/models/providers/novita-ai.md +19 -4
  122. package/.docs/models/providers/nvidia.md +8 -1
  123. package/.docs/models/providers/ollama-cloud.md +7 -2
  124. package/.docs/models/providers/openai.md +7 -2
  125. package/.docs/models/providers/opencode-go.md +21 -13
  126. package/.docs/models/providers/opencode.md +11 -4
  127. package/.docs/models/providers/ovhcloud.md +6 -8
  128. package/.docs/models/providers/poe.md +10 -15
  129. package/.docs/models/providers/regolo-ai.md +83 -0
  130. package/.docs/models/providers/siliconflow-cn.md +5 -2
  131. package/.docs/models/providers/siliconflow.md +6 -3
  132. package/.docs/models/providers/stepfun.md +8 -7
  133. package/.docs/models/providers/synthetic.md +5 -2
  134. package/.docs/models/providers/tencent-token-plan.md +71 -0
  135. package/.docs/models/providers/tencent-tokenhub.md +71 -0
  136. package/.docs/models/providers/togetherai.md +8 -7
  137. package/.docs/models/providers/vivgrid.md +7 -3
  138. package/.docs/models/providers/vultr.md +7 -6
  139. package/.docs/models/providers/wafer.ai.md +73 -0
  140. package/.docs/models/providers/wandb.md +3 -2
  141. package/.docs/models/providers/xai.md +6 -1
  142. package/.docs/models/providers/xiaomi-token-plan-ams.md +75 -0
  143. package/.docs/models/providers/xiaomi-token-plan-cn.md +75 -0
  144. package/.docs/models/providers/xiaomi-token-plan-sgp.md +75 -0
  145. package/.docs/models/providers/xiaomi.md +4 -2
  146. package/.docs/models/providers/zai-coding-plan.md +11 -19
  147. package/.docs/models/providers/zai.md +2 -1
  148. package/.docs/models/providers/zenmux.md +17 -6
  149. package/.docs/models/providers/zhipuai-coding-plan.md +11 -21
  150. package/.docs/models/providers/zhipuai.md +2 -1
  151. package/.docs/models/providers.md +11 -0
  152. package/.docs/reference/agents/agent.md +1 -1
  153. package/.docs/reference/agents/channels.md +3 -3
  154. package/.docs/reference/agents/generate.md +88 -6
  155. package/.docs/reference/agents/generateLegacy.md +1 -1
  156. package/.docs/reference/ai-sdk/chat-route.md +2 -0
  157. package/.docs/reference/ai-sdk/handle-chat-stream.md +19 -0
  158. package/.docs/reference/ai-sdk/handle-network-stream.md +2 -0
  159. package/.docs/reference/ai-sdk/network-route.md +2 -0
  160. package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +95 -0
  161. package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +15 -0
  162. package/.docs/reference/browser/agent-browser.md +375 -0
  163. package/.docs/reference/browser/browser-viewer.md +228 -0
  164. package/.docs/reference/browser/mastra-browser.md +286 -0
  165. package/.docs/reference/browser/stagehand-browser.md +286 -0
  166. package/.docs/reference/cli/mastra.md +703 -0
  167. package/.docs/reference/client-js/agents.md +166 -0
  168. package/.docs/reference/client-js/conversations.md +1 -1
  169. package/.docs/reference/client-js/mastra-client.md +23 -0
  170. package/.docs/reference/client-js/observability.md +2 -2
  171. package/.docs/reference/client-js/responses.md +1 -1
  172. package/.docs/reference/client-js/workflows.md +62 -1
  173. package/.docs/reference/configuration.md +67 -1
  174. package/.docs/reference/core/addGateway.md +5 -5
  175. package/.docs/reference/core/getEditor.md +35 -0
  176. package/.docs/reference/core/getGateway.md +5 -5
  177. package/.docs/reference/core/getGatewayById.md +5 -5
  178. package/.docs/reference/core/getMCPServer.md +2 -2
  179. package/.docs/reference/core/getMCPServerById.md +2 -2
  180. package/.docs/reference/core/getScorer.md +3 -3
  181. package/.docs/reference/core/getScorerById.md +3 -3
  182. package/.docs/reference/core/listGateways.md +5 -5
  183. package/.docs/reference/core/listMCPServers.md +2 -2
  184. package/.docs/reference/core/listScorers.md +3 -3
  185. package/.docs/reference/core/mastra-class.md +11 -1
  186. package/.docs/reference/core/mastra-model-gateway.md +5 -5
  187. package/.docs/reference/datasets/create.md +4 -4
  188. package/.docs/reference/datasets/startExperiment.md +28 -2
  189. package/.docs/reference/datasets/update.md +4 -4
  190. package/.docs/reference/deployer/cloudflare.md +14 -1
  191. package/.docs/reference/deployer/netlify.md +50 -2
  192. package/.docs/reference/editor/mastra-editor.md +168 -0
  193. package/.docs/reference/editor/tool-provider.md +85 -0
  194. package/.docs/reference/evals/context-precision.md +3 -3
  195. package/.docs/reference/evals/context-relevance.md +3 -3
  196. package/.docs/reference/evals/create-scorer.md +5 -3
  197. package/.docs/reference/evals/filter-run.md +117 -0
  198. package/.docs/reference/evals/mastra-scorer.md +4 -4
  199. package/.docs/reference/evals/noise-sensitivity.md +6 -6
  200. package/.docs/reference/evals/prompt-alignment.md +12 -12
  201. package/.docs/reference/evals/run-evals.md +6 -6
  202. package/.docs/reference/evals/scorer-utils.md +3 -3
  203. package/.docs/reference/evals/trajectory-accuracy.md +3 -3
  204. package/.docs/reference/harness/harness-class.md +152 -53
  205. package/.docs/reference/index.md +25 -0
  206. package/.docs/reference/logging/pino-logger.md +0 -2
  207. package/.docs/reference/mastra-platform/api.md +108 -0
  208. package/.docs/reference/memory/clone-utilities.md +4 -2
  209. package/.docs/reference/memory/cloneThread.md +4 -2
  210. package/.docs/reference/memory/observational-memory.md +4 -0
  211. package/.docs/reference/observability/metrics/automatic-metrics.md +3 -3
  212. package/.docs/reference/observability/tracing/bridges/datadog.md +211 -0
  213. package/.docs/reference/observability/tracing/bridges/otel.md +3 -3
  214. package/.docs/reference/observability/tracing/configuration.md +18 -11
  215. package/.docs/reference/observability/tracing/exporters/arthur.md +122 -0
  216. package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +102 -21
  217. package/.docs/reference/observability/tracing/exporters/console-exporter.md +8 -8
  218. package/.docs/reference/observability/tracing/exporters/datadog.md +3 -1
  219. package/.docs/reference/observability/tracing/exporters/default-exporter.md +8 -8
  220. package/.docs/reference/observability/tracing/exporters/langfuse.md +25 -32
  221. package/.docs/reference/observability/tracing/exporters/otel.md +3 -3
  222. package/.docs/reference/observability/tracing/instances.md +7 -7
  223. package/.docs/reference/observability/tracing/interfaces.md +23 -6
  224. package/.docs/reference/observability/tracing/span-filtering.md +95 -0
  225. package/.docs/reference/observability/tracing/spans.md +6 -6
  226. package/.docs/reference/processors/prefill-error-handler.md +70 -0
  227. package/.docs/reference/processors/processor-interface.md +400 -40
  228. package/.docs/reference/processors/skill-search-processor.md +20 -1
  229. package/.docs/reference/processors/stream-error-retry-processor.md +54 -0
  230. package/.docs/reference/processors/tool-call-filter.md +23 -0
  231. package/.docs/reference/server/create-route.md +3 -3
  232. package/.docs/reference/server/express-adapter.md +4 -4
  233. package/.docs/reference/server/fastify-adapter.md +4 -4
  234. package/.docs/reference/server/hono-adapter.md +4 -4
  235. package/.docs/reference/server/koa-adapter.md +4 -4
  236. package/.docs/reference/server/mastra-server.md +3 -3
  237. package/.docs/reference/server/nestjs-adapter.md +169 -0
  238. package/.docs/reference/server/register-api-route.md +4 -4
  239. package/.docs/reference/server/routes.md +11 -10
  240. package/.docs/reference/storage/clickhouse.md +300 -0
  241. package/.docs/reference/storage/cloudflare-d1.md +42 -42
  242. package/.docs/reference/storage/composite.md +5 -3
  243. package/.docs/reference/storage/duckdb.md +150 -0
  244. package/.docs/reference/storage/overview.md +1 -1
  245. package/.docs/reference/storage/redis.md +266 -0
  246. package/.docs/reference/streaming/ChunkType.md +143 -3
  247. package/.docs/reference/streaming/agents/MastraModelOutput.md +2 -2
  248. package/.docs/reference/streaming/agents/stream.md +10 -2
  249. package/.docs/reference/streaming/agents/streamUntilIdle.md +94 -0
  250. package/.docs/reference/streaming/workflows/resumeStream.md +2 -0
  251. package/.docs/reference/templates/overview.md +88 -14
  252. package/.docs/reference/tools/create-tool.md +107 -5
  253. package/.docs/reference/tools/mcp-client.md +45 -0
  254. package/.docs/reference/tools/mcp-server.md +1 -3
  255. package/.docs/reference/tools/perplexity.md +155 -0
  256. package/.docs/reference/tools/tavily.md +307 -0
  257. package/.docs/reference/vectors/mongodb.md +0 -2
  258. package/.docs/reference/voice/aws-nova-sonic.md +247 -0
  259. package/.docs/reference/voice/cloudflare.md +3 -3
  260. package/.docs/reference/voice/sarvam.md +29 -23
  261. package/.docs/reference/voice/voice.connect.md +4 -4
  262. package/.docs/reference/voice/voice.listen.md +3 -3
  263. package/.docs/reference/workflows/run-methods/resume.md +24 -0
  264. package/.docs/reference/workflows/run-methods/startAsync.md +1 -1
  265. package/.docs/reference/workflows/step.md +88 -7
  266. package/.docs/reference/workflows/workflow-methods/foreach.md +14 -1
  267. package/.docs/reference/workflows/workflow.md +88 -4
  268. package/.docs/reference/workspace/azure-blob-filesystem.md +219 -0
  269. package/.docs/reference/workspace/docker-sandbox.md +196 -0
  270. package/.docs/reference/workspace/gcs-filesystem.md +1 -0
  271. package/.docs/reference/workspace/google-drive-filesystem.md +185 -0
  272. package/.docs/reference/workspace/modal-sandbox.md +168 -0
  273. package/.docs/reference/workspace/process-manager.md +1 -1
  274. package/.docs/reference/workspace/s3-filesystem.md +80 -5
  275. package/.docs/reference/workspace/vercel.md +1 -1
  276. package/.docs/reference/workspace/workspace-class.md +37 -6
  277. package/CHANGELOG.md +500 -4
  278. package/dist/stdio.js.map +1 -1
  279. package/dist/utils.d.ts +1 -4
  280. package/dist/utils.d.ts.map +1 -1
  281. package/package.json +11 -11
  282. package/.docs/docs/mastra-cloud/deployment.md +0 -77
  283. package/.docs/docs/mastra-cloud/observability.md +0 -38
  284. package/.docs/docs/mastra-cloud/overview.md +0 -23
  285. package/.docs/docs/mastra-cloud/setup.md +0 -42
@@ -151,6 +151,30 @@ for await (const part of uiMessageStream) {
151
151
  }
152
152
  ```
153
153
 
154
+ ### `streamUntilIdle()`
155
+
156
+ Stream a response and keep the stream open until every [background task](https://mastra.ai/docs/agents/background-tasks) dispatched during the run completes. The server re-enters the agentic loop on each task completion so the LLM can react to results in the same call. Requires background tasks to be [enabled on the Mastra instance](https://mastra.ai/reference/configuration) and a memory thread; otherwise the call falls through to a plain `stream()`.
157
+
158
+ ```typescript
159
+ const response = await agent.streamUntilIdle('Research solana for me', {
160
+ memory: {
161
+ thread: 'thread-1',
162
+ resource: 'resource-1',
163
+ },
164
+ maxIdleMs: 5 * 60_000,
165
+ })
166
+
167
+ response.processDataStream({
168
+ onChunk: async chunk => {
169
+ if (chunk.type === 'background-task-completed') {
170
+ console.log('task complete:', chunk.payload.taskId)
171
+ }
172
+ },
173
+ })
174
+ ```
175
+
176
+ The stream emits the same chunk types as `stream()`, plus `background-task-*` chunks for task lifecycle events. Visit [`Agent.streamUntilIdle()`](https://mastra.ai/reference/streaming/agents/streamUntilIdle) for the full server-side API and [background task chunks](https://mastra.ai/reference/streaming/ChunkType) for the payload shapes.
177
+
154
178
  ### `getTool()`
155
179
 
156
180
  Retrieve information about a specific tool available to the agent:
@@ -217,6 +241,26 @@ response.processDataStream({
217
241
  })
218
242
  ```
219
243
 
244
+ ### `resumeStream()`
245
+
246
+ Resume a suspended agent stream with custom data. Use this to continue execution after a suspension point, such as a workflow suspend within an agent:
247
+
248
+ ```typescript
249
+ const response = await agent.resumeStream(
250
+ { approved: true, selectedOption: 'plan-b' },
251
+ {
252
+ runId: 'run-123',
253
+ toolCallId: 'tool-call-456', // optional
254
+ },
255
+ )
256
+
257
+ await response.processDataStream({
258
+ onChunk: chunk => {
259
+ console.log(chunk)
260
+ },
261
+ })
262
+ ```
263
+
220
264
  ### `approveToolCallGenerate()`
221
265
 
222
266
  Approve a pending tool call when using `generate()` (non-streaming). Returns the complete response:
@@ -439,4 +483,126 @@ Delete a stored agent:
439
483
  ```typescript
440
484
  const result = await storedAgent.delete()
441
485
  console.log(result.success) // true
486
+ ```
487
+
488
+ ## Version management
489
+
490
+ Both `Agent` (code-defined) and `StoredAgent` instances have methods for managing configuration versions. See the [Editor overview](https://mastra.ai/docs/editor/overview) for an introduction to version management.
491
+
492
+ ### Getting an agent with a specific version
493
+
494
+ Pass a version identifier when getting an agent:
495
+
496
+ ```typescript
497
+ // Load the published version (default)
498
+ const agent = mastraClient.getAgent('support-agent')
499
+
500
+ // Load the latest draft
501
+ const draftAgent = mastraClient.getAgent('support-agent', { status: 'draft' })
502
+
503
+ // Load a specific version
504
+ const versionedAgent = mastraClient.getAgent('support-agent', { versionId: 'abc-123' })
505
+ ```
506
+
507
+ For stored agents, pass a status option to `details()`:
508
+
509
+ ```typescript
510
+ const storedAgent = mastraClient.getStoredAgent('my-agent')
511
+ const draft = await storedAgent.details(undefined, { status: 'draft' })
512
+ ```
513
+
514
+ ### `listVersions()`
515
+
516
+ List all versions for an agent:
517
+
518
+ ```typescript
519
+ const versions = await agent.listVersions()
520
+ console.log(versions.items) // Array of version snapshots
521
+ console.log(versions.total)
522
+ ```
523
+
524
+ With pagination and sorting:
525
+
526
+ ```typescript
527
+ const versions = await agent.listVersions({
528
+ page: 0,
529
+ perPage: 10,
530
+ orderBy: {
531
+ field: 'createdAt',
532
+ direction: 'DESC',
533
+ },
534
+ })
535
+ ```
536
+
537
+ ### `createVersion()`
538
+
539
+ Create a new version snapshot:
540
+
541
+ ```typescript
542
+ const version = await agent.createVersion({
543
+ changeMessage: 'Updated tone to be more friendly',
544
+ })
545
+ ```
546
+
547
+ ### `getVersion()`
548
+
549
+ Get a specific version by ID:
550
+
551
+ ```typescript
552
+ const version = await agent.getVersion('version-123')
553
+ console.log(version.versionNumber)
554
+ console.log(version.changedFields)
555
+ console.log(version.createdAt)
556
+ ```
557
+
558
+ ### `activateVersion()`
559
+
560
+ Set a version as the active published version:
561
+
562
+ ```typescript
563
+ await agent.activateVersion('version-123')
564
+ ```
565
+
566
+ ### `restoreVersion()`
567
+
568
+ Restore a previous version by creating a new version with the same configuration:
569
+
570
+ ```typescript
571
+ await agent.restoreVersion('version-456')
572
+ ```
573
+
574
+ ### `deleteVersion()`
575
+
576
+ Delete a version:
577
+
578
+ ```typescript
579
+ await agent.deleteVersion('version-789')
580
+ ```
581
+
582
+ ### `compareVersions()`
583
+
584
+ Compare two versions and return their differences:
585
+
586
+ ```typescript
587
+ const diff = await agent.compareVersions('version-123', 'version-456')
588
+ console.log(diff.changes) // Fields that changed between versions
589
+ ```
590
+
591
+ ### React SDK
592
+
593
+ In the React SDK, pass an `agentVersionId` through `requestContext` when using the `useChat` hook:
594
+
595
+ ```typescript
596
+ import { useChat } from '@mastra/react'
597
+
598
+ function Chat() {
599
+ const { messages, input, handleInputChange, handleSubmit } = useChat({
600
+ agentId: 'support-agent',
601
+ requestContext: {
602
+ agentVersionId: 'abc-123',
603
+ },
604
+ })
605
+
606
+ // ... render chat UI
607
+ }
442
608
  ```
@@ -1,6 +1,6 @@
1
1
  # OpenAI Responses API Conversations
2
2
 
3
- The OpenAI Responses API Conversations surface provides methods to create, retrieve, delete, and inspect thread-backed conversations in Mastra.
3
+ The OpenAI Responses API Conversations surface gives you the conversation-management side of Mastra Agents as a Responses API. It provides methods to create, retrieve, delete, and inspect thread-backed conversations in Mastra.
4
4
 
5
5
  This API follows up on the [OpenAI Responses API](https://mastra.ai/reference/client-js/responses). Stored Responses calls return `conversation_id`, and in Mastra that value is the raw memory `threadId`. Use `client.conversations` when you want to work with that thread directly.
6
6
 
@@ -12,6 +12,29 @@ export const mastraClient = new MastraClient({
12
12
  })
13
13
  ```
14
14
 
15
+ ## `RequestContext`
16
+
17
+ When you use `RequestContext` with the client SDK, import it from `@mastra/client-js`.
18
+
19
+ ```typescript
20
+ import { MastraClient, RequestContext } from '@mastra/client-js'
21
+
22
+ const client = new MastraClient({
23
+ baseUrl: 'http://localhost:4111/',
24
+ })
25
+
26
+ const requestContext = new RequestContext()
27
+ requestContext.set('userId', 'user-123')
28
+
29
+ const agent = client.getAgent('support-agent')
30
+
31
+ const response = await agent.generate('Summarize this ticket', {
32
+ requestContext,
33
+ })
34
+ ```
35
+
36
+ You can also pass `requestContext` as a `Record<string, any>`.
37
+
15
38
  ## Parameters
16
39
 
17
40
  **baseUrl** (`string`): The base URL for the Mastra API. All requests will be sent relative to this URL.
@@ -68,5 +68,5 @@ const scores = await mastraClient.listScoresBySpan({
68
68
 
69
69
  ## Related
70
70
 
71
- - [Agents API](https://mastra.ai/reference/client-js/agents) - Learn about agent interactions that generate traces
72
- - [Workflows API](https://mastra.ai/reference/client-js/workflows) - Understand workflow execution monitoring
71
+ - [Agents API](https://mastra.ai/reference/client-js/agents): Learn about agent interactions that generate traces
72
+ - [Workflows API](https://mastra.ai/reference/client-js/workflows): Understand workflow execution monitoring
@@ -1,6 +1,6 @@
1
1
  # OpenAI Responses API
2
2
 
3
- The OpenAI Responses API provides methods to create, retrieve, stream, and delete OpenAI-compatible responses through Mastra agents.
3
+ This OpenAI-compatible, agent-backed interface lets you use Mastra Agents as a Responses API. It provides methods to create, retrieve, stream, and delete responses through Mastra agents.
4
4
 
5
5
  These routes are agent-backed adapters over Mastra agents, memory, and storage. Use `agent_id` to select the Mastra agent that should handle the request. You can pass `model` to override the agent's configured model for a single request, or omit it to use the model already configured on the agent.
6
6
 
@@ -140,6 +140,18 @@ await run.resume({
140
140
  })
141
141
  ```
142
142
 
143
+ When a [`.foreach()`](https://mastra.ai/reference/workflows/workflow-methods/foreach) step suspends across multiple iterations, pass `forEachIndex` (zero-based; `0` targets the first iteration) to resume one iteration at a time. Iterations you don't target remain suspended.
144
+
145
+ ```typescript
146
+ await run.resume({
147
+ step: 'approve',
148
+ resumeData: { ok: true },
149
+ forEachIndex: 1, // resumes the second iteration
150
+ })
151
+ ```
152
+
153
+ `forEachIndex` is also supported by `resumeAsync()` and `resumeStream()`.
154
+
143
155
  ### `cancel()`
144
156
 
145
157
  Cancel a running workflow:
@@ -196,4 +208,53 @@ A workflow run result yields the following:
196
208
 
197
209
  **eventTimestamp** (`Date`): The timestamp of the event
198
210
 
199
- **payload** (`object`): Contains currentStep (id, status, output, payload) and workflowState (status, steps record)
211
+ **payload** (`object`): Contains currentStep (id, status, output, payload) and workflowState (status, steps record)
212
+
213
+ ## Schedules
214
+
215
+ Schedules are declared in code via the `schedule` field on `createWorkflow`. The client SDK exposes read and operational methods for managing them at runtime. See [Scheduled workflows](https://mastra.ai/docs/workflows/scheduled-workflows).
216
+
217
+ ### `listSchedules()`
218
+
219
+ List all schedules, optionally filtered by workflow id or status.
220
+
221
+ ```typescript
222
+ const schedules = await mastraClient.listSchedules({
223
+ workflowId: 'daily-report',
224
+ status: 'active',
225
+ })
226
+ ```
227
+
228
+ ### `getSchedule()`
229
+
230
+ Fetch a single schedule by id.
231
+
232
+ ```typescript
233
+ const schedule = await mastraClient.getSchedule('daily-report')
234
+ ```
235
+
236
+ ### `pauseSchedule()`
237
+
238
+ Pause a schedule so the scheduler stops firing it. Returns the updated schedule. Idempotent.
239
+
240
+ ```typescript
241
+ await mastraClient.pauseSchedule('daily-report')
242
+ ```
243
+
244
+ ### `resumeSchedule()`
245
+
246
+ Resume a paused schedule. The next fire time is recomputed from now, so a long-paused schedule does not fire a backlog. Returns the updated schedule. Idempotent.
247
+
248
+ ```typescript
249
+ await mastraClient.resumeSchedule('daily-report')
250
+ ```
251
+
252
+ ### `listScheduleTriggers()`
253
+
254
+ List the trigger history for a schedule, including the joined run summary for each fire.
255
+
256
+ ```typescript
257
+ const { triggers } = await mastraClient.listScheduleTriggers('daily-report', {
258
+ limit: 50,
259
+ })
260
+ ```
@@ -36,6 +36,69 @@ export const mastra = new Mastra({
36
36
  })
37
37
  ```
38
38
 
39
+ ### backgroundTasks
40
+
41
+ **Type:** `BackgroundTaskManagerConfig`
42
+
43
+ Enables and configures the background task manager. When enabled, agents can dispatch long-running tool calls (including subagent invocations) to run asynchronously while the agentic loop continues. Tasks are persisted, so a configured `storage` backend is required.
44
+
45
+ Visit the [Background tasks documentation](https://mastra.ai/docs/agents/background-tasks) to learn more.
46
+
47
+ ```typescript
48
+ import { Mastra } from '@mastra/core'
49
+ import { LibSQLStore } from '@mastra/libsql'
50
+
51
+ export const mastra = new Mastra({
52
+ storage: new LibSQLStore({
53
+ id: 'mastra-storage',
54
+ url: 'file:./mastra.db',
55
+ }),
56
+ backgroundTasks: {
57
+ enabled: true,
58
+ globalConcurrency: 10,
59
+ perAgentConcurrency: 5,
60
+ backpressure: 'queue',
61
+ defaultTimeoutMs: 300_000,
62
+ },
63
+ })
64
+ ```
65
+
66
+ **enabled** (`boolean`): Whether background tasks are enabled. The manager only initializes when this is true and a storage backend is configured. (Default: `false`)
67
+
68
+ **globalConcurrency** (`number`): Maximum number of background tasks running concurrently across all agents. (Default: `10`)
69
+
70
+ **perAgentConcurrency** (`number`): Maximum number of background tasks running concurrently for a single agent. (Default: `5`)
71
+
72
+ **backpressure** (`'queue' | 'reject' | 'fallback-sync'`): Behavior when a concurrency limit is reached. 'queue' waits for a slot, 'reject' throws on enqueue, 'fallback-sync' runs the tool synchronously in the agentic loop instead. (Default: `'queue'`)
73
+
74
+ **defaultTimeoutMs** (`number`): Default per-task timeout in milliseconds. Can be overridden per-tool or per-call. (Default: `300000`)
75
+
76
+ **defaultRetries** (`RetryConfig`): Default retry policy applied to tasks that fail.
77
+
78
+ **defaultRetries.maxRetries** (`number`): Maximum retry attempts before the task is marked failed.
79
+
80
+ **defaultRetries.retryDelayMs** (`number`): Delay between retries in milliseconds.
81
+
82
+ **defaultRetries.backoffMultiplier** (`number`): Multiplier applied to retryDelayMs on each subsequent attempt.
83
+
84
+ **defaultRetries.maxRetryDelayMs** (`number`): Upper bound on the retry delay regardless of backoff.
85
+
86
+ **defaultRetries.retryableErrors** (`(error: Error) => boolean`): Predicate that decides whether a given error should be retried. Default: retry all errors.
87
+
88
+ **cleanup** (`CleanupConfig`): Controls how long task records are kept and how often the cleanup process runs.
89
+
90
+ **cleanup.completedTtlMs** (`number`): How long to keep completed task records, in milliseconds. Default: 1 hour.
91
+
92
+ **cleanup.failedTtlMs** (`number`): How long to keep failed task records, in milliseconds. Default: 24 hours.
93
+
94
+ **cleanup.cleanupIntervalMs** (`number`): How often the cleanup process runs, in milliseconds. Default: 1 minute.
95
+
96
+ **waitTimeoutMs** (`number`): How long the agentic loop waits for a background task to complete before moving on. If a task has not finished within this time, the loop proceeds without setting isContinued. Default: undefined (do not wait). Can be overridden per-agent or per-tool.
97
+
98
+ **onTaskComplete** (`(task: BackgroundTask) => void | Promise<void>`): Global callback invoked when any background task completes successfully. Fires in addition to per-tool and per-agent callbacks.
99
+
100
+ **onTaskFailed** (`(task: BackgroundTask) => void | Promise<void>`): Global callback invoked when any background task fails. Fires in addition to per-tool and per-agent callbacks.
101
+
39
102
  ### deployer
40
103
 
41
104
  **Type:** `MastraDeployer`
@@ -442,7 +505,7 @@ const mastra = new Mastra({
442
505
 
443
506
  When `mastra build` is run, Mastra bundles your project into the `.mastra/output` directory. This option controls which packages are excluded from the bundle (marked as "external") and installed separately through a package manager. This is useful when the internal Mastra bundler ([Rollup](https://rollupjs.org/configuration-options/#external)) has trouble bundling certain packages.
444
507
 
445
- By default, `mastra build` sets this option to `true`. If you deploy your project to [Mastra Cloud](https://mastra.ai/docs/mastra-cloud/overview), it also sets this option to `true`.
508
+ By default, `mastra build` sets this option to `true`.
446
509
 
447
510
  Here's an overview of what the different values mean:
448
511
 
@@ -544,11 +607,14 @@ export const mastra = new Mastra({
544
607
  server: {
545
608
  auth: new MastraJwtAuth({
546
609
  secret: process.env.MASTRA_JWT_SECRET,
610
+ mapUserToResourceId: user => user.id,
547
611
  }),
548
612
  },
549
613
  })
550
614
  ```
551
615
 
616
+ The `mapUserToResourceId` callback maps the authenticated user to a resource ID for memory/thread scoping. When provided, it's called after successful authentication and the returned value is set on the request context as `MASTRA_RESOURCE_ID_KEY`. See [Authorization (User Isolation)](https://mastra.ai/docs/server/middleware) for details.
617
+
552
618
  ### server.bodySizeLimit
553
619
 
554
620
  **Type:** `number`\
@@ -35,8 +35,8 @@ Void. The gateway is added to the internal registry.
35
35
 
36
36
  ## Related
37
37
 
38
- - [Mastra.getGateway()](https://mastra.ai/reference/core/getGateway) - Get gateway by registration key
39
- - [Mastra.getGatewayById()](https://mastra.ai/reference/core/getGatewayById) - Get gateway by ID
40
- - [Mastra.listGateways()](https://mastra.ai/reference/core/listGateways) - List all gateways
41
- - [MastraModelGateway](https://mastra.ai/reference/core/mastra-model-gateway) - Gateway base class
42
- - [Custom Gateways Guide](https://mastra.ai/models/gateways/custom-gateways) - Creating custom gateways
38
+ - [Mastra.getGateway()](https://mastra.ai/reference/core/getGateway): Get gateway by registration key
39
+ - [Mastra.getGatewayById()](https://mastra.ai/reference/core/getGatewayById): Get gateway by ID
40
+ - [Mastra.listGateways()](https://mastra.ai/reference/core/listGateways): List all gateways
41
+ - [MastraModelGateway](https://mastra.ai/reference/core/mastra-model-gateway): Gateway base class
42
+ - [Custom Gateways Guide](https://mastra.ai/models/gateways/custom-gateways): Creating custom gateways
@@ -0,0 +1,35 @@
1
+ # Mastra.getEditor()
2
+
3
+ The `.getEditor()` method is used to retrieve the editor instance that has been configured on the Mastra instance. The editor exposes CRUD namespaces for managing stored agents, prompt blocks, MCP clients, scorers, skills, and workspaces programmatically.
4
+
5
+ ## Usage example
6
+
7
+ ```typescript
8
+ import { Mastra } from '@mastra/core'
9
+ import { MastraEditor } from '@mastra/editor'
10
+
11
+ const mastra = new Mastra({
12
+ editor: new MastraEditor(),
13
+ })
14
+
15
+ const editor = mastra.getEditor()
16
+
17
+ const agent = await editor?.agent.create({
18
+ id: 'support-agent',
19
+ name: 'Support Agent',
20
+ instructions: 'Help customers with their questions.',
21
+ })
22
+ ```
23
+
24
+ ## Parameters
25
+
26
+ This method doesn't accept any parameters.
27
+
28
+ ## Returns
29
+
30
+ **editor** (`MastraEditor | undefined`): The configured editor instance, or undefined if no editor has been configured.
31
+
32
+ ## Related
33
+
34
+ - [Editor overview](https://mastra.ai/docs/editor/overview)
35
+ - [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor)
@@ -31,8 +31,8 @@ Throws an error if no gateway is found with the specified key.
31
31
 
32
32
  ## Related
33
33
 
34
- - [Mastra.getGatewayById()](https://mastra.ai/reference/core/getGatewayById) - Get gateway by ID
35
- - [Mastra.listGateways()](https://mastra.ai/reference/core/listGateways) - List all gateways
36
- - [Mastra.addGateway()](https://mastra.ai/reference/core/addGateway) - Add a gateway
37
- - [MastraModelGateway](https://mastra.ai/reference/core/mastra-model-gateway) - Gateway base class
38
- - [Custom Gateways Guide](https://mastra.ai/models/gateways/custom-gateways) - Creating custom gateways
34
+ - [Mastra.getGatewayById()](https://mastra.ai/reference/core/getGatewayById): Get gateway by ID
35
+ - [Mastra.listGateways()](https://mastra.ai/reference/core/listGateways): List all gateways
36
+ - [Mastra.addGateway()](https://mastra.ai/reference/core/addGateway): Add a gateway
37
+ - [MastraModelGateway](https://mastra.ai/reference/core/mastra-model-gateway): Gateway base class
38
+ - [Custom Gateways Guide](https://mastra.ai/models/gateways/custom-gateways): Creating custom gateways
@@ -34,8 +34,8 @@ console.log(gateway.name) // 'My Custom Gateway'
34
34
 
35
35
  ## Related
36
36
 
37
- - [Mastra.getGateway()](https://mastra.ai/reference/core/getGateway) - Get gateway by registration key
38
- - [Mastra.listGateways()](https://mastra.ai/reference/core/listGateways) - List all gateways
39
- - [Mastra.addGateway()](https://mastra.ai/reference/core/addGateway) - Add a gateway
40
- - [MastraModelGateway](https://mastra.ai/reference/core/mastra-model-gateway) - Gateway base class
41
- - [Custom Gateways Guide](https://mastra.ai/models/gateways/custom-gateways) - Creating custom gateways
37
+ - [Mastra.getGateway()](https://mastra.ai/reference/core/getGateway): Get gateway by registration key
38
+ - [Mastra.listGateways()](https://mastra.ai/reference/core/listGateways): List all gateways
39
+ - [Mastra.addGateway()](https://mastra.ai/reference/core/addGateway): Add a gateway
40
+ - [MastraModelGateway](https://mastra.ai/reference/core/mastra-model-gateway): Gateway base class
41
+ - [Custom Gateways Guide](https://mastra.ai/models/gateways/custom-gateways): Creating custom gateways
@@ -38,8 +38,8 @@ const serverById = mastra.getMCPServerById('my-mcp-server')
38
38
 
39
39
  ## Related methods
40
40
 
41
- - [Mastra.getMCPServerById()](https://mastra.ai/reference/core/getMCPServerById) - Retrieve an MCP server by its intrinsic `id` property
42
- - [Mastra.listMCPServers()](https://mastra.ai/reference/core/listMCPServers) - List all registered MCP servers
41
+ - [Mastra.getMCPServerById()](https://mastra.ai/reference/core/getMCPServerById): Retrieve an MCP server by its intrinsic `id` property
42
+ - [Mastra.listMCPServers()](https://mastra.ai/reference/core/listMCPServers): List all registered MCP servers
43
43
 
44
44
  ## See also
45
45
 
@@ -46,8 +46,8 @@ const serverByKey = mastra.getMCPServer('customKey')
46
46
 
47
47
  ## Related methods
48
48
 
49
- - [Mastra.getMCPServer()](https://mastra.ai/reference/core/getMCPServer) - Retrieve an MCP server by its registry key
50
- - [Mastra.listMCPServers()](https://mastra.ai/reference/core/listMCPServers) - List all registered MCP servers
49
+ - [Mastra.getMCPServer()](https://mastra.ai/reference/core/getMCPServer): Retrieve an MCP server by its registry key
50
+ - [Mastra.listMCPServers()](https://mastra.ai/reference/core/listMCPServers): List all registered MCP servers
51
51
 
52
52
  ## See also
53
53
 
@@ -49,6 +49,6 @@ try {
49
49
 
50
50
  ## Related
51
51
 
52
- - [listScorers()](https://mastra.ai/reference/core/listScorers) - Get all registered scorers
53
- - [getScorerById()](https://mastra.ai/reference/core/getScorerById) - Get a scorer by its id property
54
- - [Custom Scorers](https://mastra.ai/docs/evals/custom-scorers) - Learn how to create custom scorers
52
+ - [listScorers()](https://mastra.ai/reference/core/listScorers): Get all registered scorers
53
+ - [getScorerById()](https://mastra.ai/reference/core/getScorerById): Get a scorer by its id property
54
+ - [Custom Scorers](https://mastra.ai/docs/evals/custom-scorers): Learn how to create custom scorers
@@ -49,6 +49,6 @@ try {
49
49
 
50
50
  ## Related
51
51
 
52
- - [getScorer()](https://mastra.ai/reference/core/getScorer) - Get a scorer by its registration key
53
- - [listScorers()](https://mastra.ai/reference/core/listScorers) - Get all registered scorers
54
- - [createScorer()](https://mastra.ai/reference/evals/create-scorer) - Learn how to create scorers with ids
52
+ - [getScorer()](https://mastra.ai/reference/core/getScorer): Get a scorer by its registration key
53
+ - [listScorers()](https://mastra.ai/reference/core/listScorers): Get all registered scorers
54
+ - [createScorer()](https://mastra.ai/reference/evals/create-scorer): Learn how to create scorers with ids
@@ -33,8 +33,8 @@ None.
33
33
 
34
34
  ## Related
35
35
 
36
- - [Mastra.getGateway()](https://mastra.ai/reference/core/getGateway) - Get gateway by registration key
37
- - [Mastra.getGatewayById()](https://mastra.ai/reference/core/getGatewayById) - Get gateway by ID
38
- - [Mastra.addGateway()](https://mastra.ai/reference/core/addGateway) - Add a gateway
39
- - [MastraModelGateway](https://mastra.ai/reference/core/mastra-model-gateway) - Gateway base class
40
- - [Custom Gateways Guide](https://mastra.ai/models/gateways/custom-gateways) - Creating custom gateways
36
+ - [Mastra.getGateway()](https://mastra.ai/reference/core/getGateway): Get gateway by registration key
37
+ - [Mastra.getGatewayById()](https://mastra.ai/reference/core/getGatewayById): Get gateway by ID
38
+ - [Mastra.addGateway()](https://mastra.ai/reference/core/addGateway): Add a gateway
39
+ - [MastraModelGateway](https://mastra.ai/reference/core/mastra-model-gateway): Gateway base class
40
+ - [Custom Gateways Guide](https://mastra.ai/models/gateways/custom-gateways): Creating custom gateways
@@ -46,8 +46,8 @@ This method doesn't accept any parameters.
46
46
 
47
47
  ## Related methods
48
48
 
49
- - [Mastra.getMCPServer()](https://mastra.ai/reference/core/getMCPServer) - Retrieve an MCP server by its registry key
50
- - [Mastra.getMCPServerById()](https://mastra.ai/reference/core/getMCPServerById) - Retrieve an MCP server by its intrinsic `id` property
49
+ - [Mastra.getMCPServer()](https://mastra.ai/reference/core/getMCPServer): Retrieve an MCP server by its registry key
50
+ - [Mastra.getMCPServerById()](https://mastra.ai/reference/core/getMCPServerById): Retrieve an MCP server by its intrinsic `id` property
51
51
 
52
52
  ## See also
53
53
 
@@ -24,6 +24,6 @@ This method takes no parameters.
24
24
 
25
25
  ## Related
26
26
 
27
- - [getScorer()](https://mastra.ai/reference/core/getScorer) - Get a specific scorer by key
28
- - [getScorerById()](https://mastra.ai/reference/core/getScorerById) - Get a scorer by its id property
29
- - [Scorers Overview](https://mastra.ai/docs/evals/overview) - Learn about creating and using scorers
27
+ - [getScorer()](https://mastra.ai/reference/core/getScorer): Get a specific scorer by key
28
+ - [getScorerById()](https://mastra.ai/reference/core/getScorerById): Get a scorer by its id property
29
+ - [Scorers Overview](https://mastra.ai/docs/evals/overview): Learn about creating and using scorers
@@ -49,6 +49,8 @@ Visit the [Configuration reference](https://mastra.ai/reference/configuration) f
49
49
 
50
50
  **observability** (`ObservabilityEntrypoint`): Observability configuration for tracing and monitoring
51
51
 
52
+ **environment** (`string`): Deployment environment name (e.g. \`production\`, \`staging\`, \`development\`). When set, automatically attached to all observability signals so they can be filtered by environment without passing \`tracingOptions.metadata.environment\` on each call. Falls back to \`process.env.NODE\_ENV\` when unset; left undefined if neither is set. Per-call \`tracingOptions.metadata.environment\` always takes precedence.
53
+
52
54
  **deployer** (`MastraDeployer`): An instance of a MastraDeployer for managing deployments.
53
55
 
54
56
  **server** (`ServerConfig`): Server configuration including port, host, timeout, API routes, middleware, CORS settings, and build options for Swagger UI, API request logging, and OpenAPI docs.
@@ -63,4 +65,12 @@ Visit the [Configuration reference](https://mastra.ai/reference/configuration) f
63
65
 
64
66
  **gateways** (`Record<string, MastraModelGateway>`): Custom model gateways to register for accessing AI models through alternative providers or private deployments. Structured as a key-value pair, with keys being the registry key (used for getGateway()) and values being gateway instances. (Default: `{}`)
65
67
 
66
- **memory** (`Record<string, MastraMemory>`): Memory instances to register. These can be referenced by stored agents and resolved at runtime. Structured as a key-value pair, with keys being the registry key and values being memory instances. (Default: `{}`)
68
+ **memory** (`Record<string, MastraMemory>`): Memory instances to register. These can be referenced by stored agents and resolved at runtime. Structured as a key-value pair, with keys being the registry key and values being memory instances. (Default: `{}`)
69
+
70
+ **versions** (`VersionOverrides`): Global version overrides for sub-agent delegation. When a supervisor agent delegates to a sub-agent, these overrides determine which stored version of that sub-agent to use instead of the code-defined default. Requires the editor package to be configured. See \[Sub-agent versioning]\(/docs/editor/overview#sub-agent-versioning) for details.
71
+
72
+ **versions.agents** (`Record<string, VersionSelector>`): A map of agent IDs to their version selectors. Each selector can target a specific version by ID or by publication status.
73
+
74
+ **versions.agents.versionId** (`string`): The ID of a specific version to use.
75
+
76
+ **versions.agents.status** (`'draft' | 'published'`): Select the latest version with this publication status.
@@ -148,8 +148,8 @@ Examples:
148
148
 
149
149
  ## Related
150
150
 
151
- - [Custom Gateways Guide](https://mastra.ai/models/gateways/custom-gateways) - Complete guide to creating custom gateways
152
- - [Mastra.addGateway()](https://mastra.ai/reference/core/addGateway) - Add a gateway to Mastra
153
- - [Mastra.getGateway()](https://mastra.ai/reference/core/getGateway) - Get gateway by registration key
154
- - [Mastra.getGatewayById()](https://mastra.ai/reference/core/getGatewayById) - Get gateway by ID
155
- - [Mastra.listGateways()](https://mastra.ai/reference/core/listGateways) - List all gateways
151
+ - [Custom Gateways Guide](https://mastra.ai/models/gateways/custom-gateways): Complete guide to creating custom gateways
152
+ - [Mastra.addGateway()](https://mastra.ai/reference/core/addGateway): Add a gateway to Mastra
153
+ - [Mastra.getGateway()](https://mastra.ai/reference/core/getGateway): Get gateway by registration key
154
+ - [Mastra.getGatewayById()](https://mastra.ai/reference/core/getGatewayById): Get gateway by ID
155
+ - [Mastra.listGateways()](https://mastra.ai/reference/core/listGateways): List all gateways
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Added in:** `@mastra/core@1.4.0`
4
4
 
5
- Creates a new dataset. Zod schemas passed as `inputSchema` or `groundTruthSchema` are automatically converted to JSON Schema.
5
+ Creates a new dataset. Use Standard JSON Schema (Zod, Valibot, ArkType, etc.) for defining schemas.
6
6
 
7
7
  ## Usage example
8
8
 
@@ -21,7 +21,7 @@ const dataset = await mastra.datasets.create({
21
21
  metadata: { team: 'ml' },
22
22
  })
23
23
 
24
- // Create with Zod schemas
24
+ // Create with Zod schema (library that supports Standard JSON Schema)
25
25
  const typedDataset = await mastra.datasets.create({
26
26
  name: 'Typed QA set',
27
27
  inputSchema: z.object({
@@ -40,9 +40,9 @@ const typedDataset = await mastra.datasets.create({
40
40
 
41
41
  **description** (`string`): Description of the dataset.
42
42
 
43
- **inputSchema** (`unknown`): JSON Schema or Zod schema for item inputs. Zod schemas are auto-converted.
43
+ **inputSchema** (`StandardJSONSchemaV1`): Standard JSON Schema for item inputs.
44
44
 
45
- **groundTruthSchema** (`unknown`): JSON Schema or Zod schema for item ground truths. Zod schemas are auto-converted.
45
+ **groundTruthSchema** (`StandardJSONSchemaV1`): Standard JSON Schema for item ground truths.
46
46
 
47
47
  **metadata** (`Record<string, unknown>`): Arbitrary metadata.
48
48