@mastra/core 1.87.0 → 1.88.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (450) hide show
  1. package/dist/_types/@internal_ai-v6@0.0.100/dist/index.d.ts +97 -2049
  2. package/dist/_types/@internal_core@0.1.4/dist/knowledge-compat/index.d.ts +17 -1
  3. package/dist/agent/agent.d.ts +10 -2
  4. package/dist/agent/durable/create-evented-agent.d.ts +2 -1
  5. package/dist/agent/durable/execution-engine.d.ts +4 -2
  6. package/dist/agent/durable/index.cjs +3 -2
  7. package/dist/agent/durable/index.js +3 -2
  8. package/dist/agent/durable/segment-spans.d.ts +7 -0
  9. package/dist/agent/durable/stored-signal-drain.d.ts +1 -1
  10. package/dist/agent/durable/types.d.ts +6 -0
  11. package/dist/agent/index.cjs +2 -2
  12. package/dist/agent/index.js +2 -2
  13. package/dist/agent/request-context-snapshot.d.ts +5 -0
  14. package/dist/agent/thread-stream-runtime.d.ts +26 -4
  15. package/dist/agent-builder/ee/index.cjs +1 -1
  16. package/dist/agent-builder/ee/index.js +1 -1
  17. package/dist/agent-controller/index.cjs +1 -1
  18. package/dist/agent-controller/index.js +1 -1
  19. package/dist/agent-controller/model-catalog-cache.d.ts +9 -5
  20. package/dist/agent-controller/session.d.ts +17 -0
  21. package/dist/{agent-controller-DckvJ7bq.cjs → agent-controller-C-WK9bMA.cjs} +67 -57
  22. package/dist/{agent-controller-vUU_atR-.js → agent-controller-Wxbc6702.js} +67 -57
  23. package/dist/background-tasks/index.cjs +1 -1
  24. package/dist/background-tasks/index.js +1 -1
  25. package/dist/{background-tasks-HAzB0JtC.js → background-tasks-DSMkHpbu.js} +1 -1
  26. package/dist/{background-tasks-By_1e9Gf.cjs → background-tasks-DcKNctMR.cjs} +1 -1
  27. package/dist/browser/index.cjs +1 -1
  28. package/dist/browser/index.js +1 -1
  29. package/dist/{builder-Dx8GMhFn.cjs → builder-CybmqbZt.cjs} +2 -2
  30. package/dist/{builder-CmtDqFLe.js → builder-PXwZnGYe.js} +2 -2
  31. package/dist/capabilities/302ai.json +197 -197
  32. package/dist/capabilities/abliteratedllm.json +35 -35
  33. package/dist/capabilities/abliteration-ai.json +10 -10
  34. package/dist/capabilities/above.json +19 -19
  35. package/dist/capabilities/adaption.json +15 -15
  36. package/dist/capabilities/adzuki.json +19 -19
  37. package/dist/capabilities/agentrouter.json +6 -6
  38. package/dist/capabilities/agnes.json +4 -4
  39. package/dist/capabilities/ai-router.json +8 -8
  40. package/dist/capabilities/aiand.json +25 -17
  41. package/dist/capabilities/aigrow.json +14 -14
  42. package/dist/capabilities/aimlapi.json +153 -153
  43. package/dist/capabilities/aixy.json +20 -20
  44. package/dist/capabilities/aki-io.json +11 -11
  45. package/dist/capabilities/alibaba-cn.json +93 -93
  46. package/dist/capabilities/alibaba-coding-plan-cn.json +4 -4
  47. package/dist/capabilities/alibaba-coding-plan.json +4 -4
  48. package/dist/capabilities/alibaba-token-plan-cn.json +47 -47
  49. package/dist/capabilities/alibaba-token-plan.json +49 -49
  50. package/dist/capabilities/alibaba.json +72 -72
  51. package/dist/capabilities/ambient.json +9 -9
  52. package/dist/capabilities/amd-tokenlab.json +5 -5
  53. package/dist/capabilities/amd.json +11 -11
  54. package/dist/capabilities/anthropic.json +40 -40
  55. package/dist/capabilities/anyapi.json +48 -48
  56. package/dist/capabilities/apiko.json +5 -5
  57. package/dist/capabilities/arcee.json +10 -10
  58. package/dist/capabilities/augure.json +5 -5
  59. package/dist/capabilities/auriko.json +18 -18
  60. package/dist/capabilities/bailing.json +4 -4
  61. package/dist/capabilities/baseten.json +41 -32
  62. package/dist/capabilities/bee.json +4 -4
  63. package/dist/capabilities/bothub.json +10 -10
  64. package/dist/capabilities/boundless.json +33 -33
  65. package/dist/capabilities/bumo.json +48 -48
  66. package/dist/capabilities/byteplus.json +35 -35
  67. package/dist/capabilities/cerebras.json +4 -4
  68. package/dist/capabilities/cheapaimodel.json +3 -3
  69. package/dist/capabilities/cheapest-token.json +28 -28
  70. package/dist/capabilities/chutes.json +43 -41
  71. package/dist/capabilities/cline-pass.json +33 -33
  72. package/dist/capabilities/cloudcode.json +7 -7
  73. package/dist/capabilities/cloudferro-sherlock.json +4 -4
  74. package/dist/capabilities/cloudflare-workers-ai.json +18 -18
  75. package/dist/capabilities/commandcode.json +147 -147
  76. package/dist/capabilities/concentrate.json +288 -279
  77. package/dist/capabilities/cortecs.json +108 -108
  78. package/dist/capabilities/crossmodel.json +157 -157
  79. package/dist/capabilities/crusoe.json +16 -16
  80. package/dist/capabilities/daoxe.json +9 -9
  81. package/dist/capabilities/databricks.json +131 -123
  82. package/dist/capabilities/deepinfra.json +95 -95
  83. package/dist/capabilities/deepseek.json +2 -2
  84. package/dist/capabilities/digitalocean.json +114 -115
  85. package/dist/capabilities/dothoosh.json +32 -32
  86. package/dist/capabilities/doubleword.json +26 -26
  87. package/dist/capabilities/edenai.json +298 -280
  88. package/dist/capabilities/empiriolabs.json +164 -164
  89. package/dist/capabilities/engy.json +23 -17
  90. package/dist/capabilities/entrim.json +4 -4
  91. package/dist/capabilities/evroc.json +17 -17
  92. package/dist/capabilities/ezkielyna.json +8 -8
  93. package/dist/capabilities/fastrouter.json +94 -94
  94. package/dist/capabilities/fireworks-ai.json +106 -95
  95. package/dist/capabilities/freemodel.json +9 -9
  96. package/dist/capabilities/friendli.json +31 -10
  97. package/dist/capabilities/frogbot.json +100 -100
  98. package/dist/capabilities/gisoo.json +18 -18
  99. package/dist/capabilities/gmicloud.json +19 -19
  100. package/dist/capabilities/google.json +59 -59
  101. package/dist/capabilities/graphn.json +10 -10
  102. package/dist/capabilities/greenpt.json +31 -31
  103. package/dist/capabilities/groq.json +5 -5
  104. package/dist/capabilities/helicone.json +87 -87
  105. package/dist/capabilities/hostinger-router.json +5 -5
  106. package/dist/capabilities/hpc-ai.json +9 -9
  107. package/dist/capabilities/huawei-maas.json +11 -11
  108. package/dist/capabilities/hubris.json +31 -31
  109. package/dist/capabilities/huggingface.json +95 -85
  110. package/dist/capabilities/humain.json +2 -2
  111. package/dist/capabilities/hyper.json +23 -23
  112. package/dist/capabilities/impossibl.json +157 -157
  113. package/dist/capabilities/inception.json +2 -2
  114. package/dist/capabilities/inceptron.json +4 -4
  115. package/dist/capabilities/inco.json +2 -2
  116. package/dist/capabilities/infer.json +11 -11
  117. package/dist/capabilities/inferall.json +8 -8
  118. package/dist/capabilities/inference-coop.json +6 -6
  119. package/dist/capabilities/inferenceapis.json +25 -25
  120. package/dist/capabilities/inferris.json +4 -4
  121. package/dist/capabilities/infersia.json +12 -12
  122. package/dist/capabilities/inferx.json +2 -2
  123. package/dist/capabilities/io-net.json +5 -5
  124. package/dist/capabilities/isoquant.json +4 -4
  125. package/dist/capabilities/iteracompute.json +43 -43
  126. package/dist/capabilities/jalapeno.json +10 -10
  127. package/dist/capabilities/jiekou.json +34 -34
  128. package/dist/capabilities/jzstoken.json +43 -43
  129. package/dist/capabilities/keln.json +21 -21
  130. package/dist/capabilities/kenari.json +120 -135
  131. package/dist/capabilities/kilo.json +671 -630
  132. package/dist/capabilities/kimchi.json +16 -16
  133. package/dist/capabilities/kimi-code-plan-cn.json +7 -7
  134. package/dist/capabilities/kimi-code-plan-global.json +7 -7
  135. package/dist/capabilities/kitani.json +2 -2
  136. package/dist/capabilities/klavo.json +25 -25
  137. package/dist/capabilities/korouter.json +31 -31
  138. package/dist/capabilities/kunavo.json +9 -9
  139. package/dist/capabilities/liquid.json +10 -10
  140. package/dist/capabilities/lithosai.json +2 -2
  141. package/dist/capabilities/llmgateway-providers.json +944 -906
  142. package/dist/capabilities/llmgateway.json +359 -348
  143. package/dist/capabilities/llmtr.json +25 -25
  144. package/dist/capabilities/logits.json +2 -2
  145. package/dist/capabilities/longcat.json +2 -2
  146. package/dist/capabilities/lowrouter.json +64 -64
  147. package/dist/capabilities/lyceum.json +14 -14
  148. package/dist/capabilities/melious.json +10 -10
  149. package/dist/capabilities/merge-gateway.json +268 -260
  150. package/dist/capabilities/meta.json +10 -10
  151. package/dist/capabilities/minimax-cn-coding-plan.json +5 -5
  152. package/dist/capabilities/minimax-cn.json +5 -5
  153. package/dist/capabilities/minimax-coding-plan.json +5 -5
  154. package/dist/capabilities/minimax.json +5 -5
  155. package/dist/capabilities/mistral.json +23 -15
  156. package/dist/capabilities/mixlayer.json +5 -5
  157. package/dist/capabilities/modal.json +11 -11
  158. package/dist/capabilities/model-oracle-ai.json +22 -22
  159. package/dist/capabilities/modelis.json +21 -21
  160. package/dist/capabilities/modelscope.json +2 -2
  161. package/dist/capabilities/modular.json +15 -15
  162. package/dist/capabilities/moneo.json +7 -7
  163. package/dist/capabilities/moonshotai-cn.json +6 -6
  164. package/dist/capabilities/moonshotai.json +6 -6
  165. package/dist/capabilities/morph.json +19 -19
  166. package/dist/capabilities/munito-eu.json +4 -4
  167. package/dist/capabilities/munito.json +5 -5
  168. package/dist/capabilities/nan.json +21 -21
  169. package/dist/capabilities/nano-gpt.json +594 -598
  170. package/dist/capabilities/nearai.json +121 -121
  171. package/dist/capabilities/nebius.json +42 -34
  172. package/dist/capabilities/neon.json +125 -125
  173. package/dist/capabilities/neuralwatt.json +41 -41
  174. package/dist/capabilities/nokeep.json +4 -4
  175. package/dist/capabilities/novita-ai.json +136 -136
  176. package/dist/capabilities/nvidia.json +29 -29
  177. package/dist/capabilities/oathbreaker.json +4 -4
  178. package/dist/capabilities/obscurify.json +24 -24
  179. package/dist/capabilities/oci.json +7 -7
  180. package/dist/capabilities/ofox.json +251 -251
  181. package/dist/capabilities/ollama-cloud.json +57 -57
  182. package/dist/capabilities/openai.json +56 -59
  183. package/dist/capabilities/opencode-go.json +93 -84
  184. package/dist/capabilities/openreason.json +5 -5
  185. package/dist/capabilities/openrouter.json +534 -532
  186. package/dist/capabilities/opper.json +31 -31
  187. package/dist/capabilities/orcarouter.json +292 -276
  188. package/dist/capabilities/outerlabs.json +32 -32
  189. package/dist/capabilities/ovhcloud.json +23 -23
  190. package/dist/capabilities/perplexity-agent.json +64 -64
  191. package/dist/capabilities/phala.json +31 -31
  192. package/dist/capabilities/poe.json +139 -139
  193. package/dist/capabilities/poolside.json +2 -2
  194. package/dist/capabilities/powerspring.json +8 -8
  195. package/dist/capabilities/primalabs.json +8 -8
  196. package/dist/capabilities/prime.json +133 -125
  197. package/dist/capabilities/privatemode-ai.json +4 -4
  198. package/dist/capabilities/proxystacks.json +3 -3
  199. package/dist/capabilities/qiniu-ai.json +14 -14
  200. package/dist/capabilities/refuseless.json +6 -6
  201. package/dist/capabilities/regolo-ai.json +8 -8
  202. package/dist/capabilities/requesty.json +201 -201
  203. package/dist/capabilities/ruapi.json +24 -24
  204. package/dist/capabilities/runcrate.json +8 -8
  205. package/dist/capabilities/runinfra.json +13 -13
  206. package/dist/capabilities/sakana.json +2 -2
  207. package/dist/capabilities/sandbase.json +23 -23
  208. package/dist/capabilities/sarvam.json +11 -11
  209. package/dist/capabilities/scaleway.json +15 -15
  210. package/dist/capabilities/scnet-token-plan.json +13 -13
  211. package/dist/capabilities/scx-ai.json +23 -23
  212. package/dist/capabilities/sensenova.json +13 -13
  213. package/dist/capabilities/siliconflow-cn.json +46 -46
  214. package/dist/capabilities/siliconflow.json +57 -57
  215. package/dist/capabilities/snowflake-cortex.json +21 -21
  216. package/dist/capabilities/sokkan.json +6 -6
  217. package/dist/capabilities/sparrowcodes.json +19 -19
  218. package/dist/capabilities/standardcompute.json +69 -69
  219. package/dist/capabilities/steadyrouter.json +40 -40
  220. package/dist/capabilities/stepfun-ai-step-plan.json +6 -6
  221. package/dist/capabilities/stepfun-ai.json +6 -6
  222. package/dist/capabilities/stepfun-step-plan.json +6 -6
  223. package/dist/capabilities/stepfun.json +6 -6
  224. package/dist/capabilities/stepping-stone.json +21 -21
  225. package/dist/capabilities/superbot-gg.json +4 -4
  226. package/dist/capabilities/synthetic.json +10 -10
  227. package/dist/capabilities/synthorai.json +24 -24
  228. package/dist/capabilities/teamorouter.json +14 -14
  229. package/dist/capabilities/teapot-router.json +4 -4
  230. package/dist/capabilities/tencent-token-plan-intl.json +16 -16
  231. package/dist/capabilities/tencent-token-plan.json +35 -35
  232. package/dist/capabilities/tencent-tokenhub.json +44 -44
  233. package/dist/capabilities/tensorx.json +49 -49
  234. package/dist/capabilities/the-grid-ai.json +28 -28
  235. package/dist/capabilities/thinkingmachines.json +76 -76
  236. package/dist/capabilities/tinfoil.json +9 -9
  237. package/dist/capabilities/togetherai.json +55 -55
  238. package/dist/capabilities/tokengo.json +24 -24
  239. package/dist/capabilities/tokenharbor.json +214 -214
  240. package/dist/capabilities/tokenify.json +8 -8
  241. package/dist/capabilities/trustedrouter.json +6 -6
  242. package/dist/capabilities/trustedtokens.json +19 -19
  243. package/dist/capabilities/umans-ai-coding-plan.json +11 -11
  244. package/dist/capabilities/umans-ai.json +11 -11
  245. package/dist/capabilities/uncensuredai.json +5 -5
  246. package/dist/capabilities/unrestricted.json +6 -6
  247. package/dist/capabilities/uplinkswitch.json +18 -18
  248. package/dist/capabilities/upstage.json +2 -2
  249. package/dist/capabilities/vancine.json +12 -12
  250. package/dist/capabilities/vercel.json +562 -549
  251. package/dist/capabilities/verda.json +4 -4
  252. package/dist/capabilities/vivgrid.json +62 -62
  253. package/dist/capabilities/volcengine-coding-plan.json +24 -24
  254. package/dist/capabilities/volcengine.json +31 -31
  255. package/dist/capabilities/vultr.json +18 -18
  256. package/dist/capabilities/wafer.ai.json +18 -18
  257. package/dist/capabilities/wallaby.json +5 -5
  258. package/dist/capabilities/wally.json +9 -9
  259. package/dist/capabilities/wandb.json +20 -20
  260. package/dist/capabilities/watt.json +20 -20
  261. package/dist/capabilities/xai.json +6 -6
  262. package/dist/capabilities/xiaomi-token-plan-ams.json +2 -2
  263. package/dist/capabilities/xiaomi-token-plan-cn.json +2 -2
  264. package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -2
  265. package/dist/capabilities/xiaomi.json +3 -3
  266. package/dist/capabilities/xpersona.json +13 -13
  267. package/dist/capabilities/xxapi.json +27 -27
  268. package/dist/capabilities/zai-coding-plan.json +15 -15
  269. package/dist/capabilities/zai.json +29 -29
  270. package/dist/capabilities/zenifra.json +22 -22
  271. package/dist/capabilities/zenmux.json +185 -185
  272. package/dist/capabilities/zerogpu.json +14 -14
  273. package/dist/capabilities/zhipuai-coding-plan.json +3 -3
  274. package/dist/capabilities/zhipuai.json +27 -27
  275. package/dist/capabilities/zro.json +4 -4
  276. package/dist/channels/index.cjs +2 -2
  277. package/dist/channels/index.js +2 -2
  278. package/dist/{channels-DChC1kXm.js → channels-Cxy4jW11.js} +1 -1
  279. package/dist/{channels-BamLzaJG.cjs → channels-DNOI029U.cjs} +1 -1
  280. package/dist/coding-agent/index.cjs +1 -1
  281. package/dist/coding-agent/index.js +1 -1
  282. package/dist/{constants-Dro9fuhk.js → constants-C2Q-ZI5d.js} +6 -0
  283. package/dist/{constants-B2FVV_2e.cjs → constants-DPHwzvan.cjs} +6 -0
  284. package/dist/datasets/index.cjs +2 -2
  285. package/dist/datasets/index.js +2 -2
  286. package/dist/docs/SKILL.md +1 -1
  287. package/dist/docs/assets/SOURCE_MAP.json +1158 -1153
  288. package/dist/docs/references/docs-agents-human-in-the-loop.md +1 -1
  289. package/dist/docs/references/docs-agents-resumable-streams.md +3 -3
  290. package/dist/docs/references/docs-channels.md +50 -3
  291. package/dist/docs/references/docs-deployment-workers.md +10 -4
  292. package/dist/docs/references/docs-develop.md +2 -0
  293. package/dist/docs/references/docs-evals-experiments.md +2 -0
  294. package/dist/docs/references/docs-guides-build-an-eval-loop.md +5 -1
  295. package/dist/docs/references/docs-guides-overview.md +2 -1
  296. package/dist/docs/references/docs-harness-durable-agents.md +17 -15
  297. package/dist/docs/references/docs-knowledge-importers.md +11 -1
  298. package/dist/docs/references/docs-knowledge-scopes-and-access.md +26 -0
  299. package/dist/docs/references/docs-memory-message-history.md +24 -16
  300. package/dist/docs/references/docs-memory-overview.md +21 -17
  301. package/dist/docs/references/docs-sandbox-overview.md +12 -10
  302. package/dist/docs/references/docs-server-mcp.md +68 -0
  303. package/dist/docs/references/docs-server-pubsub.md +25 -16
  304. package/dist/docs/references/docs-signals-running-across-processes.md +9 -3
  305. package/dist/docs/references/docs-signals-sending-signals.md +1 -1
  306. package/dist/docs/references/docs-workflows-control-flow.md +20 -0
  307. package/dist/docs/references/docs-workflows-overview.md +3 -3
  308. package/dist/docs/references/integrations-observability-arthur.md +1 -1
  309. package/dist/docs/references/reference-agent-controller-agent-controller-class.md +1 -1
  310. package/dist/docs/references/reference-agent-controller-session.md +9 -0
  311. package/dist/docs/references/reference-agents-agent.md +3 -1
  312. package/dist/docs/references/reference-agents-durable-agent.md +3 -3
  313. package/dist/docs/references/reference-configuration.md +60 -0
  314. package/dist/docs/references/reference-knowledge-knowledge-class.md +1 -1
  315. package/dist/docs/references/reference-knowledge-knowledge-tools.md +1 -1
  316. package/dist/docs/references/reference-observability-tracing-bridges-datadog.md +12 -11
  317. package/dist/docs/references/reference-processors-processor-interface.md +1 -1
  318. package/dist/docs/references/reference-pubsub-base.md +1 -1
  319. package/dist/docs/references/reference-pubsub-caching-pubsub.md +1 -1
  320. package/dist/docs/references/reference-pubsub-google-cloud-pubsub.md +13 -7
  321. package/dist/docs/references/reference-pubsub-lease-provider.md +4 -0
  322. package/dist/docs/references/reference-pubsub-redis-streams.md +18 -9
  323. package/dist/docs/references/reference-pubsub-valkey-streams.md +25 -7
  324. package/dist/docs/references/reference-storage-overview.md +1 -1
  325. package/dist/docs/references/reference-voice-overview.md +0 -27
  326. package/dist/docs/references/reference-workflows-step.md +1 -1
  327. package/dist/docs/references/reference-workspace-workspace-class.md +3 -1
  328. package/dist/evals/index.cjs +2 -2
  329. package/dist/evals/index.js +2 -2
  330. package/dist/evals/scoreTraces/index.cjs +2 -2
  331. package/dist/evals/scoreTraces/index.js +2 -2
  332. package/dist/events/caching-pubsub.d.ts +3 -11
  333. package/dist/events/index.cjs +1 -1
  334. package/dist/events/index.js +1 -1
  335. package/dist/events/pubsub.d.ts +2 -1
  336. package/dist/{execution-fence-BBKnrhWR.cjs → execution-fence-C1nozqra.cjs} +1118 -309
  337. package/dist/{execution-fence--VdnD7p4.js → execution-fence-pJB0qqFJ.js} +1107 -310
  338. package/dist/harness/index.cjs +1 -1
  339. package/dist/harness/index.js +1 -1
  340. package/dist/index.cjs +1 -1
  341. package/dist/index.js +1 -1
  342. package/dist/knowledge/importers/local-host.d.ts +2 -1
  343. package/dist/knowledge/importers/sink.d.ts +6 -0
  344. package/dist/knowledge/importers/types.d.ts +5 -0
  345. package/dist/knowledge/index.cjs +105 -20
  346. package/dist/knowledge/index.js +105 -21
  347. package/dist/knowledge/links.d.ts +19 -6
  348. package/dist/llm/index.cjs +3 -3
  349. package/dist/llm/index.js +3 -3
  350. package/dist/llm/model/gateways/mastra.d.ts +19 -0
  351. package/dist/llm/model/gateways/refreshing-cache.d.ts +52 -0
  352. package/dist/llm/model/provider-types.generated.d.ts +7574 -7544
  353. package/dist/llm/reasoning/account-switch.d.ts +50 -0
  354. package/dist/llm/reasoning/index.cjs +65 -0
  355. package/dist/llm/reasoning/index.d.ts +1 -0
  356. package/dist/llm/reasoning/index.js +61 -1
  357. package/dist/{llm-DknPJDW6.cjs → llm-VhPqyULU.cjs} +2 -2
  358. package/dist/{llm-ccA_1Q-H.js → llm-_z1lIfCN.js} +2 -2
  359. package/dist/loop/index.cjs +2 -2
  360. package/dist/loop/index.js +2 -2
  361. package/dist/loop/suspended-run-auto-resume.d.ts +15 -0
  362. package/dist/loop/workflows/agentic-execution/background-task-check-step.d.ts +4 -0
  363. package/dist/loop/workflows/agentic-execution/goal-step.d.ts +4 -0
  364. package/dist/loop/workflows/agentic-execution/is-task-complete-step.d.ts +4 -0
  365. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +4 -0
  366. package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts +2 -0
  367. package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts +1 -1
  368. package/dist/loop/workflows/schema.d.ts +13 -0
  369. package/dist/{manager-D9F0i7O2.cjs → manager-BT70SgFz.cjs} +3 -3
  370. package/dist/{manager-DWX6-Cx4.js → manager-C3Kx39p_.js} +3 -3
  371. package/dist/mastra/index.cjs +1 -1
  372. package/dist/mastra/index.d.ts +35 -11
  373. package/dist/mastra/index.js +1 -1
  374. package/dist/{mastra-BzWL4xI8.cjs → mastra-CQGD2RoN.cjs} +108 -20
  375. package/dist/{mastra-oUDN81l8.js → mastra-fJ0iKYGP.js} +108 -20
  376. package/dist/memory/index.cjs +2 -2
  377. package/dist/memory/index.js +2 -2
  378. package/dist/{model-BnD7SPlA.cjs → model-D9NDbf-e.cjs} +1 -1
  379. package/dist/{model-BwxfS6T_.js → model-DmBDBf-q.js} +1 -1
  380. package/dist/{netlify-CS0VDbb9.cjs → netlify-DNaNhels.cjs} +1 -1
  381. package/dist/{netlify-DcY9gHCJ.js → netlify-_yV5Nwud.js} +1 -1
  382. package/dist/notifications/index.cjs +1 -1
  383. package/dist/notifications/index.js +1 -1
  384. package/dist/{output-helpers-k2-48ssH.js → output-helpers-D-qplq22.js} +13 -15
  385. package/dist/{output-helpers-By5FbLpp.cjs → output-helpers-D4O_oFne.cjs} +12 -14
  386. package/dist/processor-provider/index.cjs +1 -1
  387. package/dist/processor-provider/index.js +1 -1
  388. package/dist/processors/index.cjs +2 -2
  389. package/dist/processors/index.js +2 -2
  390. package/dist/{provider-registry-BvbEoScB.js → provider-registry-C4tv__fr.js} +22203 -21980
  391. package/dist/{provider-registry-OggbU6OE.cjs → provider-registry-_BUQuSKb.cjs} +21869 -21628
  392. package/dist/provider-registry.json +22243 -22188
  393. package/dist/{registry-generator-BFOQQHyt.js → registry-generator-CenhQnEi.js} +1 -1
  394. package/dist/{registry-generator-CDaf48a6.cjs → registry-generator-D7lsLJC-.cjs} +1 -1
  395. package/dist/{rehydrate-CFoKaNlm.js → rehydrate-CuWN_5No.js} +2 -2
  396. package/dist/{rehydrate-QeS0NjGw.cjs → rehydrate-SpC_gJCY.cjs} +2 -2
  397. package/dist/relevance/index.cjs +2 -2
  398. package/dist/relevance/index.js +2 -2
  399. package/dist/{scheduler-0ShtMM1I.js → scheduler-D1qdie5k.js} +4 -2
  400. package/dist/{scheduler-CMjK0LoQ.cjs → scheduler-DE5lcHJA.cjs} +4 -2
  401. package/dist/server/index.d.ts +1 -1
  402. package/dist/server/types.d.ts +57 -0
  403. package/dist/storage/constants.cjs +1 -1
  404. package/dist/storage/constants.js +1 -1
  405. package/dist/storage/domains/knowledge/base.d.ts +11 -0
  406. package/dist/storage/domains/knowledge/inmemory.d.ts +1 -0
  407. package/dist/storage/domains/knowledge/pages-inmemory.d.ts +4 -0
  408. package/dist/storage/domains/knowledge/pages.d.ts +1 -1
  409. package/dist/storage/domains/memory/base.d.ts +6 -1
  410. package/dist/storage/domains/observability/tracing.d.ts +12 -0
  411. package/dist/storage/index.cjs +4 -3
  412. package/dist/storage/index.js +4 -4
  413. package/dist/stream/index.cjs +2 -2
  414. package/dist/stream/index.js +2 -2
  415. package/dist/{stream-D2rv1Ut1.js → stream-BfSwqzPi.js} +1 -1
  416. package/dist/{stream-CNqAlDJF.cjs → stream-CW3d1Xg6.cjs} +1 -1
  417. package/dist/test-utils/llm-mock.cjs +1 -1
  418. package/dist/test-utils/llm-mock.js +1 -1
  419. package/dist/tool-loop-agent/index.cjs +1 -1
  420. package/dist/tool-loop-agent/index.js +1 -1
  421. package/dist/{tool-loop-agent-CFsOjueT.js → tool-loop-agent-B4_o4-Me.js} +3 -3
  422. package/dist/{tool-loop-agent-Dusqj7-j.cjs → tool-loop-agent-JN_oKyfY.cjs} +3 -3
  423. package/dist/{utils-CIuOHPoS.cjs → utils-Bq606mC8.cjs} +1 -1
  424. package/dist/{utils-DLnCt6E9.js → utils-CnpMuTyD.js} +1 -1
  425. package/dist/utils.cjs +1 -1
  426. package/dist/utils.js +1 -1
  427. package/dist/{validate-1zReLtWc.cjs → validate-CFv6HWXx.cjs} +1 -1
  428. package/dist/{validate-ShLcQTA5.js → validate-Db2C7Sj_.js} +1 -1
  429. package/dist/vector/index.cjs +1 -1
  430. package/dist/vector/index.js +1 -1
  431. package/dist/worker/index.cjs +1 -1
  432. package/dist/worker/index.d.ts +1 -1
  433. package/dist/worker/index.js +1 -1
  434. package/dist/worker/workers/orchestration-worker.d.ts +13 -0
  435. package/dist/{worker-BPNrwCFs.cjs → worker-CNIBQPQy.cjs} +117 -32
  436. package/dist/{worker-CQ8rTJwQ.cjs → worker-IZeSOZjg.cjs} +2 -2
  437. package/dist/{worker-CKcQcPl8.js → worker-UXFAgWOK.js} +2 -2
  438. package/dist/{worker-ngt-F1Iv.js → worker-X0fAJfcx.js} +117 -32
  439. package/dist/{workflow-B_e5wMmz.cjs → workflow-CMLLlVDc.cjs} +4 -4
  440. package/dist/{workflow-XDIVRsu4.js → workflow-DfXq2p2f.js} +4 -4
  441. package/dist/workflows/builder/index.cjs +1 -1
  442. package/dist/workflows/builder/index.js +1 -1
  443. package/dist/workflows/evented/index.cjs +1 -1
  444. package/dist/workflows/evented/index.js +1 -1
  445. package/dist/workflows/evented/setup-warning.d.ts +20 -0
  446. package/dist/workflows/index.cjs +5 -5
  447. package/dist/workflows/index.js +5 -5
  448. package/dist/workflows/scheduler/types.d.ts +3 -0
  449. package/package.json +8 -8
  450. package/src/llm/model/provider-types.generated.d.ts +7574 -7544
