@mastra/core 1.87.0-alpha.2 → 1.87.0-alpha.5

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 (446) hide show
  1. package/dist/_types/@ai-sdk_openai@4.0.106/dist/index.d.ts +2034 -0
  2. package/dist/_types/@ai-sdk_openai@4.0.106/package.json +1 -0
  3. package/dist/a2a/index.cjs +1 -1
  4. package/dist/a2a/index.js +1 -1
  5. package/dist/agent/durable/index.cjs +1 -1
  6. package/dist/agent/durable/index.js +1 -1
  7. package/dist/agent/durable/run-message-refs.d.ts +3 -2
  8. package/dist/agent/index.cjs +4 -4
  9. package/dist/agent/index.js +4 -4
  10. package/dist/agent/message-list/adapters/AIV5Adapter.d.ts +15 -1
  11. package/dist/agent/message-list/index.cjs +2 -2
  12. package/dist/agent/message-list/index.js +2 -2
  13. package/dist/agent/message-list/state/types.d.ts +5 -1
  14. package/dist/agent/message-list/types.d.ts +1 -1
  15. package/dist/agent/message-list/utils/provider-compat.d.ts +9 -1
  16. package/dist/agent-builder/ee/index.cjs +1 -1
  17. package/dist/agent-builder/ee/index.js +1 -1
  18. package/dist/agent-controller/agent-controller.d.ts +6 -0
  19. package/dist/agent-controller/index.cjs +2 -2
  20. package/dist/agent-controller/index.js +2 -2
  21. package/dist/agent-controller/worker-run-binding.d.ts +15 -0
  22. package/dist/{agent-controller-Dc58ARqw.js → agent-controller-CDwoELRq.js} +50 -8
  23. package/dist/{agent-controller-v64JbuDa.cjs → agent-controller-DEB1G03O.cjs} +50 -8
  24. package/dist/background-tasks/index.cjs +1 -1
  25. package/dist/background-tasks/index.js +1 -1
  26. package/dist/{background-tasks-DgiQNKh7.cjs → background-tasks-B40g_Guf.cjs} +1 -1
  27. package/dist/{background-tasks-E-Jjxks4.js → background-tasks-CBp2178j.js} +1 -1
  28. package/dist/browser/index.cjs +2 -2
  29. package/dist/browser/index.js +2 -2
  30. package/dist/{builder-Dh175HnQ.js → builder-DTEXPju5.js} +2 -2
  31. package/dist/{builder-Dfp6Ckjr.cjs → builder-tuHJooMG.cjs} +2 -2
  32. package/dist/capabilities/302ai.json +191 -191
  33. package/dist/capabilities/abliteratedllm.json +39 -39
  34. package/dist/capabilities/abliteration-ai.json +10 -10
  35. package/dist/capabilities/above.json +20 -20
  36. package/dist/capabilities/adaption.json +15 -15
  37. package/dist/capabilities/adzuki.json +20 -20
  38. package/dist/capabilities/agentrouter.json +9 -9
  39. package/dist/capabilities/agnes.json +3 -3
  40. package/dist/capabilities/ai-router.json +6 -6
  41. package/dist/capabilities/aiand.json +25 -25
  42. package/dist/capabilities/aigrow.json +15 -15
  43. package/dist/capabilities/aimlapi.json +140 -143
  44. package/dist/capabilities/aixy.json +22 -22
  45. package/dist/capabilities/aki-io.json +12 -12
  46. package/dist/capabilities/alibaba-cn.json +98 -98
  47. package/dist/capabilities/alibaba-coding-plan-cn.json +3 -3
  48. package/dist/capabilities/alibaba-coding-plan.json +3 -3
  49. package/dist/capabilities/alibaba-token-plan-cn.json +48 -48
  50. package/dist/capabilities/alibaba-token-plan.json +51 -51
  51. package/dist/capabilities/alibaba.json +99 -65
  52. package/dist/capabilities/ambient.json +23 -16
  53. package/dist/capabilities/amd.json +7 -7
  54. package/dist/capabilities/anthropic.json +43 -43
  55. package/dist/capabilities/anyapi.json +13 -13
  56. package/dist/capabilities/apiko.json +2 -2
  57. package/dist/capabilities/arcee.json +9 -9
  58. package/dist/capabilities/augure.json +7 -7
  59. package/dist/capabilities/auriko.json +20 -20
  60. package/dist/capabilities/bailing.json +5 -5
  61. package/dist/capabilities/baseten.json +32 -32
  62. package/dist/capabilities/bee.json +3 -3
  63. package/dist/capabilities/berget.json +8 -8
  64. package/dist/capabilities/bothub.json +17 -17
  65. package/dist/capabilities/boundless.json +39 -39
  66. package/dist/capabilities/bumo.json +38 -38
  67. package/dist/capabilities/byteplus.json +32 -32
  68. package/dist/capabilities/cerebras.json +4 -4
  69. package/dist/capabilities/cheapaimodel.json +10 -10
  70. package/dist/capabilities/cheapest-token.json +30 -30
  71. package/dist/capabilities/chutes.json +10 -10
  72. package/dist/capabilities/clarifai.json +2 -2
  73. package/dist/capabilities/cline-pass.json +36 -36
  74. package/dist/capabilities/cloudcode.json +9 -9
  75. package/dist/capabilities/cloudflare-workers-ai.json +19 -19
  76. package/dist/capabilities/commandcode.json +145 -145
  77. package/dist/capabilities/concentrate.json +278 -295
  78. package/dist/capabilities/cortecs.json +109 -109
  79. package/dist/capabilities/crossmodel.json +200 -200
  80. package/dist/capabilities/crusoe.json +10 -10
  81. package/dist/capabilities/daoxe.json +6 -6
  82. package/dist/capabilities/databricks.json +124 -124
  83. package/dist/capabilities/deepinfra.json +98 -89
  84. package/dist/capabilities/deepseek.json +4 -4
  85. package/dist/capabilities/digitalocean.json +113 -113
  86. package/dist/capabilities/dothoosh.json +27 -27
  87. package/dist/capabilities/doubleword.json +23 -23
  88. package/dist/capabilities/edenai.json +283 -292
  89. package/dist/capabilities/empiriolabs.json +159 -159
  90. package/dist/capabilities/engy.json +23 -23
  91. package/dist/capabilities/entrim.json +2 -2
  92. package/dist/capabilities/evroc.json +16 -16
  93. package/dist/capabilities/ezkielyna.json +10 -10
  94. package/dist/capabilities/fastrouter.json +82 -82
  95. package/dist/capabilities/fireworks-ai.json +126 -65
  96. package/dist/capabilities/freemodel.json +15 -15
  97. package/dist/capabilities/friendli.json +8 -8
  98. package/dist/capabilities/frogbot.json +95 -95
  99. package/dist/capabilities/gisoo.json +15 -15
  100. package/dist/capabilities/gmicloud.json +13 -13
  101. package/dist/capabilities/google.json +54 -54
  102. package/dist/capabilities/graphn.json +16 -16
  103. package/dist/capabilities/greenpt.json +35 -35
  104. package/dist/capabilities/groq.json +9 -9
  105. package/dist/capabilities/helicone.json +84 -84
  106. package/dist/capabilities/hopper.json +2 -2
  107. package/dist/capabilities/hostinger-router.json +11 -11
  108. package/dist/capabilities/hpc-ai.json +7 -7
  109. package/dist/capabilities/huawei-maas.json +15 -15
  110. package/dist/capabilities/hubris.json +32 -32
  111. package/dist/capabilities/huggingface.json +118 -78
  112. package/dist/capabilities/hyper.json +20 -28
  113. package/dist/capabilities/impossibl.json +123 -123
  114. package/dist/capabilities/inception.json +3 -3
  115. package/dist/capabilities/inceptron.json +2 -2
  116. package/dist/capabilities/inco.json +5 -5
  117. package/dist/capabilities/infer.json +16 -16
  118. package/dist/capabilities/inferall.json +14 -14
  119. package/dist/capabilities/inference-coop.json +8 -8
  120. package/dist/capabilities/inferenceapis.json +15 -15
  121. package/dist/capabilities/inferris.json +2 -2
  122. package/dist/capabilities/infersia.json +9 -9
  123. package/dist/capabilities/inferx.json +2 -2
  124. package/dist/capabilities/infomaniak.json +4 -4
  125. package/dist/capabilities/io-net.json +2 -2
  126. package/dist/capabilities/isoquant.json +4 -4
  127. package/dist/capabilities/iteracompute.json +54 -54
  128. package/dist/capabilities/jalapeno.json +11 -11
  129. package/dist/capabilities/jiekou.json +63 -63
  130. package/dist/capabilities/jzstoken.json +50 -50
  131. package/dist/capabilities/keln.json +18 -18
  132. package/dist/capabilities/kenari.json +118 -126
  133. package/dist/capabilities/kilo.json +632 -638
  134. package/dist/capabilities/kimi-code-plan-cn.json +5 -5
  135. package/dist/capabilities/kimi-code-plan-global.json +5 -5
  136. package/dist/capabilities/klavo.json +20 -20
  137. package/dist/capabilities/korouter.json +34 -34
  138. package/dist/capabilities/kunavo.json +10 -10
  139. package/dist/capabilities/liquid.json +13 -13
  140. package/dist/capabilities/lithosai.json +2 -2
  141. package/dist/capabilities/llmgateway-providers.json +973 -917
  142. package/dist/capabilities/llmgateway.json +333 -333
  143. package/dist/capabilities/llmtr.json +29 -29
  144. package/dist/capabilities/logits.json +2 -2
  145. package/dist/capabilities/lowrouter.json +54 -54
  146. package/dist/capabilities/lyceum.json +14 -14
  147. package/dist/capabilities/melious.json +15 -15
  148. package/dist/capabilities/merge-gateway.json +244 -244
  149. package/dist/capabilities/meta.json +8 -8
  150. package/dist/capabilities/minimax-cn-coding-plan.json +5 -5
  151. package/dist/capabilities/minimax-cn.json +5 -5
  152. package/dist/capabilities/minimax-coding-plan.json +5 -5
  153. package/dist/capabilities/minimax.json +5 -5
  154. package/dist/capabilities/mistral.json +17 -17
  155. package/dist/capabilities/mixlayer.json +2 -2
  156. package/dist/capabilities/modal.json +10 -10
  157. package/dist/capabilities/model-oracle-ai.json +25 -25
  158. package/dist/capabilities/modelis.json +24 -24
  159. package/dist/capabilities/modelscope.json +2 -2
  160. package/dist/capabilities/modular.json +9 -9
  161. package/dist/capabilities/moneo.json +14 -14
  162. package/dist/capabilities/moonshotai-cn.json +7 -7
  163. package/dist/capabilities/moonshotai.json +7 -7
  164. package/dist/capabilities/morph.json +13 -13
  165. package/dist/capabilities/munito-eu.json +8 -8
  166. package/dist/capabilities/munito.json +8 -8
  167. package/dist/capabilities/nan.json +25 -25
  168. package/dist/capabilities/nano-gpt.json +573 -554
  169. package/dist/capabilities/nearai.json +89 -89
  170. package/dist/capabilities/nebius.json +30 -30
  171. package/dist/capabilities/neon.json +128 -128
  172. package/dist/capabilities/neuralwatt.json +41 -41
  173. package/dist/capabilities/novita-ai.json +171 -171
  174. package/dist/capabilities/nvidia.json +40 -40
  175. package/dist/capabilities/oathbreaker.json +2 -2
  176. package/dist/capabilities/obscurify.json +21 -21
  177. package/dist/capabilities/oci.json +10 -10
  178. package/dist/capabilities/ofox.json +375 -375
  179. package/dist/capabilities/ollama-cloud.json +51 -51
  180. package/dist/capabilities/openai.json +53 -53
  181. package/dist/capabilities/opencode-go.json +86 -86
  182. package/dist/capabilities/openreason.json +5 -5
  183. package/dist/capabilities/openrouter.json +557 -546
  184. package/dist/capabilities/opper.json +29 -29
  185. package/dist/capabilities/orcarouter.json +254 -254
  186. package/dist/capabilities/outerlabs.json +29 -29
  187. package/dist/capabilities/ovhcloud.json +23 -23
  188. package/dist/capabilities/pendra.json +4 -4
  189. package/dist/capabilities/perplexity-agent.json +55 -55
  190. package/dist/capabilities/perplexity.json +2 -2
  191. package/dist/capabilities/phala.json +34 -34
  192. package/dist/capabilities/pioneer.json +30 -30
  193. package/dist/capabilities/poe.json +126 -126
  194. package/dist/capabilities/powerspring.json +11 -11
  195. package/dist/capabilities/primalabs.json +10 -10
  196. package/dist/capabilities/prime.json +120 -119
  197. package/dist/capabilities/privatemode-ai.json +10 -10
  198. package/dist/capabilities/proxystacks.json +7 -7
  199. package/dist/capabilities/qiniu-ai.json +14 -14
  200. package/dist/capabilities/refuseless.json +9 -9
  201. package/dist/capabilities/regolo-ai.json +5 -5
  202. package/dist/capabilities/requesty.json +167 -190
  203. package/dist/capabilities/ruapi.json +17 -17
  204. package/dist/capabilities/runcrate.json +9 -9
  205. package/dist/capabilities/runinfra.json +10 -10
  206. package/dist/capabilities/sakana.json +6 -6
  207. package/dist/capabilities/sambanova.json +8 -8
  208. package/dist/capabilities/sandbase.json +21 -21
  209. package/dist/capabilities/sarvam.json +5 -5
  210. package/dist/capabilities/scaleway.json +18 -18
  211. package/dist/capabilities/scnet-token-plan.json +10 -10
  212. package/dist/capabilities/scx-ai.json +32 -32
  213. package/dist/capabilities/sensenova.json +14 -14
  214. package/dist/capabilities/siliconflow-cn.json +44 -44
  215. package/dist/capabilities/siliconflow.json +53 -53
  216. package/dist/capabilities/snowflake-cortex.json +22 -22
  217. package/dist/capabilities/sokkan.json +9 -9
  218. package/dist/capabilities/sparrowcodes.json +19 -19
  219. package/dist/capabilities/standardcompute.json +90 -90
  220. package/dist/capabilities/steadyrouter.json +42 -42
  221. package/dist/capabilities/stepfun-ai-step-plan.json +2 -2
  222. package/dist/capabilities/stepfun-ai.json +2 -2
  223. package/dist/capabilities/stepfun-step-plan.json +2 -2
  224. package/dist/capabilities/stepfun.json +2 -2
  225. package/dist/capabilities/stepping-stone.json +19 -19
  226. package/dist/capabilities/synthetic.json +10 -10
  227. package/dist/capabilities/synthorai.json +24 -24
  228. package/dist/capabilities/teamorouter.json +23 -23
  229. package/dist/capabilities/teapot-router.json +12 -12
  230. package/dist/capabilities/tencent-token-plan-intl.json +126 -0
  231. package/dist/capabilities/tencent-token-plan.json +39 -39
  232. package/dist/capabilities/tencent-tokenhub.json +56 -41
  233. package/dist/capabilities/tensorx.json +50 -50
  234. package/dist/capabilities/tenstorrent.json +6 -6
  235. package/dist/capabilities/the-grid-ai.json +33 -33
  236. package/dist/capabilities/thinkingmachines.json +77 -77
  237. package/dist/capabilities/tinfoil.json +12 -12
  238. package/dist/capabilities/toapis.json +2 -2
  239. package/dist/capabilities/togetherai.json +41 -41
  240. package/dist/capabilities/tokengo.json +22 -22
  241. package/dist/capabilities/tokenify.json +3 -3
  242. package/dist/capabilities/trustedrouter.json +7 -7
  243. package/dist/capabilities/trustedtokens.json +17 -17
  244. package/dist/capabilities/umans-ai-coding-plan.json +11 -11
  245. package/dist/capabilities/umans-ai.json +8 -8
  246. package/dist/capabilities/uncensuredai.json +5 -5
  247. package/dist/capabilities/unrestricted.json +4 -4
  248. package/dist/capabilities/uplinkswitch.json +21 -21
  249. package/dist/capabilities/upstage.json +6 -6
  250. package/dist/capabilities/vancine.json +24 -24
  251. package/dist/capabilities/vercel.json +582 -582
  252. package/dist/capabilities/vivgrid.json +86 -86
  253. package/dist/capabilities/volcengine-coding-plan.json +29 -29
  254. package/dist/capabilities/volcengine.json +23 -23
  255. package/dist/capabilities/vultr.json +27 -27
  256. package/dist/capabilities/wafer.ai.json +18 -18
  257. package/dist/capabilities/wallaby.json +2 -2
  258. package/dist/capabilities/wally.json +11 -11
  259. package/dist/capabilities/wandb.json +21 -21
  260. package/dist/capabilities/watt.json +20 -20
  261. package/dist/capabilities/xai.json +5 -5
  262. package/dist/capabilities/xiaomi-token-plan-ams.json +2 -2
  263. package/dist/capabilities/xiaomi-token-plan-cn.json +2 -2
  264. package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -2
  265. package/dist/capabilities/xiaomi.json +2 -2
  266. package/dist/capabilities/xpersona.json +10 -10
  267. package/dist/capabilities/xxapi.json +28 -28
  268. package/dist/capabilities/zai-coding-plan.json +18 -18
  269. package/dist/capabilities/zai.json +27 -27
  270. package/dist/capabilities/zenifra.json +26 -26
  271. package/dist/capabilities/zenmux.json +200 -200
  272. package/dist/capabilities/zerogpu.json +13 -13
  273. package/dist/capabilities/zhipuai-coding-plan.json +8 -8
  274. package/dist/capabilities/zhipuai.json +26 -26
  275. package/dist/capabilities/zro.json +7 -7
  276. package/dist/channels/agent-channels.d.ts +22 -0
  277. package/dist/channels/index.cjs +2 -2
  278. package/dist/channels/index.js +2 -2
  279. package/dist/channels/output-processor.d.ts +12 -0
  280. package/dist/channels/state-adapter.d.ts +3 -1
  281. package/dist/channels/stream-helpers.d.ts +17 -0
  282. package/dist/{channels-0AO7PMJF.js → channels-CC2Z4adP.js} +1 -1
  283. package/dist/{channels-BZL9RT2i.cjs → channels-Drxs9g13.cjs} +1 -1
  284. package/dist/coding-agent/index.cjs +2 -2
  285. package/dist/coding-agent/index.js +2 -2
  286. package/dist/{constants-B9ZDvXZ4.cjs → constants-Bou0hEgY.cjs} +4 -0
  287. package/dist/{constants-BmdTvEYN.js → constants-CFWgIaqA.js} +4 -0
  288. package/dist/datasets/experiment/scorer.d.ts +16 -5
  289. package/dist/datasets/index.cjs +2 -2
  290. package/dist/datasets/index.js +2 -2
  291. package/dist/docs/SKILL.md +2 -1
  292. package/dist/docs/assets/SOURCE_MAP.json +1032 -1032
  293. package/dist/docs/references/docs-agents-networks.md +1 -1
  294. package/dist/docs/references/docs-agents-tools.md +6 -0
  295. package/dist/docs/references/docs-auth-simple-auth.md +8 -8
  296. package/dist/docs/references/docs-evals-custom-scorers.md +1 -1
  297. package/dist/docs/references/docs-mastra-platform-observability-overview.md +3 -189
  298. package/dist/docs/references/docs-memory-message-history.md +25 -0
  299. package/dist/docs/references/docs-sandbox-lsp.md +5 -6
  300. package/dist/docs/references/docs-sandbox-overview.md +20 -0
  301. package/dist/docs/references/docs-sandbox-skills.md +2 -0
  302. package/dist/docs/references/docs-signals-sending-signals.md +1 -1
  303. package/dist/docs/references/reference-agent-controller-session.md +1 -1
  304. package/dist/docs/references/reference-agents-generate.md +1 -1
  305. package/dist/docs/references/reference-agents-network.md +1 -1
  306. package/dist/docs/references/reference-configuration.md +8 -8
  307. package/dist/docs/references/reference-core-getWorkspaceById.md +37 -0
  308. package/dist/docs/references/reference-evals-create-scorer.md +5 -5
  309. package/dist/docs/references/reference-evals-run-evals.md +1 -1
  310. package/dist/docs/references/reference-knowledge-knowledge-tools.md +3 -3
  311. package/dist/docs/references/reference-manual-install.md +1 -1
  312. package/dist/docs/references/reference-memory-observational-memory.md +8 -0
  313. package/dist/docs/references/reference-observability-tracing-interfaces.md +10 -6
  314. package/dist/docs/references/reference-processors-processor-interface.md +3 -2
  315. package/dist/docs/references/reference-processors-system-prompt-scrubber.md +1 -1
  316. package/dist/docs/references/reference-pubsub-base.md +5 -3
  317. package/dist/docs/references/reference-pubsub-caching-pubsub.md +3 -1
  318. package/dist/docs/references/reference-storage-overview.md +1 -1
  319. package/dist/docs/references/reference-storage-retention.md +20 -20
  320. package/dist/docs/references/reference-tools-vector-query-tool.md +8 -0
  321. package/dist/docs/references/reference-voice-overview.md +11 -26
  322. package/dist/docs/references/reference-voice-speech-to-speech.md +1 -1
  323. package/dist/docs/references/reference-voice-voice.listen.md +1 -0
  324. package/dist/docs/references/reference-voice-voice.speak.md +1 -3
  325. package/dist/docs/references/reference-workspace-factory-sandbox.md +6 -6
  326. package/dist/docs/references/reference-workspace-sandbox.md +14 -0
  327. package/dist/docs/references/reference.md +1 -0
  328. package/dist/evals/index.cjs +2 -2
  329. package/dist/evals/index.js +2 -2
  330. package/dist/evals/scoreTraces/index.cjs +2 -2
  331. package/dist/evals/scoreTraces/index.js +2 -2
  332. package/dist/harness/index.cjs +2 -2
  333. package/dist/harness/index.js +2 -2
  334. package/dist/index.cjs +1 -1
  335. package/dist/index.js +1 -1
  336. package/dist/knowledge/index.cjs +51 -16
  337. package/dist/knowledge/index.js +51 -16
  338. package/dist/knowledge/page-tools.d.ts +9 -0
  339. package/dist/knowledge/scope-runtime.d.ts +6 -0
  340. package/dist/llm/index.cjs +3 -3
  341. package/dist/llm/index.js +3 -3
  342. package/dist/llm/model/base.types.d.ts +3 -1
  343. package/dist/llm/model/mastra-gateway-provider-tools.d.ts +9 -6
  344. package/dist/llm/model/model.d.ts +1 -1
  345. package/dist/llm/model/model.loop.d.ts +1 -1
  346. package/dist/llm/model/model.loop.types.d.ts +3 -1
  347. package/dist/llm/model/provider-options.d.ts +4 -3
  348. package/dist/llm/model/provider-types.generated.d.ts +7932 -7894
  349. package/dist/{llm-B4AeSFvV.cjs → llm-CbpBEabY.cjs} +38 -78
  350. package/dist/{llm-B46V7Mi7.js → llm-D3y8qOKL.js} +38 -78
  351. package/dist/loop/index.cjs +2 -2
  352. package/dist/loop/index.js +2 -2
  353. package/dist/{manager-BwDxA1Nn.cjs → manager-BOn6RJwA.cjs} +106 -35
  354. package/dist/{manager-BRAvwB9b.js → manager-elIuArZa.js} +106 -35
  355. package/dist/mastra/index.cjs +1 -1
  356. package/dist/mastra/index.js +1 -1
  357. package/dist/{mastra-DBhdD172.cjs → mastra-CDQJWY6v.cjs} +16 -16
  358. package/dist/{mastra-CIx6qEq2.js → mastra-DQjco6Bt.js} +16 -16
  359. package/dist/memory/index.cjs +3 -3
  360. package/dist/memory/index.js +3 -3
  361. package/dist/{message-list-wI71UGxk.js → message-list-BGm1DCiG.js} +230 -129
  362. package/dist/{message-list-DfN9mWeN.cjs → message-list-vR3uLAHL.cjs} +230 -129
  363. package/dist/{model-CJMsDU8w.js → model-BjyU1L4I.js} +4 -3
  364. package/dist/{model-CYhAa5qO.cjs → model-C4aI7k-i.cjs} +4 -3
  365. package/dist/{netlify-Bw7Vd58y.cjs → netlify-BjuUEMrL.cjs} +41364 -30461
  366. package/dist/{netlify-C9aJA6Cv.js → netlify-BpB7PtZV.js} +41361 -30464
  367. package/dist/notifications/index.cjs +1 -1
  368. package/dist/notifications/index.js +1 -1
  369. package/dist/observability/types/tracing.d.ts +1 -1
  370. package/dist/processor-provider/index.cjs +1 -1
  371. package/dist/processor-provider/index.js +1 -1
  372. package/dist/processors/index.cjs +2 -2
  373. package/dist/processors/index.js +2 -2
  374. package/dist/{provider-registry-DOfYSEju.js → provider-registry-BjdxtGZZ.js} +22658 -22514
  375. package/dist/{provider-registry-Bn_7VvZ8.cjs → provider-registry-bkFdaY45.cjs} +22657 -22513
  376. package/dist/provider-registry.json +22617 -22527
  377. package/dist/{registry-generator-BnK5Npgr.cjs → registry-generator-BORKO0_T.cjs} +1 -1
  378. package/dist/{registry-generator-Cw594Ttt.js → registry-generator-CPF318Kc.js} +1 -1
  379. package/dist/{rehydrate-BWnd_TEx.cjs → rehydrate-Cps4MTph.cjs} +2 -2
  380. package/dist/{rehydrate-Dgqkw7Py.js → rehydrate-Cw2Id-Uz.js} +2 -2
  381. package/dist/relevance/index.cjs +2 -2
  382. package/dist/relevance/index.js +2 -2
  383. package/dist/{run-registry-lLRc7EE6.cjs → run-registry-BTFPEkXT.cjs} +368 -92
  384. package/dist/{run-registry-DhOKJtlb.js → run-registry-D5z2YVqJ.js} +356 -92
  385. package/dist/storage/constants.cjs +1 -1
  386. package/dist/storage/constants.js +1 -1
  387. package/dist/storage/domains/knowledge/base.d.ts +16 -1
  388. package/dist/storage/domains/knowledge/importers-inmemory.d.ts +1 -0
  389. package/dist/storage/domains/knowledge/importers.d.ts +8 -0
  390. package/dist/storage/domains/knowledge/inmemory.d.ts +1 -0
  391. package/dist/storage/domains/knowledge/pages-inmemory.d.ts +5 -1
  392. package/dist/storage/index.cjs +3 -3
  393. package/dist/storage/index.js +3 -3
  394. package/dist/storage/types.d.ts +8 -0
  395. package/dist/stream/index.cjs +2 -2
  396. package/dist/stream/index.js +2 -2
  397. package/dist/{stream-BIDts1fZ.cjs → stream-D1OnBHDi.cjs} +3 -3
  398. package/dist/{stream-C8HKG3qC.js → stream-DB5efioT.js} +3 -3
  399. package/dist/test-utils/llm-mock.cjs +1 -1
  400. package/dist/test-utils/llm-mock.js +1 -1
  401. package/dist/{to-prompt-B9eZo2U5.cjs → to-prompt-CG-LyaBY.cjs} +9 -0
  402. package/dist/{to-prompt-BsDtVXrf.js → to-prompt-CMlVGYxC.js} +9 -0
  403. package/dist/tool-loop-agent/index.cjs +1 -1
  404. package/dist/tool-loop-agent/index.js +1 -1
  405. package/dist/{tool-loop-agent-DM5V_0XS.js → tool-loop-agent-DkhFVx0h.js} +4 -4
  406. package/dist/{tool-loop-agent-PEY5a1R6.cjs → tool-loop-agent-Ote8gJMn.cjs} +4 -4
  407. package/dist/tools/index.cjs +1 -1
  408. package/dist/tools/index.js +1 -1
  409. package/dist/{tools-CDfyMpzN.js → tools-DDfA_ES4.js} +113 -31
  410. package/dist/{tools-CGF5Ik6j.cjs → tools-n9lqzDNe.cjs} +113 -31
  411. package/dist/{utils-DcnKVK34.js → utils-BTKpGHA6.js} +1 -1
  412. package/dist/{utils-CxMSu_wc.cjs → utils-Dl_UFejV.cjs} +1 -1
  413. package/dist/utils.cjs +1 -1
  414. package/dist/utils.js +1 -1
  415. package/dist/{validate-Dn750ciE.js → validate-D6fUqYGz.js} +1 -1
  416. package/dist/{validate-RVKgazCf.cjs → validate-DdDuQRoZ.cjs} +1 -1
  417. package/dist/vector/index.cjs +2 -2
  418. package/dist/vector/index.js +2 -2
  419. package/dist/worker/index.cjs +1 -1
  420. package/dist/worker/index.js +1 -1
  421. package/dist/{worker-Dx0ZHMGX.cjs → worker-B27B9RlK.cjs} +2 -2
  422. package/dist/{worker-SDi9jbP5.js → worker-Bo_hTQJC.js} +2 -2
  423. package/dist/{worker-DJPAdazC.js → worker-DC269pGx.js} +2 -2
  424. package/dist/{worker-CFPu9qwV.cjs → worker-mq-oiLa5.cjs} +2 -2
  425. package/dist/{workflow-ZFOz_365.cjs → workflow-D61dV4AC.cjs} +3 -3
  426. package/dist/{workflow-DkBqNn7X.js → workflow-D97r3h2-.js} +3 -3
  427. package/dist/workflows/builder/index.cjs +1 -1
  428. package/dist/workflows/builder/index.js +1 -1
  429. package/dist/workflows/evented/index.cjs +1 -1
  430. package/dist/workflows/evented/index.js +1 -1
  431. package/dist/workflows/index.cjs +4 -4
  432. package/dist/workflows/index.js +4 -4
  433. package/dist/workflows/step.d.ts +2 -0
  434. package/dist/workflows/workflow.d.ts +2 -0
  435. package/dist/workspace/index.cjs +3 -1
  436. package/dist/workspace/index.d.ts +1 -1
  437. package/dist/workspace/index.js +2 -2
  438. package/dist/workspace/lsp/manager.d.ts +19 -4
  439. package/dist/workspace/sandbox/mastra-sandbox.d.ts +17 -0
  440. package/dist/workspace/tools/index.d.ts +1 -0
  441. package/dist/workspace/tools/media.d.ts +20 -1
  442. package/dist/workspace/tools/recreate-sandbox.d.ts +24 -0
  443. package/dist/{workspace-DY2Nxiyi.js → workspace-BK9ltbSa.js} +270 -105
  444. package/dist/{workspace-X2RHJZU9.cjs → workspace-Pv3J8K0c.cjs} +281 -104
  445. package/package.json +9 -9
  446. package/src/llm/model/provider-types.generated.d.ts +7932 -7894
