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

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 (450) 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 +27 -11
  3. package/dist/agent/agent.types.d.ts +4 -0
  4. package/dist/agent/durable/create-durable-agent.d.ts +1 -1
  5. package/dist/agent/durable/durable-agent.d.ts +30 -500
  6. package/dist/agent/durable/durable-stream-until-idle.d.ts +2 -1
  7. package/dist/agent/durable/evented-agent.d.ts +2 -5
  8. package/dist/agent/durable/execution-engine.d.ts +20 -3
  9. package/dist/agent/durable/index.cjs +55 -6338
  10. package/dist/agent/durable/index.d.ts +3 -2
  11. package/dist/agent/durable/index.js +44 -6327
  12. package/dist/agent/durable/stream-adapter.d.ts +5 -5
  13. package/dist/agent/durable/types.d.ts +454 -3
  14. package/dist/agent/durable/workflows/durable-loop-builder.d.ts +7 -9
  15. package/dist/agent/helpers.d.ts +1 -1
  16. package/dist/agent/index.cjs +4 -4
  17. package/dist/agent/index.d.ts +1 -1
  18. package/dist/agent/index.js +4 -4
  19. package/dist/agent/streams/execution-capability.d.ts +3 -2
  20. package/dist/agent/streams/execution-policy.d.ts +1 -1
  21. package/dist/agent/streams/types.d.ts +3 -3
  22. package/dist/agent/types.d.ts +5 -5
  23. package/dist/agent-builder/ee/index.cjs +1 -1
  24. package/dist/agent-builder/ee/index.js +1 -1
  25. package/dist/agent-controller/index.cjs +2 -2
  26. package/dist/agent-controller/index.js +2 -2
  27. package/dist/{agent-controller-c4KbZ8DY.js → agent-controller-Cf3_IuY8.js} +9 -9
  28. package/dist/{agent-controller-6ORqG6hK.cjs → agent-controller-K5vHtqfO.cjs} +9 -9
  29. package/dist/{agent-skills-resolver-BIeWsb01.cjs → agent-skills-resolver-BMoCDoaK.cjs} +1 -1
  30. package/dist/{agent-skills-resolver-k04IRam7.js → agent-skills-resolver-CUEIMDbx.js} +1 -1
  31. package/dist/background-tasks/index.cjs +1 -1
  32. package/dist/background-tasks/index.js +1 -1
  33. package/dist/{background-tasks-CEglmAt7.js → background-tasks-BgpX1P_s.js} +1 -1
  34. package/dist/{background-tasks-Da0c3R-J.cjs → background-tasks-DqnQMfuf.cjs} +1 -1
  35. package/dist/browser/index.cjs +2 -2
  36. package/dist/browser/index.js +2 -2
  37. package/dist/{builder-DS826dWf.cjs → builder-D8Osghdo.cjs} +3 -3
  38. package/dist/{builder-0V9N8S15.js → builder-x295GDL6.js} +3 -3
  39. package/dist/capabilities/302ai.json +191 -191
  40. package/dist/capabilities/abliteratedllm.json +36 -36
  41. package/dist/capabilities/abliteration-ai.json +7 -7
  42. package/dist/capabilities/above.json +20 -20
  43. package/dist/capabilities/adaption.json +10 -10
  44. package/dist/capabilities/adzuki.json +31 -31
  45. package/dist/capabilities/agentrouter.json +10 -10
  46. package/dist/capabilities/ai-router.json +9 -9
  47. package/dist/capabilities/aiand.json +19 -19
  48. package/dist/capabilities/aigrow.json +14 -14
  49. package/dist/capabilities/aimlapi.json +142 -142
  50. package/dist/capabilities/aipg.json +2 -2
  51. package/dist/capabilities/aixy.json +20 -20
  52. package/dist/capabilities/aki-io.json +15 -15
  53. package/dist/capabilities/alibaba-cn.json +90 -90
  54. package/dist/capabilities/alibaba-coding-plan-cn.json +5 -5
  55. package/dist/capabilities/alibaba-coding-plan.json +5 -5
  56. package/dist/capabilities/alibaba-token-plan-cn.json +55 -55
  57. package/dist/capabilities/alibaba-token-plan.json +57 -57
  58. package/dist/capabilities/alibaba.json +64 -64
  59. package/dist/capabilities/ambient.json +12 -12
  60. package/dist/capabilities/amd.json +8 -8
  61. package/dist/capabilities/anthropic.json +60 -36
  62. package/dist/capabilities/anyapi.json +14 -14
  63. package/dist/capabilities/apiko.json +2 -2
  64. package/dist/capabilities/arcee.json +11 -11
  65. package/dist/capabilities/augure.json +5 -5
  66. package/dist/capabilities/auriko.json +19 -19
  67. package/dist/capabilities/bailing.json +5 -5
  68. package/dist/capabilities/baseten.json +18 -18
  69. package/dist/capabilities/bee.json +3 -3
  70. package/dist/capabilities/berget.json +8 -8
  71. package/dist/capabilities/bothub.json +13 -13
  72. package/dist/capabilities/boundless.json +35 -35
  73. package/dist/capabilities/bumo.json +44 -44
  74. package/dist/capabilities/byteplus.json +31 -31
  75. package/dist/capabilities/cerebras.json +4 -4
  76. package/dist/capabilities/cheapaimodel.json +10 -10
  77. package/dist/capabilities/cheapest-token.json +31 -31
  78. package/dist/capabilities/chutes.json +8 -8
  79. package/dist/capabilities/cline-pass.json +41 -41
  80. package/dist/capabilities/cloudcode.json +7 -7
  81. package/dist/capabilities/cloudflare-workers-ai.json +31 -31
  82. package/dist/capabilities/commandcode.json +147 -147
  83. package/dist/capabilities/concentrate.json +259 -259
  84. package/dist/capabilities/cortecs.json +109 -109
  85. package/dist/capabilities/crossmodel.json +169 -169
  86. package/dist/capabilities/crusoe.json +10 -10
  87. package/dist/capabilities/daoxe.json +9 -9
  88. package/dist/capabilities/databricks.json +59 -59
  89. package/dist/capabilities/deepinfra.json +85 -85
  90. package/dist/capabilities/deepseek.json +3 -3
  91. package/dist/capabilities/digitalocean.json +113 -113
  92. package/dist/capabilities/dothoosh.json +29 -29
  93. package/dist/capabilities/doubleword.json +23 -23
  94. package/dist/capabilities/edenai.json +454 -453
  95. package/dist/capabilities/empiriolabs.json +170 -170
  96. package/dist/capabilities/engy.json +22 -22
  97. package/dist/capabilities/entrim.json +6 -6
  98. package/dist/capabilities/evroc.json +16 -16
  99. package/dist/capabilities/ezkielyna.json +9 -9
  100. package/dist/capabilities/fastrouter.json +80 -80
  101. package/dist/capabilities/fireworks-ai.json +65 -65
  102. package/dist/capabilities/freemodel.json +21 -21
  103. package/dist/capabilities/friendli.json +6 -6
  104. package/dist/capabilities/frogbot.json +89 -89
  105. package/dist/capabilities/gisoo.json +19 -19
  106. package/dist/capabilities/gmicloud.json +16 -16
  107. package/dist/capabilities/google.json +57 -57
  108. package/dist/capabilities/graphn.json +12 -12
  109. package/dist/capabilities/greenpt.json +34 -34
  110. package/dist/capabilities/groq.json +2 -2
  111. package/dist/capabilities/helicone.json +83 -83
  112. package/dist/capabilities/hostinger-router.json +11 -11
  113. package/dist/capabilities/hpc-ai.json +14 -14
  114. package/dist/capabilities/huawei-maas.json +14 -14
  115. package/dist/capabilities/hubris.json +25 -25
  116. package/dist/capabilities/huggingface.json +48 -48
  117. package/dist/capabilities/hyper.json +26 -26
  118. package/dist/capabilities/impossibl.json +132 -132
  119. package/dist/capabilities/inception.json +2 -2
  120. package/dist/capabilities/inco.json +5 -5
  121. package/dist/capabilities/infer.json +12 -12
  122. package/dist/capabilities/inferall.json +10 -10
  123. package/dist/capabilities/inference-coop.json +11 -11
  124. package/dist/capabilities/inferenceapis.json +6 -6
  125. package/dist/capabilities/inferris.json +4 -4
  126. package/dist/capabilities/infersia.json +14 -14
  127. package/dist/capabilities/inferx.json +3 -3
  128. package/dist/capabilities/infomaniak.json +4 -4
  129. package/dist/capabilities/io-net.json +2 -2
  130. package/dist/capabilities/isoquant.json +4 -4
  131. package/dist/capabilities/iteracompute.json +60 -60
  132. package/dist/capabilities/jad-ai.json +3 -3
  133. package/dist/capabilities/jalapeno.json +10 -10
  134. package/dist/capabilities/jiekou.json +65 -65
  135. package/dist/capabilities/jzstoken.json +52 -52
  136. package/dist/capabilities/keln.json +23 -23
  137. package/dist/capabilities/kenari.json +122 -116
  138. package/dist/capabilities/kilo.json +627 -627
  139. package/dist/capabilities/kimi-code-plan-cn.json +7 -7
  140. package/dist/capabilities/kimi-code-plan-global.json +7 -7
  141. package/dist/capabilities/kitani.json +2 -2
  142. package/dist/capabilities/klavo.json +24 -24
  143. package/dist/capabilities/korouter.json +29 -29
  144. package/dist/capabilities/kunavo.json +7 -7
  145. package/dist/capabilities/liquid.json +10 -10
  146. package/dist/capabilities/lithosai.json +2 -2
  147. package/dist/capabilities/llmgateway-providers.json +890 -890
  148. package/dist/capabilities/llmgateway.json +333 -333
  149. package/dist/capabilities/llmtr.json +30 -30
  150. package/dist/capabilities/longcat.json +3 -3
  151. package/dist/capabilities/lowrouter.json +51 -51
  152. package/dist/capabilities/lyceum.json +14 -14
  153. package/dist/capabilities/melious.json +15 -15
  154. package/dist/capabilities/merge-gateway.json +236 -236
  155. package/dist/capabilities/meta.json +11 -11
  156. package/dist/capabilities/mistral.json +21 -21
  157. package/dist/capabilities/mixlayer.json +3 -3
  158. package/dist/capabilities/modal.json +10 -10
  159. package/dist/capabilities/model-oracle-ai.json +24 -24
  160. package/dist/capabilities/modelis.json +20 -20
  161. package/dist/capabilities/modelscope.json +2 -2
  162. package/dist/capabilities/modular.json +5 -5
  163. package/dist/capabilities/moneo.json +16 -16
  164. package/dist/capabilities/moonshotai-cn.json +7 -7
  165. package/dist/capabilities/moonshotai.json +7 -7
  166. package/dist/capabilities/morph.json +16 -16
  167. package/dist/capabilities/munito-eu.json +4 -4
  168. package/dist/capabilities/munito.json +6 -6
  169. package/dist/capabilities/nan.json +29 -29
  170. package/dist/capabilities/nano-gpt.json +586 -556
  171. package/dist/capabilities/nearai.json +89 -89
  172. package/dist/capabilities/nebius.json +29 -29
  173. package/dist/capabilities/neon.json +126 -126
  174. package/dist/capabilities/neuralwatt.json +43 -43
  175. package/dist/capabilities/nokeep.json +2 -2
  176. package/dist/capabilities/novita-ai.json +140 -140
  177. package/dist/capabilities/nvidia.json +35 -35
  178. package/dist/capabilities/oathbreaker.json +2 -2
  179. package/dist/capabilities/obscurify.json +31 -31
  180. package/dist/capabilities/oci.json +7 -7
  181. package/dist/capabilities/ofox.json +354 -354
  182. package/dist/capabilities/ollama-cloud.json +54 -54
  183. package/dist/capabilities/openai.json +53 -60
  184. package/dist/capabilities/opencode-go.json +89 -89
  185. package/dist/capabilities/openreason.json +5 -5
  186. package/dist/capabilities/openrouter.json +553 -553
  187. package/dist/capabilities/opper.json +28 -28
  188. package/dist/capabilities/orcarouter.json +248 -248
  189. package/dist/capabilities/outerlabs.json +32 -32
  190. package/dist/capabilities/ovhcloud.json +4 -4
  191. package/dist/capabilities/pareto.json +5 -5
  192. package/dist/capabilities/perplexity-agent.json +55 -55
  193. package/dist/capabilities/phala.json +33 -33
  194. package/dist/capabilities/pioneer.json +28 -28
  195. package/dist/capabilities/poe.json +121 -121
  196. package/dist/capabilities/poolside.json +3 -3
  197. package/dist/capabilities/powerspring.json +12 -12
  198. package/dist/capabilities/primalabs.json +9 -9
  199. package/dist/capabilities/prime.json +111 -111
  200. package/dist/capabilities/privatemode-ai.json +13 -13
  201. package/dist/capabilities/proxystacks.json +7 -7
  202. package/dist/capabilities/qiniu-ai.json +15 -15
  203. package/dist/capabilities/refuseless.json +10 -10
  204. package/dist/capabilities/regolo-ai.json +6 -6
  205. package/dist/capabilities/requesty.json +171 -188
  206. package/dist/capabilities/ruapi.json +19 -19
  207. package/dist/capabilities/runcrate.json +8 -8
  208. package/dist/capabilities/runinfra.json +13 -13
  209. package/dist/capabilities/sakana.json +6 -6
  210. package/dist/capabilities/sambanova.json +6 -6
  211. package/dist/capabilities/sandbase.json +25 -25
  212. package/dist/capabilities/sarvam.json +13 -13
  213. package/dist/capabilities/scaleway.json +20 -20
  214. package/dist/capabilities/scnet-token-plan.json +8 -8
  215. package/dist/capabilities/scx-ai.json +30 -30
  216. package/dist/capabilities/sensenova.json +13 -13
  217. package/dist/capabilities/siliconflow-cn.json +68 -68
  218. package/dist/capabilities/siliconflow.json +60 -60
  219. package/dist/capabilities/snowflake-cortex.json +20 -20
  220. package/dist/capabilities/sokkan.json +7 -7
  221. package/dist/capabilities/sparrowcodes.json +23 -23
  222. package/dist/capabilities/standardcompute.json +103 -103
  223. package/dist/capabilities/steadyrouter.json +36 -36
  224. package/dist/capabilities/stepfun-ai-step-plan.json +4 -4
  225. package/dist/capabilities/stepfun-ai.json +4 -4
  226. package/dist/capabilities/stepfun-step-plan.json +4 -4
  227. package/dist/capabilities/stepfun.json +4 -4
  228. package/dist/capabilities/stepping-stone.json +20 -20
  229. package/dist/capabilities/subconscious.json +2 -2
  230. package/dist/capabilities/superbot-gg.json +4 -4
  231. package/dist/capabilities/synthetic.json +11 -11
  232. package/dist/capabilities/synthorai.json +23 -23
  233. package/dist/capabilities/teamorouter.json +21 -21
  234. package/dist/capabilities/teapot-router.json +12 -12
  235. package/dist/capabilities/tencent-coding-plan.json +2 -2
  236. package/dist/capabilities/tencent-token-plan.json +24 -24
  237. package/dist/capabilities/tencent-tokenhub.json +6 -6
  238. package/dist/capabilities/tensorx.json +50 -50
  239. package/dist/capabilities/tenstorrent.json +5 -5
  240. package/dist/capabilities/the-grid-ai.json +28 -28
  241. package/dist/capabilities/thinkingmachines.json +60 -60
  242. package/dist/capabilities/tinfoil.json +14 -14
  243. package/dist/capabilities/toapis.json +3 -3
  244. package/dist/capabilities/togetherai.json +51 -51
  245. package/dist/capabilities/tokengo.json +16 -16
  246. package/dist/capabilities/tokenify.json +9 -9
  247. package/dist/capabilities/trustedrouter.json +7 -7
  248. package/dist/capabilities/trustedtokens.json +15 -15
  249. package/dist/capabilities/umans-ai-coding-plan.json +14 -14
  250. package/dist/capabilities/umans-ai.json +12 -12
  251. package/dist/capabilities/uncensuredai.json +5 -5
  252. package/dist/capabilities/unrestricted.json +8 -8
  253. package/dist/capabilities/uplinkswitch.json +19 -19
  254. package/dist/capabilities/upstage.json +4 -4
  255. package/dist/capabilities/vancine.json +21 -21
  256. package/dist/capabilities/vercel.json +551 -551
  257. package/dist/capabilities/vivgrid.json +85 -85
  258. package/dist/capabilities/volcengine-coding-plan.json +30 -30
  259. package/dist/capabilities/volcengine.json +36 -36
  260. package/dist/capabilities/vultr.json +31 -31
  261. package/dist/capabilities/wafer.ai.json +16 -16
  262. package/dist/capabilities/wallaby.json +5 -5
  263. package/dist/capabilities/wally.json +12 -12
  264. package/dist/capabilities/wandb.json +15 -15
  265. package/dist/capabilities/watt.json +23 -23
  266. package/dist/capabilities/xai.json +6 -6
  267. package/dist/capabilities/xiaomi-token-plan-ams.json +2 -2
  268. package/dist/capabilities/xiaomi-token-plan-cn.json +3 -3
  269. package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -2
  270. package/dist/capabilities/xiaomi.json +6 -6
  271. package/dist/capabilities/xpersona.json +13 -13
  272. package/dist/capabilities/xxapi.json +27 -27
  273. package/dist/capabilities/zai-coding-plan.json +10 -10
  274. package/dist/capabilities/zai.json +26 -26
  275. package/dist/capabilities/zenifra.json +28 -28
  276. package/dist/capabilities/zenmux.json +197 -197
  277. package/dist/capabilities/zerogpu.json +14 -14
  278. package/dist/capabilities/zhipuai-coding-plan.json +7 -7
  279. package/dist/capabilities/zhipuai.json +24 -24
  280. package/dist/capabilities/zro.json +7 -7
  281. package/dist/channels/agent-channels.d.ts +11 -0
  282. package/dist/channels/chat-tools.d.ts +156 -0
  283. package/dist/channels/index.cjs +7 -2
  284. package/dist/channels/index.d.ts +2 -0
  285. package/dist/channels/index.js +3 -3
  286. package/dist/{channels-C5DxhFRc.js → channels-Dx4jiXeK.js} +1 -1
  287. package/dist/{channels-B57qQolh.cjs → channels-q6qnuRNV.cjs} +1 -1
  288. package/dist/coding-agent/index.cjs +4 -4
  289. package/dist/coding-agent/index.js +4 -4
  290. package/dist/{constants-DaBkXs5H.cjs → constants-B9ZDvXZ4.cjs} +41 -0
  291. package/dist/{constants-BDHIyN28.js → constants-BmdTvEYN.js} +30 -1
  292. package/dist/datasets/index.cjs +2 -2
  293. package/dist/datasets/index.js +2 -2
  294. package/dist/docs/SKILL.md +1 -1
  295. package/dist/docs/assets/SOURCE_MAP.json +1289 -1284
  296. package/dist/docs/references/reference-agents-agent.md +1 -1
  297. package/dist/docs/references/reference-agents-channels.md +34 -1
  298. package/dist/docs/references/reference-agents-durable-agent.md +26 -2
  299. package/dist/evals/index.cjs +2 -2
  300. package/dist/evals/index.js +2 -2
  301. package/dist/evals/scoreTraces/index.cjs +2 -2
  302. package/dist/evals/scoreTraces/index.js +2 -2
  303. package/dist/events/index.cjs +1 -1
  304. package/dist/events/index.js +1 -1
  305. package/dist/{filesystem-CUj0vclS.cjs → filesystem-B0AZrbj8.cjs} +1 -1
  306. package/dist/{filesystem-BBqrAmKK.js → filesystem-B3s0WRud.js} +1 -1
  307. package/dist/{filesystem-B_HACoLS.js → filesystem-B5X-5G0x.js} +1 -1
  308. package/dist/{filesystem-pZNvxjuW.cjs → filesystem-BDSpwBke.cjs} +1 -1
  309. package/dist/{filesystem-5Z777gYZ.js → filesystem-BsdkC311.js} +1 -1
  310. package/dist/{filesystem-BNHPgtjJ.cjs → filesystem-C-cyJfi1.cjs} +1 -1
  311. package/dist/{filesystem-U5o28b5w.cjs → filesystem-CEbD_77-.cjs} +1 -1
  312. package/dist/{filesystem-yHKEz2Pr.cjs → filesystem-CUAgLugE.cjs} +1 -1
  313. package/dist/{filesystem-Cb8iTPM-.js → filesystem-Cv79mHRk.js} +1 -1
  314. package/dist/{filesystem-DhiaddZe.cjs → filesystem-DsCQiBl2.cjs} +1 -1
  315. package/dist/{filesystem-DSYDB3ek.js → filesystem-DzM9pcQ8.js} +1 -1
  316. package/dist/{filesystem-gpIfFMed.js → filesystem-DzfqVTO_.js} +1 -1
  317. package/dist/{filesystem-versioned-CxbiSJF-.js → filesystem-versioned-Bijb_p9l.js} +44 -44
  318. package/dist/harness/index.cjs +2 -2
  319. package/dist/harness/index.js +2 -2
  320. package/dist/index.cjs +1 -1
  321. package/dist/index.js +1 -1
  322. package/dist/knowledge/index.cjs +1 -1
  323. package/dist/knowledge/index.js +1 -1
  324. package/dist/llm/index.cjs +3 -3
  325. package/dist/llm/index.js +3 -3
  326. package/dist/llm/model/provider-types.generated.d.ts +7744 -7747
  327. package/dist/{llm-ByskI6z3.cjs → llm-CsQuqKPc.cjs} +2 -2
  328. package/dist/{llm-B0VtQDgT.js → llm-DnXK3Pmw.js} +2 -2
  329. package/dist/loop/base-loop-builder.d.ts +60 -0
  330. package/dist/loop/index.cjs +2 -2
  331. package/dist/loop/index.js +2 -2
  332. package/dist/loop/loop-builder.d.ts +10 -32
  333. package/dist/loop/workflows/agentic-execution/index.d.ts +1 -1
  334. package/dist/loop/workflows/agentic-loop/index.d.ts +1 -1
  335. package/dist/{manager-C2RGNH68.js → manager-BsghM-UL.js} +3 -3
  336. package/dist/{manager-BJKx4lQf.cjs → manager-DwFnIrI6.cjs} +3 -3
  337. package/dist/mastra/index.cjs +1 -1
  338. package/dist/mastra/index.js +1 -1
  339. package/dist/{mastra-zUTq9ilk.js → mastra-B8i1UDZs.js} +51 -25
  340. package/dist/{mastra-FXCeC5rF.cjs → mastra-Cn5NC6Es.cjs} +51 -25
  341. package/dist/memory/index.cjs +2 -2
  342. package/dist/memory/index.js +2 -2
  343. package/dist/{model-BmTFNo62.cjs → model-CNPfry_X.cjs} +1 -1
  344. package/dist/{model-BTNRPDgQ.js → model-CsOcWMUt.js} +1 -1
  345. package/dist/{netlify-B_XdjYPY.cjs → netlify-C-83Fxus.cjs} +1 -1
  346. package/dist/{netlify-BCSVhO5q.js → netlify-C-OpNSGp.js} +1 -1
  347. package/dist/notifications/index.cjs +1 -1
  348. package/dist/notifications/index.js +1 -1
  349. package/dist/{output-helpers-RlvE2WPA.js → output-helpers-D4II19No.js} +45 -45
  350. package/dist/processor-provider/index.cjs +1 -1
  351. package/dist/processor-provider/index.js +1 -1
  352. package/dist/processors/index.cjs +2 -2
  353. package/dist/processors/index.js +2 -2
  354. package/dist/processors/processors/pii-detector.d.ts +1 -0
  355. package/dist/{provider-registry-D8O1G18A.cjs → provider-registry-9O-H9osy.cjs} +22407 -22407
  356. package/dist/{provider-registry-Ble43Wb4.js → provider-registry-RZ8EgSe8.js} +22407 -22407
  357. package/dist/provider-registry.json +22277 -22277
  358. package/dist/{registry-generator-BQ1noftK.cjs → registry-generator-DxCX-FiO.cjs} +1 -1
  359. package/dist/{registry-generator-D1Zslex6.js → registry-generator-e8sltJls.js} +1 -1
  360. package/dist/{rehydrate-BiA_HUJH.cjs → rehydrate-B-wrAN7C.cjs} +2 -2
  361. package/dist/{rehydrate-CgxEur9m.js → rehydrate-D3fPgJwp.js} +2 -2
  362. package/dist/relevance/index.cjs +2 -2
  363. package/dist/relevance/index.js +2 -2
  364. package/dist/{run-registry-aomba2_Z.cjs → run-registry-5_LQBGn_.cjs} +83635 -77661
  365. package/dist/{run-registry-BUFmc_78.js → run-registry-DC03XLeZ.js} +83435 -76843
  366. package/dist/{scheduler-BuivoTeD.js → scheduler-B-VZUvv_.js} +1 -1
  367. package/dist/{scheduler-COSuIH7R.cjs → scheduler-D00X03jQ.cjs} +1 -1
  368. package/dist/schedules/index.cjs +1 -1
  369. package/dist/schedules/index.js +1 -1
  370. package/dist/{schedules-Dmu9qOgc.js → schedules-DZfSx-7P.js} +94 -94
  371. package/dist/{signal-provider-CicwpNwY.cjs → signal-provider-BFAvh_AJ.cjs} +1 -1
  372. package/dist/{signal-provider-BOtSN-_0.js → signal-provider-BslnAjWG.js} +1 -1
  373. package/dist/signals/index.cjs +3 -3
  374. package/dist/signals/index.js +3 -3
  375. package/dist/{signals-6EBDPHQX.cjs → signals-B1JSj-Ew.cjs} +2 -2
  376. package/dist/{signals-BH__LS8Y.js → signals-De9VnwL2.js} +2 -2
  377. package/dist/skills/index.cjs +2 -2
  378. package/dist/skills/index.js +2 -2
  379. package/dist/{source-8qxr6KJv.cjs → source-DDwx-87N.cjs} +1 -1
  380. package/dist/{source-DRqDgbCv.js → source-Did_2XQc.js} +1 -1
  381. package/dist/{state-processor-BRk8t1OR.js → state-processor-B9kxpM53.js} +140 -140
  382. package/dist/{state-processor-Bfs9LkY8.cjs → state-processor-kRNZ38Nf.cjs} +139 -139
  383. package/dist/storage/constants.cjs +1 -1
  384. package/dist/storage/constants.js +1 -1
  385. package/dist/storage/domains/agents/index.cjs +1 -1
  386. package/dist/storage/domains/agents/index.js +1 -1
  387. package/dist/storage/domains/mcp-clients/index.cjs +1 -1
  388. package/dist/storage/domains/mcp-clients/index.js +1 -1
  389. package/dist/storage/domains/mcp-servers/index.cjs +1 -1
  390. package/dist/storage/domains/mcp-servers/index.js +1 -1
  391. package/dist/storage/domains/memory/base.d.ts +3 -1
  392. package/dist/storage/domains/memory/observational-memory-lifecycle.d.ts +1 -1
  393. package/dist/storage/domains/prompt-blocks/index.cjs +1 -1
  394. package/dist/storage/domains/prompt-blocks/index.js +1 -1
  395. package/dist/storage/domains/scorer-definitions/index.cjs +1 -1
  396. package/dist/storage/domains/scorer-definitions/index.js +1 -1
  397. package/dist/storage/domains/skills/index.cjs +1 -1
  398. package/dist/storage/domains/skills/index.js +1 -1
  399. package/dist/storage/domains/workspaces/index.cjs +1 -1
  400. package/dist/storage/domains/workspaces/index.js +1 -1
  401. package/dist/storage/index.cjs +12 -11
  402. package/dist/storage/index.js +12 -12
  403. package/dist/storage/types.d.ts +13 -0
  404. package/dist/stream/index.cjs +2 -2
  405. package/dist/stream/index.js +2 -2
  406. package/dist/{stream-DUrp3Fcy.cjs → stream-4aNIw_TQ.cjs} +1 -1
  407. package/dist/{stream-S_NC5v9e.js → stream-CJUm6EAH.js} +1 -1
  408. package/dist/test-utils/llm-mock.cjs +1 -1
  409. package/dist/test-utils/llm-mock.js +1 -1
  410. package/dist/tool-loop-agent/index.cjs +1 -1
  411. package/dist/tool-loop-agent/index.js +1 -1
  412. package/dist/{tool-loop-agent-DU0BiemT.cjs → tool-loop-agent-Dn0QCB9n.cjs} +3 -3
  413. package/dist/{tool-loop-agent-BhCzpGfr.js → tool-loop-agent-FEEwHfmg.js} +3 -3
  414. package/dist/tools/index.cjs +1 -1
  415. package/dist/tools/index.js +1 -1
  416. package/dist/{utils-DYIai19q.js → utils-Bd_y1_a-.js} +1 -1
  417. package/dist/{utils-CeEt4K7t.cjs → utils-DY01hxVd.cjs} +1 -1
  418. package/dist/utils.cjs +1 -1
  419. package/dist/utils.js +1 -1
  420. package/dist/{validate-BRikrNhF.js → validate-CX0yQo_q.js} +1 -1
  421. package/dist/{validate-BckgxuJ0.cjs → validate-CuB_1Zd3.cjs} +1 -1
  422. package/dist/vector/index.cjs +1 -1
  423. package/dist/vector/index.js +1 -1
  424. package/dist/worker/index.cjs +1 -1
  425. package/dist/worker/index.js +1 -1
  426. package/dist/{worker-Du5ybt5o.js → worker-B80xkcKG.js} +3 -3
  427. package/dist/{worker-D9WwmcJa.cjs → worker-CbaSmip-.cjs} +3 -3
  428. package/dist/{worker-DcBfwJqD.js → worker-DSEfMPmq.js} +3 -3
  429. package/dist/{worker-BfhUD77l.cjs → worker-GsGIxPMa.cjs} +3 -3
  430. package/dist/{workflow-jNWVBYDJ.js → workflow-CZHY_C85.js} +4 -4
  431. package/dist/{workflow-BWV5m9Mx.cjs → workflow-CnBPXTpv.cjs} +4 -4
  432. package/dist/workflows/builder/index.cjs +1 -1
  433. package/dist/workflows/builder/index.js +1 -1
  434. package/dist/workflows/evented/index.cjs +1 -1
  435. package/dist/workflows/evented/index.js +1 -1
  436. package/dist/workflows/evented/workflow.d.ts +1 -1
  437. package/dist/workflows/index.cjs +6 -6
  438. package/dist/workflows/index.js +6 -6
  439. package/dist/workspace/index.cjs +2 -2
  440. package/dist/workspace/index.js +2 -2
  441. package/dist/{workspace-BQ2wZj5D.cjs → workspace-D2drutNg.cjs} +607 -607
  442. package/dist/{workspace-D7JRhn1Z.js → workspace-D7TIleIt.js} +609 -609
  443. package/dist/{workspace-skills-CGiXfKzA.js → workspace-skills-38OY32_b.js} +531 -531
  444. package/package.json +8 -8
  445. package/src/llm/model/provider-types.generated.d.ts +7744 -7747
  446. package/dist/agent/durable/evented-execution-engine.d.ts +0 -20
  447. package/dist/{filesystem-versioned-D-OCaYSl.cjs → filesystem-versioned-DZGyPbNC.cjs} +43 -43
  448. package/dist/{output-helpers-CncZ3y-g.cjs → output-helpers-JL-HeCbT.cjs} +44 -44
  449. package/dist/{schedules-qIHUKsj4.cjs → schedules-BZS8McF7.cjs} +93 -93
  450. package/dist/{workspace-skills-CUSjYHdi.cjs → workspace-skills-BcquhPDn.cjs} +530 -530
