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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/dist/_types/@internal_core@0.1.4/dist/knowledge-compat/index.d.ts +49 -0
  2. package/dist/a2a/index.cjs +1 -1
  3. package/dist/a2a/index.js +1 -1
  4. package/dist/agent/durable/index.cjs +1 -1
  5. package/dist/agent/durable/index.js +1 -1
  6. package/dist/agent/durable/run-registry.d.ts +2 -0
  7. package/dist/agent/durable/types.d.ts +6 -0
  8. package/dist/agent/durable/utils/resolve-runtime.d.ts +5 -0
  9. package/dist/agent/index.cjs +3 -3
  10. package/dist/agent/index.js +3 -3
  11. package/dist/agent/message-list/index.cjs +1 -1
  12. package/dist/agent/message-list/index.js +1 -1
  13. package/dist/agent/message-list/state/MessageStateManager.d.ts +5 -0
  14. package/dist/agent-builder/ee/index.cjs +1 -1
  15. package/dist/agent-builder/ee/index.js +1 -1
  16. package/dist/agent-controller/index.cjs +1 -1
  17. package/dist/agent-controller/index.js +1 -1
  18. package/dist/agent-controller/session.d.ts +11 -1
  19. package/dist/{agent-controller-BolLBwDm.cjs → agent-controller-BcN7r3yI.cjs} +40 -204
  20. package/dist/{agent-controller--gKWI81G.js → agent-controller-DfeTRuBc.js} +40 -204
  21. package/dist/background-tasks/index.cjs +1 -1
  22. package/dist/background-tasks/index.js +1 -1
  23. package/dist/{background-tasks-CgzXjBfE.js → background-tasks-BcU--rXL.js} +1 -1
  24. package/dist/{background-tasks-DYtlijQ1.cjs → background-tasks-DRUHnQOk.cjs} +1 -1
  25. package/dist/browser/index.cjs +15 -6
  26. package/dist/browser/index.js +15 -6
  27. package/dist/browser/processor.d.ts +1 -0
  28. package/dist/{builder-Dz-g-9CZ.cjs → builder-Bufqrcz3.cjs} +2 -2
  29. package/dist/{builder-emNPaIaC.js → builder-TuIc5l7X.js} +2 -2
  30. package/dist/capabilities/302ai.json +201 -201
  31. package/dist/capabilities/abliteratedllm.json +34 -34
  32. package/dist/capabilities/abliteration-ai.json +11 -11
  33. package/dist/capabilities/above.json +22 -22
  34. package/dist/capabilities/adaption.json +13 -13
  35. package/dist/capabilities/adzuki.json +33 -33
  36. package/dist/capabilities/agentrouter.json +7 -7
  37. package/dist/capabilities/agnes.json +4 -4
  38. package/dist/capabilities/ai-router.json +8 -8
  39. package/dist/capabilities/aiand.json +22 -22
  40. package/dist/capabilities/aigrow.json +12 -12
  41. package/dist/capabilities/aimlapi.json +149 -149
  42. package/dist/capabilities/aixy.json +26 -26
  43. package/dist/capabilities/aki-io.json +12 -12
  44. package/dist/capabilities/alibaba-cn.json +93 -93
  45. package/dist/capabilities/alibaba-coding-plan-cn.json +5 -5
  46. package/dist/capabilities/alibaba-coding-plan.json +5 -5
  47. package/dist/capabilities/alibaba-token-plan-cn.json +37 -37
  48. package/dist/capabilities/alibaba-token-plan.json +40 -40
  49. package/dist/capabilities/alibaba.json +66 -66
  50. package/dist/capabilities/ambient.json +13 -13
  51. package/dist/capabilities/amd.json +11 -11
  52. package/dist/capabilities/anthropic.json +42 -42
  53. package/dist/capabilities/anyapi.json +47 -47
  54. package/dist/capabilities/apiko.json +5 -5
  55. package/dist/capabilities/arcee.json +11 -11
  56. package/dist/capabilities/augure.json +7 -7
  57. package/dist/capabilities/auriko.json +21 -21
  58. package/dist/capabilities/bailing.json +5 -5
  59. package/dist/capabilities/baseten.json +33 -33
  60. package/dist/capabilities/bee.json +4 -4
  61. package/dist/capabilities/berget.json +8 -8
  62. package/dist/capabilities/bothub.json +17 -17
  63. package/dist/capabilities/boundless.json +38 -38
  64. package/dist/capabilities/bumo.json +34 -34
  65. package/dist/capabilities/byteplus.json +24 -24
  66. package/dist/capabilities/cerebras.json +4 -4
  67. package/dist/capabilities/cheapaimodel.json +10 -10
  68. package/dist/capabilities/cheapest-token.json +28 -28
  69. package/dist/capabilities/chutes.json +7 -7
  70. package/dist/capabilities/cline-pass.json +35 -35
  71. package/dist/capabilities/cloudcode.json +7 -7
  72. package/dist/capabilities/cloudferro-sherlock.json +4 -4
  73. package/dist/capabilities/cloudflare-workers-ai.json +19 -19
  74. package/dist/capabilities/commandcode.json +149 -149
  75. package/dist/capabilities/concentrate.json +276 -268
  76. package/dist/capabilities/cortecs.json +104 -104
  77. package/dist/capabilities/crossmodel.json +179 -179
  78. package/dist/capabilities/crusoe.json +19 -19
  79. package/dist/capabilities/daoxe.json +6 -6
  80. package/dist/capabilities/databricks.json +124 -124
  81. package/dist/capabilities/deepinfra.json +89 -83
  82. package/dist/capabilities/deepseek.json +4 -4
  83. package/dist/capabilities/digitalocean.json +113 -113
  84. package/dist/capabilities/dothoosh.json +32 -32
  85. package/dist/capabilities/doubleword.json +25 -25
  86. package/dist/capabilities/edenai.json +286 -286
  87. package/dist/capabilities/empiriolabs.json +169 -169
  88. package/dist/capabilities/engy.json +16 -16
  89. package/dist/capabilities/entrim.json +8 -8
  90. package/dist/capabilities/evroc.json +12 -12
  91. package/dist/capabilities/ezkielyna.json +4 -4
  92. package/dist/capabilities/fastrouter.json +83 -83
  93. package/dist/capabilities/fireworks-ai.json +99 -99
  94. package/dist/capabilities/fortytwo.json +4 -4
  95. package/dist/capabilities/freemodel.json +22 -22
  96. package/dist/capabilities/friendli.json +8 -8
  97. package/dist/capabilities/frogbot.json +87 -87
  98. package/dist/capabilities/gisoo.json +17 -17
  99. package/dist/capabilities/gmicloud.json +21 -21
  100. package/dist/capabilities/google.json +58 -58
  101. package/dist/capabilities/graphn.json +8 -8
  102. package/dist/capabilities/greenpt.json +34 -34
  103. package/dist/capabilities/groq.json +9 -9
  104. package/dist/capabilities/helicone.json +87 -87
  105. package/dist/capabilities/hetzner.json +5 -5
  106. package/dist/capabilities/hostinger-router.json +10 -10
  107. package/dist/capabilities/hpc-ai.json +12 -12
  108. package/dist/capabilities/huawei-maas.json +15 -15
  109. package/dist/capabilities/hubris.json +32 -32
  110. package/dist/capabilities/huggingface.json +93 -85
  111. package/dist/capabilities/humain.json +2 -2
  112. package/dist/capabilities/hyper.json +23 -23
  113. package/dist/capabilities/impossibl.json +173 -173
  114. package/dist/capabilities/inceptron.json +8 -8
  115. package/dist/capabilities/inco.json +4 -4
  116. package/dist/capabilities/infer.json +14 -14
  117. package/dist/capabilities/inferall.json +9 -9
  118. package/dist/capabilities/inference-coop.json +9 -9
  119. package/dist/capabilities/inferenceapis.json +13 -13
  120. package/dist/capabilities/inferris.json +4 -4
  121. package/dist/capabilities/infersia.json +8 -8
  122. package/dist/capabilities/inferx.json +3 -3
  123. package/dist/capabilities/infomaniak.json +2 -2
  124. package/dist/capabilities/io-net.json +5 -5
  125. package/dist/capabilities/isoquant.json +4 -4
  126. package/dist/capabilities/iteracompute.json +53 -53
  127. package/dist/capabilities/jad-ai.json +2 -2
  128. package/dist/capabilities/jalapeno.json +12 -12
  129. package/dist/capabilities/jiekou.json +67 -67
  130. package/dist/capabilities/joingonka.json +4 -4
  131. package/dist/capabilities/jzstoken.json +53 -53
  132. package/dist/capabilities/keln.json +21 -21
  133. package/dist/capabilities/kenari.json +132 -124
  134. package/dist/capabilities/kilo.json +604 -604
  135. package/dist/capabilities/kimi-code-plan-cn.json +7 -7
  136. package/dist/capabilities/kimi-code-plan-global.json +7 -7
  137. package/dist/capabilities/kitani.json +6 -6
  138. package/dist/capabilities/klavo.json +21 -21
  139. package/dist/capabilities/korouter.json +30 -30
  140. package/dist/capabilities/kunavo.json +7 -7
  141. package/dist/capabilities/liquid.json +9 -9
  142. package/dist/capabilities/lithosai.json +2 -2
  143. package/dist/capabilities/llmgateway-providers.json +944 -944
  144. package/dist/capabilities/llmgateway.json +340 -340
  145. package/dist/capabilities/llmtr.json +30 -30
  146. package/dist/capabilities/logits.json +2 -2
  147. package/dist/capabilities/longcat.json +2 -2
  148. package/dist/capabilities/lowrouter.json +60 -60
  149. package/dist/capabilities/lyceum.json +12 -12
  150. package/dist/capabilities/melious.json +8 -8
  151. package/dist/capabilities/merge-gateway.json +280 -280
  152. package/dist/capabilities/meta.json +7 -7
  153. package/dist/capabilities/mistral.json +18 -18
  154. package/dist/capabilities/mixlayer.json +5 -5
  155. package/dist/capabilities/modal.json +12 -12
  156. package/dist/capabilities/model-oracle-ai.json +25 -25
  157. package/dist/capabilities/modelis.json +21 -21
  158. package/dist/capabilities/modular.json +13 -13
  159. package/dist/capabilities/moneo.json +18 -18
  160. package/dist/capabilities/moonshotai-cn.json +7 -7
  161. package/dist/capabilities/moonshotai.json +7 -7
  162. package/dist/capabilities/morph.json +16 -16
  163. package/dist/capabilities/munito-eu.json +6 -6
  164. package/dist/capabilities/munito.json +10 -10
  165. package/dist/capabilities/nan.json +28 -28
  166. package/dist/capabilities/nano-gpt.json +566 -565
  167. package/dist/capabilities/nearai.json +96 -96
  168. package/dist/capabilities/nebius.json +32 -32
  169. package/dist/capabilities/neon.json +124 -124
  170. package/dist/capabilities/neuralwatt.json +36 -36
  171. package/dist/capabilities/nokeep.json +5 -5
  172. package/dist/capabilities/novita-ai.json +153 -153
  173. package/dist/capabilities/nvidia.json +35 -35
  174. package/dist/capabilities/oathbreaker.json +3 -3
  175. package/dist/capabilities/obscurify.json +27 -27
  176. package/dist/capabilities/oci.json +10 -10
  177. package/dist/capabilities/ofox.json +381 -381
  178. package/dist/capabilities/ollama-cloud.json +48 -48
  179. package/dist/capabilities/openai.json +59 -59
  180. package/dist/capabilities/opencode-go.json +91 -91
  181. package/dist/capabilities/openreason.json +5 -5
  182. package/dist/capabilities/openrouter.json +526 -527
  183. package/dist/capabilities/opper.json +29 -29
  184. package/dist/capabilities/orcarouter.json +228 -228
  185. package/dist/capabilities/outerlabs.json +30 -30
  186. package/dist/capabilities/ovhcloud.json +19 -19
  187. package/dist/capabilities/pareto.json +5 -5
  188. package/dist/capabilities/pendra.json +4 -4
  189. package/dist/capabilities/perplexity-agent.json +47 -47
  190. package/dist/capabilities/phala.json +30 -30
  191. package/dist/capabilities/pioneer.json +27 -27
  192. package/dist/capabilities/poe.json +133 -133
  193. package/dist/capabilities/poolside.json +2 -2
  194. package/dist/capabilities/powerspring.json +9 -9
  195. package/dist/capabilities/primalabs.json +9 -9
  196. package/dist/capabilities/prime.json +106 -106
  197. package/dist/capabilities/privatemode-ai.json +12 -12
  198. package/dist/capabilities/proxystacks.json +7 -7
  199. package/dist/capabilities/qiniu-ai.json +14 -14
  200. package/dist/capabilities/refuseless.json +8 -8
  201. package/dist/capabilities/regolo-ai.json +2 -2
  202. package/dist/capabilities/requesty.json +258 -199
  203. package/dist/capabilities/ruapi.json +21 -21
  204. package/dist/capabilities/runcrate.json +14 -14
  205. package/dist/capabilities/runinfra.json +18 -18
  206. package/dist/capabilities/sakana.json +6 -6
  207. package/dist/capabilities/sambanova.json +6 -6
  208. package/dist/capabilities/sandbase.json +22 -22
  209. package/dist/capabilities/sarvam.json +14 -14
  210. package/dist/capabilities/scaleway.json +16 -16
  211. package/dist/capabilities/scnet-token-plan.json +10 -10
  212. package/dist/capabilities/scx-ai.json +29 -29
  213. package/dist/capabilities/sensenova.json +12 -12
  214. package/dist/capabilities/siliconflow-cn.json +56 -56
  215. package/dist/capabilities/siliconflow.json +60 -60
  216. package/dist/capabilities/snowflake-cortex.json +20 -20
  217. package/dist/capabilities/sokkan.json +10 -10
  218. package/dist/capabilities/sparrowcodes.json +16 -16
  219. package/dist/capabilities/standardcompute.json +88 -88
  220. package/dist/capabilities/steadyrouter.json +35 -35
  221. package/dist/capabilities/stepfun-ai-step-plan.json +4 -4
  222. package/dist/capabilities/stepfun-ai.json +4 -4
  223. package/dist/capabilities/stepfun-step-plan.json +4 -4
  224. package/dist/capabilities/stepfun.json +4 -4
  225. package/dist/capabilities/stepping-stone.json +21 -21
  226. package/dist/capabilities/subconscious.json +2 -2
  227. package/dist/capabilities/superbot-gg.json +4 -4
  228. package/dist/capabilities/synthetic.json +10 -10
  229. package/dist/capabilities/synthorai.json +19 -19
  230. package/dist/capabilities/teamorouter.json +25 -25
  231. package/dist/capabilities/teapot-router.json +7 -7
  232. package/dist/capabilities/tencent-token-plan-intl.json +24 -24
  233. package/dist/capabilities/tencent-token-plan.json +40 -40
  234. package/dist/capabilities/tencent-tokenhub.json +47 -47
  235. package/dist/capabilities/tensorx.json +48 -48
  236. package/dist/capabilities/tenstorrent.json +8 -8
  237. package/dist/capabilities/the-grid-ai.json +28 -28
  238. package/dist/capabilities/thinkingmachines.json +39 -39
  239. package/dist/capabilities/tinfoil.json +14 -14
  240. package/dist/capabilities/toapis.json +2 -2
  241. package/dist/capabilities/togetherai.json +50 -50
  242. package/dist/capabilities/tokengo.json +19 -19
  243. package/dist/capabilities/tokenify.json +9 -9
  244. package/dist/capabilities/trustedrouter.json +7 -7
  245. package/dist/capabilities/trustedtokens.json +20 -20
  246. package/dist/capabilities/umans-ai-coding-plan.json +18 -18
  247. package/dist/capabilities/umans-ai.json +12 -12
  248. package/dist/capabilities/uncensuredai.json +4 -4
  249. package/dist/capabilities/unrestricted.json +8 -8
  250. package/dist/capabilities/uplinkswitch.json +22 -22
  251. package/dist/capabilities/upstage.json +6 -6
  252. package/dist/capabilities/vancine.json +15 -15
  253. package/dist/capabilities/vercel.json +546 -546
  254. package/dist/capabilities/vivgrid.json +84 -84
  255. package/dist/capabilities/volcengine-coding-plan.json +28 -28
  256. package/dist/capabilities/volcengine.json +29 -29
  257. package/dist/capabilities/vultr.json +31 -31
  258. package/dist/capabilities/wafer.ai.json +15 -15
  259. package/dist/capabilities/wallaby.json +2 -2
  260. package/dist/capabilities/wally.json +9 -9
  261. package/dist/capabilities/wandb.json +16 -16
  262. package/dist/capabilities/watt.json +22 -22
  263. package/dist/capabilities/xai.json +7 -7
  264. package/dist/capabilities/xiaomi.json +3 -3
  265. package/dist/capabilities/xpersona.json +11 -11
  266. package/dist/capabilities/xxapi.json +28 -28
  267. package/dist/capabilities/zai-coding-plan.json +12 -12
  268. package/dist/capabilities/zai.json +31 -31
  269. package/dist/capabilities/zenifra.json +26 -26
  270. package/dist/capabilities/zenmux.json +159 -159
  271. package/dist/capabilities/zerogpu.json +11 -11
  272. package/dist/capabilities/zhipuai-coding-plan.json +8 -8
  273. package/dist/capabilities/zhipuai.json +29 -29
  274. package/dist/capabilities/zro.json +7 -7
  275. package/dist/channels/index.cjs +2 -2
  276. package/dist/channels/index.js +2 -2
  277. package/dist/{channels-CndspFXP.js → channels-Cdsqdajh.js} +1 -1
  278. package/dist/{channels-BVnDIsZS.cjs → channels-MsOnUvU6.cjs} +1 -1
  279. package/dist/coding-agent/index.cjs +2 -2
  280. package/dist/coding-agent/index.js +2 -2
  281. package/dist/datasets/index.cjs +2 -2
  282. package/dist/datasets/index.js +2 -2
  283. package/dist/docs/SKILL.md +1 -1
  284. package/dist/docs/assets/SOURCE_MAP.json +609 -609
  285. package/dist/docs/references/reference-agent-controller-session.md +29 -1
  286. package/dist/docs/references/reference-memory-observational-memory.md +4 -0
  287. package/dist/docs/references/reference.md +1 -0
  288. package/dist/evals/index.cjs +1 -1
  289. package/dist/evals/index.js +1 -1
  290. package/dist/evals/scoreTraces/index.cjs +1 -1
  291. package/dist/evals/scoreTraces/index.js +1 -1
  292. package/dist/harness/index.cjs +1 -1
  293. package/dist/harness/index.js +1 -1
  294. package/dist/index.cjs +1 -1
  295. package/dist/index.js +1 -1
  296. package/dist/knowledge/importers/overlay.d.ts +138 -0
  297. package/dist/knowledge/importers/sink.d.ts +6 -0
  298. package/dist/knowledge/importers/types.d.ts +5 -0
  299. package/dist/knowledge/index.cjs +1412 -139
  300. package/dist/knowledge/index.js +1412 -139
  301. package/dist/knowledge/links.d.ts +27 -0
  302. package/dist/llm/index.cjs +3 -3
  303. package/dist/llm/index.js +3 -3
  304. package/dist/llm/model/provider-types.generated.d.ts +7781 -7766
  305. package/dist/llm/reasoning/anthropic-thinking.d.ts +5 -0
  306. package/dist/llm/reasoning/gemini-thinking.d.ts +24 -0
  307. package/dist/llm/reasoning/index.cjs +389 -0
  308. package/dist/llm/reasoning/index.d.ts +8 -0
  309. package/dist/llm/reasoning/index.js +362 -0
  310. package/dist/llm/reasoning/model-fallback.d.ts +75 -0
  311. package/dist/llm/reasoning/model-ids.d.ts +5 -0
  312. package/dist/llm/reasoning/thinking-provider-options.d.ts +10 -0
  313. package/dist/llm/reasoning/thinking-request.d.ts +14 -0
  314. package/dist/llm/reasoning/thinking.d.ts +37 -0
  315. package/dist/{llm-B1semiTO.cjs → llm-CS6YY_IV.cjs} +2 -2
  316. package/dist/{llm-CytL7cpw.js → llm-zjtMQn7M.js} +2 -2
  317. package/dist/loop/index.cjs +2 -2
  318. package/dist/loop/index.js +2 -2
  319. package/dist/{manager-BwyfS4ha.cjs → manager-BU_lY6kl.cjs} +2 -2
  320. package/dist/{manager-DnTzA9GL.js → manager-Do0MENhH.js} +2 -2
  321. package/dist/mastra/index.cjs +1 -1
  322. package/dist/mastra/index.d.ts +2 -0
  323. package/dist/mastra/index.js +1 -1
  324. package/dist/{mastra-DTkZPpch.js → mastra-C-1zIyS5.js} +22 -16
  325. package/dist/{mastra-Dj35Lj_J.cjs → mastra-DYVjsXTO.cjs} +22 -16
  326. package/dist/memory/index.cjs +3 -3
  327. package/dist/memory/index.js +3 -3
  328. package/dist/memory/om-events/index.cjs +189 -0
  329. package/dist/memory/om-events/index.d.ts +17 -0
  330. package/dist/memory/om-events/index.js +188 -0
  331. package/dist/{message-list-vR3uLAHL.cjs → message-list-C0F2sDNC.cjs} +3 -2
  332. package/dist/{message-list-BGm1DCiG.js → message-list-RgFlLrxG.js} +3 -2
  333. package/dist/{model-eDfetuno.cjs → model-DGFc1hw3.cjs} +1 -1
  334. package/dist/{model-DyQ07rPH.js → model-DIzIjDej.js} +1 -1
  335. package/dist/{netlify-BUvdxfHe.js → netlify-B9mLgxJs.js} +1 -1
  336. package/dist/{netlify-BC4v7Ufv.cjs → netlify-CyL6FNsw.cjs} +1 -1
  337. package/dist/notifications/index.cjs +1 -1
  338. package/dist/notifications/index.js +1 -1
  339. package/dist/processor-provider/index.cjs +1 -1
  340. package/dist/processor-provider/index.js +1 -1
  341. package/dist/processors/index.cjs +2 -2
  342. package/dist/processors/index.js +2 -2
  343. package/dist/{provider-registry-CP_5SNiw.js → provider-registry-DdQoO_jd.js} +22523 -22492
  344. package/dist/{provider-registry-Bn01gq9y.cjs → provider-registry-g9m_fyV8.cjs} +22523 -22492
  345. package/dist/provider-registry.json +22977 -22946
  346. package/dist/{registry-generator-CNFKGRFQ.cjs → registry-generator-At8J4ZOR.cjs} +1 -1
  347. package/dist/{registry-generator-CDPyxbzt.js → registry-generator-CX6Ev697.js} +1 -1
  348. package/dist/{rehydrate-DExpzlNS.cjs → rehydrate-BzD6UX8f.cjs} +2 -2
  349. package/dist/{rehydrate-CnGNY2zq.js → rehydrate-DEDxsr6E.js} +2 -2
  350. package/dist/relevance/index.cjs +2 -2
  351. package/dist/relevance/index.js +2 -2
  352. package/dist/{run-registry-BL_kKvFE.js → run-registry-D22IF5SK.js} +434 -26
  353. package/dist/{run-registry-CibQoN6K.cjs → run-registry-PiQTSx2Y.cjs} +457 -25
  354. package/dist/storage/domains/knowledge/base.d.ts +86 -1
  355. package/dist/storage/domains/knowledge/importers-inmemory.d.ts +9 -0
  356. package/dist/storage/domains/knowledge/importers.d.ts +31 -0
  357. package/dist/storage/domains/knowledge/inmemory.d.ts +7 -0
  358. package/dist/storage/domains/knowledge/pages-inmemory.d.ts +31 -1
  359. package/dist/storage/domains/knowledge/pages.d.ts +74 -0
  360. package/dist/storage/index.cjs +2 -2
  361. package/dist/storage/index.js +2 -2
  362. package/dist/storage/types.d.ts +6 -0
  363. package/dist/stream/base/output.d.ts +7 -0
  364. package/dist/stream/index.cjs +2 -2
  365. package/dist/stream/index.js +2 -2
  366. package/dist/{stream-D_7tMaJe.cjs → stream-BbPZavop.cjs} +36 -4
  367. package/dist/{stream-1DGoEkG2.js → stream-CoQTdzLm.js} +31 -5
  368. package/dist/test-utils/llm-mock.cjs +1 -1
  369. package/dist/test-utils/llm-mock.js +1 -1
  370. package/dist/tool-loop-agent/index.cjs +1 -1
  371. package/dist/tool-loop-agent/index.js +1 -1
  372. package/dist/{tool-loop-agent-CLB1r3X3.cjs → tool-loop-agent-8lyD6O4o.cjs} +4 -4
  373. package/dist/{tool-loop-agent-BXya_RYj.js → tool-loop-agent-DhQkNDaR.js} +4 -4
  374. package/dist/{utils-C55ZdVaj.js → utils-B-3lET9S.js} +1 -1
  375. package/dist/{utils-B-KOMA_Q.cjs → utils-DtmyBuBT.cjs} +1 -1
  376. package/dist/utils.cjs +1 -1
  377. package/dist/utils.js +1 -1
  378. package/dist/{validate-BDfYr72F.js → validate-CO4rWYyH.js} +1 -1
  379. package/dist/{validate-CmZhnsmX.cjs → validate-vucjWXcz.cjs} +1 -1
  380. package/dist/vector/index.cjs +2 -2
  381. package/dist/vector/index.js +2 -2
  382. package/dist/worker/index.cjs +1 -1
  383. package/dist/worker/index.js +1 -1
  384. package/dist/{worker-CuK2RaC0.js → worker-B6CpapAF.js} +2 -2
  385. package/dist/{worker-BoybIUTI.cjs → worker-BgifMkOw.cjs} +2 -2
  386. package/dist/{worker-BG1rw_dg.js → worker-CCpSrXBY.js} +2 -2
  387. package/dist/{worker-D2B-x7Le.cjs → worker-eUT7GgQ9.cjs} +2 -2
  388. package/dist/{workflow-Bt09PcH1.js → workflow-B4Tn58DD.js} +3 -3
  389. package/dist/{workflow-CTKqeRXU.cjs → workflow-BJSrGEEL.cjs} +3 -3
  390. package/dist/workflows/builder/index.cjs +1 -1
  391. package/dist/workflows/builder/index.js +1 -1
  392. package/dist/workflows/evented/index.cjs +1 -1
  393. package/dist/workflows/evented/index.js +1 -1
  394. package/dist/workflows/index.cjs +4 -4
  395. package/dist/workflows/index.js +4 -4
  396. package/dist/workspace/index.cjs +1 -1
  397. package/dist/workspace/index.js +1 -1
  398. package/dist/workspace/sandbox/local-sandbox.d.ts +11 -0
  399. package/dist/workspace/sandbox/sandbox.d.ts +2 -0
  400. package/dist/{workspace-C8Zo5_qK.cjs → workspace-C5lXteRU.cjs} +174 -12
  401. package/dist/{workspace-DOAil8mG.js → workspace-CnmmMou8.js} +174 -12
  402. package/llm/reasoning.d.ts +1 -0
  403. package/memory/om-events.d.ts +1 -0
  404. package/package.json +27 -7
  405. package/src/llm/model/provider-types.generated.d.ts +7781 -7766