@@ -4,18 +4,18 @@ 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-C8HKG3qC.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-DB5efioT.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-wI71UGxk.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";
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-B46V7Mi7.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-D3y8qOKL.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";
18
- import { h as resolveFilePartMediaTypeAndData, m as parseDataUri, o as categorizeFileData } from "./to-prompt-BsDtVXrf.js";
18
+ import { h as resolveFilePartMediaTypeAndData, m as parseDataUri, o as categorizeFileData } from "./to-prompt-CMlVGYxC.js";
19
19
  import { c as parsePartialJson, h as tool$1, m as generateId$1, p as asSchema$1, r as embed$4, u as APICallError$1 } from "./dist-TPVqg8oV.js";
20
20
  import { n as embed$5 } from "./dist-D3cKCUe-.js";
21
21
  import { t as deepEqual$3 } from "./deep-equal-d1xU02ag.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-DOfYSEju.js";
27
+ import { c as modelSupportsStructuredOutput, l as modelSupportsTemperature } from "./provider-registry-BjdxtGZZ.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-CJMsDU8w.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-DcnKVK34.js";
30
+ import { t as MastraLLMV1 } from "./model-BjyU1L4I.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-BTKpGHA6.js";
32
32
  import { h as getWorkflowFGAResourceId, i as MastraFGAPermissions, y as requireFGA } from "./ee-iTj2bRDt-By_B9ngH.js";
