@mastra/core 1.87.0-alpha.12 → 1.87.0-alpha.14

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 (584) hide show
  1. package/dist/agent/active-run-signal-queues.d.ts +49 -0
  2. package/dist/agent/agent.d.ts +17 -1
  3. package/dist/agent/durable/abort-transport.d.ts +1 -1
  4. package/dist/agent/durable/durable-agent.d.ts +1 -0
  5. package/dist/agent/durable/execution-engine.d.ts +12 -0
  6. package/dist/agent/durable/index.cjs +1 -1
  7. package/dist/agent/durable/index.js +1 -1
  8. package/dist/agent/durable/preparation.d.ts +17 -0
  9. package/dist/agent/durable/stored-signal-drain.d.ts +100 -0
  10. package/dist/agent/durable/types.d.ts +37 -0
  11. package/dist/agent/durable/utils/resolve-runtime.d.ts +11 -0
  12. package/dist/agent/durable/utils/serialize-state.d.ts +1 -0
  13. package/dist/agent/durable/workflows/create-durable-agentic-workflow.d.ts +1 -0
  14. package/dist/agent/durable/workflows/durable-loop-builder.d.ts +5 -0
  15. package/dist/agent/durable/workflows/finalize-run.d.ts +6 -0
  16. package/dist/agent/durable/workflows/shared/message-list-state.d.ts +6 -2
  17. package/dist/agent/durable/workflows/shared/schemas.d.ts +2 -0
  18. package/dist/agent/durable/workflows/steps/llm-execution.d.ts +1 -0
  19. package/dist/agent/index.cjs +2 -2
  20. package/dist/agent/index.js +2 -2
  21. package/dist/agent/signals.d.ts +7 -3
  22. package/dist/agent/stored-run-signals.d.ts +93 -0
  23. package/dist/agent/stored-signals.d.ts +40 -0
  24. package/dist/agent/streams/abort-transport.d.ts +10 -1
  25. package/dist/agent/streams/constants.d.ts +9 -0
  26. package/dist/agent/streams/publisher.d.ts +3 -1
  27. package/dist/agent/thread-stream-runtime.d.ts +46 -4
  28. package/dist/agent/tool-name.d.ts +21 -0
  29. package/dist/agent-builder/ee/index.cjs +1 -1
  30. package/dist/agent-builder/ee/index.js +1 -1
  31. package/dist/agent-controller/index.cjs +1 -1
  32. package/dist/agent-controller/index.js +1 -1
  33. package/dist/agent-controller/types.d.ts +6 -0
  34. package/dist/{agent-controller-DfeTRuBc.js → agent-controller-FSjSZ_iD.js} +11 -9
  35. package/dist/{agent-controller-BcN7r3yI.cjs → agent-controller-k4B293tu.cjs} +11 -9
  36. package/dist/background-tasks/index.cjs +1 -1
  37. package/dist/background-tasks/index.js +1 -1
  38. package/dist/background-tasks/manager.d.ts +3 -1
  39. package/dist/background-tasks/workflow-id.d.ts +42 -0
  40. package/dist/{background-tasks-BcU--rXL.js → background-tasks-ClI6oF60.js} +239 -28
  41. package/dist/{background-tasks-DRUHnQOk.cjs → background-tasks-D40Y_iLc.cjs} +262 -27
  42. package/dist/browser/index.cjs +2 -2
  43. package/dist/browser/index.js +2 -2
  44. package/dist/{builder-Bufqrcz3.cjs → builder-C_I6l0US.cjs} +2 -2
  45. package/dist/{builder-TuIc5l7X.js → builder-D00XMm41.js} +2 -2
  46. package/dist/capabilities/302ai.json +197 -197
  47. package/dist/capabilities/abliteratedllm.json +33 -33
  48. package/dist/capabilities/abliteration-ai.json +10 -10
  49. package/dist/capabilities/above.json +22 -22
  50. package/dist/capabilities/adaption.json +7 -7
  51. package/dist/capabilities/adzuki.json +31 -31
  52. package/dist/capabilities/agentrouter.json +4 -4
  53. package/dist/capabilities/agnes.json +4 -4
  54. package/dist/capabilities/ai-router.json +6 -6
  55. package/dist/capabilities/aiand.json +22 -22
  56. package/dist/capabilities/aigrow.json +11 -11
  57. package/dist/capabilities/aimlapi.json +146 -146
  58. package/dist/capabilities/aipg.json +2 -2
  59. package/dist/capabilities/aixy.json +20 -20
  60. package/dist/capabilities/aki-io.json +13 -13
  61. package/dist/capabilities/alibaba-cn.json +126 -90
  62. package/dist/capabilities/alibaba-coding-plan-cn.json +6 -11
  63. package/dist/capabilities/alibaba-coding-plan.json +6 -11
  64. package/dist/capabilities/alibaba-token-plan-cn.json +49 -49
  65. package/dist/capabilities/alibaba-token-plan.json +54 -54
  66. package/dist/capabilities/alibaba.json +87 -61
  67. package/dist/capabilities/ambient.json +14 -14
  68. package/dist/capabilities/amd.json +8 -8
  69. package/dist/capabilities/anthropic.json +42 -42
  70. package/dist/capabilities/anyapi.json +16 -16
  71. package/dist/capabilities/apiko.json +5 -5
  72. package/dist/capabilities/arcee.json +11 -11
  73. package/dist/capabilities/auriko.json +15 -15
  74. package/dist/capabilities/bailing.json +5 -5
  75. package/dist/capabilities/baseten.json +35 -35
  76. package/dist/capabilities/bee.json +3 -3
  77. package/dist/capabilities/berget.json +8 -8
  78. package/dist/capabilities/bothub.json +16 -16
  79. package/dist/capabilities/boundless.json +34 -34
  80. package/dist/capabilities/bumo.json +37 -37
  81. package/dist/capabilities/byteplus.json +29 -29
  82. package/dist/capabilities/cerebras.json +4 -4
  83. package/dist/capabilities/cheapaimodel.json +10 -10
  84. package/dist/capabilities/cheapest-token.json +29 -29
  85. package/dist/capabilities/chutes.json +58 -10
  86. package/dist/capabilities/cline-pass.json +38 -38
  87. package/dist/capabilities/cloudcode.json +6 -6
  88. package/dist/capabilities/cloudferro-sherlock.json +4 -4
  89. package/dist/capabilities/cloudflare-workers-ai.json +16 -16
  90. package/dist/capabilities/commandcode.json +147 -147
  91. package/dist/capabilities/concentrate.json +277 -277
  92. package/dist/capabilities/cortecs.json +102 -102
  93. package/dist/capabilities/crossmodel.json +183 -183
  94. package/dist/capabilities/crusoe.json +17 -17
  95. package/dist/capabilities/daoxe.json +8 -8
  96. package/dist/capabilities/databricks.json +124 -124
  97. package/dist/capabilities/deepinfra.json +101 -101
  98. package/dist/capabilities/deepseek.json +3 -3
  99. package/dist/capabilities/digitalocean.json +116 -116
  100. package/dist/capabilities/dothoosh.json +32 -32
  101. package/dist/capabilities/doubleword.json +30 -30
  102. package/dist/capabilities/edenai.json +290 -290
  103. package/dist/capabilities/empiriolabs.json +162 -162
  104. package/dist/capabilities/engy.json +19 -19
  105. package/dist/capabilities/entrim.json +8 -8
  106. package/dist/capabilities/evroc.json +13 -13
  107. package/dist/capabilities/ezkielyna.json +12 -12
  108. package/dist/capabilities/fastrouter.json +86 -86
  109. package/dist/capabilities/fireworks-ai.json +99 -99
  110. package/dist/capabilities/fortytwo.json +4 -4
  111. package/dist/capabilities/freemodel.json +14 -14
  112. package/dist/capabilities/friendli.json +12 -12
  113. package/dist/capabilities/frogbot.json +91 -91
  114. package/dist/capabilities/gisoo.json +18 -18
  115. package/dist/capabilities/gmicloud.json +19 -19
  116. package/dist/capabilities/google.json +52 -52
  117. package/dist/capabilities/graphn.json +12 -12
  118. package/dist/capabilities/greenpt.json +34 -34
  119. package/dist/capabilities/groq.json +6 -6
  120. package/dist/capabilities/helicone.json +87 -87
  121. package/dist/capabilities/hetzner.json +4 -4
  122. package/dist/capabilities/hopper.json +2 -2
  123. package/dist/capabilities/hostinger-router.json +13 -20
  124. package/dist/capabilities/hpc-ai.json +10 -10
  125. package/dist/capabilities/huawei-maas.json +11 -11
  126. package/dist/capabilities/hubris.json +28 -28
  127. package/dist/capabilities/huggingface.json +92 -85
  128. package/dist/capabilities/hyper.json +18 -18
  129. package/dist/capabilities/impossibl.json +146 -146
  130. package/dist/capabilities/inception.json +2 -2
  131. package/dist/capabilities/inceptron.json +8 -8
  132. package/dist/capabilities/inco.json +4 -4
  133. package/dist/capabilities/infer.json +14 -14
  134. package/dist/capabilities/inferall.json +6 -6
  135. package/dist/capabilities/inference-coop.json +12 -12
  136. package/dist/capabilities/inferenceapis.json +26 -26
  137. package/dist/capabilities/inferris.json +4 -4
  138. package/dist/capabilities/infersia.json +10 -10
  139. package/dist/capabilities/inferx.json +3 -3
  140. package/dist/capabilities/infomaniak.json +3 -3
  141. package/dist/capabilities/io-net.json +4 -4
  142. package/dist/capabilities/isoquant.json +4 -4
  143. package/dist/capabilities/iteracompute.json +55 -55
  144. package/dist/capabilities/jad-ai.json +2 -2
  145. package/dist/capabilities/jalapeno.json +10 -10
  146. package/dist/capabilities/jiekou.json +58 -58
  147. package/dist/capabilities/joingonka.json +4 -4
  148. package/dist/capabilities/jzstoken.json +51 -51
  149. package/dist/capabilities/keln.json +22 -22
  150. package/dist/capabilities/kenari.json +141 -116
  151. package/dist/capabilities/kilo.json +629 -645
  152. package/dist/capabilities/kimi-code-plan-cn.json +6 -6
  153. package/dist/capabilities/kimi-code-plan-global.json +6 -6
  154. package/dist/capabilities/kitani.json +6 -6
  155. package/dist/capabilities/klavo.json +26 -26
  156. package/dist/capabilities/korouter.json +27 -27
  157. package/dist/capabilities/kunavo.json +9 -9
  158. package/dist/capabilities/liquid.json +12 -12
  159. package/dist/capabilities/lithosai.json +3 -3
  160. package/dist/capabilities/llmgateway-providers.json +920 -928
  161. package/dist/capabilities/llmgateway.json +357 -349
  162. package/dist/capabilities/llmtr.json +32 -32
  163. package/dist/capabilities/logits.json +2 -2
  164. package/dist/capabilities/lowrouter.json +48 -48
  165. package/dist/capabilities/lyceum.json +14 -14
  166. package/dist/capabilities/melious.json +9 -9
  167. package/dist/capabilities/merge-gateway.json +276 -276
  168. package/dist/capabilities/meta.json +10 -10
  169. package/dist/capabilities/minimax-cn-coding-plan.json +5 -5
  170. package/dist/capabilities/minimax-cn.json +5 -5
  171. package/dist/capabilities/minimax-coding-plan.json +5 -5
  172. package/dist/capabilities/minimax.json +5 -5
  173. package/dist/capabilities/mistral.json +19 -19
  174. package/dist/capabilities/mixlayer.json +4 -4
  175. package/dist/capabilities/modal.json +14 -14
  176. package/dist/capabilities/model-oracle-ai.json +26 -26
  177. package/dist/capabilities/modelis.json +17 -17
  178. package/dist/capabilities/modular.json +13 -13
  179. package/dist/capabilities/moneo.json +16 -16
  180. package/dist/capabilities/moonshotai-cn.json +6 -6
  181. package/dist/capabilities/moonshotai.json +6 -6
  182. package/dist/capabilities/morph.json +17 -17
  183. package/dist/capabilities/munito-eu.json +6 -6
  184. package/dist/capabilities/munito.json +10 -10
  185. package/dist/capabilities/nan.json +30 -30
  186. package/dist/capabilities/nano-gpt.json +595 -596
  187. package/dist/capabilities/nearai.json +99 -99
  188. package/dist/capabilities/nebius.json +31 -31
  189. package/dist/capabilities/neon.json +126 -126
  190. package/dist/capabilities/neuralwatt.json +43 -43
  191. package/dist/capabilities/nokeep.json +4 -4
  192. package/dist/capabilities/novita-ai.json +123 -123
  193. package/dist/capabilities/nvidia.json +33 -33
  194. package/dist/capabilities/oathbreaker.json +4 -4
  195. package/dist/capabilities/obscurify.json +29 -29
  196. package/dist/capabilities/oci.json +9 -9
  197. package/dist/capabilities/ofox.json +243 -607
  198. package/dist/capabilities/ollama-cloud.json +55 -55
  199. package/dist/capabilities/openai.json +55 -55
  200. package/dist/capabilities/opencode-go.json +96 -94
  201. package/dist/capabilities/openreason.json +4 -4
  202. package/dist/capabilities/openrouter.json +529 -543
  203. package/dist/capabilities/opper.json +29 -29
  204. package/dist/capabilities/orcarouter.json +436 -178
  205. package/dist/capabilities/outerlabs.json +28 -28
  206. package/dist/capabilities/ovhcloud.json +21 -22
  207. package/dist/capabilities/pareto.json +6 -6
  208. package/dist/capabilities/perplexity-agent.json +63 -63
  209. package/dist/capabilities/phala.json +30 -30
  210. package/dist/capabilities/pioneer.json +23 -23
  211. package/dist/capabilities/poe.json +140 -140
  212. package/dist/capabilities/poolside.json +3 -3
  213. package/dist/capabilities/powerspring.json +14 -14
  214. package/dist/capabilities/primalabs.json +7 -7
  215. package/dist/capabilities/prime.json +119 -119
  216. package/dist/capabilities/privatemode-ai.json +10 -10
  217. package/dist/capabilities/proxystacks.json +7 -7
  218. package/dist/capabilities/qiniu-ai.json +15 -15
  219. package/dist/capabilities/refuseless.json +5 -5
  220. package/dist/capabilities/regolo-ai.json +8 -8
  221. package/dist/capabilities/requesty.json +204 -204
  222. package/dist/capabilities/ruapi.json +24 -24
  223. package/dist/capabilities/runcrate.json +15 -15
  224. package/dist/capabilities/runinfra.json +16 -16
  225. package/dist/capabilities/sakana.json +5 -5
  226. package/dist/capabilities/sambanova.json +7 -7
  227. package/dist/capabilities/sandbase.json +21 -21
  228. package/dist/capabilities/sarvam.json +11 -11
  229. package/dist/capabilities/scaleway.json +15 -15
  230. package/dist/capabilities/scnet-token-plan.json +14 -14
  231. package/dist/capabilities/scx-ai.json +26 -26
  232. package/dist/capabilities/sensenova.json +12 -12
  233. package/dist/capabilities/siliconflow-cn.json +54 -54
  234. package/dist/capabilities/siliconflow.json +66 -66
  235. package/dist/capabilities/snowflake-cortex.json +22 -22
  236. package/dist/capabilities/sokkan.json +7 -7
  237. package/dist/capabilities/sparrowcodes.json +23 -23
  238. package/dist/capabilities/standardcompute.json +96 -96
  239. package/dist/capabilities/steadyrouter.json +38 -38
  240. package/dist/capabilities/stepfun-ai-step-plan.json +15 -9
  241. package/dist/capabilities/stepfun-ai.json +22 -8
  242. package/dist/capabilities/stepfun-step-plan.json +15 -8
  243. package/dist/capabilities/stepfun.json +22 -8
  244. package/dist/capabilities/stepping-stone.json +25 -25
  245. package/dist/capabilities/synthetic.json +10 -10
  246. package/dist/capabilities/synthorai.json +24 -24
  247. package/dist/capabilities/teamorouter.json +18 -18
  248. package/dist/capabilities/teapot-router.json +12 -12
  249. package/dist/capabilities/tencent-token-plan-intl.json +20 -20
  250. package/dist/capabilities/tencent-token-plan.json +38 -38
  251. package/dist/capabilities/tencent-tokenhub.json +46 -46
  252. package/dist/capabilities/tensorx.json +52 -52
  253. package/dist/capabilities/tenstorrent.json +8 -8
  254. package/dist/capabilities/the-grid-ai.json +35 -35
  255. package/dist/capabilities/thinkingmachines.json +78 -78
  256. package/dist/capabilities/tinfoil.json +5 -5
  257. package/dist/capabilities/toapis.json +2 -2
  258. package/dist/capabilities/togetherai.json +53 -61
  259. package/dist/capabilities/tokengo.json +23 -23
  260. package/dist/capabilities/tokenify.json +9 -9
  261. package/dist/capabilities/trustedrouter.json +5 -5
  262. package/dist/capabilities/trustedtokens.json +19 -19
  263. package/dist/capabilities/umans-ai-coding-plan.json +15 -15
  264. package/dist/capabilities/umans-ai.json +11 -11
  265. package/dist/capabilities/unrestricted.json +8 -8
  266. package/dist/capabilities/uplinkswitch.json +22 -22
  267. package/dist/capabilities/upstage.json +4 -4
  268. package/dist/capabilities/vancine.json +19 -19
  269. package/dist/capabilities/vercel.json +520 -513
  270. package/dist/capabilities/verda.json +8 -1
  271. package/dist/capabilities/vivgrid.json +81 -81
  272. package/dist/capabilities/volcengine-coding-plan.json +29 -29
  273. package/dist/capabilities/volcengine.json +21 -21
  274. package/dist/capabilities/vultr.json +26 -26
  275. package/dist/capabilities/wafer.ai.json +13 -13
  276. package/dist/capabilities/wallaby.json +4 -4
  277. package/dist/capabilities/wally.json +13 -13
  278. package/dist/capabilities/wandb.json +17 -17
  279. package/dist/capabilities/watt.json +24 -24
  280. package/dist/capabilities/xai.json +4 -4
  281. package/dist/capabilities/xiaomi-token-plan-ams.json +2 -2
  282. package/dist/capabilities/xiaomi-token-plan-cn.json +2 -2
  283. package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -2
  284. package/dist/capabilities/xiaomi.json +2 -2
  285. package/dist/capabilities/xpersona.json +10 -10
  286. package/dist/capabilities/xxapi.json +28 -28
  287. package/dist/capabilities/zai-coding-plan.json +13 -13
  288. package/dist/capabilities/zai.json +28 -28
  289. package/dist/capabilities/zenifra.json +29 -29
  290. package/dist/capabilities/zenmux.json +178 -178
  291. package/dist/capabilities/zerogpu.json +15 -15
  292. package/dist/capabilities/zhipuai-coding-plan.json +6 -6
  293. package/dist/capabilities/zhipuai.json +25 -25
  294. package/dist/capabilities/zro.json +5 -5
  295. package/dist/channels/index.cjs +2 -2
  296. package/dist/channels/index.js +2 -2
  297. package/dist/{channels-MsOnUvU6.cjs → channels-BU5_kAUO.cjs} +1 -1
  298. package/dist/{channels-Cdsqdajh.js → channels-DMSae7xD.js} +1 -1
  299. package/dist/coding-agent/index.cjs +3 -3
  300. package/dist/coding-agent/index.js +3 -3
  301. package/dist/{constants-Bou0hEgY.cjs → constants-CFO8w780.cjs} +8 -0
  302. package/dist/{constants-CFWgIaqA.js → constants-CUv0mU2y.js} +8 -0
  303. package/dist/datasets/index.cjs +2 -2
  304. package/dist/datasets/index.js +2 -2
  305. package/dist/docs/SKILL.md +2 -1
  306. package/dist/docs/assets/SOURCE_MAP.json +1044 -1009
  307. package/dist/docs/references/docs-agents-code-mode.md +2 -2
  308. package/dist/docs/references/docs-agents-human-in-the-loop.md +2 -2
  309. package/dist/docs/references/docs-agents-networks.md +1 -1
  310. package/dist/docs/references/docs-agents-overview.md +6 -6
  311. package/dist/docs/references/docs-agents-processors.md +9 -9
  312. package/dist/docs/references/docs-agents-resumable-streams.md +2 -2
  313. package/dist/docs/references/docs-agents-structured-output.md +6 -6
  314. package/dist/docs/references/docs-agents-tools.md +9 -9
  315. package/dist/docs/references/docs-browser.md +1 -1
  316. package/dist/docs/references/docs-channels.md +5 -5
  317. package/dist/docs/references/docs-classifier.md +1 -1
  318. package/dist/docs/references/docs-connections-a2a.md +1 -1
  319. package/dist/docs/references/docs-connections-acp.md +2 -2
  320. package/dist/docs/references/docs-connections-overview.md +1 -1
  321. package/dist/docs/references/docs-connections-sdk-agents.md +6 -6
  322. package/dist/docs/references/docs-deployment-workers.md +1 -1
  323. package/dist/docs/references/docs-develop.md +1 -1
  324. package/dist/docs/references/docs-evals-custom-scorers.md +1 -1
  325. package/dist/docs/references/docs-evals-multi-turn.md +2 -2
  326. package/dist/docs/references/docs-guides-build-an-eval-loop.md +2 -2
  327. package/dist/docs/references/docs-guides-context-engineering.md +3 -3
  328. package/dist/docs/references/docs-guides-streaming.md +1 -1
  329. package/dist/docs/references/docs-harness-agent-controller.md +6 -3
  330. package/dist/docs/references/docs-harness-background-tasks.md +2 -2
  331. package/dist/docs/references/docs-harness-durable-agents.md +5 -5
  332. package/dist/docs/references/docs-harness-goals.md +2 -2
  333. package/dist/docs/references/docs-harness-schedules.md +35 -1
  334. package/dist/docs/references/docs-knowledge-agents-and-tools.md +2 -2
  335. package/dist/docs/references/docs-knowledge-importers.md +22 -1
  336. package/dist/docs/references/docs-knowledge-overview.md +1 -1
  337. package/dist/docs/references/docs-knowledge-scopes-and-access.md +1 -1
  338. package/dist/docs/references/docs-memory-memory-processors.md +8 -8
  339. package/dist/docs/references/docs-memory-message-history.md +3 -3
  340. package/dist/docs/references/docs-memory-observational-memory.md +1 -1
  341. package/dist/docs/references/docs-memory-semantic-recall.md +2 -2
  342. package/dist/docs/references/docs-memory-working-memory.md +3 -2
  343. package/dist/docs/references/docs-sandbox-overview.md +2 -2
  344. package/dist/docs/references/docs-sandbox-skills.md +1 -1
  345. package/dist/docs/references/docs-server-mastra-client.md +1 -1
  346. package/dist/docs/references/docs-server-mcp.md +23 -0
  347. package/dist/docs/references/docs-server-pubsub.md +21 -1
  348. package/dist/docs/references/docs-server-request-context.md +4 -4
  349. package/dist/docs/references/docs-signals-notifications.md +2 -2
  350. package/dist/docs/references/docs-signals-overview.md +1 -1
  351. package/dist/docs/references/docs-signals-running-across-processes.md +3 -0
  352. package/dist/docs/references/docs-signals-sending-signals.md +7 -7
  353. package/dist/docs/references/docs-signals-signal-providers.md +18 -2
  354. package/dist/docs/references/docs-signals-state-signals.md +1 -0
  355. package/dist/docs/references/docs-signals-thread-streams.md +12 -0
  356. package/dist/docs/references/docs-skills.md +4 -4
  357. package/dist/docs/references/docs-storage.md +12 -12
  358. package/dist/docs/references/docs-studio-editor.md +2 -2
  359. package/dist/docs/references/docs-subagents.md +26 -3
  360. package/dist/docs/references/integrations-agentic-ui-copilotkit.md +1 -1
  361. package/dist/docs/references/integrations-agentic-ui-openui.md +1 -1
  362. package/dist/docs/references/integrations-channels-discord.md +1 -1
  363. package/dist/docs/references/integrations-channels-github.md +1 -1
  364. package/dist/docs/references/integrations-channels-imessage.md +2 -2
  365. package/dist/docs/references/integrations-channels-ring.md +2 -2
  366. package/dist/docs/references/integrations-channels-slack.md +1 -1
  367. package/dist/docs/references/integrations-channels-teams.md +1 -1
  368. package/dist/docs/references/integrations-channels-telegram.md +1 -1
  369. package/dist/docs/references/integrations-channels-whatsapp.md +1 -1
  370. package/dist/docs/references/integrations-tools-firecrawl.md +1 -1
  371. package/dist/docs/references/reference-acp-acp-agent.md +1 -1
  372. package/dist/docs/references/reference-acp-create-acp-tool.md +1 -1
  373. package/dist/docs/references/reference-agent-controller-agent-controller-class.md +3 -1
  374. package/dist/docs/references/reference-agent-controller-session.md +5 -5
  375. package/dist/docs/references/reference-agents-agent.md +40 -14
  376. package/dist/docs/references/reference-agents-channels.md +11 -11
  377. package/dist/docs/references/reference-agents-durable-agent.md +2 -2
  378. package/dist/docs/references/reference-agents-getLLM.md +2 -2
  379. package/dist/docs/references/reference-agents-getMetadata.md +2 -2
  380. package/dist/docs/references/reference-agents-network.md +2 -2
  381. package/dist/docs/references/reference-browser-mastra-browser.md +1 -1
  382. package/dist/docs/references/reference-channels-thread-link.md +1 -1
  383. package/dist/docs/references/reference-classifier-classifier.md +2 -0
  384. package/dist/docs/references/reference-coding-agent-build-base-prompt.md +1 -1
  385. package/dist/docs/references/reference-coding-agent-create-coding-agent.md +7 -7
  386. package/dist/docs/references/reference-configuration.md +15 -14
  387. package/dist/docs/references/reference-core-getAgentById.md +1 -1
  388. package/dist/docs/references/reference-core-mastra-model-gateway.md +1 -1
  389. package/dist/docs/references/reference-datasets-startExperiment.md +1 -1
  390. package/dist/docs/references/reference-editor-mastra-editor.md +2 -2
  391. package/dist/docs/references/reference-file-based-agents-config.md +3 -3
  392. package/dist/docs/references/reference-file-based-agents-schedules.md +1 -1
  393. package/dist/docs/references/reference-file-based-agents-subagents.md +3 -3
  394. package/dist/docs/references/reference-file-based-agents-workspace.md +1 -1
  395. package/dist/docs/references/reference-knowledge-knowledge-class.md +12 -0
  396. package/dist/docs/references/reference-manual-install.md +1 -1
  397. package/dist/docs/references/reference-memory-memory-class.md +3 -3
  398. package/dist/docs/references/reference-memory-observational-memory.md +3 -3
  399. package/dist/docs/references/reference-observability-tracing-bridges-datadog.md +12 -11
  400. package/dist/docs/references/reference-observability-tracing-configuration.md +2 -2
  401. package/dist/docs/references/reference-observability-tracing-exporters-datadog.md +14 -12
  402. package/dist/docs/references/reference-processors-batch-parts-processor.md +1 -1
  403. package/dist/docs/references/reference-processors-classifier-processor.md +2 -2
  404. package/dist/docs/references/reference-processors-cyber-refusal-handler.md +1 -1
  405. package/dist/docs/references/reference-processors-language-detector.md +1 -1
  406. package/dist/docs/references/reference-processors-message-history-processor.md +1 -1
  407. package/dist/docs/references/reference-processors-model-selection-processor.md +3 -3
  408. package/dist/docs/references/reference-processors-moderation-processor.md +4 -4
  409. package/dist/docs/references/reference-processors-pii-detector.md +2 -2
  410. package/dist/docs/references/reference-processors-prefill-error-handler.md +2 -2
  411. package/dist/docs/references/reference-processors-processor-interface.md +19 -8
  412. package/dist/docs/references/reference-processors-prompt-injection-detector.md +1 -1
  413. package/dist/docs/references/reference-processors-provider-history-compat.md +1 -1
  414. package/dist/docs/references/reference-processors-response-cache.md +1 -1
  415. package/dist/docs/references/reference-processors-semantic-recall-processor.md +1 -1
  416. package/dist/docs/references/reference-processors-skill-search-processor.md +1 -1
  417. package/dist/docs/references/reference-processors-skills-processor.md +1 -1
  418. package/dist/docs/references/reference-processors-stream-error-retry-processor.md +3 -3
  419. package/dist/docs/references/reference-processors-system-prompt-scrubber.md +1 -1
  420. package/dist/docs/references/reference-processors-token-limiter-processor.md +3 -3
  421. package/dist/docs/references/reference-processors-tool-call-filter.md +2 -2
  422. package/dist/docs/references/reference-processors-tool-search-processor.md +3 -3
  423. package/dist/docs/references/reference-processors-unicode-normalizer.md +1 -1
  424. package/dist/docs/references/reference-processors-working-memory-processor.md +1 -1
  425. package/dist/docs/references/reference-rag-chunking-and-embedding.md +1 -1
  426. package/dist/docs/references/reference-rag-graph-rag-guide.md +2 -2
  427. package/dist/docs/references/reference-rag-retrieval.md +13 -13
  428. package/dist/docs/references/reference-signals-create-notification-inbox-tool.md +1 -1
  429. package/dist/docs/references/reference-signals-time-signal-provider.md +102 -0
  430. package/dist/docs/references/reference-storage-composite.md +4 -0
  431. package/dist/docs/references/reference-storage-overview.md +29 -29
  432. package/dist/docs/references/reference-tools-create-code-mode.md +1 -1
  433. package/dist/docs/references/reference-tools-vector-query-tool.md +3 -3
  434. package/dist/docs/references/reference-voice-overview.md +28 -28
  435. package/dist/docs/references/reference-voice-speech-to-speech.md +10 -10
  436. package/dist/docs/references/reference-voice-speech-to-text.md +1 -1
  437. package/dist/docs/references/reference-voice-text-to-speech.md +1 -1
  438. package/dist/docs/references/reference-voice-voice.addInstructions.md +1 -1
  439. package/dist/docs/references/reference-voice-voice.listen.md +1 -1
  440. package/dist/docs/references/reference-workers-overview.md +3 -1
  441. package/dist/docs/references/reference-workflows-step.md +1 -1
  442. package/dist/docs/references/reference-workflows-workflow-methods-map.md +1 -1
  443. package/dist/docs/references/reference-workflows-workflow.md +1 -1
  444. package/dist/docs/references/reference-workspace-factory-sandbox.md +2 -0
  445. package/dist/docs/references/reference-workspace-local-filesystem.md +1 -1
  446. package/dist/docs/references/reference-workspace-local-sandbox.md +1 -1
  447. package/dist/docs/references/reference.md +1 -0
  448. package/dist/evals/index.cjs +2 -2
  449. package/dist/evals/index.js +2 -2
  450. package/dist/evals/scoreTraces/index.cjs +2 -2
  451. package/dist/evals/scoreTraces/index.js +2 -2
  452. package/dist/harness/index.cjs +1 -1
  453. package/dist/harness/index.js +1 -1
  454. package/dist/index.cjs +1 -1
  455. package/dist/index.js +1 -1
  456. package/dist/knowledge/importers/overlay.d.ts +32 -0
  457. package/dist/knowledge/importers/sink.d.ts +11 -1
  458. package/dist/knowledge/importers/types.d.ts +9 -0
  459. package/dist/knowledge/index.cjs +551 -87
  460. package/dist/knowledge/index.d.ts +6 -0
  461. package/dist/knowledge/index.js +551 -87
  462. package/dist/knowledge/page-tools.d.ts +2 -0
  463. package/dist/llm/index.cjs +3 -3
  464. package/dist/llm/index.js +3 -3
  465. package/dist/llm/model/provider-types.generated.d.ts +7865 -7877
  466. package/dist/{llm-CS6YY_IV.cjs → llm-C1aiWB6O.cjs} +2 -2
  467. package/dist/{llm-zjtMQn7M.js → llm-D5rGQSnS.js} +2 -2
  468. package/dist/loop/index.cjs +2 -2
  469. package/dist/loop/index.js +2 -2
  470. package/dist/loop/loop-runtime.d.ts +1 -1
  471. package/dist/loop/shared/signal-outcome.d.ts +1 -1
  472. package/dist/loop/shared/steps/signal-drain-core.d.ts +9 -3
  473. package/dist/{manager-BU_lY6kl.cjs → manager-B2z5f39G.cjs} +3 -3
  474. package/dist/{manager-Do0MENhH.js → manager-DxwPLhYJ.js} +3 -3
  475. package/dist/mastra/index.cjs +1 -1
  476. package/dist/mastra/index.js +1 -1
  477. package/dist/{mastra-C-1zIyS5.js → mastra-CHd7UnbI.js} +17 -17
  478. package/dist/{mastra-DYVjsXTO.cjs → mastra-WMuI7TZD.cjs} +17 -17
  479. package/dist/memory/index.cjs +2 -2
  480. package/dist/memory/index.js +2 -2
  481. package/dist/{model-DIzIjDej.js → model-B8DlLHex.js} +1 -1
  482. package/dist/{model-DGFc1hw3.cjs → model-C2CTzjMk.cjs} +1 -1
  483. package/dist/{netlify-CyL6FNsw.cjs → netlify-Dhs0UJul.cjs} +1 -1
  484. package/dist/{netlify-B9mLgxJs.js → netlify-xQFmVbr4.js} +1 -1
  485. package/dist/notifications/index.cjs +1 -1
  486. package/dist/notifications/index.js +1 -1
  487. package/dist/processor-provider/index.cjs +1 -1
  488. package/dist/processor-provider/index.js +1 -1
  489. package/dist/processors/index.cjs +2 -2
  490. package/dist/processors/index.js +2 -2
  491. package/dist/{provider-registry-g9m_fyV8.cjs → provider-registry-CSQPAFzz.cjs} +22244 -22307
  492. package/dist/{provider-registry-DdQoO_jd.js → provider-registry-FxVHWmht.js} +22244 -22307
  493. package/dist/provider-registry.json +22283 -22350
  494. package/dist/{registry-generator-CX6Ev697.js → registry-generator-BzsrHxrr.js} +1 -1
  495. package/dist/{registry-generator-At8J4ZOR.cjs → registry-generator-Dsh7xcz9.cjs} +1 -1
  496. package/dist/{rehydrate-BzD6UX8f.cjs → rehydrate-8q7KX4rD.cjs} +2 -2
  497. package/dist/{rehydrate-DEDxsr6E.js → rehydrate-DV1iO9eZ.js} +2 -2
  498. package/dist/relevance/index.cjs +2 -2
  499. package/dist/relevance/index.js +2 -2
  500. package/dist/{run-registry-PiQTSx2Y.cjs → run-registry-DOlZccsr.cjs} +4703 -2233
  501. package/dist/{run-registry-D22IF5SK.js → run-registry-sTm40Ecv.js} +4704 -2234
  502. package/dist/{scheduler-B-VZUvv_.js → scheduler-0ShtMM1I.js} +71 -21
  503. package/dist/{scheduler-D00X03jQ.cjs → scheduler-CMjK0LoQ.cjs} +82 -20
  504. package/dist/server/types.d.ts +6 -0
  505. package/dist/signals/index.cjs +2 -1
  506. package/dist/signals/index.d.ts +1 -0
  507. package/dist/signals/index.js +2 -2
  508. package/dist/signals/time-signal-provider.d.ts +62 -0
  509. package/dist/signals-BTfT-6DE.js +280 -0
  510. package/dist/signals-CIwzgkvN.cjs +291 -0
  511. package/dist/{source-BVOi8Xhp.cjs → source-BC8Et5qZ.cjs} +7 -0
  512. package/dist/{source-fNa6u1kH.js → source-DYZMfjv3.js} +7 -0
  513. package/dist/storage/constants.cjs +1 -1
  514. package/dist/storage/constants.js +1 -1
  515. package/dist/storage/domains/agents/index.cjs +1 -1
  516. package/dist/storage/domains/agents/index.js +1 -1
  517. package/dist/storage/domains/inmemory-db.d.ts +6 -0
  518. package/dist/storage/domains/knowledge/base.d.ts +22 -4
  519. package/dist/storage/domains/knowledge/inmemory.d.ts +2 -0
  520. package/dist/storage/domains/knowledge/pages.d.ts +8 -0
  521. package/dist/storage/domains/memory/base.d.ts +107 -0
  522. package/dist/storage/domains/memory/index.d.ts +1 -0
  523. package/dist/storage/domains/memory/inmemory.d.ts +36 -0
  524. package/dist/storage/domains/memory/queue-thread.d.ts +36 -0
  525. package/dist/storage/domains/schedules/base.d.ts +31 -2
  526. package/dist/storage/domains/schedules/inmemory.d.ts +9 -2
  527. package/dist/storage/domains/workflows/base.d.ts +14 -0
  528. package/dist/storage/domains/workflows/inmemory.d.ts +4 -1
  529. package/dist/storage/index.cjs +9 -4
  530. package/dist/storage/index.js +5 -5
  531. package/dist/stream/index.cjs +2 -2
  532. package/dist/stream/index.js +2 -2
  533. package/dist/{stream-BbPZavop.cjs → stream-aGuW9AL8.cjs} +88 -2
  534. package/dist/{stream-CoQTdzLm.js → stream-k-Q1NLUs.js} +59 -3
  535. package/dist/test-utils/llm-mock.cjs +1 -1
  536. package/dist/test-utils/llm-mock.js +1 -1
  537. package/dist/tool-loop-agent/index.cjs +1 -1
  538. package/dist/tool-loop-agent/index.js +1 -1
  539. package/dist/{tool-loop-agent-DhQkNDaR.js → tool-loop-agent-CJrysPOR.js} +3 -3
  540. package/dist/{tool-loop-agent-8lyD6O4o.cjs → tool-loop-agent-WcRtGJHn.cjs} +3 -3
  541. package/dist/{utils-DtmyBuBT.cjs → utils-DEzQLxWP.cjs} +1 -1
  542. package/dist/{utils-B-3lET9S.js → utils-DamF4CfD.js} +1 -1
  543. package/dist/utils.cjs +1 -1
  544. package/dist/utils.js +1 -1
  545. package/dist/{validate-vucjWXcz.cjs → validate-CDlONK0o.cjs} +1 -1
  546. package/dist/{validate-CO4rWYyH.js → validate-rum3NMFA.js} +1 -1
  547. package/dist/vector/index.cjs +1 -1
  548. package/dist/vector/index.js +1 -1
  549. package/dist/worker/index.cjs +1 -1
  550. package/dist/worker/index.js +1 -1
  551. package/dist/{worker-BgifMkOw.cjs → worker-6MiKMAqB.cjs} +3 -3
  552. package/dist/{worker-B6CpapAF.js → worker-BnXipQth.js} +2 -2
  553. package/dist/{worker-eUT7GgQ9.cjs → worker-rwal1zI8.cjs} +2 -2
  554. package/dist/{worker-CCpSrXBY.js → worker-st16x0my.js} +3 -3
  555. package/dist/{workflow-B4Tn58DD.js → workflow-BzhYKgc_.js} +25 -33
  556. package/dist/{workflow-BJSrGEEL.cjs → workflow-D2-gn0U0.cjs} +25 -33
  557. package/dist/workflows/builder/index.cjs +1 -1
  558. package/dist/workflows/builder/index.js +1 -1
  559. package/dist/workflows/evented/execution-engine.d.ts +3 -1
  560. package/dist/workflows/evented/index.cjs +1 -1
  561. package/dist/workflows/evented/index.js +1 -1
  562. package/dist/workflows/evented/setup-warning.d.ts +11 -0
  563. package/dist/workflows/evented/workflow-event-processor/index.d.ts +10 -2
  564. package/dist/workflows/evented/workflow-event-processor/loop.d.ts +1 -1
  565. package/dist/workflows/evented/workflow-event-processor/parallel.d.ts +2 -2
  566. package/dist/workflows/evented/workflow-event-processor/sleep.d.ts +2 -2
  567. package/dist/workflows/evented/workflow.d.ts +6 -2
  568. package/dist/workflows/handlers/entry.d.ts +8 -0
  569. package/dist/workflows/index.cjs +7 -5
  570. package/dist/workflows/index.js +6 -6
  571. package/dist/workflows/run-storage.d.ts +11 -2
  572. package/dist/workflows/scheduler/claim.d.ts +51 -0
  573. package/dist/workflows/scheduler/index.d.ts +2 -0
  574. package/dist/workflows/types.d.ts +6 -0
  575. package/dist/workflows/workflow.d.ts +85 -10
  576. package/dist/workspace/filesystem/local-filesystem.d.ts +13 -0
  577. package/dist/workspace/index.cjs +1 -1
  578. package/dist/workspace/index.js +1 -1
  579. package/dist/{workspace-CnmmMou8.js → workspace-Ct2kAiDv.js} +50 -11
  580. package/dist/{workspace-C5lXteRU.cjs → workspace-CzzrnE6Q.cjs} +50 -11
  581. package/package.json +7 -7
  582. package/src/llm/model/provider-types.generated.d.ts +7865 -7877
  583. package/dist/signals-B1JSj-Ew.cjs +0 -58
  584. package/dist/signals-De9VnwL2.js +0 -53