@@ -338,10 +338,26 @@ export interface KnowledgePagesCore {
338
338
  export declare function createKnowledgePagesCoreLoader(features: ReadonlySet<string>, loadStorageModule: () => Promise<unknown>): () => Promise<KnowledgePagesCore>;
339
339
  /** Most words one keyword search uses; every word adds a substring check per page in each store. */
340
340
  export declare const KNOWLEDGE_SEARCH_MAX_WORDS = 16;
341
+ /**
342
+ * Longest search word, in characters (code points). Every store scans page text for each word, so a
343
+ * longer word only makes that scan slower; no real word or identifier needs more.
344
+ */
345
+ export declare const KNOWLEDGE_SEARCH_MAX_WORD_LENGTH = 128;
346
+ /**
347
+ * A keyword search the store refuses, such as one with a word over
348
+ * {@link KNOWLEDGE_SEARCH_MAX_WORD_LENGTH} characters. Recognise it by `name`; adapters bundle their
349
+ * own copy.
350
+ * @experimental
351
+ */
352
+ export declare class KnowledgeInvalidSearchError extends Error {
353
+ constructor(message: string);
354
+ }
341
355
  /**
342
356
  * Keyword-search words: the query split on whitespace, lowercased, deduplicated, keeping the first
343
357
  * {@link KNOWLEDGE_SEARCH_MAX_WORDS}. A hit needs at least one of them (as a case-insensitive
344
- * substring); an empty list means the search returns nothing.
358
+ * substring); an empty list means the search returns nothing. Throws
359
+ * {@link KnowledgeInvalidSearchError} for any word over {@link KNOWLEDGE_SEARCH_MAX_WORD_LENGTH}
360
+ * characters rather than dropping or cutting it, which would match the wrong pages.
345
361
  */
346
362
  export declare function knowledgeSearchWords(query: string): string[];
347
363
  /**
@@ -1680,8 +1680,16 @@ TRequestContext extends Record<string, any> | unknown = any, TEditor extends Age
1680
1680
  * @internal Used by the server's run abort route.
1681
1681
  */
1682
1682
  __abortRunAcknowledged(runId: string): Promise<boolean>;
1683
- /** @internal Close the stored signals of a parked run that an abort requested by another process releases here. */
1684
- __closeParkedRunSignals(runId: string): Promise<void> | undefined;
1683
+ /**
1684
+ * @internal Close the stored signals of a parked run that an abort requested by another process releases here.
1685
+ * With `exclusiveOfResume`, the close holds the run's execution claim from its snapshot read through its commit, as
1686
+ * a resume segment does. A resume that starts meanwhile waits for it, instead of consuming a signal that the close,
1687
+ * working from the snapshot it read before, would then return to pending. Resolves `false` while another
1688
+ * execution holds the run.
1689
+ */
1690
+ __closeParkedRunSignals(runId: string, options?: {
1691
+ exclusiveOfResume?: boolean;
1692
+ }): Promise<boolean> | undefined;
1685
1693
  sendMessage<OUTPUT = TOutput>(message: AgentMessageInput, target: SendAgentMessageOptions<OUTPUT>): SendAgentMessageResult<OUTPUT>;
1686
1694
  queueMessage<OUTPUT = TOutput>(message: AgentMessageInput, target: QueueAgentMessageOptions<OUTPUT>): QueueAgentMessageResult<OUTPUT>;
1687
1695
  /**
@@ -92,7 +92,8 @@ export interface CreateEventedAgentOptions<TAgentId extends string = string, TTo
92
92
  *
93
93
  * In one process it runs on any pubsub, including the default one. Running its
94
94
  * steps on several processes needs a pubsub that redelivers unacknowledged
95
- * events and a workflows store with step guards.
95
+ * events, a workflows store with step guards, and a server cache (`cache` on
96
+ * `Mastra`) that every process shares.
96
97
  *
97
98
  * @see https://mastra.ai/docs/server/pubsub#evented-workflows-and-agents
98
99
  *
@@ -101,8 +101,10 @@ export declare class DefaultAgentExecutionEngine {
101
101
  * Close the stored signals of a parked run that was aborted. Call it before
102
102
  * the snapshot is deleted and before the abort terminal is published.
103
103
  * Returns nothing to wait for when this engine's runs never store signals.
104
+ * Resolves `false` when the run was left open: its committed state could not
105
+ * be determined yet, or the close did not commit.
104
106
  */
105
- closeParkedRunSignals(_runId: string): Promise<void> | undefined;
107
+ closeParkedRunSignals(_runId: string): Promise<boolean> | undefined;
106
108
  /**
107
109
  * Publish the abort terminal for a parked run this call just canceled. The bus is
108
110
  * shared, so observers on every server close now, whichever server later refuses
@@ -355,7 +357,7 @@ export declare class EventedAgentExecutionEngine extends DefaultAgentExecutionEn
355
357
  #private;
356
358
  get executionMode(): 'blocking' | 'background';
357
359
  get suspendPersistedOnReturn(): boolean;
358
- closeParkedRunSignals(runId: string): Promise<void> | undefined;
360
+ closeParkedRunSignals(runId: string): Promise<boolean> | undefined;
359
361
  get executesStepsLocally(): boolean;
360
362
  prepareExecution(pubsub: PubSub | undefined, fence: ExecutionFence | undefined, workflowEngine: 'default' | 'evented', logger: IMastraLogger, guardrailLogger: IMastraLogger | undefined): {
361
363
  sharedExecution: boolean;
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_execution_fence = require("../../execution-fence-BBKnrhWR.cjs");
2
+ const require_execution_fence = require("../../execution-fence-C1nozqra.cjs");
3
3
  const require_observability = require("../../observability-VaoaeadK.cjs");
4
4
  // src/agent/durable/durable-agent.ts
5
5
  var DurableAgent = class extends require_execution_fence.Agent {
@@ -606,7 +606,8 @@ function isEventedAgentClass(obj) {
606
606
  *
607
607
  * In one process it runs on any pubsub, including the default one. Running its
608
608
  * steps on several processes needs a pubsub that redelivers unacknowledged
609
- * events and a workflows store with step guards.
609
+ * events, a workflows store with step guards, and a server cache (`cache` on
610
+ * `Mastra`) that every process shares.
610
611
  *
611
612
  * @see https://mastra.ai/docs/server/pubsub#evented-workflows-and-agents
612
613
  *
@@ -1,4 +1,4 @@
1
- import { $ as modelConfigSchema, A as detachFullStreamOnEnd, B as serializeToolsMetadata, Bs as emitChunkEvent, Cc as AgentControlEventTypes, D as prepareForDurableExecution, E as normalizeResumeGenerateArgs, F as createDurableToolCallStep, G as resolveDurableToolCallConcurrency, Gs as emitSuspendedEvent, Hs as emitFinishEvent, I as createWorkflowInput, J as createBaseIterationStateUpdate, Js as resolveInternalState, K as buildStepRecord, Ks as diffResponseMessages, L as serializeDurableOptions, M as createDurableGoalStep, N as createDurableIsTaskCompleteStep, O as applyReservedMemoryContextKeys, P as createDurableLLMMappingStep, Pt as validateModelTimeoutSettings, Q as durableAgenticOutputSchema, Qs as toolRequiresApproval, R as serializeDurableState, Rs as createDurableAgentStream, Sc as AGENT_STREAM_TOPIC, T as Agent, Us as emitStepFinishEvent, V as createDurableLLMExecutionStep, Vs as emitErrorEvent, W as createDurableBackgroundTaskCheckStep, Ws as emitStepStartEvent, X as baseDurableAgenticInputSchema, Xs as resolveRuntimeDependencies, Y as accumulatedUsageSchema, Ys as resolveModel, Z as baseIterationStateSchema, Zs as resolveTool, _c as segmentSpanData, _t as untilIdleHandlesBackgroundTask, ac as endRunSpansWithError, at as runResumeDurableStreamUntilIdle, bc as DurableStepIds, cc as getRunRegistryEntry, ct as readRunDeadline, dc as setRunRegistryEntry, dt as requestAcknowledgedAbort, ec as DURABLE_CONTEXT_SEGMENT_KEY, et as modelListEntrySchema, fc as takeRunScorerInstances, ft as subscribeToAbortRequests, gc as segmentEndedBySuspension, gt as getScopeStreamSlot, hc as liveSegmentSpan, ht as getRunStreamSlot, i as agentThreadStreamRuntime, ic as deleteRunRegistryEntry, it as runDurableStreamUntilIdle, j as createDurableAgenticWorkflow, k as persistDurableRunInput, lc as globalRunRegistry, lt as AgentStreamBus, mc as endFailedSegmentSpans, nc as RunRegistry, nt as runDurableFinishSideEffects, ot as RUN_DEADLINE_KEY, pc as carrySegmentSpans, pt as createRunAbortController, q as calculateAccumulatedUsage, qs as rebuildRunToolsFromMastra, rt as loadRunStoredMessages, st as ensureRemoteAbortListener, t as __resetExecutionFencesForTests, tc as ExtendedRunRegistry, tt as executeDurableAgentScorers, ut as publishAbortRequest, vc as DURABLE_STOP_WHEN_ERROR_ID, vt as pruneAgentLoopSnapshot, wc as AgentStreamEventTypes, xc as AGENT_CONTROL_TOPIC, yc as DurableAgentDefaults, z as serializeModelConfig, zs as emitAbortEvent } from "../../execution-fence--VdnD7p4.js";
1
+ import { $ as modelConfigSchema, $s as resolveTool, A as detachFullStreamOnEnd, B as serializeToolsMetadata, Bs as createDurableAgentStream, Cc as AGENT_CONTROL_TOPIC, D as prepareForDurableExecution, E as normalizeResumeGenerateArgs, Ec as AgentStreamEventTypes, F as createDurableToolCallStep, G as resolveDurableToolCallConcurrency, Gs as emitStepFinishEvent, Hs as emitChunkEvent, I as createWorkflowInput, J as createBaseIterationStateUpdate, Js as diffResponseMessages, K as buildStepRecord, Ks as emitStepStartEvent, L as serializeDurableOptions, M as createDurableGoalStep, N as createDurableIsTaskCompleteStep, O as applyReservedMemoryContextKeys, P as createDurableLLMMappingStep, Pt as validateModelTimeoutSettings, Q as durableAgenticOutputSchema, Qs as resolveRuntimeDependencies, R as serializeDurableState, Sc as DurableStepIds, T as Agent, Tc as AgentControlEventTypes, Us as emitErrorEvent, V as createDurableLLMExecutionStep, Vs as emitAbortEvent, W as createDurableBackgroundTaskCheckStep, Ws as emitFinishEvent, X as baseDurableAgenticInputSchema, Xs as resolveInternalState, Y as accumulatedUsageSchema, Ys as rebuildRunToolsFromMastra, Z as baseIterationStateSchema, Zs as resolveModel, _c as liveSegmentSpan, _t as untilIdleHandlesBackgroundTask, at as runResumeDurableStreamUntilIdle, bc as DURABLE_STOP_WHEN_ERROR_ID, ct as readRunDeadline, dc as globalRunRegistry, dt as requestAcknowledgedAbort, ec as toolRequiresApproval, et as modelListEntrySchema, ft as subscribeToAbortRequests, gc as endFailedSegmentSpans, gt as getScopeStreamSlot, hc as carrySegmentSpans, ht as getRunStreamSlot, i as agentThreadStreamRuntime, ic as RunRegistry, it as runDurableStreamUntilIdle, j as createDurableAgenticWorkflow, k as persistDurableRunInput, lt as AgentStreamBus, mc as takeRunScorerInstances, nc as DURABLE_CONTEXT_SEGMENT_KEY, nt as runDurableFinishSideEffects, oc as deleteRunRegistryEntry, ot as RUN_DEADLINE_KEY, pc as setRunRegistryEntry, pt as createRunAbortController, q as calculateAccumulatedUsage, qs as emitSuspendedEvent, rc as ExtendedRunRegistry, rt as loadRunStoredMessages, sc as endRunSpansWithError, st as ensureRemoteAbortListener, t as __resetExecutionFencesForTests, tt as executeDurableAgentScorers, uc as getRunRegistryEntry, ut as publishAbortRequest, vc as segmentEndedBySuspension, vt as pruneAgentLoopSnapshot, wc as AGENT_STREAM_TOPIC, xc as DurableAgentDefaults, yc as segmentSpanData, z as serializeModelConfig } from "../../execution-fence-pJB0qqFJ.js";
2
2
  import { a as agentLoopTermination, o as executionFailureTermination } from "../../observability-DPDWibyH.js";
3
3
  // src/agent/durable/durable-agent.ts
4
4
  var DurableAgent = class extends Agent {
@@ -605,7 +605,8 @@ function isEventedAgentClass(obj) {
605
605
  *
606
606
  * In one process it runs on any pubsub, including the default one. Running its
607
607
  * steps on several processes needs a pubsub that redelivers unacknowledged
608
- * events and a workflows store with step guards.
608
+ * events, a workflows store with step guards, and a server cache (`cache` on
609
+ * `Mastra`) that every process shares.
609
610
  *
610
611
  * @see https://mastra.ai/docs/server/pubsub#evented-workflows-and-agents
611
612
  *
@@ -24,6 +24,13 @@ type CarrierTarget = Pick<RequestContext, 'getRaw' | 'setRaw'> | Record<string,
24
24
  * caller's context cannot overwrite the parent's segment.
25
25
  */
26
26
  export declare function carrySegmentSpans(target: CarrierTarget, runId: string, segment: SegmentSpanData | null): void;
27
+ /**
28
+ * Record the `autoResumeSuspendedTools` a resumed execution of `runId` runs with on the request context it hands the
29
+ * engine, which carries it to every step of the segment wherever it runs. (#30190)
30
+ */
31
+ export declare function carrySegmentAutoResume(requestContext: RequestContext, runId: string, value: boolean): void;
32
+ /** The `autoResumeSuspendedTools` a resume carried for the current execution of `runId`, if any. */
33
+ export declare function segmentAutoResume(requestContext: Pick<RequestContext, 'getRaw'> | undefined, runId: string): boolean | undefined;
27
34
  /**
28
35
  * The pair the current execution reports under: the one a resume or recovery carried for `runId`,
29
36
  * else the run's first pair from `state` (the workflow input or the loop state). A carried `null`
@@ -57,7 +57,7 @@ export declare function closeStoredSignalRun({ mastra, runId, input, requestCont
57
57
  state: unknown | (() => unknown);
58
58
  /** Set by the close of the run's total deadline. */
59
59
  deadline?: boolean;
60
- }): Promise<void> | undefined;
60
+ }): Promise<boolean> | undefined;
61
61
  export type StoredSignalDrain = {
62
62
  signals: CreatedAgentSignal[];
63
63
  /** Workflow state to save together with the transcript that holds `signals`. */
@@ -782,6 +782,12 @@ export interface RunRegistryEntry {
782
782
  * registered on the Mastra instance instead of trusting the entry.
783
783
  */
784
784
  isPlaceholder?: boolean;
785
+ /**
786
+ * The `autoResumeSuspendedTools` the run's current segment executes with, set when a resume runs it. Absent until
787
+ * then: the run executes with the value in its workflow input. Each suspension persists it, so a resume in another
788
+ * process that leaves the option out keeps the latest one. (#30190)
789
+ */
790
+ autoResumeSuspendedTools?: boolean;
785
791
  /**
786
792
  * Resolved tools with execute functions.
787
793
  *
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_stream = require("../stream-CNqAlDJF.cjs");
3
- const require_execution_fence = require("../execution-fence-BBKnrhWR.cjs");
2
+ const require_stream = require("../stream-CW3d1Xg6.cjs");
3
+ const require_execution_fence = require("../execution-fence-C1nozqra.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 { dn as resolveSuspendedToolRunId, fn as resolveThreadIdFromArgs, hn as tryStreamWithJsonFallback, l as TripWire, mn as tryGenerateWithJsonFallback, pn as supportedLanguageModelSpecifications, un as isSupportedLanguageModel } from "../stream-D2rv1Ut1.js";
2
- import { C as mergeAgentPersona, Hl as isDurableAgentLike, S as MAX_FS_SUBAGENT_DEPTH, T as Agent, Ts as getGoalActivityDurationMs, Vl as hasResumableStreams, b as agentInstructions, bt as resolveDeclineReason, cu as isAgentCompatible, w as AGENT_RESUME_CLAIM_STALE_MS, x as assembleAgentFromFsEntry, y as agentConfig, yt as DEFAULT_TOOL_DECLINE_REASON } from "../execution-fence--VdnD7p4.js";
1
+ import { dn as resolveSuspendedToolRunId, fn as resolveThreadIdFromArgs, hn as tryStreamWithJsonFallback, l as TripWire, mn as tryGenerateWithJsonFallback, pn as supportedLanguageModelSpecifications, un as isSupportedLanguageModel } from "../stream-BfSwqzPi.js";
2
+ import { C as mergeAgentPersona, Ds as getGoalActivityDurationMs, S as MAX_FS_SUBAGENT_DEPTH, T as Agent, Ul as hasResumableStreams, Wl as isDurableAgentLike, b as agentInstructions, bt as resolveDeclineReason, uu as isAgentCompatible, w as AGENT_RESUME_CLAIM_STALE_MS, x as assembleAgentFromFsEntry, y as agentConfig, yt as DEFAULT_TOOL_DECLINE_REASON } from "../execution-fence-pJB0qqFJ.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";
@@ -10,6 +10,11 @@ export declare const MASTRA_DURABLE_EXECUTIONS_KEY = "mastra__durableExecutions"
10
10
  * resumed or recovered execution reports under (see `durable/segment-spans.ts`).
11
11
  */
12
12
  export declare const MASTRA_DURABLE_SEGMENTS_KEY = "mastra__durableSegments";
13
+ /**
14
+ * Reserved request-context key carrying `Record<runId, boolean>`: the `autoResumeSuspendedTools` a resumed execution
15
+ * runs with, so a step that suspends persists it on whichever worker runs the step. (#30190)
16
+ */
17
+ export declare const MASTRA_DURABLE_AUTO_RESUME_KEY = "mastra__durableAutoResume";
13
18
  /**
14
19
  * JSON-safe snapshot of `requestContext.entries()`, for a run that continues
15
20
  * somewhere the live context can't follow: a durable step, or a claimed
@@ -63,8 +63,20 @@ type AgentThreadRunRecord<OUTPUT = unknown> = {
63
63
  segmentAbortController?: AbortController;
64
64
  /** This process read the record's own `run-registered` back from the thread topic. */
65
65
  registrationSeen?: boolean;
66
- /** Another process registered the run after this record did, so it executes the run now. */
67
- registeredElsewhere?: boolean;
66
+ /** Another process registered the run after this record did, so it executes the run now: that registration's stream. */
67
+ registeredElsewhere?: string;
68
+ /** Resumes of this parked run that are still setting up; queued input is theirs, see {@link AgentThreadStreamRuntime.holdParkedRunForResume}. */
69
+ resumeHolds?: number;
70
+ /**
71
+ * A resume this record doesn't follow ran the run and left it parked again, so the record's suspension and options
72
+ * may be stale: queued input never releases it. A resume that registers replaces the record. (#30190)
73
+ */
74
+ resumedUntracked?: boolean;
75
+ /**
76
+ * Another process holds queued work behind this run (`queued-input-waiting`). Kept until the run is released, so a
77
+ * notice that arrives while a resume holds the run still counts once the hold ends. (#30190, #32093)
78
+ */
79
+ queuedInputElsewhere?: boolean;
68
80
  /**
69
81
  * This record's retake gave up while its handoff was still in flight, so that handoff may yet install the run id
70
82
  * on a lease nothing here renews. Ending must leave such a lease to expire rather than release a successor's.
@@ -257,7 +269,7 @@ export declare class AgentThreadStreamRuntime {
257
269
  abortRun(runId: string, pubsub?: PubSub, options?: {
258
270
  fenceResume?: boolean;
259
271
  /** Closes the stored signals of a parked run this call releases; only called for a storage-backed run. */
260
- closeStoredRun?: (runId: string) => Promise<void> | undefined;
272
+ closeStoredRun?: (runId: string) => Promise<unknown> | undefined;
261
273
  }): boolean;
