@mastra/core 1.86.0-alpha.7 → 1.86.0-alpha.8

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 (419) hide show
  1. package/dist/agent/agent.d.ts +60 -1
  2. package/dist/agent/agent.types.d.ts +30 -2
  3. package/dist/agent/durable/create-evented-agent.d.ts +6 -0
  4. package/dist/agent/durable/durable-agent.d.ts +1 -15
  5. package/dist/agent/durable/index.cjs +7 -14
  6. package/dist/agent/durable/index.js +7 -14
  7. package/dist/agent/index.cjs +2 -2
  8. package/dist/agent/index.js +2 -2
  9. package/dist/agent/types.d.ts +25 -0
  10. package/dist/agent-builder/ee/index.cjs +1 -1
  11. package/dist/agent-builder/ee/index.js +1 -1
  12. package/dist/agent-controller/index.cjs +1 -1
  13. package/dist/agent-controller/index.js +1 -1
  14. package/dist/{agent-controller-Cf3_IuY8.js → agent-controller-B7POPub5.js} +7 -7
  15. package/dist/{agent-controller-K5vHtqfO.cjs → agent-controller-DEPayioq.cjs} +7 -7
  16. package/dist/background-tasks/index.cjs +1 -1
  17. package/dist/background-tasks/index.js +1 -1
  18. package/dist/{background-tasks-DqnQMfuf.cjs → background-tasks-7iftnRK_.cjs} +1 -1
  19. package/dist/{background-tasks-BgpX1P_s.js → background-tasks-Cv1ecD6S.js} +1 -1
  20. package/dist/browser/index.cjs +2 -2
  21. package/dist/browser/index.js +2 -2
  22. package/dist/{builder-D8Osghdo.cjs → builder-DuJBbQDH.cjs} +2 -2
  23. package/dist/{builder-x295GDL6.js → builder-Gg-xnX_E.js} +2 -2
  24. package/dist/capabilities/302ai.json +194 -194
  25. package/dist/capabilities/abliteratedllm.json +32 -32
  26. package/dist/capabilities/abliteration-ai.json +11 -11
  27. package/dist/capabilities/above.json +12 -12
  28. package/dist/capabilities/adaption.json +13 -13
  29. package/dist/capabilities/adzuki.json +32 -32
  30. package/dist/capabilities/agentrouter.json +6 -6
  31. package/dist/capabilities/agnes.json +2 -2
  32. package/dist/capabilities/ai-router.json +5 -5
  33. package/dist/capabilities/aiand.json +23 -23
  34. package/dist/capabilities/aigrow.json +11 -11
  35. package/dist/capabilities/aimlapi.json +144 -144
  36. package/dist/capabilities/aixy.json +21 -21
  37. package/dist/capabilities/aki-io.json +15 -15
  38. package/dist/capabilities/alibaba-cn.json +79 -79
  39. package/dist/capabilities/alibaba-coding-plan-cn.json +2 -2
  40. package/dist/capabilities/alibaba-coding-plan.json +2 -2
  41. package/dist/capabilities/alibaba-token-plan-cn.json +52 -52
  42. package/dist/capabilities/alibaba-token-plan.json +53 -53
  43. package/dist/capabilities/alibaba.json +70 -70
  44. package/dist/capabilities/ambient.json +15 -15
  45. package/dist/capabilities/amd.json +9 -9
  46. package/dist/capabilities/anthropic.json +48 -48
  47. package/dist/capabilities/anyapi.json +12 -12
  48. package/dist/capabilities/apiko.json +4 -4
  49. package/dist/capabilities/arcee.json +10 -10
  50. package/dist/capabilities/augure.json +6 -6
  51. package/dist/capabilities/auriko.json +18 -18
  52. package/dist/capabilities/bailing.json +5 -5
  53. package/dist/capabilities/baseten.json +26 -26
  54. package/dist/capabilities/bee.json +4 -4
  55. package/dist/capabilities/berget.json +6 -6
  56. package/dist/capabilities/bothub.json +14 -14
  57. package/dist/capabilities/boundless.json +41 -41
  58. package/dist/capabilities/bumo.json +39 -39
  59. package/dist/capabilities/byteplus.json +34 -34
  60. package/dist/capabilities/cheapaimodel.json +7 -7
  61. package/dist/capabilities/cheapest-token.json +33 -33
  62. package/dist/capabilities/chutes.json +10 -10
  63. package/dist/capabilities/cline-pass.json +35 -35
  64. package/dist/capabilities/cloudcode.json +8 -8
  65. package/dist/capabilities/cloudferro-sherlock.json +4 -4
  66. package/dist/capabilities/cloudflare-workers-ai.json +31 -31
  67. package/dist/capabilities/commandcode.json +148 -148
  68. package/dist/capabilities/concentrate.json +277 -253
  69. package/dist/capabilities/cortecs.json +113 -113
  70. package/dist/capabilities/crossmodel.json +172 -172
  71. package/dist/capabilities/crusoe.json +9 -9
  72. package/dist/capabilities/daoxe.json +8 -8
  73. package/dist/capabilities/databricks.json +54 -54
  74. package/dist/capabilities/deepinfra.json +95 -86
  75. package/dist/capabilities/deepseek.json +3 -3
  76. package/dist/capabilities/digitalocean.json +117 -117
  77. package/dist/capabilities/dothoosh.json +35 -35
  78. package/dist/capabilities/doubleword.json +29 -29
  79. package/dist/capabilities/edenai.json +456 -456
  80. package/dist/capabilities/empiriolabs.json +174 -174
  81. package/dist/capabilities/engy.json +20 -20
  82. package/dist/capabilities/entrim.json +6 -6
  83. package/dist/capabilities/evroc.json +10 -10
  84. package/dist/capabilities/ezkielyna.json +10 -10
  85. package/dist/capabilities/fastrouter.json +77 -77
  86. package/dist/capabilities/fireworks-ai.json +60 -60
  87. package/dist/capabilities/freemodel.json +17 -17
  88. package/dist/capabilities/frogbot.json +93 -93
  89. package/dist/capabilities/gisoo.json +19 -19
  90. package/dist/capabilities/gmicloud.json +19 -19
  91. package/dist/capabilities/google.json +59 -59
  92. package/dist/capabilities/graphn.json +9 -9
  93. package/dist/capabilities/greenpt.json +34 -34
  94. package/dist/capabilities/groq.json +8 -8
  95. package/dist/capabilities/helicone.json +83 -83
  96. package/dist/capabilities/hopper.json +2 -2
  97. package/dist/capabilities/hostinger-router.json +9 -9
  98. package/dist/capabilities/hpc-ai.json +11 -11
  99. package/dist/capabilities/huawei-maas.json +13 -13
  100. package/dist/capabilities/hubris.json +33 -33
  101. package/dist/capabilities/huggingface.json +60 -51
  102. package/dist/capabilities/humain.json +2 -2
  103. package/dist/capabilities/hyper.json +27 -27
  104. package/dist/capabilities/impossibl.json +118 -118
  105. package/dist/capabilities/inception.json +3 -3
  106. package/dist/capabilities/inceptron.json +8 -8
  107. package/dist/capabilities/inco.json +4 -4
  108. package/dist/capabilities/infer.json +15 -15
  109. package/dist/capabilities/inferall.json +10 -10
  110. package/dist/capabilities/inference-coop.json +12 -12
  111. package/dist/capabilities/inferenceapis.json +20 -20
  112. package/dist/capabilities/inferris.json +4 -4
  113. package/dist/capabilities/infersia.json +8 -8
  114. package/dist/capabilities/inferx.json +3 -3
  115. package/dist/capabilities/infomaniak.json +4 -4
  116. package/dist/capabilities/io-net.json +4 -4
  117. package/dist/capabilities/iteracompute.json +63 -63
  118. package/dist/capabilities/jad-ai.json +3 -3
  119. package/dist/capabilities/jalapeno.json +11 -11
  120. package/dist/capabilities/jiekou.json +63 -63
  121. package/dist/capabilities/joingonka.json +4 -4
  122. package/dist/capabilities/jzstoken.json +52 -52
  123. package/dist/capabilities/keln.json +26 -26
  124. package/dist/capabilities/kenari.json +127 -127
  125. package/dist/capabilities/kilo.json +604 -628
  126. package/dist/capabilities/kimi-code-plan-cn.json +4 -4
  127. package/dist/capabilities/kimi-code-plan-global.json +4 -4
  128. package/dist/capabilities/kitani.json +6 -6
  129. package/dist/capabilities/klavo.json +26 -26
  130. package/dist/capabilities/korouter.json +34 -34
  131. package/dist/capabilities/kunavo.json +4 -4
  132. package/dist/capabilities/liquid.json +10 -10
  133. package/dist/capabilities/lithosai.json +2 -2
  134. package/dist/capabilities/llmgateway-providers.json +934 -907
  135. package/dist/capabilities/llmgateway.json +339 -339
  136. package/dist/capabilities/llmtr.json +27 -27
  137. package/dist/capabilities/longcat.json +2 -2
  138. package/dist/capabilities/lowrouter.json +53 -53
  139. package/dist/capabilities/lyceum.json +8 -8
  140. package/dist/capabilities/melious.json +13 -13
  141. package/dist/capabilities/merge-gateway.json +284 -284
  142. package/dist/capabilities/meta.json +11 -11
  143. package/dist/capabilities/minimax-cn-coding-plan.json +6 -6
  144. package/dist/capabilities/minimax-coding-plan.json +6 -6
  145. package/dist/capabilities/mistral.json +22 -22
  146. package/dist/capabilities/mixlayer.json +3 -3
  147. package/dist/capabilities/modal.json +13 -13
  148. package/dist/capabilities/model-oracle-ai.json +23 -23
  149. package/dist/capabilities/modelis.json +21 -21
  150. package/dist/capabilities/modelscope.json +2 -2
  151. package/dist/capabilities/modular.json +10 -10
  152. package/dist/capabilities/moneo.json +14 -14
  153. package/dist/capabilities/moonshotai-cn.json +7 -7
  154. package/dist/capabilities/moonshotai.json +7 -7
  155. package/dist/capabilities/morph.json +15 -15
  156. package/dist/capabilities/munito-eu.json +8 -8
  157. package/dist/capabilities/munito.json +10 -10
  158. package/dist/capabilities/nan.json +25 -25
  159. package/dist/capabilities/nano-gpt.json +570 -570
  160. package/dist/capabilities/nearai.json +87 -87
  161. package/dist/capabilities/nebius.json +41 -32
  162. package/dist/capabilities/neon.json +132 -132
  163. package/dist/capabilities/neuralwatt.json +38 -38
  164. package/dist/capabilities/novita-ai.json +153 -153
  165. package/dist/capabilities/nvidia.json +28 -28
  166. package/dist/capabilities/obscurify.json +33 -33
  167. package/dist/capabilities/oci.json +6 -6
  168. package/dist/capabilities/ofox.json +322 -322
  169. package/dist/capabilities/ollama-cloud.json +52 -52
  170. package/dist/capabilities/openai.json +47 -47
  171. package/dist/capabilities/opencode-go.json +79 -78
  172. package/dist/capabilities/openreason.json +5 -5
  173. package/dist/capabilities/openrouter.json +520 -530
  174. package/dist/capabilities/opper.json +30 -24
  175. package/dist/capabilities/orcarouter.json +227 -227
  176. package/dist/capabilities/outerlabs.json +28 -28
  177. package/dist/capabilities/ovhcloud.json +8 -8
  178. package/dist/capabilities/pareto.json +5 -5
  179. package/dist/capabilities/perplexity-agent.json +64 -64
  180. package/dist/capabilities/perplexity.json +2 -2
  181. package/dist/capabilities/phala.json +36 -36
  182. package/dist/capabilities/pioneer.json +30 -30
  183. package/dist/capabilities/poe.json +109 -109
  184. package/dist/capabilities/powerspring.json +10 -10
  185. package/dist/capabilities/primalabs.json +10 -10
  186. package/dist/capabilities/prime.json +116 -99
  187. package/dist/capabilities/privatemode-ai.json +10 -10
  188. package/dist/capabilities/proxystacks.json +7 -7
  189. package/dist/capabilities/qiniu-ai.json +12 -12
  190. package/dist/capabilities/refuseless.json +8 -8
  191. package/dist/capabilities/regolo-ai.json +8 -8
  192. package/dist/capabilities/requesty.json +172 -172
  193. package/dist/capabilities/ruapi.json +21 -21
  194. package/dist/capabilities/runcrate.json +15 -15
  195. package/dist/capabilities/runinfra.json +20 -20
  196. package/dist/capabilities/sakana.json +7 -7
  197. package/dist/capabilities/sambanova.json +4 -4
  198. package/dist/capabilities/sandbase.json +30 -30
  199. package/dist/capabilities/sarvam.json +5 -5
  200. package/dist/capabilities/scaleway.json +17 -17
  201. package/dist/capabilities/scnet-token-plan.json +8 -8
  202. package/dist/capabilities/scx-ai.json +26 -26
  203. package/dist/capabilities/sensenova.json +7 -7
  204. package/dist/capabilities/siliconflow-cn.json +45 -45
  205. package/dist/capabilities/siliconflow.json +59 -59
  206. package/dist/capabilities/snowflake-cortex.json +25 -25
  207. package/dist/capabilities/sokkan.json +9 -9
  208. package/dist/capabilities/sparrowcodes.json +23 -23
  209. package/dist/capabilities/standardcompute.json +103 -103
  210. package/dist/capabilities/steadyrouter.json +39 -39
  211. package/dist/capabilities/stepfun-ai-step-plan.json +6 -6
  212. package/dist/capabilities/stepfun-ai.json +6 -6
  213. package/dist/capabilities/stepfun-step-plan.json +6 -6
  214. package/dist/capabilities/stepfun.json +6 -6
  215. package/dist/capabilities/stepping-stone.json +13 -13
  216. package/dist/capabilities/subconscious.json +2 -2
  217. package/dist/capabilities/synthetic.json +11 -11
  218. package/dist/capabilities/synthorai.json +27 -27
  219. package/dist/capabilities/teamorouter.json +30 -30
  220. package/dist/capabilities/teapot-router.json +13 -13
  221. package/dist/capabilities/tencent-token-plan.json +24 -24
  222. package/dist/capabilities/tencent-tokenhub.json +9 -9
  223. package/dist/capabilities/tensorx.json +45 -45
  224. package/dist/capabilities/tenstorrent.json +6 -6
  225. package/dist/capabilities/the-grid-ai.json +24 -24
  226. package/dist/capabilities/thinkingmachines.json +59 -59
  227. package/dist/capabilities/tinfoil.json +14 -14
  228. package/dist/capabilities/toapis.json +2 -2
  229. package/dist/capabilities/togetherai.json +53 -53
  230. package/dist/capabilities/tokengo.json +25 -25
  231. package/dist/capabilities/tokenify.json +10 -10
  232. package/dist/capabilities/trustedrouter.json +7 -7
  233. package/dist/capabilities/trustedtokens.json +16 -16
  234. package/dist/capabilities/umans-ai-coding-plan.json +15 -15
  235. package/dist/capabilities/umans-ai.json +8 -8
  236. package/dist/capabilities/uncensuredai.json +4 -4
  237. package/dist/capabilities/unrestricted.json +4 -4
  238. package/dist/capabilities/uplinkswitch.json +20 -20
  239. package/dist/capabilities/upstage.json +6 -6
  240. package/dist/capabilities/vancine.json +22 -22
  241. package/dist/capabilities/vercel.json +569 -577
  242. package/dist/capabilities/vivgrid.json +80 -80
  243. package/dist/capabilities/volcengine-coding-plan.json +26 -26
  244. package/dist/capabilities/volcengine.json +30 -30
  245. package/dist/capabilities/vultr.json +25 -25
  246. package/dist/capabilities/wafer.ai.json +18 -18
  247. package/dist/capabilities/wallaby.json +5 -5
  248. package/dist/capabilities/wally.json +8 -8
  249. package/dist/capabilities/wandb.json +20 -20
  250. package/dist/capabilities/watt.json +20 -20
  251. package/dist/capabilities/xai.json +6 -6
  252. package/dist/capabilities/xiaomi.json +5 -5
  253. package/dist/capabilities/xpersona.json +12 -12
  254. package/dist/capabilities/xxapi.json +33 -33
  255. package/dist/capabilities/zai-coding-plan.json +9 -9
  256. package/dist/capabilities/zai.json +27 -27
  257. package/dist/capabilities/zenifra.json +23 -23
  258. package/dist/capabilities/zenmux.json +192 -192
  259. package/dist/capabilities/zerogpu.json +10 -10
  260. package/dist/capabilities/zhipuai-coding-plan.json +7 -7
  261. package/dist/capabilities/zhipuai.json +26 -26
  262. package/dist/capabilities/zro.json +6 -6
  263. package/dist/channels/index.cjs +2 -2
  264. package/dist/channels/index.js +2 -2
  265. package/dist/{channels-Dx4jiXeK.js → channels-BRVCOutx.js} +1 -1
  266. package/dist/{channels-q6qnuRNV.cjs → channels-MjTA9bFp.cjs} +1 -1
  267. package/dist/coding-agent/index.cjs +2 -2
  268. package/dist/coding-agent/index.js +2 -2
  269. package/dist/datasets/dataset.d.ts +13 -6
  270. package/dist/datasets/experiment/durable.d.ts +16 -0
  271. package/dist/datasets/experiment/index.d.ts +2 -1
  272. package/dist/datasets/experiment/item.d.ts +26 -4
  273. package/dist/datasets/experiment/retries.d.ts +18 -0
  274. package/dist/datasets/experiment/types.d.ts +18 -0
  275. package/dist/datasets/experiment/workflow-id.d.ts +7 -0
  276. package/dist/datasets/experiment/workflow.d.ts +74 -0
  277. package/dist/datasets/index.cjs +3 -2
  278. package/dist/datasets/index.d.ts +2 -1
  279. package/dist/datasets/index.js +3 -3
  280. package/dist/docs/SKILL.md +2 -2
  281. package/dist/docs/assets/SOURCE_MAP.json +790 -790
  282. package/dist/docs/references/docs-deployment-workers.md +1 -1
  283. package/dist/docs/references/docs-evals-experiments.md +29 -1
  284. package/dist/docs/references/docs-harness-durable-agents.md +9 -5
  285. package/dist/docs/references/docs-knowledge-agents-and-tools.md +1 -0
  286. package/dist/docs/references/docs-knowledge-load-your-content.md +1 -1
  287. package/dist/docs/references/docs-mastra-platform-observability-overview.md +1 -1
  288. package/dist/docs/references/docs-server-pubsub.md +51 -8
  289. package/dist/docs/references/docs-signals-running-across-processes.md +2 -0
  290. package/dist/docs/references/docs-workflows-overview.md +1 -1
  291. package/dist/docs/references/docs-workflows-scheduled-workflows.md +1 -1
  292. package/dist/docs/references/integrations-channels-slack.md +4 -2
  293. package/dist/docs/references/integrations.md +6 -0
  294. package/dist/docs/references/reference-agents-agent.md +2 -0
  295. package/dist/docs/references/reference-agents-channels.md +116 -27
  296. package/dist/docs/references/reference-agents-durable-agent.md +2 -0
  297. package/dist/docs/references/reference-datasets-runExperimentItem.md +13 -1
  298. package/dist/docs/references/reference-datasets-startExperimentAsync.md +3 -1
  299. package/dist/docs/references/reference-editor-mastra-editor.md +3 -1
  300. package/dist/docs/references/reference-knowledge-knowledge-class.md +2 -2
  301. package/dist/docs/references/reference-knowledge-knowledge-tools.md +43 -20
  302. package/dist/docs/references/reference-processors-moderation-processor.md +2 -2
  303. package/dist/docs/references/reference-pubsub-base.md +5 -1
  304. package/dist/docs/references/reference-pubsub-event-emitter.md +2 -0
  305. package/dist/docs/references/reference-pubsub-redis-streams.md +1 -1
  306. package/dist/docs/references/reference-pubsub-unix-socket-pubsub.md +2 -0
  307. package/dist/docs/references/reference-streaming-ChunkType.md +1 -1
  308. package/dist/docs/references/reference-workers-overview.md +1 -1
  309. package/dist/docs/references/reference-workflows-run-methods-start.md +23 -0
  310. package/dist/docs/references/reference-workflows-run-methods-timeTravel.md +4 -0
  311. package/dist/docs/references/reference-workflows-run.md +1 -1
  312. package/dist/evals/index.cjs +1 -1
  313. package/dist/evals/index.js +1 -1
  314. package/dist/evals/scoreTraces/index.cjs +1 -1
  315. package/dist/evals/scoreTraces/index.js +1 -1
  316. package/dist/events/caching-pubsub.d.ts +1 -0
  317. package/dist/events/event-emitter/index.d.ts +12 -5
  318. package/dist/events/index.cjs +15 -1
  319. package/dist/events/index.js +15 -1
  320. package/dist/events/pubsub.d.ts +29 -0
  321. package/dist/events/reach.d.ts +11 -0
  322. package/dist/events/unix-socket-pubsub.d.ts +14 -0
  323. package/dist/harness/index.cjs +1 -1
  324. package/dist/harness/index.js +1 -1
  325. package/dist/index.cjs +1 -1
  326. package/dist/index.js +1 -1
  327. package/dist/knowledge/index.cjs +1 -1
  328. package/dist/knowledge/index.js +1 -1
  329. package/dist/llm/index.cjs +3 -3
  330. package/dist/llm/index.js +3 -3
  331. package/dist/llm/model/provider-types.generated.d.ts +8092 -8089
  332. package/dist/llm/model/shared.types.d.ts +31 -0
  333. package/dist/{llm-DnXK3Pmw.js → llm-Djd8Qzi0.js} +2 -2
  334. package/dist/{llm-CsQuqKPc.cjs → llm-DmUucguC.cjs} +2 -2
  335. package/dist/loop/index.cjs +2 -2
  336. package/dist/loop/index.js +2 -2
  337. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +2 -2
  338. package/dist/{manager-BsghM-UL.js → manager-CO_Xz2zR.js} +460 -94
  339. package/dist/{manager-DwFnIrI6.cjs → manager-D27PkIPo.cjs} +476 -92
  340. package/dist/mastra/index.cjs +1 -1
  341. package/dist/mastra/index.d.ts +13 -0
  342. package/dist/mastra/index.js +1 -1
  343. package/dist/{mastra-B8i1UDZs.js → mastra-Ch00nEAJ.js} +31 -16
  344. package/dist/{mastra-Cn5NC6Es.cjs → mastra-qsVWpOTi.cjs} +31 -16
  345. package/dist/memory/index.cjs +2 -2
  346. package/dist/memory/index.js +2 -2
  347. package/dist/{model-CsOcWMUt.js → model-CW-mfGYA.js} +1 -1
  348. package/dist/{model-CNPfry_X.cjs → model-Do6DTJoj.cjs} +1 -1
  349. package/dist/{netlify-C-83Fxus.cjs → netlify-DU32SDT6.cjs} +1 -1
  350. package/dist/{netlify-C-OpNSGp.js → netlify-DZSAbdve.js} +1 -1
  351. package/dist/notifications/index.cjs +1 -1
  352. package/dist/notifications/index.js +1 -1
  353. package/dist/{output-helpers-JL-HeCbT.cjs → output-helpers-1Zu4Vt9C.cjs} +68 -25
  354. package/dist/{output-helpers-D4II19No.js → output-helpers-CedRCE17.js} +69 -26
  355. package/dist/processor-provider/index.cjs +1 -1
  356. package/dist/processor-provider/index.js +1 -1
  357. package/dist/processors/index.cjs +2 -2
  358. package/dist/processors/index.js +2 -2
  359. package/dist/{provider-registry-RZ8EgSe8.js → provider-registry-deA0x-Gd.js} +22467 -22456
  360. package/dist/{provider-registry-9O-H9osy.cjs → provider-registry-zGezZVsL.cjs} +22467 -22456
  361. package/dist/provider-registry.json +22423 -22408
  362. package/dist/{registry-generator-DxCX-FiO.cjs → registry-generator-BkQ1AxZn.cjs} +1 -1
  363. package/dist/{registry-generator-e8sltJls.js → registry-generator-VvBfOKAD.js} +1 -1
  364. package/dist/{rehydrate-D3fPgJwp.js → rehydrate-BjLV643n.js} +2 -2
  365. package/dist/{rehydrate-B-wrAN7C.cjs → rehydrate-DDYFpQsV.cjs} +2 -2
  366. package/dist/relevance/index.cjs +2 -2
  367. package/dist/relevance/index.js +2 -2
  368. package/dist/{run-registry-5_LQBGn_.cjs → run-registry-5Suldxz3.cjs} +519 -71
  369. package/dist/{run-registry-DC03XLeZ.js → run-registry-CGRPldLH.js} +519 -71
  370. package/dist/storage/domains/knowledge/base.d.ts +5 -0
  371. package/dist/storage/domains/knowledge/inmemory.d.ts +1 -0
  372. package/dist/storage/domains/knowledge/pages.d.ts +24 -7
  373. package/dist/storage/index.cjs +2 -2
  374. package/dist/storage/index.js +2 -2
  375. package/dist/stream/base/output.d.ts +42 -15
  376. package/dist/stream/index.cjs +2 -2
  377. package/dist/stream/index.js +2 -2
  378. package/dist/stream/types.d.ts +19 -0
  379. package/dist/{stream-CJUm6EAH.js → stream-Dpwx0whf.js} +1 -1
  380. package/dist/{stream-4aNIw_TQ.cjs → stream-Dvy_0o14.cjs} +1 -1
  381. package/dist/test-utils/llm-mock.cjs +1 -1
  382. package/dist/test-utils/llm-mock.js +1 -1
  383. package/dist/tool-loop-agent/index.cjs +1 -1
  384. package/dist/tool-loop-agent/index.js +1 -1
  385. package/dist/{tool-loop-agent-FEEwHfmg.js → tool-loop-agent-PbWrEj1k.js} +3 -3
  386. package/dist/{tool-loop-agent-Dn0QCB9n.cjs → tool-loop-agent-UxOv3FoK.cjs} +3 -3
  387. package/dist/tools/types.d.ts +27 -1
  388. package/dist/{utils-DY01hxVd.cjs → utils-BbMTlyBO.cjs} +1 -1
  389. package/dist/{utils-Bd_y1_a-.js → utils-BnNi1BYM.js} +1 -1
  390. package/dist/utils.cjs +1 -1
  391. package/dist/utils.js +1 -1
  392. package/dist/{validate-CX0yQo_q.js → validate-HSBcm96b.js} +1 -1
  393. package/dist/{validate-CuB_1Zd3.cjs → validate-Skps-cM3.cjs} +1 -1
  394. package/dist/vector/index.cjs +1 -1
  395. package/dist/vector/index.js +1 -1
  396. package/dist/worker/index.cjs +1 -1
  397. package/dist/worker/index.js +1 -1
  398. package/dist/{worker-GsGIxPMa.cjs → worker-BE-0DyKL.cjs} +2 -2
  399. package/dist/{worker-DSEfMPmq.js → worker-BKrKHZzU.js} +2 -2
  400. package/dist/{worker-CbaSmip-.cjs → worker-BNS5A3qP.cjs} +2 -2
  401. package/dist/{worker-B80xkcKG.js → worker-DehaD4qD.js} +2 -2
  402. package/dist/{workflow-CnBPXTpv.cjs → workflow-BjUTwaK9.cjs} +4 -4
  403. package/dist/{workflow-CZHY_C85.js → workflow-Bvw6yDjc.js} +4 -4
  404. package/dist/workflows/builder/index.cjs +1 -1
  405. package/dist/workflows/builder/index.js +1 -1
  406. package/dist/workflows/evented/index.cjs +1 -1
  407. package/dist/workflows/evented/index.js +1 -1
  408. package/dist/workflows/evented/setup-warning.d.ts +18 -0
  409. package/dist/workflows/evented/workflow-event-processor/run-status.d.ts +37 -0
  410. package/dist/workflows/evented/workflow.d.ts +10 -0
  411. package/dist/workflows/index.cjs +4 -4
  412. package/dist/workflows/index.js +4 -4
  413. package/dist/workflows/workflow.d.ts +6 -1
  414. package/dist/workspace/index.cjs +1 -1
  415. package/dist/workspace/index.js +1 -1
  416. package/dist/{workspace-D7TIleIt.js → workspace-C05xDH60.js} +160 -7
  417. package/dist/{workspace-D2drutNg.cjs → workspace-D1OzzlLw.cjs} +160 -7
  418. package/package.json +6 -6
  419. package/src/llm/model/provider-types.generated.d.ts +8092 -8089
