@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
@@ -0,0 +1,49 @@
1
+ import type { CreatedAgentSignal } from './signals.js';
2
+ type ActiveRunSignalScope = 'pending' | 'pre-run';
3
+ /**
4
+ * Signals waiting for a thread's active run, keyed by thread key.
5
+ */
6
+ export declare function createActiveRunSignalQueues(): {
7
+ /** Appends to the thread's queue for `scope`. */
8
+ enqueue(scope: ActiveRunSignalScope, key: string, signal: CreatedAgentSignal): void;
9
+ /** Whether either of the thread's queues holds a signal with this id. */
10
+ includes(key: string, signalId: string): boolean;
11
+ /** Whether either of the thread's queues is non-empty. */
12
+ hasSignals(key: string): boolean;
13
+ /** Removes and returns the thread's whole queue for `scope`. */
14
+ take(scope: ActiveRunSignalScope, key: string): CreatedAgentSignal[];
15
+ /** The thread's queued signals, pre-run first, iterated without copying the queues. */
16
+ queued(key: string): Generator<CreatedAgentSignal>;
17
+ /** Passes each queued signal to `forward`, pre-run first, then drops the thread's queues. */
18
+ handOff(key: string, forward: (signal: CreatedAgentSignal, preRun: boolean) => void): void;
19
+ /** Puts pre-run signals a finished run never took in front of the thread's follow-ups. */
20
+ foldPreRunIntoPending(key: string): void;
21
+ /** Removes the oldest follow-up, dropping the queue once it is empty. */
22
+ takeNextPending(key: string): CreatedAgentSignal | undefined;
23
+ /** Puts a follow-up back at the front of the thread's queue. */
24
+ returnToFront(key: string, signal: CreatedAgentSignal): void;
25
+ /**
26
+ * Moves the remaining follow-ups in front of the thread's pre-run signals,
27
+ * for a follow-up run's first model request, and returns them.
28
+ */
29
+ batchPendingIntoPreRun(key: string): CreatedAgentSignal[];
30
+ /**
31
+ * Requeues after a follow-up run failed to start: `signal`, then whatever
32
+ * was batched into its pre-run queue, then the follow-ups queued since.
33
+ */
34
+ restoreAfterFailedStart(key: string, signal: CreatedAgentSignal | undefined): void;
35
+ /**
36
+ * Removes matching signals from both of the thread's queues and returns
37
+ * their ids, pre-run first. Each queue is replaced by a new array, or
38
+ * dropped when nothing is left.
39
+ */
40
+ cancel(key: string, matches: (signal: CreatedAgentSignal) => boolean): string[];
41
+ /** Removes one pre-run signal in place, dropping the queue once it is empty. */
42
+ discardPreRunSignal(key: string, signalId: string): void;
43
+ /** Drops the thread's pre-run queue. */
44
+ discardPreRunQueue(key: string): void;
45
+ clear(): void;
46
+ };
47
+ export type ActiveRunSignalQueues = ReturnType<typeof createActiveRunSignalQueues>;
48
+ export {};
49
+ //# sourceMappingURL=active-run-signal-queues.d.ts.map
@@ -1682,6 +1682,8 @@ TRequestContext extends Record<string, any> | unknown = any, TEditor extends Age
1682
1682
  * @internal Used by the server's run abort route.
1683
1683
  */
1684
1684
  __abortRunAcknowledged(runId: string): Promise<boolean>;
1685
+ /** @internal Close the stored signals of a parked run that an abort requested by another process releases here. */
1686
+ __closeParkedRunSignals(runId: string): Promise<void> | undefined;
1685
1687
  sendMessage<OUTPUT = TOutput>(message: AgentMessageInput, target: SendAgentMessageOptions<OUTPUT>): SendAgentMessageResult<OUTPUT>;
1686
1688
  queueMessage<OUTPUT = TOutput>(message: AgentMessageInput, target: QueueAgentMessageOptions<OUTPUT>): QueueAgentMessageResult<OUTPUT>;
1687
1689
  /**
@@ -1689,7 +1691,14 @@ TRequestContext extends Record<string, any> | unknown = any, TEditor extends Age
1689
1691
  * the thread immediately when it is idle. Shares the queue used by `queueMessage()`.
1690
1692
  */
1691
1693
  queueSignal<OUTPUT = TOutput>(signal: AgentSignal, target: QueueAgentSignalOptions<OUTPUT>): QueueAgentSignalResult<OUTPUT>;
1692
- cancelQueuedMessages(target: CancelQueuedAgentMessagesOptions): CancelQueuedAgentMessagesResult;
1694
+ /**
1695
+ * Cancels queued input of a thread: signals sent to its active run that no
1696
+ * model request took yet, and messages queued for its next run. Resolves
1697
+ * with every cancelled id once the cancellation settled, including signals
1698
+ * kept in memory storage. A signal a run already took into its transcript is
1699
+ * not cancelled.
1700
+ */
1701
+ cancelQueuedMessages(target: CancelQueuedAgentMessagesOptions): Promise<CancelQueuedAgentMessagesResult>;
1693
1702
  subscribeThreadEvents(scope: SubscribeAgentThreadEventsOptions, listener: AgentThreadEventListener): () => void;