@@ -1,7 +1,7 @@
1
1
  import type { KnowledgeScopeDeclarations } from '../../../knowledge/declarations.js';
2
2
  import { StorageDomain } from '../base.js';
3
3
  import type { KnowledgeImportersStorage } from './importers.js';
4
- import type { KnowledgePage, KnowledgePageStore, KnowledgeReadScope } from './pages.js';
4
+ import type { KnowledgeNote, KnowledgePage, KnowledgePageStore, KnowledgePageWrite, KnowledgeReadScope } from './pages.js';
5
5
  /** @experimental Knowledge APIs are experimental and may change without notice. */
6
6
  export declare const KNOWLEDGE_STORAGE_CONTRACT_VERSION: 4;
7
7
  /** @experimental Knowledge APIs are experimental and may change without notice. */
@@ -188,6 +188,91 @@ export declare abstract class KnowledgeStorage extends StorageDomain implements
188
188
  read: KnowledgeReadScope;
189
189
  }): Promise<KnowledgePage[]>;
190
190
  getPageByPath(_input: Parameters<KnowledgePageStore['getPageByPath']>[0]): ReturnType<KnowledgePageStore['getPageByPath']>;
191
+ /**
192
+ * For each id, what {@link getPageParents} returns with `parentId: id`: that row and its
193
+ * ancestors, nearest first, deleted rows included. Every requested id is a key; a missing or
194
+ * unreadable one maps to `[]`.
195
+ *
196
+ * @experimental
197
+ */
198
+ getPageChains?(input: {
199
+ ids: string[];
200
+ read: KnowledgeReadScope;
201
+ }): Promise<Record<string, KnowledgePage[]>>;
202
+ /**
203
+ * For each path, what {@link getPageByPath} returns for it under `scopeId`, in input order.
204
+ *
205
+ * @experimental
206
+ */
207
+ getPagesByPaths?(input: {
208
+ scopeId: string;
209
+ paths: string[][];
210
+ read: KnowledgeReadScope;
211
+ }): Promise<(KnowledgePage | null)[]>;
212
+ /**
213
+ * For each parent, the position {@link createPage} places a new child after: the position of its
214
+ * last live child, or `null` with none. Every requested id is a key. Takes no read scope, like
215
+ * {@link createPage}: ask only for parents the caller may write under. A root (no parent) is not
216
+ * expressible; importers never create one.
217
+ *
218
+ * @experimental
219
+ */
220
+ getLastChildPositions?(input: {
221
+ parentIds: string[];
222
+ }): Promise<Record<string, string | null>>;
223
+ /**
224
+ * For each page, every note {@link listNotes} returns for it, unpaginated, oldest first.
225
+ * Every requested id is a key. Not bounded per page: ask only for pages whose notes you need.
226
+ *
227
+ * @experimental
228
+ */
229
+ listNotesByPages?(input: {
230
+ pageIds: string[];
231
+ read: KnowledgeReadScope;
232
+ }): Promise<Record<string, KnowledgeNote[]>>;
233
+ /**
234
+ * For each root, the live ordinary pages under it, the ones {@link lockSubtree} would lock (not the
235
+ * root, no scope pages, no deleted rows), unordered and not locked; `null` when it has more than
236
+ * `limit`. Every requested id is a key; a missing root maps to `[]`. Takes no read scope, like
237
+ * {@link lockSubtree}.
238
+ *
239
+ * @experimental
240
+ */
241
+ getPageSubtrees?(input: {
242
+ rootIds: string[];
243
+ limit: number;
244
+ }): Promise<Record<string, KnowledgePage[] | null>>;
245
+ /**
246
+ * For each name, what {@link findPagesByName} returns for it with the same `read`, `scopeId` and
247
+ * `limit` (the limit applies per name). Every requested name is a key, as given.
248
+ *
249
+ * @experimental
250
+ */
251
+ findPagesByNames?(input: {
252
+ names: string[];
253
+ read: KnowledgeReadScope;
254
+ scopeId?: string;
255
+ limit?: number;
256
+ }): Promise<Record<string, KnowledgePage[]>>;
257
+ /**
258
+ * Applies `writes` in one transaction with the end state, activity rows and versions of making
259
+ * the matching single writes one by one in input order. Activity rows are written in input order
260
+ * (`replace-links` writes none). The store checks only versions (a write whose page is missing,
261
+ * deleted or at another version throws) and key clashes, and the description and note token
262
+ * bounds; the caller has already made every other check the single writes make (live parent, no
263
+ * live children, depth and move limits, stamp scopes, mentions). A store may group the
264
+ * statements, so a batch must also hold:
265
+ * - at most one `create`, one `move` and one `delete` per page, and no `create`, `update` or `move` of a deleted one;
266
+ * - a `create` doesn't take a key that a `move` in the batch frees.
267
+ * - at most one `add-note` or `remove-note` per note.
268
+ * A batch that breaks the first rule throws before writing; one that breaks the second may throw.
269
+ * Any throw applies nothing, and the caller then rolls back and writes one by one.
270
+ *
271
+ * @experimental
272
+ */
273
+ applyPageWrites?(input: {
274
+ writes: KnowledgePageWrite[];
275
+ }): Promise<void>;
191
276
  findPagesByName(_input: Parameters<KnowledgePageStore['findPagesByName']>[0]): ReturnType<KnowledgePageStore['findPagesByName']>;
