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

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 (405) hide show
  1. package/dist/_types/@internal_core@0.1.4/dist/knowledge-compat/index.d.ts +49 -0
  2. package/dist/a2a/index.cjs +1 -1
  3. package/dist/a2a/index.js +1 -1
  4. package/dist/agent/durable/index.cjs +1 -1
  5. package/dist/agent/durable/index.js +1 -1
  6. package/dist/agent/durable/run-registry.d.ts +2 -0
  7. package/dist/agent/durable/types.d.ts +6 -0
  8. package/dist/agent/durable/utils/resolve-runtime.d.ts +5 -0
  9. package/dist/agent/index.cjs +3 -3
  10. package/dist/agent/index.js +3 -3
  11. package/dist/agent/message-list/index.cjs +1 -1
  12. package/dist/agent/message-list/index.js +1 -1
  13. package/dist/agent/message-list/state/MessageStateManager.d.ts +5 -0
  14. package/dist/agent-builder/ee/index.cjs +1 -1
  15. package/dist/agent-builder/ee/index.js +1 -1
  16. package/dist/agent-controller/index.cjs +1 -1
  17. package/dist/agent-controller/index.js +1 -1
  18. package/dist/agent-controller/session.d.ts +11 -1
  19. package/dist/{agent-controller-BolLBwDm.cjs → agent-controller-BcN7r3yI.cjs} +40 -204
  20. package/dist/{agent-controller--gKWI81G.js → agent-controller-DfeTRuBc.js} +40 -204
  21. package/dist/background-tasks/index.cjs +1 -1
  22. package/dist/background-tasks/index.js +1 -1
  23. package/dist/{background-tasks-CgzXjBfE.js → background-tasks-BcU--rXL.js} +1 -1
  24. package/dist/{background-tasks-DYtlijQ1.cjs → background-tasks-DRUHnQOk.cjs} +1 -1
  25. package/dist/browser/index.cjs +15 -6
  26. package/dist/browser/index.js +15 -6
  27. package/dist/browser/processor.d.ts +1 -0
  28. package/dist/{builder-Dz-g-9CZ.cjs → builder-Bufqrcz3.cjs} +2 -2
  29. package/dist/{builder-emNPaIaC.js → builder-TuIc5l7X.js} +2 -2
  30. package/dist/capabilities/302ai.json +201 -201
  31. package/dist/capabilities/abliteratedllm.json +34 -34
  32. package/dist/capabilities/abliteration-ai.json +11 -11
  33. package/dist/capabilities/above.json +22 -22
  34. package/dist/capabilities/adaption.json +13 -13
  35. package/dist/capabilities/adzuki.json +33 -33
  36. package/dist/capabilities/agentrouter.json +7 -7
  37. package/dist/capabilities/agnes.json +4 -4
  38. package/dist/capabilities/ai-router.json +8 -8
  39. package/dist/capabilities/aiand.json +22 -22
  40. package/dist/capabilities/aigrow.json +12 -12
  41. package/dist/capabilities/aimlapi.json +149 -149
  42. package/dist/capabilities/aixy.json +26 -26
  43. package/dist/capabilities/aki-io.json +12 -12
  44. package/dist/capabilities/alibaba-cn.json +93 -93
  45. package/dist/capabilities/alibaba-coding-plan-cn.json +5 -5
  46. package/dist/capabilities/alibaba-coding-plan.json +5 -5
  47. package/dist/capabilities/alibaba-token-plan-cn.json +37 -37
  48. package/dist/capabilities/alibaba-token-plan.json +40 -40
  49. package/dist/capabilities/alibaba.json +66 -66
  50. package/dist/capabilities/ambient.json +13 -13
  51. package/dist/capabilities/amd.json +11 -11
  52. package/dist/capabilities/anthropic.json +42 -42
  53. package/dist/capabilities/anyapi.json +47 -47
  54. package/dist/capabilities/apiko.json +5 -5
  55. package/dist/capabilities/arcee.json +11 -11
  56. package/dist/capabilities/augure.json +7 -7
  57. package/dist/capabilities/auriko.json +21 -21
  58. package/dist/capabilities/bailing.json +5 -5
  59. package/dist/capabilities/baseten.json +33 -33
  60. package/dist/capabilities/bee.json +4 -4
  61. package/dist/capabilities/berget.json +8 -8
  62. package/dist/capabilities/bothub.json +17 -17
  63. package/dist/capabilities/boundless.json +38 -38
  64. package/dist/capabilities/bumo.json +34 -34
  65. package/dist/capabilities/byteplus.json +24 -24
  66. package/dist/capabilities/cerebras.json +4 -4
  67. package/dist/capabilities/cheapaimodel.json +10 -10
  68. package/dist/capabilities/cheapest-token.json +28 -28
  69. package/dist/capabilities/chutes.json +7 -7
  70. package/dist/capabilities/cline-pass.json +35 -35
  71. package/dist/capabilities/cloudcode.json +7 -7
  72. package/dist/capabilities/cloudferro-sherlock.json +4 -4
  73. package/dist/capabilities/cloudflare-workers-ai.json +19 -19
  74. package/dist/capabilities/commandcode.json +149 -149
  75. package/dist/capabilities/concentrate.json +276 -268
  76. package/dist/capabilities/cortecs.json +104 -104
  77. package/dist/capabilities/crossmodel.json +179 -179
  78. package/dist/capabilities/crusoe.json +19 -19
  79. package/dist/capabilities/daoxe.json +6 -6
  80. package/dist/capabilities/databricks.json +124 -124
  81. package/dist/capabilities/deepinfra.json +89 -83
  82. package/dist/capabilities/deepseek.json +4 -4
  83. package/dist/capabilities/digitalocean.json +113 -113
  84. package/dist/capabilities/dothoosh.json +32 -32
  85. package/dist/capabilities/doubleword.json +25 -25
  86. package/dist/capabilities/edenai.json +286 -286
  87. package/dist/capabilities/empiriolabs.json +169 -169
  88. package/dist/capabilities/engy.json +16 -16
  89. package/dist/capabilities/entrim.json +8 -8
  90. package/dist/capabilities/evroc.json +12 -12
  91. package/dist/capabilities/ezkielyna.json +4 -4
  92. package/dist/capabilities/fastrouter.json +83 -83
  93. package/dist/capabilities/fireworks-ai.json +99 -99
  94. package/dist/capabilities/fortytwo.json +4 -4
  95. package/dist/capabilities/freemodel.json +22 -22
  96. package/dist/capabilities/friendli.json +8 -8
  97. package/dist/capabilities/frogbot.json +87 -87
  98. package/dist/capabilities/gisoo.json +17 -17
  99. package/dist/capabilities/gmicloud.json +21 -21
  100. package/dist/capabilities/google.json +58 -58
  101. package/dist/capabilities/graphn.json +8 -8
  102. package/dist/capabilities/greenpt.json +34 -34
  103. package/dist/capabilities/groq.json +9 -9
  104. package/dist/capabilities/helicone.json +87 -87
  105. package/dist/capabilities/hetzner.json +5 -5
  106. package/dist/capabilities/hostinger-router.json +10 -10
  107. package/dist/capabilities/hpc-ai.json +12 -12
  108. package/dist/capabilities/huawei-maas.json +15 -15
  109. package/dist/capabilities/hubris.json +32 -32
  110. package/dist/capabilities/huggingface.json +93 -85
  111. package/dist/capabilities/humain.json +2 -2
  112. package/dist/capabilities/hyper.json +23 -23
  113. package/dist/capabilities/impossibl.json +173 -173
  114. package/dist/capabilities/inceptron.json +8 -8
  115. package/dist/capabilities/inco.json +4 -4
  116. package/dist/capabilities/infer.json +14 -14
  117. package/dist/capabilities/inferall.json +9 -9
  118. package/dist/capabilities/inference-coop.json +9 -9
  119. package/dist/capabilities/inferenceapis.json +13 -13
  120. package/dist/capabilities/inferris.json +4 -4
  121. package/dist/capabilities/infersia.json +8 -8
  122. package/dist/capabilities/inferx.json +3 -3
  123. package/dist/capabilities/infomaniak.json +2 -2
  124. package/dist/capabilities/io-net.json +5 -5
  125. package/dist/capabilities/isoquant.json +4 -4
  126. package/dist/capabilities/iteracompute.json +53 -53
  127. package/dist/capabilities/jad-ai.json +2 -2
  128. package/dist/capabilities/jalapeno.json +12 -12
  129. package/dist/capabilities/jiekou.json +67 -67
  130. package/dist/capabilities/joingonka.json +4 -4
  131. package/dist/capabilities/jzstoken.json +53 -53
  132. package/dist/capabilities/keln.json +21 -21
  133. package/dist/capabilities/kenari.json +132 -124
  134. package/dist/capabilities/kilo.json +604 -604
  135. package/dist/capabilities/kimi-code-plan-cn.json +7 -7
  136. package/dist/capabilities/kimi-code-plan-global.json +7 -7
  137. package/dist/capabilities/kitani.json +6 -6
  138. package/dist/capabilities/klavo.json +21 -21
  139. package/dist/capabilities/korouter.json +30 -30
  140. package/dist/capabilities/kunavo.json +7 -7
  141. package/dist/capabilities/liquid.json +9 -9
  142. package/dist/capabilities/lithosai.json +2 -2
  143. package/dist/capabilities/llmgateway-providers.json +944 -944
  144. package/dist/capabilities/llmgateway.json +340 -340
  145. package/dist/capabilities/llmtr.json +30 -30
  146. package/dist/capabilities/logits.json +2 -2
  147. package/dist/capabilities/longcat.json +2 -2
  148. package/dist/capabilities/lowrouter.json +60 -60
  149. package/dist/capabilities/lyceum.json +12 -12
  150. package/dist/capabilities/melious.json +8 -8
  151. package/dist/capabilities/merge-gateway.json +280 -280
  152. package/dist/capabilities/meta.json +7 -7
  153. package/dist/capabilities/mistral.json +18 -18
  154. package/dist/capabilities/mixlayer.json +5 -5
  155. package/dist/capabilities/modal.json +12 -12
  156. package/dist/capabilities/model-oracle-ai.json +25 -25
  157. package/dist/capabilities/modelis.json +21 -21
  158. package/dist/capabilities/modular.json +13 -13
  159. package/dist/capabilities/moneo.json +18 -18
  160. package/dist/capabilities/moonshotai-cn.json +7 -7
  161. package/dist/capabilities/moonshotai.json +7 -7
  162. package/dist/capabilities/morph.json +16 -16
  163. package/dist/capabilities/munito-eu.json +6 -6
  164. package/dist/capabilities/munito.json +10 -10
  165. package/dist/capabilities/nan.json +28 -28
  166. package/dist/capabilities/nano-gpt.json +566 -565
  167. package/dist/capabilities/nearai.json +96 -96
  168. package/dist/capabilities/nebius.json +32 -32
  169. package/dist/capabilities/neon.json +124 -124
  170. package/dist/capabilities/neuralwatt.json +36 -36
  171. package/dist/capabilities/nokeep.json +5 -5
  172. package/dist/capabilities/novita-ai.json +153 -153
  173. package/dist/capabilities/nvidia.json +35 -35
  174. package/dist/capabilities/oathbreaker.json +3 -3
  175. package/dist/capabilities/obscurify.json +27 -27
  176. package/dist/capabilities/oci.json +10 -10
  177. package/dist/capabilities/ofox.json +381 -381
  178. package/dist/capabilities/ollama-cloud.json +48 -48
  179. package/dist/capabilities/openai.json +59 -59
  180. package/dist/capabilities/opencode-go.json +91 -91
  181. package/dist/capabilities/openreason.json +5 -5
  182. package/dist/capabilities/openrouter.json +526 -527
  183. package/dist/capabilities/opper.json +29 -29
  184. package/dist/capabilities/orcarouter.json +228 -228
  185. package/dist/capabilities/outerlabs.json +30 -30
  186. package/dist/capabilities/ovhcloud.json +19 -19
  187. package/dist/capabilities/pareto.json +5 -5
  188. package/dist/capabilities/pendra.json +4 -4
  189. package/dist/capabilities/perplexity-agent.json +47 -47
  190. package/dist/capabilities/phala.json +30 -30
  191. package/dist/capabilities/pioneer.json +27 -27
  192. package/dist/capabilities/poe.json +133 -133
  193. package/dist/capabilities/poolside.json +2 -2
  194. package/dist/capabilities/powerspring.json +9 -9
  195. package/dist/capabilities/primalabs.json +9 -9
  196. package/dist/capabilities/prime.json +106 -106
  197. package/dist/capabilities/privatemode-ai.json +12 -12
  198. package/dist/capabilities/proxystacks.json +7 -7
  199. package/dist/capabilities/qiniu-ai.json +14 -14
  200. package/dist/capabilities/refuseless.json +8 -8
  201. package/dist/capabilities/regolo-ai.json +2 -2
  202. package/dist/capabilities/requesty.json +258 -199
  203. package/dist/capabilities/ruapi.json +21 -21
  204. package/dist/capabilities/runcrate.json +14 -14
  205. package/dist/capabilities/runinfra.json +18 -18
  206. package/dist/capabilities/sakana.json +6 -6
  207. package/dist/capabilities/sambanova.json +6 -6
  208. package/dist/capabilities/sandbase.json +22 -22
  209. package/dist/capabilities/sarvam.json +14 -14
  210. package/dist/capabilities/scaleway.json +16 -16
  211. package/dist/capabilities/scnet-token-plan.json +10 -10
  212. package/dist/capabilities/scx-ai.json +29 -29
  213. package/dist/capabilities/sensenova.json +12 -12
  214. package/dist/capabilities/siliconflow-cn.json +56 -56
  215. package/dist/capabilities/siliconflow.json +60 -60
  216. package/dist/capabilities/snowflake-cortex.json +20 -20
  217. package/dist/capabilities/sokkan.json +10 -10
  218. package/dist/capabilities/sparrowcodes.json +16 -16
  219. package/dist/capabilities/standardcompute.json +88 -88
  220. package/dist/capabilities/steadyrouter.json +35 -35
  221. package/dist/capabilities/stepfun-ai-step-plan.json +4 -4
  222. package/dist/capabilities/stepfun-ai.json +4 -4
  223. package/dist/capabilities/stepfun-step-plan.json +4 -4
  224. package/dist/capabilities/stepfun.json +4 -4
  225. package/dist/capabilities/stepping-stone.json +21 -21
  226. package/dist/capabilities/subconscious.json +2 -2
  227. package/dist/capabilities/superbot-gg.json +4 -4
  228. package/dist/capabilities/synthetic.json +10 -10
  229. package/dist/capabilities/synthorai.json +19 -19
  230. package/dist/capabilities/teamorouter.json +25 -25
  231. package/dist/capabilities/teapot-router.json +7 -7
  232. package/dist/capabilities/tencent-token-plan-intl.json +24 -24
  233. package/dist/capabilities/tencent-token-plan.json +40 -40
  234. package/dist/capabilities/tencent-tokenhub.json +47 -47
  235. package/dist/capabilities/tensorx.json +48 -48
  236. package/dist/capabilities/tenstorrent.json +8 -8
  237. package/dist/capabilities/the-grid-ai.json +28 -28
  238. package/dist/capabilities/thinkingmachines.json +39 -39
  239. package/dist/capabilities/tinfoil.json +14 -14
  240. package/dist/capabilities/toapis.json +2 -2
  241. package/dist/capabilities/togetherai.json +50 -50
  242. package/dist/capabilities/tokengo.json +19 -19
  243. package/dist/capabilities/tokenify.json +9 -9
  244. package/dist/capabilities/trustedrouter.json +7 -7
  245. package/dist/capabilities/trustedtokens.json +20 -20
  246. package/dist/capabilities/umans-ai-coding-plan.json +18 -18
  247. package/dist/capabilities/umans-ai.json +12 -12
  248. package/dist/capabilities/uncensuredai.json +4 -4
  249. package/dist/capabilities/unrestricted.json +8 -8
  250. package/dist/capabilities/uplinkswitch.json +22 -22
  251. package/dist/capabilities/upstage.json +6 -6
  252. package/dist/capabilities/vancine.json +15 -15
  253. package/dist/capabilities/vercel.json +546 -546
  254. package/dist/capabilities/vivgrid.json +84 -84
  255. package/dist/capabilities/volcengine-coding-plan.json +28 -28
  256. package/dist/capabilities/volcengine.json +29 -29
  257. package/dist/capabilities/vultr.json +31 -31
  258. package/dist/capabilities/wafer.ai.json +15 -15
  259. package/dist/capabilities/wallaby.json +2 -2
  260. package/dist/capabilities/wally.json +9 -9
  261. package/dist/capabilities/wandb.json +16 -16
  262. package/dist/capabilities/watt.json +22 -22
  263. package/dist/capabilities/xai.json +7 -7
  264. package/dist/capabilities/xiaomi.json +3 -3
  265. package/dist/capabilities/xpersona.json +11 -11
  266. package/dist/capabilities/xxapi.json +28 -28
  267. package/dist/capabilities/zai-coding-plan.json +12 -12
  268. package/dist/capabilities/zai.json +31 -31
  269. package/dist/capabilities/zenifra.json +26 -26
  270. package/dist/capabilities/zenmux.json +159 -159
  271. package/dist/capabilities/zerogpu.json +11 -11
  272. package/dist/capabilities/zhipuai-coding-plan.json +8 -8
  273. package/dist/capabilities/zhipuai.json +29 -29
  274. package/dist/capabilities/zro.json +7 -7
  275. package/dist/channels/index.cjs +2 -2
  276. package/dist/channels/index.js +2 -2
  277. package/dist/{channels-CndspFXP.js → channels-Cdsqdajh.js} +1 -1
  278. package/dist/{channels-BVnDIsZS.cjs → channels-MsOnUvU6.cjs} +1 -1
  279. package/dist/coding-agent/index.cjs +2 -2
  280. package/dist/coding-agent/index.js +2 -2
  281. package/dist/datasets/index.cjs +2 -2
  282. package/dist/datasets/index.js +2 -2
  283. package/dist/docs/SKILL.md +1 -1
  284. package/dist/docs/assets/SOURCE_MAP.json +609 -609
  285. package/dist/docs/references/reference-agent-controller-session.md +29 -1
  286. package/dist/docs/references/reference-memory-observational-memory.md +4 -0
  287. package/dist/docs/references/reference.md +1 -0
  288. package/dist/evals/index.cjs +1 -1
  289. package/dist/evals/index.js +1 -1
  290. package/dist/evals/scoreTraces/index.cjs +1 -1
  291. package/dist/evals/scoreTraces/index.js +1 -1
  292. package/dist/harness/index.cjs +1 -1
  293. package/dist/harness/index.js +1 -1
  294. package/dist/index.cjs +1 -1
  295. package/dist/index.js +1 -1
  296. package/dist/knowledge/importers/overlay.d.ts +138 -0
  297. package/dist/knowledge/importers/sink.d.ts +6 -0
  298. package/dist/knowledge/importers/types.d.ts +5 -0
  299. package/dist/knowledge/index.cjs +1412 -139
  300. package/dist/knowledge/index.js +1412 -139
  301. package/dist/knowledge/links.d.ts +27 -0
  302. package/dist/llm/index.cjs +3 -3
  303. package/dist/llm/index.js +3 -3
  304. package/dist/llm/model/provider-types.generated.d.ts +7781 -7766
  305. package/dist/llm/reasoning/anthropic-thinking.d.ts +5 -0
  306. package/dist/llm/reasoning/gemini-thinking.d.ts +24 -0
  307. package/dist/llm/reasoning/index.cjs +389 -0
  308. package/dist/llm/reasoning/index.d.ts +8 -0
  309. package/dist/llm/reasoning/index.js +362 -0
  310. package/dist/llm/reasoning/model-fallback.d.ts +75 -0
  311. package/dist/llm/reasoning/model-ids.d.ts +5 -0
  312. package/dist/llm/reasoning/thinking-provider-options.d.ts +10 -0
  313. package/dist/llm/reasoning/thinking-request.d.ts +14 -0
  314. package/dist/llm/reasoning/thinking.d.ts +37 -0
  315. package/dist/{llm-B1semiTO.cjs → llm-CS6YY_IV.cjs} +2 -2
  316. package/dist/{llm-CytL7cpw.js → llm-zjtMQn7M.js} +2 -2
  317. package/dist/loop/index.cjs +2 -2
  318. package/dist/loop/index.js +2 -2
  319. package/dist/{manager-BwyfS4ha.cjs → manager-BU_lY6kl.cjs} +2 -2
  320. package/dist/{manager-DnTzA9GL.js → manager-Do0MENhH.js} +2 -2
  321. package/dist/mastra/index.cjs +1 -1
  322. package/dist/mastra/index.d.ts +2 -0
  323. package/dist/mastra/index.js +1 -1
  324. package/dist/{mastra-DTkZPpch.js → mastra-C-1zIyS5.js} +22 -16
  325. package/dist/{mastra-Dj35Lj_J.cjs → mastra-DYVjsXTO.cjs} +22 -16
  326. package/dist/memory/index.cjs +3 -3
  327. package/dist/memory/index.js +3 -3
  328. package/dist/memory/om-events/index.cjs +189 -0
  329. package/dist/memory/om-events/index.d.ts +17 -0
  330. package/dist/memory/om-events/index.js +188 -0
  331. package/dist/{message-list-vR3uLAHL.cjs → message-list-C0F2sDNC.cjs} +3 -2
  332. package/dist/{message-list-BGm1DCiG.js → message-list-RgFlLrxG.js} +3 -2
  333. package/dist/{model-eDfetuno.cjs → model-DGFc1hw3.cjs} +1 -1
  334. package/dist/{model-DyQ07rPH.js → model-DIzIjDej.js} +1 -1
  335. package/dist/{netlify-BUvdxfHe.js → netlify-B9mLgxJs.js} +1 -1
  336. package/dist/{netlify-BC4v7Ufv.cjs → netlify-CyL6FNsw.cjs} +1 -1
  337. package/dist/notifications/index.cjs +1 -1
  338. package/dist/notifications/index.js +1 -1
  339. package/dist/processor-provider/index.cjs +1 -1
  340. package/dist/processor-provider/index.js +1 -1
  341. package/dist/processors/index.cjs +2 -2
  342. package/dist/processors/index.js +2 -2
  343. package/dist/{provider-registry-CP_5SNiw.js → provider-registry-DdQoO_jd.js} +22523 -22492
  344. package/dist/{provider-registry-Bn01gq9y.cjs → provider-registry-g9m_fyV8.cjs} +22523 -22492
  345. package/dist/provider-registry.json +22977 -22946
  346. package/dist/{registry-generator-CNFKGRFQ.cjs → registry-generator-At8J4ZOR.cjs} +1 -1
  347. package/dist/{registry-generator-CDPyxbzt.js → registry-generator-CX6Ev697.js} +1 -1
  348. package/dist/{rehydrate-DExpzlNS.cjs → rehydrate-BzD6UX8f.cjs} +2 -2
  349. package/dist/{rehydrate-CnGNY2zq.js → rehydrate-DEDxsr6E.js} +2 -2
  350. package/dist/relevance/index.cjs +2 -2
  351. package/dist/relevance/index.js +2 -2
  352. package/dist/{run-registry-BL_kKvFE.js → run-registry-D22IF5SK.js} +434 -26
  353. package/dist/{run-registry-CibQoN6K.cjs → run-registry-PiQTSx2Y.cjs} +457 -25
  354. package/dist/storage/domains/knowledge/base.d.ts +86 -1
  355. package/dist/storage/domains/knowledge/importers-inmemory.d.ts +9 -0
  356. package/dist/storage/domains/knowledge/importers.d.ts +31 -0
  357. package/dist/storage/domains/knowledge/inmemory.d.ts +7 -0
  358. package/dist/storage/domains/knowledge/pages-inmemory.d.ts +31 -1
  359. package/dist/storage/domains/knowledge/pages.d.ts +74 -0
  360. package/dist/storage/index.cjs +2 -2
  361. package/dist/storage/index.js +2 -2
  362. package/dist/storage/types.d.ts +6 -0
  363. package/dist/stream/base/output.d.ts +7 -0
  364. package/dist/stream/index.cjs +2 -2
  365. package/dist/stream/index.js +2 -2
  366. package/dist/{stream-D_7tMaJe.cjs → stream-BbPZavop.cjs} +36 -4
  367. package/dist/{stream-1DGoEkG2.js → stream-CoQTdzLm.js} +31 -5
  368. package/dist/test-utils/llm-mock.cjs +1 -1
  369. package/dist/test-utils/llm-mock.js +1 -1
  370. package/dist/tool-loop-agent/index.cjs +1 -1
  371. package/dist/tool-loop-agent/index.js +1 -1
  372. package/dist/{tool-loop-agent-CLB1r3X3.cjs → tool-loop-agent-8lyD6O4o.cjs} +4 -4
  373. package/dist/{tool-loop-agent-BXya_RYj.js → tool-loop-agent-DhQkNDaR.js} +4 -4
  374. package/dist/{utils-C55ZdVaj.js → utils-B-3lET9S.js} +1 -1
  375. package/dist/{utils-B-KOMA_Q.cjs → utils-DtmyBuBT.cjs} +1 -1
  376. package/dist/utils.cjs +1 -1
  377. package/dist/utils.js +1 -1
  378. package/dist/{validate-BDfYr72F.js → validate-CO4rWYyH.js} +1 -1
  379. package/dist/{validate-CmZhnsmX.cjs → validate-vucjWXcz.cjs} +1 -1
  380. package/dist/vector/index.cjs +2 -2
  381. package/dist/vector/index.js +2 -2
  382. package/dist/worker/index.cjs +1 -1
  383. package/dist/worker/index.js +1 -1
  384. package/dist/{worker-CuK2RaC0.js → worker-B6CpapAF.js} +2 -2
  385. package/dist/{worker-BoybIUTI.cjs → worker-BgifMkOw.cjs} +2 -2
  386. package/dist/{worker-BG1rw_dg.js → worker-CCpSrXBY.js} +2 -2
  387. package/dist/{worker-D2B-x7Le.cjs → worker-eUT7GgQ9.cjs} +2 -2
  388. package/dist/{workflow-Bt09PcH1.js → workflow-B4Tn58DD.js} +3 -3
  389. package/dist/{workflow-CTKqeRXU.cjs → workflow-BJSrGEEL.cjs} +3 -3
  390. package/dist/workflows/builder/index.cjs +1 -1
  391. package/dist/workflows/builder/index.js +1 -1
  392. package/dist/workflows/evented/index.cjs +1 -1
  393. package/dist/workflows/evented/index.js +1 -1
  394. package/dist/workflows/index.cjs +4 -4
  395. package/dist/workflows/index.js +4 -4
  396. package/dist/workspace/index.cjs +1 -1
  397. package/dist/workspace/index.js +1 -1
  398. package/dist/workspace/sandbox/local-sandbox.d.ts +11 -0
  399. package/dist/workspace/sandbox/sandbox.d.ts +2 -0
  400. package/dist/{workspace-C8Zo5_qK.cjs → workspace-C5lXteRU.cjs} +174 -12
  401. package/dist/{workspace-DOAil8mG.js → workspace-CnmmMou8.js} +174 -12
  402. package/llm/reasoning.d.ts +1 -0
  403. package/memory/om-events.d.ts +1 -0
  404. package/package.json +27 -7
  405. package/src/llm/model/provider-types.generated.d.ts +7781 -7766