@@ -1,9 +1,9 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-BrhgMLW6.cjs");
2
- const require_netlify = require("./netlify-B_XdjYPY.cjs");
2
+ const require_netlify = require("./netlify-C-83Fxus.cjs");
3
3
  const require_model = require("./model-jBymoqGa.cjs");
4
4
  const require_to_prompt = require("./to-prompt-B9eZo2U5.cjs");
5
5
  const require_content = require("./content-CC0W1d5p.cjs");
6
- const require_provider_registry = require("./provider-registry-D8O1G18A.cjs");
6
+ const require_provider_registry = require("./provider-registry-9O-H9osy.cjs");
7
7
  const require_error = require("./error-D90lJ6M7.cjs");
8
8
  const require_request_context = require("./request-context-D9RXYCy8.cjs");
9
9
  const require_dynamic_argument = require("./dynamic-argument-CUc1BBOS.cjs");
@@ -1,8 +1,8 @@
1
- import { _ as MASTRA_GATEWAY_STREAM_TRANSPORT, a as interpolateUrlTemplate, b as createOpenAICompatible, f as findGatewayForModel, h as shouldEnableGateway, l as MASTRA_USER_AGENT, m as hasAuthCredentials, o as parseModelRouterId, p as getGatewayId, r as ModelsDevGateway, s as createGoogleGenerativeAI, t as NetlifyGateway, v as MastraModelGateway, x as EventSourceParserStream, y as createOpenAI } from "./netlify-BCSVhO5q.js";
1
+ import { _ as MASTRA_GATEWAY_STREAM_TRANSPORT, a as interpolateUrlTemplate, b as createOpenAICompatible, f as findGatewayForModel, h as shouldEnableGateway, l as MASTRA_USER_AGENT, m as hasAuthCredentials, o as parseModelRouterId, p as getGatewayId, r as ModelsDevGateway, s as createGoogleGenerativeAI, t as NetlifyGateway, v as MastraModelGateway, x as EventSourceParserStream, y as createOpenAI } from "./netlify-C-OpNSGp.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-BsDtVXrf.js";
4
4
  import { t as convertToDataContent } from "./content-CFBIylxS.js";
