@mastra/core 1.86.0-alpha.6 → 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 (509) hide show
  1. package/dist/_types/@internal_core@0.1.4/dist/memory/index.d.ts +25 -0
  2. package/dist/agent/agent.d.ts +87 -12
  3. package/dist/agent/agent.types.d.ts +34 -2
  4. package/dist/agent/durable/create-durable-agent.d.ts +1 -1
  5. package/dist/agent/durable/create-evented-agent.d.ts +6 -0
  6. package/dist/agent/durable/durable-agent.d.ts +30 -514
  7. package/dist/agent/durable/durable-stream-until-idle.d.ts +2 -1
  8. package/dist/agent/durable/evented-agent.d.ts +2 -5
  9. package/dist/agent/durable/execution-engine.d.ts +20 -3
  10. package/dist/agent/durable/index.cjs +61 -6351
  11. package/dist/agent/durable/index.d.ts +3 -2
  12. package/dist/agent/durable/index.js +50 -6340
  13. package/dist/agent/durable/stream-adapter.d.ts +5 -5
  14. package/dist/agent/durable/types.d.ts +454 -3
  15. package/dist/agent/durable/workflows/durable-loop-builder.d.ts +7 -9
  16. package/dist/agent/helpers.d.ts +1 -1
  17. package/dist/agent/index.cjs +4 -4
  18. package/dist/agent/index.d.ts +1 -1
  19. package/dist/agent/index.js +4 -4
  20. package/dist/agent/streams/execution-capability.d.ts +3 -2
  21. package/dist/agent/streams/execution-policy.d.ts +1 -1
  22. package/dist/agent/streams/types.d.ts +3 -3
  23. package/dist/agent/types.d.ts +30 -5
  24. package/dist/agent-builder/ee/index.cjs +1 -1
  25. package/dist/agent-builder/ee/index.js +1 -1
  26. package/dist/agent-controller/index.cjs +2 -2
  27. package/dist/agent-controller/index.js +2 -2
  28. package/dist/{agent-controller-c4KbZ8DY.js → agent-controller-B7POPub5.js} +9 -9
  29. package/dist/{agent-controller-6ORqG6hK.cjs → agent-controller-DEPayioq.cjs} +9 -9
  30. package/dist/{agent-skills-resolver-BIeWsb01.cjs → agent-skills-resolver-BMoCDoaK.cjs} +1 -1
  31. package/dist/{agent-skills-resolver-k04IRam7.js → agent-skills-resolver-CUEIMDbx.js} +1 -1
  32. package/dist/background-tasks/index.cjs +1 -1
  33. package/dist/background-tasks/index.js +1 -1
  34. package/dist/{background-tasks-Da0c3R-J.cjs → background-tasks-7iftnRK_.cjs} +1 -1
  35. package/dist/{background-tasks-CEglmAt7.js → background-tasks-Cv1ecD6S.js} +1 -1
  36. package/dist/browser/index.cjs +2 -2
  37. package/dist/browser/index.js +2 -2
  38. package/dist/{builder-DS826dWf.cjs → builder-DuJBbQDH.cjs} +3 -3
  39. package/dist/{builder-0V9N8S15.js → builder-Gg-xnX_E.js} +3 -3
  40. package/dist/capabilities/302ai.json +198 -198
  41. package/dist/capabilities/abliteratedllm.json +38 -38
  42. package/dist/capabilities/abliteration-ai.json +6 -6
  43. package/dist/capabilities/above.json +23 -23
  44. package/dist/capabilities/adaption.json +14 -14
  45. package/dist/capabilities/adzuki.json +22 -22
  46. package/dist/capabilities/agentrouter.json +7 -7
  47. package/dist/capabilities/agnes.json +2 -2
  48. package/dist/capabilities/ai-router.json +5 -5
  49. package/dist/capabilities/aiand.json +23 -23
  50. package/dist/capabilities/aigrow.json +15 -15
  51. package/dist/capabilities/aimlapi.json +143 -143
  52. package/dist/capabilities/aipg.json +2 -2
  53. package/dist/capabilities/aixy.json +16 -16
  54. package/dist/capabilities/aki-io.json +12 -12
  55. package/dist/capabilities/alibaba-cn.json +84 -84
  56. package/dist/capabilities/alibaba-coding-plan-cn.json +5 -5
  57. package/dist/capabilities/alibaba-coding-plan.json +5 -5
  58. package/dist/capabilities/alibaba-token-plan-cn.json +51 -51
  59. package/dist/capabilities/alibaba-token-plan.json +52 -52
  60. package/dist/capabilities/alibaba.json +69 -69
  61. package/dist/capabilities/ambient.json +12 -12
  62. package/dist/capabilities/amd.json +10 -10
  63. package/dist/capabilities/anthropic.json +64 -40
  64. package/dist/capabilities/anyapi.json +12 -12
  65. package/dist/capabilities/apiko.json +5 -5
  66. package/dist/capabilities/arcee.json +7 -7
  67. package/dist/capabilities/augure.json +8 -8
  68. package/dist/capabilities/auriko.json +21 -21
  69. package/dist/capabilities/bailing.json +2 -2
  70. package/dist/capabilities/baseten.json +26 -26
  71. package/dist/capabilities/bee.json +4 -4
  72. package/dist/capabilities/berget.json +4 -4
  73. package/dist/capabilities/bothub.json +17 -17
  74. package/dist/capabilities/boundless.json +41 -41
  75. package/dist/capabilities/bumo.json +43 -43
  76. package/dist/capabilities/byteplus.json +31 -31
  77. package/dist/capabilities/cerebras.json +4 -4
  78. package/dist/capabilities/cheapaimodel.json +6 -6
  79. package/dist/capabilities/cheapest-token.json +32 -32
  80. package/dist/capabilities/chutes.json +10 -10
  81. package/dist/capabilities/cline-pass.json +43 -43
  82. package/dist/capabilities/cloudcode.json +8 -8
  83. package/dist/capabilities/cloudferro-sherlock.json +4 -4
  84. package/dist/capabilities/cloudflare-workers-ai.json +31 -31
  85. package/dist/capabilities/commandcode.json +151 -151
  86. package/dist/capabilities/concentrate.json +287 -263
  87. package/dist/capabilities/cortecs.json +106 -106
  88. package/dist/capabilities/crossmodel.json +189 -189
  89. package/dist/capabilities/crusoe.json +3 -3
  90. package/dist/capabilities/daoxe.json +9 -9
  91. package/dist/capabilities/databricks.json +62 -62
  92. package/dist/capabilities/deepinfra.json +97 -88
  93. package/dist/capabilities/deepseek.json +3 -3
  94. package/dist/capabilities/digitalocean.json +114 -114
  95. package/dist/capabilities/dothoosh.json +36 -36
  96. package/dist/capabilities/doubleword.json +29 -29
  97. package/dist/capabilities/edenai.json +443 -442
  98. package/dist/capabilities/empiriolabs.json +172 -172
  99. package/dist/capabilities/engy.json +20 -20
  100. package/dist/capabilities/entrim.json +8 -8
  101. package/dist/capabilities/evroc.json +15 -15
  102. package/dist/capabilities/ezkielyna.json +7 -7
  103. package/dist/capabilities/fastrouter.json +82 -82
  104. package/dist/capabilities/fireworks-ai.json +50 -50
  105. package/dist/capabilities/freemodel.json +24 -24
  106. package/dist/capabilities/friendli.json +6 -6
  107. package/dist/capabilities/frogbot.json +98 -98
  108. package/dist/capabilities/gisoo.json +20 -20
  109. package/dist/capabilities/gmicloud.json +14 -14
  110. package/dist/capabilities/google.json +60 -60
  111. package/dist/capabilities/graphn.json +12 -12
  112. package/dist/capabilities/greenpt.json +33 -33
  113. package/dist/capabilities/groq.json +9 -9
  114. package/dist/capabilities/helicone.json +81 -81
  115. package/dist/capabilities/hopper.json +2 -2
  116. package/dist/capabilities/hostinger-router.json +12 -12
  117. package/dist/capabilities/hpc-ai.json +10 -10
  118. package/dist/capabilities/huawei-maas.json +15 -15
  119. package/dist/capabilities/hubris.json +27 -27
  120. package/dist/capabilities/huggingface.json +59 -50
  121. package/dist/capabilities/humain.json +2 -2
  122. package/dist/capabilities/hyper.json +25 -25
  123. package/dist/capabilities/impossibl.json +140 -140
  124. package/dist/capabilities/inception.json +2 -2
  125. package/dist/capabilities/inceptron.json +8 -8
  126. package/dist/capabilities/inco.json +4 -4
  127. package/dist/capabilities/infer.json +14 -14
  128. package/dist/capabilities/inferall.json +7 -7
  129. package/dist/capabilities/inference-coop.json +15 -15
  130. package/dist/capabilities/inferenceapis.json +18 -18
  131. package/dist/capabilities/inferris.json +4 -4
  132. package/dist/capabilities/infersia.json +13 -13
  133. package/dist/capabilities/infomaniak.json +2 -2
  134. package/dist/capabilities/io-net.json +5 -5
  135. package/dist/capabilities/isoquant.json +4 -4
  136. package/dist/capabilities/iteracompute.json +54 -54
  137. package/dist/capabilities/jalapeno.json +12 -12
  138. package/dist/capabilities/jiekou.json +63 -63
  139. package/dist/capabilities/joingonka.json +4 -4
  140. package/dist/capabilities/jzstoken.json +56 -56
  141. package/dist/capabilities/keln.json +27 -27
  142. package/dist/capabilities/kenari.json +117 -111
  143. package/dist/capabilities/kilo.json +625 -649
  144. package/dist/capabilities/kimi-code-plan-cn.json +6 -6
  145. package/dist/capabilities/kimi-code-plan-global.json +6 -6
  146. package/dist/capabilities/kitani.json +6 -6
  147. package/dist/capabilities/klavo.json +21 -21
  148. package/dist/capabilities/korouter.json +33 -33
  149. package/dist/capabilities/kunavo.json +9 -9
  150. package/dist/capabilities/liquid.json +8 -8
  151. package/dist/capabilities/lithosai.json +3 -3
  152. package/dist/capabilities/llmgateway-providers.json +932 -905
  153. package/dist/capabilities/llmgateway.json +343 -343
  154. package/dist/capabilities/llmtr.json +25 -25
  155. package/dist/capabilities/longcat.json +2 -2
  156. package/dist/capabilities/lowrouter.json +48 -48
  157. package/dist/capabilities/lyceum.json +13 -13
  158. package/dist/capabilities/melious.json +13 -13
  159. package/dist/capabilities/merge-gateway.json +294 -294
  160. package/dist/capabilities/meta.json +10 -10
  161. package/dist/capabilities/minimax-cn-coding-plan.json +6 -6
  162. package/dist/capabilities/minimax-coding-plan.json +6 -6
  163. package/dist/capabilities/mistral.json +20 -20
  164. package/dist/capabilities/mixlayer.json +3 -3
  165. package/dist/capabilities/modal.json +14 -14
  166. package/dist/capabilities/model-oracle-ai.json +19 -19
  167. package/dist/capabilities/modelis.json +19 -19
  168. package/dist/capabilities/modular.json +5 -5
  169. package/dist/capabilities/moneo.json +17 -17
  170. package/dist/capabilities/moonshotai-cn.json +5 -5
  171. package/dist/capabilities/moonshotai.json +5 -5
  172. package/dist/capabilities/morph.json +14 -14
  173. package/dist/capabilities/munito-eu.json +8 -8
  174. package/dist/capabilities/munito.json +10 -10
  175. package/dist/capabilities/nan.json +28 -28
  176. package/dist/capabilities/nano-gpt.json +597 -567
  177. package/dist/capabilities/nearai.json +89 -89
  178. package/dist/capabilities/nebius.json +40 -31
  179. package/dist/capabilities/neon.json +135 -135
  180. package/dist/capabilities/neuralwatt.json +39 -39
  181. package/dist/capabilities/nokeep.json +2 -2
  182. package/dist/capabilities/novita-ai.json +158 -158
  183. package/dist/capabilities/nvidia.json +35 -35
  184. package/dist/capabilities/oathbreaker.json +2 -2
  185. package/dist/capabilities/obscurify.json +26 -26
  186. package/dist/capabilities/oci.json +6 -6
  187. package/dist/capabilities/ofox.json +352 -352
  188. package/dist/capabilities/ollama-cloud.json +52 -52
  189. package/dist/capabilities/openai.json +49 -56
  190. package/dist/capabilities/opencode-go.json +82 -81
  191. package/dist/capabilities/openreason.json +5 -5
  192. package/dist/capabilities/openrouter.json +557 -567
  193. package/dist/capabilities/opper.json +28 -22
  194. package/dist/capabilities/orcarouter.json +230 -230
  195. package/dist/capabilities/outerlabs.json +33 -33
  196. package/dist/capabilities/ovhcloud.json +6 -6
  197. package/dist/capabilities/pareto.json +6 -6
  198. package/dist/capabilities/perplexity-agent.json +58 -58
  199. package/dist/capabilities/perplexity.json +2 -2
  200. package/dist/capabilities/phala.json +22 -22
  201. package/dist/capabilities/pioneer.json +30 -30
  202. package/dist/capabilities/poe.json +122 -122
  203. package/dist/capabilities/poolside.json +3 -3
  204. package/dist/capabilities/powerspring.json +10 -10
  205. package/dist/capabilities/primalabs.json +8 -8
  206. package/dist/capabilities/prime.json +114 -97
  207. package/dist/capabilities/privatemode-ai.json +11 -11
  208. package/dist/capabilities/proxystacks.json +7 -7
  209. package/dist/capabilities/qiniu-ai.json +13 -13
  210. package/dist/capabilities/refuseless.json +7 -7
  211. package/dist/capabilities/regolo-ai.json +6 -6
  212. package/dist/capabilities/requesty.json +172 -189
  213. package/dist/capabilities/ruapi.json +18 -18
  214. package/dist/capabilities/runcrate.json +17 -17
  215. package/dist/capabilities/runinfra.json +16 -16
  216. package/dist/capabilities/sakana.json +6 -6
  217. package/dist/capabilities/sambanova.json +4 -4
  218. package/dist/capabilities/sandbase.json +24 -24
  219. package/dist/capabilities/sarvam.json +12 -12
  220. package/dist/capabilities/scaleway.json +19 -19
  221. package/dist/capabilities/scnet-token-plan.json +10 -10
  222. package/dist/capabilities/scx-ai.json +23 -23
  223. package/dist/capabilities/sensenova.json +14 -14
  224. package/dist/capabilities/siliconflow-cn.json +64 -64
  225. package/dist/capabilities/siliconflow.json +63 -63
  226. package/dist/capabilities/snowflake-cortex.json +23 -23
  227. package/dist/capabilities/sokkan.json +12 -12
  228. package/dist/capabilities/sparrowcodes.json +23 -23
  229. package/dist/capabilities/standardcompute.json +83 -83
  230. package/dist/capabilities/steadyrouter.json +39 -39
  231. package/dist/capabilities/stepfun-ai-step-plan.json +5 -5
  232. package/dist/capabilities/stepfun-ai.json +5 -5
  233. package/dist/capabilities/stepfun-step-plan.json +5 -5
  234. package/dist/capabilities/stepfun.json +5 -5
  235. package/dist/capabilities/stepping-stone.json +16 -16
  236. package/dist/capabilities/superbot-gg.json +4 -4
  237. package/dist/capabilities/synthetic.json +14 -14
  238. package/dist/capabilities/synthorai.json +29 -29
  239. package/dist/capabilities/teamorouter.json +26 -26
  240. package/dist/capabilities/teapot-router.json +13 -13
  241. package/dist/capabilities/tencent-coding-plan.json +2 -2
  242. package/dist/capabilities/tencent-token-plan.json +30 -30
  243. package/dist/capabilities/tencent-tokenhub.json +8 -8
  244. package/dist/capabilities/tensorx.json +45 -45
  245. package/dist/capabilities/tenstorrent.json +8 -8
  246. package/dist/capabilities/the-grid-ai.json +35 -35
  247. package/dist/capabilities/thinkingmachines.json +59 -59
  248. package/dist/capabilities/tinfoil.json +5 -5
  249. package/dist/capabilities/toapis.json +2 -2
  250. package/dist/capabilities/togetherai.json +59 -59
  251. package/dist/capabilities/tokengo.json +24 -24
  252. package/dist/capabilities/tokenify.json +9 -9
  253. package/dist/capabilities/trustedrouter.json +5 -5
  254. package/dist/capabilities/trustedtokens.json +18 -18
  255. package/dist/capabilities/umans-ai-coding-plan.json +18 -18
  256. package/dist/capabilities/umans-ai.json +15 -15
  257. package/dist/capabilities/uncensuredai.json +4 -4
  258. package/dist/capabilities/unrestricted.json +4 -4
  259. package/dist/capabilities/uplinkswitch.json +21 -21
  260. package/dist/capabilities/upstage.json +7 -7
  261. package/dist/capabilities/vancine.json +20 -20
  262. package/dist/capabilities/vercel.json +568 -576
  263. package/dist/capabilities/vivgrid.json +78 -78
  264. package/dist/capabilities/volcengine-coding-plan.json +30 -30
  265. package/dist/capabilities/volcengine.json +35 -35
  266. package/dist/capabilities/vultr.json +27 -27
  267. package/dist/capabilities/wafer.ai.json +16 -16
  268. package/dist/capabilities/wallaby.json +5 -5
  269. package/dist/capabilities/wally.json +11 -11
  270. package/dist/capabilities/wandb.json +21 -21
  271. package/dist/capabilities/watt.json +26 -26
  272. package/dist/capabilities/xai.json +7 -7
  273. package/dist/capabilities/xiaomi-token-plan-ams.json +2 -2
  274. package/dist/capabilities/xiaomi-token-plan-cn.json +3 -3
  275. package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -2
  276. package/dist/capabilities/xiaomi.json +6 -6
  277. package/dist/capabilities/xpersona.json +12 -12
  278. package/dist/capabilities/xxapi.json +31 -31
  279. package/dist/capabilities/zai-coding-plan.json +13 -13
  280. package/dist/capabilities/zai.json +27 -27
  281. package/dist/capabilities/zenifra.json +27 -27
  282. package/dist/capabilities/zenmux.json +195 -195
  283. package/dist/capabilities/zerogpu.json +12 -12
  284. package/dist/capabilities/zhipuai-coding-plan.json +8 -8
  285. package/dist/capabilities/zhipuai.json +27 -27
  286. package/dist/capabilities/zro.json +6 -6
  287. package/dist/channels/agent-channels.d.ts +11 -0
  288. package/dist/channels/chat-tools.d.ts +156 -0
  289. package/dist/channels/index.cjs +7 -2
  290. package/dist/channels/index.d.ts +2 -0
  291. package/dist/channels/index.js +3 -3
  292. package/dist/{channels-C5DxhFRc.js → channels-BRVCOutx.js} +1 -1
  293. package/dist/{channels-B57qQolh.cjs → channels-MjTA9bFp.cjs} +1 -1
  294. package/dist/coding-agent/index.cjs +4 -4
  295. package/dist/coding-agent/index.js +4 -4
  296. package/dist/{constants-DaBkXs5H.cjs → constants-B9ZDvXZ4.cjs} +41 -0
  297. package/dist/{constants-BDHIyN28.js → constants-BmdTvEYN.js} +30 -1
  298. package/dist/datasets/dataset.d.ts +13 -6
  299. package/dist/datasets/experiment/durable.d.ts +16 -0
  300. package/dist/datasets/experiment/index.d.ts +2 -1
  301. package/dist/datasets/experiment/item.d.ts +26 -4
  302. package/dist/datasets/experiment/retries.d.ts +18 -0
  303. package/dist/datasets/experiment/types.d.ts +18 -0
  304. package/dist/datasets/experiment/workflow-id.d.ts +7 -0
  305. package/dist/datasets/experiment/workflow.d.ts +74 -0
  306. package/dist/datasets/index.cjs +3 -2
  307. package/dist/datasets/index.d.ts +2 -1
  308. package/dist/datasets/index.js +3 -3
  309. package/dist/docs/SKILL.md +2 -2
  310. package/dist/docs/assets/SOURCE_MAP.json +1309 -1304
  311. package/dist/docs/references/docs-deployment-workers.md +1 -1
  312. package/dist/docs/references/docs-evals-experiments.md +29 -1
  313. package/dist/docs/references/docs-harness-durable-agents.md +9 -5
  314. package/dist/docs/references/docs-knowledge-agents-and-tools.md +1 -0
  315. package/dist/docs/references/docs-knowledge-load-your-content.md +1 -1
  316. package/dist/docs/references/docs-mastra-platform-observability-overview.md +1 -1
  317. package/dist/docs/references/docs-server-pubsub.md +51 -8
  318. package/dist/docs/references/docs-signals-running-across-processes.md +2 -0
  319. package/dist/docs/references/docs-workflows-overview.md +1 -1
  320. package/dist/docs/references/docs-workflows-scheduled-workflows.md +1 -1
  321. package/dist/docs/references/integrations-channels-slack.md +4 -2
  322. package/dist/docs/references/integrations.md +6 -0
  323. package/dist/docs/references/reference-agents-agent.md +3 -1
  324. package/dist/docs/references/reference-agents-channels.md +146 -24
  325. package/dist/docs/references/reference-agents-durable-agent.md +28 -2
  326. package/dist/docs/references/reference-datasets-runExperimentItem.md +13 -1
  327. package/dist/docs/references/reference-datasets-startExperimentAsync.md +3 -1
  328. package/dist/docs/references/reference-editor-mastra-editor.md +3 -1
  329. package/dist/docs/references/reference-knowledge-knowledge-class.md +2 -2
  330. package/dist/docs/references/reference-knowledge-knowledge-tools.md +43 -20
  331. package/dist/docs/references/reference-processors-moderation-processor.md +2 -2
  332. package/dist/docs/references/reference-pubsub-base.md +5 -1
  333. package/dist/docs/references/reference-pubsub-event-emitter.md +2 -0
  334. package/dist/docs/references/reference-pubsub-redis-streams.md +1 -1
  335. package/dist/docs/references/reference-pubsub-unix-socket-pubsub.md +2 -0
  336. package/dist/docs/references/reference-streaming-ChunkType.md +1 -1
  337. package/dist/docs/references/reference-workers-overview.md +1 -1
  338. package/dist/docs/references/reference-workflows-run-methods-start.md +23 -0
  339. package/dist/docs/references/reference-workflows-run-methods-timeTravel.md +4 -0
  340. package/dist/docs/references/reference-workflows-run.md +1 -1
  341. package/dist/evals/index.cjs +2 -2
  342. package/dist/evals/index.js +2 -2
  343. package/dist/evals/scoreTraces/index.cjs +2 -2
  344. package/dist/evals/scoreTraces/index.js +2 -2
  345. package/dist/events/caching-pubsub.d.ts +1 -0
  346. package/dist/events/event-emitter/index.d.ts +12 -5
  347. package/dist/events/index.cjs +15 -1
  348. package/dist/events/index.js +15 -1
  349. package/dist/events/pubsub.d.ts +29 -0
  350. package/dist/events/reach.d.ts +11 -0
  351. package/dist/events/unix-socket-pubsub.d.ts +14 -0
  352. package/dist/{filesystem-CUj0vclS.cjs → filesystem-B0AZrbj8.cjs} +1 -1
  353. package/dist/{filesystem-BBqrAmKK.js → filesystem-B3s0WRud.js} +1 -1
  354. package/dist/{filesystem-B_HACoLS.js → filesystem-B5X-5G0x.js} +1 -1
  355. package/dist/{filesystem-pZNvxjuW.cjs → filesystem-BDSpwBke.cjs} +1 -1
  356. package/dist/{filesystem-5Z777gYZ.js → filesystem-BsdkC311.js} +1 -1
  357. package/dist/{filesystem-BNHPgtjJ.cjs → filesystem-C-cyJfi1.cjs} +1 -1
  358. package/dist/{filesystem-U5o28b5w.cjs → filesystem-CEbD_77-.cjs} +1 -1
  359. package/dist/{filesystem-yHKEz2Pr.cjs → filesystem-CUAgLugE.cjs} +1 -1
  360. package/dist/{filesystem-Cb8iTPM-.js → filesystem-Cv79mHRk.js} +1 -1
  361. package/dist/{filesystem-DhiaddZe.cjs → filesystem-DsCQiBl2.cjs} +1 -1
  362. package/dist/{filesystem-DSYDB3ek.js → filesystem-DzM9pcQ8.js} +1 -1
  363. package/dist/{filesystem-gpIfFMed.js → filesystem-DzfqVTO_.js} +1 -1
  364. package/dist/{filesystem-versioned-CxbiSJF-.js → filesystem-versioned-Bijb_p9l.js} +44 -44
  365. package/dist/harness/index.cjs +2 -2
  366. package/dist/harness/index.js +2 -2
  367. package/dist/index.cjs +1 -1
  368. package/dist/index.js +1 -1
  369. package/dist/knowledge/index.cjs +1 -1
  370. package/dist/knowledge/index.js +1 -1
  371. package/dist/llm/index.cjs +3 -3
  372. package/dist/llm/index.js +3 -3
  373. package/dist/llm/model/provider-types.generated.d.ts +7720 -7720
  374. package/dist/llm/model/shared.types.d.ts +31 -0
  375. package/dist/{llm-B0VtQDgT.js → llm-Djd8Qzi0.js} +2 -2
  376. package/dist/{llm-ByskI6z3.cjs → llm-DmUucguC.cjs} +2 -2
  377. package/dist/loop/base-loop-builder.d.ts +60 -0
  378. package/dist/loop/index.cjs +2 -2
  379. package/dist/loop/index.js +2 -2
  380. package/dist/loop/loop-builder.d.ts +10 -32
  381. package/dist/loop/workflows/agentic-execution/index.d.ts +1 -1
  382. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +2 -2
  383. package/dist/loop/workflows/agentic-loop/index.d.ts +1 -1
  384. package/dist/{manager-C2RGNH68.js → manager-CO_Xz2zR.js} +461 -95
  385. package/dist/{manager-BJKx4lQf.cjs → manager-D27PkIPo.cjs} +477 -93
  386. package/dist/mastra/index.cjs +1 -1
  387. package/dist/mastra/index.d.ts +13 -0
  388. package/dist/mastra/index.js +1 -1
  389. package/dist/{mastra-zUTq9ilk.js → mastra-Ch00nEAJ.js} +66 -25
  390. package/dist/{mastra-FXCeC5rF.cjs → mastra-qsVWpOTi.cjs} +66 -25
  391. package/dist/memory/index.cjs +2 -2
  392. package/dist/memory/index.js +2 -2
  393. package/dist/{model-BTNRPDgQ.js → model-CW-mfGYA.js} +1 -1
  394. package/dist/{model-BmTFNo62.cjs → model-Do6DTJoj.cjs} +1 -1
  395. package/dist/{netlify-B_XdjYPY.cjs → netlify-DU32SDT6.cjs} +1 -1
  396. package/dist/{netlify-BCSVhO5q.js → netlify-DZSAbdve.js} +1 -1
  397. package/dist/notifications/index.cjs +1 -1
  398. package/dist/notifications/index.js +1 -1
  399. package/dist/{output-helpers-CncZ3y-g.cjs → output-helpers-1Zu4Vt9C.cjs} +112 -69
  400. package/dist/{output-helpers-RlvE2WPA.js → output-helpers-CedRCE17.js} +113 -70
  401. package/dist/processor-provider/index.cjs +1 -1
  402. package/dist/processor-provider/index.js +1 -1
  403. package/dist/processors/index.cjs +2 -2
  404. package/dist/processors/index.js +2 -2
  405. package/dist/processors/processors/pii-detector.d.ts +1 -0
  406. package/dist/{provider-registry-Ble43Wb4.js → provider-registry-deA0x-Gd.js} +21349 -21338
  407. package/dist/{provider-registry-D8O1G18A.cjs → provider-registry-zGezZVsL.cjs} +21349 -21338
  408. package/dist/provider-registry.json +21695 -21680
  409. package/dist/{registry-generator-BQ1noftK.cjs → registry-generator-BkQ1AxZn.cjs} +1 -1
  410. package/dist/{registry-generator-D1Zslex6.js → registry-generator-VvBfOKAD.js} +1 -1
  411. package/dist/{rehydrate-CgxEur9m.js → rehydrate-BjLV643n.js} +2 -2
  412. package/dist/{rehydrate-BiA_HUJH.cjs → rehydrate-DDYFpQsV.cjs} +2 -2
  413. package/dist/relevance/index.cjs +2 -2
  414. package/dist/relevance/index.js +2 -2
  415. package/dist/{run-registry-aomba2_Z.cjs → run-registry-5Suldxz3.cjs} +83965 -77543
  416. package/dist/{run-registry-BUFmc_78.js → run-registry-CGRPldLH.js} +84057 -77017
  417. package/dist/{scheduler-BuivoTeD.js → scheduler-B-VZUvv_.js} +1 -1
  418. package/dist/{scheduler-COSuIH7R.cjs → scheduler-D00X03jQ.cjs} +1 -1
  419. package/dist/schedules/index.cjs +1 -1
  420. package/dist/schedules/index.js +1 -1
  421. package/dist/{schedules-Dmu9qOgc.js → schedules-DZfSx-7P.js} +94 -94
  422. package/dist/{signal-provider-CicwpNwY.cjs → signal-provider-BFAvh_AJ.cjs} +1 -1
  423. package/dist/{signal-provider-BOtSN-_0.js → signal-provider-BslnAjWG.js} +1 -1
  424. package/dist/signals/index.cjs +3 -3
  425. package/dist/signals/index.js +3 -3
  426. package/dist/{signals-6EBDPHQX.cjs → signals-B1JSj-Ew.cjs} +2 -2
  427. package/dist/{signals-BH__LS8Y.js → signals-De9VnwL2.js} +2 -2
  428. package/dist/skills/index.cjs +2 -2
  429. package/dist/skills/index.js +2 -2
  430. package/dist/{source-8qxr6KJv.cjs → source-DDwx-87N.cjs} +1 -1
  431. package/dist/{source-DRqDgbCv.js → source-Did_2XQc.js} +1 -1
  432. package/dist/{state-processor-BRk8t1OR.js → state-processor-B9kxpM53.js} +140 -140
  433. package/dist/{state-processor-Bfs9LkY8.cjs → state-processor-kRNZ38Nf.cjs} +139 -139
  434. package/dist/storage/constants.cjs +1 -1
  435. package/dist/storage/constants.js +1 -1
  436. package/dist/storage/domains/agents/index.cjs +1 -1
  437. package/dist/storage/domains/agents/index.js +1 -1
  438. package/dist/storage/domains/knowledge/base.d.ts +5 -0
  439. package/dist/storage/domains/knowledge/inmemory.d.ts +1 -0
  440. package/dist/storage/domains/knowledge/pages.d.ts +24 -7
  441. package/dist/storage/domains/mcp-clients/index.cjs +1 -1
  442. package/dist/storage/domains/mcp-clients/index.js +1 -1
  443. package/dist/storage/domains/mcp-servers/index.cjs +1 -1
  444. package/dist/storage/domains/mcp-servers/index.js +1 -1
  445. package/dist/storage/domains/memory/base.d.ts +3 -1
  446. package/dist/storage/domains/memory/observational-memory-lifecycle.d.ts +1 -1
  447. package/dist/storage/domains/prompt-blocks/index.cjs +1 -1
  448. package/dist/storage/domains/prompt-blocks/index.js +1 -1
  449. package/dist/storage/domains/scorer-definitions/index.cjs +1 -1
  450. package/dist/storage/domains/scorer-definitions/index.js +1 -1
  451. package/dist/storage/domains/skills/index.cjs +1 -1
  452. package/dist/storage/domains/skills/index.js +1 -1
  453. package/dist/storage/domains/workspaces/index.cjs +1 -1
  454. package/dist/storage/domains/workspaces/index.js +1 -1
  455. package/dist/storage/index.cjs +12 -11
  456. package/dist/storage/index.js +12 -12
  457. package/dist/storage/types.d.ts +13 -0
  458. package/dist/stream/base/output.d.ts +42 -15
  459. package/dist/stream/index.cjs +2 -2
  460. package/dist/stream/index.js +2 -2
  461. package/dist/stream/types.d.ts +19 -0
  462. package/dist/{stream-S_NC5v9e.js → stream-Dpwx0whf.js} +1 -1
  463. package/dist/{stream-DUrp3Fcy.cjs → stream-Dvy_0o14.cjs} +1 -1
  464. package/dist/test-utils/llm-mock.cjs +1 -1
  465. package/dist/test-utils/llm-mock.js +1 -1
  466. package/dist/tool-loop-agent/index.cjs +1 -1
  467. package/dist/tool-loop-agent/index.js +1 -1
  468. package/dist/{tool-loop-agent-BhCzpGfr.js → tool-loop-agent-PbWrEj1k.js} +3 -3
  469. package/dist/{tool-loop-agent-DU0BiemT.cjs → tool-loop-agent-UxOv3FoK.cjs} +3 -3
  470. package/dist/tools/index.cjs +1 -1
  471. package/dist/tools/index.js +1 -1
  472. package/dist/tools/types.d.ts +27 -1
  473. package/dist/{utils-CeEt4K7t.cjs → utils-BbMTlyBO.cjs} +1 -1
  474. package/dist/{utils-DYIai19q.js → utils-BnNi1BYM.js} +1 -1
  475. package/dist/utils.cjs +1 -1
  476. package/dist/utils.js +1 -1
  477. package/dist/{validate-BRikrNhF.js → validate-HSBcm96b.js} +1 -1
  478. package/dist/{validate-BckgxuJ0.cjs → validate-Skps-cM3.cjs} +1 -1
  479. package/dist/vector/index.cjs +1 -1
  480. package/dist/vector/index.js +1 -1
  481. package/dist/worker/index.cjs +1 -1
  482. package/dist/worker/index.js +1 -1
  483. package/dist/{worker-BfhUD77l.cjs → worker-BE-0DyKL.cjs} +3 -3
  484. package/dist/{worker-DcBfwJqD.js → worker-BKrKHZzU.js} +3 -3
  485. package/dist/{worker-D9WwmcJa.cjs → worker-BNS5A3qP.cjs} +3 -3
  486. package/dist/{worker-Du5ybt5o.js → worker-DehaD4qD.js} +3 -3
  487. package/dist/{workflow-BWV5m9Mx.cjs → workflow-BjUTwaK9.cjs} +4 -4
  488. package/dist/{workflow-jNWVBYDJ.js → workflow-Bvw6yDjc.js} +4 -4
  489. package/dist/workflows/builder/index.cjs +1 -1
  490. package/dist/workflows/builder/index.js +1 -1
  491. package/dist/workflows/evented/index.cjs +1 -1
  492. package/dist/workflows/evented/index.js +1 -1
  493. package/dist/workflows/evented/setup-warning.d.ts +18 -0
  494. package/dist/workflows/evented/workflow-event-processor/run-status.d.ts +37 -0
  495. package/dist/workflows/evented/workflow.d.ts +11 -1
  496. package/dist/workflows/index.cjs +6 -6
  497. package/dist/workflows/index.js +6 -6
  498. package/dist/workflows/workflow.d.ts +6 -1
  499. package/dist/workspace/index.cjs +2 -2
  500. package/dist/workspace/index.js +2 -2
  501. package/dist/{workspace-D7JRhn1Z.js → workspace-C05xDH60.js} +564 -411
  502. package/dist/{workspace-BQ2wZj5D.cjs → workspace-D1OzzlLw.cjs} +564 -411
  503. package/dist/{workspace-skills-CGiXfKzA.js → workspace-skills-38OY32_b.js} +531 -531
  504. package/package.json +6 -6
  505. package/src/llm/model/provider-types.generated.d.ts +7720 -7720
  506. package/dist/agent/durable/evented-execution-engine.d.ts +0 -20
  507. package/dist/{filesystem-versioned-D-OCaYSl.cjs → filesystem-versioned-DZGyPbNC.cjs} +43 -43
  508. package/dist/{schedules-qIHUKsj4.cjs → schedules-BZS8McF7.cjs} +93 -93
  509. package/dist/{workspace-skills-CUSjYHdi.cjs → workspace-skills-BcquhPDn.cjs} +530 -530