@@ -4,14 +4,14 @@ import { t as MastraBase } from "./base-CKLWBhDo.js";
4
4
  import { A as compactStopReasonContext, D as agentLoopTermination, O as executionFailureTermination, S as resolveObservabilityContext, b as wrapMastra, i as subtractReportedUsage, k as tripwireTermination, n as extractUsageMetrics, r as isUsageIncomplete, t as calculateObservedUsage, x as createObservabilityContext, y as unwrapMastraTracingProxy } from "./observability-D7RNOAPx.js";
5
5
  import { a as MastraNonRetryableError, i as MastraError, n as ErrorDomain, o as getErrorFromUnknown, t as ErrorCategory } from "./error-oh2DLsP2.js";
6
6
  import { a as classifyProviderError, l as describeProviderError, t as recordTerminalErrorMessage, u as readProviderErrorDetails } from "./error-BC9Au-22.js";
7
- import { $ as resolveProcessorSpanAttributes, $t as computeModelOutputProviderMetadata, A as OUTPUT_STREAM_HOOK_DURATION_KEY_PREFIX, An as safeError, B as ProviderHistoryCompat, Bt as summarizeStepResult, C as markChunkOutputProcessed, Cn as isMastraTimeoutError, Ct as resolveTemplate, D as asJsonSchema, Dn as MastraModelInput, Dt as getStepResult, E as isStructuredOutputError, Et as validateTemplate, F as findOwnModelStepSpan, Ft as materializeState, G as REPROCESS_PART_KEY, Gt as patchState, Ht as applyStatePatch, It as materializeWorkflowRun, J as summarizeActiveToolsForSpan, Jt as isObservationalMemoryEnabled$1, K as takeHeldParts, L as isTrailingAssistantGuardContinuation, Lt as pickStateKeys, M as ProcessorState, Mn as createRunScopeKey, Mt as applyStateColumnsWrite, N as endOutputStreamSpanAtStepEnd, Nt as isStateCheckpointDue, O as getResponseFormat, On as safeClose, Ot as getStepResultAsync, P as endOutputStreamSpanOutsideStep, Pt as latestStepResults, Q as summarizeToolChoiceForSpan, Qt as commitToolResult, R as needsTrailingAssistantGuard, Rt as stateBaseOf, S as stampChunkProducedAt, Sn as guardStreamWithAbort, T as escapeUnescapedControlCharsInJsonStrings, Tn as settledOrElapsed, Tt as traverseMappingPath, Vt as unusedStateEntries, W as FLUSH_HELD_PARTS_KEY, Wt as diffStateAsJson, X as summarizeProcessorResultForSpan, Xt as parseMemoryRequestContext, Y as summarizeProcessorModelForSpan, Z as summarizeProcessorToolsForSpan, _ as reconcileBufferedStepTexts, _n as DEADLINE_SAVE_WAIT_MS, _t as collectMappingStepRefs, a as convertFullStreamChunkToMastra, an as withAgentWorkflowToolMarker, at as RunJournal, b as resolveProcessorWriterMessageId, bn as getAbortReason, bt as resolveStepOutputs, c as WorkflowRunOutput, cn as isProcessorWorkflow, ct as hydrateStepResults, d as MastraModelOutput, dn as resolveThreadIdFromArgs, dt as loadStepResults, en as hasToolResultProcessor, et as resolveProcessorSpanName, f as clearStepPartIndexes, fn as supportedLanguageModelSpecifications, ft as loadedStepResults, g as persistProcessorDataChunk, gn as DEADLINE_SAVE_CLAIM_HOLD_MS, gt as stubStepResult, h as findStepPartBoundaries, hn as applyStateSignal, ht as storageV2StepResultAccessors, in as snapshotToolResult, it as PROCESSOR_ABORT_SIGNAL, j as ProcessorRunner, jn as createRunScope, k as isSignalChunkExcluded, kn as safeEnqueue, kt as getSnapshotMemoryInfo, l as TripWire, ln as isSupportedLanguageModel, lt as isStepResultStub, m as findIterationOffsetInParts, mn as tryStreamWithJsonFallback, mt as residentStepResultsLoader, nn as readModelOutput, nt as PROCESSOR_LATE_SIGNAL_SINK, on as normalizeModelOutput, ot as buildStepResultAccessors, p as createDestructurableOutput, pn as tryGenerateWithJsonFallback, pt as residentStepResults, q as withoutHeldContent, rn as resolveModelOutputAfterToolResultProcessors, rt as createProcessorSendSignal, s as MastraAgentNetworkStream, sn as validationErrorModelOutput, st as getHydratedStepResult, tn as latestProcessedModelOutput, tt as toProcessorSpanPhase, u as getModelOutputForTripwire, un as resolveSuspendedToolRunId, ut as lazyStepResults, v as resolveMessageText, vn as MastraTimeoutError, vt as collectPredicateStepRefs, w as createOutputHandler, wn as raceAgainstAbort, wt as templateReadsState, x as getChunkProducedAt, xn as guardStreamUntilMatch, xt as stepRefId, y as resolveOutputMessageSkippingCompletionChecks, yn as createTimeoutAbortSignal, yt as predicateReadsState, z as removeTrailingAssistantGuardContinuations, zt as stateColumnsWrite } from "./stream-1DGoEkG2.js";
7
+ import { $ as summarizeToolChoiceForSpan, $t as commitToolResult, A as isSignalChunkExcluded, An as safeEnqueue, At as getSnapshotMemoryInfo, B as removeTrailingAssistantGuardContinuations, Bt as stateColumnsWrite, C as stampChunkProducedAt, Cn as guardStreamWithAbort, D as isStructuredOutputError, Dt as validateTemplate, E as escapeUnescapedControlCharsInJsonStrings, En as settledOrElapsed, Et as traverseMappingPath, F as endOutputStreamSpanOutsideStep, Ft as latestStepResults, G as FLUSH_HELD_PARTS_KEY, Gt as diffStateAsJson, Ht as unusedStateEntries, I as findOwnModelStepSpan, It as materializeState, J as withoutHeldContent, K as REPROCESS_PART_KEY, Kt as patchState, Lt as materializeWorkflowRun, M as ProcessorRunner, Mn as createRunScope, N as ProcessorState, Nn as createRunScopeKey, Nt as applyStateColumnsWrite, O as asJsonSchema, On as MastraModelInput, Ot as getStepResult, P as endOutputStreamSpanAtStepEnd, Pt as isStateCheckpointDue, Q as summarizeProcessorToolsForSpan, R as isTrailingAssistantGuardContinuation, Rt as pickStateKeys, S as getChunkProducedAt, Sn as guardStreamUntilMatch, St as stepRefId, T as createOutputHandler, Tn as raceAgainstAbort, Tt as templateReadsState, Ut as applyStatePatch, V as ProviderHistoryCompat, Vt as summarizeStepResult, X as summarizeProcessorModelForSpan, Y as summarizeActiveToolsForSpan, Yt as isObservationalMemoryEnabled$1, Z as summarizeProcessorResultForSpan, Zt as parseMemoryRequestContext, _ as persistProcessorDataChunk, _n as DEADLINE_SAVE_CLAIM_HOLD_MS, _t as stubStepResult, a as convertFullStreamChunkToMastra, an as snapshotToolResult, at as PROCESSOR_ABORT_SIGNAL, b as resolveOutputMessageSkippingCompletionChecks, bn as createTimeoutAbortSignal, bt as predicateReadsState, c as WorkflowRunOutput, cn as validationErrorModelOutput, ct as getHydratedStepResult, d as MastraModelOutput, dn as resolveSuspendedToolRunId, dt as lazyStepResults, en as computeModelOutputProviderMetadata, et as resolveProcessorSpanAttributes, f as clearStepPartIndexes, fn as resolveThreadIdFromArgs, ft as loadStepResults, g as isFeedbackContinuation, gn as applyStateSignal, gt as storageV2StepResultAccessors, h as findStepPartBoundaries, hn as tryStreamWithJsonFallback, ht as residentStepResultsLoader, in as resolveModelOutputAfterToolResultProcessors, it as createProcessorSendSignal, j as OUTPUT_STREAM_HOOK_DURATION_KEY_PREFIX, jn as safeError, k as getResponseFormat, kn as safeClose, kt as getStepResultAsync, l as TripWire, ln as isProcessorWorkflow, lt as hydrateStepResults, m as findIterationOffsetInParts, mn as tryGenerateWithJsonFallback, mt as residentStepResults, nn as latestProcessedModelOutput, nt as toProcessorSpanPhase, on as withAgentWorkflowToolMarker, ot as RunJournal, p as createDestructurableOutput, pn as supportedLanguageModelSpecifications, pt as loadedStepResults, q as takeHeldParts, rn as readModelOutput, rt as PROCESSOR_LATE_SIGNAL_SINK, s as MastraAgentNetworkStream, sn as normalizeModelOutput, st as buildStepResultAccessors, tn as hasToolResultProcessor, tt as resolveProcessorSpanName, u as getModelOutputForTripwire, un as isSupportedLanguageModel, ut as isStepResultStub, v as reconcileBufferedStepTexts, vn as DEADLINE_SAVE_WAIT_MS, vt as collectMappingStepRefs, w as markChunkOutputProcessed, wn as isMastraTimeoutError, wt as resolveTemplate, x as resolveProcessorWriterMessageId, xn as getAbortReason, xt as resolveStepOutputs, y as resolveMessageText, yn as MastraTimeoutError, yt as collectPredicateStepRefs, z as needsTrailingAssistantGuard, zt as stateBaseOf } from "./stream-CoQTdzLm.js";
8
8
  import { c as MASTRA_THREAD_ID_KEY, d as isReservedRequestContextKey, f as mergeVersionOverrides$1, l as MASTRA_VERSIONS_KEY, n as MASTRA_AUTH_TOKEN_KEY, o as MASTRA_RESOURCE_ID_KEY, p as withoutLiveRequestKeys, r as MASTRA_INHERITED_MEMORY_KEY, s as MASTRA_SCOPES_KEY, t as MASTRA_CONTINUATION_TOOL_CALL_IDS_KEY, u as RequestContext } from "./request-context-COnZHt2-.js";