@@ -32,7 +32,7 @@ export const researcher = new Agent({
32
32
  id: 'researcher',
33
33
  name: 'Researcher',
34
34
  instructions: 'You research topics thoroughly.',
35
- model: 'openai/gpt-6.1-sol',
35
+ model: 'openai/gpt-6.2-sol',
36
36
  durable: { executionEngine: 'default' },
37
37
  })
38
38
  ```
@@ -101,13 +101,13 @@ import { createEventedAgent } from '@mastra/core/agent/durable'
101
101
  const agent = new Agent({
102
102
  id: 'writer',
103
103
  instructions: 'You write articles.',
104
- model: 'openai/gpt-6.1-sol',
104
+ model: 'openai/gpt-6.2-sol',
105
105
  })
106
106
 
107
107
  export const eventedWriter = createEventedAgent({ agent })
108
108
  ```
109
109
 
110
- In one process, an evented agent runs on the default PubSub backend with no extra setup, which is how you try it locally. To run its steps on several processes, such as dedicated [workers](https://mastra.ai/docs/deployment/workers), configure a PubSub backend that redelivers unacknowledged events and a storage adapter with workflow step guards. `EventEmitterPubSub` and `UnixSocketPubSub` don't qualify. See [evented workflows and agents](https://mastra.ai/docs/server/pubsub) for the supported backends and adapters.
110
+ In one process, an evented agent runs on the default PubSub backend with no extra setup, which is how you try it locally. To run its steps on several processes, such as dedicated [workers](https://mastra.ai/docs/deployment/workers), configure a PubSub backend that redelivers unacknowledged events and a storage adapter with workflow step guards. `EventEmitterPubSub` and `UnixSocketPubSub` don't qualify. Messages sent to a running evented agent reach a run on another process only when the agent's memory uses [storage that shares pending signals across processes](https://mastra.ai/docs/server/pubsub). See [evented workflows and agents](https://mastra.ai/docs/server/pubsub) for the supported backends and adapters.
111
111
 
112
112
  ### Resumable streams for stored agents
113
113
 
@@ -120,7 +120,7 @@ await mastraClient.createStoredAgent({
120
120
  id: 'helper',
121
121
  name: 'Helper',
122
122
  instructions: 'You are a helpful assistant.',
123
- model: { provider: 'openai', name: 'gpt-5.6' },
123
+ model: { provider: 'openai', name: 'gpt-6.2-sol' },
124
124
  durable: true,
125
125
  })
126
126
  ```
@@ -141,7 +141,7 @@ const inngest = new Inngest({ id: 'my-app' })
141
141
  const agent = new Agent({
142
142
  id: 'analyst',
143
143
  instructions: 'You analyze data.',
144
- model: 'openai/gpt-6.1-sol',
144
+ model: 'openai/gpt-6.2-sol',
145
145
  })
146
146
 
147
147
  export const inngestAnalyst = createInngestAgent({ agent, inngest })
@@ -33,7 +33,7 @@ const worker = new Agent({
33
33
  id: 'worker',
34
34
  name: 'worker',
35
35
  instructions: 'You complete software tasks end to end.',
36
- model: 'openai/gpt-6.1-sol',
36
+ model: 'openai/gpt-6.2-sol',
37
37
  memory,
38
38
  goal: {
39
39
  judge: 'openai/gpt-6-luna',
@@ -93,7 +93,7 @@ const worker = new Agent({
93
93
  id: 'worker',
94
94
  name: 'worker',
95
95
  instructions: 'You complete software tasks end to end.',
96
- model: 'openai/gpt-6.1-sol',
96
+ model: 'openai/gpt-6.2-sol',
97
97
  memory,
98
98
  goal: {
99
99
  // A resolver function lets you inject provider credentials and read the
@@ -27,7 +27,7 @@ const pinger = new Agent({
27
27
  id: 'pinger',
28
28
  name: 'Pinger',
29
29
  instructions: 'Report the current system status in one sentence.',
30
- model: 'openai/gpt-6.1-sol',
30
+ model: 'openai/gpt-6.2-sol',
31
31
  })
32
32
 
33
33
  const mastra = new Mastra({
@@ -230,6 +230,40 @@ Things to know:
230
230
 
231
231
  Turning on **Experimental schedule tools** in `/settings` (restart required) gives the agent tools that manage the same schedules: `schedule_create`, `schedule_list`, `schedule_update` (pause or delete), `schedule_resume`, and `schedule_run`. The tools only see and change schedules on the thread of the run that calls them. Because a schedule can run a script on every fire, `schedule_create`, `schedule_resume`, and `schedule_run` need the same approval as running a shell command unless YOLO mode is on. Schedules the agent creates are marked `created by agent` in the transcript.
232
232
 
233
+ ## Ticking from outside the process
234
+
235
+ By default the in-process scheduler polls storage on a timer and fires due schedules. A host that serves many tenants from one database, or that runs without a long-lived process, can instead drive ticks itself, for example from a cron job that calls an HTTP route every minute.
236
+
237
+ Give each tenant a view of the store with `forTenant()`. A view only reads and writes that tenant's schedules and triggers, so schedule IDs only need to be unique per tenant:
238
+
239
+ ```typescript
240
+ const schedules = await mastra.getStorage()!.getStore('schedules')
241
+ const project = schedules!.forTenant('org_1:project_1')
242
+
243
+ await project.createSchedule(schedule)
244
+ ```
245
+
246
+ On each tick, call `runScheduleTick()` with the root store. It lists due tenant schedules across every tenant, passes each occurrence to `dispatch`, and only then advances the schedule:
247
+
248
+ ```typescript
249
+ import { runScheduleTick } from '@mastra/core/workflows'
250
+
251
+ await runScheduleTick({
252
+ store: schedules!,
253
+ now: Date.now(),
254
+ dispatch: fire => queue.enqueue({ name: fire.runId, payload: fire }),
255
+ onError: (error, schedule) =>
256
+ logger.error('Schedule dispatch failed', { scheduleId: schedule.id, error }),
257
+ })
258
+ ```
259
+
260
+ - **Dedupe on `runId`.** `runId` is the same for every attempt at one occurrence. If the process dies after `dispatch` but before the schedule advances, the next tick dispatches the same `runId` again, so `dispatch` must be idempotent on it, for example by naming the queue task after it.
261
+ - **Handle `onError`.** A failed dispatch leaves the schedule due, so it's retried on the next tick. A dispatch that keeps failing fails on every tick, and `onError` is the only place it's reported.
262
+ - **Tenant schedules only.** `runScheduleTick()` never fires schedules without a tenant. Those belong to the in-process scheduler, so the two never fire the same occurrence.
263
+ - **Claiming one fire.** To advance a single schedule you already dispatched yourself, call `claimScheduleFire({ store, schedule, now })`. It returns the claimed occurrence, or `undefined` if another tick claimed it first.
264
+
265
+ Tenant views are supported by the in-memory store, `@mastra/pg` and `@mastra/libsql`. Other stores throw from `forTenant()`. Prune trigger history from the root store. A tenant view refuses `prune()`.
266
+
233
267
  ## Related
234
268
 
235
269
  - [`mastra.schedules`](https://mastra.ai/reference/schedules/overview): API reference for creating and managing schedules.
@@ -48,7 +48,7 @@ export const supportAgent = new Agent({
48
48
  id: 'support-agent',
49
49
  name: 'Support agent',
50
50
  instructions: 'Help customers with their orders.',
51
- model: 'openai/gpt-6.1-sol',
51
+ model: 'openai/gpt-6.2-sol',
52
52
  knowledge,
53
53
  })
54
54
  ```
@@ -69,7 +69,7 @@ export const docsAgent = new Agent({
69
69
  id: 'docs-agent',
70
70
  name: 'Docs agent',
71
71
  instructions: `Answer from the company docs.\n\n${knowledge.getInstructions({ write: false, pinnedContext: false })}`,
72
- model: 'openai/gpt-6.1-sol',
72
+ model: 'openai/gpt-6.2-sol',
73
73
  tools: {
74
74
  ...knowledge.createTools({ write: false, pinnedContext: false }),
75
75
  },
@@ -18,7 +18,7 @@ Each importer instance is one configured source, called a binding. It has an `id
18
18
  2. Collects the items it writes with `ctx.items`, and applies them to Knowledge in numbered batches. Each batch is applied in one storage transaction, together with the cursor you saved with `ctx.state`. Accepted writes and cursor state commit together. A cursor can advance past refused items. Resend those items explicitly.
19
19
  3. Ends with a result that counts what was created, updated, left unchanged, moved, removed or refused.
20
20
 
21
- Items name things by `sourceId`, the source's own stable ID. Your importer never names pages or paths. An item with `parent` set is placed under the page of that parent item. An item without one is placed directly under the target.
21
+ Items name things by `sourceId`, the source's own stable ID. Your importer never names pages. An item with `parent` set is placed under the page of that parent item. An item with `path` set is placed at that path under the target. An item with neither is placed directly under the target.
22
22
 
23
23
  Importers need a Knowledge store that supports transactions: `@mastra/libsql`, `@mastra/pg` or the in-memory store.
24
24
 
@@ -107,6 +107,27 @@ export class HelpDeskImporter extends KnowledgeImporter({
107
107
 
108
108
  Set `parent` to another item's `sourceId` to nest pages. You can send a child before its parent. Until the parent is imported, the child waits directly under the target. After the parent is written, Knowledge moves waiting children under it in bounded batches, in the same run or a later one.
109
109
 
110
+ ### Place items by path
111
+
112
+ When the source already has a tree of names, such as a site's URLs, set `path` instead of `parent`. It's a list of key segments under the target, ending with the item's own key:
113
+
114
+ ```typescript
115
+ await ctx.items.upsert({ sourceId: url, title, body, path: ['agents', 'tools'] })
116
+ ```
117
+
118
+ Knowledge creates any folder on the path that doesn't exist yet as an empty page. When an item's path names a folder, the item takes that folder over and keeps its page, position and children. Any body a person wrote in the folder is kept as a note, and comes back if the source later removes the item. When an item's path changes, its page and its children move to the new path. Folders stay when their items are removed, until a person deletes them.
119
+
120
+ A path item is refused as `invalid` when:
121
+
122
+ - It also sets `fallbackParent`, or sets `parent` to anything other than `null`.
123
+ - Its path is empty, or a segment is empty or only whitespace.
124
+ - The target's path and the item's path together are more than ten keys deep, or a segment is too long for a page key.
125
+ - Its `sourceId` starts with `~path:`. Knowledge keeps that prefix for the folders it creates.
126
+
127
+ A path item is refused as `occupied` when another item of the same importer already sits at the path, or when its path changes to one that another page holds. The exception is a folder Knowledge created for this importer: its children move under the item's page. When the item already has a page and its path changes onto such a folder, the folder is deleted to free the key. That move is refused as `occupied` if a person left notes on the folder, or if its body would replace a body the item's page keeps. On an item's first save, the folder's page becomes the item's page. Its notes stay, and no body is lost. A page a person moved out of the target stays where they put it.
128
+
129
+ Placing by path needs a store that can change a page's key: PostgreSQL, LibSQL and the in-memory store. MySQL and MongoDB refuse every path item as `invalid`, and the run logs a warning once.
130
+
110
131
  To put a folder in the tree before you have its content, declare it. A declared item that creates its page gets a title and an empty body. Declaring an item whose page already exists keeps that page's body. An upsert of the item supplies or replaces the body:
111
132
 
112
133
  ```typescript
@@ -57,7 +57,7 @@ export const agent = new Agent({
57
57
  id: 'assistant',
58
58
  name: 'Assistant',
59
59
  instructions: 'You help your team and keep its knowledge up to date.',
60
- model: 'openai/gpt-6.1-sol',
60
+ model: 'openai/gpt-6.2-sol',
61
61
  memory: new Memory({ storage }),
62
62
  knowledge,
63
63
  })
@@ -134,7 +134,7 @@ export const faq = new Agent({
134
134
  id: 'faq',
135
135
  name: 'FAQ',
136
136
  instructions: 'You answer public questions about Acme.',
137
- model: 'openai/gpt-6.1-sol',
137
+ model: 'openai/gpt-6.2-sol',
138
138
  knowledge,
139
139
  memory,
140
140
  scopes: ({ scopes }) =>
@@ -57,7 +57,7 @@ const agent = new Agent({
57
57
  id: 'test-agent',
58
58
  name: 'Test Agent',
59
59
  instructions: 'You are a helpful assistant',
60
- model: 'openai/gpt-6.1-sol',
60
+ model: 'openai/gpt-6.2-sol',
61
61
  memory: new Memory({
62
62
  storage: new LibSQLStore({
63
63
  id: 'memory-store',
@@ -109,7 +109,7 @@ import { openai } from '@ai-sdk/openai'
109
109
  const agent = new Agent({
110
110
  name: 'semantic-agent',
111
111
  instructions: 'You are a helpful assistant with semantic memory',
112
- model: 'openai/gpt-6.1-sol',
112
+ model: 'openai/gpt-6.2-sol',
113
113
  memory: new Memory({
114
114
  storage: new LibSQLStore({
115
115
  id: 'memory-store',
@@ -159,7 +159,7 @@ import { openai } from '@ai-sdk/openai'
159
159
  const agent = new Agent({
160
160
  name: 'working-memory-agent',
161
161
  instructions: 'You are an assistant with working memory',
162
- model: 'openai/gpt-6.1-sol',
162
+ model: 'openai/gpt-6.2-sol',
163
163
  memory: new Memory({
164
164
  storage: new LibSQLStore({
165
165
  id: 'memory-store',
@@ -191,7 +191,7 @@ const customMessageHistory = new MessageHistory({
191
191
  const agent = new Agent({
192
192
  name: 'custom-memory-agent',
193
193
  instructions: 'You are a helpful assistant',
194
- model: 'openai/gpt-6.1-sol',
194
+ model: 'openai/gpt-6.2-sol',
195
195
  memory: new Memory({
196
196
  storage: new LibSQLStore({ id: 'memory-store', url: 'file:memory.db' }),
197
197
  options: {
@@ -264,7 +264,7 @@ const agent = new Agent({
264
264
  id: 'safe-agent',
265
265
  name: 'safe-agent',
266
266
  instructions: 'You are a helpful assistant',
267
- model: 'openai/gpt-6.1-sol',
267
+ model: 'openai/gpt-6.2-sol',
268
268
  memory: new Memory({ options: { lastMessages: 10 } }),
269
269
  // Your guardrail runs BEFORE memory saves
270
270
  outputProcessors: [contentBlocker],
@@ -304,7 +304,7 @@ const agent = new Agent({
304
304
  id: 'validated-agent',
305
305
  name: 'validated-agent',
306
306
  instructions: 'You are a helpful assistant',
307
- model: 'openai/gpt-6.1-sol',
307
+ model: 'openai/gpt-6.2-sol',
308
308
  memory: new Memory({ options: { lastMessages: 10 } }),
309
309
  // Your guardrail runs AFTER memory loads history
310
310
  inputProcessors: [inputValidator],
@@ -340,7 +340,7 @@ const agent = new Agent({
340
340
  id: 'writer',
341
341
  name: 'writer',
342
342
  instructions: 'You write step-by-step migration guides.',
343
- model: 'openai/gpt-6.1-sol',
343
+ model: 'openai/gpt-6.2-sol',
344
344
  memory,
345
345
  })
346
346
 
@@ -427,7 +427,7 @@ export const supportAgent = new Agent({
427
427
  id: 'support-agent',
428
428
  name: 'Support agent',
429
429
  instructions: 'Answer customer support questions.',
430
- model: 'openai/gpt-6.1-sol',
430
+ model: 'openai/gpt-6.2-sol',
431
431
  memory: new Memory({ options: { lastMessages: 10 } }),
432
432
  inputProcessors: [new AttachmentUploader()],
433
433
  })
@@ -196,7 +196,7 @@ export const supportAgent = new Agent({
196
196
  id: 'support-agent',
197
197
  name: 'Support agent',
198
198
  instructions: 'Answer customer support questions.',
199
- model: 'openai/gpt-6.1-sol',
199
+ model: 'openai/gpt-6.2-sol',
200
200
  memory: new Memory({
201
201
  options: {
202
202
  generateTitle: true,
@@ -219,7 +219,7 @@ export const supportAgent = new Agent({
219
219
  id: 'support-agent',
220
220
  name: 'Support agent',
221
221
  instructions: 'Answer customer support questions.',
222
- model: 'openai/gpt-6.1-sol',
222
+ model: 'openai/gpt-6.2-sol',
223
223
  memory: new Memory({
224
224
  options: {
225
225
  generateTitle: {
@@ -254,7 +254,7 @@ export const supportAgent = new Agent({
254
254
  id: 'support-agent',
255
255
  name: 'Support agent',
256
256
  instructions: 'Answer customer support questions.',
257
- model: 'openai/gpt-6.1-sol',
257
+ model: 'openai/gpt-6.2-sol',
258
258
  memory: new Memory({
259
259
  options: {
260
260
  generateTitle: {
@@ -176,7 +176,7 @@ const memory = new Memory({
176
176
  })
177
177
  ```
178
178
 
179
- Use a model with a large context window (128,000 tokens or more) that's fast enough to run in the background. Mastra has tested `google/gemini-2.5-flash`, `openai/gpt-6-luna`, `anthropic/claude-haiku-5.5` and `deepseek/deepseek-flash`.
179
+ Use a model with a large context window (128,000 tokens or more) that's fast enough to run in the background. Mastra has tested `google/gemini-2.5-flash`, `openai/gpt-6-luna`, `anthropic/claude-haiku-5-5` and `deepseek/deepseek-flash`.
180
180
 
181
181
  To use a different model per role, set `observation.model` and `reflection.model` instead, and leave the top-level `model` out. Setting both throws. Some models keep so much detail that their reflections can stay above the threshold; in testing, `google/gemini-2.5-flash` did this. A common split uses a detail-preserving model as the Observer and one that condenses more aggressively, such as `deepseek/deepseek-flash`, as the Reflector. See [different models per agent](https://mastra.ai/reference/memory/observational-memory).
182
182
 
@@ -38,7 +38,7 @@ const agent = new Agent({
38
38
  id: 'support-agent',
39
39
  name: 'SupportAgent',
40
40
  instructions: 'You are a helpful support agent.',
41
- model: 'openai/gpt-6.1-sol',
41
+ model: 'openai/gpt-6.2-sol',
42
42
  memory: new Memory({
43
43
  storage: new LibSQLStore({
44
44
  id: 'agent-storage',
@@ -68,7 +68,7 @@ const agent = new Agent({
68
68
  id: 'support-agent',
69
69
  name: 'SupportAgent',
70
70
  instructions: 'You are a helpful support agent.',
71
- model: 'openai/gpt-6.1-sol',
71
+ model: 'openai/gpt-6.2-sol',
72
72
  memory: new Memory({
73
73
  storage: new MongoDBStore({
74
74
  id: 'agent-storage',
@@ -34,7 +34,7 @@ const agent = new Agent({
34
34
  id: 'personal-assistant',
35
35
  name: 'PersonalAssistant',
36
36
  instructions: 'You are a helpful personal assistant.',
37
- model: 'openai/gpt-6.1-sol',
37
+ model: 'openai/gpt-6.2-sol',
38
38
  memory: new Memory({
39
39
  options: {
40
40
  workingMemory: {
@@ -269,7 +269,8 @@ When a schema is provided, the agent receives the working memory as a JSON objec
269
269
  Schema-based working memory uses **merge semantics**, meaning the agent only needs to include fields it wants to add or update. Existing fields are preserved automatically.
270
270
 
271
271
  - **Object fields are deep merged:** Only provided fields are updated; others remain unchanged
272
- - **Set a field to `null` to delete it:** This explicitly removes the field from memory
272
+ - **`null` in agent updates:** Optional schema fields set to `null` keep their existing value. A `null` only removes a key the schema doesn't declare as an optional property, such as a key in a record-style object
273
+ - **`null` in direct merges:** `memory.mergeWorkingMemory()` deletes a field when its value is `null`, including optional fields. Omit the field to keep its value
273
274
  - **Arrays are replaced entirely:** When an array field is provided, it replaces the existing array (arrays aren't merged element-by-element)
274
275
 
275
276
  ### Concurrent updates
@@ -30,7 +30,7 @@ export const codingAgent = new Agent({
30
30
  id: 'coding-agent',
31
31
  name: 'Coding agent',
32
32
  instructions: 'Use the sandbox to complete coding tasks.',
33
- model: 'openai/gpt-6.1-sol',
33
+ model: 'openai/gpt-6.2-sol',
34
34
  workspace: new Workspace({
35
35
  sandbox: new LocalSandbox({
36
36
  workingDirectory: './workspace',
@@ -344,7 +344,7 @@ const agent = new Agent({
344
344
  id: 'coder',
345
345
  name: 'Coder',
346
346
  instructions: 'You write and run code.',
347
- model: 'openai/gpt-6.1-sol',
347
+ model: 'openai/gpt-6.2-sol',
348
348
  workspace,
349
349
  tools: { recreate_sandbox: createRecreateSandboxTool() },
350
350
  })
@@ -95,7 +95,7 @@ export const supportAgent = new Agent({
95
95
  id: 'support-agent',
96
96
  name: 'Support Agent',
97
97
  instructions: 'You help customers with support requests.',
98
- model: 'openai/gpt-6.1-sol',
98
+ model: 'openai/gpt-6.2-sol',
99
99
  workspace,
100
100
  inputProcessors: [new SkillsProcessor({ injectCatalog: false })],
101
101
  })
@@ -301,7 +301,7 @@ export const colorAgent = new Agent({
301
301
  instructions: `You are a helpful CSS assistant.
302
302
  You can change the background color of web pages.
303
303
  Respond with a hex reference for the color requested by the user`,
304
- model: 'openai/gpt-6.1-sol',
304
+ model: 'openai/gpt-6.2-sol',
305
305
  })
306
306
  ```
307
307
 
@@ -278,6 +278,29 @@ export const mastra = new Mastra({
278
278
 
279
279
  Observational Memory starts observing only after a thread reaches its token threshold, 30,000 tokens by default. For a short demo, set a lower `observation.messageTokens` so the agent learns from a few messages. Observational Memory processes messages in the background, so right after `call_agent`, call `get_observations` with `waitForPending: true` to wait (up to 30 seconds) for it to finish before reading.
280
280
 
281
+ ## Agent skills
282
+
283
+ The server also serves the official Mastra [Agent Skills](https://agentskills.io) from the [mastra-ai/skills](https://github.com/mastra-ai/skills) repository:
284
+
285
+ - `skill://mastra/SKILL.md`: How to build with current Mastra APIs: agents, workflows, tools, memory, workspaces, and storage.
286
+ - `skill://mastra-factory/SKILL.md`: How to work with Mastra Factory.
287
+
288
+ Clients that support the [MCP Skills extension](https://modelcontextprotocol.io/extensions/skills/overview) list these skills and load them when a task needs them, so a connected coding agent works from current Mastra docs without installing anything. Other clients can read the files as resources.
289
+
290
+ Each Mastra release includes the skills as they were when it was built, so serving them needs no network access. Callers need only `mcp:read`. Serving them needs a version of `@mastra/mcp` with skills support. An older one serves everything else as before. To turn them off:
291
+
292
+ ```typescript
293
+ import { Mastra } from '@mastra/core'
294
+
295
+ export const mastra = new Mastra({
296
+ server: {
297
+ mcp: { skills: false },
298
+ },
299
+ })
300
+ ```
301
+
302
+ To serve your own skills, create an [`MCPServer`](https://mastra.ai/reference/tools/mcp-server) with the `skills` option.
303
+
281
304
  ## OAuth discovery
282
305
 
283
306
  When `server.auth` is configured, the endpoint tells MCP clients how to get a token, following the [MCP authorization spec](https://modelcontextprotocol.io/specification/draft/basic/authorization). A request without a valid token gets a `401` whose `WWW-Authenticate` header points at the endpoint's protected-resource metadata ([RFC 9728](https://datatracker.ietf.org/doc/html/rfc9728)):
@@ -15,7 +15,7 @@ Several built-in systems publish and subscribe to events through the same pub/su
15
15
  - **Workflow execution**: The scheduler publishes a `workflow.start` event, and a long-lived worker consumes it to run the workflow. Step and lifecycle events flow over pub/sub during execution.
16
16
  - **Scheduled workflows**: The scheduler dispatches due runs by publishing to the workflow topic. See [Scheduled workflows](https://mastra.ai/docs/workflows/scheduled-workflows).
17
17
  - **Background tasks**: A task manager dispatches work to a worker group and fans task lifecycle updates out to subscribers, which is how background task streams stay live. See [Background task streaming](https://mastra.ai/docs/harness/background-tasks).
18
- - **Agent signals**: Sending a signal to an active agent run publishes an event on a thread topic, so a run executing in another process receives the signal.
18
+ - **Agent signals**: Sending a signal to an active agent run publishes an event on a thread topic. The event reaches the process that holds the run. A step of an evented run that executes in a different process gets the signal only through [storage that shares pending signals across processes](#signals-sent-to-a-running-evented-agent).
19
19
  - **Resumable streams**: Stream chunks are published per run, so a client that reconnects can replay what it missed.
20
20
 
21
21
  Because these systems run on one bus, the backend you choose applies to all of them at once.
@@ -119,12 +119,32 @@ The backends that redeliver are marked **Yes** in the [Choosing a backend](#choo
119
119
  - `EventEmitterPubSub` delivers inside one process. An event never reaches another instance, and each instance that boots restarts the active evented workflow runs of the others.
120
120
  - `UnixSocketPubSub` reaches the other processes on the host, but no other process picks up the step of a process that stopped, and each process that boots restarts the active evented workflow runs of the others.
121
121
 
122
+ ### Signals sent to a running evented agent
123
+
124
+ Messages and other signals sent to an evented agent's active run wait until a model request of the run takes them. Where they wait depends on the storage of the agent's [memory](https://mastra.ai/docs/memory/overview):
125
+
126
+ - **Storage that keeps pending signals**: Each signal waits as a row of the memory messages table under the reserved thread ID `mastra-queue:pending:<threadId>`, and under `mastra-queue:taken:<threadId>` once a run takes it, with no resource ID. No read by thread or resource returns it. When the run saves its messages, the row becomes the message the signal would have been. A transient signal is deleted instead. `@mastra/pg`, `@mastra/libsql`, and `InMemoryStore` from `@mastra/core/storage` keep pending signals.
127
+ - **Storage that shares pending signals across processes**: Every process of the deployment reads and writes the same pending signals. A stored signal then reaches the run's next model request in whichever process executes it.
128
+
129
+ | Storage adapter | Keeps pending signals | Shares them across processes |
130
+ | ---------------- | --------------------- | ---------------------------------------------------------------------------- |
131
+ | `@mastra/pg` | Yes | Yes |
132
+ | `@mastra/libsql` | Yes | [Depends on the connection](https://mastra.ai/integrations/databases/libsql) |
133
+ | `InMemoryStore` | Yes | No |
134
+
135
+ A run keeps its signals in storage when the agent's memory uses storage that keeps pending signals and the run is the thread's active run, with a thread and a `resourceId`. A run started with `prepare()` and a run with `readOnly` memory aren't the thread's active run. Any other evented run keeps its signals in the memory of the process that started it, and they reach the run only when that process executes the run's next step. Otherwise the agent answers them in a new turn after the run ends. Input from `queueMessage()` and `queueSignal()` always stays in process memory.
136
+
137
+ A stored signal that the run never takes waits for the thread's next run. The process that started the run starts that next run with the signal when the run ends, if that process is still up. When another run already holds the thread and reads the same storage, that run takes the signal at its next model request, or, if it already made its last one, the signal starts the thread's next turn when that run ends. Otherwise the signal waits for the thread's next run that reads the same storage. A run that fails deletes the signals its failed turn took, whether it fails in the process that started it or on a worker, and the thread's next run receives only the ones it never took. A failure that carries no saved progress is the exception, such as a step that runs out of deliveries with `storageVersion: 2`: the run then puts back the signals it took and never saved, and the thread's next run receives them again. When a run's `modelSettings.timeout.totalMs` deadline fires in the process that started it while another process executes its steps, the starting process saves only the turn's input, and the signals the interrupted step took and never saved go back to pending, so the thread's next run receives them again, also when the run saved earlier progress. A suspended run stops receiving signals once another run uses its thread, and signals sent to it afterwards wait for the thread's next run or are answered `blocked`, as [`sendSignal()`](https://mastra.ai/reference/agents/agent) describes. A signal taken by a step that crashes before the run saves its progress is taken again by the thread's next run if the crashed run never recovers or ends.
138
+
122
139
  ### Warning for unsupported setups
123
140
 
124
141
  Mastra logs a warning the first time an evented run is created in a setup that can't support several processes:
125
142
 
126
143
  - The PubSub backend delivers to other processes and doesn't redeliver unacknowledged events.
127
144
  - The PubSub backend redelivers unacknowledged events and the storage adapter has no workflow step guards.
145
+ - The PubSub backend delivers to other processes and an evented agent's active run keeps its signals in one process.
146
+
147
+ Mastra logs the last case as a separate warning, the first time such a run starts, beginning with `Signals sent to running evented agents aren't supported on several processes with this setup`. It names the cause: the run has no memory, thread, or `resourceId`, the agent's memory storage doesn't keep pending signals, or that storage keeps them in one process.
128
148
 
129
149
  The default `EventEmitterPubSub` doesn't trigger the warning, because its events never leave the process. `UnixSocketPubSub` triggers it even when one process uses the socket, because Mastra can't tell how many processes share it.
130
150
 
@@ -180,7 +180,7 @@ export const supportAgent = new Agent({
180
180
  ? `You are helping ${user.name ?? user.id}. Be personable.`
181
181
  : 'You are a helpful assistant.',
182
182
  model: ({ user }) =>
183
- user?.role === 'admin' ? 'openai/gpt-6.1-sol' : '__GATEWAY_OPENAI_MODEL_MINI__',
183
+ user?.role === 'admin' ? 'openai/gpt-6.2-sol' : 'openai/gpt-6-luna',
184
184
  tools: ({ user }) => (user ? { accountTool } : {}),
185
185
  })
186
186
  ```
@@ -217,7 +217,7 @@ export const dynamicAgent = new Agent({
217
217
 
218
218
  return `${basePrompt} ${localeInstructions}`.trim()
219
219
  },
220
- model: 'openai/gpt-6.1-sol',
220
+ model: 'openai/gpt-6.2-sol',
221
221
  })
222
222
  ```
223
223
 
@@ -244,7 +244,7 @@ export const registryAgent = new Agent({
244
244
 
245
245
  return prompt.content
246
246
  },
247
- model: 'openai/gpt-6.1-sol',
247
+ model: 'openai/gpt-6.2-sol',
248
248
  })
249
249
  ```
250
250
 
@@ -429,7 +429,7 @@ export const validatedAgent = new Agent({
429
429
 
430
430
  return `You are helping user ${userId}`
431
431
  },
432
- model: 'openai/gpt-6.1-sol',
432
+ model: 'openai/gpt-6.2-sol',
433
433
  })
434
434
  ```
435
435
 
@@ -31,7 +31,7 @@ const ciAgent = new Agent({
31
31
  id: 'ci-agent',
32
32
  name: 'CI Agent',
33
33
  instructions: 'Triage CI failures and explain what broke.',
34
- model: 'openai/gpt-6.1-sol',
34
+ model: 'openai/gpt-6.2-sol',
35
35
  memory: new Memory({ storage }),
36
36
  })
37
37
 
@@ -137,7 +137,7 @@ export const ciAgent = new Agent({
137
137
  id: 'ci-agent',
138
138
  name: 'CI Agent',
139
139
  instructions: 'Triage CI failures and explain what broke.',
140
- model: 'openai/gpt-6.1-sol',
140
+ model: 'openai/gpt-6.2-sol',
141
141
  memory: new Memory({ storage }),
142
142
  notifications: {
143
143
  deliveryPolicy: {
@@ -31,7 +31,7 @@ const agent = new Agent({
31
31
  id: 'support-agent',
32
32
  name: 'Support Agent',
33
33
  instructions: 'Help the user compare options.',
34
- model: 'openai/gpt-6.1-sol',
34
+ model: 'openai/gpt-6.2-sol',
35
35
  memory: new Memory({
36
36
  storage: new LibSQLStore({
37
37
  id: 'signals-storage',
@@ -51,6 +51,8 @@ When a signal arrives, the runtime looks for the thread's current owner. If one
51
51
 
52
52
  If no owner is advertised, the receiving process tries to claim the thread. Winning means this process runs the agent. Losing means another process claimed it first, so this process forwards the signal and `accepted` resolves to `deliver` rather than `wake`. [`sendSignal()`](https://mastra.ai/reference/agents/agent) documents the accepted result.
53
53
 
54
+ When an evented agent's run keeps its signals in [storage that shares pending signals across processes](https://mastra.ai/docs/server/pubsub), a process that doesn't hold the run can write a signal to that storage itself. It does so only when the agent's `memory` is a `Memory` instance and the process was already following the thread's events when the run started. Otherwise, and always when `memory` is a function, it forwards the signal, and the process that holds the run stores it when the event arrives.
55
+
54
56
  Set `ifIdle.requireClaimedOwner: true` when an idle wake must not start a run on an arbitrary instance. The wake only reaches an advertised owner, and `accepted` rejects if none responds within the discovery window.
55
57
 
56
58
  ## Delivery guarantees and duplicates
@@ -64,6 +66,7 @@ This doesn't guarantee exactly-once delivery for every event. If your handlers w
64
66
  What survives a crash depends on where the data lives:
65
67
 
66
68
  - Runtime queues live in process memory. A crash before the run consumes them loses those signals.
69
+ - Evented agents on [storage that shares pending signals across processes](https://mastra.ai/docs/server/pubsub) keep the signals sent to an active run in their memory storage until the run takes them. Once stored, a signal doesn't depend on the process that accepted it. Until then it depends on one process: a forwarded signal on the process that holds the run, and a signal sent while a `stream()` call is starting its run on the sending process. Input from `queueMessage()` and `queueSignal()` lives in process memory.
67
70
  - Signals sent with `persist` behavior are written to memory storage and survive a restart when that storage is shared.
68
71
  - [State signals](https://mastra.ai/docs/signals/state-signals) and their tracking are stored on the thread and survive a restart with shared storage.
69
72
  - [Notifications](https://mastra.ai/docs/signals/notifications) are durable records in notification storage. Their dispatcher can retry delivery after a restart.
@@ -54,7 +54,7 @@ const result = agent.queueMessage('Also check whether the tests need updates.',
54
54
  await result.accepted
55
55
  ```
56
56
 
57
- Queued input waits for the active run to finish, then starts a new run. On an idle thread it starts immediately. [`cancelQueuedMessages()`](https://mastra.ai/reference/agents/agent) removes queued input without stopping the active run. Cancellation is best-effort across processes and doesn't revoke accepted input.
57
+ Queued input waits for the active run to finish, then starts a new run. On an idle thread it starts immediately. [`cancelQueuedMessages()`](https://mastra.ai/reference/agents/agent) removes input that no run has taken yet, without stopping the active run. Its awaited result lists the IDs this process cancelled, including ones it deleted from memory storage when it knows the thread's store: this process started the thread's current run and that run hasn't ended, or the agent's memory is a fixed instance and this process knows the thread's run keeps its signals in storage. Other processes cancel matching input when they get the request, and those IDs aren't in the result. Input a run already took stays delivered.
58
58
 
59
59
  [`queueSignal()`](https://mastra.ai/reference/agents/agent) queues typed context with the same behavior but keeps the signal's `type`, `tagName`, and attributes.
60
60
 
@@ -79,7 +79,7 @@ await result.accepted
79
79
 
80
80
  Mastra passes `contents` as written and XML-escapes attribute values. A closing tag matching the signal's own tag is escaped so content can't end it early; this isn't a prompt-injection defense, so treat forwarded third-party text as untrusted. Use XML-safe `tagName` and attribute names with letters, numbers, periods, hyphens, or the underscore character, starting with a letter or underscore.
81
81
 
82
- Like `sendMessage()`, `sendSignal()` delivers by default. Set `transient: true` to apply context only to the current request; Mastra doesn't store it, and transient signals can't be state signals. The [Agent reference](https://mastra.ai/reference/agents/agent) covers `attributes`, `metadata`, and `providerOptions`.
82
+ Like `sendMessage()`, `sendSignal()` delivers by default. Set `transient: true` to apply context only to the current request. Mastra never saves a transient signal as a message, so later turns don't find it in the history. When the run keeps its signals in memory storage, the signal waits there as a row of the messages table under the reserved thread ID `mastra-queue:pending:<threadId>`, and under `mastra-queue:taken:<threadId>` once a run takes it, with no resource ID, and no message read by thread or resource returns it. The row is deleted when the run that took it ends. One no run took waits for the thread's next turn. A run whose failure carries no saved progress, such as a step that runs out of deliveries with `storageVersion: 2`, gives back the signals it took, and the thread's next turn receives them again, so a transient signal can be seen twice. When the step that took a signal crashes before saving its state in a run that never recovers or ends, or when the storage call that settles the run's signals at its end fails, the thread's next run takes the signal again. Transient signals can't be state signals. The [Agent reference](https://mastra.ai/reference/agents/agent) covers `attributes`, `metadata`, and `providerOptions`.
83
83
 
84
84
  ## Input that outlives the conversation
85
85
 
@@ -117,7 +117,7 @@ if (action === 'persist') {
117
117
  }
118
118
  ```
119
119
 
120
- Only idle threads persist here. An active thread still delivers to the running run, so `persisted` is set only when the action is `persist`.
120
+ Only idle threads persist here. An active thread still delivers to the active run, so `persisted` is set only when the action is `persist`.
121
121
 
122
122
  Message and signal sends return an `accepted` promise. It resolves when Mastra decides what to do, not when a run finishes. `sendNotificationSignal()` includes `accepted` only when its delivery policy emits a signal, so check `decision` first. `sendStateSignal()` omits it when it skips an unchanged snapshot.
123
123
 
@@ -127,13 +127,13 @@ The `accepted` promise resolves with one of these actions:
127
127
  - `deliver`: the input was sent to a run, or another process accepted responsibility for starting one.
128
128
  - `persist`: the input is to be stored without delivery or a new run. Wait for `persisted` to confirm the write.
129
129
  - `discard`: the input was dropped.
130
- - `blocked`: the signal couldn't start or join a run. `reason` is `thread-blocked` when another run, such as a paused or suspended one, owns the thread, or `scope-mismatch` when the signal's `scopes` differ from those of the run active on the thread. Resume or wait for run `runId` to end, then send the signal again.
130
+ - `blocked`: the signal couldn't start or join a run, and Mastra doesn't keep it. `reason` is `thread-blocked` when another run, such as a paused or suspended one, owns the thread, or when run `runId` ended before a process that stores input directly could store it. `reason` is `scope-mismatch` when the signal's `scopes` differ from those of the run active on the thread. Resume or wait for run `runId` to end, then send the signal again. When the action is `wake`, the result carries the run's `output` stream. A run that fails after starting reports the error there. A routing failure rejects `accepted`. Use [`persisted`](https://mastra.ai/reference/agents/agent) to wait for a storage write.
131
131
 
132
- When the action is `wake`, the result carries the run's `output` stream. A run that fails after starting reports the error there. A routing failure rejects `accepted`. Use [`persisted`](https://mastra.ai/reference/agents/agent) to wait for a storage write.
132
+ An evented agent on [storage that keeps pending signals](https://mastra.ai/docs/server/pubsub) stores input sent to its active run. When the process that receives the input writes it to storage, `accepted` resolves after the write and rejects when the write fails. A process that forwards the input to the process that holds the run resolves `deliver` before the input is stored. [`sendSignal()`](https://mastra.ai/reference/agents/agent) lists the cases.
133
133
 
134
134
  ## When the agent sees your input
135
135
 
136
- When input arrives during a model request, Mastra can cancel that request and retry it with the new input. The interruption window stays open while the model produces only reasoning or metadata, or waits for its first token. It closes when the model produces text, a tool call, or other content. The replacement retries in the same run and step with the new input and keeps the discarded response out of history. It adds nothing to `maxSteps` and leaves `stepNumber` unchanged. There's no separate interruption limit, so repeated input can restart reasoning until the request completes, the run is cancelled, or its timeout expires.
136
+ When input arrives during a model request, Mastra can cancel that request and retry it with the new input. For an evented agent whose request runs in another process, this needs [storage that shares pending signals across processes](https://mastra.ai/docs/server/pubsub). The interruption window stays open while the model produces only reasoning or metadata, or waits for its first token. It closes when the model produces text, a tool call, or other content. The replacement retries in the same run and step with the new input and keeps the discarded response out of history. It adds nothing to `maxSteps` and leaves `stepNumber` unchanged. There's no separate interruption limit, so repeated input can restart reasoning until the request completes, the run is cancelled, or its timeout expires.
137
137
 
138
138
  The window closes once the request produces text, a tool call, or other content. Input then waits for the next loop boundary. Running tools aren't cancelled or repeated, and queued input never jumps ahead. If `maxSteps` is reached first, Mastra may save queued input without a response.
139
139
 
@@ -149,7 +149,7 @@ Aborting a run preserves queued input by default. Pass `clearPendingSignals: tru
149
149
  subscription.abort({ clearPendingSignals: true })
150
150
  ```
151
151
 
152
- Without a subscription, call [`agent.abortThreadStream()`](https://mastra.ai/reference/agents/agent) with the same option. Listeners stay subscribed and a later message can start a run. With shared PubSub, the clear request reaches the owning process but clears only its local queue. Neither abort nor cancellation revokes an acceptance that already resolved. Continuations are separate, so aborting the original doesn't cancel them.
152
+ Without a subscription, call [`agent.abortThreadStream()`](https://mastra.ai/reference/agents/agent) with the same option. Listeners stay subscribed and a later message can start a run. With shared PubSub, the clear request reaches the process that holds the run, which clears its local queue and the signals stored for the run that the run hasn't taken. [`cancelQueuedMessages()`](https://mastra.ai/reference/agents/agent) removes selected input without stopping the run and returns a promise of the cancelled IDs. Neither abort nor cancellation changes an `accepted` result that already resolved, but both can remove input answered with `deliver` that the run hasn't taken yet. Continuations are separate, so aborting the original doesn't cancel them.
153
153
 
154
154
  ## AgentController and session
155
155