@mastra/core 1.87.0 → 1.88.0-alpha.0

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 (404) hide show
  1. package/dist/_types/@internal_ai-v6@0.0.100/dist/index.d.ts +97 -2049
  2. package/dist/agent/agent.d.ts +10 -2
  3. package/dist/agent/durable/create-evented-agent.d.ts +2 -1
  4. package/dist/agent/durable/execution-engine.d.ts +4 -2
  5. package/dist/agent/durable/index.cjs +3 -2
  6. package/dist/agent/durable/index.js +3 -2
  7. package/dist/agent/durable/segment-spans.d.ts +7 -0
  8. package/dist/agent/durable/stored-signal-drain.d.ts +1 -1
  9. package/dist/agent/durable/types.d.ts +6 -0
  10. package/dist/agent/index.cjs +2 -2
  11. package/dist/agent/index.js +2 -2
  12. package/dist/agent/request-context-snapshot.d.ts +5 -0
  13. package/dist/agent/thread-stream-runtime.d.ts +26 -4
  14. package/dist/agent-builder/ee/index.cjs +1 -1
  15. package/dist/agent-builder/ee/index.js +1 -1
  16. package/dist/agent-controller/index.cjs +1 -1
  17. package/dist/agent-controller/index.js +1 -1
  18. package/dist/{agent-controller-vUU_atR-.js → agent-controller-CQDCmsFD.js} +15 -9
  19. package/dist/{agent-controller-DckvJ7bq.cjs → agent-controller-NQKYmY0W.cjs} +15 -9
  20. package/dist/background-tasks/index.cjs +1 -1
  21. package/dist/background-tasks/index.js +1 -1
  22. package/dist/{background-tasks-HAzB0JtC.js → background-tasks-B7UygDdO.js} +1 -1
  23. package/dist/{background-tasks-By_1e9Gf.cjs → background-tasks-CeARf1DK.cjs} +1 -1
  24. package/dist/browser/index.cjs +1 -1
  25. package/dist/browser/index.js +1 -1
  26. package/dist/{builder-CmtDqFLe.js → builder-CpAEmMdR.js} +2 -2
  27. package/dist/{builder-Dx8GMhFn.cjs → builder-Dmf04g9P.cjs} +2 -2
  28. package/dist/capabilities/302ai.json +196 -196
  29. package/dist/capabilities/abliteratedllm.json +33 -33
  30. package/dist/capabilities/abliteration-ai.json +9 -9
  31. package/dist/capabilities/above.json +13 -13
  32. package/dist/capabilities/adaption.json +7 -7
  33. package/dist/capabilities/adzuki.json +20 -20
  34. package/dist/capabilities/agentrouter.json +10 -10
  35. package/dist/capabilities/agnes.json +2 -2
  36. package/dist/capabilities/ai-router.json +6 -6
  37. package/dist/capabilities/aiand.json +27 -18
  38. package/dist/capabilities/aigrow.json +14 -14
  39. package/dist/capabilities/aimlapi.json +146 -146
  40. package/dist/capabilities/aipg.json +2 -2
  41. package/dist/capabilities/aixy.json +17 -17
  42. package/dist/capabilities/aki-io.json +14 -14
  43. package/dist/capabilities/alibaba-cn.json +94 -94
  44. package/dist/capabilities/alibaba-coding-plan-cn.json +5 -5
  45. package/dist/capabilities/alibaba-coding-plan.json +5 -5
  46. package/dist/capabilities/alibaba-token-plan-cn.json +50 -50
  47. package/dist/capabilities/alibaba-token-plan.json +53 -53
  48. package/dist/capabilities/alibaba.json +71 -71
  49. package/dist/capabilities/ambient.json +8 -8
  50. package/dist/capabilities/amd-tokenlab.json +4 -4
  51. package/dist/capabilities/amd.json +11 -11
  52. package/dist/capabilities/anthropic.json +36 -36
  53. package/dist/capabilities/anyapi.json +18 -18
  54. package/dist/capabilities/apiko.json +2 -2
  55. package/dist/capabilities/arcee.json +9 -9
  56. package/dist/capabilities/augure.json +5 -5
  57. package/dist/capabilities/auriko.json +23 -23
  58. package/dist/capabilities/bailing.json +5 -5
  59. package/dist/capabilities/baseten.json +47 -38
  60. package/dist/capabilities/bee.json +5 -5
  61. package/dist/capabilities/bothub.json +14 -14
  62. package/dist/capabilities/boundless.json +37 -37
  63. package/dist/capabilities/bumo.json +40 -40
  64. package/dist/capabilities/byteplus.json +22 -22
  65. package/dist/capabilities/cerebras.json +4 -4
  66. package/dist/capabilities/cheapaimodel.json +10 -10
  67. package/dist/capabilities/cheapest-token.json +25 -25
  68. package/dist/capabilities/chutes.json +34 -32
  69. package/dist/capabilities/cline-pass.json +29 -29
  70. package/dist/capabilities/cloudcode.json +7 -7
  71. package/dist/capabilities/cloudflare-workers-ai.json +15 -15
  72. package/dist/capabilities/commandcode.json +146 -146
  73. package/dist/capabilities/concentrate.json +286 -277
  74. package/dist/capabilities/cortecs.json +109 -109
  75. package/dist/capabilities/crossmodel.json +194 -194
  76. package/dist/capabilities/crusoe.json +13 -13
  77. package/dist/capabilities/daoxe.json +7 -7
  78. package/dist/capabilities/databricks.json +128 -120
  79. package/dist/capabilities/deepinfra.json +102 -102
  80. package/dist/capabilities/deepseek.json +4 -4
  81. package/dist/capabilities/digitalocean.json +113 -114
  82. package/dist/capabilities/dothoosh.json +29 -29
  83. package/dist/capabilities/doubleword.json +26 -26
  84. package/dist/capabilities/edenai.json +287 -278
  85. package/dist/capabilities/empiriolabs.json +169 -169
  86. package/dist/capabilities/engy.json +24 -18
  87. package/dist/capabilities/entrim.json +6 -6
  88. package/dist/capabilities/evroc.json +13 -13
  89. package/dist/capabilities/ezkielyna.json +9 -9
  90. package/dist/capabilities/fastrouter.json +79 -79
  91. package/dist/capabilities/fireworks-ai.json +92 -92
  92. package/dist/capabilities/freemodel.json +10 -10
  93. package/dist/capabilities/friendli.json +26 -5
  94. package/dist/capabilities/frogbot.json +97 -97
  95. package/dist/capabilities/gisoo.json +19 -19
  96. package/dist/capabilities/gmicloud.json +7 -7
  97. package/dist/capabilities/google.json +53 -53
  98. package/dist/capabilities/graphn.json +14 -14
  99. package/dist/capabilities/greenpt.json +34 -34
  100. package/dist/capabilities/groq.json +4 -4
  101. package/dist/capabilities/helicone.json +88 -88
  102. package/dist/capabilities/hetzner.json +4 -4
  103. package/dist/capabilities/hostinger-router.json +10 -10
  104. package/dist/capabilities/hpc-ai.json +2 -2
  105. package/dist/capabilities/huawei-maas.json +15 -15
  106. package/dist/capabilities/hubris.json +28 -28
  107. package/dist/capabilities/huggingface.json +87 -85
  108. package/dist/capabilities/hyper.json +24 -24
  109. package/dist/capabilities/impossibl.json +114 -114
  110. package/dist/capabilities/inception.json +3 -3
  111. package/dist/capabilities/inceptron.json +8 -8
  112. package/dist/capabilities/inco.json +2 -2
  113. package/dist/capabilities/infer.json +17 -17
  114. package/dist/capabilities/inferall.json +5 -5
  115. package/dist/capabilities/inference-coop.json +2 -2
  116. package/dist/capabilities/inferenceapis.json +27 -27
  117. package/dist/capabilities/inferris.json +3 -3
  118. package/dist/capabilities/infersia.json +11 -11
  119. package/dist/capabilities/infomaniak.json +2 -2
  120. package/dist/capabilities/io-net.json +2 -2
  121. package/dist/capabilities/iteracompute.json +38 -38
  122. package/dist/capabilities/jalapeno.json +10 -10
  123. package/dist/capabilities/jiekou.json +34 -34
  124. package/dist/capabilities/joingonka.json +4 -4
  125. package/dist/capabilities/jzstoken.json +49 -49
  126. package/dist/capabilities/keln.json +24 -24
  127. package/dist/capabilities/kenari.json +122 -137
  128. package/dist/capabilities/kilo.json +615 -614
  129. package/dist/capabilities/kimchi.json +14 -14
  130. package/dist/capabilities/kimi-code-plan-cn.json +9 -9
  131. package/dist/capabilities/kimi-code-plan-global.json +9 -9
  132. package/dist/capabilities/kitani.json +6 -6
  133. package/dist/capabilities/klavo.json +20 -20
  134. package/dist/capabilities/korouter.json +35 -35
  135. package/dist/capabilities/kunavo.json +10 -10
  136. package/dist/capabilities/liquid.json +9 -9
  137. package/dist/capabilities/lithosai.json +2 -2
  138. package/dist/capabilities/llmgateway-providers.json +959 -923
  139. package/dist/capabilities/llmgateway.json +349 -340
  140. package/dist/capabilities/llmtr.json +29 -29
  141. package/dist/capabilities/logits.json +2 -2
  142. package/dist/capabilities/lowrouter.json +53 -53
  143. package/dist/capabilities/lyceum.json +12 -12
  144. package/dist/capabilities/melious.json +9 -9
  145. package/dist/capabilities/merge-gateway.json +271 -263
  146. package/dist/capabilities/meta.json +11 -11
  147. package/dist/capabilities/minimax-cn-coding-plan.json +5 -5
  148. package/dist/capabilities/minimax-cn.json +5 -5
  149. package/dist/capabilities/minimax-coding-plan.json +5 -5
  150. package/dist/capabilities/minimax.json +5 -5
  151. package/dist/capabilities/mistral.json +16 -16
  152. package/dist/capabilities/mixlayer.json +4 -4
  153. package/dist/capabilities/modal.json +11 -11
  154. package/dist/capabilities/model-oracle-ai.json +19 -19
  155. package/dist/capabilities/modelis.json +16 -16
  156. package/dist/capabilities/modular.json +5 -5
  157. package/dist/capabilities/moneo.json +10 -10
  158. package/dist/capabilities/moonshotai-cn.json +6 -6
  159. package/dist/capabilities/moonshotai.json +6 -6
  160. package/dist/capabilities/morph.json +18 -18
  161. package/dist/capabilities/munito-eu.json +8 -8
  162. package/dist/capabilities/munito.json +10 -10
  163. package/dist/capabilities/nan.json +33 -33
  164. package/dist/capabilities/nano-gpt.json +557 -567
  165. package/dist/capabilities/nearai.json +77 -77
  166. package/dist/capabilities/nebius.json +42 -34
  167. package/dist/capabilities/neon.json +127 -127
  168. package/dist/capabilities/neuralwatt.json +37 -37
  169. package/dist/capabilities/nokeep.json +4 -4
  170. package/dist/capabilities/novita-ai.json +115 -115
  171. package/dist/capabilities/nvidia.json +17 -17
  172. package/dist/capabilities/oathbreaker.json +5 -5
  173. package/dist/capabilities/obscurify.json +29 -29
  174. package/dist/capabilities/oci.json +6 -6
  175. package/dist/capabilities/ofox.json +265 -265
  176. package/dist/capabilities/ollama-cloud.json +52 -52
  177. package/dist/capabilities/openai.json +58 -61
  178. package/dist/capabilities/opencode-go.json +90 -90
  179. package/dist/capabilities/openreason.json +6 -6
  180. package/dist/capabilities/openrouter.json +550 -548
  181. package/dist/capabilities/opper.json +26 -26
  182. package/dist/capabilities/orcarouter.json +310 -294
  183. package/dist/capabilities/outerlabs.json +29 -29
  184. package/dist/capabilities/ovhcloud.json +22 -22
  185. package/dist/capabilities/pareto.json +4 -4
  186. package/dist/capabilities/perplexity-agent.json +69 -69
  187. package/dist/capabilities/perplexity.json +2 -2
  188. package/dist/capabilities/phala.json +30 -30
  189. package/dist/capabilities/poe.json +111 -111
  190. package/dist/capabilities/poolside.json +2 -2
  191. package/dist/capabilities/powerspring.json +9 -9
  192. package/dist/capabilities/primalabs.json +11 -11
  193. package/dist/capabilities/prime.json +127 -119
  194. package/dist/capabilities/privatemode-ai.json +6 -6
  195. package/dist/capabilities/proxystacks.json +3 -3
  196. package/dist/capabilities/qiniu-ai.json +13 -13
  197. package/dist/capabilities/refuseless.json +5 -5
  198. package/dist/capabilities/regolo-ai.json +10 -10
  199. package/dist/capabilities/requesty.json +200 -200
  200. package/dist/capabilities/ruapi.json +20 -20
  201. package/dist/capabilities/runcrate.json +13 -13
  202. package/dist/capabilities/runinfra.json +19 -19
  203. package/dist/capabilities/sakana.json +5 -5
  204. package/dist/capabilities/sambanova.json +9 -9
  205. package/dist/capabilities/sandbase.json +22 -22
  206. package/dist/capabilities/sarvam.json +14 -14
  207. package/dist/capabilities/scaleway.json +17 -17
  208. package/dist/capabilities/scnet-token-plan.json +8 -8
  209. package/dist/capabilities/scx-ai.json +22 -22
  210. package/dist/capabilities/sensenova.json +11 -11
  211. package/dist/capabilities/siliconflow-cn.json +59 -59
  212. package/dist/capabilities/siliconflow.json +57 -57
  213. package/dist/capabilities/snowflake-cortex.json +19 -19
  214. package/dist/capabilities/sokkan.json +10 -10
  215. package/dist/capabilities/sparrowcodes.json +20 -20
  216. package/dist/capabilities/standardcompute.json +85 -85
  217. package/dist/capabilities/steadyrouter.json +40 -40
  218. package/dist/capabilities/stepfun-ai-step-plan.json +5 -5
  219. package/dist/capabilities/stepfun-ai.json +5 -5
  220. package/dist/capabilities/stepfun-step-plan.json +5 -5
  221. package/dist/capabilities/stepfun.json +5 -5
  222. package/dist/capabilities/stepping-stone.json +18 -18
  223. package/dist/capabilities/superbot-gg.json +4 -4
  224. package/dist/capabilities/synthetic.json +12 -12
  225. package/dist/capabilities/synthorai.json +21 -21
  226. package/dist/capabilities/teamorouter.json +17 -17
  227. package/dist/capabilities/teapot-router.json +13 -13
  228. package/dist/capabilities/tencent-token-plan-intl.json +22 -22
  229. package/dist/capabilities/tencent-token-plan.json +42 -42
  230. package/dist/capabilities/tencent-tokenhub.json +44 -44
  231. package/dist/capabilities/tensorx.json +43 -43
  232. package/dist/capabilities/tenstorrent.json +2 -2
  233. package/dist/capabilities/the-grid-ai.json +30 -30
  234. package/dist/capabilities/thinkingmachines.json +78 -78
  235. package/dist/capabilities/tinfoil.json +13 -13
  236. package/dist/capabilities/toapis.json +2 -2
  237. package/dist/capabilities/togetherai.json +54 -54
  238. package/dist/capabilities/tokengo.json +23 -23
  239. package/dist/capabilities/tokenharbor.json +217 -217
  240. package/dist/capabilities/tokenify.json +9 -9
  241. package/dist/capabilities/trustedrouter.json +6 -6
  242. package/dist/capabilities/trustedtokens.json +12 -12
  243. package/dist/capabilities/umans-ai-coding-plan.json +17 -17
  244. package/dist/capabilities/umans-ai.json +11 -11
  245. package/dist/capabilities/uncensuredai.json +5 -5
  246. package/dist/capabilities/unrestricted.json +4 -4
  247. package/dist/capabilities/uplinkswitch.json +20 -20
  248. package/dist/capabilities/upstage.json +2 -2
  249. package/dist/capabilities/vancine.json +20 -20
  250. package/dist/capabilities/vercel.json +580 -571
  251. package/dist/capabilities/vivgrid.json +61 -61
  252. package/dist/capabilities/volcengine-coding-plan.json +26 -26
  253. package/dist/capabilities/volcengine.json +24 -24
  254. package/dist/capabilities/vultr.json +15 -15
  255. package/dist/capabilities/wafer.ai.json +19 -19
  256. package/dist/capabilities/wallaby.json +5 -5
  257. package/dist/capabilities/wally.json +11 -11
  258. package/dist/capabilities/wandb.json +21 -21
  259. package/dist/capabilities/watt.json +19 -19
  260. package/dist/capabilities/xai.json +2 -2
  261. package/dist/capabilities/xpersona.json +13 -13
  262. package/dist/capabilities/xxapi.json +27 -27
  263. package/dist/capabilities/zai-coding-plan.json +11 -11
  264. package/dist/capabilities/zai.json +32 -32
  265. package/dist/capabilities/zenifra.json +27 -27
  266. package/dist/capabilities/zenmux.json +178 -178
  267. package/dist/capabilities/zerogpu.json +12 -12
  268. package/dist/capabilities/zhipuai-coding-plan.json +3 -3
  269. package/dist/capabilities/zhipuai.json +28 -28
  270. package/dist/capabilities/zro.json +7 -7
  271. package/dist/channels/index.cjs +2 -2
  272. package/dist/channels/index.js +2 -2
  273. package/dist/{channels-DChC1kXm.js → channels-BQ--aLCA.js} +1 -1
  274. package/dist/{channels-BamLzaJG.cjs → channels-CTCBsS5M.cjs} +1 -1
  275. package/dist/coding-agent/index.cjs +1 -1
  276. package/dist/coding-agent/index.js +1 -1
  277. package/dist/datasets/index.cjs +2 -2
  278. package/dist/datasets/index.js +2 -2
  279. package/dist/docs/SKILL.md +1 -1
  280. package/dist/docs/assets/SOURCE_MAP.json +804 -804
  281. package/dist/docs/references/docs-agents-human-in-the-loop.md +1 -1
  282. package/dist/docs/references/docs-agents-resumable-streams.md +3 -3
  283. package/dist/docs/references/docs-channels.md +8 -2
  284. package/dist/docs/references/docs-deployment-workers.md +10 -4
  285. package/dist/docs/references/docs-harness-durable-agents.md +17 -15
  286. package/dist/docs/references/docs-server-mcp.md +68 -0
  287. package/dist/docs/references/docs-server-pubsub.md +25 -16
  288. package/dist/docs/references/docs-signals-running-across-processes.md +9 -3
  289. package/dist/docs/references/docs-signals-sending-signals.md +1 -1
  290. package/dist/docs/references/docs-workflows-overview.md +3 -3
  291. package/dist/docs/references/reference-agents-agent.md +3 -1
  292. package/dist/docs/references/reference-agents-durable-agent.md +3 -3
  293. package/dist/docs/references/reference-configuration.md +60 -0
  294. package/dist/docs/references/reference-pubsub-base.md +1 -1
  295. package/dist/docs/references/reference-pubsub-caching-pubsub.md +1 -1
  296. package/dist/docs/references/reference-pubsub-google-cloud-pubsub.md +13 -7
  297. package/dist/docs/references/reference-pubsub-lease-provider.md +4 -0
  298. package/dist/docs/references/reference-pubsub-redis-streams.md +18 -9
  299. package/dist/docs/references/reference-pubsub-valkey-streams.md +25 -7
  300. package/dist/evals/index.cjs +1 -1
  301. package/dist/evals/index.js +1 -1
  302. package/dist/evals/scoreTraces/index.cjs +1 -1
  303. package/dist/evals/scoreTraces/index.js +1 -1
  304. package/dist/events/caching-pubsub.d.ts +3 -11
  305. package/dist/events/index.cjs +1 -1
  306. package/dist/events/index.js +1 -1
  307. package/dist/events/pubsub.d.ts +2 -1
  308. package/dist/{execution-fence-BBKnrhWR.cjs → execution-fence-C8Q0wWkG.cjs} +841 -219
  309. package/dist/{execution-fence--VdnD7p4.js → execution-fence-DGFyUV5h.js} +841 -219
  310. package/dist/harness/index.cjs +1 -1
  311. package/dist/harness/index.js +1 -1
  312. package/dist/index.cjs +1 -1
  313. package/dist/index.js +1 -1
  314. package/dist/knowledge/index.cjs +1 -1
  315. package/dist/knowledge/index.js +1 -1
  316. package/dist/llm/index.cjs +3 -3
  317. package/dist/llm/index.js +3 -3
  318. package/dist/llm/model/provider-types.generated.d.ts +7689 -7673
  319. package/dist/llm/reasoning/account-switch.d.ts +50 -0
  320. package/dist/llm/reasoning/index.cjs +65 -0
  321. package/dist/llm/reasoning/index.d.ts +1 -0
  322. package/dist/llm/reasoning/index.js +61 -1
  323. package/dist/{llm-DknPJDW6.cjs → llm-RIAYOAtD.cjs} +2 -2
  324. package/dist/{llm-ccA_1Q-H.js → llm-YNjDFSui.js} +2 -2
  325. package/dist/loop/index.cjs +2 -2
  326. package/dist/loop/index.js +2 -2
  327. package/dist/loop/suspended-run-auto-resume.d.ts +15 -0
  328. package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts +1 -1
  329. package/dist/{manager-DWX6-Cx4.js → manager-DZhtdV6Q.js} +2 -2
  330. package/dist/{manager-D9F0i7O2.cjs → manager-Y-jYcS7T.cjs} +2 -2
  331. package/dist/mastra/index.cjs +1 -1
  332. package/dist/mastra/index.d.ts +35 -11
  333. package/dist/mastra/index.js +1 -1
  334. package/dist/{mastra-BzWL4xI8.cjs → mastra-B2-HBq1-.cjs} +108 -20
  335. package/dist/{mastra-oUDN81l8.js → mastra-BJ54VxOO.js} +108 -20
  336. package/dist/memory/index.cjs +2 -2
  337. package/dist/memory/index.js +2 -2
  338. package/dist/{model-BwxfS6T_.js → model-cS3d5rmF.js} +1 -1
  339. package/dist/{model-BnD7SPlA.cjs → model-lzZPXaEV.cjs} +1 -1
  340. package/dist/{netlify-CS0VDbb9.cjs → netlify-1lti1j4Z.cjs} +1 -1
  341. package/dist/{netlify-DcY9gHCJ.js → netlify-ClBjc0Xg.js} +1 -1
  342. package/dist/notifications/index.cjs +1 -1
  343. package/dist/notifications/index.js +1 -1
  344. package/dist/{output-helpers-k2-48ssH.js → output-helpers-D-qplq22.js} +13 -15
  345. package/dist/{output-helpers-By5FbLpp.cjs → output-helpers-D4O_oFne.cjs} +12 -14
  346. package/dist/processor-provider/index.cjs +1 -1
  347. package/dist/processor-provider/index.js +1 -1
  348. package/dist/processors/index.cjs +2 -2
  349. package/dist/processors/index.js +2 -2
  350. package/dist/{provider-registry-OggbU6OE.cjs → provider-registry-C6jd3Uxi.cjs} +21565 -21544
  351. package/dist/{provider-registry-BvbEoScB.js → provider-registry-C_XQJvu2.js} +21565 -21544
  352. package/dist/provider-registry.json +22006 -21980
  353. package/dist/{registry-generator-CDaf48a6.cjs → registry-generator-BYdAlox6.cjs} +1 -1
  354. package/dist/{registry-generator-BFOQQHyt.js → registry-generator-DBrTbThj.js} +1 -1
  355. package/dist/{rehydrate-CFoKaNlm.js → rehydrate-4xHubfOY.js} +2 -2
  356. package/dist/{rehydrate-QeS0NjGw.cjs → rehydrate-BtwY0ima.cjs} +2 -2
  357. package/dist/relevance/index.cjs +2 -2
  358. package/dist/relevance/index.js +2 -2
  359. package/dist/{scheduler-0ShtMM1I.js → scheduler-D1qdie5k.js} +4 -2
  360. package/dist/{scheduler-CMjK0LoQ.cjs → scheduler-DE5lcHJA.cjs} +4 -2
  361. package/dist/server/index.d.ts +1 -1
  362. package/dist/server/types.d.ts +57 -0
  363. package/dist/storage/domains/memory/base.d.ts +6 -1
  364. package/dist/storage/index.cjs +2 -2
  365. package/dist/storage/index.js +2 -2
  366. package/dist/stream/index.cjs +2 -2
  367. package/dist/stream/index.js +2 -2
  368. package/dist/{stream-CNqAlDJF.cjs → stream-DqKDB3nL.cjs} +1 -1
  369. package/dist/{stream-D2rv1Ut1.js → stream-H_wVxqdK.js} +1 -1
  370. package/dist/test-utils/llm-mock.cjs +1 -1
  371. package/dist/test-utils/llm-mock.js +1 -1
  372. package/dist/tool-loop-agent/index.cjs +1 -1
  373. package/dist/tool-loop-agent/index.js +1 -1
  374. package/dist/{tool-loop-agent-Dusqj7-j.cjs → tool-loop-agent-D4gSdYuN.cjs} +3 -3
  375. package/dist/{tool-loop-agent-CFsOjueT.js → tool-loop-agent-DvZcOxWe.js} +3 -3
  376. package/dist/{utils-CIuOHPoS.cjs → utils-Dd4m7z13.cjs} +1 -1
  377. package/dist/{utils-DLnCt6E9.js → utils-h5k_ChdS.js} +1 -1
  378. package/dist/utils.cjs +1 -1
  379. package/dist/utils.js +1 -1
  380. package/dist/{validate-ShLcQTA5.js → validate-DQB9spZ1.js} +1 -1
  381. package/dist/{validate-1zReLtWc.cjs → validate-u6_TUYSo.cjs} +1 -1
  382. package/dist/vector/index.cjs +1 -1
  383. package/dist/vector/index.js +1 -1
  384. package/dist/worker/index.cjs +1 -1
  385. package/dist/worker/index.d.ts +1 -1
  386. package/dist/worker/index.js +1 -1
  387. package/dist/worker/workers/orchestration-worker.d.ts +13 -0
  388. package/dist/{worker-CQ8rTJwQ.cjs → worker-0F7Nukyf.cjs} +2 -2
  389. package/dist/{worker-BPNrwCFs.cjs → worker-D-cq8McN.cjs} +117 -32
  390. package/dist/{worker-ngt-F1Iv.js → worker-DWOK2M_5.js} +117 -32
  391. package/dist/{worker-CKcQcPl8.js → worker-DmUkyJY_.js} +2 -2
  392. package/dist/{workflow-B_e5wMmz.cjs → workflow-DXE15e-w.cjs} +4 -4
  393. package/dist/{workflow-XDIVRsu4.js → workflow-DamOke3z.js} +4 -4
  394. package/dist/workflows/builder/index.cjs +1 -1
  395. package/dist/workflows/builder/index.js +1 -1
  396. package/dist/workflows/evented/index.cjs +1 -1
  397. package/dist/workflows/evented/index.js +1 -1
  398. package/dist/workflows/evented/setup-warning.d.ts +20 -0
  399. package/dist/workflows/index.cjs +5 -5
  400. package/dist/workflows/index.js +5 -5
  401. package/dist/workflows/scheduler/types.d.ts +3 -0
  402. package/dist/workspace/tools/media.d.ts +2 -2
  403. package/package.json +7 -7
  404. package/src/llm/model/provider-types.generated.d.ts +7689 -7673