5
- import { f as MastraGateway, l as modelSupportsTemperature, n as PROVIDER_REGISTRY, p as gatewayServesObservationalMemory, t as GatewayRegistry } from "./provider-registry-Ble43Wb4.js";
5
+ import { f as MastraGateway, l as modelSupportsTemperature, n as PROVIDER_REGISTRY, p as gatewayServesObservationalMemory, t as GatewayRegistry } from "./provider-registry-RZ8EgSe8.js";
6
6
  import { i as MastraError, n as ErrorDomain, t as ErrorCategory } from "./error-oh2DLsP2.js";
7
7
  import { u as RequestContext } from "./request-context-COnZHt2-.js";
8
8
  import { n as resolveDynamicArgument } from "./dynamic-argument-BzPK3qPN.js";
@@ -0,0 +1,60 @@
1
+ import type { createEventedWorkflow, createWorkflow } from '../workflows/create.js';
2
+ import type { Step } from '../workflows/step.js';
3
+ import type { Workflow } from '../workflows/workflow.js';
4
+ import type { LoopRuntime } from './loop-runtime.js';
5
+ import type { EagerToolExecutionCoordinator } from './workflows/agentic-execution/eager-tool-execution.js';
6
+ import type { ToolCallForeachOptions } from './workflows/agentic-execution/tool-call-concurrency.js';
7
+ /**
8
+ * Predicate evaluated by the outer dowhile after every iteration. Receives the
9
+ * engine's dowhile callback params; typed loosely because the two engines
10
+ * consume different subsets of it (the main loop only reads `inputData`, the
11
+ * durable loop also reads `getInitData`/`mastra`/the pubsub symbol).
12
+ */
13
+ export type LoopContinuationPredicate = (params: any) => Promise<boolean>;
14
+ /**
15
+ * Engine-agnostic handle for a loop step. The two engines build steps with
16
+ * different ids and schemas (state flows through workflow context on the main
17
+ * loop vs. serialized iteration state on the durable loop), so the overridable
18
+ * factory surface is typed loosely; each engine's composition works with its
19
+ * own concrete step types internally.
20
+ */
21
+ export type LoopStep = Step<string, any, any, any, any, any, any, any>;
22
+ /** Engine-agnostic handle for a composed loop workflow (see {@link LoopStep}). */
23
+ export type LoopWorkflow = Workflow<any, any, any, any, any, any, any, any>;
24
+ /**
25
+ * The agentic loop's shape: an outer `dowhile` workflow wrapping a
26
+ * single-iteration workflow (LLM execution → tool calls → mapping → background
27
+ * check → signal drain → isTaskComplete → goal). `AgenticLoopBuilder` (main
28
+ * loop) and `DurableAgenticLoopBuilder` (durable loop) both implement it.
29
+ *
30
+ * This module must only use type imports. The durable builder extends this
31
+ * class while its own module loads, and the main loop builder's imports lead
32
+ * back to `Agent` (processors and evals construct agents), so extending the
33
+ * main loop builder instead would make the durable engine's load order
34
+ * depend on which module happened to load first.
35
+ */
36
+ export declare abstract class BaseAgenticLoopBuilder {
37
+ /** Which workflow engine the loop is composed on. */
38
+ protected abstract workflowFactory(): typeof createWorkflow | typeof createEventedWorkflow;
39
+ /** Resolve the live, non-serializable view of the run (see {@link LoopRuntime}). */
40
+ protected abstract resolveRuntime(predicateParams: unknown): LoopRuntime;
41
+ /** Deliver a chunk to the run's client-facing stream. */
42
+ protected abstract emitChunk(runtime: LoopRuntime, chunk: unknown): void | Promise<void>;
43
+ protected abstract llmExecutionStep(toolCallForeachOptions: ToolCallForeachOptions, eager?: {
44
+ coordinator: EagerToolExecutionCoordinator;
45
+ toolCallStep: LoopStep;
46
+ }): LoopStep;
47
+ protected abstract toolCallStep(): LoopStep;
48
+ protected abstract llmMappingStep(llmExecutionStep: LoopStep): LoopStep;
49
+ protected abstract backgroundTaskCheckStep(): LoopStep;
50
+ protected abstract signalDrainStep(): LoopStep;
51
+ protected abstract isTaskCompleteStep(): LoopStep;
52
+ protected abstract goalStep(): LoopStep;
53
+ /** The dowhile predicate deciding after each iteration whether the loop continues. */
54
+ protected abstract buildContinuationPredicate(): LoopContinuationPredicate;
55
+ /** The single-iteration workflow. */
56
+ abstract buildIterationWorkflow(): LoopWorkflow;
57
+ /** The outer loop workflow: dowhile(iteration workflow, continuation predicate). */
58
+ abstract build(): LoopWorkflow;
59
+ }
60
+ //# sourceMappingURL=base-loop-builder.d.ts.map
@@ -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_stream = require("../stream-4aNIw_TQ.cjs");
3
+ const require_run_registry = require("../run-registry-5_LQBGn_.cjs");
4
4
  exports.MastraTimeoutError = require_stream.MastraTimeoutError;