9
9
  import { S as withAck, _ as serializeError$1, h as stripModelSnapshots, n as PublisherQueueLimitError, p as slimNestedAgentChunks, r as CachingPubSub, t as DefaultStepResult, u as isRunLocalTopic, v as EventEmitterPubSub, x as isLeaseProvider, y as NoopLeaseProvider } from "./output-helpers-CVzhy1Y0.js";
10
- import { A as stableStringify$1, E as removeWorkingMemoryTags, P as embed$3, Z as preserveResponseItemIdsOnMerge, a as isTerminalToolInvocationState, c as withUnavailableAttachmentUrls, d as aiV5UIMessagesToAIV5ModelMessages, f as coreContentToString, i as isClientToolInvocationUpdate, l as isDownloadAssetsError, m as filterMessagesForPersistence, n as MessageList, ot as normalizeToolOutput, p as messagesAreEqual, r as advancesToolInvocationState, s as unavailableAttachmentPlaceholder, t as convertMessages, u as MessageMerger } from "./message-list-BGm1DCiG.js";
10
+ import { A as stableStringify$1, E as removeWorkingMemoryTags, P as embed$3, Z as preserveResponseItemIdsOnMerge, a as isTerminalToolInvocationState, c as withUnavailableAttachmentUrls, d as aiV5UIMessagesToAIV5ModelMessages, f as coreContentToString, i as isClientToolInvocationUpdate, l as isDownloadAssetsError, m as filterMessagesForPersistence, n as MessageList, ot as normalizeToolOutput, p as messagesAreEqual, r as advancesToolInvocationState, s as unavailableAttachmentPlaceholder, t as convertMessages, u as MessageMerger } from "./message-list-RgFlLrxG.js";
11
11
  import { Bt as listScoresArgsSchema, Ft as listLogsArgsSchema, Lt as listMetricsArgsSchema, Nt as listFeedbackArgsSchema, t as EntityType } from "./storage-Cc50aQAp.js";
12
12
  import { a as getOrCreateSpan, f as resolveCurrentSpan, l as getTimeToFirstChunkMs, n as executeWithContextSync, o as getResumeTracingContext, p as resolveExportedSpanId, s as getRootExportSpan, t as executeWithContext, u as getWorkflowResumeTracingContext } from "./utils-DU_pU5SK.js";
13
13
  import { i as setSpanErrorOrigin, n as getSpanErrorOrigin } from "./error-count-BH-rJW7q.js";
14
- import { a as ModelRouterLanguageModel, d as attachModelStreamTransport, f as isDataChunk, i as resolveModelConfig, n as ModelRouterEmbeddingModel, o as resolveApiProviderId, p as readModelStreamTransport } from "./llm-CytL7cpw.js";
14
+ import { a as ModelRouterLanguageModel, d as attachModelStreamTransport, f as isDataChunk, i as resolveModelConfig, n as ModelRouterEmbeddingModel, o as resolveApiProviderId, p as readModelStreamTransport } from "./llm-zjtMQn7M.js";
15
15
  import { a as withToolPayloadTransformMetadata, i as transformToolPayloadForTargets, n as hasTransformedToolPayload, o as withToolPayloadTransformProviderMetadata, r as normalizeToolPayloadTransformPolicy, t as getTransformedToolPayload } from "./payload-transform-Dj3HUeD4.js";
16
16
  import { boundedStringify, ensureSerializable, safeStringify } from "./utils/safe-stringify.js";
17
17
  import { d as signalSpanAttributes, h as signalToXmlMarkup, l as mastraDBMessageToSignal, n as createSignal, o as isMastraSignalMessage, s as isTransientSignalMessage, u as resolveDeliveryAttributes } from "./signals-CqR_iWkg.js";
