@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.
- package/dist/_types/@internal_core@0.1.4/dist/knowledge-compat/index.d.ts +49 -0
- package/dist/a2a/index.cjs +1 -1
- package/dist/a2a/index.js +1 -1
- package/dist/agent/durable/index.cjs +1 -1
- package/dist/agent/durable/index.js +1 -1
- package/dist/agent/durable/run-registry.d.ts +2 -0
- package/dist/agent/durable/types.d.ts +6 -0
- package/dist/agent/durable/utils/resolve-runtime.d.ts +5 -0
- package/dist/agent/index.cjs +3 -3
- package/dist/agent/index.js +3 -3
- package/dist/agent/message-list/index.cjs +1 -1
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/state/MessageStateManager.d.ts +5 -0
- package/dist/agent-builder/ee/index.cjs +1 -1
- package/dist/agent-builder/ee/index.js +1 -1
- package/dist/agent-controller/index.cjs +1 -1
- package/dist/agent-controller/index.js +1 -1
- package/dist/agent-controller/session.d.ts +11 -1
- package/dist/{agent-controller-BolLBwDm.cjs → agent-controller-BcN7r3yI.cjs} +40 -204
- package/dist/{agent-controller--gKWI81G.js → agent-controller-DfeTRuBc.js} +40 -204
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/{background-tasks-CgzXjBfE.js → background-tasks-BcU--rXL.js} +1 -1
- package/dist/{background-tasks-DYtlijQ1.cjs → background-tasks-DRUHnQOk.cjs} +1 -1
- package/dist/browser/index.cjs +15 -6
- package/dist/browser/index.js +15 -6
- package/dist/browser/processor.d.ts +1 -0
- package/dist/{builder-Dz-g-9CZ.cjs → builder-Bufqrcz3.cjs} +2 -2
- package/dist/{builder-emNPaIaC.js → builder-TuIc5l7X.js} +2 -2
- package/dist/capabilities/302ai.json +201 -201
- package/dist/capabilities/abliteratedllm.json +34 -34
- package/dist/capabilities/abliteration-ai.json +11 -11
- package/dist/capabilities/above.json +22 -22
- package/dist/capabilities/adaption.json +13 -13
- package/dist/capabilities/adzuki.json +33 -33
- package/dist/capabilities/agentrouter.json +7 -7
- package/dist/capabilities/agnes.json +4 -4
- package/dist/capabilities/ai-router.json +8 -8
- package/dist/capabilities/aiand.json +22 -22
- package/dist/capabilities/aigrow.json +12 -12
- package/dist/capabilities/aimlapi.json +149 -149
- package/dist/capabilities/aixy.json +26 -26
- package/dist/capabilities/aki-io.json +12 -12
- package/dist/capabilities/alibaba-cn.json +93 -93
- package/dist/capabilities/alibaba-coding-plan-cn.json +5 -5
- package/dist/capabilities/alibaba-coding-plan.json +5 -5
- package/dist/capabilities/alibaba-token-plan-cn.json +37 -37
- package/dist/capabilities/alibaba-token-plan.json +40 -40
- package/dist/capabilities/alibaba.json +66 -66
- package/dist/capabilities/ambient.json +13 -13
- package/dist/capabilities/amd.json +11 -11
- package/dist/capabilities/anthropic.json +42 -42
- package/dist/capabilities/anyapi.json +47 -47
- package/dist/capabilities/apiko.json +5 -5
- package/dist/capabilities/arcee.json +11 -11
- package/dist/capabilities/augure.json +7 -7
- package/dist/capabilities/auriko.json +21 -21
- package/dist/capabilities/bailing.json +5 -5
- package/dist/capabilities/baseten.json +33 -33
- package/dist/capabilities/bee.json +4 -4
- package/dist/capabilities/berget.json +8 -8
- package/dist/capabilities/bothub.json +17 -17
- package/dist/capabilities/boundless.json +38 -38
- package/dist/capabilities/bumo.json +34 -34
- package/dist/capabilities/byteplus.json +24 -24
- package/dist/capabilities/cerebras.json +4 -4
- package/dist/capabilities/cheapaimodel.json +10 -10
- package/dist/capabilities/cheapest-token.json +28 -28
- package/dist/capabilities/chutes.json +7 -7
- package/dist/capabilities/cline-pass.json +35 -35
- package/dist/capabilities/cloudcode.json +7 -7
- package/dist/capabilities/cloudferro-sherlock.json +4 -4
- package/dist/capabilities/cloudflare-workers-ai.json +19 -19
- package/dist/capabilities/commandcode.json +149 -149
- package/dist/capabilities/concentrate.json +276 -268
- package/dist/capabilities/cortecs.json +104 -104
- package/dist/capabilities/crossmodel.json +179 -179
- package/dist/capabilities/crusoe.json +19 -19
- package/dist/capabilities/daoxe.json +6 -6
- package/dist/capabilities/databricks.json +124 -124
- package/dist/capabilities/deepinfra.json +89 -83
- package/dist/capabilities/deepseek.json +4 -4
- package/dist/capabilities/digitalocean.json +113 -113
- package/dist/capabilities/dothoosh.json +32 -32
- package/dist/capabilities/doubleword.json +25 -25
- package/dist/capabilities/edenai.json +286 -286
- package/dist/capabilities/empiriolabs.json +169 -169
- package/dist/capabilities/engy.json +16 -16
- package/dist/capabilities/entrim.json +8 -8
- package/dist/capabilities/evroc.json +12 -12
- package/dist/capabilities/ezkielyna.json +4 -4
- package/dist/capabilities/fastrouter.json +83 -83
- package/dist/capabilities/fireworks-ai.json +99 -99
- package/dist/capabilities/fortytwo.json +4 -4
- package/dist/capabilities/freemodel.json +22 -22
- package/dist/capabilities/friendli.json +8 -8
- package/dist/capabilities/frogbot.json +87 -87
- package/dist/capabilities/gisoo.json +17 -17
- package/dist/capabilities/gmicloud.json +21 -21
- package/dist/capabilities/google.json +58 -58
- package/dist/capabilities/graphn.json +8 -8
- package/dist/capabilities/greenpt.json +34 -34
- package/dist/capabilities/groq.json +9 -9
- package/dist/capabilities/helicone.json +87 -87
- package/dist/capabilities/hetzner.json +5 -5
- package/dist/capabilities/hostinger-router.json +10 -10
- package/dist/capabilities/hpc-ai.json +12 -12
- package/dist/capabilities/huawei-maas.json +15 -15
- package/dist/capabilities/hubris.json +32 -32
- package/dist/capabilities/huggingface.json +93 -85
- package/dist/capabilities/humain.json +2 -2
- package/dist/capabilities/hyper.json +23 -23
- package/dist/capabilities/impossibl.json +173 -173
- package/dist/capabilities/inceptron.json +8 -8
- package/dist/capabilities/inco.json +4 -4
- package/dist/capabilities/infer.json +14 -14
- package/dist/capabilities/inferall.json +9 -9
- package/dist/capabilities/inference-coop.json +9 -9
- package/dist/capabilities/inferenceapis.json +13 -13
- package/dist/capabilities/inferris.json +4 -4
- package/dist/capabilities/infersia.json +8 -8
- package/dist/capabilities/inferx.json +3 -3
- package/dist/capabilities/infomaniak.json +2 -2
- package/dist/capabilities/io-net.json +5 -5
- package/dist/capabilities/isoquant.json +4 -4
- package/dist/capabilities/iteracompute.json +53 -53
- package/dist/capabilities/jad-ai.json +2 -2
- package/dist/capabilities/jalapeno.json +12 -12
- package/dist/capabilities/jiekou.json +67 -67
- package/dist/capabilities/joingonka.json +4 -4
- package/dist/capabilities/jzstoken.json +53 -53
- package/dist/capabilities/keln.json +21 -21
- package/dist/capabilities/kenari.json +132 -124
- package/dist/capabilities/kilo.json +604 -604
- package/dist/capabilities/kimi-code-plan-cn.json +7 -7
- package/dist/capabilities/kimi-code-plan-global.json +7 -7
- package/dist/capabilities/kitani.json +6 -6
- package/dist/capabilities/klavo.json +21 -21
- package/dist/capabilities/korouter.json +30 -30
- package/dist/capabilities/kunavo.json +7 -7
- package/dist/capabilities/liquid.json +9 -9
- package/dist/capabilities/lithosai.json +2 -2
- package/dist/capabilities/llmgateway-providers.json +944 -944
- package/dist/capabilities/llmgateway.json +340 -340
- package/dist/capabilities/llmtr.json +30 -30
- package/dist/capabilities/logits.json +2 -2
- package/dist/capabilities/longcat.json +2 -2
- package/dist/capabilities/lowrouter.json +60 -60
- package/dist/capabilities/lyceum.json +12 -12
- package/dist/capabilities/melious.json +8 -8
- package/dist/capabilities/merge-gateway.json +280 -280
- package/dist/capabilities/meta.json +7 -7
- package/dist/capabilities/mistral.json +18 -18
- package/dist/capabilities/mixlayer.json +5 -5
- package/dist/capabilities/modal.json +12 -12
- package/dist/capabilities/model-oracle-ai.json +25 -25
- package/dist/capabilities/modelis.json +21 -21
- package/dist/capabilities/modular.json +13 -13
- package/dist/capabilities/moneo.json +18 -18
- package/dist/capabilities/moonshotai-cn.json +7 -7
- package/dist/capabilities/moonshotai.json +7 -7
- package/dist/capabilities/morph.json +16 -16
- package/dist/capabilities/munito-eu.json +6 -6
- package/dist/capabilities/munito.json +10 -10
- package/dist/capabilities/nan.json +28 -28
- package/dist/capabilities/nano-gpt.json +566 -565
- package/dist/capabilities/nearai.json +96 -96
- package/dist/capabilities/nebius.json +32 -32
- package/dist/capabilities/neon.json +124 -124
- package/dist/capabilities/neuralwatt.json +36 -36
- package/dist/capabilities/nokeep.json +5 -5
- package/dist/capabilities/novita-ai.json +153 -153
- package/dist/capabilities/nvidia.json +35 -35
- package/dist/capabilities/oathbreaker.json +3 -3
- package/dist/capabilities/obscurify.json +27 -27
- package/dist/capabilities/oci.json +10 -10
- package/dist/capabilities/ofox.json +381 -381
- package/dist/capabilities/ollama-cloud.json +48 -48
- package/dist/capabilities/openai.json +59 -59
- package/dist/capabilities/opencode-go.json +91 -91
- package/dist/capabilities/openreason.json +5 -5
- package/dist/capabilities/openrouter.json +526 -527
- package/dist/capabilities/opper.json +29 -29
- package/dist/capabilities/orcarouter.json +228 -228
- package/dist/capabilities/outerlabs.json +30 -30
- package/dist/capabilities/ovhcloud.json +19 -19
- package/dist/capabilities/pareto.json +5 -5
- package/dist/capabilities/pendra.json +4 -4
- package/dist/capabilities/perplexity-agent.json +47 -47
- package/dist/capabilities/phala.json +30 -30
- package/dist/capabilities/pioneer.json +27 -27
- package/dist/capabilities/poe.json +133 -133
- package/dist/capabilities/poolside.json +2 -2
- package/dist/capabilities/powerspring.json +9 -9
- package/dist/capabilities/primalabs.json +9 -9
- package/dist/capabilities/prime.json +106 -106
- package/dist/capabilities/privatemode-ai.json +12 -12
- package/dist/capabilities/proxystacks.json +7 -7
- package/dist/capabilities/qiniu-ai.json +14 -14
- package/dist/capabilities/refuseless.json +8 -8
- package/dist/capabilities/regolo-ai.json +2 -2
- package/dist/capabilities/requesty.json +258 -199
- package/dist/capabilities/ruapi.json +21 -21
- package/dist/capabilities/runcrate.json +14 -14
- package/dist/capabilities/runinfra.json +18 -18
- package/dist/capabilities/sakana.json +6 -6
- package/dist/capabilities/sambanova.json +6 -6
- package/dist/capabilities/sandbase.json +22 -22
- package/dist/capabilities/sarvam.json +14 -14
- package/dist/capabilities/scaleway.json +16 -16
- package/dist/capabilities/scnet-token-plan.json +10 -10
- package/dist/capabilities/scx-ai.json +29 -29
- package/dist/capabilities/sensenova.json +12 -12
- package/dist/capabilities/siliconflow-cn.json +56 -56
- package/dist/capabilities/siliconflow.json +60 -60
- package/dist/capabilities/snowflake-cortex.json +20 -20
- package/dist/capabilities/sokkan.json +10 -10
- package/dist/capabilities/sparrowcodes.json +16 -16
- package/dist/capabilities/standardcompute.json +88 -88
- package/dist/capabilities/steadyrouter.json +35 -35
- package/dist/capabilities/stepfun-ai-step-plan.json +4 -4
- package/dist/capabilities/stepfun-ai.json +4 -4
- package/dist/capabilities/stepfun-step-plan.json +4 -4
- package/dist/capabilities/stepfun.json +4 -4
- package/dist/capabilities/stepping-stone.json +21 -21
- package/dist/capabilities/subconscious.json +2 -2
- package/dist/capabilities/superbot-gg.json +4 -4
- package/dist/capabilities/synthetic.json +10 -10
- package/dist/capabilities/synthorai.json +19 -19
- package/dist/capabilities/teamorouter.json +25 -25
- package/dist/capabilities/teapot-router.json +7 -7
- package/dist/capabilities/tencent-token-plan-intl.json +24 -24
- package/dist/capabilities/tencent-token-plan.json +40 -40
- package/dist/capabilities/tencent-tokenhub.json +47 -47
- package/dist/capabilities/tensorx.json +48 -48
- package/dist/capabilities/tenstorrent.json +8 -8
- package/dist/capabilities/the-grid-ai.json +28 -28
- package/dist/capabilities/thinkingmachines.json +39 -39
- package/dist/capabilities/tinfoil.json +14 -14
- package/dist/capabilities/toapis.json +2 -2
- package/dist/capabilities/togetherai.json +50 -50
- package/dist/capabilities/tokengo.json +19 -19
- package/dist/capabilities/tokenify.json +9 -9
- package/dist/capabilities/trustedrouter.json +7 -7
- package/dist/capabilities/trustedtokens.json +20 -20
- package/dist/capabilities/umans-ai-coding-plan.json +18 -18
- package/dist/capabilities/umans-ai.json +12 -12
- package/dist/capabilities/uncensuredai.json +4 -4
- package/dist/capabilities/unrestricted.json +8 -8
- package/dist/capabilities/uplinkswitch.json +22 -22
- package/dist/capabilities/upstage.json +6 -6
- package/dist/capabilities/vancine.json +15 -15
- package/dist/capabilities/vercel.json +546 -546
- package/dist/capabilities/vivgrid.json +84 -84
- package/dist/capabilities/volcengine-coding-plan.json +28 -28
- package/dist/capabilities/volcengine.json +29 -29
- package/dist/capabilities/vultr.json +31 -31
- package/dist/capabilities/wafer.ai.json +15 -15
- package/dist/capabilities/wallaby.json +2 -2
- package/dist/capabilities/wally.json +9 -9
- package/dist/capabilities/wandb.json +16 -16
- package/dist/capabilities/watt.json +22 -22
- package/dist/capabilities/xai.json +7 -7
- package/dist/capabilities/xiaomi.json +3 -3
- package/dist/capabilities/xpersona.json +11 -11
- package/dist/capabilities/xxapi.json +28 -28
- package/dist/capabilities/zai-coding-plan.json +12 -12
- package/dist/capabilities/zai.json +31 -31
- package/dist/capabilities/zenifra.json +26 -26
- package/dist/capabilities/zenmux.json +159 -159
- package/dist/capabilities/zerogpu.json +11 -11
- package/dist/capabilities/zhipuai-coding-plan.json +8 -8
- package/dist/capabilities/zhipuai.json +29 -29
- package/dist/capabilities/zro.json +7 -7
- package/dist/channels/index.cjs +2 -2
- package/dist/channels/index.js +2 -2
- package/dist/{channels-CndspFXP.js → channels-Cdsqdajh.js} +1 -1
- package/dist/{channels-BVnDIsZS.cjs → channels-MsOnUvU6.cjs} +1 -1
- package/dist/coding-agent/index.cjs +2 -2
- package/dist/coding-agent/index.js +2 -2
- package/dist/datasets/index.cjs +2 -2
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +609 -609
- package/dist/docs/references/reference-agent-controller-session.md +29 -1
- package/dist/docs/references/reference-memory-observational-memory.md +4 -0
- package/dist/docs/references/reference.md +1 -0
- package/dist/evals/index.cjs +1 -1
- package/dist/evals/index.js +1 -1
- package/dist/evals/scoreTraces/index.cjs +1 -1
- package/dist/evals/scoreTraces/index.js +1 -1
- package/dist/harness/index.cjs +1 -1
- package/dist/harness/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/knowledge/importers/overlay.d.ts +138 -0
- package/dist/knowledge/importers/sink.d.ts +6 -0
- package/dist/knowledge/importers/types.d.ts +5 -0
- package/dist/knowledge/index.cjs +1412 -139
- package/dist/knowledge/index.js +1412 -139
- package/dist/knowledge/links.d.ts +27 -0
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/provider-types.generated.d.ts +7781 -7766
- package/dist/llm/reasoning/anthropic-thinking.d.ts +5 -0
- package/dist/llm/reasoning/gemini-thinking.d.ts +24 -0
- package/dist/llm/reasoning/index.cjs +389 -0
- package/dist/llm/reasoning/index.d.ts +8 -0
- package/dist/llm/reasoning/index.js +362 -0
- package/dist/llm/reasoning/model-fallback.d.ts +75 -0
- package/dist/llm/reasoning/model-ids.d.ts +5 -0
- package/dist/llm/reasoning/thinking-provider-options.d.ts +10 -0
- package/dist/llm/reasoning/thinking-request.d.ts +14 -0
- package/dist/llm/reasoning/thinking.d.ts +37 -0
- package/dist/{llm-B1semiTO.cjs → llm-CS6YY_IV.cjs} +2 -2
- package/dist/{llm-CytL7cpw.js → llm-zjtMQn7M.js} +2 -2
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/{manager-BwyfS4ha.cjs → manager-BU_lY6kl.cjs} +2 -2
- package/dist/{manager-DnTzA9GL.js → manager-Do0MENhH.js} +2 -2
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.d.ts +2 -0
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-DTkZPpch.js → mastra-C-1zIyS5.js} +22 -16
- package/dist/{mastra-Dj35Lj_J.cjs → mastra-DYVjsXTO.cjs} +22 -16
- package/dist/memory/index.cjs +3 -3
- package/dist/memory/index.js +3 -3
- package/dist/memory/om-events/index.cjs +189 -0
- package/dist/memory/om-events/index.d.ts +17 -0
- package/dist/memory/om-events/index.js +188 -0
- package/dist/{message-list-vR3uLAHL.cjs → message-list-C0F2sDNC.cjs} +3 -2
- package/dist/{message-list-BGm1DCiG.js → message-list-RgFlLrxG.js} +3 -2
- package/dist/{model-eDfetuno.cjs → model-DGFc1hw3.cjs} +1 -1
- package/dist/{model-DyQ07rPH.js → model-DIzIjDej.js} +1 -1
- package/dist/{netlify-BUvdxfHe.js → netlify-B9mLgxJs.js} +1 -1
- package/dist/{netlify-BC4v7Ufv.cjs → netlify-CyL6FNsw.cjs} +1 -1
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/processor-provider/index.cjs +1 -1
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +2 -2
- package/dist/processors/index.js +2 -2
- package/dist/{provider-registry-CP_5SNiw.js → provider-registry-DdQoO_jd.js} +22523 -22492
- package/dist/{provider-registry-Bn01gq9y.cjs → provider-registry-g9m_fyV8.cjs} +22523 -22492
- package/dist/provider-registry.json +22977 -22946
- package/dist/{registry-generator-CNFKGRFQ.cjs → registry-generator-At8J4ZOR.cjs} +1 -1
- package/dist/{registry-generator-CDPyxbzt.js → registry-generator-CX6Ev697.js} +1 -1
- package/dist/{rehydrate-DExpzlNS.cjs → rehydrate-BzD6UX8f.cjs} +2 -2
- package/dist/{rehydrate-CnGNY2zq.js → rehydrate-DEDxsr6E.js} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/{run-registry-BL_kKvFE.js → run-registry-D22IF5SK.js} +434 -26
- package/dist/{run-registry-CibQoN6K.cjs → run-registry-PiQTSx2Y.cjs} +457 -25
- package/dist/storage/domains/knowledge/base.d.ts +86 -1
- package/dist/storage/domains/knowledge/importers-inmemory.d.ts +9 -0
- package/dist/storage/domains/knowledge/importers.d.ts +31 -0
- package/dist/storage/domains/knowledge/inmemory.d.ts +7 -0
- package/dist/storage/domains/knowledge/pages-inmemory.d.ts +31 -1
- package/dist/storage/domains/knowledge/pages.d.ts +74 -0
- package/dist/storage/index.cjs +2 -2
- package/dist/storage/index.js +2 -2
- package/dist/storage/types.d.ts +6 -0
- package/dist/stream/base/output.d.ts +7 -0
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/{stream-D_7tMaJe.cjs → stream-BbPZavop.cjs} +36 -4
- package/dist/{stream-1DGoEkG2.js → stream-CoQTdzLm.js} +31 -5
- package/dist/test-utils/llm-mock.cjs +1 -1
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tool-loop-agent/index.cjs +1 -1
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/{tool-loop-agent-CLB1r3X3.cjs → tool-loop-agent-8lyD6O4o.cjs} +4 -4
- package/dist/{tool-loop-agent-BXya_RYj.js → tool-loop-agent-DhQkNDaR.js} +4 -4
- package/dist/{utils-C55ZdVaj.js → utils-B-3lET9S.js} +1 -1
- package/dist/{utils-B-KOMA_Q.cjs → utils-DtmyBuBT.cjs} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-BDfYr72F.js → validate-CO4rWYyH.js} +1 -1
- package/dist/{validate-CmZhnsmX.cjs → validate-vucjWXcz.cjs} +1 -1
- package/dist/vector/index.cjs +2 -2
- package/dist/vector/index.js +2 -2
- package/dist/worker/index.cjs +1 -1
- package/dist/worker/index.js +1 -1
- package/dist/{worker-CuK2RaC0.js → worker-B6CpapAF.js} +2 -2
- package/dist/{worker-BoybIUTI.cjs → worker-BgifMkOw.cjs} +2 -2
- package/dist/{worker-BG1rw_dg.js → worker-CCpSrXBY.js} +2 -2
- package/dist/{worker-D2B-x7Le.cjs → worker-eUT7GgQ9.cjs} +2 -2
- package/dist/{workflow-Bt09PcH1.js → workflow-B4Tn58DD.js} +3 -3
- package/dist/{workflow-CTKqeRXU.cjs → workflow-BJSrGEEL.cjs} +3 -3
- package/dist/workflows/builder/index.cjs +1 -1
- package/dist/workflows/builder/index.js +1 -1
- package/dist/workflows/evented/index.cjs +1 -1
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +4 -4
- package/dist/workflows/index.js +4 -4
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/sandbox/local-sandbox.d.ts +11 -0
- package/dist/workspace/sandbox/sandbox.d.ts +2 -0
- package/dist/{workspace-C8Zo5_qK.cjs → workspace-C5lXteRU.cjs} +174 -12
- package/dist/{workspace-DOAil8mG.js → workspace-CnmmMou8.js} +174 -12
- package/llm/reasoning.d.ts +1 -0
- package/memory/om-events.d.ts +1 -0
- package/package.json +27 -7
- 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;
|
package/dist/storage/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_run_registry = require("../run-registry-
|
|
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-
|
|
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");
|
package/dist/storage/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $a as
|
|
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
|
|
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";
|
package/dist/storage/types.d.ts
CHANGED
|
@@ -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 */
|
package/dist/stream/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_stream = require("../stream-
|
|
3
|
-
const require_llm = require("../llm-
|
|
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;
|
package/dist/stream/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as ChunkFrom } from "../llm-
|
|
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-
|
|
3
|
-
const require_message_list = require("./message-list-
|
|
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)
|
|
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() {
|