@@ -2,7 +2,42 @@ const require_rolldown_runtime = require("./rolldown-runtime-BrhgMLW6.cjs");
2
2
  const require_error_count = require("./error-count-DeDpeWU2.cjs");
3
3
  let events = require("events");
4
4
  events = require_rolldown_runtime.__toESM(events, 1);
5
+ // src/events/acking-callback.ts
6
+ /**
7
+ * Adapt an event-only handler into an `EventCallback` that acknowledges every
8
+ * delivery.
9
+ *
10
+ * Handlers that only need the event cannot honour the `EventCallback` contract
11
+ * themselves: on a durable backend (Redis consumer groups, GCP Pub/Sub) every
12
+ * delivery — including the ones a handler inspects and filters out — has to be
13
+ * acked, or it stays in the subscription's pending set and is redelivered.
14
+ * Wrapping is the only way an event-only handler can satisfy that.
15
+ *
16
+ * A throwing handler leaves the delivery unacked and rejects the callback, which
17
+ * a backend that honours redelivery treats as a nack.
18
+ */
19
+ function withAck(handler) {
20
+ return async (event, ack) => {
21
+ await handler(event);
22
+ await ack?.();
23
+ };
24
+ }
5
25
  // src/events/pubsub.ts
26
+ /**
27
+ * The event bus behind workflow execution, streams, signals, background tasks
28
+ * and schedules.
29
+ *
30
+ * Mastra decides how to behave from the capability getters below
31
+ * (`deliversAcrossProcesses`, `redeliversUnacked`, `supportedModes`, ...), never
32
+ * from which transport class the instance is. An implementation states what its
33
+ * transport does by overriding them.
34
+ *
35
+ * Evented workflows and evented agents can run on any implementation inside one
36
+ * process. Running them on several processes needs a pubsub that redelivers
37
+ * unacknowledged events and a workflows store with step guards.
38
+ *
39
+ * @see https://mastra.ai/docs/server/pubsub#evented-workflows-and-agents
40
+ */
6
41
  var PubSub = class {
7
42
  /**
8
43
  * Delete all retained state for a topic (cached history, persistent stream
@@ -79,6 +114,19 @@ var PubSub = class {
79
114
  return false;
80
115
  }
81
116
  /**
117
+ * Whether an event published here can reach a subscriber in another process.
118
+ * Defaults to `true`, so an implementation is treated as a shared transport
119
+ * unless it says otherwise: runs are fenced against other processes, and
120
+ * shutdown detaches from the evented runs other processes may still execute
121
+ * instead of stopping them.
122
+ *
123
+ * Return `false` only when every subscriber lives in the publishing process.
124
+ * Mastra then skips that cross-process coordination.
125
+ */
126
+ get deliversAcrossProcesses() {
127
+ return true;
128
+ }
129
+ /**
82
130
  * Whether a message delivered to a consumer that neither acks nor nacks it
83
131
  * (for example because its process died) is delivered again to a consumer of
84
132
  * the same group once the broker considers it abandoned. Defaults to `false`.
@@ -88,6 +136,9 @@ var PubSub = class {
88
136
  * pass restarts the run. The broker's abandonment threshold must be at least
89
137
  * 30 s, the evented step fence a dead worker leaves behind; a redelivery that
90
138
  * arrives before the fence expires is dropped as a duplicate.
139
+ *
140
+ * Evented workflows and agents that run on several processes need `true`
141
+ * here. Without it, no other worker picks up the step a stopped worker held.
91
142
  */
92
143
  get redeliversUnacked() {
93
144
  return false;
@@ -469,12 +520,17 @@ var AckHandleBuffer = class {
469
520
  const NOOP_ACK = async () => {};
470
521
  /**
471
522
  * The default pubsub: delivers events inside the process that published them.
523
+ * It needs no external service, and nothing it holds outlives the process.
524
+ *
525
+ * Evented workflows and evented agents run on it in one process: local
526
+ * development, tests, and a single server. It is not a transport for running
527
+ * them on several instances. Each instance has its own emitter, so an event
528
+ * never reaches another instance, and instances that share one storage each
529
+ * treat the others' runs as their own to recover. Use a pubsub that redelivers
530
+ * unacknowledged events for that.
472
531
  *
473
- * Several Mastra instances that share one storage but each use their own
474
- * `EventEmitterPubSub` are not supported for evented workflows: every instance
475
- * treats the others' runs as its own to recover. A multi-instance evented
476
- * deployment needs a broker such as Redis Streams, Valkey Streams or Google
477
- * Cloud Pub/Sub.
532
+ * The leases, consumer groups and nack redelivery here coordinate subscribers
533
+ * of this one process. They give no guarantee across processes.
478
534
  */
479
535
  var EventEmitterPubSub = class extends PubSub {
480
536
  get supportedModes() {
@@ -489,6 +545,10 @@ var EventEmitterPubSub = class extends PubSub {
489
545
  get supportsNativeBatching() {
490
546
  return true;
491
547
  }
548
+ /** Every subscriber is a listener on this process's emitter. */
549
+ get deliversAcrossProcesses() {
550
+ return false;
551
+ }
492
552
  /**
493
553
  * Ack and nack are no-ops here: a message lives only in the process that
494
554
  * published it, so nothing redelivers it once that process stops.
@@ -767,70 +827,6 @@ var EventEmitterPubSub = class extends PubSub {
767
827
  return Promise.resolve(true);
768
828
  }
769
829
  };
770
- // src/events/acking-callback.ts
771
- /**
772
- * Adapt an event-only handler into an `EventCallback` that acknowledges every
773
- * delivery.
774
- *
775
- * Handlers that only need the event cannot honour the `EventCallback` contract
776
- * themselves: on a durable backend (Redis consumer groups, GCP Pub/Sub) every
777
- * delivery — including the ones a handler inspects and filters out — has to be
778
- * acked, or it stays in the subscription's pending set and is redelivered.
779
- * Wrapping is the only way an event-only handler can satisfy that.
780
- *
781
- * A throwing handler leaves the delivery unacked and rejects the callback, which
782
- * a backend that honours redelivery treats as a nack.
783
- */
784
- function withAck(handler) {
785
- return async (event, ack) => {
786
- await handler(event);
787
- await ack?.();
788
- };
789
- }
790
- // src/events/codec/error.ts
791
- const MAX_CAUSE_DEPTH = 5;
792
- /**
793
- * Serializes an Error instance to a plain SerializedError object without
794
- * mutating the original. Unlike `getErrorFromUnknown(...).toJSON()`, this does
795
- * not attach a non-enumerable `toJSON` to the live Error.
796
- */
797
- function serializeError(err, depth = 0) {
798
- const json = {
799
- name: err.name || "Error",
800
- message: err.message
801
- };
802
- if (err.stack !== void 0) json.stack = err.stack;
803
- if (err.cause !== void 0) {
804
- if (err.cause instanceof Error && depth < MAX_CAUSE_DEPTH) json.cause = serializeError(err.cause, depth + 1);
805
- else json.cause = err.cause;
806
- }
807
- for (const key in err) {
808
- if (!Object.prototype.hasOwnProperty.call(err, key)) continue;
809
- if (key === "message" || key === "name" || key === "stack" || key === "cause" || key === "__mastraSpanErrorOrigin") continue;
810
- json[key] = err[key];
811
- }
812
- const origin = require_error_count.getSpanErrorOrigin(err);
813
- if (origin) json.__mastraSpanErrorOrigin = origin;
814
- return json;
815
- }
816
- /**
817
- * Rehydrates a SerializedError into a vanilla Error instance. We never
818
- * instantiate user-controlled prototypes — name is preserved as a string field.
819
- */
820
- function rehydrateError(s) {
821
- const cause = s.cause !== void 0 ? s.cause && typeof s.cause === "object" && "message" in s.cause && "name" in s.cause ? rehydrateError(s.cause) : s.cause : void 0;
822
- const err = cause !== void 0 ? new Error(s.message, { cause }) : new Error(s.message);
823
- if (s.name) err.name = s.name;
824
- if (s.stack !== void 0) err.stack = s.stack;
825
- for (const key in s) {
826
- if (!Object.prototype.hasOwnProperty.call(s, key)) continue;
827
- if (key === "message" || key === "name" || key === "stack" || key === "cause" || key === "__mastraSpanErrorOrigin") continue;
828
- err[key] = s[key];
829
- }
830
- const origin = require_error_count.getSpanErrorOrigin(s);
831
- if (origin) require_error_count.setSpanErrorOrigin(err, origin);
832
- return err;
833
- }
834
830
  // src/stream/strip-model-snapshots.ts
835
831
  /**
836
832
  * Removes the model request/history snapshots that agent `step-start`,
@@ -979,6 +975,50 @@ function toCachedLogFrame(topic, event) {
979
975
  data
980
976
  };
981
977
  }
978
+ // src/events/codec/error.ts
979
+ const MAX_CAUSE_DEPTH = 5;
980
+ /**
981
+ * Serializes an Error instance to a plain SerializedError object without
982
+ * mutating the original. Unlike `getErrorFromUnknown(...).toJSON()`, this does
983
+ * not attach a non-enumerable `toJSON` to the live Error.
984
+ */
985
+ function serializeError(err, depth = 0) {
986
+ const json = {
987
+ name: err.name || "Error",
988
+ message: err.message
989
+ };
990
+ if (err.stack !== void 0) json.stack = err.stack;
991
+ if (err.cause !== void 0) {
992
+ if (err.cause instanceof Error && depth < MAX_CAUSE_DEPTH) json.cause = serializeError(err.cause, depth + 1);
993
+ else json.cause = err.cause;
994
+ }
995
+ for (const key in err) {
996
+ if (!Object.prototype.hasOwnProperty.call(err, key)) continue;
997
+ if (key === "message" || key === "name" || key === "stack" || key === "cause" || key === "__mastraSpanErrorOrigin") continue;
998
+ json[key] = err[key];
999
+ }
1000
+ const origin = require_error_count.getSpanErrorOrigin(err);
1001
+ if (origin) json.__mastraSpanErrorOrigin = origin;
1002
+ return json;
1003
+ }
1004
+ /**
1005
+ * Rehydrates a SerializedError into a vanilla Error instance. We never
1006
+ * instantiate user-controlled prototypes — name is preserved as a string field.
1007
+ */
1008
+ function rehydrateError(s) {
1009
+ const cause = s.cause !== void 0 ? s.cause && typeof s.cause === "object" && "message" in s.cause && "name" in s.cause ? rehydrateError(s.cause) : s.cause : void 0;
1010
+ const err = cause !== void 0 ? new Error(s.message, { cause }) : new Error(s.message);
1011
+ if (s.name) err.name = s.name;
1012
+ if (s.stack !== void 0) err.stack = s.stack;
1013
+ for (const key in s) {
1014
+ if (!Object.prototype.hasOwnProperty.call(s, key)) continue;
1015
+ if (key === "message" || key === "name" || key === "stack" || key === "cause" || key === "__mastraSpanErrorOrigin") continue;
1016
+ err[key] = s[key];
1017
+ }
1018
+ const origin = require_error_count.getSpanErrorOrigin(s);
1019
+ if (origin) require_error_count.setSpanErrorOrigin(err, origin);
1020
+ return err;
1021
+ }
982
1022
  // src/events/caching-pubsub.ts
983
1023
  const EMPTY_INDICES = /* @__PURE__ */ new Set();
984
1024
  /**
@@ -1083,6 +1123,9 @@ var CachingPubSub = class extends PubSub {
1083
1123
  get supportsOffsets() {
1084
1124
  return true;
1085
1125
  }
1126
+ get deliversAcrossProcesses() {
1127
+ return this.inner.deliversAcrossProcesses;
1128
+ }
1086
1129
  get redeliversUnacked() {
1087
1130
  return this.inner.redeliversUnacked;
1088
1131
  }
@@ -1,6 +1,41 @@
1
1
  import { i as setSpanErrorOrigin, n as getSpanErrorOrigin } from "./error-count-BH-rJW7q.js";
2
2
  import EventEmitter$1 from "events";
3
+ // src/events/acking-callback.ts
4
+ /**
5
+ * Adapt an event-only handler into an `EventCallback` that acknowledges every
6
+ * delivery.
7
+ *
8
+ * Handlers that only need the event cannot honour the `EventCallback` contract
9
+ * themselves: on a durable backend (Redis consumer groups, GCP Pub/Sub) every
10
+ * delivery — including the ones a handler inspects and filters out — has to be
11
+ * acked, or it stays in the subscription's pending set and is redelivered.
12
+ * Wrapping is the only way an event-only handler can satisfy that.
13
+ *
14
+ * A throwing handler leaves the delivery unacked and rejects the callback, which
15
+ * a backend that honours redelivery treats as a nack.
16
+ */
17
+ function withAck(handler) {
18
+ return async (event, ack) => {
19
+ await handler(event);
20
+ await ack?.();
21
+ };
22
+ }
3
23
  // src/events/pubsub.ts
24
+ /**
25
+ * The event bus behind workflow execution, streams, signals, background tasks
26
+ * and schedules.
27
+ *
28
+ * Mastra decides how to behave from the capability getters below
29
+ * (`deliversAcrossProcesses`, `redeliversUnacked`, `supportedModes`, ...), never
30
+ * from which transport class the instance is. An implementation states what its
31
+ * transport does by overriding them.
32
+ *
33
+ * Evented workflows and evented agents can run on any implementation inside one
34
+ * process. Running them on several processes needs a pubsub that redelivers
35
+ * unacknowledged events and a workflows store with step guards.
36
+ *
37
+ * @see https://mastra.ai/docs/server/pubsub#evented-workflows-and-agents
38
+ */
4
39
  var PubSub = class {
5
40
  /**
6
41
  * Delete all retained state for a topic (cached history, persistent stream
@@ -77,6 +112,19 @@ var PubSub = class {
77
112
  return false;
78
113
  }
79
114
  /**
115
+ * Whether an event published here can reach a subscriber in another process.
116
+ * Defaults to `true`, so an implementation is treated as a shared transport
117
+ * unless it says otherwise: runs are fenced against other processes, and
118
+ * shutdown detaches from the evented runs other processes may still execute
119
+ * instead of stopping them.
120
+ *
121
+ * Return `false` only when every subscriber lives in the publishing process.
122
+ * Mastra then skips that cross-process coordination.
123
+ */
124
+ get deliversAcrossProcesses() {
125
+ return true;
126
+ }
127
+ /**
80
128
  * Whether a message delivered to a consumer that neither acks nor nacks it
81
129
  * (for example because its process died) is delivered again to a consumer of
82
130
  * the same group once the broker considers it abandoned. Defaults to `false`.
@@ -86,6 +134,9 @@ var PubSub = class {
86
134
  * pass restarts the run. The broker's abandonment threshold must be at least
87
135
  * 30 s, the evented step fence a dead worker leaves behind; a redelivery that
88
136
  * arrives before the fence expires is dropped as a duplicate.
137
+ *
138
+ * Evented workflows and agents that run on several processes need `true`
139
+ * here. Without it, no other worker picks up the step a stopped worker held.
89
140
  */
90
141
  get redeliversUnacked() {
91
142
  return false;
@@ -467,12 +518,17 @@ var AckHandleBuffer = class {
467
518
  const NOOP_ACK = async () => {};
468
519
  /**
469
520
  * The default pubsub: delivers events inside the process that published them.
521
+ * It needs no external service, and nothing it holds outlives the process.
522
+ *
523
+ * Evented workflows and evented agents run on it in one process: local
524
+ * development, tests, and a single server. It is not a transport for running
525
+ * them on several instances. Each instance has its own emitter, so an event
526
+ * never reaches another instance, and instances that share one storage each
527
+ * treat the others' runs as their own to recover. Use a pubsub that redelivers
528
+ * unacknowledged events for that.
470
529
  *
471
- * Several Mastra instances that share one storage but each use their own
472
- * `EventEmitterPubSub` are not supported for evented workflows: every instance
473
- * treats the others' runs as its own to recover. A multi-instance evented
474
- * deployment needs a broker such as Redis Streams, Valkey Streams or Google
475
- * Cloud Pub/Sub.
530
+ * The leases, consumer groups and nack redelivery here coordinate subscribers
531
+ * of this one process. They give no guarantee across processes.
476
532
  */
477
533
  var EventEmitterPubSub = class extends PubSub {
478
534
  get supportedModes() {
@@ -487,6 +543,10 @@ var EventEmitterPubSub = class extends PubSub {
487
543
  get supportsNativeBatching() {
488
544
  return true;
489
545
  }
546
+ /** Every subscriber is a listener on this process's emitter. */
547
+ get deliversAcrossProcesses() {
548
+ return false;
549
+ }
490
550
  /**
491
551
  * Ack and nack are no-ops here: a message lives only in the process that
492
552
  * published it, so nothing redelivers it once that process stops.
@@ -765,70 +825,6 @@ var EventEmitterPubSub = class extends PubSub {
765
825
  return Promise.resolve(true);
766
826
  }
767
827
  };
768
- // src/events/acking-callback.ts
769
- /**
770
- * Adapt an event-only handler into an `EventCallback` that acknowledges every
771
- * delivery.
772
- *
773
- * Handlers that only need the event cannot honour the `EventCallback` contract
774
- * themselves: on a durable backend (Redis consumer groups, GCP Pub/Sub) every
775
- * delivery — including the ones a handler inspects and filters out — has to be
776
- * acked, or it stays in the subscription's pending set and is redelivered.
777
- * Wrapping is the only way an event-only handler can satisfy that.
778
- *
779
- * A throwing handler leaves the delivery unacked and rejects the callback, which
780
- * a backend that honours redelivery treats as a nack.
781
- */
782
- function withAck(handler) {
783
- return async (event, ack) => {
784
- await handler(event);
785
- await ack?.();
786
- };
787
- }
788
- // src/events/codec/error.ts
789
- const MAX_CAUSE_DEPTH = 5;
790
- /**
791
- * Serializes an Error instance to a plain SerializedError object without
792
- * mutating the original. Unlike `getErrorFromUnknown(...).toJSON()`, this does
793
- * not attach a non-enumerable `toJSON` to the live Error.
794
- */
795
- function serializeError(err, depth = 0) {
796
- const json = {
797
- name: err.name || "Error",
798
- message: err.message
799
- };
800
- if (err.stack !== void 0) json.stack = err.stack;
801
- if (err.cause !== void 0) {
802
- if (err.cause instanceof Error && depth < MAX_CAUSE_DEPTH) json.cause = serializeError(err.cause, depth + 1);
803
- else json.cause = err.cause;
804
- }
805
- for (const key in err) {
806
- if (!Object.prototype.hasOwnProperty.call(err, key)) continue;
807
- if (key === "message" || key === "name" || key === "stack" || key === "cause" || key === "__mastraSpanErrorOrigin") continue;
808
- json[key] = err[key];
809
- }
810
- const origin = getSpanErrorOrigin(err);
811
- if (origin) json.__mastraSpanErrorOrigin = origin;
812
- return json;
813
- }
814
- /**
815
- * Rehydrates a SerializedError into a vanilla Error instance. We never
816
- * instantiate user-controlled prototypes — name is preserved as a string field.
817
- */
818
- function rehydrateError(s) {
819
- const cause = s.cause !== void 0 ? s.cause && typeof s.cause === "object" && "message" in s.cause && "name" in s.cause ? rehydrateError(s.cause) : s.cause : void 0;
820
- const err = cause !== void 0 ? new Error(s.message, { cause }) : new Error(s.message);
821
- if (s.name) err.name = s.name;
822
- if (s.stack !== void 0) err.stack = s.stack;
823
- for (const key in s) {
824
- if (!Object.prototype.hasOwnProperty.call(s, key)) continue;
825
- if (key === "message" || key === "name" || key === "stack" || key === "cause" || key === "__mastraSpanErrorOrigin") continue;
826
- err[key] = s[key];
827
- }
828
- const origin = getSpanErrorOrigin(s);
829
- if (origin) setSpanErrorOrigin(err, origin);
830
- return err;
831
- }
832
828
  // src/stream/strip-model-snapshots.ts
833
829
  /**
834
830
  * Removes the model request/history snapshots that agent `step-start`,
@@ -977,6 +973,50 @@ function toCachedLogFrame(topic, event) {
977
973
  data
978
974
  };
979
975
  }
976
+ // src/events/codec/error.ts
977
+ const MAX_CAUSE_DEPTH = 5;
978
+ /**
979
+ * Serializes an Error instance to a plain SerializedError object without
980
+ * mutating the original. Unlike `getErrorFromUnknown(...).toJSON()`, this does
981
+ * not attach a non-enumerable `toJSON` to the live Error.
982
+ */
983
+ function serializeError(err, depth = 0) {
984
+ const json = {
985
+ name: err.name || "Error",
986
+ message: err.message
987
+ };
988
+ if (err.stack !== void 0) json.stack = err.stack;
989
+ if (err.cause !== void 0) {
990
+ if (err.cause instanceof Error && depth < MAX_CAUSE_DEPTH) json.cause = serializeError(err.cause, depth + 1);
991
+ else json.cause = err.cause;
992
+ }
993
+ for (const key in err) {
994
+ if (!Object.prototype.hasOwnProperty.call(err, key)) continue;
995
+ if (key === "message" || key === "name" || key === "stack" || key === "cause" || key === "__mastraSpanErrorOrigin") continue;
996
+ json[key] = err[key];
997
+ }
998
+ const origin = getSpanErrorOrigin(err);
999
+ if (origin) json.__mastraSpanErrorOrigin = origin;
1000
+ return json;
1001
+ }
1002
+ /**
1003
+ * Rehydrates a SerializedError into a vanilla Error instance. We never
1004
+ * instantiate user-controlled prototypes — name is preserved as a string field.
1005
+ */
1006
+ function rehydrateError(s) {
1007
+ const cause = s.cause !== void 0 ? s.cause && typeof s.cause === "object" && "message" in s.cause && "name" in s.cause ? rehydrateError(s.cause) : s.cause : void 0;
1008
+ const err = cause !== void 0 ? new Error(s.message, { cause }) : new Error(s.message);
1009
+ if (s.name) err.name = s.name;
1010
+ if (s.stack !== void 0) err.stack = s.stack;
1011
+ for (const key in s) {
1012
+ if (!Object.prototype.hasOwnProperty.call(s, key)) continue;
1013
+ if (key === "message" || key === "name" || key === "stack" || key === "cause" || key === "__mastraSpanErrorOrigin") continue;
1014
+ err[key] = s[key];
1015
+ }
1016
+ const origin = getSpanErrorOrigin(s);
1017
+ if (origin) setSpanErrorOrigin(err, origin);
1018
+ return err;
1019
+ }
980
1020
  // src/events/caching-pubsub.ts
981
1021
  const EMPTY_INDICES = /* @__PURE__ */ new Set();
982
1022
  /**
@@ -1081,6 +1121,9 @@ var CachingPubSub = class extends PubSub {
1081
1121
  get supportsOffsets() {
1082
1122
  return true;
1083
1123
  }
1124
+ get deliversAcrossProcesses() {
1125
+ return this.inner.deliversAcrossProcesses;
1126
+ }
1084
1127
  get redeliversUnacked() {
1085
1128
  return this.inner.redeliversUnacked;
1086
1129
  }
@@ -1538,4 +1581,4 @@ var DefaultStepResult = class {
1538
1581
  return this.toolResults.filter((toolResult) => toolResult.dynamic === true);
1539
1582
  }
1540
1583
  };
1541
- export { NoopLeaseProvider as _, RUN_LOCAL_TOPIC_PREFIXES as a, isRunLocalTopic as c, slimProgressChunk as d, stripModelSnapshots as f, EventEmitterPubSub as g, withAck as h, withCaching as i, toCachedLogFrame as l, serializeError as m, PublisherQueueLimitError as n, RUN_LOG_TTL_MS as o, rehydrateError as p, CachingPubSub as r, cachedLogTtlMs as s, DefaultStepResult as t, slimNestedAgentChunks as u, PubSub as v, isLeaseProvider as y };
1584
+ export { PubSub as _, rehydrateError as a, RUN_LOG_TTL_MS as c, toCachedLogFrame as d, slimNestedAgentChunks as f, NoopLeaseProvider as g, EventEmitterPubSub as h, withCaching as i, cachedLogTtlMs as l, stripModelSnapshots as m, PublisherQueueLimitError as n, serializeError as o, slimProgressChunk as p, CachingPubSub as r, RUN_LOCAL_TOPIC_PREFIXES as s, DefaultStepResult as t, isRunLocalTopic as u, isLeaseProvider as v, withAck as y };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_run_registry = require("../run-registry-aomba2_Z.cjs");
2
+ const require_run_registry = require("../run-registry-5Suldxz3.cjs");
3
3
  let zod_v4 = require("zod/v4");
4
4
  // src/processor-provider/types.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { Zt as ToolCallFilter, an as BatchPartsProcessor, cn as LanguageDetector, dn as ModerationProcessor, ln as PIIDetector, md as UnicodeNormalizer, nn as TokenLimiterProcessor, tn as SystemPromptScrubber, un as PromptInjectionDetector } from "../run-registry-BUFmc_78.js";
1
+ import { Ho as ToolCallFilter, Ko as SystemPromptScrubber, as as PIIDetector, cs as UnicodeNormalizer, es as BatchPartsProcessor, is as LanguageDetector, os as PromptInjectionDetector, qo as TokenLimiterProcessor, ss as ModerationProcessor } from "../run-registry-CGRPldLH.js";
2
2
  import { z } from "zod/v4";
3
3
  // src/processor-provider/types.ts
4
4
  /**
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_stream = require("../stream-DUrp3Fcy.cjs");
3
- const require_run_registry = require("../run-registry-aomba2_Z.cjs");
2
+ const require_run_registry = require("../run-registry-5Suldxz3.cjs");
3
+ const require_stream = require("../stream-Dvy_0o14.cjs");
4
4
  exports.AgentsMDInjector = require_run_registry.AgentsMDInjector;
5
5
  exports.BaseProcessor = require_run_registry.BaseProcessor;
6
6
  exports.BatchPartsProcessor = require_run_registry.BatchPartsProcessor;
@@ -1,3 +1,3 @@
1
- import { B as REPROCESS_PART_KEY, D as ProcessorState, E as ProcessorRunner, F as ProviderHistoryCompat, I as anthropicToolIdFormat, L as cerebrasStripReasoningContent, Q as createProcessorSendSignal, R as openaiOrphanItemId, nn as isProcessorWorkflow } from "../stream-S_NC5v9e.js";
2
- import { $t as CostGuardProcessor, $u as ProcessorStepInputSchema, Cd as isRetryableOpenAIResponsesStreamError, Ct as WorkingMemory, Gt as RESPONSE_CACHE_CONTEXT_KEY, Gu as MessagePartSchema, Ho as SkillsProcessor, Ht as createBackgroundWorkSignalProcessor, Hu as FilePartSchema, Jt as SkillSearchProcessor, Ju as ProcessorMessageContentSchema, Kt as ResponseCache, Ku as ProcessorInputPhaseSchema, Qt as RegexFilterProcessor, Qu as ProcessorOutputStreamPhaseSchema, Sd as isBadRequestError, St as globalEmbeddingCache, Uo as formatSkillsCatalog, Ut as CyberRefusalHandler, Uu as ImagePartSchema, Vo as WorkspaceInstructionsProcessor, Wt as DEFAULT_RESPONSE_CACHE_TTL_SECONDS, Wu as MessageContentSchema, Xt as AgentsMDInjector, Xu as ProcessorOutputResultPhaseSchema, Yt as ToolSearchProcessor, Yu as ProcessorMessageSchema, Zt as ToolCallFilter, Zu as ProcessorOutputStepPhaseSchema, _d as isMalformedFunctionCallError, ad as TextPartSchema, an as BatchPartsProcessor, bd as FILE_UPLOAD_ERROR_CODES, bt as MemoryInputFilter, cn as LanguageDetector, dn as ModerationProcessor, ed as ProcessorStepOutputSchema, en as TokenCostControl, gd as defaultStabilityErrorProcessors, hd as STABILITY_ERROR_PROCESSOR_IDS, id as StepStartPartSchema, ln as PIIDetector, lr as StructuredOutputProcessor, md as UnicodeNormalizer, nd as ReasoningPartSchema, nn as TokenLimiterProcessor, od as ToolInvocationPartSchema, on as ModelSelectionProcessor, qt as buildResponseCacheKey, qu as ProcessorInputStepPhaseSchema, rd as SourcePartSchema, sn as ClassifierProcessor, td as ProcessorStepSchema, tn as SystemPromptScrubber, un as PromptInjectionDetector, vd as UnsupportedFileHandler, wd as PrefillErrorHandler, wt as MessageHistory, xd as StreamErrorRetryProcessor, xt as SemanticRecall, yd as FileUploadProcessor, yt as BaseProcessor } from "../run-registry-BUFmc_78.js";
1
+ import { Al as ToolInvocationPartSchema, Ao as createBackgroundWorkSignalProcessor, Bo as ToolSearchProcessor, Cl as ProcessorStepInputSchema, Dl as SourcePartSchema, El as ReasoningPartSchema, Fo as buildResponseCacheKey, Gn as WorkingMemory, Go as TokenCostControl, Hn as MemoryInputFilter, Ho as ToolCallFilter, Io as WorkspaceInstructionsProcessor, Kn as MessageHistory, Ko as SystemPromptScrubber, Lo as SkillSearchProcessor, Mo as DEFAULT_RESPONSE_CACHE_TTL_SECONDS, No as RESPONSE_CACHE_CONTEXT_KEY, Ol as StepStartPartSchema, Po as ResponseCache, Ro as SkillsProcessor, Sl as ProcessorOutputStreamPhaseSchema, Tl as ProcessorStepSchema, Un as SemanticRecall, Uo as RegexFilterProcessor, Vn as BaseProcessor, Vo as AgentsMDInjector, Wn as globalEmbeddingCache, Wo as CostGuardProcessor, _l as ProcessorInputStepPhaseSchema, _s as isRetryableOpenAIResponsesStreamError, as as PIIDetector, bl as ProcessorOutputResultPhaseSchema, cs as UnicodeNormalizer, ds as isMalformedFunctionCallError, es as BatchPartsProcessor, fl as FilePartSchema, fs as UnsupportedFileHandler, gl as ProcessorInputPhaseSchema, gs as isBadRequestError, hl as MessagePartSchema, hs as StreamErrorRetryProcessor, is as LanguageDetector, jo as CyberRefusalHandler, kl as TextPartSchema, ls as STABILITY_ERROR_PROCESSOR_IDS, ml as MessageContentSchema, ms as FILE_UPLOAD_ERROR_CODES, ns as ClassifierProcessor, os as PromptInjectionDetector, pl as ImagePartSchema, ps as FileUploadProcessor, qo as TokenLimiterProcessor, rs as StructuredOutputProcessor, ss as ModerationProcessor, ts as ModelSelectionProcessor, us as defaultStabilityErrorProcessors, vl as ProcessorMessageContentSchema, vs as PrefillErrorHandler, wl as ProcessorStepOutputSchema, xl as ProcessorOutputStepPhaseSchema, yl as ProcessorMessageSchema, zo as formatSkillsCatalog } from "../run-registry-CGRPldLH.js";
2
+ import { B as REPROCESS_PART_KEY, D as ProcessorState, E as ProcessorRunner, F as ProviderHistoryCompat, I as anthropicToolIdFormat, L as cerebrasStripReasoningContent, Q as createProcessorSendSignal, R as openaiOrphanItemId, nn as isProcessorWorkflow } from "../stream-Dpwx0whf.js";
3
3
  export { AgentsMDInjector, BaseProcessor, BatchPartsProcessor, ClassifierProcessor, CostGuardProcessor, CyberRefusalHandler, DEFAULT_RESPONSE_CACHE_TTL_SECONDS, FILE_UPLOAD_ERROR_CODES, FilePartSchema, FileUploadProcessor, ImagePartSchema, LanguageDetector, MemoryInputFilter, MessageContentSchema, MessageHistory, MessagePartSchema, ModelSelectionProcessor, ModerationProcessor, PIIDetector, PrefillErrorHandler, ProcessorInputPhaseSchema, ProcessorInputStepPhaseSchema, ProcessorMessageContentSchema, ProcessorMessageSchema, ProcessorOutputResultPhaseSchema, ProcessorOutputStepPhaseSchema, ProcessorOutputStreamPhaseSchema, ProcessorRunner, ProcessorState, ProcessorStepInputSchema, ProcessorStepOutputSchema, ProcessorStepSchema, PromptInjectionDetector, ProviderHistoryCompat, REPROCESS_PART_KEY, RESPONSE_CACHE_CONTEXT_KEY, ReasoningPartSchema, RegexFilterProcessor, ResponseCache, STABILITY_ERROR_PROCESSOR_IDS, SemanticRecall, SkillSearchProcessor, SkillsProcessor, SourcePartSchema, StepStartPartSchema, StreamErrorRetryProcessor, StructuredOutputProcessor, SystemPromptScrubber, TextPartSchema, TokenCostControl, TokenLimiterProcessor as TokenLimiter, TokenLimiterProcessor, ToolCallFilter, ToolInvocationPartSchema, ToolSearchProcessor, UnicodeNormalizer, UnsupportedFileHandler, WorkingMemory, WorkspaceInstructionsProcessor, anthropicToolIdFormat, buildResponseCacheKey, cerebrasStripReasoningContent, createBackgroundWorkSignalProcessor, createProcessorSendSignal, defaultStabilityErrorProcessors, formatSkillsCatalog, globalEmbeddingCache, isBadRequestError, isMalformedFunctionCallError, isProcessorWorkflow, isRetryableOpenAIResponsesStreamError, openaiOrphanItemId };
@@ -188,6 +188,7 @@ export declare class PIIDetector implements Processor<'pii-detector'> {
188
188
  * These run instead of LLM calls in processOutputStream to eliminate
189
189
  * per-chunk API costs and latency.
190
190
  */
191
+ private static readonly EMAIL_CONTINUATION;
191
192
  private static readonly PII_PATTERNS;
192
193
  /** PII types that require LLM context and cannot be detected by regex */
193
194
  private static readonly LLM_ONLY_TYPES;