@@ -0,0 +1,50 @@
1
+ import { z } from 'zod/v4';
2
+ export declare const ACCOUNT_SWITCH_PART_TYPE: 'data-mastracode-account-switch';
3
+ declare const accountSwitchReasonSchema: z.ZodEnum<{
4
+ "auth-failed": "auth-failed";
5
+ "persistent-outage": "persistent-outage";
6
+ "pool-exhausted": "pool-exhausted";
7
+ "preferred-routing": "preferred-routing";
8
+ "quota-exhausted": "quota-exhausted";
9
+ "rate-limit": "rate-limit";
10
+ }>;
11
+ export type AccountSwitchReason = z.infer<typeof accountSwitchReasonSchema>;
12
+ /** Friendly names for the notice copy (display only, never auth data). */
13
+ export declare const PROVIDER_DISPLAY_NAMES: Record<string, string>;
14
+ declare const accountSwitchPartSchema: z.ZodObject<{
15
+ provider: z.ZodString;
16
+ from: z.ZodCatch<z.ZodNullable<z.ZodObject<{
17
+ id: z.ZodString;
18
+ label: z.ZodString;
19
+ }, z.core.$strip>>>;
20
+ to: z.ZodCatch<z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
21
+ id: z.ZodString;
22
+ label: z.ZodString;
23
+ }, z.core.$strip>>>, z.ZodTransform<{
24
+ id: string;
25
+ label: string;
26
+ } | null, {
27
+ id: string;
28
+ label: string;
29
+ } | null | undefined>>>;
30
+ reason: z.ZodEnum<{
31
+ "auth-failed": "auth-failed";
32
+ "persistent-outage": "persistent-outage";
33
+ "pool-exhausted": "pool-exhausted";
34
+ "preferred-routing": "preferred-routing";
35
+ "quota-exhausted": "quota-exhausted";
36
+ "rate-limit": "rate-limit";
37
+ }>;
38
+ at: z.ZodCatch<z.ZodString>;
39
+ exclusive: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
40
+ }, z.core.$strip>;
41
+ /** Labels and instance ids only, never token material. */
42
+ export type AccountSwitchPartData = z.infer<typeof accountSwitchPartSchema>;
43
+ /** Validates untrusted `reason` values (e.g. persisted message parts). */
44
+ export declare function isAccountSwitchReason(value: unknown): value is AccountSwitchReason;
45
+ /** Reads a persisted switch part; `null` when it is not one. */
46
+ export declare function parseAccountSwitchPart(data: unknown): AccountSwitchPartData | null;
47
+ /** One-line transcript copy for a switch part, the same in every surface that shows it. */
48
+ export declare function accountSwitchNoticeText(data: AccountSwitchPartData): string;
49
+ export {};
50
+ //# sourceMappingURL=account-switch.d.ts.map
@@ -325,6 +325,66 @@ function modelFallbackNoticeText(data, modelName = (label) => label) {
325
325
  function parseModelFallbackPart(data) {
326
326
  return modelFallbackPartSchema.safeParse(data).data ?? null;
327
327
  }
328
+ // src/llm/reasoning/account-switch.ts
329
+ const ACCOUNT_SWITCH_PART_TYPE = "data-mastracode-account-switch";
330
+ const accountSwitchReasonSchema = zod_v4.z.enum([
331
+ "rate-limit",
332
+ "quota-exhausted",
333
+ "auth-failed",
334
+ ...pendingModelFallbackSchema.shape.reason.options,
335
+ "preferred-routing"
336
+ ]);
337
+ const REASON_TEXT = {
338
+ "rate-limit": "rate limit",
339
+ "quota-exhausted": "quota exhausted",
340
+ "auth-failed": "auth failed",
341
+ "pool-exhausted": "pool exhausted",
342
+ "persistent-outage": "persistent outage",
343
+ "preferred-routing": "subscription routing"
344
+ };
345
+ /** Friendly names for the notice copy (display only, never auth data). */
346
+ const PROVIDER_DISPLAY_NAMES = {
347
+ anthropic: "Anthropic",
348
+ "kimi-for-coding": "Kimi",
349
+ "openai-codex": "Codex",
350
+ "github-copilot": "GitHub Copilot",
351
+ xai: "xAI"
352
+ };
353
+ const accountEndpointSchema = zod_v4.z.object({
354
+ id: zod_v4.z.string(),
355
+ label: zod_v4.z.string()
356
+ });
357
+ const accountSwitchPartSchema = zod_v4.z.object({
358
+ provider: zod_v4.z.string(),
359
+ from: accountEndpointSchema.nullable().catch(null),
360
+ to: accountEndpointSchema.nullish().transform((account) => account ?? null).catch({
361
+ id: "unknown",
362
+ label: "unknown"
363
+ }),
364
+ reason: accountSwitchReasonSchema,
365
+ at: zod_v4.z.string().catch(""),
366
+ /**
367
+ * Set on a `to: null` part when a route pinned to a single account reported
368
+ * that account unusable. The provider's other subscriptions were never
369
+ * consulted, so "all accounts unavailable" would misreport what happened.
370
+ */
371
+ exclusive: zod_v4.z.boolean().optional().catch(void 0)
372
+ });
373
+ /** Validates untrusted `reason` values (e.g. persisted message parts). */
374
+ function isAccountSwitchReason(value) {
375
+ return accountSwitchReasonSchema.safeParse(value).success;
376
+ }
377
+ /** Reads a persisted switch part; `null` when it is not one. */
378
+ function parseAccountSwitchPart(data) {
379
+ return accountSwitchPartSchema.safeParse(data).data ?? null;
380
+ }
381
+ /** One-line transcript copy for a switch part, the same in every surface that shows it. */
382
+ function accountSwitchNoticeText(data) {
383
+ const provider = PROVIDER_DISPLAY_NAMES[data.provider] ?? data.provider;
384
+ const reason = REASON_TEXT[data.reason];
385
+ if (data.to === null) return data.exclusive ? `Pinned ${provider} account unavailable (${reason})` : `All ${provider} accounts unavailable (${reason})`;
386
+ return `Switched ${provider} account: ${data.from?.label ?? "unknown"} \u2192 ${data.to.label} (${reason})`;
387
+ }
328
388
  // src/llm/reasoning/thinking-provider-options.ts
329
389
  /**
330
390
  * Per-call `providerOptions` that ask `modelId` to think at `level`, for callers that pass
@@ -360,19 +420,24 @@ function thinkingProviderOptions(modelId, level) {
360
420
  const options = format?.sendEffort?.(runLevel) ?? format?.enableThinking;
361
421
  return format && options ? { [format.optionsKey]: options } : void 0;
362
422
  }
423
+ exports.ACCOUNT_SWITCH_PART_TYPE = ACCOUNT_SWITCH_PART_TYPE;
363
424
  exports.ANTHROPIC_THINKING_BUDGET_TOKENS = ANTHROPIC_THINKING_BUDGET_TOKENS;
364
425
  exports.MASTRA_GATEWAY_PREFIX = MASTRA_GATEWAY_PREFIX;
365
426
  exports.MODEL_FALLBACK_PART_TYPE = MODEL_FALLBACK_PART_TYPE;
366
427
  exports.MODEL_FALLBACK_STATE_KEY = MODEL_FALLBACK_STATE_KEY;
428
+ exports.PROVIDER_DISPLAY_NAMES = PROVIDER_DISPLAY_NAMES;
367
429
  exports.THINKING_LEVEL_VALUES = THINKING_LEVEL_VALUES;
368
430
  exports.THINK_COMMAND_DESCRIPTOR = THINK_COMMAND_DESCRIPTOR;
431
+ exports.accountSwitchNoticeText = accountSwitchNoticeText;
369
432
  exports.getAnthropicThinkingCapability = getAnthropicThinkingCapability;
370
433
  exports.getAvailableThinkingLevelsForModel = getAvailableThinkingLevelsForModel;
434
+ exports.isAccountSwitchReason = isAccountSwitchReason;
371
435
  exports.isRoutedWithoutThinking = isRoutedWithoutThinking;
372
436
  exports.isThinkingAdapterProvider = isThinkingAdapterProvider;
373
437
  exports.isThinkingLevelSetting = isThinkingLevelSetting;
374
438
  exports.modelFallbackNoticeText = modelFallbackNoticeText;
375
439
  exports.normalizeAnthropicModelId = normalizeAnthropicModelId;
440
+ exports.parseAccountSwitchPart = parseAccountSwitchPart;
376
441
  exports.parseModelFallbackPart = parseModelFallbackPart;
377
442
  exports.parsePendingModelFallback = parsePendingModelFallback;
378
443
  exports.parseThinkCommand = parseThinkCommand;
@@ -1,5 +1,6 @@
1
1
  export * from './thinking.js';
2
2
  export * from './model-fallback.js';
3
+ export * from './account-switch.js';
3
4
  export { MASTRA_GATEWAY_PREFIX, normalizeAnthropicModelId, stripMastraGatewayPrefix } from './model-ids.js';
4
5
  export { ANTHROPIC_THINKING_BUDGET_TOKENS, getAnthropicThinkingCapability, supportsAnthropicXhighEffort, } from './anthropic-thinking.js';
5
6
  export { resolveGoogleThinkingConfig, runGeminiThinkingLevel } from './gemini-thinking.js';
@@ -324,6 +324,66 @@ function modelFallbackNoticeText(data, modelName = (label) => label) {
324
324
  function parseModelFallbackPart(data) {
325
325
  return modelFallbackPartSchema.safeParse(data).data ?? null;
326
326
  }
327
+ // src/llm/reasoning/account-switch.ts
328
+ const ACCOUNT_SWITCH_PART_TYPE = "data-mastracode-account-switch";
329
+ const accountSwitchReasonSchema = z.enum([
330
+ "rate-limit",
331
+ "quota-exhausted",
332
+ "auth-failed",
333
+ ...pendingModelFallbackSchema.shape.reason.options,
334
+ "preferred-routing"
335
+ ]);
336
+ const REASON_TEXT = {
337
+ "rate-limit": "rate limit",
338
+ "quota-exhausted": "quota exhausted",
339
+ "auth-failed": "auth failed",
340
+ "pool-exhausted": "pool exhausted",
341
+ "persistent-outage": "persistent outage",
342
+ "preferred-routing": "subscription routing"
343
+ };
344
+ /** Friendly names for the notice copy (display only, never auth data). */
345
+ const PROVIDER_DISPLAY_NAMES = {
346
+ anthropic: "Anthropic",
347
+ "kimi-for-coding": "Kimi",
348
+ "openai-codex": "Codex",
349
+ "github-copilot": "GitHub Copilot",
350
+ xai: "xAI"
351
+ };
352
+ const accountEndpointSchema = z.object({
353
+ id: z.string(),
354
+ label: z.string()
355
+ });
356
+ const accountSwitchPartSchema = z.object({
357
+ provider: z.string(),
358
+ from: accountEndpointSchema.nullable().catch(null),
359
+ to: accountEndpointSchema.nullish().transform((account) => account ?? null).catch({
360
+ id: "unknown",
361
+ label: "unknown"
362
+ }),
363
+ reason: accountSwitchReasonSchema,
364
+ at: z.string().catch(""),
365
+ /**
366
+ * Set on a `to: null` part when a route pinned to a single account reported
367
+ * that account unusable. The provider's other subscriptions were never
368
+ * consulted, so "all accounts unavailable" would misreport what happened.
369
+ */
370
+ exclusive: z.boolean().optional().catch(void 0)
371
+ });
372
+ /** Validates untrusted `reason` values (e.g. persisted message parts). */
373
+ function isAccountSwitchReason(value) {
374
+ return accountSwitchReasonSchema.safeParse(value).success;
375
+ }
376
+ /** Reads a persisted switch part; `null` when it is not one. */
377
+ function parseAccountSwitchPart(data) {
378
+ return accountSwitchPartSchema.safeParse(data).data ?? null;
379
+ }
380
+ /** One-line transcript copy for a switch part, the same in every surface that shows it. */
381
+ function accountSwitchNoticeText(data) {
382
+ const provider = PROVIDER_DISPLAY_NAMES[data.provider] ?? data.provider;
383
+ const reason = REASON_TEXT[data.reason];
384
+ if (data.to === null) return data.exclusive ? `Pinned ${provider} account unavailable (${reason})` : `All ${provider} accounts unavailable (${reason})`;
385
+ return `Switched ${provider} account: ${data.from?.label ?? "unknown"} \u2192 ${data.to.label} (${reason})`;
386
+ }
327
387
  // src/llm/reasoning/thinking-provider-options.ts
328
388
  /**
329
389
  * Per-call `providerOptions` that ask `modelId` to think at `level`, for callers that pass
@@ -359,4 +419,4 @@ function thinkingProviderOptions(modelId, level) {
359
419
  const options = format?.sendEffort?.(runLevel) ?? format?.enableThinking;
360
420
  return format && options ? { [format.optionsKey]: options } : void 0;
361
421
  }
362
- export { ANTHROPIC_THINKING_BUDGET_TOKENS, MASTRA_GATEWAY_PREFIX, MODEL_FALLBACK_PART_TYPE, MODEL_FALLBACK_STATE_KEY, THINKING_LEVEL_VALUES, THINK_COMMAND_DESCRIPTOR, getAnthropicThinkingCapability, getAvailableThinkingLevelsForModel, isRoutedWithoutThinking, isThinkingAdapterProvider, isThinkingLevelSetting, modelFallbackNoticeText, normalizeAnthropicModelId, parseModelFallbackPart, parsePendingModelFallback, parseThinkCommand, pendingModelFallbackSchema, requestableReasoningOptions, resolveDefaultThinkingLevel, resolveGoogleThinkingConfig, runGeminiThinkingLevel, runThinkingLevel, stripMastraGatewayPrefix, supportsAnthropicXhighEffort, supportsMaxReasoningEffort, thinkingProviderOptions, thinkingRequestFormatFor };
422
+ export { ACCOUNT_SWITCH_PART_TYPE, ANTHROPIC_THINKING_BUDGET_TOKENS, MASTRA_GATEWAY_PREFIX, MODEL_FALLBACK_PART_TYPE, MODEL_FALLBACK_STATE_KEY, PROVIDER_DISPLAY_NAMES, THINKING_LEVEL_VALUES, THINK_COMMAND_DESCRIPTOR, accountSwitchNoticeText, getAnthropicThinkingCapability, getAvailableThinkingLevelsForModel, isAccountSwitchReason, isRoutedWithoutThinking, isThinkingAdapterProvider, isThinkingLevelSetting, modelFallbackNoticeText, normalizeAnthropicModelId, parseAccountSwitchPart, parseModelFallbackPart, parsePendingModelFallback, parseThinkCommand, pendingModelFallbackSchema, requestableReasoningOptions, resolveDefaultThinkingLevel, resolveGoogleThinkingConfig, runGeminiThinkingLevel, runThinkingLevel, stripMastraGatewayPrefix, supportsAnthropicXhighEffort, supportsMaxReasoningEffort, thinkingProviderOptions, thinkingRequestFormatFor };
@@ -1,10 +1,10 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-BrhgMLW6.cjs");
2
- const require_netlify = require("./netlify-CS0VDbb9.cjs");
2
+ const require_netlify = require("./netlify-1lti1j4Z.cjs");
3
3
  const require_model = require("./model-jBymoqGa.cjs");
4
4
  const require_to_prompt = require("./to-prompt-CG-LyaBY.cjs");
5
5
  const require_mastra_gateway_provider_tools = require("./mastra-gateway-provider-tools-WpH3Tmu4.cjs");
6
6
  const require_content = require("./content-CC0W1d5p.cjs");
7
- const require_provider_registry = require("./provider-registry-OggbU6OE.cjs");
7
+ const require_provider_registry = require("./provider-registry-C6jd3Uxi.cjs");
8
8
  const require_error = require("./error-D90lJ6M7.cjs");
9
9
  const require_request_context = require("./request-context-D9RXYCy8.cjs");
10
10
  const require_dynamic_argument = require("./dynamic-argument-CUc1BBOS.cjs");
@@ -1,9 +1,9 @@
1
- import { C as createOpenAICompatible, S as createOpenAI, _ as hasAuthCredentials, a as interpolateUrlTemplate, b as MASTRA_GATEWAY_STREAM_TRANSPORT, c as parseModelRouterId, f as MASTRA_USER_AGENT, g as getGatewayId, h as findGatewayForModel, l as createOpenAI$1, o as applyOpencodeCallTimeSessionHeader, r as ModelsDevGateway, s as applyOpencodeSessionHeader, t as NetlifyGateway, u as createGoogleGenerativeAI, v as shouldEnableGateway, w as EventSourceParserStream, x as MastraModelGateway } from "./netlify-DcY9gHCJ.js";
1
+ import { C as createOpenAICompatible, S as createOpenAI, _ as hasAuthCredentials, a as interpolateUrlTemplate, b as MASTRA_GATEWAY_STREAM_TRANSPORT, c as parseModelRouterId, f as MASTRA_USER_AGENT, g as getGatewayId, h as findGatewayForModel, l as createOpenAI$1, o as applyOpencodeCallTimeSessionHeader, r as ModelsDevGateway, s as applyOpencodeSessionHeader, t as NetlifyGateway, u as createGoogleGenerativeAI, v as shouldEnableGateway, w as EventSourceParserStream, x as MastraModelGateway } from "./netlify-ClBjc0Xg.js";
2
2
  import { n as prepareAzureStrictToolSchemas, r as createStreamFromGenerateResult, t as AISDKV5LanguageModel } from "./model-DS-b2R-R.js";
3
3
  import { i as aiV5PromptToAIV7Prompt, r as aiV5PromptToAIV6Prompt } from "./to-prompt-CMlVGYxC.js";
4
4
  import { n as isMastraGatewayChatModel, r as markMastraGatewayChatModel } from "./mastra-gateway-provider-tools-C-AjGZis.js";
5
5
  import { t as convertToDataContent } from "./content-CFBIylxS.js";
6
- import { f as MastraGateway, l as modelSupportsTemperature, n as PROVIDER_REGISTRY, p as gatewayServesObservationalMemory, t as GatewayRegistry } from "./provider-registry-BvbEoScB.js";
6
+ import { f as MastraGateway, l as modelSupportsTemperature, n as PROVIDER_REGISTRY, p as gatewayServesObservationalMemory, t as GatewayRegistry } from "./provider-registry-C_XQJvu2.js";
7
7
  import { i as MastraError } from "./error-oh2DLsP2.js";
8
8
  import { u as RequestContext } from "./request-context-COnZHt2-.js";
9
9
  import { n as resolveDynamicArgument } from "./dynamic-argument-BzPK3qPN.js";
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_stream = require("../stream-CNqAlDJF.cjs");
3
- const require_execution_fence = require("../execution-fence-BBKnrhWR.cjs");
2
+ const require_stream = require("../stream-DqKDB3nL.cjs");
3
+ const require_execution_fence = require("../execution-fence-C8Q0wWkG.cjs");
4
4
  exports.MastraTimeoutError = require_stream.MastraTimeoutError;
5
5
  exports.createScorer = require_execution_fence.createScorer;
6
6
  exports.createTimeoutAbortSignal = require_stream.createTimeoutAbortSignal;
@@ -1,3 +1,3 @@
1
- import { An as isMastraTimeoutError, En as createTimeoutAbortSignal, Tn as MastraTimeoutError } from "../stream-D2rv1Ut1.js";
2
- import { At as runDefaultCompletionCheck, Ct as formatCompletionFeedback, Dt as generateStructuredFinalResult, Et as generateFinalResult, Mt as runValidation, Nt as loop, Ot as runChecks, St as formatCheckFeedback, Tt as formatValidationFeedback, h as createScorer, jt as runStreamCompletionScorers, kt as runCompletionScorers, wt as formatStreamCompletionFeedback } from "../execution-fence--VdnD7p4.js";
1
+ import { An as isMastraTimeoutError, En as createTimeoutAbortSignal, Tn as MastraTimeoutError } from "../stream-H_wVxqdK.js";
2
+ import { At as runDefaultCompletionCheck, Ct as formatCompletionFeedback, Dt as generateStructuredFinalResult, Et as generateFinalResult, Mt as runValidation, Nt as loop, Ot as runChecks, St as formatCheckFeedback, Tt as formatValidationFeedback, h as createScorer, jt as runStreamCompletionScorers, kt as runCompletionScorers, wt as formatStreamCompletionFeedback } from "../execution-fence-DGFyUV5h.js";
3
3
  export { MastraTimeoutError, createScorer, createTimeoutAbortSignal, formatCheckFeedback, formatCompletionFeedback, formatStreamCompletionFeedback, formatValidationFeedback, generateFinalResult, generateStructuredFinalResult, isMastraTimeoutError, loop, runChecks, runCompletionScorers, runDefaultCompletionCheck, runStreamCompletionScorers, runValidation };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The `autoResumeSuspendedTools` a suspended agentic-loop run executed its latest segment with: the value persisted
3
+ * with its most recent suspension. A resume can override the run's setting, so a resume in another process (or after
4
+ * a restart) that leaves the option out keeps the latest one, not the one the first parked tool call recorded.
5
+ * (#30190)
6
+ *
7
+ * Each tool call that suspends persists the segment's value in its own suspend payload, with its `suspendedAt`.
8
+ * Tool calls that suspend side by side keep one record each, under `__workflow_meta.foreachOutput` or as the step's
9
+ * `output`. The step's own suspend payload mirrors only the first suspended call, so a step with per-call records is
10
+ * read through those records. A per-call record is read through its own payload first: on the evented engine its
11
+ * `output` can hold stale copies of its siblings' records from before it was resumed. A snapshot written before the
12
+ * value was persisted has none, and this returns `undefined`.
13
+ */
14
+ export declare function findLatestSuspendedAutoResume(snapshot: unknown): boolean | undefined;
15
+ //# sourceMappingURL=suspended-run-auto-resume.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import type { ToolSet } from '../../../_types/@internal_ai-sdk-v5@0.0.100/dist/index.js';
2
2
  import type { OuterLLMRun } from '../../types.js';
3
- export declare function createToolCallStep<Tools extends ToolSet = ToolSet, OUTPUT = undefined>({ tools, messageList, options, outputWriter, controller, runId, streamState, modelSpanTracker, _internal, logger, agentId, agentVersionId, resolvedScopes, returnScorerData, mastra, requireToolApproval: requireToolApprovalFromFactory, actor, mcp, agent, }: OuterLLMRun<Tools, OUTPUT>): import("../../../workflows").Step<"toolCallStep", unknown, {
3
+ export declare function createToolCallStep<Tools extends ToolSet = ToolSet, OUTPUT = undefined>({ tools, messageList, options, outputWriter, controller, runId, streamState, modelSpanTracker, _internal, logger, agentId, agentVersionId, resolvedScopes, returnScorerData, autoResumeSuspendedTools, mastra, requireToolApproval: requireToolApprovalFromFactory, actor, mcp, agent, }: OuterLLMRun<Tools, OUTPUT>): import("../../../workflows").Step<"toolCallStep", unknown, {
4
4
  toolCallId: string;
5
5
  toolName: string;
6
6
  args: Record<string, any>;
@@ -1,7 +1,7 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-tIEjjQTE.js";
2
2
  import { i as MastraError } from "./error-oh2DLsP2.js";
3
- import { ft as loadStepResults, un as isSupportedLanguageModel } from "./stream-D2rv1Ut1.js";
4
- import { Ki as assertSupportedPatterns, Ns as createStep, Ps as createWorkflow, d as validateAndSaveScore, l as flushBeforeTraceRead, m as ScorerRunError } from "./execution-fence--VdnD7p4.js";
3
+ import { ft as loadStepResults, un as isSupportedLanguageModel } from "./stream-H_wVxqdK.js";
4
+ import { Ki as assertSupportedPatterns, Ns as createStep, Ps as createWorkflow, d as validateAndSaveScore, l as flushBeforeTraceRead, m as ScorerRunError } from "./execution-fence-DGFyUV5h.js";
5
5
  import { o as MASTRA_RESOURCE_ID_KEY, p as withoutLiveRequestKeys, u as RequestContext } from "./request-context-COnZHt2-.js";
6
6
  import { _ as resolveObservabilityContext } from "./observability-DPDWibyH.js";
7
7
  import { t as EntityType } from "./storage-Cc50aQAp.js";
@@ -1,7 +1,7 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-BrhgMLW6.cjs");
2
2
  const require_error = require("./error-D90lJ6M7.cjs");
3
- const require_stream = require("./stream-CNqAlDJF.cjs");
4
- const require_execution_fence = require("./execution-fence-BBKnrhWR.cjs");
3
+ const require_stream = require("./stream-DqKDB3nL.cjs");
4
+ const require_execution_fence = require("./execution-fence-C8Q0wWkG.cjs");
5
5
  const require_request_context = require("./request-context-D9RXYCy8.cjs");
6
6
  const require_observability = require("./observability-VaoaeadK.cjs");
7
7
  const require_storage = require("./storage-CfG0I2aF.cjs");
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_mastra = require("../mastra-BzWL4xI8.cjs");
2
+ const require_mastra = require("../mastra-B2-HBq1-.cjs");
3
3
  exports.Mastra = require_mastra.Mastra;
@@ -224,8 +224,9 @@ export interface Config<TAgents extends Record<string, Agent<any>> = Record<stri
224
224
  /**
225
225
  * Pub/sub system for event-driven communication between components.
226
226
  *
227
- * The default delivers inside this process. Evented workflows and evented
228
- * agents that run on several processes need a pubsub that redelivers
227
+ * The default delivers inside this process. A pubsub shared by several
228
+ * processes goes with a `cache` they share too. Evented workflows and evented
229
+ * agents that run on several processes also need a pubsub that redelivers
229
230
  * unacknowledged events and a workflows store with step guards.
230
231
  * @see https://mastra.ai/docs/server/pubsub#evented-workflows-and-agents
231
232
  * @default EventEmitterPubSub
@@ -234,13 +235,16 @@ export interface Config<TAgents extends Record<string, Agent<any>> = Record<stri
234
235
  /** Provisional naming/API: registered native-agent policy defaults; execution activation is deferred. */
235
236
  durable?: ExecutionEngineDefaults;
236
237
  /**
237
- * Server cache for storing stream events and other temporary data.
238
- * Used by durable agents for resumable streams - clients can disconnect
239
- * and reconnect without missing events.
240
- *
241
- * When provided, durable agents created without their own cache will
242
- * inherit this cache instance.
238
+ * Server cache that holds each agent run's numbered event log and ownership
239
+ * record. Resumable streams, `observe(runId, { offset })` and the observe and
240
+ * abort routes read it. Agents without their own cache use this one.
243
241
  *
242
+ * The default keeps everything in this process. When `pubsub` reaches other
243
+ * processes, set a cache every process shares, such as `RedisServerCache`
244
+ * from `@mastra/redis`. Otherwise the observe and abort routes only find a
245
+ * run on the process that started it, and evented agent steps that run in
246
+ * another process publish frames an offset can't skip.
247
+ * @see https://mastra.ai/docs/server/pubsub#evented-workflows-and-agents
244
248
  * @default InMemoryServerCache
245
249
  */
246
250
  cache?: MastraServerCache;
@@ -2491,6 +2495,13 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
2491
2495
  getMCPServerById<TMCPServerName extends keyof TMCPServers>(serverId: TMCPServers[TMCPServerName]['id'], version?: string): TMCPServers[TMCPServerName] | undefined;
2492
2496
  addTopicListener(topic: string, listener: (event: any) => Promise<void>): Promise<void>;
2493
2497
  removeTopicListener(topic: string, listener: (event: any) => Promise<void>): Promise<void>;
2498
+ /**
2499
+ * @internal Registers what a workflow event may need on this instance: the durable loop
2500
+ * workflow of every agent added so far, and the experiment workflow for experiment events.
2501
+ * Workers that process this instance's events with their own processor call it before each event;
2502
+ * it does the same setup handleWorkflowEvent does.
2503
+ */
2504
+ __prepareWorkflowEvent(event: Event): Promise<void>;
2494
2505
  /**
2495
2506
  * Process a single workflow event. Shared entry point used by:
2496
2507
  * - pull-mode workers (OrchestrationWorker)
@@ -2514,10 +2525,12 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
2514
2525
  * @internal
2515
2526
  */
2516
2527
  __registerWorkflowEventConsumer(consumer: (event: Event) => Promise<WorkflowEventResult>): () => void;
2528
+ /** @internal */
2529
+ __publishLocalScheduledWorkflowStart(event: Omit<Event, 'id' | 'createdAt'>): Promise<void>;
2517
2530
  /**
2518
- * Hands a workflow event to the instance in this process that is executing
2519
- * its durable-agent run, when that is another instance whose workers are
2520
- * consuming. Returns undefined when the caller should process the event.
2531
+ * Hands a local scheduled start to the scheduler's instance, or a durable-agent
2532
+ * event to the instance executing its run. Returns undefined when the caller
2533
+ * should process the event.
2521
2534
  *
2522
2535
  * Mastra instances sharing an in-process pubsub join the same consumer
2523
2536
  * group, so any of them can receive a step of a run another one started.
@@ -2792,9 +2805,20 @@ export declare class Mastra<TAgents extends Record<string, Agent<any>> = Record<
2792
2805
  * call that ignores the abort), or the lease backend doesn't answer or
2793
2806
  * fails the release, the lease is kept until it expires. Handing runs back can take up to about 1.5 seconds past
2794
2807
  * `drainTimeout`.
2808
+ *
2809
+ * With `drain: 'step'` the instance first stops taking workflow events, so
2810
+ * another process on the same pubsub continues its evented runs. The steps
2811
+ * it is executing still get `drainTimeout` to finish, and the runs it
2812
+ * started are still awaited within the same window while they finish on the
2813
+ * other process. Use it when another process is running during the
2814
+ * shutdown, as in a rolling deploy: with no other process, runs wait for the
2815
+ * next one to start. It is supported on Redis Streams and Valkey Streams,
2816
+ * and ignored on a pubsub that does not redeliver unacknowledged events.
2817
+ * Defaults to `'run'`.
2795
2818
  */
2796
2819
  shutdown(options?: {
2797
2820
  drainTimeout?: number;
2821
+ drain?: 'run' | 'step';
2798
2822
  }): Promise<void>;
2799
2823
  get serverCache(): MastraServerCache;
2800
2824
  }
@@ -1 +1 @@
1
- export { t as Mastra } from "../mastra-oUDN81l8.js";
1
+ export { t as Mastra } from "../mastra-BJ54VxOO.js";