@@ -83,7 +83,7 @@ The server generated by `mastra build` starts these workers automatically. If yo
83
83
 
84
84
  This setup needs no external infrastructure beyond your storage adapter. It doesn't survive process crashes, and you can't scale individual components.
85
85
 
86
- > **Warning:** The in-memory PubSub delivers events only inside the process that published them. Running several Mastra instances on one storage with it isn't supported for evented workflows: each instance restarts the others' active runs when it boots. Configure a distributed PubSub backend for a multi-instance deployment.
86
+ > **Warning:** The in-memory PubSub delivers events only inside the process that published them. Running several Mastra instances on one storage with it isn't supported for evented workflows or agents. Each instance restarts the others' active evented workflow runs when it boots. A multi-instance deployment needs a PubSub backend that redelivers unacknowledged events and a storage adapter with workflow step guards. See [evented workflows and agents](https://mastra.ai/docs/server/pubsub).
87
87
 
88
88
  ### Split processes
89
89
 
@@ -487,6 +487,34 @@ while (experiment.status === 'pending' || experiment.status === 'running') {
487
487
  console.log(experiment.status) // 'completed' | 'failed'
488
488
  ```
489
489
 
490
+ ### Durable experiments
491
+
492
+ By default, `startExperimentAsync()` runs the experiment inside the process that started it. If that process stops or redeploys, the experiment stays `running`. Pass `durable: true` to run it as an [evented workflow](https://mastra.ai/docs/deployment/workers) instead, with one workflow step per item:
493
+
494
+ ```typescript
495
+ const { experimentId } = await dataset.startExperimentAsync({
496
+ durable: true,
497
+ targetType: 'agent',
498
+ targetId: 'translation-agent',
499
+ scorers: ['accuracy'],
500
+ maxConcurrency: 5,
501
+ })
502
+ ```
503
+
504
+ The workflow's run ID is the experiment ID. Each item's result is upserted on `(experimentId, itemId, attempt)`, so an item that runs again after a crash still leaves one row. A target error is recorded on the item's row and doesn't fail the run. When every item is done, Mastra finalizes the experiment.
505
+
506
+ Durable runs need [workers](https://mastra.ai/docs/deployment/workers) and a pubsub that redelivers unacknowledged events, such as Redis Streams, Valkey Streams, or Google Cloud Pub/Sub. A process that only handles pushed events through `mastra.handleWorkflowEvent()` can run the steps too, without starting workers. On the default in-memory pubsub, the run works but stays in one process, so it isn't durable.
507
+
508
+ Everything in a durable run must be serializable, so `durable: true` accepts registered targets, scorer IDs, `version`, `maxConcurrency`, `itemTimeout`, `maxRetries`, `agentModel` as a `provider/modelId` string, `requestContext` with plain JSON values, `unmockedToolPolicy`, and `versions`. It throws a `MastraError` with the `id` `EXPERIMENT_NOT_DURABLE` before creating anything when the config uses an inline `task`, lifecycle hooks, `onEvent`, `signal`, scorer objects or step scorers, `persistence` set to `'none'`, or `requestContext` values that aren't plain JSON, such as functions or dates.
509
+
510
+ A durable run doesn't keep the signed-in user from the request that started it. Mastra removes the auth token, user, roles, and permissions from `requestContext` before the run is published or stored, so targets in a durable run don't see them.
511
+
512
+ Keep these limits in mind:
513
+
514
+ - **Recovery waits for the broker.** With Redis or Valkey Streams, an item cut off by a crash runs again after `reclaimIdleMs` (60 seconds by default).
515
+ - **A pull worker runs one step at a time.** Items run in parallel only across workers, so `maxConcurrency` above the worker count doesn't speed up the run.
516
+ - **Workflow targets can run twice after a crash.** Workflow recovery can restart the cut-off target run while the item also runs again. The item still counts once.
517
+
490
518
  ## Caller-driven experiments
491
519
 
492
520
  `startExperiment()` puts Mastra in charge of the whole run. If a durable orchestrator (for example Temporal, Airflow, or a custom worker fleet) owns the loop instead, create the experiment first and drive it yourself in one of these shapes:
@@ -520,7 +548,7 @@ const { result, scores } = await dataset.runExperimentItem({
520
548
  })
521
549
  ```
522
550
 
523
- Retries and timeouts belong to your orchestrator: each `runExperimentItem` call executes the item exactly once. Scorers resolve with the same precedence as native runs: experiment `scorers` win over item `scorerIds`, which win over dataset `scorerIds`.
551
+ By default each `runExperimentItem` call executes the item once. Pass `maxRetries` and `itemTimeout` to retry and time out inside the call, or leave both to your orchestrator. The item's tool mocks apply as in native runs. Scorers resolve with the same precedence as native runs: experiment `scorers` win over item `scorerIds`, which win over dataset `scorerIds`.
524
552
 
525
553
  ### Ingest external results
526
554
 
@@ -78,11 +78,11 @@ A durable agent adds three layers on top of a regular agent:
78
78
 
79
79
  Mastra provides three factory functions that produce durable agents. They differ in how the workflow is executed:
80
80
 
81
- | Factory | Package | Best for |
82
- | ---------------------- | ----------------- | -------------------------------------------------------------------------------------------------- |
83
- | `createDurableAgent()` | `@mastra/core` | Local development and single-process servers. You get a stream you can await directly. |
84
- | `createEventedAgent()` | `@mastra/core` | Background execution. The workflow starts without blocking, and you consume chunks through PubSub. |
85
- | `createInngestAgent()` | `@mastra/inngest` | Production deployments. Inngest adds step memoization, retries, and a monitoring dashboard. |
81
+ | Factory | Package | Best for |
82
+ | ---------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
83
+ | `createDurableAgent()` | `@mastra/core` | Local development and single-process servers. You get a stream you can await directly. |
84
+ | `createEventedAgent()` | `@mastra/core` | Background execution. The workflow starts without blocking, and you consume chunks through PubSub. Running it on several processes needs a [supported PubSub backend and storage adapter](https://mastra.ai/docs/server/pubsub). |
85
+ | `createInngestAgent()` | `@mastra/inngest` | Production deployments. Inngest adds step memoization, retries, and a monitoring dashboard. |
86
86
 
87
87
  All three return an object you register with `Mastra` the same way as a regular agent. `createDurableAgent()` and `createEventedAgent()` return class instances that extend `Agent`. `createInngestAgent()` returns a Proxy-backed object that forwards `Agent` methods to the underlying agent. When a signal wakes an idle thread, all three start that run with the durable `stream()`. `sendSignal()` and `sendNotificationSignal()` both work this way.
88
88
 
@@ -120,6 +120,8 @@ const agent = new Agent({
120
120
  export const eventedWriter = createEventedAgent({ agent })
121
121
  ```
122
122
 
123
+ In one process, an evented agent runs on the default PubSub backend with no extra setup, which is how you try it locally. To run its steps on several processes, such as dedicated [workers](https://mastra.ai/docs/deployment/workers), configure a PubSub backend that redelivers unacknowledged events and a storage adapter with workflow step guards. `EventEmitterPubSub` and `UnixSocketPubSub` don't qualify. See [evented workflows and agents](https://mastra.ai/docs/server/pubsub) for the supported backends and adapters.
124
+
123
125
  ### Resumable streams for stored agents
124
126
 
125
127
  Agents created with [`createStoredAgent()`](https://mastra.ai/reference/client-js/agents) use the `durable` field to configure resumable streams only. The server hydrates a plain `Agent` with stream publishing and replay enabled:
@@ -415,6 +417,8 @@ Recovery can start the same tool call before the previous execution detects owne
415
417
 
416
418
  Every replica can start with `recovery.durableAgents: 'auto'`. Replicas that boot together race to recover the same orphaned runs, but only one claim succeeds per run and the other replicas skip it. This requires a claim that every replica shares: a workflows store that supports run fencing, or a PubSub backend whose lease every replica shares. Without either, gate recovery behind your own leader election or run it from a single replica.
417
419
 
420
+ Evented agents whose steps run on several processes have further requirements. See [evented workflows and agents](https://mastra.ai/docs/server/pubsub).
421
+
418
422
  ## Database load
419
423
 
420
424
  Mastra doesn't publish a benchmarked hardware reference for durable agents, so size your database from your own workload. This section covers what drives the load and what to watch.
@@ -83,6 +83,7 @@ With the read tools, an agent can:
83
83
  - Browse how a scope is organized.
84
84
  - Search pages and notes by keyword, or by meaning when you [add semantic search](https://mastra.ai/docs/knowledge/search).
85
85
  - Read a page, including its notes and the notes on other pages that mention it.
86
+ - List what changed over a period, such as everything since the start of a quarter, including note changes. See [`knowledge_activity`](https://mastra.ai/reference/knowledge/knowledge-tools).
86
87
 
87
88
  A long page comes back in parts. The first read shows the page's headings. The agent then reads the section it needs, continues from a line, or reads only the lines that match a term.
88
89
 
@@ -59,7 +59,7 @@ export async function seedDocs(orgId: string, docs: Doc[]) {
59
59
 
60
60
  Agents whose runs hold `org:acme` can now find these pages with search and read them. If you set `vector` and `embedder`, `upsertPage()` also embeds each page for [search by meaning](https://mastra.ai/docs/knowledge/search).
61
61
 
62
- To add a dated fact or a comment to a page, add a note. The `[[docs:acme#releases/2026-12]]` mention becomes a link once that page exists:
62
+ To add a dated fact or a comment to a page, add a note. The `[[docs:acme#releases/2026-12]]` mention becomes a link only if that page already exists when you add the note. Creating the page later doesn't turn an earlier mention into a link, so add the note after the target page exists, or update the note once it does:
63
63
 
64
64
  ```typescript
65
65
  await knowledge.addNote({
@@ -208,7 +208,7 @@ Platform adds these fields and grouping options:
208
208
  | `aggregateTraces()` | Supports `groupBy: ['projectId']` and `countDistinct.projectId`. |
209
209
  | `aggregateSpans()` | Supports `groupBy: ['projectId']`, but not `countDistinct.projectId`. |
210
210
 
211
- Data retention depends on your plan: 15 days for Starter, 6 months for Teams, and custom retention for Enterprise. See [pricing](https://mastra.ai/pricing) for current plan limits.
211
+ Data retention depends on your plan: 15 days for Free, 60 days for Starter, 180 days for Team, and custom retention for Enterprise. See [pricing](https://mastra.ai/pricing) for current plan limits.
212
212
 
213
213
  ### Other observability data
214
214
 
@@ -46,18 +46,19 @@ Because it runs in process, events aren't persisted and don't reach other proces
46
46
 
47
47
  Set the `pubsub` option on the `Mastra` instance to choose a backend. Each backend implements the same [`PubSub`](https://mastra.ai/reference/pubsub/base) contract, so the rest of your application doesn't change.
48
48
 
49
- The deciding question is where the subscriber runs.
49
+ The deciding questions are where the subscriber runs and whether [evented workflows and agents](#evented-workflows-and-agents) run on more than one process.
50
50
 
51
- | Backend | Scope | Mode | Package |
52
- | ----------------------------------------------------------------------------- | ---------------------------- | ------------- | ----------------------------- |
53
- | [`EventEmitterPubSub`](https://mastra.ai/reference/pubsub/event-emitter) | Single process | Pull and push | `@mastra/core` |
54
- | [`UnixSocketPubSub`](https://mastra.ai/reference/pubsub/unix-socket-pubsub) | Multiple processes, one host | Push | `@mastra/core` |
55
- | [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams) | Distributed, multiple hosts | Pull | `@mastra/redis-streams` |
56
- | [`GoogleCloudPubSub`](https://mastra.ai/reference/pubsub/google-cloud-pubsub) | Distributed, multiple hosts | Pull | `@mastra/google-cloud-pubsub` |
51
+ | Backend | Scope | Evented runs on several processes | Mode | Package |
52
+ | ----------------------------------------------------------------------------- | ---------------------------- | --------------------------------- | ------------- | ----------------------------- |
53
+ | [`EventEmitterPubSub`](https://mastra.ai/reference/pubsub/event-emitter) | Single process | No | Pull and push | `@mastra/core` |
54
+ | [`UnixSocketPubSub`](https://mastra.ai/reference/pubsub/unix-socket-pubsub) | Multiple processes, one host | No | Push | `@mastra/core` |
55
+ | [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams) | Distributed, multiple hosts | Yes | Pull | `@mastra/redis-streams` |
56
+ | [`ValkeyStreamsPubSub`](https://mastra.ai/reference/pubsub/valkey-streams) | Distributed, multiple hosts | Yes | Pull | `@mastra/valkey-streams` |
57
+ | [`GoogleCloudPubSub`](https://mastra.ai/reference/pubsub/google-cloud-pubsub) | Distributed, multiple hosts | Yes | Pull | `@mastra/google-cloud-pubsub` |
57
58
 
58
59
  ### Multiple processes on one host
59
60
 
60
- Use [`UnixSocketPubSub`](https://mastra.ai/reference/pubsub/unix-socket-pubsub) when several processes on the same machine need to share a stream. It delivers events over a Unix domain socket and elects one process as a broker. If the broker exits, the remaining processes elect a new one.
61
+ Use [`UnixSocketPubSub`](https://mastra.ai/reference/pubsub/unix-socket-pubsub) when several processes on the same machine need to share streams and signals. It delivers events over a Unix domain socket and elects one process as a broker. If the broker exits, the remaining processes elect a new one. It doesn't redeliver the events a stopped process held, so it isn't a backend for evented workflows or agents that run on several processes.
61
62
 
62
63
  ```typescript
63
64
  import { Mastra } from '@mastra/core'
@@ -104,6 +105,48 @@ export const mastra = new Mastra({
104
105
  })
105
106
  ```
106
107
 
108
+ ## Evented workflows and agents
109
+
110
+ Workflows on the [evented execution engine](https://mastra.ai/docs/workflows/scheduled-workflows) and agents created with [`createEventedAgent()`](https://mastra.ai/docs/harness/durable-agents) advance a run one event at a time. Any worker can take the next event, which lets several processes share one run. That only holds when the deployment has both of the following:
111
+
112
+ - **A PubSub backend that redelivers unacknowledged events**: When a worker stops in the middle of a step, the backend gives the step's event to another worker.
113
+ - **A storage adapter with workflow step guards**: The backend can deliver the same event more than once, and the step guard keeps a later delivery from saving the step's result a second time. A step can still run more than once, so [make steps with side effects idempotent](https://mastra.ai/docs/workflows/overview).
114
+
115
+ The backends that redeliver are marked **Yes** in the [Choosing a backend](#choosing-a-backend) table. A backend's reference page says whether redelivery can be turned off. The storage adapters with workflow step guards are `@mastra/pg` and `@mastra/libsql`. With `@mastra/libsql`, see [evented agent worker takeover](https://mastra.ai/reference/pubsub/redis-streams) for the database setups that work across machines.
116
+
117
+ [`EventEmitterPubSub`](https://mastra.ai/reference/pubsub/event-emitter) and [`UnixSocketPubSub`](https://mastra.ai/reference/pubsub/unix-socket-pubsub) don't redeliver an event that a stopped process received and never acknowledged. On the default `EventEmitterPubSub`, evented workflows and agents run in one process, which is how you try the evented engine locally and run it in tests. Don't use either backend to run evented workflows or agents on several processes:
118
+
119
+ - `EventEmitterPubSub` delivers inside one process. An event never reaches another instance, and each instance that boots restarts the active evented workflow runs of the others.
120
+ - `UnixSocketPubSub` reaches the other processes on the host, but no other process picks up the step of a process that stopped, and each process that boots restarts the active evented workflow runs of the others.
121
+
122
+ ### Warning for unsupported setups
123
+
124
+ Mastra logs a warning the first time an evented run is created in a setup that can't support several processes:
125
+
126
+ - The PubSub backend delivers to other processes and doesn't redeliver unacknowledged events.
127
+ - The PubSub backend redelivers unacknowledged events and the storage adapter has no workflow step guards.
128
+
129
+ The default `EventEmitterPubSub` doesn't trigger the warning, because its events never leave the process. `UnixSocketPubSub` triggers it even when one process uses the socket, because Mastra can't tell how many processes share it.
130
+
131
+ If you see the warning with your own [`PubSub`](https://mastra.ai/reference/pubsub/base) implementation, override the properties that describe its transport. Mastra reads them instead of checking which class the backend is:
132
+
133
+ ```typescript
134
+ import { PubSub } from '@mastra/core/events'
135
+
136
+ export class MyBrokerPubSub extends PubSub {
137
+ // The broker hands an unacknowledged event to another consumer in the group.
138
+ override get redeliversUnacked(): boolean {
139
+ return true
140
+ }
141
+
142
+ // publish(), subscribe(), unsubscribe(), flush()
143
+ }
144
+ ```
145
+
146
+ Return `true` from `redeliversUnacked` only when the broker redelivers an abandoned event to another consumer of the same group, and only after 30 seconds or more. If your implementation delivers only inside the publishing process, return `false` from `deliversAcrossProcesses` instead. See the [`PubSub` properties](https://mastra.ai/reference/pubsub/base).
147
+
148
+ To disable the warning for a setup that one process uses, set the `MASTRA_DISABLE_EVENTED_SETUP_WARNING` environment variable to `true`.
149
+
107
150
  ## Resumable streams
108
151
 
109
152
  Resumable streams let a client reconnect and replay events it missed, which requires the backend to keep recent history. Distributed backends such as [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams) persist events, so they support replay on their own.
@@ -31,6 +31,8 @@ Choose a backend based on where the processes run.
31
31
 
32
32
  [`UnixSocketPubSub`](https://mastra.ai/reference/pubsub/unix-socket-pubsub) elects one process as the socket broker and re-elects a new one if it exits. It doesn't work across machines.
33
33
 
34
+ This table covers signal delivery and thread leases. Evented workflows and agents that run on several processes have stricter requirements, which `EventEmitterPubSub` and `UnixSocketPubSub` don't meet. See [evented workflows and agents](https://mastra.ai/docs/server/pubsub).
35
+
34
36
  [`GoogleCloudPubSub`](https://mastra.ai/reference/pubsub/google-cloud-pubsub) delivers events across processes but doesn't implement leases. Mastra can't tell which instance owns a thread, so any instance receiving a signal can try to run it. Use it only when another layer guarantees one process per thread.
35
37
 
36
38
  ## Thread ownership and leases
@@ -504,7 +504,7 @@ While a run executes, Mastra holds a storage lease on it and renews it in the ba
504
504
 
505
505
  `mastra.restartAllActiveWorkflowRuns()`, which the server calls on boot, restarts a default-engine run only once it stopped: no instance holds its lease, and neither the run nor its lease changed for `recovery.workflowGraceMs` (2 seconds by default). A run that's still running, or stopped more recently, is left to the [recovery loop](#recovery-loop).
506
506
 
507
- Evented runs on a pubsub whose broker redelivers unacknowledged events (Redis Streams, Valkey Streams, Google Cloud Pub/Sub) are left to the broker: when a worker stops mid-step, the broker redelivers the step's event to another worker, and booting instances don't restart the run. Scheduled runs are the exception, because their events stay in the process that fired them, so recovery restarts them. On any other pubsub, including the default in-process one, recovery restarts every active evented run at once. The in-process pubsub delivers events only inside one process, so running several instances on one storage with it isn't supported for evented workflows.
507
+ Evented runs on a pubsub whose broker redelivers unacknowledged events are left to the broker: when a worker stops mid-step, the broker redelivers the step's event to another worker, and booting instances don't restart the run. Scheduled runs are the exception, because their events stay in the process that fired them, so recovery restarts them. On any other pubsub, including the default in-process one, recovery restarts every active evented run at once. The in-process pubsub delivers events only inside one process, so running several instances on one storage with it isn't supported for evented workflows or agents. See [evented workflows and agents](https://mastra.ai/docs/server/pubsub) for the PubSub backends and storage adapters that support several instances.
508
508
 
509
509
  A restarted run runs the interrupted step again, even if that step finished before the process stopped but its result wasn't saved. On the evented engine, a step that already saved its result doesn't run again when its event arrives late, for example after a broker redelivery or a `restart()` that ran while the step was saving its result. The run continues from the saved result instead. This needs a storage adapter with run-ownership support. Workflows that set `autoRestartActiveRuns: false`, including durable agent workflows, run the step again. Make steps with side effects idempotent, so a repeated step has no additional effect.
510
510
 
@@ -50,7 +50,7 @@ Declaring `schedule` doesn't change how the workflow runs. Scheduled fires run i
50
50
 
51
51
  Split-worker deployments are the exception. When the [`MASTRA_WORKERS`](https://mastra.ai/reference/workers/overview) environment variable is set to any value, including `false`, `createWorkflow` builds scheduled workflows on the **evented execution engine** so that every process in the deployment runs them the same way. Scheduled fires then run on the [orchestration worker](https://mastra.ai/docs/deployment/workers), and Mastra logs a warning to the console when the workflow is created. The public API (`workflow.start()`, `workflow.startAsync()`, `resume()`) doesn't change.
52
52
 
53
- Evented runs require a storage adapter that applies concurrent updates atomically, such as `@mastra/libsql` or `@mastra/pg`. With any other adapter, `createRun()` throws an error that lists the supported adapters.
53
+ Evented runs require a storage adapter that applies concurrent updates atomically, such as `@mastra/libsql` or `@mastra/pg`. With any other adapter, `createRun()` throws an error that lists the supported adapters. A split deployment also needs a PubSub backend that redelivers unacknowledged events and a storage adapter with workflow step guards. See [evented workflows and agents](https://mastra.ai/docs/server/pubsub).
54
54
 
55
55
  Only the environment variable triggers the switch, because `createWorkflow` runs before `Mastra` reads its `workers` option. If you split workers with the `workers` option instead, import `createWorkflow` from `@mastra/core/workflows/evented` for your scheduled workflows.
56
56
 
@@ -58,7 +58,7 @@ Your server needs a public URL that Slack can reach for webhook delivery and OAu
58
58
 
59
59
  1. Open [Slack apps](https://api.slack.com/apps), then open **Your App Configuration Tokens**.
60
60
 
61
- 2. Generate an app configuration token for the workspace where the agent will run.
61
+ 2. Generate an app configuration token for the workspace where the agent will run. Slack shows an access token (`xoxe.xoxp-1-...`) that expires in 12 hours, followed by a refresh token (`xoxe-1-...`). Copy the refresh token. Mastra rotates it after you connect, so don't use it anywhere else.
62
62
 
63
63
  3. Run `mastra connect add slack-channels` and complete the authorization flow. The platform stores and rotates the configuration credential.
64
64
 
@@ -79,10 +79,12 @@ Your server needs a public URL that Slack can reach for webhook delivery and OAu
79
79
 
80
80
  5. Start your Mastra application.
81
81
 
82
- 6. In Studio, connect the Slack channel to an agent. Mastra creates a Slack app and returns an authorization URL. Open it, choose the workspace, and approve the bot scopes.
82
+ 6. In Studio, connect the Slack channel to an agent. The Connect page on the Mastra platform only stores the connection, so you link it to an agent in Studio. Mastra creates a Slack app and returns an authorization URL. Open it, choose the workspace, and approve the bot scopes.
83
83
 
84
84
  The [default Slack manifest](https://mastra.ai/reference/channels/slack-provider) lists the requested scopes and event subscriptions.
85
85
 
86
+ To let the agent post structured cards with tables, charts, and fields, see [Generative UI cards](https://mastra.ai/reference/agents/channels).
87
+
86
88
  ## Self-managed setup
87
89
 
88
90
  Create a Slack app yourself and store its credentials in your Mastra environment. Use this path for agent chat when you want to control the Slack app directly.
@@ -20,6 +20,7 @@
20
20
  - [Gmail](https://mastra.ai/integrations/email-calendar/google-mail)
21
21
  - [Google Calendar](https://mastra.ai/integrations/email-calendar/google-calendar)
22
22
  - [Microsoft Outlook](https://mastra.ai/integrations/email-calendar/outlook)
23
+ - [SendGrid](https://mastra.ai/integrations/email-calendar/sendgrid)
23
24
 
24
25
  ## Documents
25
26
 
@@ -129,8 +130,10 @@
129
130
 
130
131
  ## Tools
131
132
 
133
+ - [Anthropic](https://mastra.ai/integrations/tools/anthropic)
132
134
  - [Bright Data](https://mastra.ai/integrations/tools/brightdata)
133
135
  - [Firecrawl](https://mastra.ai/integrations/tools/firecrawl)
136
+ - [GitLab](https://mastra.ai/integrations/tools/gitlab)
134
137
  - [Parallel](https://mastra.ai/integrations/tools/parallel)
135
138
  - [Perplexity](https://mastra.ai/integrations/tools/perplexity)
136
139
  - [Sanity Context](https://mastra.ai/integrations/tools/sanity-context)
@@ -223,7 +226,10 @@
223
226
  ## Other providers
224
227
 
225
228
  - [Canva](https://mastra.ai/integrations/other/canva)
229
+ - [Cloudflare Workers](https://mastra.ai/integrations/other/cloudflare-workers)
230
+ - [Digits](https://mastra.ai/integrations/other/digits)
226
231
  - [Fireflies.ai](https://mastra.ai/integrations/other/fireflies)
232
+ - [Google Analytics](https://mastra.ai/integrations/other/google-analytics)
227
233
  - [incident.io](https://mastra.ai/integrations/other/incident-io)
228
234
  - [Resend](https://mastra.ai/integrations/other/resend)
229
235
  - [Robinhood](https://mastra.ai/integrations/other/robinhood)
@@ -432,6 +432,8 @@ const result = await agent.sendNotificationSignal(
432
432
 
433
433
  **options.ifIdle** (`object`): Controls what happens when the target thread is idle.
434
434
 
435
+ **options.ifIdle.behavior** (`'wake' | 'persist' | 'discard'`): What to do when the notification signal reaches an idle thread. Defaults to wake. persist is stored on the record, so a deferred or summarized delivery also persists without waking the thread. A summary covering several records persists only when every record asked to persist.
436
+
435
437
  **options.ifIdle.streamOptions** (`AgentExecutionOptions`): Options for the stream that starts when an immediate notification wakes an idle thread.
436
438
 
437
439
  Returns `{ record: NotificationRecord, decision: NotificationDeliveryDecision, runId?: string, signal?: CreatedAgentSignal, persisted?: Promise<void>, accepted?: Promise<SendAgentSignalAccepted> }`. `record` is the stored inbox record. `decision` is the delivery-policy result. `signal` and `runId` are present when ingress emits a signal immediately, including the immediate summary emitted for active high-priority notifications. `persisted` is present when the emitted signal is persisted without waking an idle thread. `accepted` is present when a signal is emitted and resolves at decision-time, once Mastra decides what to do with it: `{ action: 'wake', runId, output }` when this process runs the agent (it started or won the lease to start the run), `{ action: 'deliver', runId }` when the signal is forwarded onto an existing run, or `{ action: 'persist' }` / `{ action: 'discard' }` when nothing ran. `runId` on the accepted result is present only on `wake` and `deliver`. On the `wake` action, `output` is the agent stream for in-process consumption.
@@ -15,10 +15,10 @@ import { Agent } from '@mastra/core/agent'
15
15
  import { createSlackAdapter } from '@chat-adapter/slack'
16
16
  import { createDiscordAdapter } from '@chat-adapter/discord'
17
17
 
18
- export const supportAgent = new Agent({
19
- id: 'support-agent',
20
- name: 'Support Agent',
21
- instructions: 'You are a helpful support assistant.',
18
+ const agent = new Agent({
19
+ id: 'channels-agent',
20
+ name: 'Channels Agent',
21
+ instructions: 'You are a helpful assistant.',
22
22
  model: 'openai/gpt-6.1-sol',
23
23
  channels: {
24
24
  adapters: {
@@ -236,7 +236,7 @@ const agent = new Agent({
236
236
 
237
237
  > **Experimental:** `generativeUI` is experimental and may change in a minor release.
238
238
 
239
- Set `generativeUI: true` on the Slack adapter to let the agent post structured cards (status summaries, key/value fields, tables, charts, images, and link buttons) instead of long markdown replies. Install the optional peer first:
239
+ Set `generativeUI: true` on Slack to let the agent post structured cards (status summaries, key/value fields, tables, charts, images, and link buttons) instead of long markdown replies. Install the optional peer first:
240
240
 
241
241
  **npm**:
242
242
 
@@ -266,24 +266,46 @@ bun add @json-render/chat
266
266
 
267
267
  `@mastra/core` loads `@json-render/chat` at runtime, so `mastra build` and `mastra deploy` don't pick it up on their own. Add it to [`bundler.dynamicPackages`](https://mastra.ai/reference/core/mastra-class) so it's included in the build output:
268
268
 
269
+ ```typescript
270
+ export const mastra = new Mastra({
271
+ // ...
272
+ bundler: { dynamicPackages: ['@json-render/chat'] },
273
+ })
274
+ ```
275
+
276
+ Runs on Slack then get a `render_card` tool. The tool call itself isn't rendered as a tool card.
277
+
278
+ ### Enable with Mastra Connect
279
+
280
+ When Slack chat runs through [Mastra Connect](https://mastra.ai/integrations/channels/slack), set `generativeUI` in the Slack provider options. `channels()` forwards `providerOptions` to [`SlackProvider`](https://mastra.ai/reference/channels/slack-provider):
281
+
269
282
  ```typescript
270
283
  import { Mastra } from '@mastra/core'
271
- import { supportAgent } from './agents/support-agent'
284
+ import { channels } from '@mastra/connect'
272
285
 
273
286
  export const mastra = new Mastra({
274
- agents: { supportAgent },
287
+ // ...
288
+ channels: await channels({
289
+ providers: { slack: { providerOptions: { generativeUI: true } } },
290
+ }),
275
291
  bundler: { dynamicPackages: ['@json-render/chat'] },
276
292
  })
277
293
  ```
278
294
 
295
+ The agent doesn't need `channels.adapters`. Connect the Slack channel to the agent in Studio.
296
+
297
+ ### Enable with `createSlackAdapter()`
298
+
299
+ When you manage your own Slack app with the [self-managed setup](https://mastra.ai/integrations/channels/slack), set `generativeUI` on the agent's Slack adapter instead:
300
+
279
301
  ```typescript
280
302
  import { Agent } from '@mastra/core/agent'
281
303
  import { createSlackAdapter } from '@chat-adapter/slack'
282
304
 
283
- export const supportAgent = new Agent({
284
- id: 'support-agent',
285
- name: 'Support Agent',
286
- instructions: 'You are a helpful support assistant.',
305
+ const agent = new Agent({
306
+ id: 'generative-ui-agent',
307
+ name: 'Generative UI Agent',
308
+ instructions: '...',
287
309
  model: 'openai/gpt-6.1-sol',
288
310
  channels: {
289
311
  adapters: {
@@ -293,21 +315,54 @@ export const supportAgent = new Agent({
293
315
  })
294
316
  ```
295
317
 
296
- Runs on that adapter get a `render_card` tool whose description lists the available components. The agent passes a flat spec of `{ root, elements }`, where the root element is a `Card`:
318
+ ### Card spec
297
319
 
298
- ```json
299
- {
300
- "root": "card",
301
- "elements": {
302
- "card": { "type": "Card", "props": { "title": "Deploy status" }, "children": ["fields"] },
303
- "fields": { "type": "Fields", "children": ["env", "version"] },
304
- "env": { "type": "Field", "props": { "label": "Environment", "value": "beta" } },
305
- "version": { "type": "Field", "props": { "label": "Version", "value": "1.8.1" } }
306
- }
307
- }
320
+ The agent passes `render_card` a [json-render](https://json-render.dev/docs) spec. See the json-render docs for the spec format and components. Image URLs, including a `Card` `imageUrl`, must be public HTTPS images that Slack can fetch.
321
+
322
+ The tool returns `{ ok: true, messageId }` once the card is posted. When the spec is invalid or exceeds the [Slack limits](#slack-card-limits), it returns `{ ok: false, issues }` without posting, so the agent can fix the spec and call it again. When Slack rejects the post, it returns `{ ok: false, error }`.
323
+
324
+ ### Agent instructions
325
+
326
+ A generic prompt usually produces only a basic table or chart. Name the components the agent should use and when to use them. When `render_card` returns issues, agents also tend to simplify the card by dropping images or fields instead of fixing the spec, so tell the agent to keep every component:
327
+
328
+ ```typescript
329
+ import { Agent } from '@mastra/core/agent'
330
+
331
+ const agent = new Agent({
332
+ id: 'generative-ui-agent',
333
+ name: 'Generative UI Agent',
334
+ instructions: `You are a support assistant for an internal deploy service.
335
+
336
+ Use render_card for status updates and reports. Start each card with a Card that has a title.
337
+ - Use Fields and Field for key facts such as environment, version, and owner.
338
+ - Use a Table for lists of items and a Chart for trends over time.
339
+ - Use an Image only when you have a public HTTPS image URL.
340
+ - Put links to dashboards or logs in LinkButton elements inside Actions.
341
+
342
+ If render_card returns issues, fix the spec and call it again. Keep every component you planned, including images and fields. Don't remove content to make the card pass.`,
343
+ model: 'openai/gpt-6.1-sol',
344
+ })
308
345
  ```
309
346
 
310
- The tool returns `{ ok: true, messageId }` once the card is posted. When the spec is invalid or exceeds the platform's limits (on Slack, one table and 100 rows per card), it returns `{ ok: false, issues }` without posting, so the agent can fix the spec and call it again. The tool call itself isn't rendered as a tool card. Interactive buttons aren't available yet. Cards can link out with `LinkButton`.
347
+ ### How cards look in Slack
348
+
349
+ `@chat-adapter/slack` renders a `Card` as a header block and a context block, followed by the blocks for its children. It doesn't use Slack's [card block](https://docs.slack.dev/reference/block-kit/blocks/card-block), so the card has no visible container or border around it.
350
+
351
+ ### Slack card limits
352
+
353
+ `render_card` checks these limits before posting. The Slack adapter would otherwise turn an oversized chart or table into plain text.
354
+
355
+ | Element | Limit per card |
356
+ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
357
+ | Table | 1 table, up to 100 rows, 20 columns, and 10,000 characters of cell text |
358
+ | Fields | 10 `Field` elements per `Fields` group |
359
+ | Chart | 2 charts, each with up to 20 points and 12 series. Titles and axis labels up to 50 characters. Category and series names up to 20 characters and unique |
360
+
361
+ ### Not supported yet
362
+
363
+ - Interactive `Button` elements. Cards can only link out with `LinkButton`.
364
+ - Streaming cards. A card is posted once, after the agent calls `render_card`.
365
+ - Adapters other than Slack. `generativeUI` is ignored on them.
311
366
 
312
367
  ## Custom typing status
313
368
 
@@ -341,6 +396,23 @@ const agent = new Agent({
341
396
  })
342
397
  ```
343
398
 
399
+ With [Mastra Connect](https://mastra.ai/integrations/channels/slack), pass the function in the Slack provider options:
400
+
401
+ ```typescript
402
+ import type { TypingStatusFn } from '@mastra/core/channels'
403
+
404
+ const typingStatus: TypingStatusFn = (chunk, ctx) => {
405
+ // ...
406
+ }
407
+
408
+ export const mastra = new Mastra({
409
+ // ...
410
+ channels: await channels({
411
+ providers: { slack: { providerOptions: { typingStatus } } },
412
+ }),
413
+ })
414
+ ```
415
+
344
416
  ## Handlers
345
417
 
346
418
  Override built-in event handlers. Each handler can be:
@@ -374,6 +446,23 @@ const agent = new Agent({
374
446
  })
375
447
  ```
376
448
 
449
+ With [Mastra Connect](https://mastra.ai/integrations/channels/slack), pass `handlers` in the Slack provider options instead. They apply to every agent connected to Slack:
450
+
451
+ ```typescript
452
+ import type { ChannelHandlers } from '@mastra/core/channels'
453
+
454
+ const handlers: ChannelHandlers = {
455
+ // ...
456
+ }
457
+
458
+ export const mastra = new Mastra({
459
+ // ...
460
+ channels: await channels({
461
+ providers: { slack: { providerOptions: { handlers } } },
462
+ }),
463
+ })
464
+ ```
465
+
377
466
  **onDirectMessage** (`ChannelHandler | false`): Called when the bot receives a direct message.
378
467
 
379
468
  **onMention** (`ChannelHandler | false`): Called when the bot is @mentioned in a channel or thread.
@@ -605,10 +694,10 @@ import { Agent } from '@mastra/core/agent'
605
694
  import { createChannelTools } from '@mastra/core/channels'
606
695
  import { createSlackAdapter } from '@chat-adapter/slack'
607
696
 
608
- export const supportAgent = new Agent({
609
- id: 'support-agent',
610
- name: 'Support Agent',
611
- instructions: 'You are a helpful support assistant.',
697
+ const agent = new Agent({
698
+ id: 'channel-tools-agent',
699
+ name: 'Channel Tools Agent',
700
+ instructions: 'You are a helpful assistant.',
612
701
  model: 'openai/gpt-6.1-sol',
613
702
  tools: {
614
703
  ...(await createChannelTools({ channels: 'selected', channelIds: ['slack:C0123ABC'] })),
@@ -105,6 +105,8 @@ Returns: `DurableAgent`
105
105
 
106
106
  Wraps an `Agent` with fire-and-forget durable execution on the built-in evented workflow engine. Like `createDurableAgent`, it returns a result you stream from, but the run is started without being awaited: events on the Mastra instance's PubSub drive execution independently of the caller. Register the agent on a `Mastra` instance with storage to get evented execution; without one, the agent falls back to the default in-process engine and logs a warning. It doesn't accept `id` or `name` overrides.
107
107
 
108
+ An evented agent runs in one process on any PubSub backend. Running its steps on several processes needs a backend that redelivers unacknowledged events and a storage adapter with workflow step guards. See [evented workflows and agents](https://mastra.ai/docs/server/pubsub).
109
+
108
110
  ```typescript
109
111
  import { createEventedAgent } from '@mastra/core/agent/durable'
110
112
 
@@ -30,7 +30,9 @@ console.log(result.output)
30
30
  console.log(scores)
31
31
  ```
32
32
 
33
- Each call executes the item exactly once, with no internal retry loop. Calling it on a target-less experiment throws `EXPERIMENT_HAS_NO_TARGET`. Use [`submitExperimentResult()`](https://mastra.ai/reference/datasets/submitExperimentResult) for those. Calls after finalization throw `EXPERIMENT_ALREADY_FINALIZED`, and an `itemId` that isn't visible at the pinned dataset version throws `DATASET_ITEM_NOT_FOUND`.
33
+ Each call executes the item once, retrying up to `maxRetries` times when you pass it, and you pass run options such as `agentModel` or `itemTimeout` on every call because the experiment record doesn't store them.
34
+
35
+ Calling it on a target-less experiment throws `EXPERIMENT_HAS_NO_TARGET`. Use [`submitExperimentResult()`](https://mastra.ai/reference/datasets/submitExperimentResult) for those. Calls after finalization throw `EXPERIMENT_ALREADY_FINALIZED`, and an `itemId` that isn't visible at the pinned dataset version throws `DATASET_ITEM_NOT_FOUND`.
34
36
 
35
37
  ## Parameters
36
38
 
@@ -42,6 +44,16 @@ Each call executes the item exactly once, with no internal retry loop. Calling i
42
44
 
43
45
  **requestContext** (`Record<string, unknown>`): Request context merged with the item's own request context (item values win).
44
46
 
47
+ **agentModel** (`string | object`): Model to run an agent target with, instead of the agent's own model. Accepts the same values as agentModel in \`startExperiment()\`. Throws for non-agent targets.
48
+
49
+ **itemTimeout** (`number`): Timeout in milliseconds for the item, covering every retry. A timed-out item records an error and isn't retried.
50
+
51
+ **maxRetries** (`number`): Retries after a failed execution. Defaults to 0. Uses exponential backoff. Aborts, timeouts, and tool mock errors aren't retried. The result row records retryCount.
52
+
53
+ **unmockedToolPolicy** (`'allow' | 'deny'`): Handling for agent tool calls that the item's toolMocks don't declare. Defaults to 'allow'. The item's own unmockedToolPolicy wins.
54
+
55
+ **versions** (`VersionOverrides`): Version overrides for sub-agents the target delegates to.
56
+
45
57
  ## Returns
46
58
 
47
59
  **result** (`Promise<object>`): The persisted result and its scores.
@@ -34,7 +34,9 @@ console.log(`Current status: ${experiment.status}`)
34
34
 
35
35
  ## Parameters
36
36
 
37
- Takes the same `StartExperimentConfig` as [`dataset.startExperiment()`](https://mastra.ai/reference/datasets/startExperiment).
37
+ Takes the same `StartExperimentConfig` as [`dataset.startExperiment()`](https://mastra.ai/reference/datasets/startExperiment), plus `durable`.
38
+
39
+ **durable** (`boolean`): Runs the experiment as an evented workflow with one step per item, so a stopped process doesn't leave it running. Needs workers and a pubsub that redelivers events, such as Redis Streams. Only serializable options are allowed: other options throw EXPERIMENT_NOT_DURABLE before anything is created. See Durable experiments.
38
40
 
39
41
  When `persistence.experiments` is set to `'none'`, `startExperimentAsync()` doesn't persist an experiment record, progress updates, or item results. Score persistence remains controlled separately by `persistence.scores`. Without an experiment event observer, the run is fire-and-forget, and the experiment API can't report whether it completed or failed.
40
42
 
@@ -178,7 +178,7 @@ All namespaces extend a shared CRUD base class, so they expose the same `create`
178
178
 
179
179
  ### Agent namespace examples
180
180
 
181
- Create a stored override for an existing code-defined agent:
181
+ Create a stored override for an existing code-defined agent. Use the code agent's `id`. The `name`, `instructions`, and `model` fields are required, so pass them even when they match the code agent:
182
182
 
183
183
  ```typescript
184
184
  import { mastra } from '../mastra'
@@ -187,7 +187,9 @@ const editor = mastra.getEditor()!
187
187
 
188
188
  await editor.agent.create({
189
189
  id: 'support-agent',
190
+ name: 'Support agent',
190
191
  instructions: 'You are a friendly support agent for Acme.',
192
+ model: { provider: 'openai', name: 'gpt-5.6' },
191
193
  tools: {
192
194
  search_kb: { description: 'Search the Acme knowledge base' },
193
195
  },
@@ -42,7 +42,7 @@ export const knowledge = new Knowledge({
42
42
 
43
43
  **storage** (`MastraCompositeStore`): Storage adapter. Without it, Knowledge uses the storage of the Mastra instance it is registered on.
44
44
 
45
- **tools** (`boolean | { read?: boolean | { maxTokens?: number }; write?: boolean }`): Tools an attached agent gets. true gives all five: knowledge_list, knowledge_search, knowledge_read, knowledge_page and knowledge_note. { read: true } gives the first three. { write: true } gives the last two. { read: { maxTokens } } turns on read and caps each knowledge_read body or match result, and each knowledge_list result, at maxTokens: 1,000 by default, at least 100. See Read pages. (Default: `false`)
45
+ **tools** (`boolean | { read?: boolean | { maxTokens?: number }; write?: boolean }`): Tools an attached agent gets. true gives all six: knowledge_list, knowledge_search, knowledge_read, knowledge_activity, knowledge_page and knowledge_note. { read: true } gives the first four. { write: true } gives the last two. { read: { maxTokens } } turns on read and caps each knowledge_read body or match result, each knowledge_list result, and each knowledge_activity result, at maxTokens: 1,000 by default, at least 100. See Read pages. (Default: `false`)
46
46
 
47
47
  **pinnedContext** (`boolean | { maxPins?: number; maxTokens?: number }`): Pinned pages delivered to an attached agent every turn, plus the knowledge_pin tool. Needs Memory. maxPins defaults to 20 and maxTokens to 500, with no maximum. See Pinned context. (Default: `false`)
48
48
 
@@ -77,7 +77,7 @@ Returns the Knowledge tools for explicit wiring, such as an agent that isn't att
77
77
 
78
78
  ```typescript
79
79
  const tools = knowledge.createTools({ write: false })
80
- // knowledge_list, knowledge_search, knowledge_read
80
+ // knowledge_list, knowledge_search, knowledge_read, knowledge_activity
81
81
  ```
82
82
 
83
83
  `principals` fixes the scope addresses every call acts as, for a host that runs the tools outside an agent run, such as an MCP server acting for an external agent. Each address must match a declared scope type, the store's declarations included. A call made with one that doesn't is refused. `createTools()` throws only for an empty list. The call's own run scopes are then ignored, and access follows the scope rules for these principals. Set them from the host's own authentication, never from the request. `author` is recorded on writes made through these tools.