5
5
  exports.createScorer = require_run_registry.createScorer;
6
6
  exports.createTimeoutAbortSignal = require_stream.createTimeoutAbortSignal;
@@ -1,3 +1,3 @@
1
- import { _n as isMastraTimeoutError, fn as MastraTimeoutError, pn as createTimeoutAbortSignal } from "../stream-S_NC5v9e.js";
2
- import { Al as createScorer, As as generateStructuredFinalResult, Ds as formatStreamCompletionFeedback, Es as formatCompletionFeedback, Fs as runValidation, Is as loop, Ms as runCompletionScorers, Ns as runDefaultCompletionCheck, Os as formatValidationFeedback, Ps as runStreamCompletionScorers, Ts as formatCheckFeedback, js as runChecks, ks as generateFinalResult } from "../run-registry-BUFmc_78.js";
1
+ import { _n as isMastraTimeoutError, fn as MastraTimeoutError, pn as createTimeoutAbortSignal } from "../stream-CJUm6EAH.js";
2
+ import { Bt as formatCompletionFeedback, Gt as runChecks, Ht as formatValidationFeedback, Jt as runStreamCompletionScorers, Kt as runCompletionScorers, T as createScorer, Ut as generateFinalResult, Vt as formatStreamCompletionFeedback, Wt as generateStructuredFinalResult, Xt as loop, Yt as runValidation, qt as runDefaultCompletionCheck, zt as formatCheckFeedback } from "../run-registry-DC03XLeZ.js";
3
3
  export { MastraTimeoutError, createScorer, createTimeoutAbortSignal, formatCheckFeedback, formatCompletionFeedback, formatStreamCompletionFeedback, formatValidationFeedback, generateFinalResult, generateStructuredFinalResult, isMastraTimeoutError, loop, runChecks, runCompletionScorers, runDefaultCompletionCheck, runStreamCompletionScorers, runValidation };
@@ -2,13 +2,14 @@ import type { ToolSet } from '../_types/@internal_ai-sdk-v5@0.0.98/dist/index.js
2
2
  import type { ChunkType } from '../stream/types.js';
3
3
  import type { createEventedWorkflow } from '../workflows/create.js';
4
4
  import { createWorkflow } from '../workflows/create.js';
5
- import type { Step } from '../workflows/step.js';
6
5
  import type { OutputWriter } from '../workflows/types.js';
7
- import type { Workflow } from '../workflows/workflow.js';
6
+ import { BaseAgenticLoopBuilder } from './base-loop-builder.js';
7
+ import type { LoopContinuationPredicate, LoopStep, LoopWorkflow } from './base-loop-builder.js';
8
8
  import type { LoopRuntime } from './loop-runtime.js';
9
9
  import type { LoopRun } from './types.js';
10
10
  import { EagerToolExecutionCoordinator } from './workflows/agentic-execution/eager-tool-execution.js';