262
274
  /**
263
275
  * A run parked on a tool suspension: its active segment ended (so it was
@@ -266,6 +278,16 @@ export declare class AgentThreadStreamRuntime {
266
278
  */
267
279
  /** Whether `runId` is parked on a tool suspension in this process. */
268
280
  isRunParked(runId: string, pubsub?: PubSub): boolean;
281
+ /**
282
+ * Holds a parked run for a resume that is setting up, so input queued meanwhile stays the resumed run's next model
283
+ * input, as it was before parked runs were released for queued input, instead of starting a turn beside the resumed
284
+ * tool. The returned function ends the hold; if the run is still parked then, for example because the resume
285
+ * failed, queued input starts the next turn, unless `startQueuedTurn` is false: a caller whose resume this record
286
+ * doesn't follow, and that left the run parked again, marks the record so queued input keeps waiting. (#30190)
287
+ */
288
+ holdParkedRunForResume(runId: string, pubsub?: PubSub): (options?: {
289
+ startQueuedTurn?: boolean;
290
+ }) => void;
269
291
  getActiveThreadRunId(options: AgentThreadIdentityOptions, pubsub?: PubSub): string | undefined;
270
292
  /** Same predicate as {@link getActiveThreadRunId}, over every tracked thread. */
271
293
  listActiveThreadRuns(pubsub?: PubSub): ActiveThreadRun[];