@@ -24,13 +24,13 @@ import { _ as getRequestContextInputValues, a as getModelFacingValidationError,
24
24
  import { a as isApprovalExempt, c as isProviderDefinedTool, d as markAgentWorkflowTool, f as markApprovalExempt, l as isProviderTool, n as getNeedsApprovalFn, o as isBuiltBeforeApproval, r as getProviderToolName, s as isMastraTool, t as getBeforeApprovalFn } from "./toolchecks-DrsZdc3S.js";
25
25
  import { a as waitDelay, i as getRetryAfterMs, n as DEFAULT_MAX_RETRY_AFTER_MS, r as clampDelayMs } from "./fetchWithRetry-DFSvpYDT.js";
26
26
  import { i as hasFreeFormObject } from "./model-DS-b2R-R.js";
27
- import { c as modelSupportsStructuredOutput, l as modelSupportsTemperature } from "./provider-registry-CP_5SNiw.js";
27
+ import { c as modelSupportsStructuredOutput, l as modelSupportsTemperature } from "./provider-registry-DdQoO_jd.js";
28
28
  import { t as InMemoryServerCache } from "./inmemory-BK3zLwvM.js";
29
29
  import { n as resolveDynamicArgument, t as getRequestUser } from "./dynamic-argument-BzPK3qPN.js";
30
- import { t as MastraLLMV1 } from "./model-DyQ07rPH.js";
31
- import { A as eagerToolCallDidNotExecute, D as EagerToolExecutionCoordinator, E as EAGER_TOOL_EXECUTION_MARKER, F as hasRunningRunStep, I as isRunStepActive, L as setRunLeaseFence, M as isEagerlyExecutableToolCall, N as TOOL_ABORT_NOTICE, O as EagerToolExecutionNotRun, P as clearRunLeaseFence, R as startRunStep, S as selectFields, T as EAGER_TOOL_BAILOUT, a as ensureToolProperties, b as removeUndefinedValues, d as makeCoreTool, i as delay$1, j as eagerToolCallSuspensionIntent, k as eagerToolCallAlreadyAnnouncedInput, n as createMastraProxy, o as generateEmptyFromSchema, p as makeProcessorCoreTool, r as deepMerge$1, v as readPositiveIntEnv, w as EAGER_TOOL_ABORT_SIGNAL, y as rebindProcessorTools, z as whenRunStepsSettle } from "./utils-C55ZdVaj.js";
30
+ import { t as MastraLLMV1 } from "./model-DIzIjDej.js";
31
+ import { A as eagerToolCallDidNotExecute, D as EagerToolExecutionCoordinator, E as EAGER_TOOL_EXECUTION_MARKER, F as hasRunningRunStep, I as isRunStepActive, L as setRunLeaseFence, M as isEagerlyExecutableToolCall, N as TOOL_ABORT_NOTICE, O as EagerToolExecutionNotRun, P as clearRunLeaseFence, R as startRunStep, S as selectFields, T as EAGER_TOOL_BAILOUT, a as ensureToolProperties, b as removeUndefinedValues, d as makeCoreTool, i as delay$1, j as eagerToolCallSuspensionIntent, k as eagerToolCallAlreadyAnnouncedInput, n as createMastraProxy, o as generateEmptyFromSchema, p as makeProcessorCoreTool, r as deepMerge$1, v as readPositiveIntEnv, w as EAGER_TOOL_ABORT_SIGNAL, y as rebindProcessorTools, z as whenRunStepsSettle } from "./utils-B-3lET9S.js";
32
32
  import { h as getWorkflowFGAResourceId, i as MastraFGAPermissions, y as requireFGA } from "./ee-iTj2bRDt-By_B9ngH.js";
33
- import { c as createBackgroundTask, o as resolveBackgroundConfig, s as sanitizeToolArguments, t as generateBackgroundTaskSystemPrompt } from "./background-tasks-CgzXjBfE.js";
33
+ import { c as createBackgroundTask, o as resolveBackgroundConfig, s as sanitizeToolArguments, t as generateBackgroundTaskSystemPrompt } from "./background-tasks-BcU--rXL.js";
34
34
  import { t as ToolStream } from "./stream-D9JOykz7.js";
35
35
  import { MISSING, collectInvalidPredicatePaths, createPredicateEvaluator, derivePredicateLabel, normalizePredicatePath, walk } from "./predicate/index.js";
36
36
  import { Classifier } from "./classifier/index.js";
@@ -42,7 +42,7 @@ import { A as writeObjective, D as readObjective, O as resolveEffectiveGoalSetti
42
42
  import { An as computeTraceStatus, Cr as extractTrajectory, Dr as saveScorePayloadSchema, It as TABLE_SCHEMAS, Lt as TABLE_SCORERS, Nn as extractBranchSpans, Pn as getBranchArgsSchema, Qn as listTracesArgsSchema, Sr as withBufferedReflectionVerified, Tr as extractWorkflowTrajectory, Yn as listBranchesArgsSchema, _r as isAppendOnlySince, ar as spanRecordSchema, br as maxObservationCursor, cr as toTraceSpans, gn as BRANCH_SPAN_TYPE_SET, gr as compareObservationalMemoryHeadOrder, hr as assertActiveObservationsApplied, or as toLightSpanRecord, pn as matchesExpectedWorkflowStatus, qn as isPreviewTruncated, sr as toTraceSpan, vn as TraceStatus, vr as isBufferedChunkCoveredByCursor, wr as extractTrajectoryFromTrace, xr as planReflectionGenerationText, yr as isBufferedReflectionUnchangedSince } from "./constants-CFWgIaqA.js";
43
43
  import { t as GoalSignalProvider } from "./signal-provider-BslnAjWG.js";
44
44
  import { t as slugify } from "./slugify-BUNmb-Ga.js";
45
- import { F as LocalSandbox, at as evaluateReadRecord, c as Workspace, dt as WORKSPACE_TOOLS, g as resolveToolConfig, gt as shellQuote, h as createWorkspaceTools, ht as sliceByTokens, l as createSkillTools, lt as CompositeFilesystem, mt as estimateTokenCount, ot as normalizeReadTrackerPath, pt as sliceByTokensSafe, st as LocalFilesystem } from "./workspace-DOAil8mG.js";
45
+ import { F as LocalSandbox, at as evaluateReadRecord, c as Workspace, dt as WORKSPACE_TOOLS, g as resolveToolConfig, gt as shellQuote, h as createWorkspaceTools, ht as sliceByTokens, l as createSkillTools, lt as CompositeFilesystem, mt as estimateTokenCount, ot as normalizeReadTrackerPath, pt as sliceByTokensSafe, st as LocalFilesystem } from "./workspace-CnmmMou8.js";
46
46
  import { i as normalizeWebSearchProvider, n as createWebSearchProviderTool, r as isWebSearchTool } from "./tools-tPy2FwMI.js";
47
47
  import { D as BM25Index, O as tokenize } from "./workspace-skills-38OY32_b.js";
48
48
  import { f as calculatePagination, g as InMemoryThreadStateStorage, h as resolveListOrderBy, m as normalizePerPage, p as compareByField, s as StorageDomain, u as MastraCompositeStore } from "./filesystem-versioned-BL1ojJLo.js";
@@ -39196,6 +39196,29 @@ function knowledgePageKeyProblem(key) {
39196
39196
  if (!key) return "Knowledge page key must not be empty";
39197
39197
  if (/[/#%]/.test(key)) return `Knowledge page key "${key}" must not contain "/", "#" or "%"`;
39198
39198
  }
39199
+ const isRowWrite = (write) => write.op === "create" || write.op === "update" || write.op === "move" || write.op === "delete";
39200
+ /**
39201
+ * Throws unless the batch holds `applyPageWrites`' first rule: at most one create, one move and one
39202
+ * delete per page, no create, update or move of a page the batch deletes, and at most one write
39203
+ * per note (stores apply note removals before additions, so two writes of one note can't keep
39204
+ * input order).
39205
+ */
39206
+ function assertKnowledgePageWritesBatchable(writes) {
39207
+ const rows = /* @__PURE__ */ new Map();
39208
+ const notes = /* @__PURE__ */ new Map();
39209
+ for (const write of writes) {
39210
+ if (isRowWrite(write)) rows.set(write.id, [...rows.get(write.id) ?? [], write.op]);
39211
+ if ((write.op === "add-note" || write.op === "remove-note") && write.id !== void 0) {
39212
+ const seen = notes.get(write.id);
39213
+ if (seen !== void 0) throw new Error(`Knowledge page writes can't apply ${seen}, ${write.op} to note ${write.id} in one batch`);
39214
+ notes.set(write.id, write.op);
39215
+ }
39216
+ }
39217
+ for (const [id, ops] of rows) {
39218
+ const count = (op) => ops.filter((o) => o === op).length;
39219
+ if (count("create") > 1 || count("move") > 1 || count("delete") > 1 || count("delete") === 1 && ops.length > 1) throw new Error(`Knowledge page writes can't apply ${ops.join(", ")} to page ${id} in one batch`);
39220
+ }
39221
+ }
39199
39222
  // src/storage/domains/knowledge/pages.ts
39200
39223
  /**
39201
39224
  * Knowledge storage contract, schema 4: pages, notes, stamps, mentions, body links and pins.
@@ -40033,6 +40056,10 @@ var InMemoryKnowledgeImportersStorage = class extends KnowledgeImportersStorage
40033
40056
  const node = [...this.#s.nodes.values()].find((n) => n.pageId === pageId);
40034
40057
  return node ? structuredClone(node) : null;
40035
40058
  }
40059
+ async getNodesByPages(pageIds) {
40060
+ const pages = new Set(pageIds);
40061
+ return [...this.#s.nodes.values()].filter((n) => pages.has(n.pageId)).map((n) => structuredClone(n));
40062
+ }
40036
40063
  async saveNode(node) {
40037
40064
  const owner = [...this.#s.nodes.values()].find((n) => n.pageId === node.pageId);
40038
40065
  if (owner && (owner.bindingId !== node.bindingId || owner.sourceId !== node.sourceId)) throw new Error(`Knowledge page ${node.pageId} is already mapped to another imported node`);
@@ -40044,6 +40071,22 @@ var InMemoryKnowledgeImportersStorage = class extends KnowledgeImportersStorage
40044
40071
  async deleteNode(bindingId, sourceId) {
40045
40072
  this.#s.nodes.delete(key(bindingId, sourceId));
40046
40073
  }
40074
+ async writeNodes(input) {
40075
+ const next = new Map(this.#s.nodes);
40076
+ for (const d of input.deletes) next.delete(key(d.bindingId, d.sourceId));
40077
+ const updatedAt = /* @__PURE__ */ new Date();
40078
+ for (const node of input.saves) next.set(key(node.bindingId, node.sourceId), structuredClone({
40079
+ ...node,
40080
+ updatedAt
40081
+ }));
40082
+ const byPage = /* @__PURE__ */ new Map();
40083
+ for (const [k, node] of next) {
40084
+ const other = byPage.get(node.pageId);
40085
+ if (other !== void 0 && other !== k) throw new Error(`Knowledge page ${node.pageId} is already mapped to another imported node`);
40086
+ byPage.set(node.pageId, k);
40087
+ }
40088
+ this.#s.nodes = next;
40089
+ }
40047
40090
  async listNodes(bindingId, options = {}) {
40048
40091
  const limit = options.limit ?? 500;
40049
40092
  const nodes = [...this.#s.nodes.values()].filter((n) => n.bindingId === bindingId && (options.after === void 0 || byteOrder(n.sourceId, options.after) > 0) && (!options.unsettled || n.unsettled)).sort((a, b) => byteOrder(a.sourceId, b.sourceId));
@@ -40096,6 +40139,9 @@ var InMemoryKnowledgeImportersStorage = class extends KnowledgeImportersStorage
40096
40139
  change: structuredClone(change)
40097
40140
  });
40098
40141
  }
40142
+ async recordRunChanges(changes) {
40143
+ for (const change of changes) await this.recordRunChange(change);
40144
+ }
40099
40145
  async listRunChanges(runId, options = {}) {
40100
40146
  const limit = options.limit ?? 500;
40101
40147
  const after = options.after === void 0 ? 0 : Number(options.after);
@@ -40441,10 +40487,53 @@ var InMemoryKnowledgePageStore = class {
40441
40487
  }
40442
40488
  return page && this.#pageReadable(page, input.read) ? clone$1(page) : null;
40443
40489
  }
40490
+ async getPageChains(input) {
40491
+ const ids = [...new Set(input.ids)];
40492
+ const chains = await Promise.all(ids.map((id) => this.getPageParents({
40493
+ parentId: id,
40494
+ read: input.read
40495
+ })));
40496
+ return Object.fromEntries(ids.map((id, i) => [id, chains[i]]));
40497
+ }
40498
+ async getPagesByPaths(input) {
40499
+ return Promise.all(input.paths.map((path) => this.getPageByPath({
40500
+ scopeId: input.scopeId,
40501
+ path,
40502
+ read: input.read
40503
+ })));
40504
+ }
40505
+ async getLastChildPositions(input) {
40506
+ return Object.fromEntries([...new Set(input.parentIds)].map((id) => [id, this.#children(id).sort(byPosition).at(-1)?.position ?? null]));
40507
+ }
40508
+ async getPageSubtrees(input) {
40509
+ const out = Object.fromEntries(input.rootIds.map((id) => [id, null]));
40510
+ for (const rootId of new Set(input.rootIds)) {
40511
+ const pages = [];
40512
+ for (let i = -1; i < pages.length && pages.length <= input.limit; i++) {
40513
+ const parentId = i < 0 ? rootId : pages[i].id;
40514
+ pages.push(...this.#children(parentId).filter((page) => !page.isScope));
40515
+ }
40516
+ out[rootId] = pages.length > input.limit ? null : pages.map(clone$1);
40517
+ }
40518
+ return out;
40519
+ }
40520
+ async listNotesByPages(input) {
40521
+ const notes = Object.fromEntries([...new Set(input.pageIds)].map((id) => [id, []]));
40522
+ for (const note of [...this.#notes.values()].sort(oldestFirst)) if (Object.hasOwn(notes, note.pageId) && !note.deletedAt && this.#noteVisible(note, input.read)) notes[note.pageId].push(clone$1(note));
40523
+ return notes;
40524
+ }
40444
40525
  async findPagesByName(input) {
40445
40526
  const name = canonicalKnowledgeName(input.name);
40446
40527
  return [...this.#pages.values()].filter((page) => !page.deletedAt && canonicalKnowledgeName(page.name) === name && (input.scopeId === void 0 || page.scopeId === input.scopeId) && this.#pageReadable(page, input.read)).sort(newestFirst).slice(0, pageSize(input.limit)).map(clone$1);
40447
40528
  }
40529
+ async findPagesByNames(input) {
40530
+ const names = [...new Set(input.names)];
40531
+ const found = await Promise.all(names.map((name) => this.findPagesByName({
40532
+ ...input,
40533
+ name
40534
+ })));
40535
+ return Object.fromEntries(names.map((name, i) => [name, found[i]]));
40536
+ }
40448
40537
  async listChildPages(input) {
40449
40538
  const { items, nextCursor } = paginate(this.#children(input.parentId).filter((page) => !page.isScope && this.#pageReadable(page, input.read)).sort(byPosition), input.cursor, input.limit);
40450
40539
  return {
@@ -40540,6 +40629,63 @@ var InMemoryKnowledgePageStore = class {
40540
40629
  ...nextCursor ? { nextCursor } : {}
40541
40630
  };
40542
40631
  }
40632
+ /** The single writes, one by one in input order; all undone if one fails. */
40633
+ async applyPageWrites(input) {
40634
+ assertKnowledgePageWritesBatchable(input.writes);
40635
+ const before = this.snapshot();
40636
+ try {
40637
+ for (const write of input.writes) switch (write.op) {
40638
+ case "create": {
40639
+ const { op: _op, scopeId: _scope, depth: _depth, ...create } = write;
40640
+ await this.createPage(create);
40641
+ break;
40642
+ }
40643
+ case "update": {
40644
+ const { op: _op, scopeId: _scope, ...update } = write;
40645
+ await this.updatePage(update);
40646
+ break;
40647
+ }
40648
+ case "move": {
40649
+ const { op: _op, scopeId: _scope, fromScopeId: _from, depth: _depth, ...move } = write;
40650
+ await this.movePage(move);
40651
+ break;
40652
+ }
40653
+ case "delete":
40654
+ await this.deletePage({
40655
+ id: write.id,
40656
+ expectedVersion: write.expectedVersion,
40657
+ deletedBy: write.deletedBy
40658
+ });
40659
+ break;
40660
+ case "add-note": {
40661
+ const { op: _op, scopeId: _scope, ...note } = write;
40662
+ await this.addNote(note);
40663
+ break;
40664
+ }
40665
+ case "remove-note": {
40666
+ const note = await this.getNote({
40667
+ id: write.id,
40668
+ read: "all",
40669
+ includeDeleted: true
40670
+ });
40671
+ if (note && note.pageId !== write.pageId) throw new KnowledgeConflictError(write.id);
40672
+ await this.removeNote({
40673
+ id: write.id,
40674
+ deletedBy: write.deletedBy,
40675
+ provenance: write.provenance
40676
+ });
40677
+ break;
40678
+ }
40679
+ case "replace-links": await this.replacePageBodyLinks({
40680
+ pageId: write.pageId,
40681
+ links: write.links
40682
+ });
40683
+ }
40684
+ } catch (error) {
40685
+ this.restore(before);
40686
+ throw error;
40687
+ }
40688
+ }
40543
40689
  async createPage(input) {
40544
40690
  const parent = this.#livePage(input.parentId);
40545
40691
  const scopeId = parent.isScope ? parent.id : parent.scopeId;
@@ -40938,6 +41084,24 @@ var InMemoryKnowledgeStorage = class extends KnowledgeStorage {
40938
41084
  getPageParents(input) {
40939
41085
  return this.#pageStore.getPageParents(input);
40940
41086
  }
41087
+ getPageChains(input) {
41088
+ return this.#pageStore.getPageChains(input);
41089
+ }
41090
+ getPagesByPaths(input) {
41091
+ return this.#pageStore.getPagesByPaths(input);
41092
+ }
41093
+ getLastChildPositions(input) {
41094
+ return this.#pageStore.getLastChildPositions(input);
41095
+ }
41096
+ getPageSubtrees(input) {
41097
+ return this.#pageStore.getPageSubtrees(input);
41098
+ }
41099
+ listNotesByPages(input) {
41100
+ return this.#pageStore.listNotesByPages(input);
41101
+ }
41102
+ applyPageWrites(input) {
41103
+ return this.#pageStore.applyPageWrites(input);
41104
+ }
40941
41105
  listScopeDeclarations() {
40942
41106
  return this.#pageStore.listScopeDeclarations();
40943
41107
  }
@@ -40950,6 +41114,9 @@ var InMemoryKnowledgeStorage = class extends KnowledgeStorage {
40950
41114
  getPageByPath(input) {
40951
41115
  return this.#pageStore.getPageByPath(input);
40952
41116
  }
41117
+ findPagesByNames(input) {
41118
+ return this.#pageStore.findPagesByNames(input);
41119
+ }
40953
41120
  findPagesByName(input) {
40954
41121
  return this.#pageStore.findPagesByName(input);
40955
41122
  }
@@ -53711,6 +53878,13 @@ async function syncKnowledgePageBodyLinks(storage, page, resolver = new BodyLink
53711
53878
  }
53712
53879
  /** The ref keys a page answers to now: its id, name, scope address and `scope#key/key` path. */
53713
53880
  async function pageRefKeys(storage, page) {
53881
+ return refKeysOf(page, !page.isScope && page.key && page.parentId ? await storage.getPageParents({
53882
+ parentId: page.parentId,
53883
+ read: "all"
53884
+ }) : []);
53885
+ }
53886
+ /** {@link pageRefKeys} from the page's parents as `getPageParents` gives them. */
53887
+ function refKeysOf(page, parents) {
53714
53888
  const keys = [knowledgeLinkRefKey(page.id), knowledgeLinkRefKey(page.name)];
53715
53889
  if (page.isScope) {
53716
53890
  if (page.address) keys.push(knowledgeLinkRefKey(page.address));
@@ -53718,10 +53892,7 @@ async function pageRefKeys(storage, page) {
53718
53892
  }
53719
53893
  if (!page.key || !page.parentId) return keys;
53720
53894
  const path = [];
53721
- for (const current of [page, ...await storage.getPageParents({
53722
- parentId: page.parentId,
53723
- read: "all"
53724
- })]) {
53895
+ for (const current of [page, ...parents]) {
53725
53896
  if (current.isScope) {
53726
53897
  if (current.address) keys.push(knowledgeLinkRefKey(`${current.address}#${path.join("/")}`));
53727
53898
  return keys;
@@ -53870,6 +54041,203 @@ async function reindexKnowledgeLinks(storage) {
53870
54041
  } while (cursor);
53871
54042
  return count;
53872
54043
  }
54044
+ /**
54045
+ * A batched link repair that would stop at a cap the op-by-op refreshes enforce one write at a time
54046
+ * (linking pages, namesakes, refs looked up, subtree size): the caller saves op by op instead, so the
54047
+ * caps apply exactly as they do there.
54048
+ */
54049
+ var KnowledgeLinkRepairUnsupportedError = class extends Error {
54050
+ reason;
54051
+ constructor(reason) {
54052
+ super(`batched link repair: ${reason}`);
54053
+ this.reason = reason;
54054
+ this.name = "KnowledgeLinkRepairUnsupportedError";
54055
+ }
54056
+ };
54057
+ /** True when the store has every set-based read and write {@link repairKnowledgeLinks} uses. */
54058
+ function canRepairKnowledgeLinksInBatch(storage) {
54059
+ return !!(storage.getPageChains && storage.getPagesByPaths && storage.getPageSubtrees && storage.findPagesByNames && storage.applyPageWrites);
54060
+ }
54061
+ /**
54062
+ * Every {@link syncKnowledgePageBodyLinks} and {@link refreshKnowledgeLinksTo} of a flush, run once
54063
+ * over the store as the flush left it, in a fixed number of statements: each page's links come out
54064
+ * as they do when the calls run one after another after the writes. Throws
54065
+ * {@link KnowledgeLinkRepairUnsupportedError}, having written nothing, when a cap could bite.
54066
+ */
54067
+ async function repairKnowledgeLinks(storage, repair) {
54068
+ const synced = new Map(repair.synced.map((page) => [page.id, page]));
54069
+ if (!synced.size && !repair.refreshed.length) return;
54070
+ const roots = repair.refreshed.filter((item) => item.withDescendants).map((item) => item.page.id);
54071
+ const subtrees = roots.length ? await storage.getPageSubtrees({
54072
+ rootIds: [...new Set(roots)],
54073
+ limit: 500
54074
+ }) : {};
54075
+ const affected = [];
54076
+ for (const { page, withDescendants } of repair.refreshed) {
54077
+ affected.push(page);
54078
+ if (!withDescendants) continue;
54079
+ const under = subtrees[page.id];
54080
+ if (!under) throw new KnowledgeLinkRepairUnsupportedError("a moved subtree past the move limit");
54081
+ affected.push(...under);
54082
+ }
54083
+ const parentIds = affected.flatMap((page) => !page.isScope && page.key && page.parentId ? [page.parentId] : []);
54084
+ const chains = parentIds.length ? await storage.getPageChains({
54085
+ ids: [...new Set(parentIds)],
54086
+ read: "all"
54087
+ }) : {};
54088
+ const refs = /* @__PURE__ */ new Set();
54089
+ const targets = new Set(affected.map((page) => page.id));
54090
+ const names = /* @__PURE__ */ new Set();
54091
+ for (const page of affected) {
54092
+ const parents = !page.isScope && page.key && page.parentId ? chains[page.parentId] ?? [] : [];
54093
+ for (const key of refKeysOf(page, parents)) refs.add(key);
54094
+ if (!page.deletedAt) names.add(page.name);
54095
+ }
54096
+ if (names.size) {
54097
+ const namesakes = await storage.findPagesByNames({
54098
+ names: [...names],
54099
+ read: "all",
54100
+ limit: 100
54101
+ });
54102
+ for (const found of Object.values(namesakes)) {
54103
+ if (found.length > MAX_KNOWLEDGE_LINK_REFRESH_NAMESAKES) throw new KnowledgeLinkRepairUnsupportedError("a name past the namesake limit");
54104
+ for (const namesake of found) targets.add(namesake.id);
54105
+ }
54106
+ }
54107
+ const sources = affected.length ? await storage.listPageBodyLinkSources({
54108
+ refs: [...refs],
54109
+ toPageIds: [...targets]
54110
+ }) : [];
54111
+ if (sources.length > 100) throw new KnowledgeLinkRepairUnsupportedError("linking pages past the refresh limit");
54112
+ const unread = sources.filter((id) => !synced.has(id));
54113
+ const live = new Map((unread.length ? await storage.getPages({
54114
+ ids: unread,
54115
+ read: "all"
54116
+ }) : []).map((page) => [page.id, page]));
54117
+ const rewrite = /* @__PURE__ */ new Map();
54118
+ for (const id of unread) rewrite.set(id, live.get(id) ?? null);
54119
+ for (const [id, page] of synced) rewrite.set(id, page);
54120
+ const wanted = /* @__PURE__ */ new Map();
54121
+ const lookups = [];
54122
+ const refreshing = new Set(sources);
54123
+ let looked = 0;
54124
+ for (const [id, page] of rewrite) {
54125
+ const byKey = /* @__PURE__ */ new Map();
54126
+ if (page && !page.deletedAt) for (const [ref, count] of knowledgeBodyLinkRefs(page.body)) {
54127
+ const key = knowledgeLinkRefKey(ref);
54128
+ if (key.length > 512) continue;
54129
+ const entry = byKey.get(key);
54130
+ if (entry) entry.count += count;
54131
+ else byKey.set(key, {
54132
+ ref,
54133
+ count
54134
+ });
54135
+ }
54136
+ const entries = [...byKey];
54137
+ wanted.set(id, entries);
54138
+ if (page) for (const [, { ref }] of entries) lookups.push({
54139
+ ref,
54140
+ home: page.scopeId
54141
+ });
54142
+ if (refreshing.has(id)) looked += new Set(entries.map(([, { ref }]) => ref)).size;
54143
+ }
54144
+ if (looked >= 1e3) throw new KnowledgeLinkRepairUnsupportedError("refs looked up past the refresh limit");
54145
+ const resolved = await resolveKnowledgeBodyLinks(storage, lookups);
54146
+ await storage.applyPageWrites({ writes: [...wanted].map(([pageId, entries]) => {
54147
+ const home = rewrite.get(pageId)?.scopeId;
54148
+ return {
54149
+ op: "replace-links",
54150
+ pageId,
54151
+ links: entries.map(([key, { ref, count }]) => ({
54152
+ ref: key,
54153
+ toPageId: home === void 0 ? null : resolved.get(`${home}\u0000${ref}`) ?? null,
54154
+ count
54155
+ }))
54156
+ };
54157
+ }) });
54158
+ }
54159
+ /** What {@link BodyLinkResolver} answers for each `(home, ref)`, keyed `home\0ref`, in a fixed number of reads. */
54160
+ async function resolveKnowledgeBodyLinks(storage, lookups) {
54161
+ const answers = /* @__PURE__ */ new Map();
54162
+ if (!lookups.length) return answers;
54163
+ const keyOf = (home, ref) => `${home}\u0000${ref}`;
54164
+ const byId = new Set((await storage.getPages({
54165
+ ids: [...new Set(lookups.map((item) => item.ref))],
54166
+ read: "all"
54167
+ })).map((page) => page.id));
54168
+ const remaining = lookups.filter(({ ref, home }) => {
54169
+ if (!byId.has(ref)) return true;
54170
+ answers.set(keyOf(home, ref), ref);
54171
+ return false;
54172
+ });
54173
+ const paths = /* @__PURE__ */ new Map();
54174
+ const addresses = /* @__PURE__ */ new Set();
54175
+ for (const { ref } of remaining) if (ref.indexOf("#") > 0) {
54176
+ const parsed = parseKnowledgePageRef(ref);
54177
+ paths.set(ref, parsed);
54178
+ if (parsed) addresses.add(parsed.scope);
54179
+ } else addresses.add(ref);
54180
+ const scopes = /* @__PURE__ */ new Map();
54181
+ if (addresses.size) {
54182
+ for (const scope of await storage.getScopesByAddress([...addresses])) if (!scope.deletedAt && scope.address) scopes.set(scope.address, scope.id);
54183
+ }
54184
+ const pathsByScope = /* @__PURE__ */ new Map();
54185
+ for (const [ref, parsed] of paths) {
54186
+ const scopeId = parsed && scopes.get(parsed.scope);
54187
+ if (!scopeId) continue;
54188
+ if (!pathsByScope.has(scopeId)) pathsByScope.set(scopeId, /* @__PURE__ */ new Map());
54189
+ pathsByScope.get(scopeId).set(ref, parsed.path);
54190
+ }
54191
+ const pathAnswers = /* @__PURE__ */ new Map();
54192
+ for (const [scopeId, refs] of pathsByScope) {
54193
+ const found = await storage.getPagesByPaths({
54194
+ scopeId,
54195
+ paths: [...refs.values()],
54196
+ read: "all"
54197
+ });
54198
+ [...refs.keys()].forEach((ref, i) => pathAnswers.set(ref, found[i]?.id ?? null));
54199
+ }
54200
+ const namesByHome = /* @__PURE__ */ new Map();
54201
+ for (const { ref, home } of remaining) {
54202
+ if (paths.has(ref)) {
54203
+ answers.set(keyOf(home, ref), pathAnswers.get(ref) ?? null);
54204
+ continue;
54205
+ }
54206
+ const scopeId = scopes.get(ref);
54207
+ if (scopeId) {
54208
+ answers.set(keyOf(home, ref), scopeId);
54209
+ continue;
54210
+ }
54211
+ if (!namesByHome.has(home)) namesByHome.set(home, /* @__PURE__ */ new Set());
54212
+ namesByHome.get(home).add(ref);
54213
+ }
54214
+ const anywhere = /* @__PURE__ */ new Map();
54215
+ for (const [home, names] of namesByHome) {
54216
+ const found = await storage.findPagesByNames({
54217
+ names: [...names],
54218
+ read: "all",
54219
+ scopeId: home,
54220
+ limit: 2
54221
+ });
54222
+ for (const name of names) {
54223
+ const inHome = found[name] ?? [];
54224
+ if (inHome.length) answers.set(keyOf(home, name), inHome.length === 1 ? inHome[0].id : null);
54225
+ else anywhere.set(name, [...anywhere.get(name) ?? [], home]);
54226
+ }
54227
+ }
54228
+ if (anywhere.size) {
54229
+ const found = await storage.findPagesByNames({
54230
+ names: [...anywhere.keys()],
54231
+ read: "all",
54232
+ limit: 2
54233
+ });
54234
+ for (const [name, homes] of anywhere) {
54235
+ const pages = found[name] ?? [];
54236
+ for (const home of homes) answers.set(keyOf(home, name), pages.length === 1 ? pages[0].id : null);
54237
+ }
54238
+ }
54239
+ return answers;
54240
+ }
53873
54241
  // ../_vendored/ai_v7/dist/dist-C-C3A1Ts.js
53874
54242
  /**
53875
54243
  * Symbol used for identifying AI SDK Error instances.
@@ -74089,6 +74457,25 @@ function makeSaveQueueManager(memory, runId, mastra) {
74089
74457
  onSaved: recordRunSavedMessages(runId)
74090
74458
  });
74091
74459
  }
74460
+ /** Rebuild a hydrated entry's starting tools for the caller of the segment now running. */
74461
+ async function rebuildToolsForSegment(mastra, entry, { runId, agentId, input, requestContext }) {
74462
+ const resolved = await resolveRunAgent(mastra, agentId, runId, input.agentVersionId);
74463
+ entry.baseTools = await (isDurableAgentLike(resolved) && resolved.agent !== resolved ? resolved.agent : resolved).getToolsForExecution({
74464
+ runId,
74465
+ threadId: input.state.threadId,
74466
+ resourceId: input.state.resourceId,
74467
+ requestContext,
74468
+ memoryConfig: input.state.memoryConfig,
74469
+ autoResumeSuspendedTools: input.options?.autoResumeSuspendedTools,
74470
+ clientTools: input.options?.clientTools,
74471
+ delegation: entry.delegation,
74472
+ methodType: entry.methodType ?? "stream",
74473
+ backgroundTaskEnabled: Boolean(entry.backgroundTaskManager),
74474
+ backgroundTaskPolicy: input.options?.backgroundTaskPolicy,
74475
+ model: entry.model
74476
+ });
74477
+ return entry.baseTools;
74478
+ }
74092
74479
  /**
74093
74480
  * The run's `requestContextEntries` as handed to scorers (`customContext`), with
74094
74481
  * the signed-in user taken from the live run-level context rather than the
@@ -74228,10 +74615,23 @@ async function resolveRuntimeDependencies(options) {
74228
74615
  let errorProcessors = globalEntry?.errorProcessors;
74229
74616
  let processorStates = globalEntry?.processorStates;
74230
74617
  let rehydratedFromMastra = false;
74618
+ let toolsSegment;
74231
74619
  let rebuiltAgent;
74232
74620
  let backgroundTasks;
74233
- if (hasHydratedEntry) logger?.debug?.(`[DurableAgent:${agentId}] Using model and tools from global registry for run ${runId}`);
74234
- else if (mastra) try {
74621
+ if (hasHydratedEntry) {
74622
+ logger?.debug?.(`[DurableAgent:${agentId}] Using model and tools from global registry for run ${runId}`);
74623
+ const { stepSegment } = options;
74624
+ if (!globalEntry || stepSegment === void 0) {} else if (globalEntry.toolsSegment === void 0) globalEntry.toolsSegment = stepSegment;
74625
+ else if (globalEntry.toolsSegment !== stepSegment && mastra) {
74626
+ tools = await rebuildToolsForSegment(mastra, globalEntry, {
74627
+ runId,
74628
+ agentId,
74629
+ input,
74630
+ requestContext: restoreRequestContext(input.requestContextEntries, options.requestContext)
74631
+ });
74632
+ globalEntry.toolsSegment = stepSegment;
74633
+ }
74634
+ } else if (mastra) try {
74235
74635
  const agent = await resolveRunAgent(mastra, agentId, runId, input.agentVersionId);
74236
74636
  rebuiltAgent = isDurableAgentLike(agent) && agent.agent !== agent ? agent.agent : agent;
74237
74637
  const resolveRequestContext = restoreRequestContext(input.requestContextEntries, options.requestContext);
@@ -74274,6 +74674,7 @@ async function resolveRuntimeDependencies(options) {
74274
74674
  errorProcessors = rebuiltProcessors.errorProcessors;
74275
74675
  processorStates = rebuiltProcessors.processorStates;
74276
74676
  rehydratedFromMastra = true;
74677
+ toolsSegment = options.stepSegment;
74277
74678
  } catch (error) {
74278
74679
  if (error instanceof DurableProcessorRebuildError || error instanceof DurableAgentNotFoundError) throw error;
74279
74680
  if ((input.options?.toolsetToolNames?.length ?? 0) > 0) throw error;
@@ -74290,6 +74691,7 @@ async function resolveRuntimeDependencies(options) {
74290
74691
  const rebuilt = {
74291
74692
  isPlaceholder: false,
74292
74693
  tools,
74694
+ toolsSegment,
74293
74695
  model,
74294
74696
  modelList,
74295
74697
  workspace,
@@ -74982,11 +75384,7 @@ async function runDurableFinishSideEffects({ runId, initData, messageListState,
74982
75384
  });
74983
75385
  const steps = outputResult?.steps;
74984
75386
  const lastStep = steps?.at(-1);
74985
- const responses = messageList.get.response.db();
74986
- const reply = steps && steps.length > 1 && responses.some((msg) => {
74987
- const result = msg.content.metadata?.completionResult;
74988
- return result && typeof result === "object" && "suppressFeedback" in result && result.suppressFeedback === true;
74989
- }) ? resolveOutputMessageSkippingCompletionChecks(messageList) : void 0;
75387
+ const reply = isFeedbackContinuation(messageList, steps) ? resolveOutputMessageSkippingCompletionChecks(messageList) : void 0;
74990
75388
  const parts = reply?.content.parts;
74991
75389
  const offset = parts ? findIterationOffsetInParts(parts, lastStep?.text) : void 0;
74992
75390
  const split = reply && offset !== void 0 ? messageList.splitResponseMessageAtPartOffset(reply.id, offset) : void 0;
@@ -77226,6 +77624,7 @@ function createDurableLLMExecutionStep(_options) {
77226
77624
  messageListState: await readMessageListState(params, typedInput)
77227
77625
  },
77228
77626
  requestContext,
77627
+ stepSegment: getStepSegment(runId, params.requestContext),
77229
77628
  logger
77230
77629
  });
77231
77630
  const storeStepTranscript = () => {
@@ -83071,6 +83470,7 @@ var DurableAgenticLoopBuilder = class extends BaseAgenticLoopBuilder {
83071
83470
  }],
83072
83471
  metadata: {
83073
83472
  mode: "stream",
83473
+ iterationFeedback: true,
83074
83474
  completionResult: { suppressFeedback: true }
83075
83475
  },
83076
83476
  format: 2
@@ -84570,7 +84970,7 @@ async function prepareForDurableExecution(options) {
84570
84970
  });
84571
84971
  let tripwireData;
84572
84972
  if (inputProcessors.length > 0) try {
84573
- const { ProcessorRunner } = await import("./stream-1DGoEkG2.js").then((n) => n.I);
84973
+ const { ProcessorRunner } = await import("./stream-CoQTdzLm.js").then((n) => n.L);
84574
84974
  await new ProcessorRunner({
84575
84975
  inputProcessors,
84576
84976
  outputProcessors,
@@ -95844,8 +96244,7 @@ var Agent = class Agent extends MastraBase {
95844
96244
  scopes: Array.isArray(snapshotScopes) ? snapshotScopes : void 0
95845
96245
  };
95846
96246
  const carriedEntries = entry.requestContext ? Object.entries(withoutLiveRequestKeys(Object.fromEntries(entry.requestContext.entries()))) : void 0;
95847
- const droppedStartingUser = carriedEntries !== void 0 && carriedEntries.length < entry.requestContext.size();
95848
- let resumeRequestContext = droppedStartingUser ? new RequestContext(carriedEntries) : entry.requestContext;
96247
+ let resumeRequestContext = carriedEntries !== void 0 && carriedEntries.length < entry.requestContext.size() ? new RequestContext(carriedEntries) : entry.requestContext;
95849
96248
  if (options?.requestContext) {
95850
96249
  resumeRequestContext = options.requestContext;
95851
96250
  for (const [key, value] of carriedEntries ?? []) {
@@ -95955,7 +96354,7 @@ var Agent = class Agent extends MastraBase {
95955
96354
  await executionFence.settle(async () => {});
95956
96355
  throw error;
95957
96356
  }
95958
- if (!coldSnapshot && (options?.requestContext || options?.delegation || options?.hooks || droppedStartingUser)) try {
96357
+ if (!coldSnapshot) try {
95959
96358
  const requestTools = await this.agentForExecution.getToolsForExecution({
95960
96359
  toolsets: resolvedOptions.toolsets,
95961
96360
  clientTools: resolvedOptions.clientTools,
@@ -95980,7 +96379,7 @@ var Agent = class Agent extends MastraBase {
95980
96379
  for (const reg of /* @__PURE__ */ new Set([entry, getRunRegistryEntry(runId, this.#mastra)])) {
95981
96380
  if (!reg) continue;
95982
96381
  reg.tools = rebindProcessorTools(refresh(reg.tools ?? {}, reg.requestTools), resumeRequestContext);
95983
- if (reg.baseTools) reg.baseTools = rebindProcessorTools(refresh(reg.baseTools, reg.requestTools), resumeRequestContext);
96382
+ reg.baseTools = requestTools;
95984
96383
  reg.requestTools = {
95985
96384
  ...reg.requestTools,
95986
96385
  ...requestTools
@@ -95988,13 +96387,16 @@ var Agent = class Agent extends MastraBase {
95988
96387
  if (options?.delegation) reg.delegation = resolvedOptions.delegation;
95989
96388
  }
95990
96389
  } catch (error) {
95991
- this.#mastra?.getLogger?.()?.warn?.(`[DurableAgent] resume(${runId}) tool resolution failed: ${error}`);
96390
+ this.#mastra?.getLogger?.()?.error?.(`[DurableAgent] resume(${runId}) tool resolution failed: ${error}`);
96391
+ await executionFence.settle(async () => {});
96392
+ throw error;
95992
96393
  }
95993
96394
  setExecutionClaim(resumeRequestContext, runId, executionFence.claim);
95994
96395
  for (const reg of [entry, getRunRegistryEntry(runId, this.#mastra)]) {
95995
96396
  if (!reg) continue;
95996
96397
  reg.executionFence = executionFence;
95997
96398
  reg.resumeToolCallId = resolvedOptions.toolCallId;
96399
+ if (!coldSnapshot) reg.toolsSegment = void 0;
95998
96400
  }
95999
96401
  const { controller: abortController, detach: detachExternalAbort } = createRunAbortController(resolvedOptions.abortSignal);
96000
96402
  if (agentThreadStreamRuntime.isRunAborted(runId, this.getPubSub())) abortController.abort();
@@ -104740,6 +105142,7 @@ var AgenticLoopBuilder = class extends BaseAgenticLoopBuilder {
104740
105142
  }],
104741
105143
  metadata: {
104742
105144
  mode: "stream",
105145
+ iterationFeedback: true,
104743
105146
  completionResult: { suppressFeedback: true }
104744
105147
  },
104745
105148
  format: 2
@@ -110959,6 +111362,11 @@ function getRunRegistryEntry(runId, mastra) {
110959
111362
  * claim (Inngest). The engine stores the same value on the registry entry it seeds for the segment.
110960
111363
  */
110961
111364
  const DURABLE_CONTEXT_SEGMENT_KEY = "__mastra_durableContextSegment";
111365
+ /** The run segment a step belongs to: its Core execution claim, or the engine's segment id. */
111366
+ function getStepSegment(runId, stepContext) {
111367
+ const segment = getExecutionClaim(stepContext, runId)?.executionId ?? stepContext?.get("__mastra_durableContextSegment");
111368
+ return typeof segment === "string" ? segment : void 0;
111369
+ }
110962
111370
  /**
110963
111371
  * The registry's live request context, when it belongs to the execution running this step. Once
110964
111372
  * another process claims the run (for example an approval from another host), the context cached
@@ -111285,4 +111693,4 @@ var ExtendedRunRegistry = class extends RunRegistry {
111285
111693
  this.#memoryInfo.clear();
111286
111694
  }
111287
111695
  };
111288
- export { isSpanChunk as $, SPAN_QUERY_MAX_CURSOR_BYTES as $a, RESUME_SNAPSHOT_POLL_INTERVAL_MS as $c, HarnessStorage as $i, TextPartSchema as $l, createChannelTools as $n, RESPONSE_CACHE_CONTEXT_KEY as $o, createNotificationSignal as $r, diffResponseMessages as $s, PINNED_READ_MEMO_KEY as $t, agentInstructions as A, jsonValueEquals as Aa, predicateToCondition as Ac, KnowledgePageDepthError as Ai, assertDrainTimeout as Al, strongerKnowledgeRole as An, ObservabilityInMemory as Ao, createGitHubSourceControlProviderFromEnv as Ar, defaultStabilityErrorProcessors as As, ensureRemoteAbortListener as At, detachFullStreamOnEnd as B, tracePageIdSchema as Ba, validateScoringPredicate as Bc, MAX_KNOWLEDGE_PAGE_LIST_LIMIT as Bi, ProcessorInputPhaseSchema as Bl, ChannelThreadLinkProcessor as Bn, messageVectorId as Bo, mergeWorkflowStepResult as Br, cloneWorkflow as Bs, formatCheckFeedback as Bt, MastraScorer as C, createStoreErrorId as Ca, getStepEntry as Cc, KnowledgeTransactionDeadlineError as Ci, validateStepRequestContext as Cl, knowledgeReadScopeFor as Cn, buildMetricRecord as Co, knowledgeSemanticDocumentId as Cr, StructuredOutputProcessor as Cs, endFailedSegmentSpans as Ct, isNotScorable as D, getDefaultValue as Da, createStep$1 as Dc, inspectKnowledgeSchema as Di, waitForSuspendedSnapshot as Dl, knowledgeMemoryScopes as Dn, getStringOrNull as Do, StoreOperationsInMemory as Dr, ModerationProcessor as Ds, runDurableStreamUntilIdle as Dt, filterRun as E, filterByDateRange as Ea, cloneStep$1 as Ec, createKnowledgeUlid as Ei, validateStepSuspendData as El, compileKnowledgeScopes as En, getObjectOrNull as Eo, parseKnowledgeNodeCursor as Er, PromptInjectionDetector as Es, segmentSpanData as Et, Agent as F, transformRow as Fa, nestedRunRecoveryAction as Fc, MAX_KNOWLEDGE_PAGE_BODY_LINKS as Fi, isDurableAgentLike as Fl, resolveWaitUntil as Fn, DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS as Fo, WorkflowsInMemory as Fr, StreamErrorRetryProcessor as Fs, untilIdleHandlesBackgroundTask as Ft, createDurableToolCallStep as G, THREAD_QUERY_MAX_LIMIT as Ga, ExecutionEngine as Gc, knowledgeLinkRefKey as Gi, ProcessorOutputStepPhaseSchema as Gl, renderBuiltInToolEvent as Gn, memoryDefaultOptions as Go, ScoresInMemory as Gr, cloneStep as Gs, generateStructuredFinalResult as Gt, createDurableGoalStep as H, tracePageRequestSchema as Ha, renewWorkflowLease as Hc, assertKnowledgeNoteTextWithinBound as Hi, ProcessorMessageContentSchema as Hl, markNewChannelThread as Hn, upsertMessageVectors as Ho, WorkflowDefinitionsStorage as Hr, createWorkflow as Hs, formatStreamCompletionFeedback as Ht, normalizeResumeGenerateArgs as I, transformScoreRow as Ia, nestedRunStatusOf as Ic, MAX_KNOWLEDGE_PAGE_DEPTH as Ii, FilePartSchema as Il, defaultTypingStatus as In, MESSAGE_EMBEDDING_CHARS_PER_TOKEN as Io, cloneRunData as Ir, isBadRequestError as Is, pruneAgentLoopSnapshot as It, serializeDurableState as J, threadQueryIdentitySchema as Ja, runWithConcurrency as Jc, knowledgePositionBetween as Ji, ProcessorStepOutputSchema as Jl, formatToolApproval as Jn, augmentWithInit as Jo, SchedulesStorage as Jr, createWorkflow$1 as Js, runDefaultCompletionCheck as Jt, createWorkflowInput as K, encodeThreadQueryCursor as Ka, createConcurrencyLimiter as Kc, knowledgePagePath as Ki, ProcessorOutputStreamPhaseSchema as Kl, CONTINUE_RUN_ACTION_ID as Kn, filterSystemReminderMessages as Ko, ScoresStorage as Kr, cloneWorkflow$1 as Ks, runChecks as Kt, prepareForDurableExecution as L, validateStorageMetadataFilter as La, DefaultExecutionEngine as Lc, MAX_KNOWLEDGE_PAGE_DESCRIPTION_TOKENS as Li, ImagePartSchema as Ll, resolveChannelRenderContext as Ln, buildMessageEmbeddingRows as Lo, WorkflowsStorage as Lr, isRetryableOpenAIResponsesStreamError as Ls, DEFAULT_TOOL_DECLINE_REASON as Lt, MAX_FS_SUBAGENT_DEPTH as M, safelyParseJSON as Ma, cancelNestedRun as Mc, KnowledgePageKeyConflictError as Mi, workflowTermination as Ml, encodeKnowledgeScopeId as Mn, FactoryStorage as Mo, FilesystemDB as Mr, UnsupportedFileHandler as Ms, __registerMastraCtor as Mt, mergeAgentPersona as N, serializeDate as Na, createNestedRunParentStatusLookup as Nc, MAX_KNOWLEDGE_MOVE_PAGES as Ni, hasDurableExecution as Nl, buildKnowledgeInstructions as Nn, FactoryStorageDomain as No, InMemoryStore as Nr, FileUploadProcessor as Ns, getRunStreamSlot as Nt, notScorable as O, getSqlType as Oa, isProcessor$1 as Oc, parseKnowledgeWikilinks as Oi, getEntryId as Ol, knowledgeRunScopes as On, serializeSpanAttributes as Oo, StoreOperations as Or, UnicodeNormalizer as Os, runResumeDurableStreamUntilIdle as Ot, AGENT_RESUME_CLAIM_STALE_MS as P, storageMessageMatchesMetadataFilter as Pa, nestedRunParentOf as Pc, MAX_KNOWLEDGE_NOTE_TOKENS as Pi, hasResumableStreams as Pl, AgentChannels as Pn, UniqueViolationError as Po, MockStore as Pr, FILE_UPLOAD_ERROR_CODES as Ps, getScopeStreamSlot as Pt, MessagePartSpans as Q, SPAN_QUERY_MAX_COST_METRICS as Qa, createStepFromTool as Qc, InMemoryHarness as Qi, StepStartPartSchema as Ql, createChannelToolScope as Qn, DEFAULT_RESPONSE_CACHE_TTL_SECONDS as Qo, dispatchDueNotifications as Qr, __resetExecutionFencesForTests as Qs, validateModelTimeoutSettings as Qt, applyReservedMemoryContextKeys as R, TracePageError as Ra, SCORING_PREDICATE_ROOTS as Rc, MAX_KNOWLEDGE_PAGE_LINKS as Ri, MessageContentSchema as Rl, MastraStateAdapter as Rn, chunkMessageText as Ro, createEmptyWorkflowSnapshot as Rr, PrefillErrorHandler as Rs, resolveDeclineReason as Rt, createClassifierScorer as S, createStorageErrorId as Sa, getNestedWorkflow as Sc, KnowledgeStorage as Si, validateStepInput as Sl, knowledgeAccessGrants as Sn, buildLogRecord as So, knowledgeScopeKey as Sr, ClassifierProcessor as Ss, carrySegmentSpans as St, createScorer as T, ensureDate as Ta, Workflow as Tc, assertKnowledgeSchemaCompatible as Ti, validateStepStateData as Tl, KnowledgeDeclarationError as Tn, buildUpdateSpanRecord as To, knowledgeVisibleScopeKeys as Tr, PIIDetector as Ts, segmentEndedBySuspension as Tt, createDurableIsTaskCompleteStep as U, tracePageResponseSchema as Ua, repeatAfterSettled as Uc, assertKnowledgePageDescriptionWithinBound as Ui, ProcessorMessageSchema as Ul, ChatChannelProcessor as Un, MastraMemory as Uo, InMemoryToolProviderConnectionsStorage as Ur, EventedRun as Us, formatValidationFeedback as Ut, createDurableAgenticWorkflow as V, tracePageNodeSchema as Va, WORKFLOW_RUN_LEASE_TTL_MS as Vc, MAX_KNOWLEDGE_PIN_LIST_DEPTH as Vi, ProcessorInputStepPhaseSchema as Vl, NEW_CHANNEL_THREAD_KEY as Vn, resolveMaxChunkChars as Vo, InMemoryWorkflowDefinitionsStorage as Vr, createEventedWorkflow as Vs, formatCompletionFeedback as Vt, createDurableLLMMappingStep as W, THREAD_QUERY_DEFAULT_LIMIT as Wa, runFenceConflictOf as Wc, canonicalKnowledgeName as Wi, ProcessorOutputResultPhaseSchema as Wl, CHAT_CHANNEL_RENDER_CONTEXT_KEY as Wn, MemoryProcessor as Wo, ToolProviderConnectionsStorage as Wr, EventedWorkflow as Ws, generateFinalResult as Wt, serializeToolsMetadata as X, threadQueryResponseSchema as Xa, createStepFromAgent$1 as Xc, parseKnowledgePageRef as Xi, ReasoningPartSchema as Xl, DEFAULT_CHANNEL_TOOLS_SETTINGS as Xn, createBackgroundWorkSignalProcessor as Xo, InMemoryNotificationsStorage as Xr, StepExecutor as Xs, runValidation as Xt, serializeModelConfig as Y, threadQueryRequestSchema as Ya, createMappingStep as Yc, knowledgeScopeReadable as Yi, ProcessorStepSchema as Yl, ChannelSessionRejectedError as Yn, getStorageSource as Yo, normalizeScheduleTarget as Yr, WorkflowEventProcessor as Ys, runStreamCompletionScorers as Yt, createDurableLLMExecutionStep as Z, threadQueryRowSchema as Za, createStepFromClassifier as Zc, KnowledgeInvalidCursorError as Zi, SourcePartSchema as Zl, channelToolScopeResolver as Zn, CyberRefusalHandler as Zo, NotificationsStorage as Zr, computeScheduleDefinitionHash as Zs, loop as Zt, describeNonSuccessFinishReason as _, BackgroundTasksStorage as _a, AgentControlEventTypes as _c, KNOWLEDGE_STORAGE_CONTRACT_VERSION as _i, omitPriorCompletionFields as _l, knowledgeSubtree as _n, getTraceQueryDeltaWatermark as _o, assertKnowledgeScopeWithinCeiling as _r, getMemoryTokenBoundary as _s, resolveRuntimeDependencies as _t, deleteRunRegistryEntry as a, SchemaValidator as aa, emitStepStartEvent as ac, summarizeNotifications as ai, createDeprecationProxy as al, knowledgeRunPrincipals as an, encodeSpanQueryCursor as ao, globalEmbeddingCache as ar, formatSkillsCatalog as as, accumulatedUsageSchema as at, RUN_FENCE_CONFLICT_ERROR_ID as au, createOnScorerHook as b, retentionCutoffMs as ba, restoredWorkerControllerContexts as bc, KnowledgeNotFoundError$1 as bi, runCountDeprecationMessage as bl, syncKnowledgePageBodyLinks as bn, buildCreateSpanRecord as bo, expandKnowledgeScope as br, BatchPartsProcessor as bs, resolveAgentById as bt, getRunRegistryEntry as c, getSchemaValidator as ca, publishAbortRequest as cc, defaultNotificationDeliveryDecision as ci, defineLazyWriter as cl, addKnowledgeNote as cn, resolveSpanQueryCost as co, MemoryRunState as cr, ToolCallFilter as cs, durableAgenticOutputSchema as ct, coverNestedRun as cu, setRunRegistryEntry as d, SchemaValidationError as da, createRunAbortController as dc, InMemoryMemory as di, getResumeLabelsByStepId as dl, removeKnowledgePage as dn, spanQueryIdentitySchema as do, MAX_KNOWLEDGE_NODE_DESCRIPTION_LENGTH as dr, TokenCostControl as ds, executeDurableAgentScorers as dt, matchesRunFence as du, ExperimentsInMemory as ea, emitAbortEvent as ec, createNotificationSummarySignal as ei, RESUME_SNAPSHOT_WAIT_STATUSES as el, knowledgeDeliveredPins as en, SPAN_QUERY_MAX_LIMIT as eo, resolveChannelToolsSettings as er, ResponseCache as es, createDurableBackgroundTaskCheckStep as et, ToolInvocationPartSchema as eu, takeRunScorerInstances as f, InMemoryChannelsStorage as fa, DURABLE_STOP_WHEN_ERROR_ID as fc, MemoryStorage as fi, getSingleStepEntryId as fl, updateKnowledgeNote as fn, spanQueryRequestSchema as fo, MAX_KNOWLEDGE_RECORD_TEXT_LENGTH as fr, SystemPromptScrubber as fs, runDurableFinishSideEffects as ft, resolveRunFence as fu, AGENTIC_LOOP_WORKFLOW_ID as g, BackgroundTasksInMemory as ga, AGENT_STREAM_TOPIC as gc, KnowledgeImportersStorage as gi, isSingleStepEntry as gl, KnowledgeLinkRefreshIncompleteError as gn, encodeTraceQueryDeltaCursor as go, assertKnowledgeRecordTextWithinBound as gr, advanceMemoryTokenBoundary as gs, resolveModel as gt, AGENTIC_EXECUTION_WORKFLOW_ID as h, BlobStore as ha, AGENT_CONTROL_TOPIC as hc, KnowledgeImporterRunStateError as hi, isEntryFinished as hl, embed$2 as hn, encodeTraceQueryCursor as ho, assertKnowledgeDescriptionWithinBound as hr, loadMessageHistory as hs, resolveInternalState as ht, setRunFenceContext as hu, abandonDurableAgentExecutions as i, DatasetItemIdentityConflictError as ia, emitStepFinishEvent as ic, notificationSummarySignalMetadata as ii, cleanStepResult as il, KnowledgeRunScopesError as in, createSpanQueryPreview as io, SemanticRecall as ir, SkillsProcessor as is, createBaseIterationStateUpdate as it, isWorkflowStepConflictError as iu, assembleAgentFromFsEntry as j, parseDuration as ja, evaluatePredicate as jc, KnowledgePageHasChildrenError as ji, waitMs as jl, decodeKnowledgeScopeId as jn, ObservabilityStorage as jo, FilesystemStore as jr, isMalformedFunctionCallError as js, readRunDeadline as jt, agentConfig as k, hasErrorCode as ka, mapVariable as kc, KnowledgeMoveTooLargeError as ki, getEntryWorkflow as kl, knowledgeScopeAddress as kn, toEntityType as ko, GitHubSourceControlProvider as kr, STABILITY_ERROR_PROCESSOR_IDS as ks, RUN_DEADLINE_KEY as kt, globalRunRegistry as l, UnsupportedSchemaPatternError as la, requestAcknowledgedAbort as lc, resolveDeliveryFailureUpdate as li, defineStateAccessors as ll, moveKnowledgePage as ln, spanQueryCostSchema as lo, getMemoryRunState as lr, RegexFilterProcessor as ls, modelConfigSchema as lt, currentRunGeneration as lu, agentThreadStreamRuntime as m, InMemoryBlobStore as ma, DurableStepIds as mc, KnowledgeImporterBindingConflictError as mi, hydrateSerializedStepErrors as ml, KnowledgeSemanticIndex as mn, spanQueryRowSchema as mo, assertKnowledgeCeilingRaised as mr, groupLinkedToolMessages as ms, rebuildRunToolsFromMastra as mt, runOutsideRunFenceScope as mu, ExtendedRunRegistry as n, DatasetsInMemory as na, emitErrorEvent as nc, notificationSignalMetadata as ni, applyStateDelta as nl, heldScopes as nn, SPAN_QUERY_ORDER_FIELDS as no, BaseProcessor as nr, WorkspaceInstructionsProcessor as ns, buildStepRecord as nt, WorkflowStepConflictError as nu, endRunSpansWithError as o, assertSupportedPatterns as oa, emitSuspendedEvent as oc, readNotificationRoutingRequirement as oi, createRestartExecutionParams as ol, knowledgeAgentScopes as on, parseSpanQueryRequest as oo, WorkingMemory as or, ToolSearchProcessor as os, baseDurableAgenticInputSchema as ot, RUN_FENCING_NOT_SUPPORTED_ERROR_ID as ou, AgentThreadLeaseLostError as p, ChannelsStorage as pa, DurableAgentDefaults as pc, InMemoryKnowledgeStorage as pi, getStepIds as pl, upsertKnowledgePage as pn, spanQueryResponseSchema as po, MAX_KNOWLEDGE_SCOPE_TAGS as pr, TokenLimiterProcessor as ps, loadRunStoredMessages as pt, runFencingNotSupportedError as pu, serializeDurableOptions as q, planThreadRowsQuery as qa, normalizeConcurrency as qc, knowledgePinDepth as qi, ProcessorStepInputSchema as ql, CONTINUE_RUN_MESSAGE as qn, isSystemReminderMessage as qo, InMemorySchedulesStorage as qr, createStep as qs, runCompletionScorers as qt, RunRegistry as r, DatasetsStorage as ra, emitFinishEvent as rc, notificationSummaryContents as ri, assertTimeTravelGraphMatchesSnapshot as rl, KnowledgeRun as rn, buildSpanQueryResponse as ro, MemoryInputFilter as rr, SkillSearchProcessor as rs, calculateAccumulatedUsage as rt, assertWorkflowStepGuard as ru, getActiveDurableAgentWorkflowExecutions as s, createValidator as sa, AgentStreamBus as sc, MAX_NOTIFICATION_DELIVERY_ATTEMPTS as si, createTimeTravelExecutionParams as sl, knowledgePersonaScopes as sn, planSpanQuery as so, MessageHistory as sr, AgentsMDInjector as ss, baseIterationStateSchema as st, RunFenceConflictError as su, DURABLE_CONTEXT_SEGMENT_KEY as t, ExperimentsStorage as ta, emitChunkEvent as tc, notificationSignalAttributes as ti, abortableSleep as tl, buildKnowledgePageTools as tn, SPAN_QUERY_MAX_PREVIEW_CHARACTERS as to, toChatLogger as tr, buildResponseCacheKey as ts, resolveDurableToolCallConcurrency as tt, isAgentCompatible as tu, isDurableAgentExecutionDetached as u, SchemaUpdateValidationError as ua, subscribeToAbortRequests as uc, resolveNotificationDeliveryDecision as ui, getRestartStartIndex as ul, removeKnowledgeNote as un, spanQueryIdentityKey as uo, MockMemory as ur, CostGuardProcessor as us, modelListEntrySchema as ut, isRunFenceConflictError as uu, runEvals as v, executeRetentionPrune as va, AgentStreamEventTypes as vc, KNOWLEDGE_STORAGE_SCHEMA_VERSION as vi, omitPriorSuspensionFields as vl, refreshKnowledgeLinksTo as vn, planThreadQuery as vo, canonicalizeKnowledgeScope as vr, isAfterMemoryTokenBoundary as vs, resolveTool$1 as vt, ScorerRunError as w, createVectorErrorId as wa, Run as wc, KnowledgeUnsupportedCapabilityError as wi, validateStepResumeData as wl, knowledgeRoleOn as wn, buildScoreRecord as wo, knowledgeSemanticIdempotencyKey as wr, LanguageDetector as ws, liveSegmentSpan as wt, validateAndSaveScore as x, runRetentionBatches as xa, EventedExecutionEngine as xc, KnowledgeSchemaResetRequiredError as xi, setLongTimeout as xl, updateKnowledgeLinks as xn, buildFeedbackRecord as xo, isKnowledgeScopeVisible as xr, ModelSelectionProcessor as xs, createDurableAgentStream as xt, flushBeforeTraceRead as y, resolveRetentionTargets as ya, CONTROLLER_RUN_BINDING_KEY as yc, KnowledgeConflictError as yi, resolveForeachConcurrency as yl, reindexKnowledgeLinks as yn, planTraceQuery as yo, createKnowledgeNodeCursor as yr, normalizeMessageHistoryConfig as ys, toolRequiresApproval as yt, persistDurableRunInput as z, readTracePage as za, evaluateScoringPredicate as zc, MAX_KNOWLEDGE_PAGE_LINK_REF_LENGTH as zi, MessagePartSchema as zl, REPLY_TOOL_NAME as zn, extractMessageEmbeddingText as zo, mergeStepResult as zr, getGoalActivityDurationMs as zs, getServerSideFallbackInfo as zt };
111696
+ export { isSpanChunk as $, threadQueryRequestSchema as $a, createMappingStep as $c, parseKnowledgePageRef as $i, ProcessorStepSchema as $l, DEFAULT_CHANNEL_TOOLS_SETTINGS as $n, getStorageSource as $o, InMemoryNotificationsStorage as $r, WorkflowEventProcessor as $s, PINNED_READ_MEMO_KEY as $t, agentInstructions as A, filterByDateRange as Aa, cloneStep$1 as Ac, inspectKnowledgeSchema as Ai, validateStepSuspendData as Al, knowledgeMemoryScopes as An, getObjectOrNull as Ao, StoreOperationsInMemory as Ar, PromptInjectionDetector as As, ensureRemoteAbortListener as At, detachFullStreamOnEnd as B, transformScoreRow as Ba, nestedRunStatusOf as Bc, MAX_KNOWLEDGE_PAGE_DESCRIPTION_TOKENS as Bi, FilePartSchema as Bl, resolveChannelRenderContext as Bn, MESSAGE_EMBEDDING_CHARS_PER_TOKEN as Bo, WorkflowsStorage as Br, isBadRequestError as Bs, formatCheckFeedback as Bt, MastraScorer as C, resolveRetentionTargets as Ca, CONTROLLER_RUN_BINDING_KEY as Cc, KnowledgeNotFoundError$1 as Ci, resolveForeachConcurrency as Cl, syncKnowledgePageBodyLinks as Cn, planTraceQuery as Co, expandKnowledgeScope as Cr, normalizeMessageHistoryConfig as Cs, endFailedSegmentSpans as Ct, isNotScorable as D, createStoreErrorId as Da, getStepEntry as Dc, KnowledgeUnsupportedCapabilityError as Di, validateStepRequestContext as Dl, knowledgeRoleOn as Dn, buildMetricRecord as Do, knowledgeSemanticIdempotencyKey as Dr, StructuredOutputProcessor as Ds, runDurableStreamUntilIdle as Dt, filterRun as E, createStorageErrorId as Ea, getNestedWorkflow as Ec, KnowledgeTransactionDeadlineError as Ei, validateStepInput as El, knowledgeReadScopeFor as En, buildLogRecord as Eo, knowledgeSemanticDocumentId as Er, ClassifierProcessor as Es, segmentSpanData as Et, Agent as F, parseDuration as Fa, evaluatePredicate as Fc, KnowledgePageKeyConflictError as Fi, waitMs as Fl, encodeKnowledgeScopeId as Fn, ObservabilityStorage as Fo, FilesystemDB as Fr, isMalformedFunctionCallError as Fs, untilIdleHandlesBackgroundTask as Ft, createDurableToolCallStep as G, tracePageNodeSchema as Ga, WORKFLOW_RUN_LEASE_TTL_MS as Gc, assertKnowledgeNoteTextWithinBound as Gi, ProcessorInputStepPhaseSchema as Gl, markNewChannelThread as Gn, resolveMaxChunkChars as Go, WorkflowDefinitionsStorage as Gr, createEventedWorkflow as Gs, generateStructuredFinalResult as Gt, createDurableGoalStep as H, TracePageError as Ha, SCORING_PREDICATE_ROOTS as Hc, MAX_KNOWLEDGE_PAGE_LINK_REF_LENGTH as Hi, MessageContentSchema as Hl, REPLY_TOOL_NAME as Hn, chunkMessageText as Ho, mergeStepResult as Hr, PrefillErrorHandler as Hs, formatStreamCompletionFeedback as Ht, normalizeResumeGenerateArgs as I, safelyParseJSON as Ia, cancelNestedRun as Ic, MAX_KNOWLEDGE_MOVE_PAGES as Ii, workflowTermination as Il, buildKnowledgeInstructions as In, FactoryStorage as Io, InMemoryStore as Ir, UnsupportedFileHandler as Is, pruneAgentLoopSnapshot as It, serializeDurableState as J, THREAD_QUERY_DEFAULT_LIMIT as Ja, runFenceConflictOf as Jc, knowledgeLinkRefKey as Ji, ProcessorOutputResultPhaseSchema as Jl, renderBuiltInToolEvent as Jn, MemoryProcessor as Jo, ScoresInMemory as Jr, EventedWorkflow as Js, runDefaultCompletionCheck as Jt, createWorkflowInput as K, tracePageRequestSchema as Ka, renewWorkflowLease as Kc, assertKnowledgePageDescriptionWithinBound as Ki, ProcessorMessageContentSchema as Kl, ChatChannelProcessor as Kn, upsertMessageVectors as Ko, InMemoryToolProviderConnectionsStorage as Kr, createWorkflow as Ks, runChecks as Kt, prepareForDurableExecution as L, serializeDate as La, createNestedRunParentStatusLookup as Lc, MAX_KNOWLEDGE_NOTE_TOKENS as Li, hasDurableExecution as Ll, AgentChannels as Ln, FactoryStorageDomain as Lo, MockStore as Lr, FileUploadProcessor as Ls, DEFAULT_TOOL_DECLINE_REASON as Lt, MAX_FS_SUBAGENT_DEPTH as M, getSqlType as Ma, isProcessor$1 as Mc, KnowledgeMoveTooLargeError as Mi, getEntryId as Ml, knowledgeScopeAddress as Mn, serializeSpanAttributes as Mo, GitHubSourceControlProvider as Mr, UnicodeNormalizer as Ms, __registerMastraCtor as Mt, mergeAgentPersona as N, hasErrorCode as Na, mapVariable as Nc, KnowledgePageDepthError as Ni, getEntryWorkflow as Nl, strongerKnowledgeRole as Nn, toEntityType as No, createGitHubSourceControlProviderFromEnv as Nr, STABILITY_ERROR_PROCESSOR_IDS as Ns, getRunStreamSlot as Nt, notScorable as O, createVectorErrorId as Oa, Run as Oc, assertKnowledgeSchemaCompatible as Oi, validateStepResumeData as Ol, KnowledgeDeclarationError as On, buildScoreRecord as Oo, knowledgeVisibleScopeKeys as Or, LanguageDetector as Os, runResumeDurableStreamUntilIdle as Ot, AGENT_RESUME_CLAIM_STALE_MS as P, jsonValueEquals as Pa, predicateToCondition as Pc, KnowledgePageHasChildrenError as Pi, assertDrainTimeout as Pl, decodeKnowledgeScopeId as Pn, ObservabilityInMemory as Po, FilesystemStore as Pr, defaultStabilityErrorProcessors as Ps, getScopeStreamSlot as Pt, MessagePartSpans as Q, threadQueryIdentitySchema as Qa, runWithConcurrency as Qc, knowledgeScopeReadable as Qi, ProcessorStepOutputSchema as Ql, ChannelSessionRejectedError as Qn, augmentWithInit as Qo, normalizeScheduleTarget as Qr, createWorkflow$1 as Qs, validateModelTimeoutSettings as Qt, applyReservedMemoryContextKeys as R, storageMessageMatchesMetadataFilter as Ra, nestedRunParentOf as Rc, MAX_KNOWLEDGE_PAGE_BODY_LINKS as Ri, hasResumableStreams as Rl, resolveWaitUntil as Rn, UniqueViolationError as Ro, WorkflowsInMemory as Rr, FILE_UPLOAD_ERROR_CODES as Rs, resolveDeclineReason as Rt, createClassifierScorer as S, executeRetentionPrune as Sa, AgentStreamEventTypes as Sc, KnowledgeConflictError as Si, omitPriorSuspensionFields as Sl, repairKnowledgeLinks as Sn, planThreadQuery as So, createKnowledgeNodeCursor as Sr, isAfterMemoryTokenBoundary as Ss, carrySegmentSpans as St, createScorer as T, runRetentionBatches as Ta, EventedExecutionEngine as Tc, KnowledgeStorage as Ti, setLongTimeout as Tl, knowledgeAccessGrants as Tn, buildFeedbackRecord as To, knowledgeScopeKey as Tr, ModelSelectionProcessor as Ts, segmentEndedBySuspension as Tt, createDurableIsTaskCompleteStep as U, readTracePage as Ua, evaluateScoringPredicate as Uc, MAX_KNOWLEDGE_PAGE_LIST_LIMIT as Ui, MessagePartSchema as Ul, ChannelThreadLinkProcessor as Un, extractMessageEmbeddingText as Uo, mergeWorkflowStepResult as Ur, getGoalActivityDurationMs as Us, formatValidationFeedback as Ut, createDurableAgenticWorkflow as V, validateStorageMetadataFilter as Va, DefaultExecutionEngine as Vc, MAX_KNOWLEDGE_PAGE_LINKS as Vi, ImagePartSchema as Vl, MastraStateAdapter as Vn, buildMessageEmbeddingRows as Vo, createEmptyWorkflowSnapshot as Vr, isRetryableOpenAIResponsesStreamError as Vs, formatCompletionFeedback as Vt, createDurableLLMMappingStep as W, tracePageIdSchema as Wa, validateScoringPredicate as Wc, MAX_KNOWLEDGE_PIN_LIST_DEPTH as Wi, ProcessorInputPhaseSchema as Wl, NEW_CHANNEL_THREAD_KEY as Wn, messageVectorId as Wo, InMemoryWorkflowDefinitionsStorage as Wr, cloneWorkflow as Ws, generateFinalResult as Wt, serializeToolsMetadata as X, encodeThreadQueryCursor as Xa, createConcurrencyLimiter as Xc, knowledgePinDepth as Xi, ProcessorOutputStreamPhaseSchema as Xl, CONTINUE_RUN_MESSAGE as Xn, filterSystemReminderMessages as Xo, InMemorySchedulesStorage as Xr, cloneWorkflow$1 as Xs, runValidation as Xt, serializeModelConfig as Y, THREAD_QUERY_MAX_LIMIT as Ya, ExecutionEngine as Yc, knowledgePagePath as Yi, ProcessorOutputStepPhaseSchema as Yl, CONTINUE_RUN_ACTION_ID as Yn, memoryDefaultOptions as Yo, ScoresStorage as Yr, cloneStep as Ys, runStreamCompletionScorers as Yt, createDurableLLMExecutionStep as Z, planThreadRowsQuery as Za, normalizeConcurrency as Zc, knowledgePositionBetween as Zi, ProcessorStepInputSchema as Zl, formatToolApproval as Zn, isSystemReminderMessage as Zo, SchedulesStorage as Zr, createStep as Zs, loop as Zt, describeNonSuccessFinishReason as _, ChannelsStorage as _a, DurableAgentDefaults as _c, KnowledgeImporterBindingConflictError as _i, getStepIds as _l, KnowledgeLinkRepairUnsupportedError as _n, spanQueryResponseSchema as _o, assertKnowledgeCeilingRaised as _r, TokenLimiterProcessor as _s, resolveRuntimeDependencies as _t, runFencingNotSupportedError as _u, deleteRunRegistryEntry as a, ExperimentsStorage as aa, emitChunkEvent as ac, notificationSignalMetadata as ai, abortableSleep as al, knowledgeRunPrincipals as an, SPAN_QUERY_MAX_PREVIEW_CHARACTERS as ao, BaseProcessor as ar, buildResponseCacheKey as as, accumulatedUsageSchema as at, isAgentCompatible as au, createOnScorerHook as b, BackgroundTasksInMemory as ba, AGENT_STREAM_TOPIC as bc, KNOWLEDGE_STORAGE_CONTRACT_VERSION as bi, isSingleStepEntry as bl, refreshKnowledgeLinksTo as bn, encodeTraceQueryDeltaCursor as bo, assertKnowledgeScopeWithinCeiling as br, advanceMemoryTokenBoundary as bs, resolveAgentById as bt, getRunRegistryEntry as c, DatasetItemIdentityConflictError as ca, emitStepFinishEvent as cc, summarizeNotifications as ci, cleanStepResult as cl, addKnowledgeNote as cn, createSpanQueryPreview as co, globalEmbeddingCache as cr, SkillsProcessor as cs, durableAgenticOutputSchema as ct, isWorkflowStepConflictError as cu, setRunRegistryEntry as d, createValidator as da, AgentStreamBus as dc, defaultNotificationDeliveryDecision as di, createTimeTravelExecutionParams as dl, removeKnowledgePage as dn, planSpanQuery as do, MemoryRunState as dr, AgentsMDInjector as ds, executeDurableAgentScorers as dt, RunFenceConflictError as du, KnowledgeInvalidCursorError as ea, StepExecutor as ec, NotificationsStorage as ei, createStepFromAgent$1 as el, knowledgeDeliveredPins as en, threadQueryResponseSchema as eo, channelToolScopeResolver as er, createBackgroundWorkSignalProcessor as es, createDurableBackgroundTaskCheckStep as et, ReasoningPartSchema as eu, takeRunScorerInstances as f, getSchemaValidator as fa, publishAbortRequest as fc, resolveDeliveryFailureUpdate as fi, defineLazyWriter as fl, updateKnowledgeNote as fn, resolveSpanQueryCost as fo, getMemoryRunState as fr, ToolCallFilter as fs, runDurableFinishSideEffects as ft, coverNestedRun as fu, AGENTIC_LOOP_WORKFLOW_ID as g, InMemoryChannelsStorage as ga, DURABLE_STOP_WHEN_ERROR_ID as gc, InMemoryKnowledgeStorage as gi, getSingleStepEntryId as gl, KnowledgeLinkRefreshIncompleteError as gn, spanQueryRequestSchema as go, MAX_KNOWLEDGE_SCOPE_TAGS as gr, SystemPromptScrubber as gs, resolveModel as gt, resolveRunFence as gu, AGENTIC_EXECUTION_WORKFLOW_ID as h, SchemaValidationError as ha, createRunAbortController as hc, MemoryStorage as hi, getResumeLabelsByStepId as hl, embed$2 as hn, spanQueryIdentitySchema as ho, MAX_KNOWLEDGE_RECORD_TEXT_LENGTH as hr, TokenCostControl as hs, resolveInternalState as ht, matchesRunFence as hu, abandonDurableAgentExecutions as i, ExperimentsInMemory as ia, emitAbortEvent as ic, notificationSignalAttributes as ii, RESUME_SNAPSHOT_WAIT_STATUSES as il, KnowledgeRunScopesError as in, SPAN_QUERY_MAX_LIMIT as io, toChatLogger as ir, ResponseCache as is, createBaseIterationStateUpdate as it, ToolInvocationPartSchema as iu, assembleAgentFromFsEntry as j, getDefaultValue as ja, createStep$1 as jc, parseKnowledgeWikilinks as ji, waitForSuspendedSnapshot as jl, knowledgeRunScopes as jn, getStringOrNull as jo, StoreOperations as jr, ModerationProcessor as js, readRunDeadline as jt, agentConfig as k, ensureDate as ka, Workflow as kc, createKnowledgeUlid as ki, validateStepStateData as kl, compileKnowledgeScopes as kn, buildUpdateSpanRecord as ko, parseKnowledgeNodeCursor as kr, PIIDetector as ks, RUN_DEADLINE_KEY as kt, globalRunRegistry as l, SchemaValidator as la, emitStepStartEvent as lc, readNotificationRoutingRequirement as li, createDeprecationProxy as ll, moveKnowledgePage as ln, encodeSpanQueryCursor as lo, WorkingMemory as lr, formatSkillsCatalog as ls, modelConfigSchema as lt, RUN_FENCE_CONFLICT_ERROR_ID as lu, agentThreadStreamRuntime as m, SchemaUpdateValidationError as ma, subscribeToAbortRequests as mc, InMemoryMemory as mi, getRestartStartIndex as ml, KnowledgeSemanticIndex as mn, spanQueryIdentityKey as mo, MAX_KNOWLEDGE_NODE_DESCRIPTION_LENGTH as mr, CostGuardProcessor as ms, rebuildRunToolsFromMastra as mt, isRunFenceConflictError as mu, ExtendedRunRegistry as n, InMemoryHarness as na, __resetExecutionFencesForTests as nc, createNotificationSignal as ni, createStepFromTool as nl, heldScopes as nn, SPAN_QUERY_MAX_COST_METRICS as no, createChannelTools as nr, DEFAULT_RESPONSE_CACHE_TTL_SECONDS as ns, buildStepRecord as nt, StepStartPartSchema as nu, endRunSpansWithError as o, DatasetsInMemory as oa, emitErrorEvent as oc, notificationSummaryContents as oi, applyStateDelta as ol, knowledgeAgentScopes as on, SPAN_QUERY_ORDER_FIELDS as oo, MemoryInputFilter as or, WorkspaceInstructionsProcessor as os, baseDurableAgenticInputSchema as ot, WorkflowStepConflictError as ou, AgentThreadLeaseLostError as p, UnsupportedSchemaPatternError as pa, requestAcknowledgedAbort as pc, resolveNotificationDeliveryDecision as pi, defineStateAccessors as pl, upsertKnowledgePage as pn, spanQueryCostSchema as po, MockMemory as pr, RegexFilterProcessor as ps, loadRunStoredMessages as pt, currentRunGeneration as pu, serializeDurableOptions as q, tracePageResponseSchema as qa, repeatAfterSettled as qc, canonicalKnowledgeName as qi, ProcessorMessageSchema as ql, CHAT_CHANNEL_RENDER_CONTEXT_KEY as qn, MastraMemory as qo, ToolProviderConnectionsStorage as qr, EventedRun as qs, runCompletionScorers as qt, RunRegistry as r, HarnessStorage as ra, diffResponseMessages as rc, createNotificationSummarySignal as ri, RESUME_SNAPSHOT_POLL_INTERVAL_MS as rl, KnowledgeRun as rn, SPAN_QUERY_MAX_CURSOR_BYTES as ro, resolveChannelToolsSettings as rr, RESPONSE_CACHE_CONTEXT_KEY as rs, calculateAccumulatedUsage as rt, TextPartSchema as ru, getActiveDurableAgentWorkflowExecutions as s, DatasetsStorage as sa, emitFinishEvent as sc, notificationSummarySignalMetadata as si, assertTimeTravelGraphMatchesSnapshot as sl, knowledgePersonaScopes as sn, buildSpanQueryResponse as so, SemanticRecall as sr, SkillSearchProcessor as ss, baseIterationStateSchema as st, assertWorkflowStepGuard as su, DURABLE_CONTEXT_SEGMENT_KEY as t, knowledgePageKeyProblem as ta, computeScheduleDefinitionHash as tc, dispatchDueNotifications as ti, createStepFromClassifier as tl, buildKnowledgePageTools as tn, threadQueryRowSchema as to, createChannelToolScope as tr, CyberRefusalHandler as ts, resolveDurableToolCallConcurrency as tt, SourcePartSchema as tu, isDurableAgentExecutionDetached as u, assertSupportedPatterns as ua, emitSuspendedEvent as uc, MAX_NOTIFICATION_DELIVERY_ATTEMPTS as ui, createRestartExecutionParams as ul, removeKnowledgeNote as un, parseSpanQueryRequest as uo, MessageHistory as ur, ToolSearchProcessor as us, modelListEntrySchema as ut, RUN_FENCING_NOT_SUPPORTED_ERROR_ID as uu, runEvals as v, InMemoryBlobStore as va, DurableStepIds as vc, KnowledgeImporterRunStateError as vi, hydrateSerializedStepErrors as vl, canRepairKnowledgeLinksInBatch as vn, spanQueryRowSchema as vo, assertKnowledgeDescriptionWithinBound as vr, groupLinkedToolMessages as vs, resolveTool$1 as vt, runOutsideRunFenceScope as vu, ScorerRunError as w, retentionCutoffMs as wa, restoredWorkerControllerContexts as wc, KnowledgeSchemaResetRequiredError as wi, runCountDeprecationMessage as wl, updateKnowledgeLinks as wn, buildCreateSpanRecord as wo, isKnowledgeScopeVisible as wr, BatchPartsProcessor as ws, liveSegmentSpan as wt, validateAndSaveScore as x, BackgroundTasksStorage as xa, AgentControlEventTypes as xc, KNOWLEDGE_STORAGE_SCHEMA_VERSION as xi, omitPriorCompletionFields as xl, reindexKnowledgeLinks as xn, getTraceQueryDeltaWatermark as xo, canonicalizeKnowledgeScope as xr, getMemoryTokenBoundary as xs, createDurableAgentStream as xt, flushBeforeTraceRead as y, BlobStore as ya, AGENT_CONTROL_TOPIC as yc, KnowledgeImportersStorage as yi, isEntryFinished as yl, knowledgeSubtree as yn, encodeTraceQueryCursor as yo, assertKnowledgeRecordTextWithinBound as yr, loadMessageHistory as ys, toolRequiresApproval as yt, setRunFenceContext as yu, persistDurableRunInput as z, transformRow as za, nestedRunRecoveryAction as zc, MAX_KNOWLEDGE_PAGE_DEPTH as zi, isDurableAgentLike as zl, defaultTypingStatus as zn, DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS as zo, cloneRunData as zr, StreamErrorRetryProcessor as zs, getServerSideFallbackInfo as zt };