11
11
  import type { ToolCallForeachOptions } from './workflows/agentic-execution/tool-call-concurrency.js';
12
+ export type { LoopContinuationPredicate, LoopStep, LoopWorkflow } from './base-loop-builder.js';
12
13
  export declare const AGENTIC_EXECUTION_WORKFLOW_ID = "executionWorkflow";
13
14
  export declare const AGENTIC_LOOP_WORKFLOW_ID = "agentic-loop";
14
15
  /**
@@ -20,45 +21,22 @@ export interface AgenticLoopBuilderParams<Tools extends ToolSet = ToolSet, OUTPU
20
21
  controller: ReadableStreamDefaultController<ChunkType<OUTPUT>>;
21
22
  outputWriter: OutputWriter;
22
23
  }
23
- /**
24
- * Predicate evaluated by the outer dowhile after every iteration. Receives the
25
- * engine's dowhile callback params; typed loosely because the two engines
26
- * consume different subsets of it (the main loop only reads `inputData`, the
27
- * durable loop also reads `getInitData`/`mastra`/the pubsub symbol).
28
- */
29
- export type LoopContinuationPredicate = (params: any) => Promise<boolean>;
30
- /**
31
- * Engine-agnostic handle for a loop step. The two engines build steps with
32
- * different ids and schemas (state flows through workflow context on the main
33
- * loop vs. serialized iteration state on the durable loop), so the overridable
34
- * factory surface is typed loosely; each engine's composition works with its
35
- * own concrete step types internally.
36
- */
37
- export type LoopStep = Step<string, any, any, any, any, any, any, any>;
38
- /** Engine-agnostic handle for a composed loop workflow (see {@link LoopStep}). */
39
- export type LoopWorkflow = Workflow<any, any, any, any, any, any, any, any>;
40
24
  /**
41
25
  * Builds the agentic loop: an outer `dowhile` workflow wrapping a
42
26
  * single-iteration workflow of ten steps (LLM execution → tool calls →
43
27
  * mapping → background check → signal drain → isTaskComplete → goal).
44
28
  *
45
- * This concrete base class IS the main (in-process) agent loop. Every step is
46
- * constructed through an overridable method so engine variants (the durable
47
- * loop) can subclass it and override behavior surgically instead of
48
- * maintaining a parallel copy of the topology. During the incremental
49
- * migration the durable subclass still overrides whole methods that
50
- * delegate to its own step files; the end state is that only runtime hooks
51
- * (state resolution, chunk transport, workflow engine) remain overridden.
29
+ * This is the main (in-process) agent loop. The durable loop implements the
30
+ * same `BaseAgenticLoopBuilder` shape separately (see that class for why it
31
+ * does not extend this one).
52
32
  */