@@ -302,7 +324,7 @@ export declare class AgentThreadStreamRuntime {
302
324
  * waits for the current stream to suspend or finish.
303
325
  */
304
326
  queueStreamResume<OUTPUT>(runId: string, resume: () => Promise<MastraModelOutput<OUTPUT>>, pubsub?: PubSub): Promise<MastraModelOutput<OUTPUT>>;
305
- abortThread(options: AgentAbortThreadOptions, pubsub?: PubSub, closeStoredRun?: (runId: string) => Promise<void> | undefined): boolean;
327
+ abortThread(options: AgentAbortThreadOptions, pubsub?: PubSub, closeStoredRun?: (runId: string) => Promise<unknown> | undefined): boolean;
306
328
  /** @internal */
307
329
  resetForTests(): void;
308
330
  /**
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_provider_registry = require("../../provider-registry-OggbU6OE.cjs");
2
+ const require_provider_registry = require("../../provider-registry-_BUQuSKb.cjs");
3
3
  // src/agent-builder/ee/types.ts
4
4
  /**
5
5
  * Default-on values for {@link AgentFeatures}. `browser` is defaulted
@@ -1,4 +1,4 @@
1
- import { a as getRegisteredProviders, o as isProviderRegistered, u as parseModelString } from "../../provider-registry-BvbEoScB.js";
1
+ import { a as getRegisteredProviders, o as isProviderRegistered, u as parseModelString } from "../../provider-registry-C4tv__fr.js";
2
2
  // src/agent-builder/ee/types.ts
3
3
  /**
4
4
  * Default-on values for {@link AgentFeatures}. `browser` is defaulted
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_state_processor = require("../state-processor-DaSmhVUX.cjs");
3
3
  const require_tools = require("../tools-DZoVfKPl.cjs");
4
- const require_agent_controller = require("../agent-controller-DckvJ7bq.cjs");
4
+ const require_agent_controller = require("../agent-controller-C-WK9bMA.cjs");
5
5
  exports.AgentController = require_agent_controller.AgentController;
6
6
  exports.MODEL_PERSISTENCE_VERSION = require_agent_controller.MODEL_PERSISTENCE_VERSION;
7
7
  exports.MODEL_PERSISTENCE_VERSION_KEY = require_agent_controller.MODEL_PERSISTENCE_VERSION_KEY;
@@ -1,4 +1,4 @@
1
1
  import { f as taskCheckTool, h as taskWriteTool, m as taskUpdateTool, o as assignTaskIds, p as taskCompleteTool } from "../state-processor-B_KsS82m.js";
2
2
  import { o as askUserTool, t as submitPlanTool } from "../tools-FwJyNoyg.js";
3
- import { a as Session, c as defaultDisplayState, d as SessionStartupCancelledError, f as isSessionNotStartedError, i as MODEL_PERSISTENCE_VERSION_KEY, l as defaultOMProgressState, n as parseSubagentMeta, o as getSuspensionAddressKey, p as isSessionStartupCancelledError, r as MODEL_PERSISTENCE_VERSION, s as migratePersistedModelSelection, t as AgentController, u as SessionNotStartedError } from "../agent-controller-vUU_atR-.js";
3
+ import { a as Session, c as defaultDisplayState, d as SessionStartupCancelledError, f as isSessionNotStartedError, i as MODEL_PERSISTENCE_VERSION_KEY, l as defaultOMProgressState, n as parseSubagentMeta, o as getSuspensionAddressKey, p as isSessionStartupCancelledError, r as MODEL_PERSISTENCE_VERSION, s as migratePersistedModelSelection, t as AgentController, u as SessionNotStartedError } from "../agent-controller-Wxbc6702.js";
4
4
  export { AgentController, MODEL_PERSISTENCE_VERSION, MODEL_PERSISTENCE_VERSION_KEY, Session, SessionNotStartedError, SessionStartupCancelledError, askUserTool, assignTaskIds, defaultDisplayState, defaultOMProgressState, getSuspensionAddressKey, isSessionNotStartedError, isSessionStartupCancelledError, migratePersistedModelSelection, parseSubagentMeta, submitPlanTool, taskCheckTool, taskCompleteTool, taskUpdateTool, taskWriteTool };
@@ -2,11 +2,15 @@ import type { GatewayManager, GatewayModel, MastraModelGatewayInterface } from '
2
2
  /**
3
3
  * Model catalog cache with two refresh speeds.
4
4
  *
5
- * Remote gateways download public catalogs (models.dev's is ~6 MB). Once a
6
- * downloaded catalog is older than {@link REMOTE_CATALOG_REFRESH_MS}, the next
7
- * call refreshes it in the background and keeps serving the last good result,
8
- * including when the refresh fails. A call waits for a remote gateway only
9
- * while it has nothing to serve: before its first successful download.
5
+ * Remote gateways download public catalogs (models.dev's is ~6 MB). Each is
6
+ * kept in a {@link RefreshingCache}: once older than {@link CATALOG_REFRESH_MS},
7
+ * the next call refreshes it in the background and keeps serving the last good
8
+ * result, including when the refresh fails. A call waits for a remote gateway
9
+ * only while it has nothing to serve: before its first successful download.
10
+ *
11
+ * The Mastra Gateway caches its own list on the same schedule, so it is read
12
+ * on every build instead of being cached twice; its download settling counts
13
+ * as a change, like a remote gateway's.
10
14
  *
11
15
  * Everything else (configured gateways and per-provider auth) is rebuilt at
12
16
  * most every {@link MODEL_CATALOG_TTL_MS}, or on the next call after
@@ -197,6 +197,14 @@ export interface ThreadDataStore {
197
197
  threadId: string;
198
198
  key: string;
199
199
  }): Promise<void>;
200
+ /**
201
+ * Write several values into a thread's metadata in one write, queued behind the thread's other
202
+ * metadata writes. An `undefined` value deletes its key. Rejects when storage rejects.
203
+ */
204
+ setMetadataValues(input: {
205
+ threadId: string;
206
+ values: Record<string, unknown>;
207
+ }): Promise<void>;
200
208
  /** Whether the host has thread storage configured. When false, lifecycle persistence is a no-op. */
201
209
  hasStorage(): boolean;
202
210
  /** Persist a new or updated thread row. No-op when storage is unavailable. */
@@ -436,6 +444,15 @@ export declare class SessionThread {
436
444
  key: string;
437
445
  value: unknown;
438
446
  }): Promise<void>;
