@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
@@ -1467,21 +1467,80 @@ TRequestContext extends Record<string, any> | unknown = any, TEditor extends Age
1467
1467
  runId: string;
1468
1468
  reason?: string;
1469
1469
  }): Promise<MastraAgentNetworkStream<undefined>>;
1470
+ /**
1471
+ * Runs the agent to completion and resolves with a {@link FullOutput}: final `text`, every
1472
+ * step, all tool calls and results, usage, and `object` when `structuredOutput` is set.
1473
+ * Use `stream()` instead to consume output as it is produced.
1474
+ *
1475
+ * - `messages`: a string, a message object (`{ role, content }`, AI SDK UI/model messages
1476
+ * included), or an array mixing both.
1477
+ * - `options`: per-call {@link AgentExecutionOptionsBase} (`maxSteps`, `memory`,
1478
+ * `requestContext`, `modelSettings`, `toolChoice`, ...). They are merged over the
1479
+ * agent's `defaultOptions`.
1480
+ * - Tool calls loop until the model stops calling tools or the step limit is hit
1481
+ * (`maxSteps`; 5 steps when neither `maxSteps` nor `stopWhen` is set).
1482
+ * - Rejects with the run's error if the run fails.
1483
+ * - Tool data is wrapped in `payload`: read `result.toolCalls[i].payload.args` and
1484
+ * `result.toolResults[i].payload.result`.
1485
+ *
1486
+ * This overload: `structuredOutput.schema` is a schema such as a Zod object, so
1487
+ * `result.object` is typed from that schema.
1488
+ *
1489
+ * @example
1490
+ * ```ts
1491
+ * const result = await agent.generate('What is the weather in Paris?', { maxSteps: 3 });
1492
+ * console.log(result.text);
1493
+ * for (const call of result.toolCalls) console.log(call.payload.toolName, call.payload.args);
1494
+ * for (const res of result.toolResults) console.log(res.payload.toolName, res.payload.result);
1495
+ *
1496
+ * const { object } = await agent.generate('List three colors', {
1497
+ * structuredOutput: { schema: z.object({ colors: z.array(z.string()) }) },
1498
+ * });
1499
+ * ```
1500
+ *
1501
+ * @see [Agent.generate() reference](https://mastra.ai/reference/agents/generate)
1502
+ */
1470
1503
  generate<OUTPUT extends StandardSchemaWithJSON<any, any>, T extends InferStandardSchemaOutput<OUTPUT> = InferStandardSchemaOutput<OUTPUT>>(messages: MessageListInput, options: AgentExecutionOptionsBase<T> & {
1471
1504
  structuredOutput: PublicStructuredOutputOptions<T>;
1472
1505
  } & {
1473
1506
  model?: DynamicArgument<MastraModelConfig>;
1474
1507
  }): Promise<FullOutput<T>>;
1508
+ /**
1509
+ * Runs the agent to completion with `structuredOutput`, typing `result.object` as `OUTPUT`.
1510
+ * See the first `generate()` overload for full behavior.
1511
+ *
1512
+ * @see [Agent.generate() reference](https://mastra.ai/reference/agents/generate)
1513
+ */
1475
1514
  generate<OUTPUT extends {}>(messages: MessageListInput, options: AgentExecutionOptionsBase<OUTPUT> & {
1476
1515
  structuredOutput: PublicStructuredOutputOptions<OUTPUT>;
1477
1516
  } & {
1478
1517
  model?: DynamicArgument<MastraModelConfig>;
1479
1518
  }): Promise<FullOutput<OUTPUT>>;
1519
+ /**
1520
+ * Runs the agent to completion with per-call options and no `structuredOutput`; resolves
1521
+ * with a {@link FullOutput} (`text`, `steps`, `toolCalls`, `toolResults`, `usage`, ...).
1522
+ * Tool data is under `payload`, e.g. `result.toolCalls[0].payload.args`.
1523
+ * See the first `generate()` overload for full behavior.
1524
+ *
1525
+ * @see [Agent.generate() reference](https://mastra.ai/reference/agents/generate)
1526
+ */
1480
1527
  generate(messages: MessageListInput, options: AgentExecutionOptionsBase<unknown> & {
1481
1528
  structuredOutput?: never;
1482
1529
  } & {
1483
1530
  model?: DynamicArgument<MastraModelConfig>;
1484
1531
  }): Promise<FullOutput<TOutput>>;
1532
+ /**
1533
+ * Runs the agent to completion using its `defaultOptions`; resolves with a {@link FullOutput}.
1534
+ * `messages` is a string, a message object, or an array of either.
1535
+ * See the first `generate()` overload for full behavior.
1536
+ *
1537
+ * @example
1538
+ * ```ts
1539
+ * const { text } = await agent.generate('Hello!');
1540
+ * ```
1541
+ *
1542
+ * @see [Agent.generate() reference](https://mastra.ai/reference/agents/generate)
1543
+ */
1485
1544
  generate<OUTPUT = TOutput>(messages: MessageListInput): Promise<FullOutput<OUTPUT>>;