53
- export declare class AgenticLoopBuilder<Tools extends ToolSet = ToolSet, OUTPUT = undefined> {
33
+ export declare class AgenticLoopBuilder<Tools extends ToolSet = ToolSet, OUTPUT = undefined> extends BaseAgenticLoopBuilder {
54
34
  #private;
55
35
  /**
56
36
  * The main loop resolves everything from per-run params captured at
57
- * construction time. Engine subclasses that resolve their runtime elsewhere
58
- * (e.g. the durable loop's run registry + serialized state) construct
59
- * without params — any base method that then touches `this.params` throws,
60
- * so an incompletely-overridden subclass fails loudly instead of silently
61
- * running main-loop plumbing.
37
+ * construction time. A subclass constructed without params throws on the
38
+ * first method that touches `this.params`, so an incompletely-overridden
39
+ * subclass fails loudly instead of silently running main-loop plumbing.
62
40
  */
63
41
  constructor(params?: AgenticLoopBuilderParams<Tools, OUTPUT>);
64
42
  protected get params(): AgenticLoopBuilderParams<Tools, OUTPUT>;
@@ -7,5 +7,5 @@ export { AGENTIC_EXECUTION_WORKFLOW_ID } from '../../loop-builder.js';
7
7
  * goal). The topology lives on `AgenticLoopBuilder` (loop/loop-builder.ts);
8
8
  * this wrapper preserves the existing call surface.
9
9
  */
10
- export declare function createAgenticExecutionWorkflow<Tools extends ToolSet = ToolSet, OUTPUT = undefined>(params: OuterLLMRun<Tools, OUTPUT>): import("../../loop-builder").LoopWorkflow;
10
+ export declare function createAgenticExecutionWorkflow<Tools extends ToolSet = ToolSet, OUTPUT = undefined>(params: OuterLLMRun<Tools, OUTPUT>): import("../../base-loop-builder").LoopWorkflow;
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -5,5 +5,5 @@ import type { AgenticLoopBuilderParams } from '../../loop-builder.js';
5
5
  * predicate live on `AgenticLoopBuilder` (loop/loop-builder.ts); this wrapper
6
6
  * preserves the existing call surface.
7
7
  */
8
- export declare function createAgenticLoopWorkflow<Tools extends ToolSet = ToolSet, OUTPUT = undefined>(params: AgenticLoopBuilderParams<Tools, OUTPUT>): import("../../loop-builder").LoopWorkflow;
8
+ export declare function createAgenticLoopWorkflow<Tools extends ToolSet = ToolSet, OUTPUT = undefined>(params: AgenticLoopBuilderParams<Tools, OUTPUT>): import("../../base-loop-builder").LoopWorkflow;
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1,12 +1,12 @@
1
1
  import { S as resolveObservabilityContext } from "./observability-D7RNOAPx.js";
2
2
  import { i as MastraError } from "./error-oh2DLsP2.js";
3
- import { at as loadStepResults, rn as isSupportedLanguageModel } from "./stream-S_NC5v9e.js";
3
+ import { at as loadStepResults, rn as isSupportedLanguageModel } from "./stream-CJUm6EAH.js";
4
4
  import { o as MASTRA_RESOURCE_ID_KEY, u as RequestContext } from "./request-context-COnZHt2-.js";
5
- import { Cl as flushBeforeTraceRead, Tl as validateAndSaveScore, fa as assertSupportedPatterns, kl as ScorerRunError } from "./run-registry-BUFmc_78.js";
5
+ import { Bi as assertSupportedPatterns, b as validateAndSaveScore, v as flushBeforeTraceRead, w as ScorerRunError } from "./run-registry-DC03XLeZ.js";
6
6
  import { t as EntityType } from "./storage-Cc50aQAp.js";
7
7
  import { a as getOrCreateSpan } from "./utils-DU_pU5SK.js";
8
8
  import { t as deepEqual } from "./deep-equal-d1xU02ag.js";
9
- import { Cr as extractWorkflowTrajectory, Sr as extractTrajectoryFromTrace, mn as BATCH_DELETE_TRACES_MAX_IDS, xr as extractTrajectory } from "./constants-BDHIyN28.js";
9
+ import { Cr as extractTrajectory, Tr as extractWorkflowTrajectory, mn as BATCH_DELETE_TRACES_MAX_IDS, wr as extractTrajectoryFromTrace } from "./constants-BmdTvEYN.js";
10
10
  import { isZodType } from "@mastra/schema-compat";
11
11
  import { zodToJsonSchema } from "@mastra/schema-compat/zod-to-json";
12
12
  // src/datasets/experiment/agent-model.ts
@@ -1,12 +1,12 @@
1
1
  const require_observability = require("./observability-B0R_D1PZ.cjs");
2
2
  const require_error = require("./error-D90lJ6M7.cjs");
3
- const require_stream = require("./stream-DUrp3Fcy.cjs");
3
+ const require_stream = require("./stream-4aNIw_TQ.cjs");
4
4
  const require_request_context = require("./request-context-D9RXYCy8.cjs");
5
- const require_run_registry = require("./run-registry-aomba2_Z.cjs");
5
+ const require_run_registry = require("./run-registry-5_LQBGn_.cjs");
6
6
  const require_storage = require("./storage-CfG0I2aF.cjs");
7
7
  const require_utils = require("./utils-D-eNsgDM.cjs");
8
8
  const require_deep_equal = require("./deep-equal-TMDmByBC.cjs");
9
- const require_constants = require("./constants-DaBkXs5H.cjs");
9
+ const require_constants = require("./constants-B9ZDvXZ4.cjs");
10
10
  let _mastra_schema_compat = require("@mastra/schema-compat");
11
11
  let _mastra_schema_compat_zod_to_json = require("@mastra/schema-compat/zod-to-json");
12
12
  // src/datasets/experiment/agent-model.ts
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_mastra = require("../mastra-FXCeC5rF.cjs");
2
+ const require_mastra = require("../mastra-Cn5NC6Es.cjs");
3
3
  exports.Mastra = require_mastra.Mastra;
@@ -1 +1 @@
1
- export { t as Mastra } from "../mastra-zUTq9ilk.js";
1
+ export { t as Mastra } from "../mastra-B8i1UDZs.js";
@@ -1,34 +1,35 @@
1
- import { Bt as getStorageSource, Fu as assertDrainTimeout, Gl as nestedRunRecoveryAction, Hl as cancelNestedRun, Id as runOutsideRunFenceScope, Ii as InMemoryStore, Iu as waitMs, Jl as renewWorkflowLease, Kl as nestedRunStatusOf, Ri as WorkflowsInMemory, Sa as BackgroundTasksInMemory, Ul as createNestedRunParentStatusLookup, Wl as nestedRunParentOf, Yl as repeatAfterSettled, cd as normalizeConcurrency, cs as __registerMastraCtor, dt as createStep, fl as AgentChannels, ft as createWorkflow, h as agentThreadStreamRuntime, ht as computeScheduleDefinitionHash, ld as runWithConcurrency, pd as isDurableAgentLike, pt as WorkflowEventProcessor, ql as WORKFLOW_RUN_LEASE_TTL_MS, r as abandonDurableAgentExecutions, s as getActiveDurableAgentWorkflowExecutions, sd as createConcurrencyLimiter, ta as dispatchDueNotifications, u as isDurableAgentExecutionDetached, wl as createOnScorerHook, zt as augmentWithInit } from "./run-registry-BUFmc_78.js";
2
- import { s as BackgroundTaskManager } from "./background-tasks-CEglmAt7.js";
1
+ import { Cc as createConcurrencyLimiter, Ds as createStep, En as AgentChannels, Lr as dispatchDueNotifications, Oo as augmentWithInit, Os as createWorkflow, Tc as runWithConcurrency, Vl as runOutsideRunFenceScope, Xi as BackgroundTasksInMemory, _c as repeatAfterSettled, br as WorkflowsInMemory, cl as waitMs, dc as createNestedRunParentStatusLookup, dl as isDurableAgentLike, fc as nestedRunParentOf, gc as renewWorkflowLease, hc as WORKFLOW_RUN_LEASE_TTL_MS, js as computeScheduleDefinitionHash, jt as __registerMastraCtor, ko as getStorageSource, ks as WorkflowEventProcessor, l as isDurableAgentExecutionDetached, mc as nestedRunStatusOf, o as getActiveDurableAgentWorkflowExecutions, p as agentThreadStreamRuntime, pc as nestedRunRecoveryAction, r as abandonDurableAgentExecutions, sl as assertDrainTimeout, uc as cancelNestedRun, vr as InMemoryStore, wc as normalizeConcurrency, y as createOnScorerHook } from "./run-registry-DC03XLeZ.js";
2
+ import { s as BackgroundTaskManager } from "./background-tasks-BgpX1P_s.js";
3
3
  import { t as InMemoryServerCache } from "./inmemory-BDD0w8gx.js";
4
- import { t as DatasetsManager } from "./manager-C2RGNH68.js";
4
+ import { t as DatasetsManager } from "./manager-BsghM-UL.js";
5
5
  import { i as MastraError, n as ErrorDomain, t as ErrorCategory } from "./error-oh2DLsP2.js";
6
- import { c as isRunLocalTopic, g as EventEmitterPubSub } from "./output-helpers-RlvE2WPA.js";
6
+ import { g as EventEmitterPubSub, u as isRunLocalTopic } from "./output-helpers-D4II19No.js";
7
7
  import { a as registerHook, r as deregisterHook } from "./hooks-Bth8Cjpj.js";
8
8
  import { LicenseClient } from "./license/index.js";
9
- import { p as getGatewayId } from "./netlify-BCSVhO5q.js";
10
- import { l as defaultGateways } from "./llm-B0VtQDgT.js";
9
+ import { p as getGatewayId } from "./netlify-C-OpNSGp.js";
10
+ import { l as defaultGateways } from "./llm-DnXK3Pmw.js";
11
11
  import { l as isAdaptableLogger, n as LogLevel, t as ConsoleLogger, u as noopLogger } from "./logger-BwbmRqfc.js";
12
12
  import { DualLogger, createExportSuppressedLogger, isObservabilityExportSuppressed, resolveTraceFields } from "./logger/index.js";
13
- import { c as fsAgentScheduleRowId, d as computeNextFireAt, f as toEpochMs, l as parseFsAgentScheduleRowId, t as Schedules, u as computeNextFire } from "./schedules-Dmu9qOgc.js";
13
+ import { c as fsAgentScheduleRowId, g as toEpochMs, h as computeNextFireAt, l as parseFsAgentScheduleRowId, m as computeNextFire, t as Schedules } from "./schedules-DZfSx-7P.js";
14
14
  import { C as NoOpObservability, T as noOpMetricsContext, w as noOpLoggerContext } from "./observability-D7RNOAPx.js";
15
15
  import { initContextStorage } from "./observability/context-storage.js";
16
16
  import { f as resolveCurrentSpan } from "./utils-DU_pU5SK.js";
17
- import { r as InMemoryDB } from "./source-DRqDgbCv.js";
17
+ import { r as InMemoryDB } from "./source-Did_2XQc.js";
18
18
  import { r as trackFeatureUsage } from "./feature-telemetry-DdR8J_5o.js";
19
- import { r as isToolLoopAgentLike, t as toolLoopAgentToMastraAgent } from "./tool-loop-agent-BhCzpGfr.js";
19
+ import { r as isToolLoopAgentLike, t as toolLoopAgentToMastraAgent } from "./tool-loop-agent-FEEwHfmg.js";
20
20
  import { r as normalizeToolPayloadTransformPolicy } from "./payload-transform-Dj3HUeD4.js";
21
- import { v as readPositiveIntEnv } from "./utils-DYIai19q.js";
22
- import { i as OrchestrationWorker, n as BackgroundTaskWorker, r as SchedulerWorker } from "./worker-Du5ybt5o.js";
23
- import { n as normalizeWorkflowBuilderDefinition } from "./builder-0V9N8S15.js";
24
- import { d as toJsonSchemaOrUndefined, p as collectNestedWorkflowIds, t as assertValidDynamicWorkflow } from "./validate-BRikrNhF.js";
25
- import { t as rehydrateWorkflow } from "./rehydrate-CgxEur9m.js";
26
- import { Tn as createRunScope } from "./stream-S_NC5v9e.js";
21
+ import { v as readPositiveIntEnv } from "./utils-Bd_y1_a-.js";
22
+ import { i as OrchestrationWorker, n as BackgroundTaskWorker, r as SchedulerWorker } from "./worker-B80xkcKG.js";
23
+ import { n as normalizeWorkflowBuilderDefinition } from "./builder-x295GDL6.js";
24
+ import { d as toJsonSchemaOrUndefined, p as collectNestedWorkflowIds, t as assertValidDynamicWorkflow } from "./validate-CX0yQo_q.js";
25
+ import { t as rehydrateWorkflow } from "./rehydrate-D3fPgJwp.js";
26
+ import { Tn as createRunScope } from "./stream-CJUm6EAH.js";
27
27
  import { z } from "zod/v4";
28
28
  // src/agent/streams/execution-capability.ts
29
- /** Policy and strategy metadata do not activate native execution in this stage. */
29
+ /** Native engine selection or the released structural adapter contract (including Inngest). */
30
30
  function hasDurableExecution(obj) {
31
- return isDurableAgentLike(obj);
31
+ if (isDurableAgentLike(obj)) return true;
32
+ return typeof obj === "object" && obj !== null && "__hasDurableExecution" in obj && typeof obj.__hasDurableExecution === "function" && obj.__hasDurableExecution() === true;
32
33
  }
33
34
  // src/notifications/workflow.ts
34
35
  const NOTIFICATION_DISPATCH_WORKFLOW_ID = "__mastra_notification_dispatcher";
@@ -2020,7 +2021,7 @@ var Mastra = class Mastra {
2020
2021
  const agents = this.#agents;
2021
2022
  if (agents[agentKey]) {
2022
2023
  if (agents[agentKey] === mastraAgent || toolLoopInput && this.#toolLoopRegistrations.get(toolLoopInput)?.get(agentKey) === agents[agentKey] || agents[agentKey].source === "stored" && options?.source === "stored") {
2023
- if (agents[agentKey] === mastraAgent) mastraAgent.__registerExecutionEnginePolicy(this.#durable);
2024
+ if (agents[agentKey] === mastraAgent) mastraAgent.__registerExecutionEnginePolicy?.(this.#durable);
2024
2025
  return;
2025
2026
  }
2026
2027
  throw new MastraError({
@@ -2044,7 +2045,7 @@ var Mastra = class Mastra {
2044
2045
  tts: this.#tts,
2045
2046
  vectors: this.#vectors
2046
2047
  });
2047
- mastraAgent.__registerExecutionEnginePolicy(this.#durable);
2048
+ mastraAgent.__registerExecutionEnginePolicy?.(this.#durable);
2048
2049
  agents[agentKey] = mastraAgent;
2049
2050
  if (toolLoopInput) {
2050
2051
  let registrations = this.#toolLoopRegistrations.get(toolLoopInput);
@@ -5052,7 +5053,7 @@ var Mastra = class Mastra {
5052
5053
  if (!this.#workerFilter || this.#workerFilter.has("agent-schedule")) {
5053
5054
  let agentScheduleWorker = this.#findAgentScheduleWorker();
5054
5055
  if (!agentScheduleWorker) {
5055
- const { AgentScheduleWorker } = await import("./worker-DcBfwJqD.js");
5056
+ const { AgentScheduleWorker } = await import("./worker-DSEfMPmq.js");
5056
5057
  agentScheduleWorker = new AgentScheduleWorker();
5057
5058
  agentScheduleWorker.__registerMastra(this);
5058
5059
  this.#workers.push(agentScheduleWorker);
@@ -5625,6 +5626,10 @@ var Mastra = class Mastra {
5625
5626
  async removeTopicListener(topic, listener) {
5626
5627
  await this.#pubsub.unsubscribe(topic, this.#ackingTopicListener(listener));
5627
5628
  }
5629
+ /** Build native durable agents' engines and register their workflows, so event ownership checks can find them. */
5630
+ #initializeDurableAgents() {
5631
+ for (const agent of Object.values(this.#agents ?? {})) if (hasDurableExecution(agent) && !isDurableAgentLike(agent)) agent.__initializeDurableExecution();
5632
+ }
5628
5633
  /**
5629
5634
  * Process a single workflow event. Shared entry point used by:
5630
5635
  * - pull-mode workers (OrchestrationWorker)
@@ -5636,6 +5641,15 @@ var Mastra = class Mastra {
5636
5641
  * should nack/return 5xx so the broker retries.
5637
5642
  */
5638
5643
  async handleWorkflowEvent(event) {
5644
+ try {
5645
+ this.#initializeDurableAgents();
5646
+ } catch (error) {
5647
+ this.#logger.error("Failed to initialize durable agents for workflow event", { error });
5648
+ return {
5649
+ ok: false,
5650
+ retry: true
5651
+ };
5652
+ }
5639
5653
  if (!this.#workflowEventProcessor) this.#workflowEventProcessor = new WorkflowEventProcessor({ mastra: this });
5640
5654
  return this.#workflowEventProcessor.handle(event);
5641
5655
  }
@@ -5657,6 +5671,7 @@ var Mastra = class Mastra {
5657
5671
  */
5658
5672
  async startWorkers(name) {
5659
5673
  if (this.#storage) await this.#storage.init();
5674
+ this.#initializeDurableAgents();
5660
5675
  const schedulerSelected = !this.#schedulerDisabled() && (!this.#workerFilter || this.#workerFilter.has("scheduler"));
5661
5676
  const schedulerForcedByFilter = schedulerSelected && (this.#workerFilter?.has("scheduler") ?? false);
5662
5677
  if (!name && schedulerSelected && this.#storage && !this.#findSchedulerWorker()?.isRunning) try {
@@ -5675,7 +5690,7 @@ var Mastra = class Mastra {
5675
5690
  this.#workers.push(sw);
5676
5691
  }
5677
5692
  if (!this.#findAgentScheduleWorker()) {
5678
- const { AgentScheduleWorker } = await import("./worker-DcBfwJqD.js");
5693
+ const { AgentScheduleWorker } = await import("./worker-DSEfMPmq.js");
5679
5694
  const asw = new AgentScheduleWorker();
5680
5695
  asw.__registerMastra(this);
5681
5696
  this.#workers.push(asw);
@@ -5732,12 +5747,23 @@ var Mastra = class Mastra {
5732
5747
  async #wirePushWorkflowSubscription() {
5733
5748
  const modes = this.#pubsub.supportedModes ?? ["pull"];
5734
5749
  if (modes.includes("push") && !modes.includes("pull") && !this.#pushSubscription) {
5750
+ const track = (delivery) => {
5751
+ this.#inFlightPushEvents.add(delivery);
5752
+ delivery.finally(() => this.#inFlightPushEvents.delete(delivery));
5753
+ };
5735
5754
  const cb = (event, ack, nack) => {
5736
5755
  const data = event.data;
5737
5756
  const wfId = data?.workflowId;
5738
5757
  const rId = data?.runId;
5758
+ try {
5759
+ this.#initializeDurableAgents();
5760
+ } catch (error) {
5761
+ this.#logger.error("Failed to initialize durable agents for push delivery", { error });
5762
+ if (nack) track(nack().catch((err) => this.#logger.error("Error nacking workflow event", err)));
5763
+ return;
5764
+ }
5739
5765
  if (wfId && rId && !this.#ownsWorkflow(wfId, rId, data?.parentWorkflow)) {
5740
- if (ack) ack().catch((err) => this.#logger?.error?.("Error acking skipped workflow event", err));
5766
+ if (ack) track(ack().catch((err) => this.#logger?.error?.("Error acking skipped workflow event", err)));
5741
5767
  return;
5742
5768
  }
5743
5769
  const inFlight = this.handleWorkflowEvent(event).then((result) => {
@@ -5755,8 +5781,7 @@ var Mastra = class Mastra {
5755
5781
  }
5756
5782
  if (ack) return ack().catch((err) => this.#logger?.error?.("Error acking terminal workflow event in push subscription", err));
5757
5783
  }).catch((err) => this.#logger?.error?.("Unhandled error in workflow event push subscription", err));
5758
- this.#inFlightPushEvents.add(inFlight);
5759
- inFlight.finally(() => this.#inFlightPushEvents.delete(inFlight));
5784
+ track(inFlight);
5760
5785
  };
5761
5786
  await this.#pubsub.subscribe("workflows", cb);
5762
5787
  this.#pushSubscription = {
@@ -5802,6 +5827,7 @@ var Mastra = class Mastra {
5802
5827
  await this.#executionWorkersStartPromise;
5803
5828
  }
5804
5829
  async #startExecutionWorkers() {
5830
+ this.#initializeDurableAgents();
5805
5831
  if (this.#storage) await this.#storage.init();
5806
5832
  const deps = {
5807
5833
  pubsub: this.#pubsub,
@@ -6109,7 +6135,7 @@ var Mastra = class Mastra {
6109
6135
  #syncGatewayRegistry() {
6110
6136
  try {
6111
6137
  if (process.env.MASTRA_DEV !== "true" && process.env.MASTRA_DEV !== "1") return;
6112
- import("./provider-registry-Ble43Wb4.js").then((n) => n.d).then(async ({ GatewayRegistry }) => {
6138
+ import("./provider-registry-RZ8EgSe8.js").then((n) => n.d).then(async ({ GatewayRegistry }) => {
6113
6139
  const registry = GatewayRegistry.getInstance();
6114
6140
  const customGateways = Object.values(this.#gateways || {});
6115
6141
  registry.registerCustomGateways(customGateways);
@@ -1,34 +1,35 @@
1
- const require_run_registry = require("./run-registry-aomba2_Z.cjs");
2
- const require_background_tasks = require("./background-tasks-Da0c3R-J.cjs");
1
+ const require_run_registry = require("./run-registry-5_LQBGn_.cjs");
2
+ const require_background_tasks = require("./background-tasks-DqnQMfuf.cjs");
3
3
  const require_inmemory = require("./inmemory-fgR8sq-U.cjs");
4
- const require_manager = require("./manager-BJKx4lQf.cjs");
4
+ const require_manager = require("./manager-DwFnIrI6.cjs");
5
5
  const require_error = require("./error-D90lJ6M7.cjs");
6
- const require_output_helpers = require("./output-helpers-CncZ3y-g.cjs");
6
+ const require_output_helpers = require("./output-helpers-JL-HeCbT.cjs");
7
7
  const require_hooks = require("./hooks-D7VDBETj.cjs");
8
8
  const require_license_index = require("./license/index.cjs");
9
- const require_netlify = require("./netlify-B_XdjYPY.cjs");
10
- const require_llm = require("./llm-ByskI6z3.cjs");
9
+ const require_netlify = require("./netlify-C-83Fxus.cjs");
10
+ const require_llm = require("./llm-CsQuqKPc.cjs");
11
11
  const require_logger = require("./logger-CvzZYuJd.cjs");
12
12
  const require_logger_index = require("./logger/index.cjs");
13
- const require_schedules = require("./schedules-qIHUKsj4.cjs");
13
+ const require_schedules = require("./schedules-BZS8McF7.cjs");
14
14
  const require_observability = require("./observability-B0R_D1PZ.cjs");
15
15
  const require_observability_context_storage = require("./observability/context-storage.cjs");
16
16
  const require_utils = require("./utils-D-eNsgDM.cjs");
17
- const require_source = require("./source-8qxr6KJv.cjs");
17
+ const require_source = require("./source-DDwx-87N.cjs");
18
18
  const require_feature_telemetry = require("./feature-telemetry-Cw0L1tHo.cjs");
19
- const require_tool_loop_agent = require("./tool-loop-agent-DU0BiemT.cjs");
19
+ const require_tool_loop_agent = require("./tool-loop-agent-Dn0QCB9n.cjs");
20
20
  const require_payload_transform = require("./payload-transform-CWgnsO9w.cjs");
21
- const require_utils$1 = require("./utils-CeEt4K7t.cjs");
22
- const require_worker = require("./worker-BfhUD77l.cjs");
23
- const require_builder = require("./builder-DS826dWf.cjs");
24
- const require_validate = require("./validate-BckgxuJ0.cjs");
25
- const require_rehydrate = require("./rehydrate-BiA_HUJH.cjs");
26
- const require_stream = require("./stream-DUrp3Fcy.cjs");
21
+ const require_utils$1 = require("./utils-DY01hxVd.cjs");
22
+ const require_worker = require("./worker-GsGIxPMa.cjs");
23
+ const require_builder = require("./builder-D8Osghdo.cjs");
24
+ const require_validate = require("./validate-CuB_1Zd3.cjs");
25
+ const require_rehydrate = require("./rehydrate-B-wrAN7C.cjs");
26
+ const require_stream = require("./stream-4aNIw_TQ.cjs");
27
27
  let zod_v4 = require("zod/v4");
28
28
  // src/agent/streams/execution-capability.ts
29
- /** Policy and strategy metadata do not activate native execution in this stage. */
29
+ /** Native engine selection or the released structural adapter contract (including Inngest). */
30
30
  function hasDurableExecution(obj) {
31
- return require_run_registry.isDurableAgentLike(obj);
31
+ if (require_run_registry.isDurableAgentLike(obj)) return true;
32
+ return typeof obj === "object" && obj !== null && "__hasDurableExecution" in obj && typeof obj.__hasDurableExecution === "function" && obj.__hasDurableExecution() === true;
32
33
  }
33
34
  // src/notifications/workflow.ts
34
35
  const NOTIFICATION_DISPATCH_WORKFLOW_ID = "__mastra_notification_dispatcher";
@@ -2020,7 +2021,7 @@ var Mastra = class Mastra {
2020
2021
  const agents = this.#agents;
2021
2022
  if (agents[agentKey]) {
2022
2023
  if (agents[agentKey] === mastraAgent || toolLoopInput && this.#toolLoopRegistrations.get(toolLoopInput)?.get(agentKey) === agents[agentKey] || agents[agentKey].source === "stored" && options?.source === "stored") {
2023
- if (agents[agentKey] === mastraAgent) mastraAgent.__registerExecutionEnginePolicy(this.#durable);
2024
+ if (agents[agentKey] === mastraAgent) mastraAgent.__registerExecutionEnginePolicy?.(this.#durable);
2024
2025
  return;
2025
2026
  }
2026
2027
  throw new require_error.MastraError({
@@ -2044,7 +2045,7 @@ var Mastra = class Mastra {
2044
2045
  tts: this.#tts,
2045
2046
  vectors: this.#vectors
2046
2047
  });
2047
- mastraAgent.__registerExecutionEnginePolicy(this.#durable);
2048
+ mastraAgent.__registerExecutionEnginePolicy?.(this.#durable);
2048
2049
  agents[agentKey] = mastraAgent;
2049
2050
  if (toolLoopInput) {
2050
2051
  let registrations = this.#toolLoopRegistrations.get(toolLoopInput);
@@ -5052,7 +5053,7 @@ var Mastra = class Mastra {
5052
5053
  if (!this.#workerFilter || this.#workerFilter.has("agent-schedule")) {
5053
5054
  let agentScheduleWorker = this.#findAgentScheduleWorker();
5054
5055
  if (!agentScheduleWorker) {
5055
- const { AgentScheduleWorker } = await Promise.resolve().then(() => require("./worker-D9WwmcJa.cjs"));
5056
+ const { AgentScheduleWorker } = await Promise.resolve().then(() => require("./worker-CbaSmip-.cjs"));
5056
5057
  agentScheduleWorker = new AgentScheduleWorker();
5057
5058
  agentScheduleWorker.__registerMastra(this);
5058
5059
  this.#workers.push(agentScheduleWorker);
@@ -5625,6 +5626,10 @@ var Mastra = class Mastra {
5625
5626
  async removeTopicListener(topic, listener) {
5626
5627
  await this.#pubsub.unsubscribe(topic, this.#ackingTopicListener(listener));
5627
5628
  }
5629
+ /** Build native durable agents' engines and register their workflows, so event ownership checks can find them. */
5630
+ #initializeDurableAgents() {
5631
+ for (const agent of Object.values(this.#agents ?? {})) if (hasDurableExecution(agent) && !require_run_registry.isDurableAgentLike(agent)) agent.__initializeDurableExecution();
5632
+ }
5628
5633
  /**
5629
5634
  * Process a single workflow event. Shared entry point used by:
5630
5635
  * - pull-mode workers (OrchestrationWorker)
@@ -5636,6 +5641,15 @@ var Mastra = class Mastra {
5636
5641
  * should nack/return 5xx so the broker retries.
5637
5642
  */
5638
5643
  async handleWorkflowEvent(event) {
5644
+ try {
5645
+ this.#initializeDurableAgents();
5646
+ } catch (error) {
5647
+ this.#logger.error("Failed to initialize durable agents for workflow event", { error });
5648
+ return {
5649
+ ok: false,
5650
+ retry: true
5651
+ };
5652
+ }
5639
5653
  if (!this.#workflowEventProcessor) this.#workflowEventProcessor = new require_run_registry.WorkflowEventProcessor({ mastra: this });
5640
5654
  return this.#workflowEventProcessor.handle(event);
5641
5655
  }
@@ -5657,6 +5671,7 @@ var Mastra = class Mastra {
5657
5671
  */
5658
5672
  async startWorkers(name) {
5659
5673
  if (this.#storage) await this.#storage.init();
5674
+ this.#initializeDurableAgents();
5660
5675
  const schedulerSelected = !this.#schedulerDisabled() && (!this.#workerFilter || this.#workerFilter.has("scheduler"));
5661
5676
  const schedulerForcedByFilter = schedulerSelected && (this.#workerFilter?.has("scheduler") ?? false);
5662
5677
  if (!name && schedulerSelected && this.#storage && !this.#findSchedulerWorker()?.isRunning) try {
@@ -5675,7 +5690,7 @@ var Mastra = class Mastra {
5675
5690
  this.#workers.push(sw);
5676
5691
  }
5677
5692
  if (!this.#findAgentScheduleWorker()) {
5678
- const { AgentScheduleWorker } = await Promise.resolve().then(() => require("./worker-D9WwmcJa.cjs"));
5693
+ const { AgentScheduleWorker } = await Promise.resolve().then(() => require("./worker-CbaSmip-.cjs"));
5679
5694
  const asw = new AgentScheduleWorker();
5680
5695
  asw.__registerMastra(this);
5681
5696
  this.#workers.push(asw);
@@ -5732,12 +5747,23 @@ var Mastra = class Mastra {
5732
5747
  async #wirePushWorkflowSubscription() {
5733
5748
  const modes = this.#pubsub.supportedModes ?? ["pull"];
5734
5749
  if (modes.includes("push") && !modes.includes("pull") && !this.#pushSubscription) {
5750
+ const track = (delivery) => {
5751
+ this.#inFlightPushEvents.add(delivery);
5752
+ delivery.finally(() => this.#inFlightPushEvents.delete(delivery));
5753
+ };
5735
5754
  const cb = (event, ack, nack) => {
5736
5755
  const data = event.data;
5737
5756
  const wfId = data?.workflowId;
5738
5757
  const rId = data?.runId;
5758
+ try {
5759
+ this.#initializeDurableAgents();
5760
+ } catch (error) {
5761
+ this.#logger.error("Failed to initialize durable agents for push delivery", { error });
5762
+ if (nack) track(nack().catch((err) => this.#logger.error("Error nacking workflow event", err)));
5763
+ return;
5764
+ }
5739
5765
  if (wfId && rId && !this.#ownsWorkflow(wfId, rId, data?.parentWorkflow)) {
5740
- if (ack) ack().catch((err) => this.#logger?.error?.("Error acking skipped workflow event", err));
5766
+ if (ack) track(ack().catch((err) => this.#logger?.error?.("Error acking skipped workflow event", err)));
5741
5767
  return;
5742
5768
  }
5743
5769
  const inFlight = this.handleWorkflowEvent(event).then((result) => {
@@ -5755,8 +5781,7 @@ var Mastra = class Mastra {
5755
5781
  }
5756
5782
  if (ack) return ack().catch((err) => this.#logger?.error?.("Error acking terminal workflow event in push subscription", err));
5757
5783
  }).catch((err) => this.#logger?.error?.("Unhandled error in workflow event push subscription", err));
5758
- this.#inFlightPushEvents.add(inFlight);
5759
- inFlight.finally(() => this.#inFlightPushEvents.delete(inFlight));
5784
+ track(inFlight);
5760
5785
  };
5761
5786
  await this.#pubsub.subscribe("workflows", cb);
5762
5787
  this.#pushSubscription = {
@@ -5802,6 +5827,7 @@ var Mastra = class Mastra {
5802
5827
  await this.#executionWorkersStartPromise;
5803
5828
  }
5804
5829
  async #startExecutionWorkers() {
5830
+ this.#initializeDurableAgents();
5805
5831
  if (this.#storage) await this.#storage.init();
5806
5832
  const deps = {
5807
5833
  pubsub: this.#pubsub,
@@ -6109,7 +6135,7 @@ var Mastra = class Mastra {
6109
6135
  #syncGatewayRegistry() {
6110
6136
  try {
6111
6137
  if (process.env.MASTRA_DEV !== "true" && process.env.MASTRA_DEV !== "1") return;
6112
- Promise.resolve().then(() => require("./provider-registry-D8O1G18A.cjs")).then((n) => n.provider_registry_exports).then(async ({ GatewayRegistry }) => {
6138
+ Promise.resolve().then(() => require("./provider-registry-9O-H9osy.cjs")).then((n) => n.provider_registry_exports).then(async ({ GatewayRegistry }) => {
6113
6139
  const registry = GatewayRegistry.getInstance();
6114
6140
  const customGateways = Object.values(this.#gateways || {});
6115
6141
  registry.registerCustomGateways(customGateways);
@@ -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_stream = require("../stream-4aNIw_TQ.cjs");
3
+ const require_run_registry = require("../run-registry-5_LQBGn_.cjs");
4
4
  const require_message_list = require("../message-list-DPXPXvin.cjs");
5
5
  exports.AUTHORED_USER_TURN = require_message_list.AUTHORED_USER_TURN;
6
6
  exports.DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS = require_run_registry.DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS;
@@ -1,4 +1,4 @@
1
- import { Bt as TITLE_PINNED_THREAD_METADATA_KEY, Gt as setThreadOMMetadata, Ht as isObservationalMemoryEnabled, Ut as isThreadTitlePinned, Vt as getThreadOMMetadata, Wt as parseMemoryRequestContext } from "../stream-S_NC5v9e.js";
2
- import { At as extractMessageEmbeddingText, Dt as MESSAGE_EMBEDDING_CHARS_PER_TOKEN, Et as DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS, Ft as MemoryProcessor, It as memoryDefaultOptions, Lt as filterSystemReminderMessages, Mt as resolveMaxChunkChars, Nt as upsertMessageVectors, Ot as buildMessageEmbeddingRows, Pt as MastraMemory, Rt as isSystemReminderMessage, Tt as MockMemory, as as getMemoryTokenBoundary, in as loadMessageHistory, is as advanceMemoryTokenBoundary, jt as messageVectorId, kt as chunkMessageText, ns as MemoryRunState, os as isAfterMemoryTokenBoundary, rn as groupLinkedToolMessages, rs as getMemoryRunState, ss as normalizeMessageHistoryConfig } from "../run-registry-BUFmc_78.js";
1
+ import { Bt as TITLE_PINNED_THREAD_METADATA_KEY, Gt as setThreadOMMetadata, Ht as isObservationalMemoryEnabled, Ut as isThreadTitlePinned, Vt as getThreadOMMetadata, Wt as parseMemoryRequestContext } from "../stream-CJUm6EAH.js";
2
+ import { $o as normalizeMessageHistoryConfig, Co as MastraMemory, Do as isSystemReminderMessage, Eo as filterSystemReminderMessages, Jn as getMemoryRunState, Jo as groupLinkedToolMessages, Qo as isAfterMemoryTokenBoundary, So as upsertMessageVectors, To as memoryDefaultOptions, Xo as advanceMemoryTokenBoundary, Yn as MockMemory, Yo as loadMessageHistory, Zo as getMemoryTokenBoundary, _o as buildMessageEmbeddingRows, bo as messageVectorId, go as MESSAGE_EMBEDDING_CHARS_PER_TOKEN, ho as DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS, qn as MemoryRunState, vo as chunkMessageText, wo as MemoryProcessor, xo as resolveMaxChunkChars, yo as extractMessageEmbeddingText } from "../run-registry-DC03XLeZ.js";
3
3
  import { $ as AUTHORED_USER_TURN, C as extractWorkingMemoryTags, D as removeWorkingMemoryToolInvocationParts, E as removeWorkingMemoryTags, O as removeWorkingMemoryToolInvocations, S as extractWorkingMemoryContent, T as removeSystemReminderTags, _ as SYSTEM_REMINDER_START_TAG, at as stripClientAuthoredTurnMarks, b as WORKING_MEMORY_START_TAG, et as asUserTurn, g as SYSTEM_REMINDER_END_TAG, h as SET_WORKING_MEMORY_TOOL_NAME, it as sealUserTurnMessage, nt as messageDeclaresAuthoredTurn, rt as sealTurnMarkup, tt as escapeTurnMarkup, v as UPDATE_WORKING_MEMORY_TOOL_NAME, w as isWorkingMemoryToolName, x as WORKING_MEMORY_TOOL_NAMES, y as WORKING_MEMORY_END_TAG } from "../message-list-DEuRl82K.js";
4
4
  export { AUTHORED_USER_TURN, DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS, MESSAGE_EMBEDDING_CHARS_PER_TOKEN, MastraMemory, MemoryProcessor, MemoryRunState, MockMemory, SET_WORKING_MEMORY_TOOL_NAME, SYSTEM_REMINDER_END_TAG, SYSTEM_REMINDER_START_TAG, TITLE_PINNED_THREAD_METADATA_KEY, UPDATE_WORKING_MEMORY_TOOL_NAME, WORKING_MEMORY_END_TAG, WORKING_MEMORY_START_TAG, WORKING_MEMORY_TOOL_NAMES, advanceMemoryTokenBoundary, asUserTurn, buildMessageEmbeddingRows, chunkMessageText, escapeTurnMarkup, extractMessageEmbeddingText, extractWorkingMemoryContent, extractWorkingMemoryTags, filterSystemReminderMessages, getMemoryRunState, getMemoryTokenBoundary, getThreadOMMetadata, groupLinkedToolMessages, isAfterMemoryTokenBoundary, isObservationalMemoryEnabled, isSystemReminderMessage, isThreadTitlePinned, isWorkingMemoryToolName, loadMessageHistory, memoryDefaultOptions, messageDeclaresAuthoredTurn, messageVectorId, normalizeMessageHistoryConfig, parseMemoryRequestContext, removeSystemReminderTags, removeWorkingMemoryTags, removeWorkingMemoryToolInvocationParts, removeWorkingMemoryToolInvocations, resolveMaxChunkChars, sealTurnMarkup, sealUserTurnMessage, setThreadOMMetadata, stripClientAuthoredTurnMarks, upsertMessageVectors };