447
+ /**
448
+ * Persist several settings to a specific thread in one write: they all land or none do.
449
+ * An `undefined` value deletes its setting. Unlike {@link setSettingOn}, rejects when storage
450
+ * rejects, for a caller that must not report success on a lost write.
451
+ */
452
+ setSettingsOn({ threadId, settings }: {
453
+ threadId: string;
454
+ settings: Record<string, unknown>;
455
+ }): Promise<void>;
439
456
  /** Delete a setting (metadata value) for the active thread. */
440
457
  deleteSetting({ key }: {
441
458
  key: string;
@@ -1,17 +1,18 @@
1
- const require_execution_fence = require("./execution-fence-BBKnrhWR.cjs");
1
+ const require_execution_fence = require("./execution-fence-C1nozqra.cjs");
2
2
  const require_message_list = require("./message-list-C0F2sDNC.cjs");
3
3
  const require_signals = require("./signals-CWxAMEmE.cjs");
4
4
  const require_ee_iTj2bRDt = require("./ee-iTj2bRDt-D3-QLGDF.cjs");
5
- const require_channels = require("./channels-BamLzaJG.cjs");
6
- const require_llm = require("./llm-DknPJDW6.cjs");
7
- const require_mastra = require("./mastra-BzWL4xI8.cjs");
8
- const require_stream = require("./stream-CNqAlDJF.cjs");
5
+ const require_channels = require("./channels-DNOI029U.cjs");
6
+ const require_llm = require("./llm-VhPqyULU.cjs");
7
+ const require_mastra = require("./mastra-CQGD2RoN.cjs");
8
+ const require_stream = require("./stream-CW3d1Xg6.cjs");
9
9
  const require_request_context = require("./request-context-D9RXYCy8.cjs");
10
10
  const require_dynamic_argument = require("./dynamic-argument-CUc1BBOS.cjs");
11
+ const require_provider_registry = require("./provider-registry-_BUQuSKb.cjs");
11
12
  const require_error = require("./error-D90lJ6M7.cjs");
12
13
  const require_utils_safe_stringify = require("./utils/safe-stringify.cjs");
13
14
  const require_workspace = require("./workspace-BQD4tcQi.cjs");
14
- const require_output_helpers = require("./output-helpers-By5FbLpp.cjs");
15
+ const require_output_helpers = require("./output-helpers-D4O_oFne.cjs");
15
16
  const require_memory_om_events_index = require("./memory/om-events/index.cjs");
16
17
  const require_tools = require("./tools-DZoVfKPl.cjs");
17
18
  const require_payload_transform = require("./payload-transform-CWgnsO9w.cjs");
@@ -51,18 +52,18 @@ function isSessionNotStartedError(error) {
51
52
  * short.
52
53
  */
53
54
  const MODEL_CATALOG_TTL_MS = 1e4;
54
- /** How long a downloaded remote catalog (models.dev, Netlify, ...) is served before a call refreshes it in the background. */
55
- const REMOTE_CATALOG_REFRESH_MS = 3e5;
56
- /** After a remote catalog fails, how long its last known providers are served before the next try. */
57
- const REMOTE_CATALOG_RETRY_MS = 6e4;
58
55
  /**
59
56
  * Model catalog cache with two refresh speeds.
60
57
  *
61
- * Remote gateways download public catalogs (models.dev's is ~6 MB). Once a
62
- * downloaded catalog is older than {@link REMOTE_CATALOG_REFRESH_MS}, the next
63
- * call refreshes it in the background and keeps serving the last good result,
64
- * including when the refresh fails. A call waits for a remote gateway only
65
- * while it has nothing to serve: before its first successful download.
58
+ * Remote gateways download public catalogs (models.dev's is ~6 MB). Each is
59
+ * kept in a {@link RefreshingCache}: once older than {@link CATALOG_REFRESH_MS},
60
+ * the next call refreshes it in the background and keeps serving the last good
61
+ * result, including when the refresh fails. A call waits for a remote gateway
62
+ * only while it has nothing to serve: before its first successful download.
63
+ *
64
+ * The Mastra Gateway caches its own list on the same schedule, so it is read
65
+ * on every build instead of being cached twice; its download settling counts
66
+ * as a change, like a remote gateway's.
66
67
  *
67
68
  * Everything else (configured gateways and per-provider auth) is rebuilt at
68
69
  * most every {@link MODEL_CATALOG_TTL_MS}, or on the next call after
@@ -74,23 +75,24 @@ const REMOTE_CATALOG_RETRY_MS = 6e4;
74
75
  var ModelCatalogCache = class {
75
76
  #manager;
76
77
  #isRemote;
77
- #remote = /* @__PURE__ */ new Map();
78
- #remoteVersion = 0;
79
- /** In-flight download per remote gateway, so a stalled gateway never holds back the others. */
80
- #remoteRefreshes = /* @__PURE__ */ new Map();
78
+ #remote = new require_provider_registry.RefreshingCache({
79
+ refreshAfterMs: require_provider_registry.CATALOG_REFRESH_MS,
80
+ retryAfterMs: require_provider_registry.CATALOG_RETRY_MS,
81
+ retryEmptyAfterMs: MODEL_CATALOG_TTL_MS
82
+ });
81
83
  #built;
82
84
  #build;
83
85
  /** Bumped by {@link invalidate} so builds started before it are not kept. */
84
86
  #generation = 0;
85
87
  constructor(manager, isRemote) {
86
88
  this.#manager = manager;
87
- this.#isRemote = isRemote;
89
+ this.#isRemote = (gateway) => !(gateway instanceof require_provider_registry.MastraGateway) && isRemote(gateway);
88
90
  }
89
91
  async list() {
90
92
  if (this.#mustWaitForRemote()) return this.#rebuild();
91
- if (this.#dueRemoteGateways().length > 0) this.#refreshRemote().catch(() => {});
93
+ this.#refreshRemote().catch(() => {});
92
94
  const built = this.#built;
93
- if (built && built.remoteVersion === this.#remoteVersion && Date.now() - built.builtAt < MODEL_CATALOG_TTL_MS) return built.models;
95
+ if (built && built.remoteVersion === this.#remote.version && built.gatewayVersion === this.#gatewayVersion() && Date.now() - built.builtAt < MODEL_CATALOG_TTL_MS) return built.models;
94
96
  return this.#rebuild();
95
97
  }
96
98
  /**
@@ -102,7 +104,8 @@ var ModelCatalogCache = class {
102
104
  this.#generation += 1;
103
105
  this.#built = void 0;
104
106
  this.#build = void 0;
105
- for (const snapshot of this.#remote.values()) snapshot.nextFetchAt = 0;
107
+ this.#remote.invalidate();
108
+ for (const gateway of this.#manager.gateways) if (gateway instanceof require_provider_registry.MastraGateway) gateway.invalidateModelCatalog();
106
109
  }
107
110
  #rebuild() {
108
111
  if (this.#build) return this.#build;
@@ -115,17 +118,19 @@ var ModelCatalogCache = class {
115
118
  async #buildCatalog(generation) {
116
119
  const gateways = this.#manager.gateways;
117
120
  const local = gateways.filter((gateway) => !this.#isRemote(gateway));
121
+ const gatewayVersion = this.#gatewayVersion();
118
122
  const [localProviders] = await Promise.all([this.#fetchLocal(local), this.#mustWaitForRemote() ? this.#refreshRemote() : void 0]);
119
- const remoteVersion = this.#remoteVersion;
123
+ const remoteVersion = this.#remote.version;
120
124
  const registry = this.#manager.mergeProviders(gateways.map((gateway) => ({
121
125
  gateway,
122
- providers: (this.#isRemote(gateway) ? this.#remote.get(gateway)?.providers : localProviders.get(gateway)) ?? {}
126
+ providers: (this.#isRemote(gateway) ? this.#remote.peek(gateway) : localProviders.get(gateway)) ?? {}
123
127
  })));
124
128
  const models = await this.#manager.listModelsForProviders(registry);
125
129
  if (generation === this.#generation) this.#built = {
126
130
  models,
127
131
  builtAt: Date.now(),
128
- remoteVersion
132
+ remoteVersion,
133
+ gatewayVersion
129
134
  };
130
135
  return models;
131
136
  }
@@ -134,12 +139,15 @@ var ModelCatalogCache = class {
134
139
  for (const gateway of gateways) providers.set(gateway, await this.#manager.fetchGatewayProviders(gateway));
135
140
  return providers;
136
141
  }
137
- #dueRemoteGateways() {
138
- const now = Date.now();
139
- return this.#manager.gateways.filter((gateway) => this.#isRemote(gateway) && (this.#remote.get(gateway)?.nextFetchAt ?? 0) <= now);
142
+ /** Changes only when one of this manager's Mastra Gateways stores a new list, not when another key does. */
143
+ #gatewayVersion() {
144
+ return this.#manager.gateways.map((gateway) => gateway instanceof require_provider_registry.MastraGateway ? gateway.modelCatalogVersion() : 0).join(",");
145
+ }
146
+ #remoteGateways() {
147
+ return this.#manager.gateways.filter((gateway) => this.#isRemote(gateway));
140
148
  }
141
149
  #mustWaitForRemote() {
142
- return this.#dueRemoteGateways().some((gateway) => !this.#remote.get(gateway)?.providers);
150
+ return this.#remoteGateways().some((gateway) => this.#remote.isDue(gateway) && !this.#remote.peek(gateway));
143
151
  }
144
152
  /**
145
153
  * Starts a download for each due remote gateway that is not already
@@ -148,34 +156,17 @@ var ModelCatalogCache = class {
148
156
  */
149
157
  #refreshRemote() {
150
158
  const waits = [];
151
- for (const gateway of this.#dueRemoteGateways()) {
152
- let refresh = this.#remoteRefreshes.get(gateway);
153
- if (!refresh) {
154
- refresh = this.#fetchRemote(gateway).finally(() => this.#remoteRefreshes.delete(gateway));
155
- this.#remoteRefreshes.set(gateway, refresh);
156
- }
157
- if (!this.#remote.get(gateway)?.providers) waits.push(refresh);
159
+ for (const gateway of this.#remoteGateways()) {
160
+ const refresh = this.#remote.refresh(gateway, () => this.#download(gateway));
161
+ if (!this.#remote.peek(gateway)) waits.push(refresh.catch(() => {}));
158
162
  }
159
163
  return Promise.all(waits).then(() => {});
160
164
  }
161
- /** Downloads one remote gateway and publishes its result as soon as it lands. */
162
- async #fetchRemote(gateway) {
165
+ /** Downloads one remote gateway; a failure (already logged) keeps its last known providers. */
166
+ async #download(gateway) {
163
167
  const providers = await this.#manager.fetchGatewayProviders(gateway);
164
- const fetchedAt = Date.now();
165
- const previous = this.#remote.get(gateway)?.providers;
166
- if (providers) this.#remote.set(gateway, {
167
- providers,
168
- nextFetchAt: fetchedAt + REMOTE_CATALOG_REFRESH_MS
169
- });
170
- else if (previous) this.#remote.set(gateway, {
171
- providers: previous,
172
- nextFetchAt: fetchedAt + REMOTE_CATALOG_RETRY_MS
173
- });
174
- else this.#remote.set(gateway, {
175
- providers: void 0,
176
- nextFetchAt: fetchedAt + MODEL_CATALOG_TTL_MS
177
- });
178
- this.#remoteVersion += 1;
168
+ if (!providers) throw new Error(`Gateway ${gateway.id} catalog unavailable`);
169
+ return providers;
179
170
  }