1694
1703
  sendStateSignal<OUTPUT = TOutput>(state: AgentStateSignalInput, target: SendAgentStateSignalOptions<OUTPUT>): Promise<SendAgentStateSignalResult<OUTPUT>>;
1695
1704
  /**
@@ -2173,6 +2182,12 @@ TRequestContext extends Record<string, any> | unknown = any, TEditor extends Age
2173
2182
  * segment that lost its lease without being replaced still reports its error
2174
2183
  * but keeps the snapshots so the run stays recoverable.
2175
2184
  *
2185
+ * A total deadline also closes the stored signals of a run that keeps them in
2186
+ * storage, with the signals of the transcript it saves. When the run's steps
2187
+ * execute in another process, this process holds no transcript of them and
2188
+ * saves only the turn's input, so the signals those steps took and memory
2189
+ * did not save yet are pending again for the thread's next run.
2190
+ *
2176
2191
  * Never rejects: a pubsub that is already closing (for example during
2177
2192
  * shutdown) must not turn a run's own failure into an unhandledRejection.
2178
2193
  *
@@ -2181,6 +2196,7 @@ TRequestContext extends Record<string, any> | unknown = any, TEditor extends Age
2181
2196
  protected settleExecution(runId: string, fence: ExecutionFence | undefined, outcome: {
2182
2197
  status?: string;
2183
2198
  error?: Error;
2199
+ state?: unknown;
2184
2200
  }): Promise<void>;
2185
2201
  private redeliverDeadlineError;
2186
2202
  /**
@@ -14,7 +14,7 @@
14
14
  */
15
15
  import type { PubSub } from '../../events/index.js';
16
16
  import type { Mastra } from '../../mastra/index.js';