192
277
  listChildPages(_input: Parameters<KnowledgePageStore['listChildPages']>[0]): ReturnType<KnowledgePageStore['listChildPages']>;
193
278
  listPages(_input: Parameters<KnowledgePageStore['listPages']>[0]): ReturnType<KnowledgePageStore['listPages']>;
@@ -102,8 +102,16 @@ export declare class InMemoryKnowledgeImportersStorage extends KnowledgeImporter
102
102
  getNode(bindingId: string, sourceId: string): Promise<KnowledgeImporterNodeRecord | null>;
103
103
  getNodes(bindingId: string, sourceIds: string[]): Promise<KnowledgeImporterNodeRecord[]>;
104
104
  getNodeByPage(pageId: string): Promise<KnowledgeImporterNodeRecord | null>;
105
+ getNodesByPages(pageIds: string[]): Promise<KnowledgeImporterNodeRecord[]>;
105
106
  saveNode(node: Omit<KnowledgeImporterNodeRecord, 'updatedAt'>): Promise<void>;
106
107
  deleteNode(bindingId: string, sourceId: string): Promise<void>;
108
+ writeNodes(input: {
109
+ deletes: {
110
+ bindingId: string;
111
+ sourceId: string;
112
+ }[];
113
+ saves: Omit<KnowledgeImporterNodeRecord, 'updatedAt'>[];
114
+ }): Promise<void>;
107
115
  listNodes(bindingId: string, options?: {
108
116
  after?: string;
109
117
  limit?: number;
@@ -118,6 +126,7 @@ export declare class InMemoryKnowledgeImportersStorage extends KnowledgeImporter
118
126
  getState(bindingId: string): Promise<Record<string, string>>;
119
127
  setState(bindingId: string, state: Record<string, string>): Promise<void>;
120
128
  recordRunChange(change: KnowledgeImporterRunChangeRecord): Promise<void>;
129
+ recordRunChanges(changes: KnowledgeImporterRunChangeRecord[]): Promise<void>;
121
130
  listRunChanges(runId: string, options?: {
122
131
  after?: string;
123
132
  limit?: number;
@@ -243,9 +243,32 @@ export declare abstract class KnowledgeImportersStorage {
243
243
  */
244
244
  getNodes?(bindingId: string, sourceIds: string[]): Promise<KnowledgeImporterNodeRecord[]>;
245
245
  abstract getNodeByPage(pageId: string): Promise<KnowledgeImporterNodeRecord | null>;
246
+ /**
247
+ * The nodes of `pageIds`, of any binding, each as {@link getNodeByPage} returns it, in no
248
+ * particular order; pages without one are left out and duplicates count once. Optional: an
249
+ * importer flush reads in batches only when the store implements it.
250
+ *
251
+ * @experimental
252
+ */
253
+ getNodesByPages?(pageIds: string[]): Promise<KnowledgeImporterNodeRecord[]>;
246
254
  /** Insert or replace by `(bindingId, sourceId)`. A page already mapped to another node throws. */
247
255
  abstract saveNode(node: Omit<KnowledgeImporterNodeRecord, 'updatedAt'>): Promise<void>;
248
256
  abstract deleteNode(bindingId: string, sourceId: string): Promise<void>;
257
+ /**
258
+ * Deletes `deletes`, then saves `saves` as {@link saveNode} would one by one, in one transaction.
259
+ * A key in `saves` more than once keeps its last record. A page mapped to a node that is neither
260
+ * deleted nor saved here throws, as does a page two records in `saves` map to. Optional: an
261
+ * importer flush writes in batches only when the store implements it.
262
+ *
263
+ * @experimental
264
+ */
265
+ writeNodes?(input: {
266
+ deletes: {
267
+ bindingId: string;
268
+ sourceId: string;
269
+ }[];
270
+ saves: Omit<KnowledgeImporterNodeRecord, 'updatedAt'>[];
271
+ }): Promise<void>;
249
272
  /** Ordered by sourceId (byte order). `unsettled: true` lists only nodes with `unsettled` set. */
250
273
  abstract listNodes(bindingId: string, options?: {
251
274
  after?: string;
@@ -268,6 +291,14 @@ export declare abstract class KnowledgeImportersStorage {
268
291
  abstract setState(bindingId: string, state: Record<string, string>): Promise<void>;
269
292
  /** Insert or replace by `(runId, sourceId)`. */
270
293
  abstract recordRunChange(change: KnowledgeImporterRunChangeRecord): Promise<void>;
294
+ /**
295
+ * Records `changes` as {@link recordRunChange} would one by one, in one transaction: a key recorded
296
+ * again keeps its place and takes the last record. Optional: an importer flush records its changes
297
+ * in one batch only when the store implements it.
298
+ *
299
+ * @experimental
300
+ */
301
+ recordRunChanges?(changes: KnowledgeImporterRunChangeRecord[]): Promise<void>;
271
302
  /** In the order they were recorded. */
272
303
  abstract listRunChanges(runId: string, options?: {
273
304
  after?: string;
@@ -11,10 +11,17 @@ export declare class InMemoryKnowledgeStorage extends KnowledgeStorage {
11
11
  countChildScopes(input: Parameters<KnowledgePageStore['countChildScopes']>[0]): ReturnType<KnowledgePageStore['countChildScopes']>;
12
12
  getPage(input: Parameters<KnowledgePageStore['getPage']>[0]): ReturnType<KnowledgePageStore['getPage']>;
13
13
  getPageParents(input: Parameters<KnowledgeStorage['getPageParents']>[0]): ReturnType<KnowledgeStorage['getPageParents']>;
14
+ getPageChains(input: Parameters<NonNullable<KnowledgeStorage['getPageChains']>>[0]): ReturnType<NonNullable<KnowledgeStorage['getPageChains']>>;
15
+ getPagesByPaths(input: Parameters<NonNullable<KnowledgeStorage['getPagesByPaths']>>[0]): ReturnType<NonNullable<KnowledgeStorage['getPagesByPaths']>>;
16
+ getLastChildPositions(input: Parameters<NonNullable<KnowledgeStorage['getLastChildPositions']>>[0]): ReturnType<NonNullable<KnowledgeStorage['getLastChildPositions']>>;
17
+ getPageSubtrees(input: Parameters<NonNullable<KnowledgeStorage['getPageSubtrees']>>[0]): ReturnType<NonNullable<KnowledgeStorage['getPageSubtrees']>>;
18
+ listNotesByPages(input: Parameters<NonNullable<KnowledgeStorage['listNotesByPages']>>[0]): ReturnType<NonNullable<KnowledgeStorage['listNotesByPages']>>;
19
+ applyPageWrites(input: Parameters<NonNullable<KnowledgeStorage['applyPageWrites']>>[0]): ReturnType<NonNullable<KnowledgeStorage['applyPageWrites']>>;
14
20
  listScopeDeclarations(): ReturnType<KnowledgePageStore['listScopeDeclarations']>;
15
21
  renameScopeDeclaration(input: Parameters<KnowledgePageStore['renameScopeDeclaration']>[0]): ReturnType<KnowledgePageStore['renameScopeDeclaration']>;
16
22
  getPages(input: Parameters<KnowledgePageStore['getPages']>[0]): ReturnType<KnowledgePageStore['getPages']>;
17
23
  getPageByPath(input: Parameters<KnowledgePageStore['getPageByPath']>[0]): ReturnType<KnowledgePageStore['getPageByPath']>;
24
+ findPagesByNames(input: Parameters<NonNullable<KnowledgeStorage['findPagesByNames']>>[0]): ReturnType<NonNullable<KnowledgeStorage['findPagesByNames']>>;
18
25
  findPagesByName(input: Parameters<KnowledgePageStore['findPagesByName']>[0]): ReturnType<KnowledgePageStore['findPagesByName']>;
19
26
  listChildPages(input: Parameters<KnowledgePageStore['listChildPages']>[0]): ReturnType<KnowledgePageStore['listChildPages']>;
20
27
  listPages(input: Parameters<KnowledgePageStore['listPages']>[0]): ReturnType<KnowledgePageStore['listPages']>;
@@ -1,4 +1,4 @@
1
- import type { KnowledgeNote, KnowledgePage, KnowledgePageActivityAction, KnowledgePageActivityEvent, KnowledgePageBodyLink, KnowledgePageLinkCounts, KnowledgePageLinkEdge, KnowledgePageSearchHit, KnowledgePageStore, KnowledgePin, KnowledgePinKind, KnowledgeProvenance, KnowledgeReadScope } from './pages.js';
1
+ import type { KnowledgeNote, KnowledgePage, KnowledgePageActivityAction, KnowledgePageActivityEvent, KnowledgePageBodyLink, KnowledgePageLinkCounts, KnowledgePageLinkEdge, KnowledgePageSearchHit, KnowledgePageStore, KnowledgePageWrite, KnowledgePin, KnowledgePinKind, KnowledgeProvenance, KnowledgeReadScope } from './pages.js';
2
2
  type Store = KnowledgePageStore;
3
3
  /**
4
4
  * In-memory schema-4 page store: the reference implementation of {@link KnowledgePageStore} that the
@@ -46,7 +46,33 @@ export declare class InMemoryKnowledgePageStore implements KnowledgePageStore {
46
46
  }): Promise<KnowledgePage[]>;
47
47
  getPages(input: Parameters<Store['getPages']>[0]): Promise<KnowledgePage[]>;
48
48
  getPageByPath(input: Parameters<Store['getPageByPath']>[0]): Promise<KnowledgePage | null>;
49
+ getPageChains(input: {
50
+ ids: string[];
51
+ read: KnowledgeReadScope;
52
+ }): Promise<Record<string, KnowledgePage[]>>;
53
+ getPagesByPaths(input: {
54
+ scopeId: string;
55
+ paths: string[][];
56
+ read: KnowledgeReadScope;
57
+ }): Promise<(KnowledgePage | null)[]>;
58
+ getLastChildPositions(input: {
59
+ parentIds: string[];
60
+ }): Promise<Record<string, string | null>>;
61
+ getPageSubtrees(input: {
62
+ rootIds: string[];
63
+ limit: number;
64
+ }): Promise<Record<string, KnowledgePage[] | null>>;
65
+ listNotesByPages(input: {
66
+ pageIds: string[];
67
+ read: KnowledgeReadScope;
68
+ }): Promise<Record<string, KnowledgeNote[]>>;
49
69
  findPagesByName(input: Parameters<Store['findPagesByName']>[0]): Promise<KnowledgePage[]>;
70
+ findPagesByNames(input: {
71
+ names: string[];
72
+ read: Parameters<Store['findPagesByName']>[0]['read'];
73
+ scopeId?: string;
74
+ limit?: number;
75
+ }): Promise<Record<string, KnowledgePage[]>>;
50
76
  listChildPages(input: Parameters<Store['listChildPages']>[0]): Promise<{
51
77
  pages: KnowledgePage[];
52
78
  nextCursor?: string | undefined;
@@ -63,6 +89,10 @@ export declare class InMemoryKnowledgePageStore implements KnowledgePageStore {
63
89
  pages: KnowledgePage[];
64
90
  nextCursor?: string | undefined;
65
91
  }>;
92
+ /** The single writes, one by one in input order; all undone if one fails. */
93
+ applyPageWrites(input: {
94
+ writes: KnowledgePageWrite[];
95
+ }): Promise<void>;
66
96
  createPage(input: Parameters<Store['createPage']>[0]): Promise<KnowledgePage>;
67
97
  updatePage(input: Parameters<Store['updatePage']>[0]): Promise<KnowledgePage>;
68
98
  movePage(input: Parameters<Store['movePage']>[0]): Promise<KnowledgePage>;
@@ -460,6 +460,80 @@ export interface AddKnowledgeNoteInput {
460
460
  mentions: string[];
461
461
  provenance: KnowledgeProvenance;
462
462
  }
463
+ /**
464
+ * One write in {@link KnowledgeStorage.applyPageWrites}, with everything the matching single write
465
+ * would work out for itself (scope, depth, position, ids) already decided by the caller, so the store
466
+ * applies it without reading. `scopeId` is the page's scope as of input order (a store may group
467
+ * the statements, so the stored scope can differ when its statement runs); `expectedVersion` is the
468
+ * page's version as of input order, counting earlier writes to it in the same batch.
469
+ *
470
+ * @experimental
471
+ */
472
+ export type KnowledgePageWrite = {
473
+ op: 'create';
474
+ id: string;
475
+ scopeId: string;
476
+ parentId: string;
477
+ key?: string;
478
+ name: string;
479
+ description?: string;
480
+ body?: string;
481
+ position: string;
482
+ depth: number;
483
+ provenance: KnowledgeProvenance;
484
+ } | {
485
+ op: 'update';
486
+ id: string;
487
+ scopeId: string;
488
+ expectedVersion: number;
489
+ name?: string;
490
+ /** Empty string clears it. */
491
+ description?: string;
492
+ body?: string;
493
+ provenance: KnowledgeProvenance;
494
+ } | {
495
+ /**
496
+ * Moves the page under `parentId`, and its subtree (deleted rows included) with it, as
497
+ * {@link KnowledgePageStore.movePage}: descendants keep their depth relative to it and take its scope.
498
+ */
499
+ op: 'move';
500
+ id: string;
501
+ fromScopeId: string;
502
+ expectedVersion: number;
503
+ parentId: string;
504
+ scopeId: string;
505
+ depth: number;
506
+ position: string;
507
+ provenance: KnowledgeProvenance;
508
+ } | {
509
+ op: 'delete';
510
+ id: string;
511
+ scopeId: string;
512
+ expectedVersion: number;
513
+ deletedBy: string;
514
+ } | {
515
+ op: 'add-note';
516
+ id: string;
517
+ pageId: string;
518
+ scopeId: string;
519
+ text: string;
520
+ when?: Date;
521
+ /** Non-empty; scope page ids. */
522
+ stampScopeIds: string[];
523
+ mentions: string[];
524
+ provenance: KnowledgeProvenance;
525
+ } | {
526
+ op: 'remove-note';
527
+ id: string;
528
+ pageId: string;
529
+ scopeId: string;
530
+ deletedBy: string;
531
+ provenance: KnowledgeProvenance;
532
+ } | {
533
+ op: 'replace-links';
534
+ pageId: string;
535
+ links: KnowledgePageBodyLink[];
536
+ };
463
537
  /** @experimental */
464
538
  export interface SearchKnowledgePagesInput {
465
539
  query: string;
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_run_registry = require("../run-registry-CibQoN6K.cjs");
2
+ const require_run_registry = require("../run-registry-PiQTSx2Y.cjs");
3
3
  const require_observability = require("../observability-B0R_D1PZ.cjs");
4
- const require_stream = require("../stream-D_7tMaJe.cjs");
4
+ const require_stream = require("../stream-BbPZavop.cjs");
5
5
  const require_storage = require("../storage-CfG0I2aF.cjs");
6
6
  const require_constants = require("../constants-Bou0hEgY.cjs");
7
7
  const require_filesystem_versioned = require("../filesystem-versioned-BavRtYWJ.cjs");
@@ -1,6 +1,6 @@
1
- import { $a as SPAN_QUERY_MAX_CURSOR_BYTES, $i as HarnessStorage, Aa as jsonValueEquals, Ai as KnowledgePageDepthError, Ao as ObservabilityInMemory, Ar as createGitHubSourceControlProviderFromEnv, Ba as tracePageIdSchema, Bi as MAX_KNOWLEDGE_PAGE_LIST_LIMIT, Br as mergeWorkflowStepResult, Ca as createStoreErrorId, Ci as KnowledgeTransactionDeadlineError, Co as buildMetricRecord, Cr as knowledgeSemanticDocumentId, Da as getDefaultValue, Di as inspectKnowledgeSchema, Do as getStringOrNull, Dr as StoreOperationsInMemory, Ea as filterByDateRange, Ei as createKnowledgeUlid, Eo as getObjectOrNull, Er as parseKnowledgeNodeCursor, Fa as transformRow, Fi as MAX_KNOWLEDGE_PAGE_BODY_LINKS, Fr as WorkflowsInMemory, Ga as THREAD_QUERY_MAX_LIMIT, Gi as knowledgeLinkRefKey, Gr as ScoresInMemory, Ha as tracePageRequestSchema, Hi as assertKnowledgeNoteTextWithinBound, Hr as WorkflowDefinitionsStorage, Ia as transformScoreRow, Ii as MAX_KNOWLEDGE_PAGE_DEPTH, Ir as cloneRunData, Ja as threadQueryIdentitySchema, Ji as knowledgePositionBetween, Jr as SchedulesStorage, Ka as encodeThreadQueryCursor, Ki as knowledgePagePath, Kr as ScoresStorage, La as validateStorageMetadataFilter, Li as MAX_KNOWLEDGE_PAGE_DESCRIPTION_TOKENS, Lr as WorkflowsStorage, Ma as safelyParseJSON, Mi as KnowledgePageKeyConflictError, Mo as FactoryStorage, Mr as FilesystemDB, Na as serializeDate, Ni as MAX_KNOWLEDGE_MOVE_PAGES, No as FactoryStorageDomain, Nr as InMemoryStore, Oa as getSqlType, Oi as parseKnowledgeWikilinks, Oo as serializeSpanAttributes, Or as StoreOperations, Pa as storageMessageMatchesMetadataFilter, Pi as MAX_KNOWLEDGE_NOTE_TOKENS, Po as UniqueViolationError, Pr as MockStore, Qa as SPAN_QUERY_MAX_COST_METRICS, Qi as InMemoryHarness, Qr as dispatchDueNotifications, Ra as TracePageError, Ri as MAX_KNOWLEDGE_PAGE_LINKS, Rr as createEmptyWorkflowSnapshot, Sa as createStorageErrorId, Si as KnowledgeStorage, So as buildLogRecord, Sr as knowledgeScopeKey, Ta as ensureDate, Ti as assertKnowledgeSchemaCompatible, To as buildUpdateSpanRecord, Tr as knowledgeVisibleScopeKeys, Ua as tracePageResponseSchema, Ui as assertKnowledgePageDescriptionWithinBound, Ur as InMemoryToolProviderConnectionsStorage, Va as tracePageNodeSchema, Vi as MAX_KNOWLEDGE_PIN_LIST_DEPTH, Vr as InMemoryWorkflowDefinitionsStorage, Wa as THREAD_QUERY_DEFAULT_LIMIT, Wi as canonicalKnowledgeName, Wr as ToolProviderConnectionsStorage, Xa as threadQueryResponseSchema, Xi as parseKnowledgePageRef, Xr as InMemoryNotificationsStorage, Ya as threadQueryRequestSchema, Yi as knowledgeScopeReadable, Yr as normalizeScheduleTarget, Za as threadQueryRowSchema, Zi as KnowledgeInvalidCursorError, Zr as NotificationsStorage, _a as BackgroundTasksStorage, _i as KNOWLEDGE_STORAGE_CONTRACT_VERSION, _o as getTraceQueryDeltaWatermark, _r as assertKnowledgeScopeWithinCeiling, ao as encodeSpanQueryCursor, au as RUN_FENCE_CONFLICT_ERROR_ID, ba as retentionCutoffMs, bi as KnowledgeNotFoundError, bo as buildCreateSpanRecord, br as expandKnowledgeScope, co as resolveSpanQueryCost, cu as coverNestedRun, di as InMemoryMemory, do as spanQueryIdentitySchema, dr as MAX_KNOWLEDGE_NODE_DESCRIPTION_LENGTH, du as matchesRunFence, ea as ExperimentsInMemory, eo as SPAN_QUERY_MAX_LIMIT, fa as InMemoryChannelsStorage, fi as MemoryStorage, fo as spanQueryRequestSchema, fr as MAX_KNOWLEDGE_RECORD_TEXT_LENGTH, fu as resolveRunFence, ga as BackgroundTasksInMemory, gi as KnowledgeImportersStorage, go as encodeTraceQueryDeltaCursor, gr as assertKnowledgeRecordTextWithinBound, ha as BlobStore, hi as KnowledgeImporterRunStateError, ho as encodeTraceQueryCursor, hr as assertKnowledgeDescriptionWithinBound, hu as setRunFenceContext, ia as DatasetItemIdentityConflictError, io as createSpanQueryPreview, iu as isWorkflowStepConflictError, ja as parseDuration, ji as KnowledgePageHasChildrenError, jo as ObservabilityStorage, jr as FilesystemStore, ka as hasErrorCode, ki as KnowledgeMoveTooLargeError, ko as toEntityType, kr as GitHubSourceControlProvider, lo as spanQueryCostSchema, lu as currentRunGeneration, ma as InMemoryBlobStore, mi as KnowledgeImporterBindingConflictError, mo as spanQueryRowSchema, mr as assertKnowledgeCeilingRaised, mu as runOutsideRunFenceScope, na as DatasetsInMemory, no as SPAN_QUERY_ORDER_FIELDS, nu as WorkflowStepConflictError, oo as parseSpanQueryRequest, ou as RUN_FENCING_NOT_SUPPORTED_ERROR_ID, pa as ChannelsStorage, pi as InMemoryKnowledgeStorage, po as spanQueryResponseSchema, pr as MAX_KNOWLEDGE_SCOPE_TAGS, pu as runFencingNotSupportedError, qa as planThreadRowsQuery, qi as knowledgePinDepth, qr as InMemorySchedulesStorage, ra as DatasetsStorage, ro as buildSpanQueryResponse, ru as assertWorkflowStepGuard, so as planSpanQuery, su as RunFenceConflictError, ta as ExperimentsStorage, to as SPAN_QUERY_MAX_PREVIEW_CHARACTERS, uo as spanQueryIdentityKey, uu as isRunFenceConflictError, va as executeRetentionPrune, vi as KNOWLEDGE_STORAGE_SCHEMA_VERSION, vo as planThreadQuery, vr as canonicalizeKnowledgeScope, wa as createVectorErrorId, wi as KnowledgeUnsupportedCapabilityError, wo as buildScoreRecord, wr as knowledgeSemanticIdempotencyKey, xa as runRetentionBatches, xi as KnowledgeSchemaResetRequiredError, xo as buildFeedbackRecord, xr as isKnowledgeScopeVisible, ya as resolveRetentionTargets, yi as KnowledgeConflictError, yo as planTraceQuery, yr as createKnowledgeNodeCursor, za as readTracePage, zi as MAX_KNOWLEDGE_PAGE_LINK_REF_LENGTH, zr as mergeStepResult } from "../run-registry-BL_kKvFE.js";
1
+ import { $a as threadQueryRequestSchema, $i as parseKnowledgePageRef, $r as InMemoryNotificationsStorage, Aa as filterByDateRange, Ai as inspectKnowledgeSchema, Ao as getObjectOrNull, Ar as StoreOperationsInMemory, Ba as transformScoreRow, Bi as MAX_KNOWLEDGE_PAGE_DESCRIPTION_TOKENS, Br as WorkflowsStorage, Ca as resolveRetentionTargets, Ci as KnowledgeNotFoundError, Co as planTraceQuery, Cr as expandKnowledgeScope, Da as createStoreErrorId, Di as KnowledgeUnsupportedCapabilityError, Do as buildMetricRecord, Dr as knowledgeSemanticIdempotencyKey, Ea as createStorageErrorId, Ei as KnowledgeTransactionDeadlineError, Eo as buildLogRecord, Er as knowledgeSemanticDocumentId, Fa as parseDuration, Fi as KnowledgePageKeyConflictError, Fo as ObservabilityStorage, Fr as FilesystemDB, Ga as tracePageNodeSchema, Gi as assertKnowledgeNoteTextWithinBound, Gr as WorkflowDefinitionsStorage, Ha as TracePageError, Hi as MAX_KNOWLEDGE_PAGE_LINK_REF_LENGTH, Hr as mergeStepResult, Ia as safelyParseJSON, Ii as MAX_KNOWLEDGE_MOVE_PAGES, Io as FactoryStorage, Ir as InMemoryStore, Ja as THREAD_QUERY_DEFAULT_LIMIT, Ji as knowledgeLinkRefKey, Jr as ScoresInMemory, Ka as tracePageRequestSchema, Ki as assertKnowledgePageDescriptionWithinBound, Kr as InMemoryToolProviderConnectionsStorage, La as serializeDate, Li as MAX_KNOWLEDGE_NOTE_TOKENS, Lo as FactoryStorageDomain, Lr as MockStore, Ma as getSqlType, Mi as KnowledgeMoveTooLargeError, Mo as serializeSpanAttributes, Mr as GitHubSourceControlProvider, Na as hasErrorCode, Ni as KnowledgePageDepthError, No as toEntityType, Nr as createGitHubSourceControlProviderFromEnv, Oa as createVectorErrorId, Oi as assertKnowledgeSchemaCompatible, Oo as buildScoreRecord, Or as knowledgeVisibleScopeKeys, Pa as jsonValueEquals, Pi as KnowledgePageHasChildrenError, Po as ObservabilityInMemory, Pr as FilesystemStore, Qa as threadQueryIdentitySchema, Qi as knowledgeScopeReadable, Qr as normalizeScheduleTarget, Ra as storageMessageMatchesMetadataFilter, Ri as MAX_KNOWLEDGE_PAGE_BODY_LINKS, Ro as UniqueViolationError, Rr as WorkflowsInMemory, Sa as executeRetentionPrune, Si as KnowledgeConflictError, So as planThreadQuery, Sr as createKnowledgeNodeCursor, Ta as runRetentionBatches, Ti as KnowledgeStorage, To as buildFeedbackRecord, Tr as knowledgeScopeKey, Ua as readTracePage, Ui as MAX_KNOWLEDGE_PAGE_LIST_LIMIT, Ur as mergeWorkflowStepResult, Va as validateStorageMetadataFilter, Vi as MAX_KNOWLEDGE_PAGE_LINKS, Vr as createEmptyWorkflowSnapshot, Wa as tracePageIdSchema, Wi as MAX_KNOWLEDGE_PIN_LIST_DEPTH, Wr as InMemoryWorkflowDefinitionsStorage, Xa as encodeThreadQueryCursor, Xi as knowledgePinDepth, Xr as InMemorySchedulesStorage, Ya as THREAD_QUERY_MAX_LIMIT, Yi as knowledgePagePath, Yr as ScoresStorage, Za as planThreadRowsQuery, Zi as knowledgePositionBetween, Zr as SchedulesStorage, _a as ChannelsStorage, _i as KnowledgeImporterBindingConflictError, _o as spanQueryResponseSchema, _r as assertKnowledgeCeilingRaised, _u as runFencingNotSupportedError, aa as ExperimentsStorage, ao as SPAN_QUERY_MAX_PREVIEW_CHARACTERS, ba as BackgroundTasksInMemory, bi as KNOWLEDGE_STORAGE_CONTRACT_VERSION, bo as encodeTraceQueryDeltaCursor, br as assertKnowledgeScopeWithinCeiling, ca as DatasetItemIdentityConflictError, co as createSpanQueryPreview, cu as isWorkflowStepConflictError, do as planSpanQuery, du as RunFenceConflictError, ea as KnowledgeInvalidCursorError, ei as NotificationsStorage, eo as threadQueryResponseSchema, fo as resolveSpanQueryCost, fu as coverNestedRun, ga as InMemoryChannelsStorage, gi as InMemoryKnowledgeStorage, go as spanQueryRequestSchema, gr as MAX_KNOWLEDGE_SCOPE_TAGS, gu as resolveRunFence, hi as MemoryStorage, ho as spanQueryIdentitySchema, hr as MAX_KNOWLEDGE_RECORD_TEXT_LENGTH, hu as matchesRunFence, ia as ExperimentsInMemory, io as SPAN_QUERY_MAX_LIMIT, ja as getDefaultValue, ji as parseKnowledgeWikilinks, jo as getStringOrNull, jr as StoreOperations, ka as ensureDate, ki as createKnowledgeUlid, ko as buildUpdateSpanRecord, kr as parseKnowledgeNodeCursor, lo as encodeSpanQueryCursor, lu as RUN_FENCE_CONFLICT_ERROR_ID, mi as InMemoryMemory, mo as spanQueryIdentityKey, mr as MAX_KNOWLEDGE_NODE_DESCRIPTION_LENGTH, mu as isRunFenceConflictError, na as InMemoryHarness, no as SPAN_QUERY_MAX_COST_METRICS, oa as DatasetsInMemory, oo as SPAN_QUERY_ORDER_FIELDS, ou as WorkflowStepConflictError, po as spanQueryCostSchema, pu as currentRunGeneration, qa as tracePageResponseSchema, qi as canonicalKnowledgeName, qr as ToolProviderConnectionsStorage, ra as HarnessStorage, ro as SPAN_QUERY_MAX_CURSOR_BYTES, sa as DatasetsStorage, so as buildSpanQueryResponse, su as assertWorkflowStepGuard, ti as dispatchDueNotifications, to as threadQueryRowSchema, uo as parseSpanQueryRequest, uu as RUN_FENCING_NOT_SUPPORTED_ERROR_ID, va as InMemoryBlobStore, vi as KnowledgeImporterRunStateError, vo as spanQueryRowSchema, vr as assertKnowledgeDescriptionWithinBound, vu as runOutsideRunFenceScope, wa as retentionCutoffMs, wi as KnowledgeSchemaResetRequiredError, wo as buildCreateSpanRecord, wr as isKnowledgeScopeVisible, xa as BackgroundTasksStorage, xi as KNOWLEDGE_STORAGE_SCHEMA_VERSION, xo as getTraceQueryDeltaWatermark, xr as canonicalizeKnowledgeScope, ya as BlobStore, yi as KnowledgeImportersStorage, yo as encodeTraceQueryCursor, yr as assertKnowledgeRecordTextWithinBound, yu as setRunFenceContext, za as transformRow, zi as MAX_KNOWLEDGE_PAGE_DEPTH, zr as cloneRunData } from "../run-registry-D22IF5SK.js";
2
2
  import { a as PREVIEW_MAX_LENGTH } from "../observability-D7RNOAPx.js";
3
- import { At as STATE_CHECKPOINT_PATCHES, Bt as summarizeStepResult, Ft as materializeState, Ht as applyStatePatch, It as materializeWorkflowRun, Lt as pickStateKeys, Mt as applyStateColumnsWrite, Nt as isStateCheckpointDue, Pt as latestStepResults, Rt as stateBaseOf, Ut as diffState, Vt as unusedStateEntries, jt as STEP_RESULT_SUMMARY_FIELDS, kt as getSnapshotMemoryInfo, zt as stateColumnsWrite } from "../stream-1DGoEkG2.js";
3
+ import { At as getSnapshotMemoryInfo, Bt as stateColumnsWrite, Ft as latestStepResults, Ht as unusedStateEntries, It as materializeState, Lt as materializeWorkflowRun, Mt as STEP_RESULT_SUMMARY_FIELDS, Nt as applyStateColumnsWrite, Pt as isStateCheckpointDue, Rt as pickStateKeys, Ut as applyStatePatch, Vt as summarizeStepResult, Wt as diffState, jt as STATE_CHECKPOINT_PATCHES, zt as stateBaseOf } from "../stream-CoQTdzLm.js";
4
4
  import { $ as getFeedbackAggregateArgsSchema, $t as metricsFilterSchema, A as deleteScoresResponseSchema, An as tagsField, At as getServiceNamesResponseSchema, B as experimentIdField, Bt as listScoresArgsSchema, C as dateRangeSchema, Cn as scoresOrderBySchema, Ct as getScoreBreakdownArgsSchema, D as deleteFeedbackArgsSchema, Dn as sourceField, Dt as getScoreTimeSeriesArgsSchema, E as defaultPaginationArgs, En as sortDirectionSchema, Et as getScorePercentilesResponseSchema, F as entityIdField, Fn as userIdField, Ft as listLogsArgsSchema, G as feedbackRecordSchema, Gt as logsFilterSchema, H as feedbackInputSchema, Ht as logLevelSchema, I as entityNameField, It as listLogsResponseSchema, J as getEntityNamesResponseSchema, Jt as metadataField, K as feedbackReviewStatusSchema, Kt as logsOrderByFieldSchema, L as entityTypeField, Lt as listMetricsArgsSchema, M as deltaInfoSchema, Mn as traceIdField, Mt as getTagsResponseSchema, N as deltaLimitSchema, Nn as updateFeedbackReviewStatusArgsSchema, Nt as listFeedbackArgsSchema, O as deleteFeedbackResponseSchema, On as spanContextFields, Ot as getScoreTimeSeriesResponseSchema, P as distinctColumnSchema, Pn as updatedAtField, Pt as listFeedbackResponseSchema, Q as getEnvironmentsResponseSchema, Qt as metricsAggregationSchema, R as environmentField, Rt as listMetricsResponseSchema, S as createdAtField, Sn as scoresOrderByFieldSchema, St as getScoreAggregateResponseSchema, T as defaultDeltaLimit, Tn as sessionIdField, Tt as getScorePercentilesArgsSchema, U as feedbackOrderByFieldSchema, Ut as logRecordInputSchema, V as feedbackFilterSchema, Vt as listScoresResponseSchema, W as feedbackOrderBySchema, Wt as logRecordSchema, X as getEntityTypesResponseSchema, Xt as metricRecordSchema, Y as getEntityTypesArgsSchema, Yt as metricInputSchema, Z as getEnvironmentsArgsSchema, Zt as metricTypeSchema, _ as createMetricRecordSchema, _n as runIdField, _t as getMetricPercentilesArgsSchema, a as batchCreateFeedbackArgsSchema, an as paginationInfoSchema, at as getFeedbackTimeSeriesArgsSchema, b as createScoreRecordSchema, bn as scoreRecordSchema, bt as getMetricTimeSeriesResponseSchema, c as batchCreateScoresArgsSchema, cn as parentEntityTypeField, ct as getMetricAggregateResponseSchema, d as contextFields, dn as requestIdField, dt as getMetricLabelKeysArgsSchema, en as metricsOrderByFieldSchema, et as getFeedbackAggregateResponseSchema, f as createFeedbackArgsSchema, ft as getMetricLabelKeysResponseSchema, g as createLogRecordSchema, gn as rootEntityTypeField, gt as getMetricNamesResponseSchema, h as createFeedbackResponseSchema, hn as rootEntityNameField, ht as getMetricNamesArgsSchema, i as aggregationTypeSchema, in as paginationArgsSchema, it as getFeedbackPercentilesResponseSchema, j as deltaCursorSchema, jn as threadIdField, jt as getTagsArgsSchema, k as deleteScoresArgsSchema, kn as spanIdField, kt as getServiceNamesArgsSchema, l as commonFilterFields, ln as refineObservabilityListMode, lt as getMetricBreakdownArgsSchema, m as createFeedbackRecordSchema, mn as rootEntityIdField, mt as getMetricLabelValuesResponseSchema, n as METRIC_DISTINCT_COLUMNS, nn as normalizeObservabilityListArgs, nt as getFeedbackBreakdownResponseSchema, o as batchCreateLogsArgsSchema, on as parentEntityIdField, ot as getFeedbackTimeSeriesResponseSchema, p as createFeedbackBodySchema, pn as resourceIdField, pt as getMetricLabelValuesArgsSchema, q as getEntityNamesArgsSchema, qt as logsOrderBySchema, r as aggregationIntervalSchema, rn as organizationIdField, rt as getFeedbackPercentilesArgsSchema, s as batchCreateMetricsArgsSchema, sn as parentEntityNameField, st as getMetricAggregateArgsSchema, t as EntityType, tn as metricsOrderBySchema, tt as getFeedbackBreakdownArgsSchema, u as comparePeriodSchema, un as replaceFeedbackBodySchema, ut as getMetricBreakdownResponseSchema, v as createScoreArgsSchema, vn as scopeField, vt as getMetricPercentilesResponseSchema, w as dbTimestamps, wn as serviceNameField, wt as getScoreBreakdownResponseSchema, x as createScoreResponseSchema, xn as scoresFilterSchema, xt as getScoreAggregateArgsSchema, y as createScoreBodySchema, yn as scoreInputSchema, yt as getMetricTimeSeriesArgsSchema, z as executionSourceField, zt as listModeSchema } from "../storage-Cc50aQAp.js";
5
5
  import { $ as TABLE_CHANNEL_INSTALLATIONS, $n as listTracesLightResponseSchema, $t as TABLE_WORKSPACES, A as MCP_CLIENTS_SCHEMA, An as computeTraceStatus, At as TABLE_OBSERVATIONAL_MEMORY, B as PROMPT_BLOCK_VERSIONS_SCHEMA, Bn as getSpansArgsSchema, Bt as TABLE_SKILLS, C as KNOWLEDGE_SCOPE_GRANTS_SCHEMA, Cn as branchesFilterSchema, Ct as TABLE_MCP_CLIENTS, D as KNOWLEDGE_V2_MENTIONS_SCHEMA, Dn as buildPreview, Dt as TABLE_MEMORY_RUN_FENCES, E as KNOWLEDGE_V2_ACTIVITY_SCHEMA, En as buildInputPreview, Et as TABLE_MCP_SERVER_VERSIONS, F as NOTIFICATIONS_SCHEMA, Fn as getBranchResponseSchema, Ft as TABLE_SCHEDULE_TRIGGERS, G as SKILLS_SCHEMA, Gn as getTraceLightResponseSchema, Gt as TABLE_THREAD_STATE, H as SCORERS_SCHEMA, Hn as getStringAttribute, Ht as TABLE_SKILL_VERSIONS, I as OBSERVATIONAL_MEMORY_SCHEMA, In as getRootSpanArgsSchema, It as TABLE_SCHEMAS, J as SPAN_SCHEMA, Jn as lightSpanRecordSchema, Jt as TABLE_WORKFLOW_DEFINITIONS, K as SKILL_BLOBS_SCHEMA, Kn as getTraceResponseSchema, Kt as TABLE_TOOL_PROVIDER_CONNECTIONS, L as OBSERVATIONAL_MEMORY_TABLE_SCHEMA, Ln as getRootSpanResponseSchema, Lt as TABLE_SCORERS, M as MCP_SERVERS_SCHEMA, Mn as createSpanRecordSchema, Mt as TABLE_PROMPT_BLOCK_VERSIONS, N as MCP_SERVER_VERSIONS_SCHEMA, Nn as extractBranchSpans, Nt as TABLE_RESOURCES, O as KNOWLEDGE_V2_NODES_SCHEMA, On as buildPreviewFromJson, Ot as TABLE_MESSAGES, P as MEMORY_RUN_FENCES_SCHEMA, Pn as getBranchArgsSchema, Pt as TABLE_SCHEDULES, Q as TABLE_CHANNEL_CONFIG, Qn as listTracesArgsSchema, Qt as TABLE_WORKFLOW_SNAPSHOT, R as OLD_SPAN_SCHEMA, Rn as getSpanArgsSchema, Rt as TABLE_SCORER_DEFINITIONS, S as KNOWLEDGE_SCOPE_ADDRESSES_SCHEMA, Sn as batchUpdateSpansArgsSchema, St as TABLE_KNOWLEDGE_SEMANTIC_OUTBOX, T as KNOWLEDGE_TABLE_NAMES, Tn as branchesOrderBySchema, Tt as TABLE_MCP_SERVERS, U as SCORER_DEFINITIONS_SCHEMA, Un as getStructureResponseSchema, Ut as TABLE_SPANS, V as RUN_FENCING_TABLE_SCHEMAS, Vn as getSpansResponseSchema, Vt as TABLE_SKILL_BLOBS, W as SCORER_DEFINITION_VERSIONS_SCHEMA, Wn as getTraceArgsSchema, Wt as TABLE_THREADS, X as TABLE_AGENT_VERSIONS, Xn as listBranchesResponseSchema, Xt as TABLE_WORKFLOW_RUN_ENTRIES, Y as TABLE_AGENTS, Yn as listBranchesArgsSchema, Yt as TABLE_WORKFLOW_RUNS, Z as TABLE_BACKGROUND_TASKS, Zn as listScoresBySpanResponseSchema, Zt as TABLE_WORKFLOW_RUN_OWNERS, _ as KNOWLEDGE_NODE_ADDRESSES_SCHEMA, _n as INPUT_PREVIEW_MAX_LENGTH, _r as isAppendOnlySince, _t as TABLE_KNOWLEDGE_PROPOSALS, a as DATASET_VERSIONS_SCHEMA, an as WORKFLOW_RUN_ENTRIES_SCHEMA, ar as spanRecordSchema, at as TABLE_EXPERIMENT_RESULTS, b as KNOWLEDGE_RECORDS_SCHEMA, bn as batchDeleteTracesArgsSchema, br as maxObservationCursor, bt as TABLE_KNOWLEDGE_SCOPE_ADDRESSES, c as FAVORITES_SCHEMA, cn as WORKSPACES_SCHEMA, cr as toTraceSpans, ct as TABLE_KNOWLEDGE_ACCESS_STATE, d as KNOWLEDGE_ACTIVITY_SCHEMA, dn as STORAGE_VISIBILITY_VALUES, dr as tracesOrderByFieldSchema, dt as TABLE_KNOWLEDGE_IMPORT_RUNS, en as TABLE_WORKSPACE_VERSIONS, er as listTracesResponseSchema, et as TABLE_CONFIGS, f as KNOWLEDGE_CURSORS_SCHEMA, fn as buildStorageSchema, fr as tracesOrderBySchema, ft as TABLE_KNOWLEDGE_IMPORT_STATE, g as KNOWLEDGE_NODES_SCHEMA, gn as BRANCH_SPAN_TYPE_SET, gr as compareObservationalMemoryHeadOrder, gt as TABLE_KNOWLEDGE_NODE_SCOPES, h as KNOWLEDGE_MENTIONS_SCHEMA, hn as BRANCH_SPAN_TYPES, hr as assertActiveObservationsApplied, ht as TABLE_KNOWLEDGE_NODE_ADDRESSES, i as DATASET_ITEMS_SCHEMA, in as WORKFLOW_RUNS_SCHEMA, ir as spanIdsSchema, it as TABLE_EXPERIMENTS, j as MCP_CLIENT_VERSIONS_SCHEMA, jn as createSpanArgsSchema, jt as TABLE_PROMPT_BLOCKS, k as KNOWLEDGE_V2_RECORDS_SCHEMA, kn as buildStoredPreview, kt as TABLE_NOTIFICATIONS, l as HARNESS_SESSIONS_SCHEMA, ln as WORKSPACE_VERSIONS_SCHEMA, lr as traceSpanSchema, lt as TABLE_KNOWLEDGE_ACTIVITY, m as KNOWLEDGE_IMPORT_STATE_SCHEMA, mn as BATCH_DELETE_TRACES_MAX_IDS, mr as updateSpanRecordSchema, mt as TABLE_KNOWLEDGE_NODES, n as AGENT_VERSIONS_SCHEMA, nn as TOOL_PROVIDER_CONNECTIONS_SCHEMA, nr as scoreTracesResponseSchema, nt as TABLE_DATASET_ITEMS, o as EXPERIMENTS_SCHEMA, on as WORKFLOW_RUN_JOURNAL_TABLE_CONFIGS, or as toLightSpanRecord, ot as TABLE_FAVORITES, p as KNOWLEDGE_IMPORT_RUNS_SCHEMA, pn as matchesExpectedWorkflowStatus, pr as updateSpanArgsSchema, pt as TABLE_KNOWLEDGE_MENTIONS, q as SKILL_VERSIONS_SCHEMA, qn as isPreviewTruncated, qt as TABLE_TRACES, r as DATASETS_SCHEMA, rn as WORKFLOW_DEFINITIONS_SCHEMA, rr as spanIds, rt as TABLE_DATASET_VERSIONS, s as EXPERIMENT_RESULTS_SCHEMA, sn as WORKFLOW_RUN_OWNERS_SCHEMA, sr as toTraceSpan, st as TABLE_HARNESS_SESSIONS, t as AGENTS_SCHEMA, tn as THREAD_STATE_SCHEMA, tr as scoreTracesRequestSchema, tt as TABLE_DATASETS, u as KNOWLEDGE_ACCESS_STATE_SCHEMA, un as STORAGE_FAVORITE_ENTITY_TYPES, ur as tracesFilterSchema, ut as TABLE_KNOWLEDGE_CURSORS, v as KNOWLEDGE_NODE_SCOPES_SCHEMA, vn as TraceStatus, vr as isBufferedChunkCoveredByCursor, vt as TABLE_KNOWLEDGE_RECORDS, w as KNOWLEDGE_SEMANTIC_OUTBOX_SCHEMA, wn as branchesOrderByFieldSchema, wt as TABLE_MCP_CLIENT_VERSIONS, x as KNOWLEDGE_RECORD_SCOPES_SCHEMA, xn as batchDeleteTracesResponseSchema, xr as planReflectionGenerationText, xt as TABLE_KNOWLEDGE_SCOPE_GRANTS, y as KNOWLEDGE_PROPOSALS_SCHEMA, yn as batchCreateSpansArgsSchema, yr as isBufferedReflectionUnchangedSince, yt as TABLE_KNOWLEDGE_RECORD_SCOPES, z as PROMPT_BLOCKS_SCHEMA, zn as getSpanResponseSchema, zt as TABLE_SCORER_DEFINITION_VERSIONS } from "../constants-CFWgIaqA.js";
6
6
  import { _ as ThreadStateStorage, a as GitHistory, c as DOMAIN_KEYS, d as MastraStorage, f as calculatePagination, g as InMemoryThreadStateStorage, h as resolveListOrderBy, i as getSourceControlEntityFilePath, l as EDITOR_DOMAINS, m as normalizePerPage, n as SOURCE_CONTROL_AGENTS_DIR, o as VersionedStorageDomain, p as compareByField, r as getSourceAgentFilePath, s as StorageDomain, t as FilesystemVersionedHelpers, u as MastraCompositeStore } from "../filesystem-versioned-BL1ojJLo.js";
@@ -249,6 +249,12 @@ export type StorageCloneThreadInput = {
249
249
  options?: {
250
250
  /** Maximum number of messages to copy (from most recent) */
251
251
  messageLimit?: number;
252
+ /**
253
+ * With observational memory, `Memory` copies only the messages after the observations (the ones
254
+ * still in the context window) instead of every message. Can't be combined with `messageLimit`
255
+ * or `messageFilter`.
256
+ */
257
+ contextWindowOnly?: boolean;
252
258
  /** Filter messages by date range or specific IDs */
253
259
  messageFilter?: {
254
260
  /** Only include messages created on or after this date */
@@ -166,6 +166,13 @@ export declare function resolveProcessorWriterMessageId(messageList: MessageList
166
166
  * A single entry of a stored message's part array.
167
167
  */
168
168
  type StepMessagePart = MastraDBMessage['content']['parts'][number];
169
+ /**
170
+ * @internal
171
+ * True when the run looped on its own response through a feedback continuation
172
+ * (`onIterationComplete` feedback). Only then does the response message hold earlier
173
+ * iterations that output processors must not see again.
174
+ */
175
+ export declare function isFeedbackContinuation(messageList: MessageList, steps: readonly unknown[] | undefined): boolean;
169
176
  /** @internal */
170
177
  export declare function findIterationOffsetInParts(parts: StepMessagePart[], stepText: string | undefined): number | undefined;
171
178
  /** @internal */
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_stream = require("../stream-D_7tMaJe.cjs");
3
- const require_llm = require("../llm-B1semiTO.cjs");
2
+ const require_stream = require("../stream-BbPZavop.cjs");
3
+ const require_llm = require("../llm-CS6YY_IV.cjs");
4
4
  const require_file = require("../file-BEndQUN1.cjs");
5
5
  exports.ChunkFrom = require_llm.ChunkFrom;
6
6
  exports.DefaultGeneratedFile = require_file.DefaultGeneratedFile;
@@ -1,4 +1,4 @@
1
- import { En as convertFullStreamChunkToUIMessageStream, a as convertFullStreamChunkToMastra, c as WorkflowRunOutput, d as MastraModelOutput, i as withStreamCaching, n as createCachingTransformStream, o as convertMastraChunkToAISDKv5, r as createReplayStream, s as MastraAgentNetworkStream, t as smoothStream } from "../stream-1DGoEkG2.js";
2
- import { u as ChunkFrom } from "../llm-CytL7cpw.js";
1
+ import { Dn as convertFullStreamChunkToUIMessageStream, a as convertFullStreamChunkToMastra, c as WorkflowRunOutput, d as MastraModelOutput, i as withStreamCaching, n as createCachingTransformStream, o as convertMastraChunkToAISDKv5, r as createReplayStream, s as MastraAgentNetworkStream, t as smoothStream } from "../stream-CoQTdzLm.js";
2
+ import { u as ChunkFrom } from "../llm-zjtMQn7M.js";
3
3
  import { n as DefaultGeneratedFileWithType, t as DefaultGeneratedFile } from "../file-DGZrR5f7.js";
4
4
  export { ChunkFrom, DefaultGeneratedFile, DefaultGeneratedFileWithType, MastraAgentNetworkStream, MastraModelOutput, WorkflowRunOutput, convertFullStreamChunkToMastra, convertFullStreamChunkToUIMessageStream, convertMastraChunkToAISDKv5, createCachingTransformStream, createReplayStream, smoothStream, withStreamCaching };
@@ -1,6 +1,6 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-BrhgMLW6.cjs");
2
- const require_llm = require("./llm-B1semiTO.cjs");
3
- const require_message_list = require("./message-list-vR3uLAHL.cjs");
2
+ const require_llm = require("./llm-CS6YY_IV.cjs");
3
+ const require_message_list = require("./message-list-C0F2sDNC.cjs");
4
4
  const require_observability = require("./observability-B0R_D1PZ.cjs");
5
5
  const require_base = require("./base-BIzR1D3_.cjs");
6
6
  const require_error = require("./error-D90lJ6M7.cjs");
@@ -6998,6 +6998,16 @@ function partMatches(a, b) {
6998
6998
  if (a.type === "step-start") return Number(a.createdAt) === Number(b.createdAt);
6999
6999
  return true;
7000
7000
  }
7001
+ /**
7002
+ * @internal
7003
+ * True when the run looped on its own response through a feedback continuation
7004
+ * (`onIterationComplete` feedback). Only then does the response message hold earlier
7005
+ * iterations that output processors must not see again.
7006
+ */
7007
+ function isFeedbackContinuation(messageList, steps) {
7008
+ if (!steps || steps.length < 2) return false;
7009
+ return messageList.get.response.db().some((message) => message.content.metadata?.iterationFeedback === true);
7010
+ }
7001
7011
  /** @internal */
7002
7012
  function findIterationOffsetInParts(parts, stepText) {
7003
7013
  if (!stepText) return void 0;
@@ -7050,6 +7060,9 @@ function findStepPartBoundaries(message, steps) {
7050
7060
  for (const [stepIndex] of steps.entries()) for (const part of parts.slice(offsets[stepIndex], offsets[stepIndex + 1])) if (part.type === "text") part[stepPartIndex] = stepIndex;
7051
7061
  return { offsets };
7052
7062
  }
7063
+ function joinTextParts(message) {
7064
+ return (message?.content.parts ?? []).map((part) => part.type === "text" ? part.text : "").join("");
7065
+ }
7053
7066
  /** @internal */
7054
7067
  function clearStepPartIndexes(messages) {
7055
7068
  for (const message of messages) for (const part of message.content.parts) delete part[stepPartIndex];
@@ -7089,7 +7102,11 @@ function reconcileBufferedStepTexts(steps, processedText, processedMessage, step
7089
7102
  offset += steps[index].text.length;
7090
7103
  index++;
7091
7104
  }
7092
- if (index === steps.length) return;
7105
+ if (index === steps.length) {
7106
+ const appended = processedText.slice(offset);
7107
+ if (appended && steps.length) steps[steps.length - 1].text += appended;
7108
+ return;
7109
+ }
7093
7110
  steps[index].text = processedText.slice(offset);
7094
7111
  for (const step of steps.slice(index + 1)) step.text = "";
7095
7112
  }
@@ -7882,11 +7899,15 @@ var MastraModelOutput = class extends require_base.MastraBase {
7882
7899
  }, "response", { merge: false });
7883
7900
  const outputTextBeforeProcessing = resolveOutputTextSkippingCompletionChecks(self.messageList);
7884
7901
  const stepMessage = resolveOutputMessageSkippingCompletionChecks(self.messageList);
7885
- const iterationPartOffset = stepMessage ? findIterationPartOffset(self.messageList, stepMessage, lastStepText) : void 0;
7902
+ const iterationPartOffset = stepMessage && isFeedbackContinuation(self.messageList, self.#bufferedSteps) ? findIterationPartOffset(self.messageList, stepMessage, lastStepText) : void 0;
7886
7903
  const separatedIteration = stepMessage && iterationPartOffset !== void 0 ? self.messageList.splitResponseMessageAtPartOffset(stepMessage.id, iterationPartOffset) : void 0;
7887
7904
  const earlierStepMessage = separatedIteration ? self.messageList.get.response.db().find((message) => message.id === separatedIteration.earlierMessageId) : void 0;
7888
7905
  const earlierStepPartBoundaries = separatedIteration ? findStepPartBoundaries(earlierStepMessage, self.#bufferedSteps.slice(0, -1)) : void 0;
7889
7906
  const earlierTextBeforeProcessing = earlierStepMessage ? resolveMessageText(earlierStepMessage) : void 0;
7907
+ const wholeTextCandidate = !separatedIteration && stepMessage && self.#bufferedSteps.length > 1 ? joinTextParts(stepMessage) : void 0;
7908
+ const holdsEveryStep = wholeTextCandidate !== void 0 && wholeTextCandidate === self.#bufferedSteps.map((step) => step.text).join("");
7909
+ const wholeStepPartBoundaries = holdsEveryStep ? findStepPartBoundaries(stepMessage, self.#bufferedSteps) : void 0;
7910
+ const wholeTextBeforeProcessing = holdsEveryStep ? wholeTextCandidate : void 0;
7890
7911
  const processorStepMessageId = separatedIteration?.currentMessageId ?? stepMessage?.id;
7891
7912
  const processorStepMessage = processorStepMessageId ? self.messageList.get.response.db().find((message) => message.id === processorStepMessageId) : void 0;
7892
7913
  const processorStepMessageParts = processorStepMessage?.content?.parts;
@@ -7918,6 +7939,11 @@ var MastraModelOutput = class extends require_base.MastraBase {
7918
7939
  const stepMessageWasReplaced = separatedIteration && processedStepMessage && processedStepMessage.id !== processorStepMessage?.id;
7919
7940
  if (stepMessageWasReplaced && resolveMessageText(processedStepMessage) === processedEarlierText) stepText = "";
7920
7941
  outputText = separatedIteration ? stepMessageWasReplaced ? processedOutputText : `${processedEarlierText}${stepText ?? ""}` : processedOutputText;
7942
+ const processedWholeText = wholeTextBeforeProcessing !== void 0 ? processedStepMessage ? joinTextParts(processedStepMessage) : "" : void 0;
7943
+ if (processedWholeText !== void 0 && self.#status !== "canceled" && processedWholeText !== wholeTextBeforeProcessing) {
7944
+ reconcileBufferedStepTexts(self.#bufferedSteps, processedWholeText, processedStepMessage, wholeStepPartBoundaries, wholeTextBeforeProcessing);
7945
+ stepText = lastStep?.text;
7946
+ }
7921
7947
  if (processedEarlierText !== void 0) reconcileBufferedStepTexts(self.#bufferedSteps.slice(0, -1), processedEarlierText, processedEarlierMessage, earlierStepPartBoundaries, earlierTextBeforeProcessing);
7922
7948
  } finally {
7923
7949
  clearStepPartIndexes(self.messageList.get.response.db());
@@ -10691,6 +10717,12 @@ Object.defineProperty(exports, "hydrateStepResults", {
10691
10717
  return hydrateStepResults;
10692
10718
  }
10693
10719
  });
10720
+ Object.defineProperty(exports, "isFeedbackContinuation", {
10721
+ enumerable: true,
10722
+ get: function() {
10723
+ return isFeedbackContinuation;
10724
+ }
10725
+ });
10694
10726
  Object.defineProperty(exports, "isMastraTimeoutError", {
10695
10727
  enumerable: true,
10696
10728
  get: function() {