180
171
  };
181
172
  // src/agent-controller/message-author.ts
@@ -2212,6 +2203,18 @@ var SessionThread = class {
2212
2203
  value
2213
2204
  });
2214
2205
  }
2206
+ /**
2207
+ * Persist several settings to a specific thread in one write: they all land or none do.
2208
+ * An `undefined` value deletes its setting. Unlike {@link setSettingOn}, rejects when storage
2209
+ * rejects, for a caller that must not report success on a lost write.
2210
+ */
2211
+ async setSettingsOn({ threadId, settings }) {
2212
+ if (!this.#store) return;
2213
+ await this.#store.setMetadataValues({
2214
+ threadId,
2215
+ values: settings
2216
+ });
2217
+ }
2215
2218
  /** Delete a setting (metadata value) for the active thread. */
2216
2219
  async deleteSetting({ key }) {
2217
2220
  if (!this.#store || this.#threadId === null) return;
@@ -5480,16 +5483,17 @@ var Session = class {
5480
5483
  if (error instanceof require_error.MastraError && error.id === "AGENT_LIST_SUSPENDED_RUNS_NO_STORAGE") return;
5481
5484
  throw error;
5482
5485
  }
5486
+ if (this.thread.getId() !== threadId) return;
5483
5487
  for (const run of runs) for (const call of run.toolCalls) {
5484
5488
  const { toolCallId, toolName } = call;
5485
5489
  if (!call.requiresApproval || !toolCallId || !toolName) continue;
5486
5490
  const key = address(run.runId, toolCallId);
5487
5491
  if (handled.has(key) || this.#answeredParkedApprovals.has(key)) continue;
5492
+ if (this.thread.getId() !== threadId) return;
5488
5493
  const policy = this.resolveToolApproval(toolName, threadId);
5489
5494
  if (policy === "ask") continue;
5490
5495
  if (policy === "allow" && !this.#savedRulesAllow(toolName)) continue;
5491
5496
  handled.add(key);
5492
- this.#answeredParkedApprovals.add(key);
5493
5497
  const identity = {
5494
5498
  toolCallId,
5495
5499
  runId: run.runId,
@@ -5497,8 +5501,13 @@ var Session = class {
5497
5501
  resourceId: this.identity.getResourceId(),
5498
5502
  requestContext: this.#parkedApprovalsRequestContext
5499
5503
  };
5500
- if (policy === "allow") await this.approveToolCall(identity);
5501
- else await this.declineToolCall(identity);
5504
+ try {
5505
+ if (policy === "allow") await this.approveToolCall(identity);
5506
+ else await this.declineToolCall(identity);
5507
+ this.#answeredParkedApprovals.add(key);
5508
+ } catch (error) {
5509
+ console.error("Re-checking a parked tool approval against the current policy failed:", error);
5510
+ }
5502
5511
  }
5503
5512
  }
5504
5513
  /**
@@ -8297,6 +8306,7 @@ var AgentController = class {
8297
8306
  threadId,
8298
8307
  key
8299
8308
  }),
8309
+ setMetadataValues: ({ threadId, values }) => this.writeThreadMetadataValues(threadId, values),
8300
8310
  hasStorage: () => !!this.#resolveStorage(),
8301
8311
  saveThread: ({ thread }) => this.persistThreadRow(thread),
8302
8312
  deleteThread: ({ threadId, requestContext }) => this.deleteThreadRow({