1486
1545
  subscribeToThread<OUTPUT = TOutput>(options: AgentSubscribeToThreadOptions & {
1487
1546
  withRunStatus: true;
@@ -2326,7 +2385,7 @@ TRequestContext extends Record<string, any> | unknown = any, TEditor extends Age
2326
2385
  *
2327
2386
  * @internal
2328
2387
  */
2329
- protected subscribeToDurableRunStream(runId: string, options: {
2388
+ __subscribeToRunStream(runId: string, options: {
2330
2389
  offset?: number;
2331
2390
  onComplete?: () => void;
2332
2391
  }, onEvent: (event: AgentStreamEvent) => void): Promise<() => Promise<void>>;
@@ -513,6 +513,26 @@ export type MultiPrimitiveExecutionOptions<OUTPUT = undefined> = NetworkOptions<
513
513
  * Public-facing network options that accept PublicSchema types.
514
514
  */
515
515
  export type PublicNetworkOptions<OUTPUT = undefined> = NetworkOptions<OUTPUT>;
516
+ /**
517
+ * Per-call options for `agent.generate(messages, options)` and `agent.stream(messages, options)`.
518
+ * Merged over the agent's `defaultOptions`; per-call values win.
519
+ *
520
+ * Most used: `maxSteps` (tool-call loop limit, 5 when unset), `memory` (`{ thread, resource }`),
521
+ * `requestContext`, `instructions` (override), `modelSettings` (`temperature`, `maxOutputTokens`, ...),
522
+ * `toolChoice`, `activeTools`, `abortSignal`, `onStepFinish`, `onFinish`. `structuredOutput` is
523
+ * accepted alongside these by `generate()` / `stream()`.
524
+ *
525
+ * @example
526
+ * ```ts
527
+ * await agent.generate('Plan my day', {
528
+ * maxSteps: 10,
529
+ * memory: { thread: 'thread-1', resource: 'user-1' },
530
+ * modelSettings: { temperature: 0.2 },
531
+ * });
532
+ * ```
533
+ *
534
+ * @see [Agent.generate() reference](https://mastra.ai/reference/agents/generate)
535
+ */
516
536
  export type AgentExecutionOptionsBase<OUTPUT> = {
517
537
  /**
518
538
  * Signal chunks to hide from this caller's stream: true hides all recognized signals,
@@ -578,9 +598,17 @@ export type AgentExecutionOptionsBase<OUTPUT> = {
578
598
  * Merged on top of Mastra instance-level versions and propagated via requestContext.
579
599
  */
580
600
  versions?: VersionOverrides;
581
- /** Maximum number of steps to run */
601
+ /**
602
+ * Maximum number of model steps in this run. A step is one model call plus the tools it
603
+ * calls, so this bounds the tool-call loop. Overrides the agent's `defaultOptions.maxSteps`.
604
+ * When neither `maxSteps` nor `stopWhen` is set, the run stops after 5 steps. When both are
605
+ * set, the run stops at whichever is reached first.
606
+ */
582
607
  maxSteps?: number;
583
- /** Conditions for stopping execution (e.g., step count, token limit) */
608
+ /**
609
+ * Custom stop condition(s): a function (or array of functions) of `{ steps }` returning
610
+ * whether to stop. Combined with `maxSteps` when both are set.
611
+ */
584
612
  stopWhen?: LoopOptions['stopWhen'];
585
613
  /** Provider-specific options passed to the language model */
586
614
  providerOptions?: ProviderOptions;
@@ -90,6 +90,12 @@ export interface CreateEventedAgentOptions<TAgentId extends string = string, TTo
90
90
  * death: over the same storage, a fresh process can resume in-flight runs via
91
91
  * `recover(runId)` / `recoverActiveRuns()`.
92
92
  *
93
+ * In one process it runs on any pubsub, including the default one. Running its
94
+ * steps on several processes needs a pubsub that redelivers unacknowledged
95
+ * events and a workflows store with step guards.
96
+ *
97
+ * @see https://mastra.ai/docs/server/pubsub#evented-workflows-and-agents
98
+ *
93
99
  * @param options - Configuration options
94
100
  * @returns An EventedAgent instance (register it on a `Mastra` host before use)
95
101
  *
@@ -11,7 +11,7 @@ import type { MessageListInput } from '../message-list/index.js';
11
11
  import type { AgentStreamBus } from '../streams/bus.js';
12
12
  import type { AgentDurableOption, ToolsInput } from '../types.js';
13
13
  import type { ExtendedRunRegistry } from './run-registry.js';
14
- import type { AgentAbortEventData, DurableAgentConfig, DurableAgentStreamOptions, DurableAgentStreamResult, AgentStreamEvent, DurableAgentStepFinishResult, AgentSuspendedEventData } from './types.js';
14
+ import type { AgentAbortEventData, DurableAgentConfig, DurableAgentStreamOptions, DurableAgentStreamResult, DurableAgentStepFinishResult, AgentSuspendedEventData } from './types.js';
15
15
  import type { createDurableAgenticWorkflow } from './workflows/index.js';
16
16
  export interface DurableAgent<TAgentId extends string = string, TTools extends ToolsInput = ToolsInput, TOutput = undefined> {
17
17
  stream(messages: MessageListInput, options?: DurableAgentStreamOptions<TOutput>): Promise<DurableAgentStreamResult<TOutput>>;
@@ -329,20 +329,6 @@ export declare class DurableAgent<TAgentId extends string = string, TTools exten
329
329
  __fork(): Agent<TAgentId, TTools, TOutput>;
330
330
  /** Whether new runs opt into journal storage. @internal */
331
331
  protected get storesRunsInJournal(): boolean;
332
- /**
333
- * Subscribe to a run's raw AgentStreamEvents, filtering out events from
334
- * executions that lost ownership and takeover markers. Callers must map
335
- * these events to the public frame contract produced by stream-adapter.ts's
336
- * createDurableAgentStream before sending them to clients; raw event
337
- * envelopes are not public stream frames. Resolves once subscribed, with
338
- * a function that unsubscribes.
339
- *
340
- * @internal
341
- */
342
- __subscribeToRunStream(runId: string, options: {
343
- offset?: number;
344
- onComplete?: () => void;
345
- }, onEvent: (event: AgentStreamEvent) => void): Promise<() => Promise<void>>;
346
332
  /**
347
333
  * Get the workflow instance for direct execution.
348
334
  * Lazily creates the workflow and registers Mastra on it (needed for
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_run_registry = require("../../run-registry-5_LQBGn_.cjs");
2
+ const require_run_registry = require("../../run-registry-5Suldxz3.cjs");
3
3
  const require_observability = require("../../observability-B0R_D1PZ.cjs");
4
4
  // src/agent/durable/durable-agent.ts
5
5
  var DurableAgent = class extends require_run_registry.Agent {
@@ -409,19 +409,6 @@ var DurableAgent = class extends require_run_registry.Agent {
409
409
  if (workflowsStore && !workflowsStore.supportsRunJournal()) this.guardrailLogger?.warn(`DurableAgent '${this.id}' sets storageVersion: 2, which ${storage?.name ?? "the configured"} storage doesn't support yet; storing new runs as version 1.`);
410
410
  }
411
411
  /**
412
- * Subscribe to a run's raw AgentStreamEvents, filtering out events from
413
- * executions that lost ownership and takeover markers. Callers must map
414
- * these events to the public frame contract produced by stream-adapter.ts's
415
- * createDurableAgentStream before sending them to clients; raw event
416
- * envelopes are not public stream frames. Resolves once subscribed, with
417
- * a function that unsubscribes.
418
- *
419
- * @internal
420
- */
421
- __subscribeToRunStream(runId, options, onEvent) {
422
- return this.subscribeToDurableRunStream(runId, options, onEvent);
423
- }
424
- /**
425
412
  * Get the workflow instance for direct execution.
426
413
  * Lazily creates the workflow and registers Mastra on it (needed for
427
414
  * getAgentById in execution steps).
@@ -629,6 +616,12 @@ function isEventedAgentClass(obj) {
629
616
  * death: over the same storage, a fresh process can resume in-flight runs via
630
617
  * `recover(runId)` / `recoverActiveRuns()`.
631
618
  *
619
+ * In one process it runs on any pubsub, including the default one. Running its
620
+ * steps on several processes needs a pubsub that redelivers unacknowledged
621
+ * events and a workflows store with step guards.
622
+ *
623
+ * @see https://mastra.ai/docs/server/pubsub#evented-workflows-and-agents
624
+ *
632
625
  * @param options - Configuration options
633
626
  * @returns An EventedAgent instance (register it on a `Mastra` host before use)
634
627
  *
@@ -1,4 +1,4 @@
1
- import { $ as createDurableBackgroundTaskCheckStep, At as readRunDeadline, B as createDurableAgenticWorkflow, Bs as emitFinishEvent, Ct as runDurableStreamUntilIdle, Dt as DurableStepIds, Et as DurableAgentDefaults, F as normalizeResumeGenerateArgs, Fs as __resetExecutionFencesForTests, Ft as pruneAgentLoopSnapshot, G as createWorkflowInput, Gs as publishAbortRequest, H as createDurableIsTaskCompleteStep, Hs as emitStepStartEvent, I as prepareForDurableExecution, Is as diffResponseMessages, J as serializeModelConfig, Js as createRunAbortController, K as serializeDurableOptions, Ks as requestAcknowledgedAbort, L as applyReservedMemoryContextKeys, Ls as emitAbortEvent, Mt as getRunStreamSlot, Nt as getScopeStreamSlot, Ot as RUN_DEADLINE_KEY, P as Agent, Pt as untilIdleHandlesBackgroundTask, Qs as AgentStreamEventTypes, R as persistDurableRunInput, Rs as emitChunkEvent, St as createDurableAgentStream, Tt as DURABLE_STOP_WHEN_ERROR_ID, U as createDurableLLMMappingStep, Us as emitSuspendedEvent, V as createDurableGoalStep, Vs as emitStepFinishEvent, W as createDurableToolCallStep, Ws as AgentStreamBus, X as createDurableLLMExecutionStep, Xs as AGENT_STREAM_TOPIC, Y as serializeToolsMetadata, Ys as AGENT_CONTROL_TOPIC, Zs as AgentControlEventTypes, Zt as validateModelTimeoutSettings, _t as resolveTool, a as endRunSpansWithError, at as baseDurableAgenticInputSchema, bt as liveSegmentSpan, c as globalRunRegistry, ct as modelConfigSchema, d as takeRunScorerInstances, dt as runDurableFinishSideEffects, et as resolveDurableToolCallConcurrency, ft as loadRunStoredMessages, gt as resolveRuntimeDependencies, ht as resolveModel, i as deleteRunRegistryEntry, it as accumulatedUsageSchema, kt as ensureRemoteAbortListener, lt as modelListEntrySchema, mt as resolveInternalState, n as RunRegistry, nt as calculateAccumulatedUsage, ot as baseIterationStateSchema, p as agentThreadStreamRuntime, pt as rebuildRunToolsFromMastra, q as serializeDurableState, qs as subscribeToAbortRequests, rt as createBaseIterationStateUpdate, s as getRunRegistryEntry, st as durableAgenticOutputSchema, t as ExtendedRunRegistry, tt as buildStepRecord, u as setRunRegistryEntry, ut as executeDurableAgentScorers, vt as toolRequiresApproval, wt as runResumeDurableStreamUntilIdle, xt as segmentSpanData, yt as carrySegmentSpans, z as detachFullStreamOnEnd, zs as emitErrorEvent } from "../../run-registry-DC03XLeZ.js";
1
+ import { $ as createDurableBackgroundTaskCheckStep, At as readRunDeadline, B as createDurableAgenticWorkflow, Bs as emitFinishEvent, Ct as runDurableStreamUntilIdle, Dt as DurableStepIds, Et as DurableAgentDefaults, F as normalizeResumeGenerateArgs, Fs as __resetExecutionFencesForTests, Ft as pruneAgentLoopSnapshot, G as createWorkflowInput, Gs as publishAbortRequest, H as createDurableIsTaskCompleteStep, Hs as emitStepStartEvent, I as prepareForDurableExecution, Is as diffResponseMessages, J as serializeModelConfig, Js as createRunAbortController, K as serializeDurableOptions, Ks as requestAcknowledgedAbort, L as applyReservedMemoryContextKeys, Ls as emitAbortEvent, Mt as getRunStreamSlot, Nt as getScopeStreamSlot, Ot as RUN_DEADLINE_KEY, P as Agent, Pt as untilIdleHandlesBackgroundTask, Qs as AgentStreamEventTypes, R as persistDurableRunInput, Rs as emitChunkEvent, St as createDurableAgentStream, Tt as DURABLE_STOP_WHEN_ERROR_ID, U as createDurableLLMMappingStep, Us as emitSuspendedEvent, V as createDurableGoalStep, Vs as emitStepFinishEvent, W as createDurableToolCallStep, Ws as AgentStreamBus, X as createDurableLLMExecutionStep, Xs as AGENT_STREAM_TOPIC, Y as serializeToolsMetadata, Ys as AGENT_CONTROL_TOPIC, Zs as AgentControlEventTypes, Zt as validateModelTimeoutSettings, _t as resolveTool, a as endRunSpansWithError, at as baseDurableAgenticInputSchema, bt as liveSegmentSpan, c as globalRunRegistry, ct as modelConfigSchema, d as takeRunScorerInstances, dt as runDurableFinishSideEffects, et as resolveDurableToolCallConcurrency, ft as loadRunStoredMessages, gt as resolveRuntimeDependencies, ht as resolveModel, i as deleteRunRegistryEntry, it as accumulatedUsageSchema, kt as ensureRemoteAbortListener, lt as modelListEntrySchema, mt as resolveInternalState, n as RunRegistry, nt as calculateAccumulatedUsage, ot as baseIterationStateSchema, p as agentThreadStreamRuntime, pt as rebuildRunToolsFromMastra, q as serializeDurableState, qs as subscribeToAbortRequests, rt as createBaseIterationStateUpdate, s as getRunRegistryEntry, st as durableAgenticOutputSchema, t as ExtendedRunRegistry, tt as buildStepRecord, u as setRunRegistryEntry, ut as executeDurableAgentScorers, vt as toolRequiresApproval, wt as runResumeDurableStreamUntilIdle, xt as segmentSpanData, yt as carrySegmentSpans, z as detachFullStreamOnEnd, zs as emitErrorEvent } from "../../run-registry-CGRPldLH.js";
2
2
  import { D as agentLoopTermination, O as executionFailureTermination } from "../../observability-D7RNOAPx.js";
3
3
  // src/agent/durable/durable-agent.ts
4
4
  var DurableAgent = class extends Agent {
@@ -408,19 +408,6 @@ var DurableAgent = class extends Agent {
408
408
  if (workflowsStore && !workflowsStore.supportsRunJournal()) this.guardrailLogger?.warn(`DurableAgent '${this.id}' sets storageVersion: 2, which ${storage?.name ?? "the configured"} storage doesn't support yet; storing new runs as version 1.`);
409
409
  }
410
410
  /**
411
- * Subscribe to a run's raw AgentStreamEvents, filtering out events from
412
- * executions that lost ownership and takeover markers. Callers must map
413
- * these events to the public frame contract produced by stream-adapter.ts's
414
- * createDurableAgentStream before sending them to clients; raw event
415
- * envelopes are not public stream frames. Resolves once subscribed, with
416
- * a function that unsubscribes.
417
- *
418
- * @internal
419
- */
420
- __subscribeToRunStream(runId, options, onEvent) {
421
- return this.subscribeToDurableRunStream(runId, options, onEvent);
422
- }
423
- /**
424
411
  * Get the workflow instance for direct execution.
425
412
  * Lazily creates the workflow and registers Mastra on it (needed for
426
413
  * getAgentById in execution steps).
@@ -628,6 +615,12 @@ function isEventedAgentClass(obj) {
628
615
  * death: over the same storage, a fresh process can resume in-flight runs via
629
616
  * `recover(runId)` / `recoverActiveRuns()`.
630
617
  *
618
+ * In one process it runs on any pubsub, including the default one. Running its
619
+ * steps on several processes needs a pubsub that redelivers unacknowledged
620
+ * events and a workflows store with step guards.
621
+ *
622
+ * @see https://mastra.ai/docs/server/pubsub#evented-workflows-and-agents
623
+ *
631
624
  * @param options - Configuration options
632
625
  * @returns An EventedAgent instance (register it on a `Mastra` host before use)
633
626
  *
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_stream = require("../stream-4aNIw_TQ.cjs");
3
- const require_run_registry = require("../run-registry-5_LQBGn_.cjs");
2
+ const require_run_registry = require("../run-registry-5Suldxz3.cjs");
3
+ const require_stream = require("../stream-Dvy_0o14.cjs");
4
4
  const require_message_list = require("../message-list-DPXPXvin.cjs");
5
5
  const require_signals = require("../signals-CWxAMEmE.cjs");
6
6
  const require_to_prompt = require("../to-prompt-B9eZo2U5.cjs");
@@ -1,5 +1,5 @@
1
- import { an as resolveThreadIdFromArgs, cn as tryStreamWithJsonFallback, in as resolveSuspendedToolRunId, l as TripWire, on as supportedLanguageModelSpecifications, rn as isSupportedLanguageModel, sn as tryGenerateWithJsonFallback } from "../stream-CJUm6EAH.js";
2
- import { A as agentInstructions, It as DEFAULT_TOOL_DECLINE_REASON, Lt as resolveDeclineReason, M as MAX_FS_SUBAGENT_DEPTH, N as AGENT_RESUME_CLAIM_STALE_MS, P as Agent, dl as isDurableAgentLike, j as assembleAgentFromFsEntry, jl as isAgentCompatible, k as agentConfig, ul as hasResumableStreams, ys as getGoalActivityDurationMs } from "../run-registry-DC03XLeZ.js";
1
+ import { A as agentInstructions, It as DEFAULT_TOOL_DECLINE_REASON, Lt as resolveDeclineReason, M as MAX_FS_SUBAGENT_DEPTH, N as AGENT_RESUME_CLAIM_STALE_MS, P as Agent, dl as isDurableAgentLike, j as assembleAgentFromFsEntry, jl as isAgentCompatible, k as agentConfig, ul as hasResumableStreams, ys as getGoalActivityDurationMs } from "../run-registry-CGRPldLH.js";
2
+ import { an as resolveThreadIdFromArgs, cn as tryStreamWithJsonFallback, in as resolveSuspendedToolRunId, l as TripWire, on as supportedLanguageModelSpecifications, rn as isSupportedLanguageModel, sn as tryGenerateWithJsonFallback } from "../stream-Dpwx0whf.js";
3
3
  import { Q as TypeDetector, n as MessageList, t as convertMessages } from "../message-list-DEuRl82K.js";
4
4
  import { a as isCreatedAgentSignal, c as isUserAuthoredMessage, d as signalSpanAttributes, f as signalToDataPartFormat, h as signalToXmlMarkup, i as getMessageAuthor, l as mastraDBMessageToSignal, m as signalToMessage, n as createSignal, o as isMastraSignalMessage, p as signalToMastraDBMessage, r as dataPartToSignal, s as isTransientSignalMessage, t as createMessageSignal, u as resolveDeliveryAttributes } from "../signals-CqR_iWkg.js";
5
5
  import { n as aiV5ModelMessageToV2PromptMessage } from "../to-prompt-BsDtVXrf.js";
@@ -953,6 +953,31 @@ type AgentEditableFieldConfig<TTools extends ToolsInput, TRequestContext extends
953
953
  } : {
954
954
  tools?: DynamicArgument<TTools, TRequestContext>;
955
955
  });
956
+ /**
957
+ * Options for `new Agent(config)`.
958
+ *
959
+ * - Required: `id`, `name`, `model`, and `instructions` (unless Studio owns instructions via
960
+ * `editor`).
961
+ * - Common optional fields: `tools`, `memory`, `agents` (sub-agents), `workflows`,
962
+ * `defaultOptions` (default per-call options such as `maxSteps`), `inputProcessors`,
963
+ * `outputProcessors`, `maxRetries`.
964
+ * - `model`, `instructions`, `tools`, and most other fields also accept a function of
965
+ * `{ requestContext }` resolved per call. `model` also accepts an array of fallbacks.
966
+ *
967
+ * @example
968
+ * ```ts
969
+ * const agent = new Agent({
970
+ * id: 'weather-agent',
971
+ * name: 'Weather Agent',
972
+ * instructions: 'You answer weather questions.',
973
+ * model: 'openai/gpt-5.6-sol',
974
+ * tools: { weatherTool },
975
+ * defaultOptions: { maxSteps: 5 },
976
+ * });
977
+ * ```
978
+ *
979
+ * @see [Agent constructor reference](https://mastra.ai/reference/agents/agent)
980
+ */
956
981
  export type AgentConfig<TAgentId extends string = string, TTools extends ToolsInput = ToolsInput, TOutput = undefined, TRequestContext extends Record<string, any> | unknown = unknown, TEditor extends AgentEditorConfig | undefined = AgentEditorConfig | undefined> = Omit<AgentConfigBase<TAgentId, TTools, TOutput, TRequestContext>, 'instructions' | 'tools' | 'editor'> & {
957
982
  editor?: TEditor;
958
983
  } & AgentEditableFieldConfig<TTools, TRequestContext, TEditor>;
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_provider_registry = require("../../provider-registry-9O-H9osy.cjs");
2
+ const require_provider_registry = require("../../provider-registry-zGezZVsL.cjs");
3
3
  // src/agent-builder/ee/types.ts
4
4
  /**
5
5
  * Default-on values for {@link AgentFeatures}. `browser` is defaulted
@@ -1,4 +1,4 @@
1
- import { a as getRegisteredProviders, o as isProviderRegistered, u as parseModelString } from "../../provider-registry-RZ8EgSe8.js";
1
+ import { a as getRegisteredProviders, o as isProviderRegistered, u as parseModelString } from "../../provider-registry-deA0x-Gd.js";
2
2
  // src/agent-builder/ee/types.ts
3
3
  /**
4
4
  * Default-on values for {@link AgentFeatures}. `browser` is defaulted
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_state_processor = require("../state-processor-kRNZ38Nf.cjs");
3
3
  const require_tools = require("../tools-CGF5Ik6j.cjs");
4
- const require_agent_controller = require("../agent-controller-K5vHtqfO.cjs");
4
+ const require_agent_controller = require("../agent-controller-DEPayioq.cjs");
5
5
  exports.AgentController = require_agent_controller.AgentController;
6
6
  exports.MODEL_PERSISTENCE_VERSION = require_agent_controller.MODEL_PERSISTENCE_VERSION;
7
7
  exports.MODEL_PERSISTENCE_VERSION_KEY = require_agent_controller.MODEL_PERSISTENCE_VERSION_KEY;
@@ -1,4 +1,4 @@
1
1
  import { f as taskCheckTool, h as taskWriteTool, m as taskUpdateTool, o as assignTaskIds, p as taskCompleteTool } from "../state-processor-B9kxpM53.js";
2
2
  import { s as askUserTool, t as submitPlanTool } from "../tools-CDfyMpzN.js";
3
- import { a as Session, c as defaultDisplayState, d as SessionStartupCancelledError, f as isSessionNotStartedError, i as MODEL_PERSISTENCE_VERSION_KEY, l as defaultOMProgressState, n as parseSubagentMeta, o as getSuspensionAddressKey, p as isSessionStartupCancelledError, r as MODEL_PERSISTENCE_VERSION, s as migratePersistedModelSelection, t as AgentController, u as SessionNotStartedError } from "../agent-controller-Cf3_IuY8.js";
3
+ import { a as Session, c as defaultDisplayState, d as SessionStartupCancelledError, f as isSessionNotStartedError, i as MODEL_PERSISTENCE_VERSION_KEY, l as defaultOMProgressState, n as parseSubagentMeta, o as getSuspensionAddressKey, p as isSessionStartupCancelledError, r as MODEL_PERSISTENCE_VERSION, s as migratePersistedModelSelection, t as AgentController, u as SessionNotStartedError } from "../agent-controller-B7POPub5.js";
4
4
  export { AgentController, MODEL_PERSISTENCE_VERSION, MODEL_PERSISTENCE_VERSION_KEY, Session, SessionNotStartedError, SessionStartupCancelledError, askUserTool, assignTaskIds, defaultDisplayState, defaultOMProgressState, getSuspensionAddressKey, isSessionNotStartedError, isSessionStartupCancelledError, migratePersistedModelSelection, parseSubagentMeta, submitPlanTool, taskCheckTool, taskCompleteTool, taskUpdateTool, taskWriteTool };
@@ -1,18 +1,18 @@
1
- import { Dt as DurableStepIds, P as Agent, Q as isSpanChunk, Rt as getServerSideFallbackInfo, Xr as InMemoryMemory, Z as MessagePartSpans, _a as validateStorageMetadataFilter, f as AgentThreadLeaseLostError, g as describeNonSuccessFinishReason, h as AGENTIC_LOOP_WORKFLOW_ID, jn as CHAT_CHANNEL_RENDER_CONTEXT_KEY, m as AGENTIC_EXECUTION_WORKFLOW_ID, p as agentThreadStreamRuntime } from "./run-registry-DC03XLeZ.js";
1
+ import { Dt as DurableStepIds, P as Agent, Q as isSpanChunk, Rt as getServerSideFallbackInfo, Xr as InMemoryMemory, Z as MessagePartSpans, _a as validateStorageMetadataFilter, f as AgentThreadLeaseLostError, g as describeNonSuccessFinishReason, h as AGENTIC_LOOP_WORKFLOW_ID, jn as CHAT_CHANNEL_RENDER_CONTEXT_KEY, m as AGENTIC_EXECUTION_WORKFLOW_ID, p as agentThreadStreamRuntime } from "./run-registry-CGRPldLH.js";
2
2
  import { n as MessageList } from "./message-list-DEuRl82K.js";
3
3
  import { c as isUserAuthoredMessage, n as createSignal, u as resolveDeliveryAttributes } from "./signals-CqR_iWkg.js";
4
4
  import { i as MastraFGAPermissions } from "./ee-iTj2bRDt-By_B9ngH.js";
5
- import { t as AgentControllerChannels } from "./channels-Dx4jiXeK.js";
6
- import { a as ModelRouterLanguageModel, l as defaultGateways, s as GatewayManager } from "./llm-DnXK3Pmw.js";
7
- import { t as Mastra } from "./mastra-B8i1UDZs.js";
8
- import { Bt as TITLE_PINNED_THREAD_METADATA_KEY, En as createRunScopeKey } from "./stream-CJUm6EAH.js";
5
+ import { t as AgentControllerChannels } from "./channels-BRVCOutx.js";
6
+ import { a as ModelRouterLanguageModel, l as defaultGateways, s as GatewayManager } from "./llm-Djd8Qzi0.js";
7
+ import { t as Mastra } from "./mastra-Ch00nEAJ.js";
8
+ import { Bt as TITLE_PINNED_THREAD_METADATA_KEY, En as createRunScopeKey } from "./stream-Dpwx0whf.js";
9
9
  import { c as MASTRA_THREAD_ID_KEY, i as MASTRA_MESSAGE_AUTHOR_KEY, o as MASTRA_RESOURCE_ID_KEY, u as RequestContext } from "./request-context-COnZHt2-.js";
10
10
  import { n as resolveDynamicArgument } from "./dynamic-argument-BzPK3qPN.js";
11
11
  import { i as MastraError, o as getErrorFromUnknown } from "./error-oh2DLsP2.js";
12
12
  import { toStandardSchema } from "./schema/index.js";
13
13
  import { safeStringify } from "./utils/safe-stringify.js";
14
- import { o as Workspace, p as createWorkspaceTools } from "./workspace-D7TIleIt.js";
15
- import { y as isLeaseProvider } from "./output-helpers-D4II19No.js";
14
+ import { o as Workspace, p as createWorkspaceTools } from "./workspace-C05xDH60.js";
15
+ import { v as isLeaseProvider } from "./output-helpers-CedRCE17.js";
16
16
  import { n as hasTransformedToolPayload, t as getTransformedToolPayload } from "./payload-transform-Dj3HUeD4.js";
17
17
  import { s as askUserTool, t as submitPlanTool } from "./tools-CDfyMpzN.js";
18
18
  import { r as createTool, s as isValidationError } from "./tool-Z3bykc1m.js";
@@ -1,17 +1,17 @@
1
- const require_run_registry = require("./run-registry-5_LQBGn_.cjs");
1
+ const require_run_registry = require("./run-registry-5Suldxz3.cjs");
2
2
  const require_message_list = require("./message-list-DPXPXvin.cjs");
3
3
  const require_signals = require("./signals-CWxAMEmE.cjs");
4
4
  const require_ee_iTj2bRDt = require("./ee-iTj2bRDt-D3-QLGDF.cjs");
5
- const require_channels = require("./channels-q6qnuRNV.cjs");
6
- const require_llm = require("./llm-CsQuqKPc.cjs");
7
- const require_mastra = require("./mastra-Cn5NC6Es.cjs");
8
- const require_stream = require("./stream-4aNIw_TQ.cjs");
5
+ const require_channels = require("./channels-MjTA9bFp.cjs");
6
+ const require_llm = require("./llm-DmUucguC.cjs");
7
+ const require_mastra = require("./mastra-qsVWpOTi.cjs");
8
+ const require_stream = require("./stream-Dvy_0o14.cjs");
9
9
  const require_request_context = require("./request-context-D9RXYCy8.cjs");
10
10
  const require_dynamic_argument = require("./dynamic-argument-CUc1BBOS.cjs");
11
11
  const require_error = require("./error-D90lJ6M7.cjs");
12
12
  const require_utils_safe_stringify = require("./utils/safe-stringify.cjs");
13
- const require_workspace = require("./workspace-D2drutNg.cjs");
14
- const require_output_helpers = require("./output-helpers-JL-HeCbT.cjs");
13
+ const require_workspace = require("./workspace-D1OzzlLw.cjs");
14
+ const require_output_helpers = require("./output-helpers-1Zu4Vt9C.cjs");
15
15
  const require_payload_transform = require("./payload-transform-CWgnsO9w.cjs");
16
16
  const require_tools = require("./tools-CGF5Ik6j.cjs");
17
17
  const require_tool = require("./tool-CYlT2UA-.cjs");
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_background_tasks = require("../background-tasks-DqnQMfuf.cjs");
2
+ const require_background_tasks = require("../background-tasks-7iftnRK_.cjs");
3
3
  exports.BACKGROUND_TASK_WORKFLOW_ID = require_background_tasks.BACKGROUND_TASK_WORKFLOW_ID;
4
4
  exports.BackgroundTaskManager = require_background_tasks.BackgroundTaskManager;
5
5
  exports.backgroundOverrideJsonSchema = require_background_tasks.backgroundOverrideJsonSchema;
@@ -1 +1 @@
1
- export { c as BACKGROUND_TASK_WORKFLOW_ID, s as BackgroundTaskManager, n as backgroundOverrideJsonSchema, r as backgroundOverrideZodSchema, o as createBackgroundTask, t as generateBackgroundTaskSystemPrompt, i as isToolBackgroundEligible, a as resolveBackgroundConfig } from "../background-tasks-BgpX1P_s.js";
1
+ export { c as BACKGROUND_TASK_WORKFLOW_ID, s as BackgroundTaskManager, n as backgroundOverrideJsonSchema, r as backgroundOverrideZodSchema, o as createBackgroundTask, t as generateBackgroundTaskSystemPrompt, i as isToolBackgroundEligible, a as resolveBackgroundConfig } from "../background-tasks-Cv1ecD6S.js";
@@ -178,7 +178,7 @@ var BackgroundTaskManager = class {
178
178
  if (handled) await ack?.();
179
179
  };
180
180
  if (this.#mastra) {
181
- const { buildBackgroundTaskWorkflow } = await Promise.resolve().then(() => require("./workflow-CnBPXTpv.cjs"));
181
+ const { buildBackgroundTaskWorkflow } = await Promise.resolve().then(() => require("./workflow-BjUTwaK9.cjs"));
182
182
  const workflow = buildBackgroundTaskWorkflow(this);
183
183
  if (!this.#mastra.__hasInternalWorkflow("__background-task")) this.#mastra.__registerInternalWorkflow(workflow);
184
184
  }
@@ -178,7 +178,7 @@ var BackgroundTaskManager = class {
178
178
  if (handled) await ack?.();
179
179
  };
180
180
  if (this.#mastra) {
181
- const { buildBackgroundTaskWorkflow } = await import("./workflow-CZHY_C85.js");
181
+ const { buildBackgroundTaskWorkflow } = await import("./workflow-Bvw6yDjc.js");
182
182
  const workflow = buildBackgroundTaskWorkflow(this);
183
183
  if (!this.#mastra.__hasInternalWorkflow("__background-task")) this.#mastra.__registerInternalWorkflow(workflow);
184
184
  }
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_base = require("../base-BIzR1D3_.cjs");
3
3
  const require_logger = require("../logger-CvzZYuJd.cjs");
4
- const require_stream = require("../stream-4aNIw_TQ.cjs");
4
+ const require_stream = require("../stream-Dvy_0o14.cjs");
5
5
  const require_tool = require("../tool-CYlT2UA-.cjs");
6
- const require_workspace = require("../workspace-D2drutNg.cjs");
6
+ const require_workspace = require("../workspace-D1OzzlLw.cjs");
7
7
  let events = require("events");
8
8
  let zod = require("zod");
9
9
  let fs = require("fs");
@@ -1,8 +1,8 @@
1
1
  import { t as MastraBase } from "../base-CKLWBhDo.js";
2
2
  import { a as RegisteredLogger } from "../logger-BwbmRqfc.js";
3
- import { nn as isProcessorWorkflow } from "../stream-CJUm6EAH.js";
3
+ import { nn as isProcessorWorkflow } from "../stream-Dpwx0whf.js";
4
4
  import { r as createTool } from "../tool-Z3bykc1m.js";
5
- import { E as browserCliHandler, T as BrowserCliHandler } from "../workspace-D7TIleIt.js";
5
+ import { E as browserCliHandler, T as BrowserCliHandler } from "../workspace-C05xDH60.js";
6
6
  import { EventEmitter } from "events";
7
7
  import { z } from "zod";
8
8
  import { closeSync, existsSync, fstatSync, lstatSync, mkdirSync, openSync, readdirSync, readlinkSync, unlinkSync, writeSync } from "fs";
@@ -1,6 +1,6 @@
1
- const require_validate = require("./validate-CuB_1Zd3.cjs");
1
+ const require_validate = require("./validate-Skps-cM3.cjs");
2
2
  const require_schedules = require("./schedules-BZS8McF7.cjs");
3
- const require_run_registry = require("./run-registry-5_LQBGn_.cjs");
3
+ const require_run_registry = require("./run-registry-5Suldxz3.cjs");
4
4
  let zod = require("zod");
5
5
  // src/workflows/builder/authoring-playbook.ts
6
6
  const WORKFLOW_BUILDER_AUTHORING_CONSTRAINTS = `# Persisted workflow authoring contract
@@ -1,6 +1,6 @@
1
- import { n as validateDynamicWorkflow, s as inferGraphSchemas, u as schemaCompatibility } from "./validate-CX0yQo_q.js";
1
+ import { n as validateDynamicWorkflow, s as inferGraphSchemas, u as schemaCompatibility } from "./validate-HSBcm96b.js";
2
2
  import { _ as validateCron } from "./schedules-DZfSx-7P.js";
3
- import { P as Agent } from "./run-registry-DC03XLeZ.js";
3
+ import { P as Agent } from "./run-registry-CGRPldLH.js";
4
4
  import { z } from "zod";
5
5
  // src/workflows/builder/authoring-playbook.ts
6
6
  const WORKFLOW_BUILDER_AUTHORING_CONSTRAINTS = `# Persisted workflow authoring contract