17
- export { publishAbortRequest, requestAcknowledgedAbort, subscribeToAbortRequests } from '../streams/abort-transport.js';
17
+ export { publishAbortRequest, publishSignalAvailable, requestAcknowledgedAbort, subscribeToAbortRequests, } from '../streams/abort-transport.js';
18
18
  /**
19
19
  * Make the current process responsive to abort requests for `runId`.
20
20
  *
@@ -345,6 +345,7 @@ export declare class DurableAgent<TAgentId extends string = string, TTools exten
345
345
  runId: string;
346
346
  agentId: string;
347
347
  agentName?: string | undefined;
348
+ signalsStored?: boolean | undefined;
348
349
  agentVersionId?: string | undefined;
349
350
  messageListState: any;
350
351
  toolsMetadata: any[];
@@ -20,6 +20,8 @@ export type ExecutionOutcome = {
20
20
  owner: 'agent';
21
21
  status?: string;
22
22
  error?: Error;
23
+ /** The run's workflow state when it ended. */
24
+ state?: unknown;
23
25
  } | {
24
26
  owner: 'workers';
25
27
  error?: Error;
@@ -95,6 +97,12 @@ export declare class DefaultAgentExecutionEngine {
95
97
  * another server from resuming the run.
96
98
  */
97
99
  cancelParkedRun(runId: string): Promise<boolean>;
100
+ /**
101
+ * Close the stored signals of a parked run that was aborted. Call it before
102
+ * the snapshot is deleted and before the abort terminal is published.
103
+ * Returns nothing to wait for when this engine's runs never store signals.
104
+ */
105
+ closeParkedRunSignals(_runId: string): Promise<void> | undefined;
98
106
  /**
99
107
  * Publish the abort terminal for a parked run this call just canceled. The bus is
100
108
  * shared, so observers on every server close now, whichever server later refuses
@@ -123,6 +131,7 @@ export declare class DefaultAgentExecutionEngine {
123
131
  runId: string;
124
132
  agentId: string;
125
133
  agentName?: string | undefined;
134
+ signalsStored?: boolean | undefined;
126
135
  agentVersionId?: string | undefined;
127
136
  messageListState: any;
128
137
  toolsMetadata: any[];
@@ -203,6 +212,7 @@ export declare class DefaultAgentExecutionEngine {
203
212
  runId: string;
204
213
  agentId: string;
205
214
  agentName?: string | undefined;
215
+ signalsStored?: boolean | undefined;
206
216
  agentVersionId?: string | undefined;
207
217
  messageListState: any;
208
218
  toolsMetadata: any[];
@@ -279,6 +289,7 @@ export declare class DefaultAgentExecutionEngine {
279
289
  runId: string;
280
290
  agentId: string;
281
291
  agentName?: string | undefined;
292
+ signalsStored?: boolean | undefined;
282
293
  agentVersionId?: string | undefined;
283
294
  messageListState: any;
284
295
  toolsMetadata: any[];
@@ -344,6 +355,7 @@ export declare class EventedAgentExecutionEngine extends DefaultAgentExecutionEn
344
355
  #private;
345
356
  get executionMode(): 'blocking' | 'background';
346
357
  get suspendPersistedOnReturn(): boolean;
358
+ closeParkedRunSignals(runId: string): Promise<void> | undefined;
347
359
  get executesStepsLocally(): boolean;
348
360
  prepareExecution(pubsub: PubSub | undefined, fence: ExecutionFence | undefined, workflowEngine: 'default' | 'evented', logger: IMastraLogger, guardrailLogger: IMastraLogger | undefined): {
349
361
  sharedExecution: boolean;
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_run_registry = require("../../run-registry-PiQTSx2Y.cjs");
2
+ const require_run_registry = require("../../run-registry-DOlZccsr.cjs");
3
3
  const require_observability = require("../../observability-B0R_D1PZ.cjs");
4
4
  // src/agent/durable/durable-agent.ts
5
5
  var DurableAgent = class extends require_run_registry.Agent {
@@ -1,4 +1,4 @@
1
- import { At as ensureRemoteAbortListener, B as detachFullStreamOnEnd, Ct as endFailedSegmentSpans, Dt as runDurableStreamUntilIdle, Et as segmentSpanData, F as Agent, Ft as untilIdleHandlesBackgroundTask, G as createDurableToolCallStep, H as createDurableGoalStep, I as normalizeResumeGenerateArgs, It as pruneAgentLoopSnapshot, J as serializeDurableState, K as createWorkflowInput, L as prepareForDurableExecution, Nt as getRunStreamSlot, Ot as runResumeDurableStreamUntilIdle, Pt as getScopeStreamSlot, Qt as validateModelTimeoutSettings, R as applyReservedMemoryContextKeys, Sc as AgentStreamEventTypes, St as carrySegmentSpans, Tt as segmentEndedBySuspension, U as createDurableIsTaskCompleteStep, V as createDurableAgenticWorkflow, W as createDurableLLMMappingStep, X as serializeToolsMetadata, Y as serializeModelConfig, Z as createDurableLLMExecutionStep, _c as DurableAgentDefaults, _t as resolveRuntimeDependencies, a as deleteRunRegistryEntry, ac as emitChunkEvent, at as accumulatedUsageSchema, bc as AGENT_STREAM_TOPIC, c as getRunRegistryEntry, cc as emitStepFinishEvent, ct as durableAgenticOutputSchema, d as setRunRegistryEntry, dc as AgentStreamBus, dt as executeDurableAgentScorers, et as createDurableBackgroundTaskCheckStep, f as takeRunScorerInstances, fc as publishAbortRequest, ft as runDurableFinishSideEffects, gc as DURABLE_STOP_WHEN_ERROR_ID, gt as resolveModel, hc as createRunAbortController, ht as resolveInternalState, ic as emitAbortEvent, it as createBaseIterationStateUpdate, jt as readRunDeadline, kt as RUN_DEADLINE_KEY, l as globalRunRegistry, lc as emitStepStartEvent, lt as modelConfigSchema, m as agentThreadStreamRuntime, mc as subscribeToAbortRequests, mt as rebuildRunToolsFromMastra, n as ExtendedRunRegistry, nc as __resetExecutionFencesForTests, nt as buildStepRecord, o as endRunSpansWithError, oc as emitErrorEvent, ot as baseDurableAgenticInputSchema, pc as requestAcknowledgedAbort, pt as loadRunStoredMessages, q as serializeDurableOptions, r as RunRegistry, rc as diffResponseMessages, rt as calculateAccumulatedUsage, sc as emitFinishEvent, st as baseIterationStateSchema, t as DURABLE_CONTEXT_SEGMENT_KEY, tt as resolveDurableToolCallConcurrency, uc as emitSuspendedEvent, ut as modelListEntrySchema, vc as DurableStepIds, vt as resolveTool, wt as liveSegmentSpan, xc as AgentControlEventTypes, xt as createDurableAgentStream, yc as AGENT_CONTROL_TOPIC, yt as toolRequiresApproval, z as persistDurableRunInput } from "../../run-registry-D22IF5SK.js";
1
+ import { At as ensureRemoteAbortListener, B as detachFullStreamOnEnd, Ct as endFailedSegmentSpans, Dt as runDurableStreamUntilIdle, Et as segmentSpanData, F as Agent, Ft as untilIdleHandlesBackgroundTask, G as createDurableToolCallStep, H as createDurableGoalStep, I as normalizeResumeGenerateArgs, It as pruneAgentLoopSnapshot, J as serializeDurableState, K as createWorkflowInput, L as prepareForDurableExecution, Nt as getRunStreamSlot, Ot as runResumeDurableStreamUntilIdle, Pt as getScopeStreamSlot, Qt as validateModelTimeoutSettings, R as applyReservedMemoryContextKeys, Sc as AgentStreamEventTypes, St as carrySegmentSpans, Tt as segmentEndedBySuspension, U as createDurableIsTaskCompleteStep, V as createDurableAgenticWorkflow, W as createDurableLLMMappingStep, X as serializeToolsMetadata, Y as serializeModelConfig, Z as createDurableLLMExecutionStep, _c as DurableAgentDefaults, _t as resolveModel, a as deleteRunRegistryEntry, ac as emitChunkEvent, at as accumulatedUsageSchema, bc as AGENT_STREAM_TOPIC, bt as toolRequiresApproval, c as getRunRegistryEntry, cc as emitStepFinishEvent, ct as durableAgenticOutputSchema, d as setRunRegistryEntry, dc as AgentStreamBus, dt as executeDurableAgentScorers, et as createDurableBackgroundTaskCheckStep, f as takeRunScorerInstances, fc as publishAbortRequest, ft as runDurableFinishSideEffects, gc as DURABLE_STOP_WHEN_ERROR_ID, gt as resolveInternalState, hc as createRunAbortController, ht as rebuildRunToolsFromMastra, ic as emitAbortEvent, it as createBaseIterationStateUpdate, jt as readRunDeadline, kt as RUN_DEADLINE_KEY, l as globalRunRegistry, lc as emitStepStartEvent, lt as modelConfigSchema, m as agentThreadStreamRuntime, mc as subscribeToAbortRequests, mt as createDurableAgentStream, n as ExtendedRunRegistry, nc as __resetExecutionFencesForTests, nt as buildStepRecord, o as endRunSpansWithError, oc as emitErrorEvent, ot as baseDurableAgenticInputSchema, pc as requestAcknowledgedAbort, pt as loadRunStoredMessages, q as serializeDurableOptions, r as RunRegistry, rc as diffResponseMessages, rt as calculateAccumulatedUsage, sc as emitFinishEvent, st as baseIterationStateSchema, t as DURABLE_CONTEXT_SEGMENT_KEY, tt as resolveDurableToolCallConcurrency, uc as emitSuspendedEvent, ut as modelListEntrySchema, vc as DurableStepIds, vt as resolveRuntimeDependencies, wt as liveSegmentSpan, xc as AgentControlEventTypes, yc as AGENT_CONTROL_TOPIC, yt as resolveTool, z as persistDurableRunInput } from "../../run-registry-sTm40Ecv.js";
2
2
  import { D as agentLoopTermination, O as executionFailureTermination } from "../../observability-D7RNOAPx.js";
3
3
  // src/agent/durable/durable-agent.ts
4
4
  var DurableAgent = class extends Agent {
@@ -11,6 +11,8 @@ import type { DurableAgenticWorkflowInput, RunRegistryEntry } from './types.js';
11
11
  export declare const SCOPES_ALREADY_APPLIED: unique symbol;
12
12
  /** Carries the persisted spans a resume rebuilt from storage reattaches to into `prepare()`. */
13
13
  export declare const RESUMED_SPAN_DATA: unique symbol;
14
+ /** Carries where a resume rebuilt from storage keeps its run's signals, as the run decided when it started. */
15
+ export declare const RESUMED_SIGNALS_STORED: unique symbol;
14
16
  /**
15
17
  * Result from the preparation phase
16
18
  */
@@ -91,6 +93,21 @@ export interface PreparationOptions<OUTPUT = undefined> {
91
93
  * Falls back to `agent.name` if not provided.
92
94
  */
93
95
  durableAgentName?: string;
96
+ /**
97
+ * Whether the run may keep signals sent to it in its memory storage: its
98
+ * agent runs on the evented engine and the run holds its thread. It does
99
+ * when the run also has memory, a thread and a resource, and that storage
100
+ * keeps pending signals; the run's input carries the outcome.
101
+ * @internal
102
+ */
103
+ signalsStored?: boolean;
104
+ /**
105
+ * For a run rebuilt from storage, the outcome it started with, carried
106
+ * through `RESUMED_SIGNALS_STORED`. The run keeps it and leaves its thread's
107
+ * signal run as it is.
108
+ * @internal
109
+ */
110
+ resumedSignalsStored?: boolean;
94
111
  }
95
112
  /**
96
113
  * Prepare for durable agent execution.
@@ -0,0 +1,100 @@
1
+ import type { IMastraLogger } from '../../logger/index.js';
2
+ import type { Mastra } from '../../mastra/index.js';
3
+ import type { RequestContext } from '../../request-context/index.js';
4
+ import type { MessageList } from '../message-list/index.js';
5
+ import type { CreatedAgentSignal } from '../signals.js';
6
+ import type { ThreadSignalsStore } from '../stored-signals.js';
7
+ import type { DurableAgenticWorkflowInput } from './types.js';
8
+ /**
9
+ * Workflow-state key of the ids of every signal a storage-backed run took into
10
+ * its transcript, saved in the same state write as that transcript. A claim
11
+ * skips them, and the run's close deletes the ones that never reached memory.
12
+ */
13
+ export declare const CONSUMED_SIGNAL_IDS_KEY = "consumedSignalIds";
14
+ /** The consumed set in workflow state. A run started before the set existed has consumed nothing. */
15
+ export declare function readConsumedSignalIds(state: unknown): string[];
16
+ /** Ids of the signals the run was started with. They reach the transcript as input, not through a drain. */
17
+ export declare function inputSignalIds(messageList: MessageList): string[];
18
+ type DurableRunInput = Partial<Pick<DurableAgenticWorkflowInput, 'agentId' | 'agentVersionId' | 'requestContextEntries' | 'signalsStored'>> & {
19
+ state?: {
20
+ threadId?: string;
21
+ resourceId?: string;
22
+ };
23
+ };
24
+ /**
25
+ * Where a durable run's pending signals are read and settled in this process,
26
+ * or `undefined` when the run keeps them in the thread runtime's queues. The
27
+ * run carries the decision in its input, made once when it was prepared. The
28
+ * store comes from the memory this process holds for the run or from the agent
29
+ * and the request context entries the run carries, and is kept on the run's
30
+ * registry entry once resolved. A resolution that fails or finds no store is
31
+ * tried again at the next site. A run whose memory resolves here to no store,
32
+ * or to a store without its thread, reads nothing here, and that is logged
33
+ * once.
34
+ */
35
+ export declare function durableRunSignalsStore({ mastra, runId, input, requestContext, }: {
36
+ mastra: Mastra | undefined;
37
+ runId: string;
38
+ input: DurableRunInput | undefined;
39
+ requestContext?: RequestContext;
40
+ }): Promise<ThreadSignalsStore | undefined> | undefined;
41
+ /**
42
+ * Close a storage-backed run that ended: the store deletes the taken rows it
43
+ * consumed and, while the run is still the thread's signal run, gives the
44
+ * other taken rows back to pending. Safe to repeat. Returns nothing to wait
45
+ * for when the run's signals are not stored, so other runs end without
46
+ * waiting on it.
47
+ *
48
+ * A failed close doesn't fail the run's ending: the thread keeps the run as
49
+ * its signal run until the thread's next run is prepared.
50
+ */
51
+ export declare function closeStoredSignalRun({ mastra, runId, input, requestContext, state, deadline, }: {
52
+ mastra: Mastra | undefined;
53
+ runId: string;
54
+ input: DurableRunInput | undefined;
55
+ requestContext?: RequestContext;
56
+ /** The run's latest saved workflow state, or a read of it. */
57
+ state: unknown | (() => unknown);
58
+ /** Set by the close of the run's total deadline. */
59
+ deadline?: boolean;
60
+ }): Promise<void> | undefined;
61
+ export type StoredSignalDrain = {
62
+ signals: CreatedAgentSignal[];
63
+ /** Workflow state to save together with the transcript that holds `signals`. */
64
+ state: {
65
+ [CONSUMED_SIGNAL_IDS_KEY]: string[];
66
+ };
67
+ };
68
+ /**
69
+ * One drain of a storage-backed run: claim the thread's pending rows and get
70
+ * back every taken row of the thread that the run's saved state doesn't list
71
+ * as consumed. A step that fails before saving its result gets the same rows
72
+ * again from its retry, except a row saved into the thread inside that step,
73
+ * and a step that saved its result never gets them again.
74
+ */
75
+ export declare function claimStoredSignals({ queue: { store, threadId }, runId, consumed, logger, }: {
76
+ queue: ThreadSignalsStore;
77
+ runId: string;
78
+ consumed: readonly string[];
79
+ logger?: IMastraLogger;
80
+ }): Promise<StoredSignalDrain>;
81
+ /**
82
+ * The drain of a storage-backed run at one site: `undefined` when the run's
83
+ * signals are not stored, `drain()` resolves `undefined` when the store could
84
+ * not be resolved or a read failed, so the saved consumed set stays as it is.
85
+ * A failed claim takes nothing, as the loop's other drain points do: the rows
86
+ * come back at the next drain. A claim that was written while its answer
87
+ * failed leaves the rows claimed by this run, so a cancel no longer finds
88
+ * them, and the run's next drain returns them because their ids are not in
89
+ * its consumed set. It does not check for an abort; callers check
90
+ * before calling it.
91
+ */
92
+ export declare function storedSignalDrain({ mastra, runId, input, requestContext, getState, }: {
93
+ mastra: Mastra | undefined;
94
+ runId: string;
95
+ input: DurableRunInput | undefined;
96
+ requestContext?: RequestContext;
97
+ getState: (keys: readonly string[]) => Promise<unknown>;
98
+ }): (() => Promise<StoredSignalDrain | undefined>) | undefined;
99
+ export {};
100
+ //# sourceMappingURL=stored-signal-drain.d.ts.map
@@ -33,6 +33,7 @@ import type { AIV5ResponseMessage, MessageList } from '../message-list/index.js'
33
33
  import type { SerializedMessageListState } from '../message-list/state/index.js';
34
34
  import type { SaveQueueManager } from '../save-queue/index.js';
35
35
  import type { PendingSignalListener, AgentSignalInput, CreatedAgentSignal } from '../signals.js';
36
+ import type { ThreadSignalsStore } from '../stored-signals.js';
36
37
  import type { AgentStreamsConfig } from '../streams/types.js';
37
38
  import type { TripwireData } from '../trip-wire.js';
38
39
  import type { AgentMethodType, GoalConfig, StructuredOutputOptions, ToolsInput } from '../types.js';
@@ -322,6 +323,14 @@ export interface DurableAgenticWorkflowInput {
322
323
  agentId: string;
323
324
  /** Agent name for logging/tracing */
324
325
  agentName?: string;
326
+ /**
327
+ * Whether signals sent to this run are kept in the messages table of its
328
+ * memory storage rather than in the starting process's memory. Decided once
329
+ * when the run is prepared, so every process that executes its steps reads
330
+ * the same place senders write to. Absent on runs that keep them in memory.
331
+ * @internal
332
+ */
333
+ signalsStored?: boolean;
325
334
  /**
326
335
  * Exact stored version id the run resolved to at start time. A run that
327
336
  * suspends while executing a stored version must resume on *that* version —
@@ -987,6 +996,28 @@ export interface RunRegistryEntry {
987
996
  subscribePendingSignals?: (listener: PendingSignalListener) => () => void;
988
997
  /** Releases the latest LLM step's pending-signal listener, whichever way that step exited. */
989
998
  stopStepSignalListener?: () => void;
999
+ /**
1000
+ * Interrupts the latest LLM step's model request the way its pending-signal
1001
+ * listener does. Set for runs that keep their signals in storage: a signal a
1002
+ * processor stores for such a run reaches no queue listener. Cleared when
1003
+ * that step ends.
1004
+ * @internal
1005
+ */
1006
+ interruptStepForSignals?: PendingSignalListener;
1007
+ /**
1008
+ * Hears `signal-available` hints for the latest LLM step of a run that keeps
1009
+ * its signals in storage, from whichever process stored them. Cleared when
1010
+ * that step ends.
1011
+ * @internal
1012
+ */
1013
+ onSignalAvailable?: (signalId: string) => void;
1014
+ /**
1015
+ * Where this process reads and settles the signals of a run that keeps them
1016
+ * in memory storage, once resolved: set by preparation, or by the first
1017
+ * resolution that succeeded. See `durableRunSignalsStore`.
1018
+ * @internal
1019
+ */
1020
+ pendingSignalsStore?: ThreadSignalsStore;
990
1021
  /**
991
1022
  * Thread title generation closure — mirrors the non-durable `#executeOnFinish`
992
1023
  * title-generation branch, which was never ported to the durable finish step
@@ -1056,6 +1087,12 @@ export interface RunRegistryEntry {
1056
1087
  timeoutTotalMs?: number;
1057
1088
  /** A late subscriber re-publishes the winning deadline error at most once per segment. */
1058
1089
  deadlineErrorRedelivered?: boolean;
1090
+ /**
1091
+ * Set once this process's total deadline is going to close the run's stored signals with the transcript it saves.
1092
+ * The run's other endings then leave the close to it.
1093
+ * @internal
1094
+ */
1095
+ deadlineClosesStoredSignals?: boolean;
1059
1096
  /**
1060
1097
  * This process's subscription to cross-process abort requests for the run.
1061
1098
  * Set by `ensureRemoteAbortListener`, which every durable step calls on
@@ -94,6 +94,17 @@ export declare class DurableProcessorRebuildError extends Error {
94
94
  export declare class DurableAgentNotFoundError extends Error {
95
95
  constructor(agentId: string, runId: string, cause?: unknown);
96
96
  }
97
+ /**
98
+ * The memory of a run on this process: the registry entry's when this process
99
+ * prepared or rebuilt the run, else the agent's, resolved with the request
100
+ * context entries the run carries, as {@link resolveRuntimeDependencies} does.
101
+ */
102
+ export declare function resolveRunMemory(options: {
103
+ mastra: Mastra;
104
+ runId: string;
105
+ input: Pick<DurableAgenticWorkflowInput, 'agentId' | 'agentVersionId' | 'requestContextEntries'>;
106
+ requestContext?: RequestContext;
107
+ }): Promise<MastraMemory | undefined>;
97
108
  /**
98
109
  * Resolve all runtime dependencies needed for durable step execution.
99
110
  *
@@ -119,6 +119,7 @@ export declare function createWorkflowInput(params: {
119
119
  runId: string;
120
120
  agentId: string;
121
121
  agentName?: string;
122
+ signalsStored?: boolean;
122
123
  agentVersionId?: string;
123
124
  messageList: MessageList;
124
125
  tools: Record<string, CoreTool>;
@@ -15,6 +15,7 @@ export declare function createDurableAgenticWorkflow(options?: DurableAgenticWor
15
15
  runId: string;
16
16
  agentId: string;
17
17
  agentName?: string | undefined;
18
+ signalsStored?: boolean | undefined;
18
19
  agentVersionId?: string | undefined;
19
20
  messageListState: any;
20
21
  toolsMetadata: any[];
@@ -128,6 +128,7 @@ export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
128
128
  agentId: string;
129
129
  agentVersionId?: string | undefined;
130
130
  agentName?: string | undefined;
131
+ signalsStored?: boolean | undefined;
131
132
  messageListState: any;
132
133
  initialUntaggedSystemMessages?: any[] | undefined;
133
134
  toolsMetadata: any[];
@@ -402,6 +403,7 @@ export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
402
403
  runId: string;
403
404
  agentId: string;
404
405
  agentName?: string | undefined;
406
+ signalsStored?: boolean | undefined;
405
407
  messageListState?: any;
406
408
  initialUntaggedSystemMessages?: any[] | undefined;
407
409
  toolsMetadata: any[];
@@ -462,6 +464,7 @@ export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
462
464
  runId: string;
463
465
  agentId: string;
464
466
  agentName?: string | undefined;
467
+ signalsStored?: boolean | undefined;
465
468
  messageListState?: any;
466
469
  initialUntaggedSystemMessages?: any[] | undefined;
467
470
  toolsMetadata: any[];
@@ -522,6 +525,7 @@ export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
522
525
  runId: string;
523
526
  agentId: string;
524
527
  agentName?: string | undefined;
528
+ signalsStored?: boolean | undefined;
525
529
  messageListState?: any;
526
530
  initialUntaggedSystemMessages?: any[] | undefined;
527
531
  toolsMetadata: any[];
@@ -596,6 +600,7 @@ export declare class DurableAgenticLoopBuilder extends BaseAgenticLoopBuilder {
596
600
  runId: string;
597
601
  agentId: string;
598
602
  agentName?: string | undefined;
603
+ signalsStored?: boolean | undefined;
599
604
  agentVersionId?: string | undefined;
600
605
  messageListState: any;
601
606
  toolsMetadata: any[];
@@ -82,6 +82,12 @@ export declare function deadlineMessageListState(entry: RunRegistryEntry, fallba
82
82
  messageListState: SerializedMessageListState;
83
83
  cutOffText?: string;
84
84
  };
85
+ /**
86
+ * The ids of the signals a transcript holds: a signal's message id is its signal id. A total deadline closes a run
87
+ * that stores its signals with the ids of the transcript it saves, so exactly the signals that reach memory are
88
+ * deleted and the run's other rows are left to the thread's next run.
89
+ */
90
+ export declare function transcriptSignalIds(messageListState: SerializedMessageListState): string[];
85
91
  /**
86
92
  * Give the output processors (and with them memory) their one pass when a total deadline ends a
87
93
  * durable run. The run never reaches its finish step, so this runs over what the deadline saves
@@ -39,8 +39,11 @@ export declare function readMessageListState(params: TranscriptParams, stepPaylo
39
39
  * Stores an updated transcript where this run keeps it. Returns the fields to
40
40
  * spread into the step output: nothing when it went to workflow state,
41
41
  * `{ messageListState }` when the run threads it through step payloads.
42
+ *
43
+ * `extraState` goes to workflow state in the same write, for values that must
44
+ * be saved together with the transcript they describe.
42
45
  */
43
- export declare function storeMessageListState(params: WritableTranscriptParams, messageListState: SerializedMessageListState): Promise<MessageListStateCarrier>;
46
+ export declare function storeMessageListState(params: WritableTranscriptParams, messageListState: SerializedMessageListState, extraState?: Record<string, unknown>): Promise<MessageListStateCarrier>;
44
47
  /**
45
48
  * The transcript for code that reads and rewrites it in place across several
46
49
  * phases (the continuation predicate): restored once up front, then `write`
@@ -48,7 +51,8 @@ export declare function storeMessageListState(params: WritableTranscriptParams,
48
51
  */
49
52
  export declare function openMessageListState(params: TranscriptParams, stepPayload: MessageListStateCarrier): Promise<{
50
53
  read(): SerializedMessageListState;
51
- write(next: SerializedMessageListState): void;
54
+ /** `extraState` lands in workflow state with the transcript, as in {@link storeMessageListState}. */
55
+ write(next: SerializedMessageListState, extraState?: Record<string, unknown>): void;
52
56
  }>;
53
57
  /** Test hook: replaces the waits between mid-run load retries. Returns a restore function. */
54
58
  export declare function __setMidRunLoadRetryDelaysForTests(delays: readonly number[]): () => void;
@@ -96,6 +96,7 @@ export declare const baseDurableAgenticInputSchema: z.ZodObject<{
96
96
  runId: z.ZodString;
97
97
  agentId: z.ZodString;
98
98
  agentName: z.ZodOptional<z.ZodString>;
99
+ signalsStored: z.ZodOptional<z.ZodBoolean>;
99
100
  messageListState: z.ZodAny;
100
101
  toolsMetadata: z.ZodArray<z.ZodAny>;
101
102
  modelConfig: z.ZodObject<{
@@ -123,6 +124,7 @@ export declare const baseIterationStateSchema: z.ZodObject<{
123
124
  runId: z.ZodString;
124
125
  agentId: z.ZodString;
125
126
  agentName: z.ZodOptional<z.ZodString>;
127
+ signalsStored: z.ZodOptional<z.ZodBoolean>;
126
128
  messageListState: z.ZodOptional<z.ZodAny>;
127
129
  initialUntaggedSystemMessages: z.ZodOptional<z.ZodArray<z.ZodAny>>;
128
130
  toolsMetadata: z.ZodArray<z.ZodAny>;
@@ -24,6 +24,7 @@ export declare function createDurableLLMExecutionStep(_options?: DurableLLMExecu
24
24
  agentId: string;
25
25
  agentVersionId?: string | undefined;
26
26
  agentName?: string | undefined;
27
+ signalsStored?: boolean | undefined;
27
28
  messageListState: any;
28
29
  initialUntaggedSystemMessages?: any[] | undefined;
29
30
  toolsMetadata: any[];
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_run_registry = require("../run-registry-PiQTSx2Y.cjs");
3
- const require_stream = require("../stream-BbPZavop.cjs");
2
+ const require_run_registry = require("../run-registry-DOlZccsr.cjs");
3
+ const require_stream = require("../stream-aGuW9AL8.cjs");
4
4
  const require_message_list = require("../message-list-C0F2sDNC.cjs");
5
5
  const require_signals = require("../signals-CWxAMEmE.cjs");
6
6
  const require_to_prompt = require("../to-prompt-CG-LyaBY.cjs");
@@ -1,5 +1,5 @@
1
- import { A as agentInstructions, F as Agent, Lt as DEFAULT_TOOL_DECLINE_REASON, M as MAX_FS_SUBAGENT_DEPTH, N as mergeAgentPersona, P as AGENT_RESUME_CLAIM_STALE_MS, Rl as hasResumableStreams, Rt as resolveDeclineReason, Us as getGoalActivityDurationMs, au as isAgentCompatible, j as assembleAgentFromFsEntry, k as agentConfig, zl as isDurableAgentLike } from "../run-registry-D22IF5SK.js";
2
- import { dn as resolveSuspendedToolRunId, fn as resolveThreadIdFromArgs, hn as tryStreamWithJsonFallback, l as TripWire, mn as tryGenerateWithJsonFallback, pn as supportedLanguageModelSpecifications, un as isSupportedLanguageModel } from "../stream-CoQTdzLm.js";
1
+ import { A as agentInstructions, F as Agent, Lt as DEFAULT_TOOL_DECLINE_REASON, M as MAX_FS_SUBAGENT_DEPTH, N as mergeAgentPersona, P as AGENT_RESUME_CLAIM_STALE_MS, Rl as hasResumableStreams, Rt as resolveDeclineReason, Us as getGoalActivityDurationMs, au as isAgentCompatible, j as assembleAgentFromFsEntry, k as agentConfig, zl as isDurableAgentLike } from "../run-registry-sTm40Ecv.js";
2
+ import { dn as resolveSuspendedToolRunId, fn as resolveThreadIdFromArgs, hn as tryStreamWithJsonFallback, l as TripWire, mn as tryGenerateWithJsonFallback, pn as supportedLanguageModelSpecifications, un as isSupportedLanguageModel } from "../stream-k-Q1NLUs.js";
3
3
  import { Q as TypeDetector, n as MessageList, t as convertMessages } from "../message-list-RgFlLrxG.js";
4
4
  import { a as isCreatedAgentSignal, c as isUserAuthoredMessage, d as signalSpanAttributes, f as signalToDataPartFormat, h as signalToXmlMarkup, i as getMessageAuthor, l as mastraDBMessageToSignal, m as signalToMessage, n as createSignal, o as isMastraSignalMessage, p as signalToMastraDBMessage, r as dataPartToSignal, s as isTransientSignalMessage, t as createMessageSignal, u as resolveDeliveryAttributes } from "../signals-CqR_iWkg.js";
5
5
  import { n as aiV5ModelMessageToV2PromptMessage } from "../to-prompt-CMlVGYxC.js";
@@ -68,9 +68,13 @@ export type AgentSignalInput = (AgentSignalInputBase & {
68
68
  /**
69
69
  * Whether this signal is transient. Defaults to `false`.
70
70
  *
71
- * A transient signal is delivered to the model for the current call (it appears in the prompt
72
- * for this turn), but it is not retained as part of the conversation: it is not written to
73
- * storage and never re-enters the prompt on later turns. Re-send it each turn from a processor
71
+ * A transient signal is delivered to the model for the current call, but it is never saved as a
72
+ * message of the conversation, so later turns don't find it in the history. When the run keeps
73
+ * its signals in memory storage, the signal waits there as a row that no read by thread or resource
74
+ * returns, and the row is deleted when the run that took it ends. One no run took waits for the
75
+ * thread's next turn. A run whose failure carries no saved progress, such as a step that runs out of
76
+ * deliveries with `storageVersion: 2`, gives back the signals it took, and the thread's next turn
77
+ * receives them again, so a transient signal can be seen twice. Re-send it each turn from a processor
74
78
  * to keep a single fresh copy near the latest message instead of an accumulating history.
75
79
  *
76
80
  * Transient takes precedence over `persist` delivery behaviors: combining them means the