33
- import { a as resolveBackgroundConfig, o as createBackgroundTask, t as generateBackgroundTaskSystemPrompt } from "./background-tasks-E-Jjxks4.js";
33
+ import { a as resolveBackgroundConfig, o as createBackgroundTask, t as generateBackgroundTaskSystemPrompt } from "./background-tasks-CBp2178j.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";
@@ -39,11 +39,11 @@ import { HAND_BACK_STATE_SYMBOL, PARENT_STATE_SYMBOL, PUBSUB_SYMBOL, STREAM_FORM
39
39
  import { i as executeHook } from "./hooks-Bth8Cjpj.js";
40
40
  import { o as assertValidScheduleDefinition, v as validateScheduleTiming } from "./schedules-DZfSx-7P.js";
41
41
  import { A as writeObjective, D as readObjective, O as resolveEffectiveGoalSettings, T as formatGoalBudgetPausedReason, _ as clearCachedGoalObjective, b as GOAL_SCORER_ID, g as cacheGoalObjective, k as resolveGoalStore, w as clearObjective, x as GOAL_SCORE_WAITING } from "./state-processor-B9kxpM53.js";
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-BmdTvEYN.js";
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 { N as LocalSandbox, at as LocalFilesystem, dt as sliceByTokensSafe, ft as estimateTokenCount, it as normalizeReadTrackerPath, lt as WORKSPACE_TOOLS, m as resolveToolConfig, mt as shellQuote, o as Workspace, p as createWorkspaceTools, pt as sliceByTokens, rt as evaluateReadRecord, s as createSkillTools, st as CompositeFilesystem } from "./workspace-DY2Nxiyi.js";
46
- import { i as normalizeWebSearchProvider, n as createWebSearchProviderTool, r as isWebSearchTool } from "./tools-CDfyMpzN.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-BK9ltbSa.js";
46
+ import { i as normalizeWebSearchProvider, n as createWebSearchProviderTool, r as isWebSearchTool } from "./tools-DDfA_ES4.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";
49
49
  import { coreFeatures } from "./features/index.js";
@@ -65,11 +65,11 @@ import { ReadableStream as ReadableStream$1, TransformStream as TransformStream$
65
65
  import { injectJsonInstructionIntoMessages, isAbortError } from "@ai-sdk/provider-utils-v6";
66
66
  import { z as z$1 } from "zod";
67
67
  import { createHash, randomUUID } from "crypto";
68
+ import { config, toJSONSchema } from "zod/v4/core";
69
+ import en from "zod/v4/locales/en.js";
68
70
  import { prepareJsonSchemaForOpenAIStrictMode, wrapSchemaWithNullTransform } from "@mastra/schema-compat";
69
71
  import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
70
72
  import { dirname, extname, isAbsolute, join, normalize, posix, relative, resolve, sep, win32 } from "path";
71
- import { config, toJSONSchema } from "zod/v4/core";
72
- import en from "zod/v4/locales/en.js";
73
73
  import { jsonSchemaToZod } from "@mastra/schema-compat/json-to-zod";
74
74
  import { AsyncLocalStorage } from "async_hooks";
75
75
  import fastq from "fastq";
@@ -7613,6 +7613,7 @@ function createStepFromProcessor$1(processor) {
7613
7613
  };
7614
7614
  const step = {
7615
7615
  id: `processor:${processor.id}`,
7616
+ processorId: processor.id,
7616
7617
  description: processor.name ?? `Processor ${processor.id}`,
7617
7618
  inputSchema: toStandardSchema(ProcessorStepInputSchema),
7618
7619
  outputSchema: toStandardSchema(ProcessorStepOutputSchema),
@@ -8258,7 +8259,8 @@ function cloneStep$1(step, opts) {
8258
8259
  retries: step.retries,
8259
8260
  scorers: step.scorers,
8260
8261
  component: step.component,
8261
- metadata: step.metadata
8262
+ metadata: step.metadata,
8263
+ processorId: step.processorId
8262
8264
  };
8263
8265
  }
8264
8266
  /**
@@ -11708,6 +11710,21 @@ function warnUnsupportedEventedSetup(mastra, workflowsStore) {
11708
11710
  warnedHosts.add(mastra);
11709
11711
  mastra.getLogger()?.warn(`Evented workflows and agents aren't supported on several processes with this setup: ${missing}. See ${DOCS_URL}`);
11710
11712
  }
11713
+ // src/agent-controller/worker-run-binding.ts
11714
+ const CONTROLLER_RUN_BINDING_KEY = "mastra__controllerRunBinding";
11715
+ const controllerRunBindingSchema = z.object({
11716
+ controllerId: z.string().min(1),
11717
+ agentId: z.string().min(1),
11718
+ sessionId: z.string().min(1),
11719
+ ownerId: z.string(),
11720
+ resourceId: z.string().min(1),
11721
+ threadId: z.string().min(1),
11722
+ modeId: z.string().min(1)
11723
+ });
11724
+ const restoredWorkerControllerContexts = /* @__PURE__ */ new WeakSet();
11725
+ function isRestoredWorkerControllerContext(value) {
11726
+ return typeof value === "object" && value !== null && restoredWorkerControllerContexts.has(value);
11727
+ }
11711
11728
  // src/agent/scopes.ts
11712
11729
  /**
11713
11730
  * Scope types Memory reads as the run's identity. Every other scope type is
@@ -11996,6 +12013,7 @@ function snapshotRequestContextEntries(requestContext, onEntryOmitted) {
11996
12013
  if (key === "mastra__versions") continue;
11997
12014
  if (key === "mastra__durableExecutions") continue;
11998
12015
  if (key === "mastra__durableSegments") continue;
12016
+ if (key === "__mastra_chat_channel_render") continue;
11999
12017
  const json = boundedStringify(value);
12000
12018
  if (json === void 0) {
12001
12019
  onEntryOmitted?.();
@@ -12022,6 +12040,8 @@ function restoreRequestContext(entries, runLevel, liveRunContext) {
12022
12040
  if (liveRunContext) return liveRunContext;
12023
12041
  if (entries) {
12024
12042
  const restored = new RequestContext([...Object.entries(withoutLiveRequestKeys(entries)), ...liveRequestEntries(runLevel)]);
12043
+ const controller = runLevel?.get("controller");
12044
+ if (isRestoredWorkerControllerContext(controller)) restored.set("controller", controller);
12025
12045
  restoreRunAgentScopes(restored);
12026
12046
  return restored;
12027
12047
  }
@@ -15485,7 +15505,8 @@ var StepExecutor = class extends MastraBase {
15485
15505
  return storageV2StepResultAccessors((step) => getHydratedStepResult(stepResults, step, hydrate));
15486
15506
  }
15487
15507
  async execute(params) {
15488
- const { entry, stepResults, runId, requestContext, retryCount = 0, perStep } = params;
15508
+ const { entry, stepResults, runId, retryCount = 0, perStep } = params;
15509
+ let { requestContext } = params;
15489
15510
  const stepId = getEntryId(entry);
15490
15511
  const errorAttemptId = `${runId}:${stepId}:${params.foreachIdx ?? ""}:attempt:${retryCount}`;
15491
15512
  const schemas = getEntrySchemas(entry, this.mastra);
@@ -15541,6 +15562,18 @@ var StepExecutor = class extends MastraBase {
15541
15562
  const stepTracingContext = workflowStepSpan ? { currentSpan: workflowStepSpan } : params.tracingContext ?? {};
15542
15563
  try {
15543
15564
  if (validationError) throw validationError;
15565
+ if (params.workflowId === DurableStepIds.AGENTIC_LOOP || params.workflowId === DurableStepIds.AGENTIC_EXECUTION) {
15566
+ const live = requestContext.get("controller");
15567
+ const initial = stepResults.input;
15568
+ const binding = initial?.requestContextEntries?.[CONTROLLER_RUN_BINDING_KEY];
15569
+ if (initial && binding !== void 0 && typeof live?.getState !== "function") {
15570
+ const parsed = controllerRunBindingSchema.parse(binding);
15571
+ if (initial.agentId !== parsed.agentId || initial.state?.threadId !== parsed.threadId || initial.state.resourceId !== parsed.resourceId) throw new Error("Controller binding does not match this durable run");
15572
+ const controller = this.mastra?.getAgentControllerById(parsed.controllerId);
15573
+ if (!controller) throw new Error("Controller is not registered on this worker");
15574
+ requestContext = await controller.__restoreWorkerRequestContext(requestContext, parsed, abortController.signal, initial.runId);
15575
+ }
15576
+ }
15544
15577
  const callId = globalThis.crypto.randomUUID();
15545
15578
  const outputWriter = this.createOutputWriter(runId);
15546
15579
  const stepOutput = await executeWithContext({
@@ -21337,7 +21370,8 @@ function cloneStep(step, opts) {
21337
21370
  retries: step.retries,
21338
21371
  scorers: step.scorers,
21339
21372
  metadata: step.metadata,
21340
- component: step.component
21373
+ component: step.component,
21374
+ processorId: step.processorId
21341
21375
  };
21342
21376
  }
21343
21377
  function isToolStep(input) {
@@ -21597,6 +21631,7 @@ function createStepFromProcessor(processor) {
21597
21631
  };
21598
21632
  return {
21599
21633
  id: `processor:${processor.id}`,
21634
+ processorId: processor.id,
21600
21635
  description: processor.name ?? `Processor ${processor.id}`,
21601
21636
  inputSchema: toStandardSchema(ProcessorStepSchema),
21602
21637
  outputSchema: toStandardSchema(ProcessorStepOutputSchema),
@@ -27746,12 +27781,14 @@ async function partitionMessages(messagesDescending, limits, tokenCounter, initi
27746
27781
  if (maxTokens !== void 0 && !tokenCounter) throw new Error("A token counter is required to load token-limited message history");
27747
27782
  let messageCount = 0;
27748
27783
  let tokenCount = initialTokens;
27784
+ let loadedTokens = initialTokens;
27749
27785
  let reachedLimit = false;
27750
27786
  let overflowReason;
27751
27787
  const retainedIds = /* @__PURE__ */ new Set();
27752
27788
  for (const group of groupLinkedToolMessages(messagesDescending)) {
27753
27789
  let groupTokens = 0;
27754
27790
  if (tokenCounter) for (const message of group) groupTokens += await tokenCounter.countMessage(message);
27791
+ loadedTokens += groupTokens;
27755
27792
  const exceedsMessageLimit = limits.maxMessages !== void 0 && messageCount + group.length > limits.maxMessages;
27756
27793
  const exceedsTokenLimit = maxTokens !== void 0 && tokenCount + groupTokens > maxTokens;
27757
27794
  if (reachedLimit || exceedsMessageLimit || exceedsTokenLimit) {
@@ -27766,7 +27803,8 @@ async function partitionMessages(messagesDescending, limits, tokenCounter, initi
27766
27803
  return {
27767
27804
  messages: messagesDescending.filter((message) => retainedIds.has(message.id)).reverse(),
27768
27805
  overflow: messagesDescending.filter((message) => !retainedIds.has(message.id)).reverse(),
27769
- overflowReason
27806
+ overflowReason,
27807
+ loadedTokens
27770
27808
  };
27771
27809
  }
27772
27810
  function laterDate(left, right) {
@@ -27828,15 +27866,15 @@ async function loadMessageHistory(args) {
27828
27866
  const newestOverflow = partitioned.overflow.at(-1);
27829
27867
  if (newestOverflow) cutoffTimestamp = newestOverflow.createdAt.getTime();
27830
27868
  const oldestTimestamp = result.messages.at(-1)?.createdAt.getTime();
27831
- const crossedCutoff = cutoffTimestamp !== void 0 && oldestTimestamp !== void 0 && oldestTimestamp < cutoffTimestamp;
27869
+ const crossedCutoff = cutoffTimestamp !== void 0 && oldestTimestamp !== void 0 && oldestTimestamp < cutoffTimestamp && (!args.includeOverflow || partitioned.overflowReason !== "tokens" || partitioned.loadedTokens > (args.maxTokens ?? 0));
27832
27870
  const reachedBoundary = args.boundary !== void 0 && oldestTimestamp !== void 0 && oldestTimestamp < new Date(args.boundary.createdAt).getTime();
27833
- if (!result.hasMore || crossedCutoff || reachedBoundary || result.messages.length === 0) return args.includeOverflow && partitioned.overflowReason === "tokens" ? partitioned : {
27871
+ if (!result.hasMore || crossedCutoff || reachedBoundary || result.messages.length === 0) return {
27834
27872
  messages: partitioned.messages,
27835
- overflow: []
27873
+ overflow: args.includeOverflow && partitioned.overflowReason === "tokens" ? partitioned.overflow : []
27836
27874
  };
27837
- if (oldestTimestamp === void 0) return args.includeOverflow && partitioned.overflowReason === "tokens" ? partitioned : {
27875
+ if (oldestTimestamp === void 0) return {
27838
27876
  messages: partitioned.messages,
27839
- overflow: []
27877
+ overflow: args.includeOverflow && partitioned.overflowReason === "tokens" ? partitioned.overflow : []
27840
27878
  };
27841
27879
  if (end?.getTime() === oldestTimestamp && added === 0) page++;
27842
27880
  else {
@@ -38723,6 +38761,7 @@ var ExperimentsInMemory = class extends ExperimentsStorage {
38723
38761
  targetType: input.targetType ?? null,
38724
38762
  targetId: input.targetId ?? null,
38725
38763
  scorerIds: input.scorerIds ?? null,
38764
+ scorerVersions: input.scorerVersions ?? null,
38726
38765
  name: input.name,
38727
38766
  description: input.description,
38728
38767
  metadata: input.metadata,
@@ -39629,6 +39668,31 @@ var KnowledgeStorage = class extends StorageDomain {
39629
39668
  getPages(_input) {
39630
39669
  return Promise.reject(new KnowledgeUnsupportedCapabilityError("getPages"));
39631
39670
  }
39671
+ /**
39672
+ * The page `parentId` and its ancestors, nearest first: for each row what {@link getPage} would
39673
+ * return with the same `read`, deleted rows included. Stops after the first scope page, before
39674
+ * the first row `getPage` would return null for, or after {@link MAX_KNOWLEDGE_PAGE_DEPTH} + 1
39675
+ * rows. Lets a caller holding a page walk its parents in one call instead of one per level.
39676
+ *
39677
+ * The base class reads one {@link getPage} per level; adapters that can read the chain in one
39678
+ * query override it.
39679
+ *
39680
+ * @experimental
39681
+ */
39682
+ async getPageParents(input) {
39683
+ const parents = [];
39684
+ let id = input.parentId;
39685
+ while (id && parents.length <= 10) {
39686
+ const page = await this.getPage({
39687
+ id,
39688
+ read: input.read
39689
+ });
39690
+ if (!page) break;
39691
+ parents.push(page);
39692
+ id = page.isScope ? null : page.parentId;
39693
+ }
39694
+ return parents;
39695
+ }
39632
39696
  getPageByPath(_input) {
39633
39697
  return Promise.reject(new KnowledgeUnsupportedCapabilityError("getPageByPath"));
39634
39698
  }
@@ -39946,6 +40010,12 @@ var InMemoryKnowledgeImportersStorage = class extends KnowledgeImportersStorage
39946
40010
  const node = this.#s.nodes.get(key(bindingId, sourceId));
39947
40011
  return node ? structuredClone(node) : null;
39948
40012
  }
40013
+ async getNodes(bindingId, sourceIds) {
40014
+ return [...new Set(sourceIds)].flatMap((sourceId) => {
40015
+ const node = this.#s.nodes.get(key(bindingId, sourceId));
40016
+ return node ? [structuredClone(node)] : [];
40017
+ });
40018
+ }
39949
40019
  async getNodeByPage(pageId) {
39950
40020
  const node = [...this.#s.nodes.values()].find((n) => n.pageId === pageId);
39951
40021
  return node ? structuredClone(node) : null;
@@ -40336,6 +40406,15 @@ var InMemoryKnowledgePageStore = class {
40336
40406
  const page = this.#pages.get(input.id);
40337
40407
  return page && this.#pageReadable(page, input.read) ? clone$1(page) : null;
40338
40408
  }
40409
+ async getPageParents(input) {
40410
+ const parents = [];
40411
+ let page = this.#pages.get(input.parentId);
40412
+ while (page && this.#pageReadable(page, input.read) && parents.length <= 10) {
40413
+ parents.push(clone$1(page));
40414
+ page = page.isScope || !page.parentId ? void 0 : this.#pages.get(page.parentId);
40415
+ }
40416
+ return parents;
40417
+ }
40339
40418
  async getPages(input) {
40340
40419
  return [...new Set(input.ids)].map((id) => this.#pages.get(id)).filter((page) => !!page && !page.deletedAt && this.#pageReadable(page, input.read)).map(clone$1);
40341
40420
  }
@@ -40843,6 +40922,9 @@ var InMemoryKnowledgeStorage = class extends KnowledgeStorage {
40843
40922
  getPage(input) {
40844
40923
  return this.#pageStore.getPage(input);
40845
40924
  }
40925
+ getPageParents(input) {
40926
+ return this.#pageStore.getPageParents(input);
40927
+ }
40846
40928
  listScopeDeclarations() {
40847
40929
  return this.#pageStore.listScopeDeclarations();
40848
40930
  }
@@ -47884,6 +47966,32 @@ function chunkToFallbackMessage(chunk) {
47884
47966
  if (chunk.type === "plan_update") return chunk.title && chunk.title.length > 0 ? chunk.title : null;
47885
47967
  return null;
47886
47968
  }
47969
+ /** Whitespace plus the meaningful joiners ZWNJ (U+200C) and ZWJ (U+200D). */
47970
+ const EDGE_PADDING = /[\s\u200C\u200D]/;
47971
+ /**
47972
+ * Sanitize a buffered channel reply before posting.
47973
+ *
47974
+ * Zero-width space (U+200B) and the byte-order mark (U+FEFF) are invisible
47975
+ * padding and are removed everywhere. Whitespace and the joiners ZWNJ
47976
+ * (U+200C) / ZWJ (U+200D) are trimmed only at the edges, so internal joiners
47977
+ * in compound emoji (🏄🏼‍♂️, 👨‍👩‍👧) and scripts such as Persian (می‌خواهم)
47978
+ * survive — the bug behind #31205. Invisible-only input collapses to '' so
47979
+ * callers skip posting it entirely.
47980
+ *
47981
+ * The edge trim is a single-pass scan rather than
47982
+ * `.replace(/^[\s\u200C\u200D]+|[\s\u200C\u200D]+$/g, '')`: that anchored
47983
+ * alternation backtracks quadratically over a long interior run of the class
47984
+ * (a 300k-character run of model-controlled output took ~80s), while this
47985
+ * scan is O(n).
47986
+ */
47987
+ function cleanBufferedText(input) {
47988
+ const stripped = input.replace(/[\u200B\uFEFF]/g, "");
47989
+ let start = 0;
47990
+ let end = stripped.length;
47991
+ while (start < end && EDGE_PADDING.test(stripped.charAt(start))) start++;
47992
+ while (end > start && EDGE_PADDING.test(stripped.charAt(end - 1))) end--;
47993
+ return start === 0 && end === stripped.length ? stripped : stripped.slice(start, end);
47994
+ }
47887
47995
  // src/channels/chat-driver-static.ts
47888
47996
  /**
47889
47997
  * Static (non-streaming) driver: consumes `AgentChunkType<any>` chunks and
@@ -47928,7 +48036,7 @@ async function runStaticDriver({ stream, chatThread, adapter, toolDisplay, toolD
47928
48036
  let textBuffer = "";
47929
48037
  const toolMessageIds = /* @__PURE__ */ new Map();
47930
48038
  const flushText = async () => {
47931
- const cleaned = textBuffer.replace(/[\u200B-\u200D\uFEFF]/g, "").trim();
48039
+ const cleaned = cleanBufferedText(textBuffer);
47932
48040
  if (cleaned) try {
47933
48041
  await chatThread.post(textFormat === "plain" ? cleaned : { markdown: cleaned });
47934
48042
  } catch (e) {
@@ -48263,7 +48371,7 @@ async function runStreamingDriver({ stream, chatThread, adapter, toolDisplay, to
48263
48371
  if (closed) break;
48264
48372
  await waitForNext();
48265
48373
  }
48266
- const cleaned = fallback.replace(/[\u200B-\u200D\uFEFF]/g, "").trim();
48374
+ const cleaned = cleanBufferedText(fallback);
48267
48375
  if (cleaned) try {
48268
48376
  await chatThread.post(textFormat === "plain" ? cleaned : { markdown: cleaned });
48269
48377
  } catch (postErr) {
@@ -48746,6 +48854,20 @@ const TEXT_CHUNK_TYPES = /* @__PURE__ */ new Set([
48746
48854
  /** Key the processor reads off `requestContext` to locate its render deps. */
48747
48855
  const CHAT_CHANNEL_RENDER_CONTEXT_KEY = "__mastra_chat_channel_render";
48748
48856
  /**
48857
+ * Whether a `requestContext` entry is a live render context rather than the
48858
+ * method-less husk a JSON snapshot round-trip leaves behind (issue #31310).
48859
+ * `wrapStream` is the first method the session calls, so its presence is the
48860
+ * signal that the object is usable.
48861
+ *
48862
+ * Every reader that treats a stashed render context as a live object (the
48863
+ * output processor, `resolveChannelRenderContext`, `AgentChannels.resolveRunRender`
48864
+ * and the generative-UI processor) guards with this, so a husk on a replica's
48865
+ * restored `requestContext` always falls through to a rebuild from the thread.
48866
+ */
48867
+ function isUsableRenderContext(value) {
48868
+ return typeof value === "object" && value !== null && typeof value.wrapStream === "function";
48869
+ }
48870
+ /**
48749
48871
  * Single-producer / single-consumer async queue. The processor pushes chunks
48750
48872
  * synchronously from `processOutputStream`; the driver consumes them via the
48751
48873
  * async iterable. `close()` ends the iteration after pending items are drained.
@@ -48879,7 +49001,7 @@ var ChatChannelOutputProcessor = class {
48879
49001
  async #resolveRenderContext(state, requestContext) {
48880
49002
  if (state.render !== void 0) return state.render;
48881
49003
  const fromRequest = requestContext?.get(CHAT_CHANNEL_RENDER_CONTEXT_KEY);
48882
- if (fromRequest) {
49004
+ if (isUsableRenderContext(fromRequest)) {
48883
49005
  state.render = fromRequest;
48884
49006
  return fromRequest;
48885
49007
  }
@@ -49052,7 +49174,7 @@ var ChatChannelGenerativeUIProcessor = class {
49052
49174
  }
49053
49175
  async #resolve(requestContext, state) {
49054
49176
  const inbound = requestContext?.get(CHAT_CHANNEL_RENDER_CONTEXT_KEY);
49055
- if (inbound) return inbound;
49177
+ if (isUsableRenderContext(inbound)) return inbound;
49056
49178
  if (state && "render" in state) return state.render ?? void 0;
49057
49179
  const threadId = parseMemoryRequestContext(requestContext)?.thread?.id;
49058
49180
  const render = threadId && this.#channels ? await this.#channels.buildRenderContextForThread(threadId) : null;
@@ -49206,6 +49328,8 @@ async function headContentType(url, logger) {
49206
49328
  }
49207
49329
  }
49208
49330
  // src/channels/processor.ts
49331
+ /** Per-run `state` key caching a thread's display mode recovered without a render context. */
49332
+ const RECOVERED_DISPLAY_KEY = "threadTextHidden";
49209
49333
  /**
49210
49334
  * Input processor that injects channel context (platform, bot identity, DM vs.
49211
49335
  * public-channel guidance) into the agent's system prompt on every step.
@@ -49239,19 +49363,37 @@ var ChatChannelProcessor = class {
49239
49363
  }
49240
49364
  async #resolve(requestContext, state) {
49241
49365
  const channel = requestContext?.get("channel");
49242
- if (channel) return {
49243
- channel,
49244
- textHidden: (requestContext?.get(CHAT_CHANNEL_RENDER_CONTEXT_KEY))?.textDisplay === "hidden"
49245
- };
49366
+ if (channel) {
49367
+ const render = requestContext?.get(CHAT_CHANNEL_RENDER_CONTEXT_KEY);
49368
+ return {
49369
+ channel,
49370
+ textHidden: isUsableRenderContext(render) ? render.textDisplay === "hidden" : await this.#recoverTextHidden(requestContext, state)
49371
+ };
49372
+ }
49246
49373
  if (state && "thread" in state) return state.thread ?? void 0;
49374
+ const resolved = await this.#resolveThread(requestContext);
49375
+ if (state) state.thread = resolved;
49376
+ return resolved ?? void 0;
49377
+ }
49378
+ /** The channel-backed context of the run's memory thread, or `null` when it has none. */
49379
+ async #resolveThread(requestContext) {
49247
49380
  const threadId = parseMemoryRequestContext(requestContext)?.thread?.id;
49248
49381
  const found = threadId && this.#channels ? await this.#channels.buildChannelContextForThread(threadId) : null;
49249
- const resolved = found ? {
49382
+ return found ? {
49250
49383
  channel: found.channel,
49251
49384
  textHidden: found.render.textDisplay === "hidden"
49252
49385
  } : null;
49253
- if (state) state.thread = resolved;
49254
- return resolved ?? void 0;
49386
+ }
49387
+ /**
49388
+ * Display mode of a channel-backed thread whose render context is no longer on the
49389
+ * restored request context. Cached per run like the thread lookup above, so later
49390
+ * steps of the same run read the thread once.
49391
+ */
49392
+ async #recoverTextHidden(requestContext, state) {
49393
+ if (state && RECOVERED_DISPLAY_KEY in state) return state[RECOVERED_DISPLAY_KEY] === true;
49394
+ const textHidden = (await this.#resolveThread(requestContext))?.textHidden ?? false;
49395
+ if (state) state[RECOVERED_DISPLAY_KEY] = textHidden;
49396
+ return textHidden;
49255
49397
  }
49256
49398
  };
49257
49399
  function channelLines(ctx, textHidden, tools) {
@@ -49774,15 +49916,17 @@ var ChannelReplyModeProcessor = class {
49774
49916
  var MastraStateAdapter = class {
49775
49917
  memoryStore;
49776
49918
  getOwnerId;
49919
+ logger;
49777
49920
  connected = false;
49778
49921
  connectPromise = null;
49779
49922
  cache = /* @__PURE__ */ new Map();
49780
49923
  locks = /* @__PURE__ */ new Map();
49781
49924
  lists = /* @__PURE__ */ new Map();
49782
49925
  queues = /* @__PURE__ */ new Map();
49783
- constructor(memoryStore, getOwnerId) {
49926
+ constructor(memoryStore, getOwnerId, logger) {
49784
49927
  this.memoryStore = memoryStore;
49785
49928
  this.getOwnerId = getOwnerId;
49929
+ this.logger = logger;
49786
49930
  }
49787
49931
  async connect() {
49788
49932
  if (this.connected) return;
@@ -49801,7 +49945,10 @@ var MastraStateAdapter = class {
49801
49945
  }
49802
49946
  async subscribe(threadId) {
49803
49947
  const thread = await this.findThreadByExternalId(threadId);
49804
- if (!thread) return;
49948
+ if (!thread) {
49949
+ this.logger?.warn(`subscribe(${threadId}) ignored: no Mastra thread is mapped to this chat thread. Use AgentChannels.subscribeThread() for threads the bot started itself.`);
49950
+ return;
49951
+ }
49805
49952
  await this.memoryStore.patchThread({
49806
49953
  id: thread.id,
49807
49954
  metadata: {
@@ -50193,7 +50340,7 @@ function formatLegacyHistoryBlock(history, chatThread, platform) {
50193
50340
  async function resolveChannelRenderContext(requestContext, channels) {
50194
50341
  if (!requestContext) return void 0;
50195
50342
  const stashed = requestContext.get(CHAT_CHANNEL_RENDER_CONTEXT_KEY);
50196
- if (stashed) return stashed;
50343
+ if (isUsableRenderContext(stashed)) return stashed;
50197
50344
  const threadId = requestContext.get("controller")?.threadId ?? parseMemoryRequestContext(requestContext)?.thread?.id;
50198
50345
  if (!threadId) return void 0;
50199
50346
  return await channels?.()?.buildRenderContextForThread(threadId) ?? void 0;
@@ -50637,7 +50784,7 @@ var AgentChannels = class {
50637
50784
  const storage = mastra.getStorage();
50638
50785
  const memoryStore = storage ? await storage.getStore("memory") : void 0;
50639
50786
  if (!memoryStore) throw new Error("Channels require storage to be configured on the Mastra instance. Configure a storage provider like LibSQLStore.");
50640
- this.stateAdapter = new MastraStateAdapter(memoryStore, () => this.getOwnerId());
50787
+ this.stateAdapter = new MastraStateAdapter(memoryStore, () => this.getOwnerId(), this.logger);
50641
50788
  this.log("info", "Using MastraStateAdapter (subscriptions persist across restarts)");
50642
50789
  }
50643
50790
  const { Chat, Message: ChatMessage, ThreadImpl } = await getChatModule();
@@ -50865,25 +51012,30 @@ var AgentChannels = class {
50865
51012
  runId = stashed.runId;
50866
51013
  toolName = stashed.toolName;
50867
51014
  toolArgs = stashed.args;
50868
- } else {
51015
+ }
51016
+ if (!requesterId) {
50869
51017
  const { result: lookup } = await this.lookupPersistedApproval({
50870
51018
  mastra,
50871
51019
  card,
50872
51020
  platform
50873
51021
  });
50874
- if (lookup.status === "answered") {
50875
- this.log("info", "Tool approval already answered", actionEventContext);
50876
- return;
51022
+ if (!stashed?.runId) {
51023
+ if (lookup.status === "answered") {
51024
+ this.log("info", "Tool approval already answered", actionEventContext);
51025
+ return;
51026
+ }
51027
+ if (lookup.status === "pending") {
51028
+ runId = lookup.runId;
51029
+ toolName = lookup.toolName;
51030
+ toolArgs = lookup.args;
51031
+ }
50877
51032
  }
50878
51033
  if (lookup.status === "pending") {
50879
- runId = lookup.runId;
50880
- toolName = lookup.toolName;
50881
- toolArgs = lookup.args;
50882
- if (adapterConfig?.toolApprovers !== "anyone" && !requesterId && lookup.authors.length > 1) {
51034
+ if (adapterConfig?.toolApprovers !== "anyone" && lookup.authors.length > 1) {
50883
51035
  this.log("info", "Ignoring tool approval action: requester is ambiguous", actionEventContext);
50884
51036
  return;
50885
51037
  }
50886
- requesterId ??= lookup.authors[0];
51038
+ requesterId = lookup.authors[0];
50887
51039
  }
50888
51040
  }
50889
51041
  if (!runId) {
@@ -51188,7 +51340,7 @@ var AgentChannels = class {
51188
51340
  */
51189
51341
  async resolveRunRender(requestContext, state) {
51190
51342
  const inbound = requestContext?.get(CHAT_CHANNEL_RENDER_CONTEXT_KEY);
51191
- if (inbound) return inbound;
51343
+ if (isUsableRenderContext(inbound)) return inbound;
51192
51344
  if (state && "render" in state) return state.render ?? void 0;
51193
51345
  const render = await resolveChannelRenderContext(requestContext, () => this);
51194
51346
  if (state) state.render = render ?? null;
@@ -51217,8 +51369,8 @@ var AgentChannels = class {
51217
51369
  const has = (id) => configuredProcessors.some((p) => !isProcessorWorkflow(p) && p.id === id);
51218
51370
  const processors = [];
51219
51371
  if (Object.values(this.adapterConfigs).some((cfg) => cfg.threadLink) && !has(THREAD_LINK_PROCESSOR_ID)) processors.push(new ChannelThreadLinkProcessor((requestContext) => {
51220
- const render = requestContext.get(CHAT_CHANNEL_RENDER_CONTEXT_KEY);
51221
- return render && threadLinkOptions(this.adapterConfigs[render.platform]?.threadLink);
51372
+ const platform = requestContext.get("channel")?.platform ?? requestContext.get("__mastra_chat_channel_render")?.platform;
51373
+ return platform ? threadLinkOptions(this.adapterConfigs[platform]?.threadLink) : void 0;
51222
51374
  }));
51223
51375
  if (!has("chat-channel-render")) processors.push(new ChatChannelOutputProcessor(this));
51224
51376
  if (this.replyModeEnabled && !has(REPLY_STREAM_PROCESSOR_ID)) processors.push(new ChannelReplyStreamProcessor((requestContext) => this.resolveRunRender(requestContext)));
@@ -52400,6 +52552,36 @@ var AgentChannels = class {
52400
52552
  };
52401
52553
  }
52402
52554
  /**
52555
+ * Map a chat thread to a Mastra thread (creating the mapping if needed) and
52556
+ * subscribe to it, so follow-up replies reach the agent without a mention.
52557
+ *
52558
+ * Use this for threads the bot started itself, e.g. a scheduled digest posted
52559
+ * to Slack. Inbound messages create the mapping automatically, but a thread
52560
+ * the bot opened has none until someone mentions it. An existing mapping is
52561
+ * reused and keeps its original owner.
52562
+ *
52563
+ * @example
52564
+ * ```ts
52565
+ * const sent = await channel.post('Daily digest');
52566
+ * await agent.getChannels()!.subscribeThread({ thread: sent.thread, resourceId: 'digest-bot' });
52567
+ * ```
52568
+ */
52569
+ async subscribeThread({ thread, resourceId, threadId }) {
52570
+ const mastra = this.getMastra();
52571
+ if (!mastra) throw new Error("subscribeThread requires the agent to be registered with a Mastra instance.");
52572
+ await this.initialize(mastra);
52573
+ const mastraThread = await this.getOrCreateThread({
52574
+ externalThreadId: thread.id,
52575
+ channelId: thread.channelId,
52576
+ platform: thread.adapter.name,
52577
+ resourceId,
52578
+ threadId: threadId ? () => threadId : void 0,
52579
+ mastra
52580
+ });
52581
+ await this.stateAdapter.subscribe(thread.id);
52582
+ return mastraThread;
52583
+ }
52584
+ /**
52403
52585
  * Resolves an existing Mastra thread for the given external IDs, or creates one.
52404
52586
  */
52405
52587
  async getOrCreateThread({ externalThreadId, channelId, platform, resourceId, threadId, onCreate, mastra }) {
@@ -53385,17 +53567,19 @@ async function pageRefKeys(storage, page) {
53385
53567
  if (page.address) keys.push(knowledgeLinkRefKey(page.address));
53386
53568
  return keys;
53387
53569
  }
53570
+ if (!page.key || !page.parentId) return keys;
53388
53571
  const path = [];
53389
- let current = page;
53390
- while (current && !current.isScope) {
53572
+ for (const current of [page, ...await storage.getPageParents({
53573
+ parentId: page.parentId,
53574
+ read: "all"
53575
+ })]) {
53576
+ if (current.isScope) {
53577
+ if (current.address) keys.push(knowledgeLinkRefKey(`${current.address}#${path.join("/")}`));
53578
+ return keys;
53579
+ }
53391
53580
  if (!current.key || !current.parentId) return keys;
53392
53581
  path.unshift(current.key);
53393
- current = await storage.getPage({
53394
- id: current.parentId,
53395
- read: "all"
53396
- });
53397
53582
  }
53398
- if (current?.address) keys.push(knowledgeLinkRefKey(`${current.address}#${path.join("/")}`));
53399
53583
  return keys;
53400
53584
  }
53401
53585
  /** The page and its live ordinary descendants, at most {@link MAX_KNOWLEDGE_MOVE_PAGES} + 1. */
@@ -63423,6 +63607,30 @@ async function noteSummaries(run, notes, cache = /* @__PURE__ */ new Map()) {
63423
63607
  for (const note of notes) summaries.push(noteSummary(note, await noteMentions(run, note, cache)));
63424
63608
  return summaries;
63425
63609
  }
63610
+ /**
63611
+ * Every scope the run holds, in principal order, with its role and what it can do there. A held scope
63612
+ * gets its page on the first write, so before that its role comes from the declarations and the parent
63613
+ * that write would link it under: without it a model sees no scopes on its first turn and concludes it
63614
+ * has nowhere to write. A stored scope it can't read keeps only its address.
63615
+ */
63616
+ async function heldScopes(run) {
63617
+ const stored = await run.storage.getScopesByAddress(run.principals);
63618
+ return Promise.all(run.principals.map(async (address) => {
63619
+ const found = stored.find((scope) => scope.address === address);
63620
+ const page = found && knowledgeScopeReadable(found, run.read) ? found : void 0;
63621
+ const role = found ? await run.roleOn(found) : knowledgeRoleOn(run.runtime.compiled, run.principals, {
63622
+ address,
63623
+ parentAddress: run.runtime.firstWriteParentAddress(address, run.principals)
63624
+ });
63625
+ const can = !role ? "none" : knowledgeRoleAtLeast(role, "contributor") ? "write" : "read";
63626
+ return {
63627
+ address,
63628
+ ...page ? { page } : {},
63629
+ role,
63630
+ can
63631
+ };
63632
+ }));
63633
+ }
63426
63634
  /** Scope pages for addresses the run names; each must be readable. */
63427
63635
  async function readableScopes(run, addresses) {
63428
63636
  const page = addresses.find((address) => address.includes("#"));
@@ -63703,7 +63911,7 @@ function bodyView(body, input) {
63703
63911
  function readTool(host, canEdit) {
63704
63912
  return createTool({
63705
63913
  id: "knowledge_read",
63706
- description: `Read a page: its body, its notes, its child pages and the notes on other pages that mention it. Read a scope address (org:acme) to browse that scope. Without \`page\`, lists the scopes this run holds. When a page's notes, or the notes mentioning it, come to more than ${KNOWLEDGE_READ_INLINE_TOKENS.toLocaleString("en-US")} tokens, a whole read leaves them out and counts them in \`more\`; read them on their own with \`notes\` or \`mentionedIn\`. A body returns at most ${maxTokensOf(host).toLocaleString("en-US")} tokens at a time. A body that fits comes whole as \`body\`; a longer one comes as numbered \`lines\` (\`12\u2502text\`) with the \`range\` they cover, and \`more\` says where to read on; a first read of a long page shows every heading with its line number and the first lines under it, so you can pick the part to read. For a long page, ask for its \`outline\` of headings with their line numbers, read one \`section\`, or \`match\` terms to see only the lines that contain them, with \`context\` lines around each. Those part reads return just that part of the body.` + (canEdit ? " To edit part of a long body, pass the `range` a read gave you to knowledge_page." : ""),
63914
+ description: `Read a page: its body, its notes, its child pages and the notes on other pages that mention it. Read a scope address (org:acme) to browse that scope. Without \`page\`, lists every scope this run holds, with its role and whether it can read or write there, including scopes with no page this run can read yet (\`empty\`). When a page's notes, or the notes mentioning it, come to more than ${KNOWLEDGE_READ_INLINE_TOKENS.toLocaleString("en-US")} tokens, a whole read leaves them out and counts them in \`more\`; read them on their own with \`notes\` or \`mentionedIn\`. A body returns at most ${maxTokensOf(host).toLocaleString("en-US")} tokens at a time. A body that fits comes whole as \`body\`; a longer one comes as numbered \`lines\` (\`12\u2502text\`) with the \`range\` they cover, and \`more\` says where to read on; a first read of a long page shows every heading with its line number and the first lines under it, so you can pick the part to read. For a long page, ask for its \`outline\` of headings with their line numbers, read one \`section\`, or \`match\` terms to see only the lines that contain them, with \`context\` lines around each. Those part reads return just that part of the body.` + (canEdit ? " To edit part of a long body, pass the `range` a read gave you to knowledge_page." : ""),
63707
63915
  inputSchema: {
63708
63916
  type: "object",
63709
63917
  properties: {
@@ -63785,10 +63993,13 @@ function readTool(host, canEdit) {
63785
63993
  if (outline && from) throw new Error("knowledge_read: an outline covers the whole body; pass it without from.");
63786
63994
  const run = await start(host, context);
63787
63995
  const limit = limitOf(requested);
63788
- if (!ref) return { scopes: (await run.storage.getScopesByAddress(run.principals)).filter((scope) => knowledgeScopeReadable(scope, run.read)).map((scope) => ({
63789
- address: scope.address,
63790
- name: scope.name,
63791
- ...scope.description ? { description: scope.description } : {}
63996
+ if (!ref) return { scopes: (await heldScopes(run)).map(({ address, page, role, can }) => ({
63997
+ address,
63998
+ name: page?.name ?? address,
63999
+ ...page?.description ? { description: page.description } : {},
64000
+ ...role ? { role } : {},
64001
+ can,
64002
+ ...page ? {} : { empty: true }
63792
64003
  })) };
63793
64004
  const page = await run.pageOrCloseMatches(ref);
63794
64005
  if (outline || section || match || from) {
@@ -64002,12 +64213,13 @@ async function listKnowledgeTree(run, { origin, depth, limit, cursor, descriptio
64002
64213
  let scopes = [];
64003
64214
  if (!origin) {
64004
64215
  if (cursor?.startsWith("p")) throw new Error("knowledge_list: a page cursor needs the `from` it came from.");
64005
- const held = await run.storage.getScopesByAddress(run.principals);
64006
- const order = (scope) => run.principals.indexOf(scope.address ?? "");
64007
- scopes = held.filter((scope) => knowledgeScopeReadable(scope, run.read)).sort((a, b) => order(a) - order(b));
64216
+ scopes = (await heldScopes(run)).map((held) => ({
64217
+ ...held.page ? { page: held.page } : {},
64218
+ held
64219
+ }));
64008
64220
  } else {
64009
64221
  originRef = (await pageRefs(run, [origin])).refs.get(origin.id) ?? origin.id;
64010
- if (origin.isScope && !cursor?.startsWith("p")) scopes = await childScopes(origin.id);
64222
+ if (origin.isScope && !cursor?.startsWith("p")) scopes = (await childScopes(origin.id)).map((page) => ({ page }));
64011
64223
  }
64012
64224
  const shownScopes = scopes.slice(scopeOffset, scopeOffset + limit);
64013
64225
  let roots = shownScopes;
@@ -64017,7 +64229,7 @@ async function listKnowledgeTree(run, { origin, depth, limit, cursor, descriptio
64017
64229
  const room = limit - shownScopes.length;
64018
64230
  if (room > 0) {
64019
64231
  const pages = await childPages(origin.id, room, pageCursor);
64020
- roots = [...shownScopes, ...pages.pages];
64232
+ roots = [...shownScopes, ...pages.pages.map((page) => ({ page }))];
64021
64233
  if (pages.nextCursor) nextCursor = `p${pages.nextCursor}`;
64022
64234
  } else if ((await run.storage.countChildPages({
64023
64235
  parentIds: [origin.id],
@@ -64031,10 +64243,19 @@ async function listKnowledgeTree(run, { origin, depth, limit, cursor, descriptio
64031
64243
  children: 0,
64032
64244
  below: []
64033
64245
  });
64034
- const top = roots.map((page) => nodeOf(page, origin && originRef ? childRef(origin, originRef, page) : page.address ?? page.id, 1));
64246
+ const top = roots.map(({ page, held }) => page ? {
64247
+ ...nodeOf(page, origin && originRef ? childRef(origin, originRef, page) : page.address ?? page.id, 1),
64248
+ ...held ? { held } : {}
64249
+ } : {
64250
+ held,
64251
+ ref: held.address,
64252
+ depth: 1,
64253
+ children: 0,
64254
+ below: []
64255
+ });
64035
64256
  let budget = Math.max(limit - top.length, 0);
64036
64257
  let truncated = false;
64037
- let level = top;
64258
+ let level = top.filter((node) => node.page);
64038
64259
  for (let current = 1; current <= depth && level.length; current++) {
64039
64260
  const parentIds = level.map((node) => node.page.id);
64040
64261
  const scopeParents = level.filter((node) => node.page.isScope).map((node) => node.page.id);
@@ -64058,22 +64279,30 @@ async function listKnowledgeTree(run, { origin, depth, limit, cursor, descriptio
64058
64279
  budget -= scopes.length;
64059
64280
  const pages = budget > 0 ? (await childPages(node.page.id, budget)).pages : [];
64060
64281
  budget -= pages.length;
64061
- node.below = [...scopes, ...pages].map((child) => nodeOf(child, childRef(node.page, node.ref, child), current + 1));
64062
- if (node.below.length < node.children) truncated = true;
64063
- nextLevel.push(...node.below);
64282
+ const below = [...scopes, ...pages].map((child) => ({
64283
+ ...nodeOf(child, childRef(node.page, node.ref, child), current + 1),
64284
+ page: child
64285
+ }));
64286
+ node.below = below;
64287
+ if (below.length < node.children) truncated = true;
64288
+ nextLevel.push(...below);
64064
64289
  }
64065
64290
  level = nextLevel;
64066
64291
  }
64067
64292
  const entries = [];
64068
64293
  const flatten = (nodes) => {
64069
64294
  for (const node of nodes) {
64295
+ const { page, held } = node;
64070
64296
  entries.push({
64071
64297
  ref: node.ref,
64072
- name: node.page.name,
64073
- ...descriptions && node.page.description ? { description: node.page.description } : {},
64298
+ name: page?.name ?? node.ref,
64299
+ ...descriptions && page?.description ? { description: page.description } : {},
64074
64300
  depth: node.depth,
64075
64301
  children: node.children,
64076
- ...node.page.isScope ? { scope: true } : {}
64302
+ ...!page || page.isScope ? { scope: true } : {},
64303
+ ...held?.role ? { role: held.role } : {},
64304
+ ...held ? { can: held.can } : {},
64305
+ ...page ? {} : { empty: true }
64077
64306
  });
64078
64307
  flatten(node.below);
64079
64308
  }
@@ -64090,7 +64319,7 @@ function listTool(host) {
64090
64319
  const maxTokens = maxTokensOf(host);
64091
64320
  return createTool({
64092
64321
  id: "knowledge_list",
64093
- description: `List the page tree under a starting point: each child with its ref (pass it to knowledge_read or knowledge_list), name and how many children it has. Pass \`descriptions: true\` to include page descriptions too. Without \`from\`, lists the scopes this run can read. Use it to find your way around a scope before searching or reading. One result holds at most \`limit\` entries and about ${maxTokens.toLocaleString("en-US")} tokens of them; when it stops early, \`more\` says how many entries were left out and gives the \`cursor\` to list the rest (pass the same \`from\`).`,
64322
+ description: `List the page tree under a starting point: each child with its ref (pass it to knowledge_read or knowledge_list), name and how many children it has. Pass \`descriptions: true\` to include page descriptions too. Without \`from\`, lists every scope this run holds, with its role and whether it can read or write there, including scopes with no page this run can read yet (\`empty\`). Use it to find your way around a scope before searching or reading. One result holds at most \`limit\` entries and about ${maxTokens.toLocaleString("en-US")} tokens of them; when it stops early, \`more\` says how many entries were left out and gives the \`cursor\` to list the rest (pass the same \`from\`).`,
64094
64323
  inputSchema: {
64095
64324
  type: "object",
64096
64325
  properties: {
@@ -67187,7 +67416,7 @@ var MastraLLMVNext = class extends MastraBase {
67187
67416
  content: messages
67188
67417
  }];
67189
67418
  }
67190
- stream({ resumeContext, runId, stopWhen, maxSteps, tools = {}, modelSettings, toolChoice = "auto", threadId, resourceId, structuredOutput, options, inputProcessors, llmRequestInputProcessors, outputProcessors, errorProcessors, hasConfiguredErrorProcessors, returnScorerData, providerOptions, messageList, requireToolApproval, toolCallConcurrency, eagerToolExecution, streamPublisher, _internal, onTracingTripwire, onTracingTerminalError, tracingScope = createRunScope(), agentId, agentVersionId, resolvedScopes, agentName, toolCallId, requestContext, actor, mcp, methodType, includeRawChunks, experimentalTransform, hideSignals, autoResumeSuspendedTools, maxProcessorRetries, processorStates, activeTools, isTaskComplete, goal, onIterationComplete, workspace, agentRunSpan, agent, ...rest }) {
67419
+ stream({ resumeContext, runId, stopWhen, maxSteps, tools = {}, modelSettings, toolChoice = "auto", threadId, resourceId, structuredOutput, options, inputProcessors, llmRequestInputProcessors, outputProcessors, errorProcessors, hasConfiguredErrorProcessors, returnScorerData, providerOptions, messageList, requireToolApproval, toolCallConcurrency, eagerToolExecution, streamPublisher, _internal, onTracingTripwire, onTracingTerminalError, tracingScope = createRunScope(), agentId, agentVersionId, resolvedScopes, agentName, toolCallId, requestContext, actor, mcp, methodType, includeRawChunks, experimentalTransform, hideSignals, autoResumeSuspendedTools, maxProcessorRetries, processorStates, activeTools, isTaskComplete, goal, onIterationComplete, workspace, agentRunSpan, agent, resultType, ...rest }) {
67191
67420
  const observabilityContext = resolveObservabilityContext(rest);
67192
67421
  let stopWhenToUse;
67193
67422
  if (maxSteps && typeof maxSteps === "number") {
@@ -67213,7 +67442,8 @@ var MastraLLMVNext = class extends MastraBase {
67213
67442
  provider: firstModel.provider,
67214
67443
  streaming: true,
67215
67444
  parameters: modelSettings,
67216
- ...toolDefinitions ? { tools: toolDefinitions } : {}
67445
+ ...toolDefinitions ? { tools: toolDefinitions } : {},
67446
+ ...resultType ? { resultType } : {}
67217
67447
  },
67218
67448
  metadata: {
67219
67449
  runId,
@@ -73565,8 +73795,9 @@ function releaseRunMessageRefs(runId) {
73565
73795
  /**
73566
73796
  * A `SaveQueueManager` `onSaved` callback that records the rows a run saved,
73567
73797
  * so its persisted transcript references them instead of repeating them. Only
73568
- * runs that store refs hold an entry (the transcript store creates it), so saves
73569
- * for other runs, or landing after the run released its entry, are not kept.
73798
+ * runs that store refs hold an entry (created before the run saves its input,
73799
+ * else by the transcript store), so saves for other runs, or landing after the
73800
+ * run released its entry, are not kept.
73570
73801
  */
73571
73802
  function recordRunSavedMessages(runId) {
73572
73803
  return (rows) => {
@@ -73588,6 +73819,15 @@ function recordRunSavedMessages(runId) {
73588
73819
  };
73589
73820
  }
73590
73821
  // src/agent/durable/utils/resolve-runtime.ts
73822
+ async function restoreWorkerToolsets(mastra, context, names) {
73823
+ const controller = context.get("controller");
73824
+ if (!isRestoredWorkerControllerContext(controller) || !names?.length) return;
73825
+ const toolsets = await mastra.getAgentControllerById(controller.controllerId)?.__restoreWorkerToolsets(context);
73826
+ if (!toolsets) return;
73827
+ const allowed = new Set(names);
73828
+ for (const [key, tools] of Object.entries(toolsets)) if (tools) toolsets[key] = Object.fromEntries(Object.entries(tools).filter(([name]) => allowed.has(name)));
73829
+ return toolsets;
73830
+ }
73591
73831
  /**
73592
73832
  * Build a SaveQueueManager for a run's memory, or `undefined` when no memory
73593
73833
  * is configured. Shared by `resolveRuntimeDependencies` and
@@ -73750,6 +73990,7 @@ async function resolveRuntimeDependencies(options) {
73750
73990
  backgroundTasks = resolveBackgroundTasks(mastra, agent, input.options);
73751
73991
  tools = await agent.getToolsForExecution({
73752
73992
  runId,
73993
+ toolsets: await restoreWorkerToolsets(mastra, resolveRequestContext, input.options?.toolsetToolNames),
73753
73994
  threadId: input.state.threadId,
73754
73995
  resourceId: input.state.resourceId,
73755
73996
  requestContext: resolveRequestContext,
@@ -73871,6 +74112,7 @@ async function rebuildRunToolsFromMastra(options) {
73871
74112
  const backgroundTasks = resolveBackgroundTasks(mastra, agent, execOptions);
73872
74113
  const tools = await agent.getToolsForExecution({
73873
74114
  runId,
74115
+ toolsets: await restoreWorkerToolsets(mastra, resolveRequestContext, execOptions?.toolsetToolNames),
73874
74116
  threadId: state.threadId,
73875
74117
  resourceId: state.resourceId,
73876
74118
  requestContext: resolveRequestContext,
@@ -74340,7 +74582,11 @@ function mergeRequestContextForFinalization(entries, fallback, liveRunContext) {
74340
74582
  if (liveRunContext) return liveRunContext;
74341
74583
  if (!entries) return fallback ?? new RequestContext();
74342
74584
  const restored = new RequestContext(fallback?.entries());
74343
- for (const [key, value] of Object.entries(withoutLiveRequestKeys(entries))) restored.set(key, value);
74585
+ const controller = fallback?.get("controller");
74586
+ for (const [key, value] of Object.entries(withoutLiveRequestKeys(entries))) {
74587
+ if (key === "controller" && isRestoredWorkerControllerContext(controller)) continue;
74588
+ restored.set(key, value);
74589
+ }
74344
74590
  restoreRunAgentScopes(restored);
74345
74591
  return restored;
74346
74592
  }
@@ -74381,6 +74627,7 @@ async function runDurableFinishSideEffects({ runId, initData, messageListState,
74381
74627
  ...initData,
74382
74628
  messageListState
74383
74629
  },
74630
+ requestContext,
74384
74631
  logger: effectiveLogger
74385
74632
  });
74386
74633
  rebuiltSaveQueueManager = resolved.saveQueueManager;
@@ -76385,6 +76632,15 @@ function buildMessagesFromChunks({ chunks, messageId, responseModelMetadata, too
76385
76632
  });
76386
76633
  break;
76387
76634
  }
76635
+ case "custom": {
76636
+ const p = chunk.payload;
76637
+ parts.push({
76638
+ type: "custom",
76639
+ kind: p.kind,
76640
+ ...p.providerMetadata ? { providerMetadata: p.providerMetadata } : {}
76641
+ });
76642
+ break;
76643
+ }
76388
76644
  case "tool-call": {
76389
76645
  const p = chunk.payload;
76390
76646
  const toolDef = tools?.[p.toolName] || findProviderToolByName(tools, p.toolName);
@@ -83719,15 +83975,21 @@ async function persistDurableRunInput(runId, workflowInput, mastra, beforeSave)
83719
83975
  await beforeSave();
83720
83976
  }
83721
83977
  const inputCopy = entry.messageList.clone();
83722
- await entry.saveQueueManager.flushMessages(inputCopy, state.threadId, state.memoryConfig, {
83723
- throwOnError: true,
83724
- beforePersist: () => assertExecutionOwned({
83725
- runId,
83726
- agentId: workflowInput.agentId,
83727
- mastra,
83728
- requestContext
83729
- })
83730
- });
83978
+ if (state.fixedMemory) getRunMessageRefs(runId);
83979
+ try {
83980
+ await entry.saveQueueManager.flushMessages(inputCopy, state.threadId, state.memoryConfig, {
83981
+ throwOnError: true,
83982
+ beforePersist: () => assertExecutionOwned({
83983
+ runId,
83984
+ agentId: workflowInput.agentId,
83985
+ mastra,
83986
+ requestContext
83987
+ })
83988
+ });
83989
+ } catch (error) {
83990
+ if (state.fixedMemory) releaseRunMessageRefs(runId);
83991
+ throw error;
83992
+ }
83731
83993
  const embedded = entry.messageList.getEmbeddedMessages();
83732
83994
  for (const [messageId, textHash] of inputCopy.getEmbeddedMessages()) embedded.set(messageId, textHash);
83733
83995
  }
@@ -84054,7 +84316,7 @@ async function prepareForDurableExecution(options) {
84054
84316
  });
84055
84317
  let tripwireData;
84056
84318
  if (inputProcessors.length > 0) try {
84057
- const { ProcessorRunner } = await import("./stream-C8HKG3qC.js").then((n) => n.I);
84319
+ const { ProcessorRunner } = await import("./stream-DB5efioT.js").then((n) => n.I);
84058
84320
  await new ProcessorRunner({
84059
84321
  inputProcessors,
84060
84322
  outputProcessors,
@@ -88519,11 +88781,13 @@ var Agent = class Agent extends MastraBase {
88519
88781
  ...observabilityContext,
88520
88782
  messageList,
88521
88783
  agentId: this.id,
88522
- agentName: this.name
88784
+ agentName: this.name,
88785
+ resultType: "title_generation"
88523
88786
  }).text;
88524
88787
  } else text = (await llm.__text({
88525
88788
  requestContext,
88526
88789
  ...observabilityContext,
88790
+ resultType: "title_generation",
88527
88791
  messages: [{
88528
88792
  role: "system",
88529
88793
  content: systemInstructions
@@ -110686,4 +110950,4 @@ var ExtendedRunRegistry = class extends RunRegistry {
110686
110950
  this.#memoryInfo.clear();
110687
110951
  }
110688
110952
  };
110689
- export { createDurableBackgroundTaskCheckStep as $, createSpanQueryPreview as $a, createRestartExecutionParams as $c, DatasetItemIdentityConflictError as $i, RUN_FENCING_NOT_SUPPORTED_ERROR_ID as $l, SemanticRecall as $n, SkillsProcessor as $o, notificationSummarySignalMetadata as $r, emitStepFinishEvent as $s, knowledgeDeliveredPins as $t, agentInstructions as A, transformRow as Aa, DefaultExecutionEngine as Ac, MAX_KNOWLEDGE_PAGE_BODY_LINKS as Ai, ImagePartSchema as Al, resolveWaitUntil as An, DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS as Ao, WorkflowsInMemory as Ar, StreamErrorRetryProcessor as As, readRunDeadline as At, createDurableAgenticWorkflow as B, THREAD_QUERY_MAX_LIMIT as Ba, normalizeConcurrency as Bc, knowledgeLinkRefKey as Bi, ProcessorStepInputSchema as Bl, renderBuiltInToolEvent as Bn, memoryDefaultOptions as Bo, ScoresInMemory as Br, cloneStep as Bs, formatCompletionFeedback as Bt, MastraScorer as C, getSqlType as Ca, predicateToCondition as Cc, parseKnowledgeWikilinks as Ci, assertDrainTimeout as Cl, knowledgeRunScopes as Cn, serializeSpanAttributes as Co, StoreOperations as Cr, UnicodeNormalizer as Cs, liveSegmentSpan as Ct, isNotScorable as D, safelyParseJSON as Da, nestedRunParentOf as Dc, KnowledgePageKeyConflictError as Di, hasResumableStreams as Dl, encodeKnowledgeScopeId as Dn, FactoryStorage as Do, FilesystemDB as Dr, UnsupportedFileHandler as Ds, runResumeDurableStreamUntilIdle as Dt, filterRun as E, parseDuration as Ea, createNestedRunParentStatusLookup as Ec, KnowledgePageHasChildrenError as Ei, hasDurableExecution as El, decodeKnowledgeScopeId as En, ObservabilityStorage as Eo, FilesystemStore as Er, isMalformedFunctionCallError as Es, runDurableStreamUntilIdle as Et, normalizeResumeGenerateArgs as F, tracePageIdSchema as Fa, renewWorkflowLease as Fc, MAX_KNOWLEDGE_PAGE_LIST_LIMIT as Fi, ProcessorMessageContentSchema as Fl, ChannelThreadLinkProcessor as Fn, messageVectorId as Fo, mergeWorkflowStepResult as Fr, cloneWorkflow as Fs, pruneAgentLoopSnapshot as Ft, createWorkflowInput as G, threadQueryResponseSchema as Ga, createStepFromTool as Gc, parseKnowledgePageRef as Gi, StepStartPartSchema as Gl, DEFAULT_CHANNEL_TOOLS_SETTINGS as Gn, createBackgroundWorkSignalProcessor as Go, InMemoryNotificationsStorage as Gr, StepExecutor as Gs, runChecks as Gt, createDurableIsTaskCompleteStep as H, planThreadRowsQuery as Ha, createMappingStep as Hc, knowledgePinDepth as Hi, ProcessorStepSchema as Hl, CONTINUE_RUN_MESSAGE as Hn, isSystemReminderMessage as Ho, InMemorySchedulesStorage as Hr, createStep as Hs, formatValidationFeedback as Ht, prepareForDurableExecution as I, tracePageNodeSchema as Ia, repeatAfterSettled as Ic, MAX_KNOWLEDGE_PIN_LIST_DEPTH as Ii, ProcessorMessageSchema as Il, NEW_CHANNEL_THREAD_KEY as In, resolveMaxChunkChars as Io, InMemoryWorkflowDefinitionsStorage as Ir, createEventedWorkflow as Is, DEFAULT_TOOL_DECLINE_REASON as It, serializeModelConfig as J, SPAN_QUERY_MAX_CURSOR_BYTES as Ja, abortableSleep as Jc, HarnessStorage as Ji, isAgentCompatible as Jl, createChannelTools as Jn, RESPONSE_CACHE_CONTEXT_KEY as Jo, createNotificationSignal as Jr, diffResponseMessages as Js, runStreamCompletionScorers as Jt, serializeDurableOptions as K, threadQueryRowSchema as Ka, RESUME_SNAPSHOT_POLL_INTERVAL_MS as Kc, KnowledgeInvalidCursorError as Ki, TextPartSchema as Kl, channelToolScopeResolver as Kn, CyberRefusalHandler as Ko, NotificationsStorage as Kr, computeScheduleDefinitionHash as Ks, runCompletionScorers as Kt, applyReservedMemoryContextKeys as L, tracePageRequestSchema as La, runFenceConflictOf as Lc, assertKnowledgeNoteTextWithinBound as Li, ProcessorOutputResultPhaseSchema as Ll, markNewChannelThread as Ln, upsertMessageVectors as Lo, WorkflowDefinitionsStorage as Lr, createWorkflow as Ls, resolveDeclineReason as Lt, MAX_FS_SUBAGENT_DEPTH as M, validateStorageMetadataFilter as Ma, evaluateScoringPredicate as Mc, MAX_KNOWLEDGE_PAGE_DESCRIPTION_TOKENS as Mi, MessagePartSchema as Ml, resolveChannelRenderContext as Mn, buildMessageEmbeddingRows as Mo, WorkflowsStorage as Mr, isRetryableOpenAIResponsesStreamError as Ms, getRunStreamSlot as Mt, AGENT_RESUME_CLAIM_STALE_MS as N, TracePageError as Na, validateScoringPredicate as Nc, MAX_KNOWLEDGE_PAGE_LINKS as Ni, ProcessorInputPhaseSchema as Nl, MastraStateAdapter as Nn, chunkMessageText as No, createEmptyWorkflowSnapshot as Nr, PrefillErrorHandler as Ns, getScopeStreamSlot as Nt, notScorable as O, serializeDate as Oa, nestedRunRecoveryAction as Oc, MAX_KNOWLEDGE_MOVE_PAGES as Oi, isDurableAgentLike as Ol, buildKnowledgeInstructions as On, FactoryStorageDomain as Oo, InMemoryStore as Or, FileUploadProcessor as Os, RUN_DEADLINE_KEY as Ot, Agent as P, readTracePage as Pa, WORKFLOW_RUN_LEASE_TTL_MS as Pc, MAX_KNOWLEDGE_PAGE_LINK_REF_LENGTH as Pi, ProcessorInputStepPhaseSchema as Pl, REPLY_TOOL_NAME as Pn, extractMessageEmbeddingText as Po, mergeStepResult as Pr, getGoalActivityDurationMs as Ps, untilIdleHandlesBackgroundTask as Pt, isSpanChunk as Q, buildSpanQueryResponse as Qa, createDeprecationProxy as Qc, DatasetsStorage as Qi, RUN_FENCE_CONFLICT_ERROR_ID as Ql, MemoryInputFilter as Qn, SkillSearchProcessor as Qo, notificationSummaryContents as Qr, emitFinishEvent as Qs, PINNED_READ_MEMO_KEY as Qt, persistDurableRunInput as R, tracePageResponseSchema as Ra, ExecutionEngine as Rc, assertKnowledgePageDescriptionWithinBound as Ri, ProcessorOutputStepPhaseSchema as Rl, ChatChannelProcessor as Rn, MastraMemory as Ro, InMemoryToolProviderConnectionsStorage as Rr, EventedRun as Rs, getServerSideFallbackInfo as Rt, createClassifierScorer as S, getDefaultValue as Sa, mapVariable as Sc, inspectKnowledgeSchema as Si, getEntryWorkflow as Sl, knowledgeMemoryScopes as Sn, getStringOrNull as So, StoreOperationsInMemory as Sr, ModerationProcessor as Ss, endFailedSegmentSpans as St, createScorer as T, jsonValueEquals as Ta, cancelNestedRun as Tc, KnowledgePageDepthError as Ti, workflowTermination as Tl, strongerKnowledgeRole as Tn, ObservabilityInMemory as To, createGitHubSourceControlProviderFromEnv as Tr, defaultStabilityErrorProcessors as Ts, segmentSpanData as Tt, createDurableLLMMappingStep as U, threadQueryIdentitySchema as Ua, createStepFromAgent$1 as Uc, knowledgePositionBetween as Ui, ReasoningPartSchema as Ul, formatToolApproval as Un, augmentWithInit as Uo, SchedulesStorage as Ur, createWorkflow$1 as Us, generateFinalResult as Ut, createDurableGoalStep as V, encodeThreadQueryCursor as Va, runWithConcurrency as Vc, knowledgePagePath as Vi, ProcessorStepOutputSchema as Vl, CONTINUE_RUN_ACTION_ID as Vn, filterSystemReminderMessages as Vo, ScoresStorage as Vr, cloneWorkflow$1 as Vs, formatStreamCompletionFeedback as Vt, createDurableToolCallStep as W, threadQueryRequestSchema as Wa, createStepFromClassifier as Wc, knowledgeScopeReadable as Wi, SourcePartSchema as Wl, ChannelSessionRejectedError as Wn, getStorageSource as Wo, normalizeScheduleTarget as Wr, WorkflowEventProcessor as Ws, generateStructuredFinalResult as Wt, createDurableLLMExecutionStep as X, SPAN_QUERY_MAX_PREVIEW_CHARACTERS as Xa, assertTimeTravelGraphMatchesSnapshot as Xc, ExperimentsStorage as Xi, assertWorkflowStepGuard as Xl, toChatLogger as Xn, buildResponseCacheKey as Xo, notificationSignalAttributes as Xr, emitChunkEvent as Xs, loop as Xt, serializeToolsMetadata as Y, SPAN_QUERY_MAX_LIMIT as Ya, applyStateDelta as Yc, ExperimentsInMemory as Yi, WorkflowStepConflictError as Yl, resolveChannelToolsSettings as Yn, ResponseCache as Yo, createNotificationSummarySignal as Yr, emitAbortEvent as Ys, runValidation as Yt, MessagePartSpans as Z, SPAN_QUERY_ORDER_FIELDS as Za, cleanStepResult as Zc, DatasetsInMemory as Zi, isWorkflowStepConflictError as Zl, BaseProcessor as Zn, WorkspaceInstructionsProcessor as Zo, notificationSignalMetadata as Zr, emitErrorEvent as Zs, validateModelTimeoutSettings as Zt, describeNonSuccessFinishReason as _, createStorageErrorId as _a, Run as _c, KnowledgeStorage as _i, validateStepResumeData as _l, knowledgeAccessGrants as _n, buildLogRecord as _o, knowledgeScopeKey as _r, ClassifierProcessor as _s, resolveTool$1 as _t, deleteRunRegistryEntry as a, SchemaUpdateValidationError as aa, subscribeToAbortRequests as ac, resolveNotificationDeliveryDecision as ai, getSingleStepEntryId as al, removeKnowledgeNote as an, spanQueryIdentityKey as ao, MockMemory as ar, CostGuardProcessor as as, baseDurableAgenticInputSchema as at, resolveRunFence as au, createOnScorerHook as b, ensureDate as ba, createStep$1 as bc, assertKnowledgeSchemaCompatible as bi, waitForSuspendedSnapshot as bl, KnowledgeDeclarationError as bn, buildUpdateSpanRecord as bo, knowledgeVisibleScopeKeys as br, PIIDetector as bs, createDurableAgentStream as bt, getRunRegistryEntry as c, ChannelsStorage as ca, DurableAgentDefaults as cc, InMemoryKnowledgeStorage as ci, isEntryFinished as cl, upsertKnowledgePage as cn, spanQueryResponseSchema as co, MAX_KNOWLEDGE_SCOPE_TAGS as cr, TokenLimiterProcessor as cs, modelConfigSchema as ct, setRunFenceContext as cu, setRunRegistryEntry as d, BackgroundTasksInMemory as da, AGENT_STREAM_TOPIC as dc, KnowledgeImportersStorage as di, omitPriorSuspensionFields as dl, KnowledgeLinkRefreshIncompleteError as dn, encodeTraceQueryDeltaCursor as do, assertKnowledgeRecordTextWithinBound as dr, advanceMemoryTokenBoundary as ds, runDurableFinishSideEffects as dt, SchemaValidator as ea, emitStepStartEvent as ec, summarizeNotifications as ei, createTimeTravelExecutionParams as el, buildKnowledgePageTools as en, encodeSpanQueryCursor as eo, globalEmbeddingCache as er, formatSkillsCatalog as es, resolveDurableToolCallConcurrency as et, RunFenceConflictError as eu, takeRunScorerInstances as f, BackgroundTasksStorage as fa, AgentControlEventTypes as fc, KNOWLEDGE_STORAGE_CONTRACT_VERSION as fi, resolveForeachConcurrency as fl, knowledgeSubtree as fn, getTraceQueryDeltaWatermark as fo, assertKnowledgeScopeWithinCeiling as fr, getMemoryTokenBoundary as fs, loadRunStoredMessages as ft, AGENTIC_LOOP_WORKFLOW_ID as g, runRetentionBatches as ga, getStepEntry as gc, KnowledgeSchemaResetRequiredError as gi, validateStepRequestContext as gl, updateKnowledgeLinks as gn, buildFeedbackRecord as go, isKnowledgeScopeVisible as gr, ModelSelectionProcessor as gs, resolveRuntimeDependencies as gt, AGENTIC_EXECUTION_WORKFLOW_ID as h, retentionCutoffMs as ha, getNestedWorkflow as hc, KnowledgeNotFoundError$1 as hi, validateStepInput as hl, syncKnowledgePageBodyLinks as hn, buildCreateSpanRecord as ho, expandKnowledgeScope as hr, BatchPartsProcessor as hs, resolveModel as ht, abandonDurableAgentExecutions as i, UnsupportedSchemaPatternError as ia, requestAcknowledgedAbort as ic, resolveDeliveryFailureUpdate as ii, getResumeLabelsByStepId as il, moveKnowledgePage as in, spanQueryCostSchema as io, getMemoryRunState as ir, RegexFilterProcessor as is, accumulatedUsageSchema as it, matchesRunFence as iu, assembleAgentFromFsEntry as j, transformScoreRow as ja, SCORING_PREDICATE_ROOTS as jc, MAX_KNOWLEDGE_PAGE_DEPTH as ji, MessageContentSchema as jl, defaultTypingStatus as jn, MESSAGE_EMBEDDING_CHARS_PER_TOKEN as jo, cloneRunData as jr, isBadRequestError as js, __registerMastraCtor as jt, agentConfig as k, storageMessageMatchesMetadataFilter as ka, nestedRunStatusOf as kc, MAX_KNOWLEDGE_NOTE_TOKENS as ki, FilePartSchema as kl, AgentChannels as kn, UniqueViolationError as ko, MockStore as kr, FILE_UPLOAD_ERROR_CODES as ks, ensureRemoteAbortListener as kt, globalRunRegistry as l, InMemoryBlobStore as la, DurableStepIds as lc, KnowledgeImporterBindingConflictError as li, isSingleStepEntry as ll, KnowledgeSemanticIndex as ln, spanQueryRowSchema as lo, assertKnowledgeCeilingRaised as lr, groupLinkedToolMessages as ls, modelListEntrySchema as lt, agentThreadStreamRuntime as m, resolveRetentionTargets as ma, EventedExecutionEngine as mc, KnowledgeConflictError as mi, setLongTimeout as ml, reindexKnowledgeLinks as mn, planTraceQuery as mo, createKnowledgeNodeCursor as mr, normalizeMessageHistoryConfig as ms, resolveInternalState as mt, ExtendedRunRegistry as n, createValidator as na, AgentStreamBus as nc, MAX_NOTIFICATION_DELIVERY_ATTEMPTS as ni, defineStateAccessors as nl, knowledgeRunPrincipals as nn, planSpanQuery as no, MessageHistory as nr, AgentsMDInjector as ns, calculateAccumulatedUsage as nt, currentRunGeneration as nu, endRunSpansWithError as o, SchemaValidationError as oa, createRunAbortController as oc, InMemoryMemory as oi, getStepIds as ol, removeKnowledgePage as on, spanQueryIdentitySchema as oo, MAX_KNOWLEDGE_NODE_DESCRIPTION_LENGTH as or, TokenCostControl as os, baseIterationStateSchema as ot, runFencingNotSupportedError as ou, AgentThreadLeaseLostError as p, executeRetentionPrune as pa, AgentStreamEventTypes as pc, KNOWLEDGE_STORAGE_SCHEMA_VERSION as pi, runCountDeprecationMessage as pl, refreshKnowledgeLinksTo as pn, planThreadQuery as po, canonicalizeKnowledgeScope as pr, isAfterMemoryTokenBoundary as ps, rebuildRunToolsFromMastra as pt, serializeDurableState as q, SPAN_QUERY_MAX_COST_METRICS as qa, RESUME_SNAPSHOT_WAIT_STATUSES as qc, InMemoryHarness as qi, ToolInvocationPartSchema as ql, createChannelToolScope as qn, DEFAULT_RESPONSE_CACHE_TTL_SECONDS as qo, dispatchDueNotifications as qr, __resetExecutionFencesForTests as qs, runDefaultCompletionCheck as qt, RunRegistry as r, getSchemaValidator as ra, publishAbortRequest as rc, defaultNotificationDeliveryDecision as ri, getRestartStartIndex as rl, addKnowledgeNote as rn, resolveSpanQueryCost as ro, MemoryRunState as rr, ToolCallFilter as rs, createBaseIterationStateUpdate as rt, isRunFenceConflictError as ru, getActiveDurableAgentWorkflowExecutions as s, InMemoryChannelsStorage as sa, DURABLE_STOP_WHEN_ERROR_ID as sc, MemoryStorage as si, hydrateSerializedStepErrors as sl, updateKnowledgeNote as sn, spanQueryRequestSchema as so, MAX_KNOWLEDGE_RECORD_TEXT_LENGTH as sr, SystemPromptScrubber as ss, durableAgenticOutputSchema as st, runOutsideRunFenceScope as su, DURABLE_CONTEXT_SEGMENT_KEY as t, assertSupportedPatterns as ta, emitSuspendedEvent as tc, readNotificationRoutingRequirement as ti, defineLazyWriter as tl, KnowledgeRun as tn, parseSpanQueryRequest as to, WorkingMemory as tr, ToolSearchProcessor as ts, buildStepRecord as tt, coverNestedRun as tu, isDurableAgentExecutionDetached as u, BlobStore as ua, AGENT_CONTROL_TOPIC as uc, KnowledgeImporterRunStateError as ui, omitPriorCompletionFields as ul, embed$2 as un, encodeTraceQueryCursor as uo, assertKnowledgeDescriptionWithinBound as ur, loadMessageHistory as us, executeDurableAgentScorers as ut, runEvals as v, createStoreErrorId as va, Workflow as vc, KnowledgeTransactionDeadlineError as vi, validateStepStateData as vl, knowledgeReadScopeFor as vn, buildMetricRecord as vo, knowledgeSemanticDocumentId as vr, StructuredOutputProcessor as vs, toolRequiresApproval as vt, ScorerRunError as w, hasErrorCode as wa, evaluatePredicate as wc, KnowledgeMoveTooLargeError as wi, waitMs as wl, knowledgeScopeAddress as wn, toEntityType as wo, GitHubSourceControlProvider as wr, STABILITY_ERROR_PROCESSOR_IDS as ws, segmentEndedBySuspension as wt, validateAndSaveScore as x, filterByDateRange as xa, isProcessor$1 as xc, createKnowledgeUlid as xi, getEntryId as xl, compileKnowledgeScopes as xn, getObjectOrNull as xo, parseKnowledgeNodeCursor as xr, PromptInjectionDetector as xs, carrySegmentSpans as xt, flushBeforeTraceRead as y, createVectorErrorId as ya, cloneStep$1 as yc, KnowledgeUnsupportedCapabilityError as yi, validateStepSuspendData as yl, knowledgeRoleOn as yn, buildScoreRecord as yo, knowledgeSemanticIdempotencyKey as yr, LanguageDetector as ys, resolveAgentById as yt, detachFullStreamOnEnd as z, THREAD_QUERY_DEFAULT_LIMIT as za, createConcurrencyLimiter as zc, canonicalKnowledgeName as zi, ProcessorOutputStreamPhaseSchema as zl, CHAT_CHANNEL_RENDER_CONTEXT_KEY as zn, MemoryProcessor as zo, ToolProviderConnectionsStorage as zr, EventedWorkflow as zs, formatCheckFeedback as zt };
110953
+ export { createDurableBackgroundTaskCheckStep as $, createSpanQueryPreview as $a, cleanStepResult as $c, DatasetItemIdentityConflictError as $i, isWorkflowStepConflictError as $l, SemanticRecall as $n, SkillsProcessor as $o, notificationSummarySignalMetadata as $r, emitStepFinishEvent as $s, knowledgeDeliveredPins as $t, agentInstructions as A, transformRow as Aa, nestedRunRecoveryAction as Ac, MAX_KNOWLEDGE_PAGE_BODY_LINKS as Ai, isDurableAgentLike as Al, resolveWaitUntil as An, DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS as Ao, WorkflowsInMemory as Ar, StreamErrorRetryProcessor as As, readRunDeadline as At, createDurableAgenticWorkflow as B, THREAD_QUERY_MAX_LIMIT as Ba, ExecutionEngine as Bc, knowledgeLinkRefKey as Bi, ProcessorOutputStepPhaseSchema as Bl, renderBuiltInToolEvent as Bn, memoryDefaultOptions as Bo, ScoresInMemory as Br, cloneStep as Bs, formatCompletionFeedback as Bt, MastraScorer as C, getSqlType as Ca, isProcessor$1 as Cc, parseKnowledgeWikilinks as Ci, getEntryId as Cl, knowledgeRunScopes as Cn, serializeSpanAttributes as Co, StoreOperations as Cr, UnicodeNormalizer as Cs, liveSegmentSpan as Ct, isNotScorable as D, safelyParseJSON as Da, cancelNestedRun as Dc, KnowledgePageKeyConflictError as Di, workflowTermination as Dl, encodeKnowledgeScopeId as Dn, FactoryStorage as Do, FilesystemDB as Dr, UnsupportedFileHandler as Ds, runResumeDurableStreamUntilIdle as Dt, filterRun as E, parseDuration as Ea, evaluatePredicate as Ec, KnowledgePageHasChildrenError as Ei, waitMs as El, decodeKnowledgeScopeId as En, ObservabilityStorage as Eo, FilesystemStore as Er, isMalformedFunctionCallError as Es, runDurableStreamUntilIdle as Et, normalizeResumeGenerateArgs as F, tracePageIdSchema as Fa, validateScoringPredicate as Fc, MAX_KNOWLEDGE_PAGE_LIST_LIMIT as Fi, ProcessorInputPhaseSchema as Fl, ChannelThreadLinkProcessor as Fn, messageVectorId as Fo, mergeWorkflowStepResult as Fr, cloneWorkflow as Fs, pruneAgentLoopSnapshot as Ft, createWorkflowInput as G, threadQueryResponseSchema as Ga, createStepFromAgent$1 as Gc, parseKnowledgePageRef as Gi, ReasoningPartSchema as Gl, DEFAULT_CHANNEL_TOOLS_SETTINGS as Gn, createBackgroundWorkSignalProcessor as Go, InMemoryNotificationsStorage as Gr, StepExecutor as Gs, runChecks as Gt, createDurableIsTaskCompleteStep as H, planThreadRowsQuery as Ha, normalizeConcurrency as Hc, knowledgePinDepth as Hi, ProcessorStepInputSchema as Hl, CONTINUE_RUN_MESSAGE as Hn, isSystemReminderMessage as Ho, InMemorySchedulesStorage as Hr, createStep as Hs, formatValidationFeedback as Ht, prepareForDurableExecution as I, tracePageNodeSchema as Ia, WORKFLOW_RUN_LEASE_TTL_MS as Ic, MAX_KNOWLEDGE_PIN_LIST_DEPTH as Ii, ProcessorInputStepPhaseSchema as Il, NEW_CHANNEL_THREAD_KEY as In, resolveMaxChunkChars as Io, InMemoryWorkflowDefinitionsStorage as Ir, createEventedWorkflow as Is, DEFAULT_TOOL_DECLINE_REASON as It, serializeModelConfig as J, SPAN_QUERY_MAX_CURSOR_BYTES as Ja, RESUME_SNAPSHOT_POLL_INTERVAL_MS as Jc, HarnessStorage as Ji, TextPartSchema as Jl, createChannelTools as Jn, RESPONSE_CACHE_CONTEXT_KEY as Jo, createNotificationSignal as Jr, diffResponseMessages as Js, runStreamCompletionScorers as Jt, serializeDurableOptions as K, threadQueryRowSchema as Ka, createStepFromClassifier as Kc, KnowledgeInvalidCursorError as Ki, SourcePartSchema as Kl, channelToolScopeResolver as Kn, CyberRefusalHandler as Ko, NotificationsStorage as Kr, computeScheduleDefinitionHash as Ks, runCompletionScorers as Kt, applyReservedMemoryContextKeys as L, tracePageRequestSchema as La, renewWorkflowLease as Lc, assertKnowledgeNoteTextWithinBound as Li, ProcessorMessageContentSchema as Ll, markNewChannelThread as Ln, upsertMessageVectors as Lo, WorkflowDefinitionsStorage as Lr, createWorkflow as Ls, resolveDeclineReason as Lt, MAX_FS_SUBAGENT_DEPTH as M, validateStorageMetadataFilter as Ma, DefaultExecutionEngine as Mc, MAX_KNOWLEDGE_PAGE_DESCRIPTION_TOKENS as Mi, ImagePartSchema as Ml, resolveChannelRenderContext as Mn, buildMessageEmbeddingRows as Mo, WorkflowsStorage as Mr, isRetryableOpenAIResponsesStreamError as Ms, getRunStreamSlot as Mt, AGENT_RESUME_CLAIM_STALE_MS as N, TracePageError as Na, SCORING_PREDICATE_ROOTS as Nc, MAX_KNOWLEDGE_PAGE_LINKS as Ni, MessageContentSchema as Nl, MastraStateAdapter as Nn, chunkMessageText as No, createEmptyWorkflowSnapshot as Nr, PrefillErrorHandler as Ns, getScopeStreamSlot as Nt, notScorable as O, serializeDate as Oa, createNestedRunParentStatusLookup as Oc, MAX_KNOWLEDGE_MOVE_PAGES as Oi, hasDurableExecution as Ol, buildKnowledgeInstructions as On, FactoryStorageDomain as Oo, InMemoryStore as Or, FileUploadProcessor as Os, RUN_DEADLINE_KEY as Ot, Agent as P, readTracePage as Pa, evaluateScoringPredicate as Pc, MAX_KNOWLEDGE_PAGE_LINK_REF_LENGTH as Pi, MessagePartSchema as Pl, REPLY_TOOL_NAME as Pn, extractMessageEmbeddingText as Po, mergeStepResult as Pr, getGoalActivityDurationMs as Ps, untilIdleHandlesBackgroundTask as Pt, isSpanChunk as Q, buildSpanQueryResponse as Qa, assertTimeTravelGraphMatchesSnapshot as Qc, DatasetsStorage as Qi, assertWorkflowStepGuard as Ql, MemoryInputFilter as Qn, SkillSearchProcessor as Qo, notificationSummaryContents as Qr, emitFinishEvent as Qs, PINNED_READ_MEMO_KEY as Qt, persistDurableRunInput as R, tracePageResponseSchema as Ra, repeatAfterSettled as Rc, assertKnowledgePageDescriptionWithinBound as Ri, ProcessorMessageSchema as Rl, ChatChannelProcessor as Rn, MastraMemory as Ro, InMemoryToolProviderConnectionsStorage as Rr, EventedRun as Rs, getServerSideFallbackInfo as Rt, createClassifierScorer as S, getDefaultValue as Sa, createStep$1 as Sc, inspectKnowledgeSchema as Si, waitForSuspendedSnapshot as Sl, knowledgeMemoryScopes as Sn, getStringOrNull as So, StoreOperationsInMemory as Sr, ModerationProcessor as Ss, endFailedSegmentSpans as St, createScorer as T, jsonValueEquals as Ta, predicateToCondition as Tc, KnowledgePageDepthError as Ti, assertDrainTimeout as Tl, strongerKnowledgeRole as Tn, ObservabilityInMemory as To, createGitHubSourceControlProviderFromEnv as Tr, defaultStabilityErrorProcessors as Ts, segmentSpanData as Tt, createDurableLLMMappingStep as U, threadQueryIdentitySchema as Ua, runWithConcurrency as Uc, knowledgePositionBetween as Ui, ProcessorStepOutputSchema as Ul, formatToolApproval as Un, augmentWithInit as Uo, SchedulesStorage as Ur, createWorkflow$1 as Us, generateFinalResult as Ut, createDurableGoalStep as V, encodeThreadQueryCursor as Va, createConcurrencyLimiter as Vc, knowledgePagePath as Vi, ProcessorOutputStreamPhaseSchema as Vl, CONTINUE_RUN_ACTION_ID as Vn, filterSystemReminderMessages as Vo, ScoresStorage as Vr, cloneWorkflow$1 as Vs, formatStreamCompletionFeedback as Vt, createDurableToolCallStep as W, threadQueryRequestSchema as Wa, createMappingStep as Wc, knowledgeScopeReadable as Wi, ProcessorStepSchema as Wl, ChannelSessionRejectedError as Wn, getStorageSource as Wo, normalizeScheduleTarget as Wr, WorkflowEventProcessor as Ws, generateStructuredFinalResult as Wt, createDurableLLMExecutionStep as X, SPAN_QUERY_MAX_PREVIEW_CHARACTERS as Xa, abortableSleep as Xc, ExperimentsStorage as Xi, isAgentCompatible as Xl, toChatLogger as Xn, buildResponseCacheKey as Xo, notificationSignalAttributes as Xr, emitChunkEvent as Xs, loop as Xt, serializeToolsMetadata as Y, SPAN_QUERY_MAX_LIMIT as Ya, RESUME_SNAPSHOT_WAIT_STATUSES as Yc, ExperimentsInMemory as Yi, ToolInvocationPartSchema as Yl, resolveChannelToolsSettings as Yn, ResponseCache as Yo, createNotificationSummarySignal as Yr, emitAbortEvent as Ys, runValidation as Yt, MessagePartSpans as Z, SPAN_QUERY_ORDER_FIELDS as Za, applyStateDelta as Zc, DatasetsInMemory as Zi, WorkflowStepConflictError as Zl, BaseProcessor as Zn, WorkspaceInstructionsProcessor as Zo, notificationSignalMetadata as Zr, emitErrorEvent as Zs, validateModelTimeoutSettings as Zt, describeNonSuccessFinishReason as _, createStorageErrorId as _a, getNestedWorkflow as _c, KnowledgeStorage as _i, validateStepInput as _l, knowledgeAccessGrants as _n, buildLogRecord as _o, knowledgeScopeKey as _r, ClassifierProcessor as _s, resolveTool$1 as _t, deleteRunRegistryEntry as a, SchemaUpdateValidationError as aa, subscribeToAbortRequests as ac, resolveNotificationDeliveryDecision as ai, getRestartStartIndex as al, removeKnowledgeNote as an, spanQueryIdentityKey as ao, MockMemory as ar, CostGuardProcessor as as, baseDurableAgenticInputSchema as at, isRunFenceConflictError as au, createOnScorerHook as b, ensureDate as ba, Workflow as bc, assertKnowledgeSchemaCompatible as bi, validateStepStateData as bl, KnowledgeDeclarationError as bn, buildUpdateSpanRecord as bo, knowledgeVisibleScopeKeys as br, PIIDetector as bs, createDurableAgentStream as bt, getRunRegistryEntry as c, ChannelsStorage as ca, DurableAgentDefaults as cc, InMemoryKnowledgeStorage as ci, getStepIds as cl, upsertKnowledgePage as cn, spanQueryResponseSchema as co, MAX_KNOWLEDGE_SCOPE_TAGS as cr, TokenLimiterProcessor as cs, modelConfigSchema as ct, runFencingNotSupportedError as cu, setRunRegistryEntry as d, BackgroundTasksInMemory as da, AGENT_STREAM_TOPIC as dc, KnowledgeImportersStorage as di, isSingleStepEntry as dl, KnowledgeLinkRefreshIncompleteError as dn, encodeTraceQueryDeltaCursor as do, assertKnowledgeRecordTextWithinBound as dr, advanceMemoryTokenBoundary as ds, runDurableFinishSideEffects as dt, SchemaValidator as ea, emitStepStartEvent as ec, summarizeNotifications as ei, createDeprecationProxy as el, buildKnowledgePageTools as en, encodeSpanQueryCursor as eo, globalEmbeddingCache as er, formatSkillsCatalog as es, resolveDurableToolCallConcurrency as et, RUN_FENCE_CONFLICT_ERROR_ID as eu, takeRunScorerInstances as f, BackgroundTasksStorage as fa, AgentControlEventTypes as fc, KNOWLEDGE_STORAGE_CONTRACT_VERSION as fi, omitPriorCompletionFields as fl, knowledgeSubtree as fn, getTraceQueryDeltaWatermark as fo, assertKnowledgeScopeWithinCeiling as fr, getMemoryTokenBoundary as fs, loadRunStoredMessages as ft, AGENTIC_LOOP_WORKFLOW_ID as g, runRetentionBatches as ga, EventedExecutionEngine as gc, KnowledgeSchemaResetRequiredError as gi, setLongTimeout as gl, updateKnowledgeLinks as gn, buildFeedbackRecord as go, isKnowledgeScopeVisible as gr, ModelSelectionProcessor as gs, resolveRuntimeDependencies as gt, AGENTIC_EXECUTION_WORKFLOW_ID as h, retentionCutoffMs as ha, restoredWorkerControllerContexts as hc, KnowledgeNotFoundError$1 as hi, runCountDeprecationMessage as hl, syncKnowledgePageBodyLinks as hn, buildCreateSpanRecord as ho, expandKnowledgeScope as hr, BatchPartsProcessor as hs, resolveModel as ht, abandonDurableAgentExecutions as i, UnsupportedSchemaPatternError as ia, requestAcknowledgedAbort as ic, resolveDeliveryFailureUpdate as ii, defineStateAccessors as il, moveKnowledgePage as in, spanQueryCostSchema as io, getMemoryRunState as ir, RegexFilterProcessor as is, accumulatedUsageSchema as it, currentRunGeneration as iu, assembleAgentFromFsEntry as j, transformScoreRow as ja, nestedRunStatusOf as jc, MAX_KNOWLEDGE_PAGE_DEPTH as ji, FilePartSchema as jl, defaultTypingStatus as jn, MESSAGE_EMBEDDING_CHARS_PER_TOKEN as jo, cloneRunData as jr, isBadRequestError as js, __registerMastraCtor as jt, agentConfig as k, storageMessageMatchesMetadataFilter as ka, nestedRunParentOf as kc, MAX_KNOWLEDGE_NOTE_TOKENS as ki, hasResumableStreams as kl, AgentChannels as kn, UniqueViolationError as ko, MockStore as kr, FILE_UPLOAD_ERROR_CODES as ks, ensureRemoteAbortListener as kt, globalRunRegistry as l, InMemoryBlobStore as la, DurableStepIds as lc, KnowledgeImporterBindingConflictError as li, hydrateSerializedStepErrors as ll, KnowledgeSemanticIndex as ln, spanQueryRowSchema as lo, assertKnowledgeCeilingRaised as lr, groupLinkedToolMessages as ls, modelListEntrySchema as lt, runOutsideRunFenceScope as lu, agentThreadStreamRuntime as m, resolveRetentionTargets as ma, CONTROLLER_RUN_BINDING_KEY as mc, KnowledgeConflictError as mi, resolveForeachConcurrency as ml, reindexKnowledgeLinks as mn, planTraceQuery as mo, createKnowledgeNodeCursor as mr, normalizeMessageHistoryConfig as ms, resolveInternalState as mt, ExtendedRunRegistry as n, createValidator as na, AgentStreamBus as nc, MAX_NOTIFICATION_DELIVERY_ATTEMPTS as ni, createTimeTravelExecutionParams as nl, knowledgeRunPrincipals as nn, planSpanQuery as no, MessageHistory as nr, AgentsMDInjector as ns, calculateAccumulatedUsage as nt, RunFenceConflictError as nu, endRunSpansWithError as o, SchemaValidationError as oa, createRunAbortController as oc, InMemoryMemory as oi, getResumeLabelsByStepId as ol, removeKnowledgePage as on, spanQueryIdentitySchema as oo, MAX_KNOWLEDGE_NODE_DESCRIPTION_LENGTH as or, TokenCostControl as os, baseIterationStateSchema as ot, matchesRunFence as ou, AgentThreadLeaseLostError as p, executeRetentionPrune as pa, AgentStreamEventTypes as pc, KNOWLEDGE_STORAGE_SCHEMA_VERSION as pi, omitPriorSuspensionFields as pl, refreshKnowledgeLinksTo as pn, planThreadQuery as po, canonicalizeKnowledgeScope as pr, isAfterMemoryTokenBoundary as ps, rebuildRunToolsFromMastra as pt, serializeDurableState 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, runDefaultCompletionCheck as qt, RunRegistry as r, getSchemaValidator as ra, publishAbortRequest as rc, defaultNotificationDeliveryDecision as ri, defineLazyWriter as rl, addKnowledgeNote as rn, resolveSpanQueryCost as ro, MemoryRunState as rr, ToolCallFilter as rs, createBaseIterationStateUpdate as rt, coverNestedRun as ru, getActiveDurableAgentWorkflowExecutions as s, InMemoryChannelsStorage as sa, DURABLE_STOP_WHEN_ERROR_ID as sc, MemoryStorage as si, getSingleStepEntryId as sl, updateKnowledgeNote as sn, spanQueryRequestSchema as so, MAX_KNOWLEDGE_RECORD_TEXT_LENGTH as sr, SystemPromptScrubber as ss, durableAgenticOutputSchema as st, resolveRunFence as su, DURABLE_CONTEXT_SEGMENT_KEY as t, assertSupportedPatterns as ta, emitSuspendedEvent as tc, readNotificationRoutingRequirement as ti, createRestartExecutionParams as tl, KnowledgeRun as tn, parseSpanQueryRequest as to, WorkingMemory as tr, ToolSearchProcessor as ts, buildStepRecord as tt, RUN_FENCING_NOT_SUPPORTED_ERROR_ID as tu, isDurableAgentExecutionDetached as u, BlobStore as ua, AGENT_CONTROL_TOPIC as uc, KnowledgeImporterRunStateError as ui, isEntryFinished as ul, embed$2 as un, encodeTraceQueryCursor as uo, assertKnowledgeDescriptionWithinBound as ur, loadMessageHistory as us, executeDurableAgentScorers as ut, setRunFenceContext as uu, runEvals as v, createStoreErrorId as va, getStepEntry as vc, KnowledgeTransactionDeadlineError as vi, validateStepRequestContext as vl, knowledgeReadScopeFor as vn, buildMetricRecord as vo, knowledgeSemanticDocumentId as vr, StructuredOutputProcessor as vs, toolRequiresApproval as vt, ScorerRunError as w, hasErrorCode as wa, mapVariable as wc, KnowledgeMoveTooLargeError as wi, getEntryWorkflow as wl, knowledgeScopeAddress as wn, toEntityType as wo, GitHubSourceControlProvider as wr, STABILITY_ERROR_PROCESSOR_IDS as ws, segmentEndedBySuspension as wt, validateAndSaveScore as x, filterByDateRange as xa, cloneStep$1 as xc, createKnowledgeUlid as xi, validateStepSuspendData as xl, compileKnowledgeScopes as xn, getObjectOrNull as xo, parseKnowledgeNodeCursor as xr, PromptInjectionDetector as xs, carrySegmentSpans as xt, flushBeforeTraceRead as y, createVectorErrorId as ya, Run as yc, KnowledgeUnsupportedCapabilityError as yi, validateStepResumeData as yl, knowledgeRoleOn as yn, buildScoreRecord as yo, knowledgeSemanticIdempotencyKey as yr, LanguageDetector as ys, resolveAgentById as yt, detachFullStreamOnEnd as z, THREAD_QUERY_DEFAULT_LIMIT as za, runFenceConflictOf as zc, canonicalKnowledgeName as zi, ProcessorOutputResultPhaseSchema as zl, CHAT_CHANNEL_RENDER_CONTEXT_KEY as zn, MemoryProcessor as zo, ToolProviderConnectionsStorage as zr, EventedWorkflow as zs, formatCheckFeedback as zt };