@mastra/core 1.86.0-alpha.8 → 1.86.0-alpha.9
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 +363 -0
- package/dist/a2a/index.cjs +1 -1
- package/dist/a2a/index.js +1 -1
- package/dist/agent/agent.d.ts +12 -0
- package/dist/agent/durable/index.cjs +1 -13
- package/dist/agent/durable/index.js +1 -13
- package/dist/agent/durable/preparation.d.ts +2 -0
- package/dist/agent/durable/utils/resolve-runtime.d.ts +9 -0
- package/dist/agent/durable/workflows/durable-loop-builder.d.ts +4 -0
- package/dist/agent/durable/workflows/finalize-run.d.ts +3 -1
- package/dist/agent/durable/workflows/steps/llm-execution.d.ts +1 -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/message-list.d.ts +11 -0
- package/dist/agent/message-list/utils/provider-compat.d.ts +1 -0
- package/dist/agent/request-context-snapshot.d.ts +1 -1
- package/dist/agent/streams/types.d.ts +10 -0
- package/dist/agent/thread-stream-runtime.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-DEPayioq.cjs → agent-controller-CrQ9OF80.cjs} +7 -7
- package/dist/{agent-controller-B7POPub5.js → agent-controller-SSlKzE6A.js} +7 -7
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/{background-tasks-7iftnRK_.cjs → background-tasks-BDrYBis-.cjs} +5 -3
- package/dist/{background-tasks-Cv1ecD6S.js → background-tasks-BnJfNLFo.js} +5 -3
- package/dist/browser/index.cjs +2 -2
- package/dist/browser/index.js +2 -2
- package/dist/{builder-Gg-xnX_E.js → builder-Cl-0BWkh.js} +2 -2
- package/dist/{builder-DuJBbQDH.cjs → builder-Cw8u3pPl.cjs} +2 -2
- package/dist/capabilities/302ai.json +204 -204
- package/dist/capabilities/abliteratedllm.json +30 -30
- package/dist/capabilities/above.json +21 -21
- package/dist/capabilities/adaption.json +15 -15
- package/dist/capabilities/adzuki.json +24 -24
- package/dist/capabilities/agentrouter.json +9 -9
- package/dist/capabilities/agnes.json +3 -3
- package/dist/capabilities/ai-router.json +8 -8
- package/dist/capabilities/aiand.json +31 -23
- package/dist/capabilities/aigrow.json +14 -14
- package/dist/capabilities/aimlapi.json +144 -147
- package/dist/capabilities/aipg.json +2 -2
- package/dist/capabilities/aixy.json +21 -21
- package/dist/capabilities/aki-io.json +10 -10
- package/dist/capabilities/alibaba-cn.json +136 -117
- package/dist/capabilities/alibaba-coding-plan-cn.json +7 -19
- package/dist/capabilities/alibaba-coding-plan.json +7 -19
- package/dist/capabilities/alibaba-token-plan-cn.json +49 -67
- package/dist/capabilities/alibaba-token-plan.json +50 -68
- package/dist/capabilities/alibaba.json +72 -119
- package/dist/capabilities/ambient.json +8 -8
- package/dist/capabilities/amd.json +10 -10
- package/dist/capabilities/anthropic.json +47 -47
- package/dist/capabilities/anyapi.json +19 -19
- package/dist/capabilities/apiko.json +5 -5
- package/dist/capabilities/arcee.json +11 -11
- package/dist/capabilities/augure.json +2 -2
- package/dist/capabilities/auriko.json +23 -23
- package/dist/capabilities/bailing.json +4 -4
- package/dist/capabilities/baseten.json +55 -25
- package/dist/capabilities/bee.json +4 -4
- package/dist/capabilities/berget.json +5 -5
- package/dist/capabilities/bothub.json +17 -17
- package/dist/capabilities/boundless.json +37 -37
- package/dist/capabilities/bumo.json +41 -41
- package/dist/capabilities/byteplus.json +26 -26
- package/dist/capabilities/cerebras.json +4 -4
- package/dist/capabilities/cheapaimodel.json +3 -3
- package/dist/capabilities/cheapest-token.json +30 -30
- package/dist/capabilities/chutes.json +10 -10
- package/dist/capabilities/cline-pass.json +39 -39
- package/dist/capabilities/cloudcode.json +9 -9
- package/dist/capabilities/cloudferro-sherlock.json +4 -4
- package/dist/capabilities/cloudflare-workers-ai.json +33 -33
- package/dist/capabilities/commandcode.json +139 -139
- package/dist/capabilities/concentrate.json +274 -274
- package/dist/capabilities/cortecs.json +108 -108
- package/dist/capabilities/crossmodel.json +189 -189
- package/dist/capabilities/crusoe.json +10 -10
- package/dist/capabilities/daoxe.json +9 -9
- package/dist/capabilities/databricks.json +315 -59
- package/dist/capabilities/deepinfra.json +90 -155
- package/dist/capabilities/deepseek.json +2 -2
- package/dist/capabilities/digitalocean.json +114 -114
- package/dist/capabilities/dothoosh.json +34 -34
- package/dist/capabilities/doubleword.json +28 -28
- package/dist/capabilities/edenai.json +433 -433
- package/dist/capabilities/empiriolabs.json +176 -176
- package/dist/capabilities/engy.json +17 -17
- package/dist/capabilities/entrim.json +6 -6
- package/dist/capabilities/evroc.json +13 -13
- package/dist/capabilities/ezkielyna.json +12 -12
- package/dist/capabilities/fastrouter.json +88 -88
- package/dist/capabilities/fireworks-ai.json +104 -41
- package/dist/capabilities/freemodel.json +20 -20
- package/dist/capabilities/friendli.json +9 -9
- package/dist/capabilities/frogbot.json +93 -93
- package/dist/capabilities/gisoo.json +19 -19
- package/dist/capabilities/gmicloud.json +21 -21
- package/dist/capabilities/google.json +55 -55
- package/dist/capabilities/graphn.json +11 -11
- package/dist/capabilities/greenpt.json +36 -36
- package/dist/capabilities/groq.json +9 -9
- package/dist/capabilities/helicone.json +83 -83
- package/dist/capabilities/hostinger-router.json +13 -13
- package/dist/capabilities/hpc-ai.json +8 -8
- package/dist/capabilities/huawei-maas.json +17 -17
- package/dist/capabilities/hubris.json +28 -28
- package/dist/capabilities/huggingface.json +200 -53
- package/dist/capabilities/humain.json +2 -2
- package/dist/capabilities/hyper.json +26 -26
- package/dist/capabilities/impossibl.json +127 -127
- package/dist/capabilities/inception.json +2 -2
- package/dist/capabilities/inceptron.json +8 -8
- package/dist/capabilities/inco.json +4 -4
- package/dist/capabilities/infer.json +14 -14
- package/dist/capabilities/inference-coop.json +15 -15
- package/dist/capabilities/inferenceapis.json +22 -22
- package/dist/capabilities/inferris.json +3 -3
- package/dist/capabilities/infersia.json +9 -9
- package/dist/capabilities/inferx.json +3 -3
- package/dist/capabilities/infomaniak.json +4 -4
- package/dist/capabilities/io-net.json +5 -5
- package/dist/capabilities/isoquant.json +4 -4
- package/dist/capabilities/iteracompute.json +51 -51
- package/dist/capabilities/jalapeno.json +12 -12
- package/dist/capabilities/jiekou.json +65 -65
- package/dist/capabilities/joingonka.json +4 -4
- package/dist/capabilities/jzstoken.json +54 -54
- package/dist/capabilities/keln.json +21 -28
- package/dist/capabilities/kenari.json +124 -121
- package/dist/capabilities/kilo.json +635 -636
- package/dist/capabilities/kimi-code-plan-cn.json +6 -6
- package/dist/capabilities/kimi-code-plan-global.json +6 -6
- package/dist/capabilities/kitani.json +4 -4
- package/dist/capabilities/klavo.json +13 -13
- package/dist/capabilities/korouter.json +31 -31
- package/dist/capabilities/kunavo.json +9 -9
- package/dist/capabilities/liquid.json +10 -10
- package/dist/capabilities/llmgateway-providers.json +909 -909
- package/dist/capabilities/llmgateway.json +333 -333
- package/dist/capabilities/llmtr.json +19 -19
- package/dist/capabilities/logits.json +2 -2
- package/dist/capabilities/longcat.json +1 -6
- package/dist/capabilities/lowrouter.json +52 -52
- package/dist/capabilities/lyceum.json +7 -7
- package/dist/capabilities/melious.json +16 -16
- package/dist/capabilities/merge-gateway.json +275 -275
- package/dist/capabilities/meta.json +9 -9
- package/dist/capabilities/minimax-cn-coding-plan.json +6 -6
- package/dist/capabilities/minimax-coding-plan.json +6 -6
- package/dist/capabilities/mistral.json +18 -18
- package/dist/capabilities/mixlayer.json +5 -5
- package/dist/capabilities/modal.json +13 -13
- package/dist/capabilities/model-oracle-ai.json +26 -26
- package/dist/capabilities/modelis.json +24 -24
- package/dist/capabilities/modelscope.json +2 -2
- package/dist/capabilities/modular.json +9 -9
- package/dist/capabilities/moneo.json +14 -14
- package/dist/capabilities/moonshotai-cn.json +6 -6
- package/dist/capabilities/moonshotai.json +6 -6
- package/dist/capabilities/morph.json +13 -13
- package/dist/capabilities/munito-eu.json +6 -6
- package/dist/capabilities/munito.json +10 -10
- package/dist/capabilities/nan.json +24 -24
- package/dist/capabilities/nano-gpt.json +577 -577
- package/dist/capabilities/nearai.json +82 -82
- package/dist/capabilities/nebius.json +29 -29
- package/dist/capabilities/neon.json +134 -134
- package/dist/capabilities/neuralwatt.json +43 -43
- package/dist/capabilities/nokeep.json +4 -4
- package/dist/capabilities/novita-ai.json +135 -135
- package/dist/capabilities/nvidia.json +38 -38
- package/dist/capabilities/oathbreaker.json +2 -2
- package/dist/capabilities/obscurify.json +26 -26
- package/dist/capabilities/oci.json +5 -5
- package/dist/capabilities/ofox.json +338 -338
- package/dist/capabilities/ollama-cloud.json +55 -55
- package/dist/capabilities/openai.json +48 -48
- package/dist/capabilities/opencode-go.json +81 -81
- package/dist/capabilities/openreason.json +5 -5
- package/dist/capabilities/openrouter.json +548 -563
- package/dist/capabilities/opper.json +23 -23
- package/dist/capabilities/orcarouter.json +212 -212
- package/dist/capabilities/outerlabs.json +30 -30
- package/dist/capabilities/ovhcloud.json +8 -8
- package/dist/capabilities/pareto.json +5 -5
- package/dist/capabilities/pendra.json +4 -4
- package/dist/capabilities/perplexity-agent.json +59 -59
- package/dist/capabilities/perplexity.json +2 -2
- package/dist/capabilities/phala.json +27 -27
- package/dist/capabilities/pioneer.json +24 -24
- package/dist/capabilities/poe.json +136 -136
- package/dist/capabilities/powerspring.json +14 -14
- package/dist/capabilities/primalabs.json +7 -7
- package/dist/capabilities/prime.json +108 -108
- package/dist/capabilities/privatemode-ai.json +12 -12
- package/dist/capabilities/proxystacks.json +6 -6
- package/dist/capabilities/qiniu-ai.json +15 -15
- package/dist/capabilities/refuseless.json +9 -9
- package/dist/capabilities/regolo-ai.json +6 -6
- package/dist/capabilities/requesty.json +171 -171
- package/dist/capabilities/ruapi.json +20 -20
- package/dist/capabilities/runcrate.json +16 -16
- package/dist/capabilities/runinfra.json +17 -17
- package/dist/capabilities/sakana.json +6 -6
- package/dist/capabilities/sambanova.json +6 -6
- package/dist/capabilities/sandbase.json +16 -16
- package/dist/capabilities/sarvam.json +12 -12
- package/dist/capabilities/scaleway.json +17 -17
- package/dist/capabilities/scnet-token-plan.json +8 -8
- package/dist/capabilities/scx-ai.json +29 -29
- package/dist/capabilities/sensenova.json +14 -14
- package/dist/capabilities/siliconflow-cn.json +61 -61
- package/dist/capabilities/siliconflow.json +57 -57
- package/dist/capabilities/snowflake-cortex.json +24 -24
- package/dist/capabilities/sokkan.json +10 -10
- package/dist/capabilities/sparrowcodes.json +24 -24
- package/dist/capabilities/standardcompute.json +89 -89
- package/dist/capabilities/steadyrouter.json +38 -38
- package/dist/capabilities/stepfun-ai-step-plan.json +7 -7
- package/dist/capabilities/stepfun-ai.json +16 -9
- package/dist/capabilities/stepfun-step-plan.json +16 -9
- package/dist/capabilities/stepfun.json +16 -9
- package/dist/capabilities/stepping-stone.json +18 -18
- package/dist/capabilities/subconscious.json +2 -2
- package/dist/capabilities/synthetic.json +12 -12
- package/dist/capabilities/synthorai.json +26 -26
- package/dist/capabilities/teamorouter.json +21 -21
- package/dist/capabilities/teapot-router.json +9 -9
- package/dist/capabilities/tencent-coding-plan.json +1 -23
- package/dist/capabilities/tencent-token-plan.json +57 -20
- package/dist/capabilities/tencent-tokenhub.json +182 -7
- package/dist/capabilities/tensorx.json +36 -36
- package/dist/capabilities/the-grid-ai.json +29 -29
- package/dist/capabilities/thinkingmachines.json +73 -56
- package/dist/capabilities/tinfoil.json +9 -9
- package/dist/capabilities/toapis.json +3 -3
- package/dist/capabilities/togetherai.json +61 -90
- package/dist/capabilities/tokengo.json +21 -21
- package/dist/capabilities/tokenify.json +9 -9
- package/dist/capabilities/trustedrouter.json +7 -7
- package/dist/capabilities/trustedtokens.json +14 -14
- package/dist/capabilities/umans-ai-coding-plan.json +13 -13
- package/dist/capabilities/umans-ai.json +10 -10
- package/dist/capabilities/uncensuredai.json +4 -4
- package/dist/capabilities/unrestricted.json +4 -4
- package/dist/capabilities/uplinkswitch.json +19 -19
- package/dist/capabilities/upstage.json +6 -6
- package/dist/capabilities/vancine.json +19 -19
- package/dist/capabilities/vercel.json +558 -537
- package/dist/capabilities/vivgrid.json +78 -78
- package/dist/capabilities/volcengine-coding-plan.json +26 -56
- package/dist/capabilities/volcengine.json +57 -62
- package/dist/capabilities/vultr.json +28 -28
- package/dist/capabilities/wafer.ai.json +18 -18
- package/dist/capabilities/wallaby.json +5 -5
- package/dist/capabilities/wally.json +14 -14
- package/dist/capabilities/wandb.json +20 -20
- package/dist/capabilities/watt.json +22 -22
- package/dist/capabilities/xai.json +4 -4
- package/dist/capabilities/xiaomi-token-plan-ams.json +2 -12
- package/dist/capabilities/xiaomi-token-plan-cn.json +2 -12
- package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -12
- package/dist/capabilities/xiaomi.json +3 -25
- package/dist/capabilities/xpersona.json +11 -11
- package/dist/capabilities/xxapi.json +27 -27
- package/dist/capabilities/zai-coding-plan.json +14 -14
- package/dist/capabilities/zai.json +47 -24
- package/dist/capabilities/zenifra.json +24 -24
- package/dist/capabilities/zenmux.json +185 -185
- package/dist/capabilities/zerogpu.json +12 -12
- package/dist/capabilities/zhipuai-coding-plan.json +8 -8
- package/dist/capabilities/zhipuai.json +35 -20
- package/dist/capabilities/zro.json +7 -7
- package/dist/channels/index.cjs +2 -2
- package/dist/channels/index.js +2 -2
- package/dist/{channels-BRVCOutx.js → channels-Cz1y3W6u.js} +1 -1
- package/dist/{channels-MjTA9bFp.cjs → channels-DQg4v_gm.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 +3 -2
- package/dist/docs/assets/SOURCE_MAP.json +895 -870
- package/dist/docs/references/docs-harness-background-tasks.md +4 -1
- package/dist/docs/references/docs-knowledge-importers.md +195 -0
- package/dist/docs/references/docs-knowledge-load-your-content.md +1 -1
- package/dist/docs/references/docs-knowledge-overview.md +1 -1
- package/dist/docs/references/docs-sandbox-filesystem.md +1 -1
- package/dist/docs/references/docs-signals-thread-streams.md +1 -1
- package/dist/docs/references/docs-studio-auth.md +54 -7
- package/dist/docs/references/integrations-auth-clerk.md +48 -4
- package/dist/docs/references/reference-agents-agent.md +1 -1
- package/dist/docs/references/reference-agents-durable-agent.md +10 -4
- package/dist/docs/references/reference-auth-clerk.md +21 -1
- package/dist/docs/references/reference-knowledge-knowledge-class.md +11 -4
- package/dist/docs/references/reference-memory-observational-memory.md +2 -2
- package/dist/docs/references/reference-streaming-ChunkType.md +2 -2
- package/dist/docs/references/reference-workspace-local-sandbox.md +2 -0
- package/dist/error/index.cjs +1 -1
- package/dist/error/index.js +1 -1
- package/dist/{error-C9d_24w-.js → error-BLwEXqOK.js} +2 -2
- package/dist/{error-BRQf2ku0.cjs → error-BdEvO8za.cjs} +2 -2
- 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/features/index.cjs +1 -0
- package/dist/features/index.js +1 -0
- package/dist/{filesystem-B5X-5G0x.js → filesystem-B8ad6kAW.js} +1 -1
- package/dist/{filesystem-BDSpwBke.cjs → filesystem-BB5YWXH-.cjs} +1 -1
- package/dist/{filesystem-DzM9pcQ8.js → filesystem-BDHUxbHn.js} +1 -1
- package/dist/{filesystem-B0AZrbj8.cjs → filesystem-BP5yz5LG.cjs} +1 -1
- package/dist/{filesystem-BsdkC311.js → filesystem-B_afSgYk.js} +1 -1
- package/dist/{filesystem-C-cyJfi1.cjs → filesystem-BaOJOc-V.cjs} +1 -1
- package/dist/{filesystem-B3s0WRud.js → filesystem-BhYgU8qg.js} +1 -1
- package/dist/{filesystem-DzfqVTO_.js → filesystem-CLBVmR5j.js} +1 -1
- package/dist/{filesystem-CEbD_77-.cjs → filesystem-Cgxc2a_-.cjs} +1 -1
- package/dist/{filesystem-Cv79mHRk.js → filesystem-ClBOBoDc.js} +1 -1
- package/dist/{filesystem-DsCQiBl2.cjs → filesystem-DVVecqZt.cjs} +1 -1
- package/dist/{filesystem-CUAgLugE.cjs → filesystem-Fpsu7e24.cjs} +1 -1
- package/dist/{filesystem-versioned-Bijb_p9l.js → filesystem-versioned-BL1ojJLo.js} +1 -1
- package/dist/{filesystem-versioned-DZGyPbNC.cjs → filesystem-versioned-BavRtYWJ.cjs} +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/config.d.ts +10 -0
- package/dist/knowledge/host-writes.d.ts +10 -0
- package/dist/knowledge/importers/conformance.d.ts +25 -0
- package/dist/knowledge/importers/define.d.ts +204 -0
- package/dist/knowledge/importers/host.d.ts +143 -0
- package/dist/knowledge/importers/index.d.ts +12 -0
- package/dist/knowledge/importers/local-host.d.ts +106 -0
- package/dist/knowledge/importers/manifest.d.ts +25 -0
- package/dist/knowledge/importers/runner.d.ts +61 -0
- package/dist/knowledge/importers/sink.d.ts +105 -0
- package/dist/knowledge/importers/types.d.ts +144 -0
- package/dist/knowledge/index.cjs +2715 -8
- package/dist/knowledge/index.d.ts +54 -4
- package/dist/knowledge/index.js +2692 -9
- package/dist/knowledge/instructions.d.ts +1 -1
- package/dist/knowledge/links.d.ts +8 -0
- package/dist/knowledge/pinned-state-processor.d.ts +5 -0
- package/dist/knowledge/pinned.d.ts +4 -1
- package/dist/knowledge/scope-runtime.d.ts +10 -0
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/provider-types.generated.d.ts +7705 -7727
- package/dist/{llm-DmUucguC.cjs → llm-8Av3mSjD.cjs} +2 -2
- package/dist/{llm-Djd8Qzi0.js → llm-B5A5cwJr.js} +2 -2
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/{manager-CO_Xz2zR.js → manager-DfWQCJUK.js} +2 -2
- package/dist/{manager-D27PkIPo.cjs → manager-sv35JY-z.cjs} +2 -2
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/mastra/resolve-agent.d.ts +3 -1
- package/dist/{mastra-Ch00nEAJ.js → mastra-CigBrT7X.js} +17 -23
- package/dist/{mastra-qsVWpOTi.cjs → mastra-D4hvfuxX.cjs} +19 -25
- package/dist/memory/index.cjs +3 -3
- package/dist/memory/index.js +3 -3
- package/dist/{message-list-DPXPXvin.cjs → message-list-Cj0Sq_JP.cjs} +63 -8
- package/dist/{message-list-DEuRl82K.js → message-list-KRbg-TnI.js} +63 -8
- package/dist/{model-Do6DTJoj.cjs → model-BK93CMtl.cjs} +1 -1
- package/dist/{model-CW-mfGYA.js → model-CYtXw861.js} +1 -1
- package/dist/{netlify-DU32SDT6.cjs → netlify-BAnn3ouY.cjs} +1 -1
- package/dist/{netlify-DZSAbdve.js → netlify-CuI1ZrwR.js} +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/abort-signal-scope.d.ts +6 -0
- package/dist/processors/index.cjs +2 -2
- package/dist/processors/index.js +2 -2
- package/dist/{provider-registry-zGezZVsL.cjs → provider-registry-BwuI_IpT.cjs} +21696 -21828
- package/dist/{provider-registry-deA0x-Gd.js → provider-registry-CmQLzLF_.js} +21696 -21828
- package/dist/provider-registry.json +22300 -22417
- package/dist/{registry-generator-VvBfOKAD.js → registry-generator-C17V4WfG.js} +1 -1
- package/dist/{registry-generator-BkQ1AxZn.cjs → registry-generator-C_0ae7Ce.cjs} +1 -1
- package/dist/{rehydrate-DDYFpQsV.cjs → rehydrate-CDQ4dOYj.cjs} +2 -2
- package/dist/{rehydrate-BjLV643n.js → rehydrate-PnaVawGX.js} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/{run-registry-5Suldxz3.cjs → run-registry-BmckDVBk.cjs} +1156 -403
- package/dist/{run-registry-CGRPldLH.js → run-registry-BwEcwYlU.js} +1103 -404
- package/dist/{source-DDwx-87N.cjs → source-BVOi8Xhp.cjs} +1 -1
- package/dist/{source-Did_2XQc.js → source-fNa6u1kH.js} +1 -1
- package/dist/storage/domains/agents/index.cjs +1 -1
- package/dist/storage/domains/agents/index.js +1 -1
- package/dist/storage/domains/knowledge/base.d.ts +67 -0
- package/dist/storage/domains/knowledge/importers-inmemory.d.ts +146 -0
- package/dist/storage/domains/knowledge/importers.d.ts +287 -0
- package/dist/storage/domains/knowledge/index.d.ts +1 -0
- package/dist/storage/domains/knowledge/inmemory.d.ts +11 -0
- package/dist/storage/domains/knowledge/pages-inmemory.d.ts +12 -1
- package/dist/storage/domains/knowledge/pages.d.ts +1 -0
- package/dist/storage/domains/mcp-clients/index.cjs +1 -1
- package/dist/storage/domains/mcp-clients/index.js +1 -1
- package/dist/storage/domains/mcp-servers/index.cjs +1 -1
- package/dist/storage/domains/mcp-servers/index.js +1 -1
- package/dist/storage/domains/prompt-blocks/index.cjs +1 -1
- package/dist/storage/domains/prompt-blocks/index.js +1 -1
- package/dist/storage/domains/scorer-definitions/index.cjs +1 -1
- package/dist/storage/domains/scorer-definitions/index.js +1 -1
- package/dist/storage/domains/skills/index.cjs +1 -1
- package/dist/storage/domains/skills/index.js +1 -1
- package/dist/storage/domains/workspaces/index.cjs +1 -1
- package/dist/storage/domains/workspaces/index.js +1 -1
- package/dist/storage/index.cjs +15 -10
- package/dist/storage/index.js +11 -11
- package/dist/stream/base/output.d.ts +17 -0
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/stream/types.d.ts +5 -2
- package/dist/{stream-Dvy_0o14.cjs → stream-0kdqBOOn.cjs} +64 -9
- package/dist/{stream-Dpwx0whf.js → stream-D1y9GzoD.js} +29 -10
- 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-PbWrEj1k.js → tool-loop-agent-BdjWGVIb.js} +4 -4
- package/dist/{tool-loop-agent-UxOv3FoK.cjs → tool-loop-agent-kWaZAT6Q.cjs} +4 -4
- package/dist/{utils-BbMTlyBO.cjs → utils-BKUCaZ12.cjs} +1 -1
- package/dist/{utils-BnNi1BYM.js → utils-GHY3hmLx.js} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-HSBcm96b.js → validate-CB-q-R2F.js} +1 -1
- package/dist/{validate-Skps-cM3.cjs → validate-De92squ7.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-BNS5A3qP.cjs → worker-BbWPQuPR.cjs} +2 -2
- package/dist/{worker-DehaD4qD.js → worker-C3u_xzY2.js} +2 -2
- package/dist/{worker-BE-0DyKL.cjs → worker-CAKvQj9_.cjs} +2 -2
- package/dist/{worker-BKrKHZzU.js → worker-Kwm8EKcj.js} +2 -2
- package/dist/{workflow-BjUTwaK9.cjs → workflow-CSjXeNcR.cjs} +3 -3
- package/dist/{workflow-Bvw6yDjc.js → workflow-CVmI1Sw-.js} +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/filesystem/filesystem.d.ts +5 -0
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/sandbox/local-sandbox.d.ts +16 -7
- package/dist/workspace/sandbox/native-sandbox/types.d.ts +11 -1
- package/dist/{workspace-C05xDH60.js → workspace-DY2Nxiyi.js} +75 -27
- package/dist/{workspace-D1OzzlLw.cjs → workspace-X2RHJZU9.cjs} +75 -27
- package/package.json +3 -3
- package/src/llm/model/provider-types.generated.d.ts +7705 -7727
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-BrhgMLW6.cjs");
|
|
2
|
-
const require_netlify = require("./netlify-
|
|
2
|
+
const require_netlify = require("./netlify-BAnn3ouY.cjs");
|
|
3
3
|
const require_model = require("./model-jBymoqGa.cjs");
|
|
4
4
|
const require_to_prompt = require("./to-prompt-B9eZo2U5.cjs");
|
|
5
5
|
const require_content = require("./content-CC0W1d5p.cjs");
|
|
6
|
-
const require_provider_registry = require("./provider-registry-
|
|
6
|
+
const require_provider_registry = require("./provider-registry-BwuI_IpT.cjs");
|
|
7
7
|
const require_error = require("./error-D90lJ6M7.cjs");
|
|
8
8
|
const require_request_context = require("./request-context-D9RXYCy8.cjs");
|
|
9
9
|
const require_dynamic_argument = require("./dynamic-argument-CUc1BBOS.cjs");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as MASTRA_GATEWAY_STREAM_TRANSPORT, a as interpolateUrlTemplate, b as createOpenAICompatible, f as findGatewayForModel, h as shouldEnableGateway, l as MASTRA_USER_AGENT, m as hasAuthCredentials, o as parseModelRouterId, p as getGatewayId, r as ModelsDevGateway, s as createGoogleGenerativeAI, t as NetlifyGateway, v as MastraModelGateway, x as EventSourceParserStream, y as createOpenAI } from "./netlify-
|
|
1
|
+
import { _ as MASTRA_GATEWAY_STREAM_TRANSPORT, a as interpolateUrlTemplate, b as createOpenAICompatible, f as findGatewayForModel, h as shouldEnableGateway, l as MASTRA_USER_AGENT, m as hasAuthCredentials, o as parseModelRouterId, p as getGatewayId, r as ModelsDevGateway, s as createGoogleGenerativeAI, t as NetlifyGateway, v as MastraModelGateway, x as EventSourceParserStream, y as createOpenAI } from "./netlify-CuI1ZrwR.js";
|
|
2
2
|
import { n as prepareAzureStrictToolSchemas, r as createStreamFromGenerateResult, t as AISDKV5LanguageModel } from "./model-DS-b2R-R.js";
|
|
3
3
|
import { i as aiV5PromptToAIV7Prompt, r as aiV5PromptToAIV6Prompt } from "./to-prompt-BsDtVXrf.js";
|
|
4
4
|
import { t as convertToDataContent } from "./content-CFBIylxS.js";
|
|
5
|
-
import { f as MastraGateway, l as modelSupportsTemperature, n as PROVIDER_REGISTRY, p as gatewayServesObservationalMemory, t as GatewayRegistry } from "./provider-registry-
|
|
5
|
+
import { f as MastraGateway, l as modelSupportsTemperature, n as PROVIDER_REGISTRY, p as gatewayServesObservationalMemory, t as GatewayRegistry } from "./provider-registry-CmQLzLF_.js";
|
|
6
6
|
import { i as MastraError, n as ErrorDomain, t as ErrorCategory } from "./error-oh2DLsP2.js";
|
|
7
7
|
import { u as RequestContext } from "./request-context-COnZHt2-.js";
|
|
8
8
|
import { n as resolveDynamicArgument } from "./dynamic-argument-BzPK3qPN.js";
|
package/dist/loop/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_run_registry = require("../run-registry-
|
|
3
|
-
const require_stream = require("../stream-
|
|
2
|
+
const require_run_registry = require("../run-registry-BmckDVBk.cjs");
|
|
3
|
+
const require_stream = require("../stream-0kdqBOOn.cjs");
|
|
4
4
|
exports.MastraTimeoutError = require_stream.MastraTimeoutError;
|
|
5
5
|
exports.createScorer = require_run_registry.createScorer;
|
|
6
6
|
exports.createTimeoutAbortSignal = require_stream.createTimeoutAbortSignal;
|
package/dist/loop/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Bt as formatCompletionFeedback, Gt as runChecks, Ht as formatValidationFeedback, Jt as runStreamCompletionScorers, Kt as runCompletionScorers,
|
|
2
|
-
import {
|
|
1
|
+
import { Bt as formatCompletionFeedback, Gt as runChecks, Ht as formatValidationFeedback, Jt as runStreamCompletionScorers, Kt as runCompletionScorers, Ut as generateFinalResult, Vt as formatStreamCompletionFeedback, Wt as generateStructuredFinalResult, Xt as loop, Yt as runValidation, qt as runDefaultCompletionCheck, w as createScorer, zt as formatCheckFeedback } from "../run-registry-BwEcwYlU.js";
|
|
2
|
+
import { Cn as isMastraTimeoutError, vn as MastraTimeoutError, yn as createTimeoutAbortSignal } from "../stream-D1y9GzoD.js";
|
|
3
3
|
export { MastraTimeoutError, createScorer, createTimeoutAbortSignal, formatCheckFeedback, formatCompletionFeedback, formatStreamCompletionFeedback, formatValidationFeedback, generateFinalResult, generateStructuredFinalResult, isMastraTimeoutError, loop, runChecks, runCompletionScorers, runDefaultCompletionCheck, runStreamCompletionScorers, runValidation };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as __exportAll } from "./rolldown-runtime-tIEjjQTE.js";
|
|
2
|
-
import {
|
|
2
|
+
import { C as ScorerRunError, Fs as createStep, Is as createWorkflow, Ji as assertSupportedPatterns, b as validateAndSaveScore, v as flushBeforeTraceRead } from "./run-registry-BwEcwYlU.js";
|
|
3
3
|
import { S as resolveObservabilityContext } from "./observability-D7RNOAPx.js";
|
|
4
4
|
import { i as MastraError } from "./error-oh2DLsP2.js";
|
|
5
|
-
import {
|
|
5
|
+
import { dt as loadStepResults, ln as isSupportedLanguageModel } from "./stream-D1y9GzoD.js";
|
|
6
6
|
import { o as MASTRA_RESOURCE_ID_KEY, p as withoutLiveRequestKeys, u as RequestContext } from "./request-context-COnZHt2-.js";
|
|
7
7
|
import { t as EntityType } from "./storage-Cc50aQAp.js";
|
|
8
8
|
import { a as getOrCreateSpan } from "./utils-DU_pU5SK.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-BrhgMLW6.cjs");
|
|
2
|
-
const require_run_registry = require("./run-registry-
|
|
2
|
+
const require_run_registry = require("./run-registry-BmckDVBk.cjs");
|
|
3
3
|
const require_observability = require("./observability-B0R_D1PZ.cjs");
|
|
4
4
|
const require_error = require("./error-D90lJ6M7.cjs");
|
|
5
|
-
const require_stream = require("./stream-
|
|
5
|
+
const require_stream = require("./stream-0kdqBOOn.cjs");
|
|
6
6
|
const require_request_context = require("./request-context-D9RXYCy8.cjs");
|
|
7
7
|
const require_storage = require("./storage-CfG0I2aF.cjs");
|
|
8
8
|
const require_utils = require("./utils-D-eNsgDM.cjs");
|
package/dist/mastra/index.cjs
CHANGED
package/dist/mastra/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Mastra } from "../mastra-
|
|
1
|
+
export { t as Mastra } from "../mastra-CigBrT7X.js";
|
|
@@ -36,5 +36,7 @@ export type ResolveAgentByIdResult = {
|
|
|
36
36
|
* confirmed-miss vs. transient-error distinction) can't drift between call
|
|
37
37
|
* sites.
|
|
38
38
|
*/
|
|
39
|
-
export declare function resolveAgentById(mastra: Mastra, agentId: string
|
|
39
|
+
export declare function resolveAgentById(mastra: Mastra, agentId: string, editorOptions?: {
|
|
40
|
+
versionId: string;
|
|
41
|
+
}): Promise<ResolveAgentByIdResult>;
|
|
40
42
|
//# sourceMappingURL=resolve-agent.d.ts.map
|
|
@@ -1,36 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { s as BackgroundTaskManager } from "./background-tasks-
|
|
1
|
+
import { Br as dispatchDueNotifications, Cc as WORKFLOW_RUN_LEASE_TTL_MS, Cr as WorkflowsInMemory, Fs as createStep, Io as augmentWithInit, Is as createWorkflow, Lo as getStorageSource, Ls as WorkflowEventProcessor, Mc as normalizeConcurrency, Nc as runWithConcurrency, Sc as nestedRunStatusOf, Tc as repeatAfterSettled, Xl as runOutsideRunFenceScope, bc as nestedRunParentOf, bl as isDurableAgentLike, gl as waitMs, hl as assertDrainTimeout, ia as BackgroundTasksInMemory, jc as createConcurrencyLimiter, jt as __registerMastraCtor, kn as AgentChannels, l as isDurableAgentExecutionDetached, o as getActiveDurableAgentWorkflowExecutions, p as agentThreadStreamRuntime, r as abandonDurableAgentExecutions, vc as cancelNestedRun, vl as hasDurableExecution, wc as renewWorkflowLease, xc as nestedRunRecoveryAction, xr as InMemoryStore, y as createOnScorerHook, yc as createNestedRunParentStatusLookup, zs as computeScheduleDefinitionHash } from "./run-registry-BwEcwYlU.js";
|
|
2
|
+
import { s as BackgroundTaskManager } from "./background-tasks-BnJfNLFo.js";
|
|
3
3
|
import { t as InMemoryServerCache } from "./inmemory-BDD0w8gx.js";
|
|
4
|
-
import { t as DatasetsManager } from "./manager-
|
|
4
|
+
import { t as DatasetsManager } from "./manager-DfWQCJUK.js";
|
|
5
5
|
import { i as MastraError, n as ErrorDomain, t as ErrorCategory } from "./error-oh2DLsP2.js";
|
|
6
6
|
import { h as EventEmitterPubSub, u as isRunLocalTopic } from "./output-helpers-CedRCE17.js";
|
|
7
7
|
import { a as registerHook, r as deregisterHook } from "./hooks-Bth8Cjpj.js";
|
|
8
8
|
import { LicenseClient } from "./license/index.js";
|
|
9
|
-
import { p as getGatewayId } from "./netlify-
|
|
10
|
-
import { l as defaultGateways } from "./llm-
|
|
9
|
+
import { p as getGatewayId } from "./netlify-CuI1ZrwR.js";
|
|
10
|
+
import { l as defaultGateways } from "./llm-B5A5cwJr.js";
|
|
11
11
|
import { l as isAdaptableLogger, n as LogLevel, t as ConsoleLogger, u as noopLogger } from "./logger-BwbmRqfc.js";
|
|
12
12
|
import { DualLogger, createExportSuppressedLogger, isObservabilityExportSuppressed, resolveTraceFields } from "./logger/index.js";
|
|
13
13
|
import { c as fsAgentScheduleRowId, g as toEpochMs, h as computeNextFireAt, l as parseFsAgentScheduleRowId, m as computeNextFire, t as Schedules } from "./schedules-DZfSx-7P.js";
|
|
14
14
|
import { C as NoOpObservability, T as noOpMetricsContext, w as noOpLoggerContext } from "./observability-D7RNOAPx.js";
|
|
15
15
|
import { initContextStorage } from "./observability/context-storage.js";
|
|
16
16
|
import { f as resolveCurrentSpan } from "./utils-DU_pU5SK.js";
|
|
17
|
-
import { r as InMemoryDB } from "./source-
|
|
17
|
+
import { r as InMemoryDB } from "./source-fNa6u1kH.js";
|
|
18
18
|
import { r as trackFeatureUsage } from "./feature-telemetry-DdR8J_5o.js";
|
|
19
|
-
import { r as isToolLoopAgentLike, t as toolLoopAgentToMastraAgent } from "./tool-loop-agent-
|
|
19
|
+
import { r as isToolLoopAgentLike, t as toolLoopAgentToMastraAgent } from "./tool-loop-agent-BdjWGVIb.js";
|
|
20
20
|
import { r as normalizeToolPayloadTransformPolicy } from "./payload-transform-Dj3HUeD4.js";
|
|
21
|
-
import { v as readPositiveIntEnv } from "./utils-
|
|
22
|
-
import { i as OrchestrationWorker, n as BackgroundTaskWorker, r as SchedulerWorker } from "./worker-
|
|
23
|
-
import { n as normalizeWorkflowBuilderDefinition } from "./builder-
|
|
24
|
-
import { d as toJsonSchemaOrUndefined, p as collectNestedWorkflowIds, t as assertValidDynamicWorkflow } from "./validate-
|
|
25
|
-
import { t as rehydrateWorkflow } from "./rehydrate-
|
|
26
|
-
import {
|
|
21
|
+
import { v as readPositiveIntEnv } from "./utils-GHY3hmLx.js";
|
|
22
|
+
import { i as OrchestrationWorker, n as BackgroundTaskWorker, r as SchedulerWorker } from "./worker-C3u_xzY2.js";
|
|
23
|
+
import { n as normalizeWorkflowBuilderDefinition } from "./builder-Cl-0BWkh.js";
|
|
24
|
+
import { d as toJsonSchemaOrUndefined, p as collectNestedWorkflowIds, t as assertValidDynamicWorkflow } from "./validate-CB-q-R2F.js";
|
|
25
|
+
import { t as rehydrateWorkflow } from "./rehydrate-PnaVawGX.js";
|
|
26
|
+
import { jn as createRunScope } from "./stream-D1y9GzoD.js";
|
|
27
27
|
import { z } from "zod/v4";
|
|
28
|
-
// src/agent/streams/execution-capability.ts
|
|
29
|
-
/** Native engine selection or the released structural adapter contract (including Inngest). */
|
|
30
|
-
function hasDurableExecution(obj) {
|
|
31
|
-
if (isDurableAgentLike(obj)) return true;
|
|
32
|
-
return typeof obj === "object" && obj !== null && "__hasDurableExecution" in obj && typeof obj.__hasDurableExecution === "function" && obj.__hasDurableExecution() === true;
|
|
33
|
-
}
|
|
34
28
|
// src/notifications/workflow.ts
|
|
35
29
|
const NOTIFICATION_DISPATCH_WORKFLOW_ID = "__mastra_notification_dispatcher";
|
|
36
30
|
/**
|
|
@@ -2872,7 +2866,7 @@ var Mastra = class Mastra {
|
|
|
2872
2866
|
*/
|
|
2873
2867
|
async __ensureExperimentWorkflow() {
|
|
2874
2868
|
if (this.__hasInternalWorkflow("__mastra-experiment")) return;
|
|
2875
|
-
const { buildExperimentWorkflow } = await import("./manager-
|
|
2869
|
+
const { buildExperimentWorkflow } = await import("./manager-DfWQCJUK.js").then((n) => n.y);
|
|
2876
2870
|
if (this.__hasInternalWorkflow("__mastra-experiment")) return;
|
|
2877
2871
|
this.__registerInternalWorkflow(buildExperimentWorkflow(), void 0, { distributed: true });
|
|
2878
2872
|
}
|
|
@@ -5066,7 +5060,7 @@ var Mastra = class Mastra {
|
|
|
5066
5060
|
if (!this.#workerFilter || this.#workerFilter.has("agent-schedule")) {
|
|
5067
5061
|
let agentScheduleWorker = this.#findAgentScheduleWorker();
|
|
5068
5062
|
if (!agentScheduleWorker) {
|
|
5069
|
-
const { AgentScheduleWorker } = await import("./worker-
|
|
5063
|
+
const { AgentScheduleWorker } = await import("./worker-Kwm8EKcj.js");
|
|
5070
5064
|
agentScheduleWorker = new AgentScheduleWorker();
|
|
5071
5065
|
agentScheduleWorker.__registerMastra(this);
|
|
5072
5066
|
this.#workers.push(agentScheduleWorker);
|
|
@@ -5705,7 +5699,7 @@ var Mastra = class Mastra {
|
|
|
5705
5699
|
this.#workers.push(sw);
|
|
5706
5700
|
}
|
|
5707
5701
|
if (!this.#findAgentScheduleWorker()) {
|
|
5708
|
-
const { AgentScheduleWorker } = await import("./worker-
|
|
5702
|
+
const { AgentScheduleWorker } = await import("./worker-Kwm8EKcj.js");
|
|
5709
5703
|
const asw = new AgentScheduleWorker();
|
|
5710
5704
|
asw.__registerMastra(this);
|
|
5711
5705
|
this.#workers.push(asw);
|
|
@@ -6150,7 +6144,7 @@ var Mastra = class Mastra {
|
|
|
6150
6144
|
#syncGatewayRegistry() {
|
|
6151
6145
|
try {
|
|
6152
6146
|
if (process.env.MASTRA_DEV !== "true" && process.env.MASTRA_DEV !== "1") return;
|
|
6153
|
-
import("./provider-registry-
|
|
6147
|
+
import("./provider-registry-CmQLzLF_.js").then((n) => n.d).then(async ({ GatewayRegistry }) => {
|
|
6154
6148
|
const registry = GatewayRegistry.getInstance();
|
|
6155
6149
|
const customGateways = Object.values(this.#gateways || {});
|
|
6156
6150
|
registry.registerCustomGateways(customGateways);
|
|
@@ -1,36 +1,30 @@
|
|
|
1
|
-
const require_run_registry = require("./run-registry-
|
|
2
|
-
const require_background_tasks = require("./background-tasks-
|
|
1
|
+
const require_run_registry = require("./run-registry-BmckDVBk.cjs");
|
|
2
|
+
const require_background_tasks = require("./background-tasks-BDrYBis-.cjs");
|
|
3
3
|
const require_inmemory = require("./inmemory-fgR8sq-U.cjs");
|
|
4
|
-
const require_manager = require("./manager-
|
|
4
|
+
const require_manager = require("./manager-sv35JY-z.cjs");
|
|
5
5
|
const require_error = require("./error-D90lJ6M7.cjs");
|
|
6
6
|
const require_output_helpers = require("./output-helpers-1Zu4Vt9C.cjs");
|
|
7
7
|
const require_hooks = require("./hooks-D7VDBETj.cjs");
|
|
8
8
|
const require_license_index = require("./license/index.cjs");
|
|
9
|
-
const require_netlify = require("./netlify-
|
|
10
|
-
const require_llm = require("./llm-
|
|
9
|
+
const require_netlify = require("./netlify-BAnn3ouY.cjs");
|
|
10
|
+
const require_llm = require("./llm-8Av3mSjD.cjs");
|
|
11
11
|
const require_logger = require("./logger-CvzZYuJd.cjs");
|
|
12
12
|
const require_logger_index = require("./logger/index.cjs");
|
|
13
13
|
const require_schedules = require("./schedules-BZS8McF7.cjs");
|
|
14
14
|
const require_observability = require("./observability-B0R_D1PZ.cjs");
|
|
15
15
|
const require_observability_context_storage = require("./observability/context-storage.cjs");
|
|
16
16
|
const require_utils = require("./utils-D-eNsgDM.cjs");
|
|
17
|
-
const require_source = require("./source-
|
|
17
|
+
const require_source = require("./source-BVOi8Xhp.cjs");
|
|
18
18
|
const require_feature_telemetry = require("./feature-telemetry-Cw0L1tHo.cjs");
|
|
19
|
-
const require_tool_loop_agent = require("./tool-loop-agent-
|
|
19
|
+
const require_tool_loop_agent = require("./tool-loop-agent-kWaZAT6Q.cjs");
|
|
20
20
|
const require_payload_transform = require("./payload-transform-CWgnsO9w.cjs");
|
|
21
|
-
const require_utils$1 = require("./utils-
|
|
22
|
-
const require_worker = require("./worker-
|
|
23
|
-
const require_builder = require("./builder-
|
|
24
|
-
const require_validate = require("./validate-
|
|
25
|
-
const require_rehydrate = require("./rehydrate-
|
|
26
|
-
const require_stream = require("./stream-
|
|
21
|
+
const require_utils$1 = require("./utils-BKUCaZ12.cjs");
|
|
22
|
+
const require_worker = require("./worker-CAKvQj9_.cjs");
|
|
23
|
+
const require_builder = require("./builder-Cw8u3pPl.cjs");
|
|
24
|
+
const require_validate = require("./validate-De92squ7.cjs");
|
|
25
|
+
const require_rehydrate = require("./rehydrate-CDQ4dOYj.cjs");
|
|
26
|
+
const require_stream = require("./stream-0kdqBOOn.cjs");
|
|
27
27
|
let zod_v4 = require("zod/v4");
|
|
28
|
-
// src/agent/streams/execution-capability.ts
|
|
29
|
-
/** Native engine selection or the released structural adapter contract (including Inngest). */
|
|
30
|
-
function hasDurableExecution(obj) {
|
|
31
|
-
if (require_run_registry.isDurableAgentLike(obj)) return true;
|
|
32
|
-
return typeof obj === "object" && obj !== null && "__hasDurableExecution" in obj && typeof obj.__hasDurableExecution === "function" && obj.__hasDurableExecution() === true;
|
|
33
|
-
}
|
|
34
28
|
// src/notifications/workflow.ts
|
|
35
29
|
const NOTIFICATION_DISPATCH_WORKFLOW_ID = "__mastra_notification_dispatcher";
|
|
36
30
|
/**
|
|
@@ -2872,7 +2866,7 @@ var Mastra = class Mastra {
|
|
|
2872
2866
|
*/
|
|
2873
2867
|
async __ensureExperimentWorkflow() {
|
|
2874
2868
|
if (this.__hasInternalWorkflow("__mastra-experiment")) return;
|
|
2875
|
-
const { buildExperimentWorkflow } = await Promise.resolve().then(() => require("./manager-
|
|
2869
|
+
const { buildExperimentWorkflow } = await Promise.resolve().then(() => require("./manager-sv35JY-z.cjs")).then((n) => n.workflow_exports);
|
|
2876
2870
|
if (this.__hasInternalWorkflow("__mastra-experiment")) return;
|
|
2877
2871
|
this.__registerInternalWorkflow(buildExperimentWorkflow(), void 0, { distributed: true });
|
|
2878
2872
|
}
|
|
@@ -3518,7 +3512,7 @@ var Mastra = class Mastra {
|
|
|
3518
3512
|
};
|
|
3519
3513
|
}
|
|
3520
3514
|
const durableAgents = [];
|
|
3521
|
-
for (const agent of Object.values(this.#agents ?? {})) if (agent && hasDurableExecution(agent)) durableAgents.push(agent);
|
|
3515
|
+
for (const agent of Object.values(this.#agents ?? {})) if (agent && require_run_registry.hasDurableExecution(agent)) durableAgents.push(agent);
|
|
3522
3516
|
if (durableAgents.length === 0) return {
|
|
3523
3517
|
agents: 0,
|
|
3524
3518
|
recovered: 0,
|
|
@@ -5066,7 +5060,7 @@ var Mastra = class Mastra {
|
|
|
5066
5060
|
if (!this.#workerFilter || this.#workerFilter.has("agent-schedule")) {
|
|
5067
5061
|
let agentScheduleWorker = this.#findAgentScheduleWorker();
|
|
5068
5062
|
if (!agentScheduleWorker) {
|
|
5069
|
-
const { AgentScheduleWorker } = await Promise.resolve().then(() => require("./worker-
|
|
5063
|
+
const { AgentScheduleWorker } = await Promise.resolve().then(() => require("./worker-BbWPQuPR.cjs"));
|
|
5070
5064
|
agentScheduleWorker = new AgentScheduleWorker();
|
|
5071
5065
|
agentScheduleWorker.__registerMastra(this);
|
|
5072
5066
|
this.#workers.push(agentScheduleWorker);
|
|
@@ -5641,7 +5635,7 @@ var Mastra = class Mastra {
|
|
|
5641
5635
|
}
|
|
5642
5636
|
/** Build native durable agents' engines and register their workflows, so event ownership checks can find them. */
|
|
5643
5637
|
#initializeDurableAgents() {
|
|
5644
|
-
for (const agent of Object.values(this.#agents ?? {})) if (hasDurableExecution(agent) && !require_run_registry.isDurableAgentLike(agent)) agent.__initializeDurableExecution();
|
|
5638
|
+
for (const agent of Object.values(this.#agents ?? {})) if (require_run_registry.hasDurableExecution(agent) && !require_run_registry.isDurableAgentLike(agent)) agent.__initializeDurableExecution();
|
|
5645
5639
|
}
|
|
5646
5640
|
/**
|
|
5647
5641
|
* Process a single workflow event. Shared entry point used by:
|
|
@@ -5705,7 +5699,7 @@ var Mastra = class Mastra {
|
|
|
5705
5699
|
this.#workers.push(sw);
|
|
5706
5700
|
}
|
|
5707
5701
|
if (!this.#findAgentScheduleWorker()) {
|
|
5708
|
-
const { AgentScheduleWorker } = await Promise.resolve().then(() => require("./worker-
|
|
5702
|
+
const { AgentScheduleWorker } = await Promise.resolve().then(() => require("./worker-BbWPQuPR.cjs"));
|
|
5709
5703
|
const asw = new AgentScheduleWorker();
|
|
5710
5704
|
asw.__registerMastra(this);
|
|
5711
5705
|
this.#workers.push(asw);
|
|
@@ -6150,7 +6144,7 @@ var Mastra = class Mastra {
|
|
|
6150
6144
|
#syncGatewayRegistry() {
|
|
6151
6145
|
try {
|
|
6152
6146
|
if (process.env.MASTRA_DEV !== "true" && process.env.MASTRA_DEV !== "1") return;
|
|
6153
|
-
Promise.resolve().then(() => require("./provider-registry-
|
|
6147
|
+
Promise.resolve().then(() => require("./provider-registry-BwuI_IpT.cjs")).then((n) => n.provider_registry_exports).then(async ({ GatewayRegistry }) => {
|
|
6154
6148
|
const registry = GatewayRegistry.getInstance();
|
|
6155
6149
|
const customGateways = Object.values(this.#gateways || {});
|
|
6156
6150
|
registry.registerCustomGateways(customGateways);
|
package/dist/memory/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_run_registry = require("../run-registry-
|
|
3
|
-
const require_stream = require("../stream-
|
|
4
|
-
const require_message_list = require("../message-list-
|
|
2
|
+
const require_run_registry = require("../run-registry-BmckDVBk.cjs");
|
|
3
|
+
const require_stream = require("../stream-0kdqBOOn.cjs");
|
|
4
|
+
const require_message_list = require("../message-list-Cj0Sq_JP.cjs");
|
|
5
5
|
exports.AUTHORED_USER_TURN = require_message_list.AUTHORED_USER_TURN;
|
|
6
6
|
exports.DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS = require_run_registry.DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS;
|
|
7
7
|
exports.MESSAGE_EMBEDDING_CHARS_PER_TOKEN = require_run_registry.MESSAGE_EMBEDDING_CHARS_PER_TOKEN;
|
package/dist/memory/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { $ as AUTHORED_USER_TURN, C as extractWorkingMemoryTags, D as removeWorkingMemoryToolInvocationParts, E as removeWorkingMemoryTags, O as removeWorkingMemoryToolInvocations, S as extractWorkingMemoryContent, T as removeSystemReminderTags, _ as SYSTEM_REMINDER_START_TAG, at as stripClientAuthoredTurnMarks, b as WORKING_MEMORY_START_TAG, et as asUserTurn, g as SYSTEM_REMINDER_END_TAG, h as SET_WORKING_MEMORY_TOOL_NAME, it as sealUserTurnMessage, nt as messageDeclaresAuthoredTurn, rt as sealTurnMarkup, tt as escapeTurnMarkup, v as UPDATE_WORKING_MEMORY_TOOL_NAME, w as isWorkingMemoryToolName, x as WORKING_MEMORY_TOOL_NAMES, y as WORKING_MEMORY_END_TAG } from "../message-list-
|
|
1
|
+
import { Ao as upsertMessageVectors, Co as DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS, Do as extractMessageEmbeddingText, Eo as chunkMessageText, Fo as isSystemReminderMessage, Mo as MemoryProcessor, No as memoryDefaultOptions, Oo as messageVectorId, Po as filterSystemReminderMessages, Qn as MockMemory, To as buildMessageEmbeddingRows, Xn as MemoryRunState, Zn as getMemoryRunState, as as getMemoryTokenBoundary, is as advanceMemoryTokenBoundary, jo as MastraMemory, ko as resolveMaxChunkChars, ns as groupLinkedToolMessages, os as isAfterMemoryTokenBoundary, rs as loadMessageHistory, ss as normalizeMessageHistoryConfig, wo as MESSAGE_EMBEDDING_CHARS_PER_TOKEN } from "../run-registry-BwEcwYlU.js";
|
|
2
|
+
import { Jt as isObservationalMemoryEnabled, Kt as TITLE_PINNED_THREAD_METADATA_KEY, Xt as parseMemoryRequestContext, Yt as isThreadTitlePinned, Zt as setThreadOMMetadata, qt as getThreadOMMetadata } from "../stream-D1y9GzoD.js";
|
|
3
|
+
import { $ as AUTHORED_USER_TURN, C as extractWorkingMemoryTags, D as removeWorkingMemoryToolInvocationParts, E as removeWorkingMemoryTags, O as removeWorkingMemoryToolInvocations, S as extractWorkingMemoryContent, T as removeSystemReminderTags, _ as SYSTEM_REMINDER_START_TAG, at as stripClientAuthoredTurnMarks, b as WORKING_MEMORY_START_TAG, et as asUserTurn, g as SYSTEM_REMINDER_END_TAG, h as SET_WORKING_MEMORY_TOOL_NAME, it as sealUserTurnMessage, nt as messageDeclaresAuthoredTurn, rt as sealTurnMarkup, tt as escapeTurnMarkup, v as UPDATE_WORKING_MEMORY_TOOL_NAME, w as isWorkingMemoryToolName, x as WORKING_MEMORY_TOOL_NAMES, y as WORKING_MEMORY_END_TAG } from "../message-list-KRbg-TnI.js";
|
|
4
4
|
export { AUTHORED_USER_TURN, DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS, MESSAGE_EMBEDDING_CHARS_PER_TOKEN, MastraMemory, MemoryProcessor, MemoryRunState, MockMemory, SET_WORKING_MEMORY_TOOL_NAME, SYSTEM_REMINDER_END_TAG, SYSTEM_REMINDER_START_TAG, TITLE_PINNED_THREAD_METADATA_KEY, UPDATE_WORKING_MEMORY_TOOL_NAME, WORKING_MEMORY_END_TAG, WORKING_MEMORY_START_TAG, WORKING_MEMORY_TOOL_NAMES, advanceMemoryTokenBoundary, asUserTurn, buildMessageEmbeddingRows, chunkMessageText, escapeTurnMarkup, extractMessageEmbeddingText, extractWorkingMemoryContent, extractWorkingMemoryTags, filterSystemReminderMessages, getMemoryRunState, getMemoryTokenBoundary, getThreadOMMetadata, groupLinkedToolMessages, isAfterMemoryTokenBoundary, isObservationalMemoryEnabled, isSystemReminderMessage, isThreadTitlePinned, isWorkingMemoryToolName, loadMessageHistory, memoryDefaultOptions, messageDeclaresAuthoredTurn, messageVectorId, normalizeMessageHistoryConfig, parseMemoryRequestContext, removeSystemReminderTags, removeWorkingMemoryTags, removeWorkingMemoryToolInvocationParts, removeWorkingMemoryToolInvocations, resolveMaxChunkChars, sealTurnMarkup, sealUserTurnMessage, setThreadOMMetadata, stripClientAuthoredTurnMarks, upsertMessageVectors };
|
|
@@ -533,7 +533,8 @@ function dropCrossProviderExecutedParts(messages, dbMessages, targetProvider, lo
|
|
|
533
533
|
* @see https://github.com/mastra-ai/mastra/issues/11376 - Anthropic models fail with empty object tool input
|
|
534
534
|
*/
|
|
535
535
|
function ensureAnthropicCompatibleMessages(messages, dbMessages) {
|
|
536
|
-
|
|
536
|
+
const getToolCallArgs = createToolCallArgsLookup(dbMessages);
|
|
537
|
+
return messages.map((msg) => enrichToolResultsWithInput(msg, getToolCallArgs));
|
|
537
538
|
}
|
|
538
539
|
/**
|
|
539
540
|
* Tool call ids in the assistant message at `index` that already have a matching tool_result,
|
|
@@ -650,14 +651,14 @@ function pairOrphanedToolCalls(messages) {
|
|
|
650
651
|
/**
|
|
651
652
|
* Enriches a single message's tool-result parts with input field
|
|
652
653
|
*/
|
|
653
|
-
function enrichToolResultsWithInput(message,
|
|
654
|
+
function enrichToolResultsWithInput(message, getToolCallArgs) {
|
|
654
655
|
if (message.role !== "tool" || !Array.isArray(message.content)) return message;
|
|
655
656
|
return {
|
|
656
657
|
...message,
|
|
657
658
|
content: message.content.map((part) => {
|
|
658
659
|
if (part.type === "tool-result") return {
|
|
659
660
|
...part,
|
|
660
|
-
input:
|
|
661
|
+
input: getToolCallArgs(part.toolCallId)
|
|
661
662
|
};
|
|
662
663
|
return part;
|
|
663
664
|
})
|
|
@@ -705,6 +706,35 @@ function getResponseProviderItemIdFromPart(part) {
|
|
|
705
706
|
const partAny = part;
|
|
706
707
|
return getResponseProviderItemId(partAny.providerMetadata) || getResponseProviderItemId(partAny.providerOptions);
|
|
707
708
|
}
|
|
709
|
+
function createToolCallArgsLookup(messages) {
|
|
710
|
+
let byId;
|
|
711
|
+
return (toolCallId) => {
|
|
712
|
+
if (!byId) {
|
|
713
|
+
byId = /* @__PURE__ */ new Map();
|
|
714
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
715
|
+
const message = messages[i];
|
|
716
|
+
if (!message || message.role !== "assistant") continue;
|
|
717
|
+
const seen = /* @__PURE__ */ new Set();
|
|
718
|
+
for (const part of message.content.parts ?? []) {
|
|
719
|
+
if (part.type !== "tool-invocation") continue;
|
|
720
|
+
const invocation = part.toolInvocation;
|
|
721
|
+
if (seen.has(invocation.toolCallId)) continue;
|
|
722
|
+
seen.add(invocation.toolCallId);
|
|
723
|
+
const args = invocation.args;
|
|
724
|
+
if (!byId.has(invocation.toolCallId) && args && typeof args === "object" && Object.keys(args).length > 0) byId.set(invocation.toolCallId, args);
|
|
725
|
+
}
|
|
726
|
+
seen.clear();
|
|
727
|
+
for (const invocation of message.content.toolInvocations ?? []) {
|
|
728
|
+
if (seen.has(invocation.toolCallId)) continue;
|
|
729
|
+
seen.add(invocation.toolCallId);
|
|
730
|
+
const args = invocation.args;
|
|
731
|
+
if (!byId.has(invocation.toolCallId) && args && typeof args === "object" && Object.keys(args).length > 0) byId.set(invocation.toolCallId, args);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
return byId.get(toolCallId) ?? {};
|
|
736
|
+
};
|
|
737
|
+
}
|
|
708
738
|
/**
|
|
709
739
|
* Finds the tool call args for a given toolCallId by searching through messages.
|
|
710
740
|
* This is used to reconstruct the input field when converting tool-result parts to StaticToolResult.
|
|
@@ -10976,10 +11006,13 @@ function messagesAreEqual(one, two) {
|
|
|
10976
11006
|
}
|
|
10977
11007
|
/**
|
|
10978
11008
|
* The parts as memory persists them: `updateWorkingMemory` tool steps removed, and
|
|
10979
|
-
* `<working_memory>` tags and surrounding whitespace stripped from text.
|
|
11009
|
+
* `<working_memory>` tags and surrounding whitespace stripped from text. Observational
|
|
11010
|
+
* memory's `data-om-*` marker parts are also left out: it writes them onto the stored copy
|
|
11011
|
+
* only (when it has no live message list to add them to), so a stored copy that gained one
|
|
11012
|
+
* is still the same message.
|
|
10980
11013
|
*/
|
|
10981
11014
|
function projectPartsForPersistence(parts) {
|
|
10982
|
-
return removeWorkingMemoryToolInvocationParts(parts).map((part) => part.type === "text" ? {
|
|
11015
|
+
return removeWorkingMemoryToolInvocationParts(parts).filter((part) => !part.type.startsWith("data-om-")).map((part) => part.type === "text" ? {
|
|
10983
11016
|
...part,
|
|
10984
11017
|
text: removeWorkingMemoryTags(typeof part.text === "string" ? part.text : "").trim()
|
|
10985
11018
|
} : part);
|
|
@@ -11760,10 +11793,11 @@ var StepContentExtractor = class StepContentExtractor {
|
|
|
11760
11793
|
type: "text",
|
|
11761
11794
|
text: latest.content
|
|
11762
11795
|
}];
|
|
11796
|
+
const getToolCallArgs = createToolCallArgsLookup(dbMessages);
|
|
11763
11797
|
return latest.content.map((c) => {
|
|
11764
11798
|
if (c.type === "tool-result") return {
|
|
11765
11799
|
type: "tool-result",
|
|
11766
|
-
input:
|
|
11800
|
+
input: getToolCallArgs(c.toolCallId),
|
|
11767
11801
|
output: c.output,
|
|
11768
11802
|
toolCallId: c.toolCallId,
|
|
11769
11803
|
toolName: c.toolName
|
|
@@ -13148,6 +13182,7 @@ var MessageList = class MessageList {
|
|
|
13148
13182
|
stateManager = new MessageStateManager();
|
|
13149
13183
|
#prunedResponseMessages = /* @__PURE__ */ new Map();
|
|
13150
13184
|
#embeddedMessages = /* @__PURE__ */ new Map();
|
|
13185
|
+
#messagesToResave = /* @__PURE__ */ new Set();
|
|
13151
13186
|
get memoryMessages() {
|
|
13152
13187
|
return this.stateManager.getMemoryMessages();
|
|
13153
13188
|
}
|
|
@@ -13405,11 +13440,13 @@ var MessageList = class MessageList {
|
|
|
13405
13440
|
}
|
|
13406
13441
|
/** @internal */
|
|
13407
13442
|
clone() {
|
|
13408
|
-
|
|
13443
|
+
const clone = new MessageList({
|
|
13409
13444
|
generateMessageId: this.generateMessageId,
|
|
13410
13445
|
logger: this.logger,
|
|
13411
13446
|
filterIncompleteToolCalls: this.filterIncompleteToolCalls
|
|
13412
13447
|
}).deserialize(this.serialize());
|
|
13448
|
+
for (const id of this.#messagesToResave) clone.#messagesToResave.add(id);
|
|
13449
|
+
return clone;
|
|
13413
13450
|
}
|
|
13414
13451
|
/**
|
|
13415
13452
|
* Return the transcript view that persistence-oriented output processors should store.
|
|
@@ -14063,6 +14100,21 @@ var MessageList = class MessageList {
|
|
|
14063
14100
|
this.unavailableAttachmentUpdates.clear();
|
|
14064
14101
|
return updates;
|
|
14065
14102
|
}
|
|
14103
|
+
/**
|
|
14104
|
+
* Mark a message already in this list as changed after it was loaded, so the next save writes it
|
|
14105
|
+
* again through the normal whole-message save. It is not reported as new input, output or source.
|
|
14106
|
+
* Messages that are not in the list are ignored.
|
|
14107
|
+
*/
|
|
14108
|
+
markForResave(message) {
|
|
14109
|
+
if (this.messages.some((m) => m.id === message.id)) this.#messagesToResave.add(message.id);
|
|
14110
|
+
}
|
|
14111
|
+
/**
|
|
14112
|
+
* The messages marked with {@link markForResave} and not yet drained. For save paths that read the
|
|
14113
|
+
* list instead of draining it; they pick these up next to the new input and response.
|
|
14114
|
+
*/
|
|
14115
|
+
getMessagesToResave() {
|
|
14116
|
+
return this.messages.filter((m) => this.#messagesToResave.has(m.id));
|
|
14117
|
+
}
|
|
14066
14118
|
drainUnsavedMessages() {
|
|
14067
14119
|
return this.drainUnsavedMessagesForSave().messages;
|
|
14068
14120
|
}
|
|
@@ -14073,14 +14125,17 @@ var MessageList = class MessageList {
|
|
|
14073
14125
|
drainUnsavedMessagesForSave() {
|
|
14074
14126
|
const userMessages = [...this.newUserMessages];
|
|
14075
14127
|
const responseMessages = [...this.newResponseMessages];
|
|
14076
|
-
const
|
|
14128
|
+
const resaveIds = [...this.#messagesToResave];
|
|
14129
|
+
const messages = this.messages.filter((m) => this.newUserMessages.has(m) || this.newResponseMessages.has(m) || this.#messagesToResave.has(m.id));
|
|
14077
14130
|
this.newUserMessages.clear();
|
|
14078
14131
|
this.newResponseMessages.clear();
|
|
14132
|
+
this.#messagesToResave.clear();
|
|
14079
14133
|
return {
|
|
14080
14134
|
messages: messages.map((message) => this.transformMessageForTranscript(message)),
|
|
14081
14135
|
restore: () => {
|
|
14082
14136
|
for (const message of userMessages) if (this.messages.includes(message)) this.newUserMessages.add(message);
|
|
14083
14137
|
for (const message of responseMessages) if (this.messages.includes(message)) this.newResponseMessages.add(message);
|
|
14138
|
+
for (const id of resaveIds) if (this.messages.some((m) => m.id === id)) this.#messagesToResave.add(id);
|
|
14084
14139
|
}
|
|
14085
14140
|
};
|
|
14086
14141
|
}
|
|
@@ -533,7 +533,8 @@ function dropCrossProviderExecutedParts(messages, dbMessages, targetProvider, lo
|
|
|
533
533
|
* @see https://github.com/mastra-ai/mastra/issues/11376 - Anthropic models fail with empty object tool input
|
|
534
534
|
*/
|
|
535
535
|
function ensureAnthropicCompatibleMessages(messages, dbMessages) {
|
|
536
|
-
|
|
536
|
+
const getToolCallArgs = createToolCallArgsLookup(dbMessages);
|
|
537
|
+
return messages.map((msg) => enrichToolResultsWithInput(msg, getToolCallArgs));
|
|
537
538
|
}
|
|
538
539
|
/**
|
|
539
540
|
* Tool call ids in the assistant message at `index` that already have a matching tool_result,
|
|
@@ -650,14 +651,14 @@ function pairOrphanedToolCalls(messages) {
|
|
|
650
651
|
/**
|
|
651
652
|
* Enriches a single message's tool-result parts with input field
|
|
652
653
|
*/
|
|
653
|
-
function enrichToolResultsWithInput(message,
|
|
654
|
+
function enrichToolResultsWithInput(message, getToolCallArgs) {
|
|
654
655
|
if (message.role !== "tool" || !Array.isArray(message.content)) return message;
|
|
655
656
|
return {
|
|
656
657
|
...message,
|
|
657
658
|
content: message.content.map((part) => {
|
|
658
659
|
if (part.type === "tool-result") return {
|
|
659
660
|
...part,
|
|
660
|
-
input:
|
|
661
|
+
input: getToolCallArgs(part.toolCallId)
|
|
661
662
|
};
|
|
662
663
|
return part;
|
|
663
664
|
})
|
|
@@ -705,6 +706,35 @@ function getResponseProviderItemIdFromPart(part) {
|
|
|
705
706
|
const partAny = part;
|
|
706
707
|
return getResponseProviderItemId(partAny.providerMetadata) || getResponseProviderItemId(partAny.providerOptions);
|
|
707
708
|
}
|
|
709
|
+
function createToolCallArgsLookup(messages) {
|
|
710
|
+
let byId;
|
|
711
|
+
return (toolCallId) => {
|
|
712
|
+
if (!byId) {
|
|
713
|
+
byId = /* @__PURE__ */ new Map();
|
|
714
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
715
|
+
const message = messages[i];
|
|
716
|
+
if (!message || message.role !== "assistant") continue;
|
|
717
|
+
const seen = /* @__PURE__ */ new Set();
|
|
718
|
+
for (const part of message.content.parts ?? []) {
|
|
719
|
+
if (part.type !== "tool-invocation") continue;
|
|
720
|
+
const invocation = part.toolInvocation;
|
|
721
|
+
if (seen.has(invocation.toolCallId)) continue;
|
|
722
|
+
seen.add(invocation.toolCallId);
|
|
723
|
+
const args = invocation.args;
|
|
724
|
+
if (!byId.has(invocation.toolCallId) && args && typeof args === "object" && Object.keys(args).length > 0) byId.set(invocation.toolCallId, args);
|
|
725
|
+
}
|
|
726
|
+
seen.clear();
|
|
727
|
+
for (const invocation of message.content.toolInvocations ?? []) {
|
|
728
|
+
if (seen.has(invocation.toolCallId)) continue;
|
|
729
|
+
seen.add(invocation.toolCallId);
|
|
730
|
+
const args = invocation.args;
|
|
731
|
+
if (!byId.has(invocation.toolCallId) && args && typeof args === "object" && Object.keys(args).length > 0) byId.set(invocation.toolCallId, args);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
return byId.get(toolCallId) ?? {};
|
|
736
|
+
};
|
|
737
|
+
}
|
|
708
738
|
/**
|
|
709
739
|
* Finds the tool call args for a given toolCallId by searching through messages.
|
|
710
740
|
* This is used to reconstruct the input field when converting tool-result parts to StaticToolResult.
|
|
@@ -10976,10 +11006,13 @@ function messagesAreEqual(one, two) {
|
|
|
10976
11006
|
}
|
|
10977
11007
|
/**
|
|
10978
11008
|
* The parts as memory persists them: `updateWorkingMemory` tool steps removed, and
|
|
10979
|
-
* `<working_memory>` tags and surrounding whitespace stripped from text.
|
|
11009
|
+
* `<working_memory>` tags and surrounding whitespace stripped from text. Observational
|
|
11010
|
+
* memory's `data-om-*` marker parts are also left out: it writes them onto the stored copy
|
|
11011
|
+
* only (when it has no live message list to add them to), so a stored copy that gained one
|
|
11012
|
+
* is still the same message.
|
|
10980
11013
|
*/
|
|
10981
11014
|
function projectPartsForPersistence(parts) {
|
|
10982
|
-
return removeWorkingMemoryToolInvocationParts(parts).map((part) => part.type === "text" ? {
|
|
11015
|
+
return removeWorkingMemoryToolInvocationParts(parts).filter((part) => !part.type.startsWith("data-om-")).map((part) => part.type === "text" ? {
|
|
10983
11016
|
...part,
|
|
10984
11017
|
text: removeWorkingMemoryTags(typeof part.text === "string" ? part.text : "").trim()
|
|
10985
11018
|
} : part);
|
|
@@ -11759,10 +11792,11 @@ var StepContentExtractor = class StepContentExtractor {
|
|
|
11759
11792
|
type: "text",
|
|
11760
11793
|
text: latest.content
|
|
11761
11794
|
}];
|
|
11795
|
+
const getToolCallArgs = createToolCallArgsLookup(dbMessages);
|
|
11762
11796
|
return latest.content.map((c) => {
|
|
11763
11797
|
if (c.type === "tool-result") return {
|
|
11764
11798
|
type: "tool-result",
|
|
11765
|
-
input:
|
|
11799
|
+
input: getToolCallArgs(c.toolCallId),
|
|
11766
11800
|
output: c.output,
|
|
11767
11801
|
toolCallId: c.toolCallId,
|
|
11768
11802
|
toolName: c.toolName
|
|
@@ -13147,6 +13181,7 @@ var MessageList = class MessageList {
|
|
|
13147
13181
|
stateManager = new MessageStateManager();
|
|
13148
13182
|
#prunedResponseMessages = /* @__PURE__ */ new Map();
|
|
13149
13183
|
#embeddedMessages = /* @__PURE__ */ new Map();
|
|
13184
|
+
#messagesToResave = /* @__PURE__ */ new Set();
|
|
13150
13185
|
get memoryMessages() {
|
|
13151
13186
|
return this.stateManager.getMemoryMessages();
|
|
13152
13187
|
}
|
|
@@ -13404,11 +13439,13 @@ var MessageList = class MessageList {
|
|
|
13404
13439
|
}
|
|
13405
13440
|
/** @internal */
|
|
13406
13441
|
clone() {
|
|
13407
|
-
|
|
13442
|
+
const clone = new MessageList({
|
|
13408
13443
|
generateMessageId: this.generateMessageId,
|
|
13409
13444
|
logger: this.logger,
|
|
13410
13445
|
filterIncompleteToolCalls: this.filterIncompleteToolCalls
|
|
13411
13446
|
}).deserialize(this.serialize());
|
|
13447
|
+
for (const id of this.#messagesToResave) clone.#messagesToResave.add(id);
|
|
13448
|
+
return clone;
|
|
13412
13449
|
}
|
|
13413
13450
|
/**
|
|
13414
13451
|
* Return the transcript view that persistence-oriented output processors should store.
|
|
@@ -14062,6 +14099,21 @@ var MessageList = class MessageList {
|
|
|
14062
14099
|
this.unavailableAttachmentUpdates.clear();
|
|
14063
14100
|
return updates;
|
|
14064
14101
|
}
|
|
14102
|
+
/**
|
|
14103
|
+
* Mark a message already in this list as changed after it was loaded, so the next save writes it
|
|
14104
|
+
* again through the normal whole-message save. It is not reported as new input, output or source.
|
|
14105
|
+
* Messages that are not in the list are ignored.
|
|
14106
|
+
*/
|
|
14107
|
+
markForResave(message) {
|
|
14108
|
+
if (this.messages.some((m) => m.id === message.id)) this.#messagesToResave.add(message.id);
|
|
14109
|
+
}
|
|
14110
|
+
/**
|
|
14111
|
+
* The messages marked with {@link markForResave} and not yet drained. For save paths that read the
|
|
14112
|
+
* list instead of draining it; they pick these up next to the new input and response.
|
|
14113
|
+
*/
|
|
14114
|
+
getMessagesToResave() {
|
|
14115
|
+
return this.messages.filter((m) => this.#messagesToResave.has(m.id));
|
|
14116
|
+
}
|
|
14065
14117
|
drainUnsavedMessages() {
|
|
14066
14118
|
return this.drainUnsavedMessagesForSave().messages;
|
|
14067
14119
|
}
|
|
@@ -14072,14 +14124,17 @@ var MessageList = class MessageList {
|
|
|
14072
14124
|
drainUnsavedMessagesForSave() {
|
|
14073
14125
|
const userMessages = [...this.newUserMessages];
|
|
14074
14126
|
const responseMessages = [...this.newResponseMessages];
|
|
14075
|
-
const
|
|
14127
|
+
const resaveIds = [...this.#messagesToResave];
|
|
14128
|
+
const messages = this.messages.filter((m) => this.newUserMessages.has(m) || this.newResponseMessages.has(m) || this.#messagesToResave.has(m.id));
|
|
14076
14129
|
this.newUserMessages.clear();
|
|
14077
14130
|
this.newResponseMessages.clear();
|
|
14131
|
+
this.#messagesToResave.clear();
|
|
14078
14132
|
return {
|
|
14079
14133
|
messages: messages.map((message) => this.transformMessageForTranscript(message)),
|
|
14080
14134
|
restore: () => {
|
|
14081
14135
|
for (const message of userMessages) if (this.messages.includes(message)) this.newUserMessages.add(message);
|
|
14082
14136
|
for (const message of responseMessages) if (this.messages.includes(message)) this.newResponseMessages.add(message);
|
|
14137
|
+
for (const id of resaveIds) if (this.messages.some((m) => m.id === id)) this.#messagesToResave.add(id);
|
|
14083
14138
|
}
|
|
14084
14139
|
};
|
|
14085
14140
|
}
|