@mastra/core 1.86.0 → 1.87.0-alpha.1
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/@ai-sdk_anthropic@3.0.137/dist/index.d.ts +2 -2
- package/dist/_types/@ai-sdk_google@3.0.140/dist/index.d.ts +2 -2
- package/dist/_types/@ai-sdk_openai@3.0.135/dist/index.d.ts +2 -2
- package/dist/a2a/index.cjs +1 -1
- package/dist/a2a/index.js +1 -1
- package/dist/agent/durable/constants.d.ts +2 -0
- package/dist/agent/durable/evented-execution.d.ts +7 -0
- package/dist/agent/durable/execution-engine.d.ts +1 -0
- package/dist/agent/durable/execution-fence.d.ts +2 -0
- package/dist/agent/durable/index.cjs +4 -1
- package/dist/agent/durable/index.d.ts +2 -1
- package/dist/agent/durable/index.js +2 -2
- package/dist/agent/durable/run-registry.d.ts +13 -0
- package/dist/agent/durable/segment-spans.d.ts +54 -1
- package/dist/agent/durable/types.d.ts +12 -0
- package/dist/agent/durable/workflows/durable-loop-builder.d.ts +57 -2
- package/dist/agent/durable/workflows/finalize-run.d.ts +4 -1
- package/dist/agent/durable/workflows/shared/index.d.ts +1 -1
- package/dist/agent/durable/workflows/shared/reported-cost.d.ts +7 -0
- package/dist/agent/durable/workflows/shared/schemas.d.ts +16 -1
- package/dist/agent/durable/workflows/shared/tool-call-concurrency.d.ts +6 -0
- package/dist/agent/durable/workflows/steps/llm-execution.d.ts +5 -0
- package/dist/agent/durable/workflows/steps/llm-mapping.d.ts +6 -0
- package/dist/agent/durable/workflows/steps/tool-call.d.ts +20 -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/request-context-snapshot.d.ts +3 -2
- package/dist/agent/streams/run-records.d.ts +9 -1
- package/dist/agent/thread-stream-runtime.d.ts +3 -1
- 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-run-engine.d.ts +5 -2
- package/dist/agent-controller/session.d.ts +2 -0
- package/dist/agent-controller/types.d.ts +23 -0
- package/dist/{agent-controller-D_5Dc8d3.cjs → agent-controller-BTIxiD1u.cjs} +44 -14
- package/dist/{agent-controller-D5EKeS1H.js → agent-controller-C1bK0CXm.js} +44 -14
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/background-tasks/manager.d.ts +4 -1
- package/dist/{background-tasks-idnlMbqD.js → background-tasks-BbVsBghi.js} +139 -51
- package/dist/{background-tasks-BVxb0VGV.cjs → background-tasks-CVl6e0Jo.cjs} +139 -51
- package/dist/browser/index.cjs +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/{builder-CBWoYNck.cjs → builder-BRJPSTig.cjs} +2 -2
- package/dist/{builder-Cuq-j2w3.js → builder-C8XzrtBQ.js} +2 -2
- package/dist/cache/base.d.ts +40 -10
- package/dist/cache/index.cjs +1 -1
- package/dist/cache/index.js +1 -1
- package/dist/capabilities/302ai.json +213 -213
- package/dist/capabilities/abliteratedllm.json +30 -30
- package/dist/capabilities/abliteration-ai.json +6 -6
- package/dist/capabilities/above.json +19 -19
- package/dist/capabilities/adaption.json +16 -16
- package/dist/capabilities/adzuki.json +19 -19
- package/dist/capabilities/agentrouter.json +11 -11
- package/dist/capabilities/agnes.json +2 -2
- package/dist/capabilities/ai-router.json +6 -6
- package/dist/capabilities/aiand.json +20 -20
- package/dist/capabilities/aigrow.json +14 -14
- package/dist/capabilities/aimlapi.json +146 -150
- package/dist/capabilities/aixy.json +21 -21
- package/dist/capabilities/aki-io.json +14 -14
- package/dist/capabilities/alibaba-cn.json +96 -96
- package/dist/capabilities/alibaba-coding-plan-cn.json +4 -4
- package/dist/capabilities/alibaba-coding-plan.json +4 -4
- package/dist/capabilities/alibaba-token-plan-cn.json +50 -50
- package/dist/capabilities/alibaba-token-plan.json +49 -49
- package/dist/capabilities/alibaba.json +69 -69
- package/dist/capabilities/ambient.json +12 -12
- package/dist/capabilities/amd.json +8 -8
- package/dist/capabilities/anthropic.json +43 -43
- package/dist/capabilities/anyapi.json +17 -17
- package/dist/capabilities/apiko.json +2 -2
- package/dist/capabilities/arcee.json +11 -11
- package/dist/capabilities/augure.json +6 -6
- package/dist/capabilities/auriko.json +24 -24
- package/dist/capabilities/bailing.json +5 -5
- package/dist/capabilities/baseten.json +35 -35
- package/dist/capabilities/bee.json +5 -5
- package/dist/capabilities/berget.json +8 -8
- package/dist/capabilities/bothub.json +15 -15
- package/dist/capabilities/boundless.json +36 -36
- package/dist/capabilities/bumo.json +47 -47
- package/dist/capabilities/byteplus.json +30 -30
- package/dist/capabilities/cerebras.json +4 -4
- package/dist/capabilities/cheapaimodel.json +10 -10
- package/dist/capabilities/cheapest-token.json +32 -32
- package/dist/capabilities/chutes.json +11 -14
- package/dist/capabilities/cline-pass.json +33 -33
- package/dist/capabilities/cloudcode.json +9 -9
- package/dist/capabilities/cloudferro-sherlock.json +4 -4
- package/dist/capabilities/cloudflare-workers-ai.json +17 -78
- package/dist/capabilities/commandcode.json +155 -155
- package/dist/capabilities/concentrate.json +286 -277
- package/dist/capabilities/cortecs.json +114 -114
- package/dist/capabilities/crossmodel.json +189 -189
- package/dist/capabilities/crusoe.json +8 -8
- package/dist/capabilities/daoxe.json +6 -6
- package/dist/capabilities/databricks.json +129 -129
- package/dist/capabilities/deepinfra.json +132 -69
- package/dist/capabilities/deepseek.json +4 -4
- package/dist/capabilities/digitalocean.json +112 -112
- package/dist/capabilities/dothoosh.json +31 -31
- package/dist/capabilities/doubleword.json +26 -26
- package/dist/capabilities/edenai.json +902 -1760
- package/dist/capabilities/empiriolabs.json +156 -158
- package/dist/capabilities/engy.json +18 -18
- package/dist/capabilities/entrim.json +6 -6
- package/dist/capabilities/evroc.json +16 -16
- package/dist/capabilities/ezkielyna.json +7 -7
- package/dist/capabilities/fastrouter.json +73 -73
- package/dist/capabilities/fireworks-ai.json +86 -65
- package/dist/capabilities/freemodel.json +24 -24
- package/dist/capabilities/friendli.json +2 -2
- package/dist/capabilities/frogbot.json +96 -96
- package/dist/capabilities/gisoo.json +17 -17
- package/dist/capabilities/gmicloud.json +10 -10
- package/dist/capabilities/google.json +50 -50
- package/dist/capabilities/graphn.json +12 -12
- package/dist/capabilities/greenpt.json +35 -35
- package/dist/capabilities/groq.json +8 -8
- package/dist/capabilities/helicone.json +77 -77
- package/dist/capabilities/hostinger-router.json +11 -11
- package/dist/capabilities/hpc-ai.json +14 -14
- package/dist/capabilities/huawei-maas.json +16 -16
- package/dist/capabilities/hubris.json +30 -30
- package/dist/capabilities/huggingface.json +101 -91
- package/dist/capabilities/hyper.json +24 -24
- package/dist/capabilities/impossibl.json +135 -135
- 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 +13 -13
- package/dist/capabilities/inferall.json +4 -4
- package/dist/capabilities/inference-coop.json +9 -9
- package/dist/capabilities/inferenceapis.json +26 -26
- package/dist/capabilities/inferris.json +3 -3
- package/dist/capabilities/infersia.json +14 -14
- 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/iteracompute.json +55 -55
- package/dist/capabilities/jad-ai.json +2 -2
- package/dist/capabilities/jalapeno.json +11 -11
- package/dist/capabilities/jiekou.json +64 -64
- package/dist/capabilities/joingonka.json +4 -4
- package/dist/capabilities/jzstoken.json +40 -40
- package/dist/capabilities/keln.json +25 -25
- package/dist/capabilities/kenari.json +123 -123
- package/dist/capabilities/kilo.json +639 -623
- package/dist/capabilities/kimi-code-plan-cn.json +4 -4
- package/dist/capabilities/kimi-code-plan-global.json +4 -4
- package/dist/capabilities/kitani.json +6 -6
- package/dist/capabilities/klavo.json +23 -23
- package/dist/capabilities/korouter.json +31 -31
- package/dist/capabilities/kunavo.json +10 -10
- package/dist/capabilities/liquid.json +10 -10
- package/dist/capabilities/lithosai.json +2 -2
- package/dist/capabilities/llmgateway-providers.json +895 -886
- package/dist/capabilities/llmgateway.json +344 -336
- package/dist/capabilities/llmtr.json +26 -26
- package/dist/capabilities/logits.json +2 -2
- package/dist/capabilities/longcat.json +2 -2
- package/dist/capabilities/lowrouter.json +49 -49
- package/dist/capabilities/lyceum.json +11 -11
- package/dist/capabilities/melious.json +12 -12
- package/dist/capabilities/merge-gateway.json +259 -258
- package/dist/capabilities/meta.json +8 -8
- package/dist/capabilities/minimax-cn-coding-plan.json +2 -2
- package/dist/capabilities/minimax-cn.json +5 -5
- package/dist/capabilities/minimax-coding-plan.json +2 -2
- package/dist/capabilities/minimax.json +5 -5
- package/dist/capabilities/mistral.json +18 -18
- package/dist/capabilities/mixlayer.json +5 -5
- package/dist/capabilities/modal.json +10 -10
- package/dist/capabilities/model-oracle-ai.json +26 -26
- package/dist/capabilities/modelis.json +13 -13
- package/dist/capabilities/modelscope.json +2 -2
- package/dist/capabilities/modular.json +8 -8
- package/dist/capabilities/moneo.json +13 -13
- package/dist/capabilities/moonshotai-cn.json +3 -3
- package/dist/capabilities/moonshotai.json +3 -3
- package/dist/capabilities/morph.json +11 -11
- 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 +583 -548
- package/dist/capabilities/nearai.json +82 -82
- package/dist/capabilities/nebius.json +33 -33
- package/dist/capabilities/neon.json +135 -135
- package/dist/capabilities/neuralwatt.json +37 -37
- package/dist/capabilities/nokeep.json +5 -5
- package/dist/capabilities/novita-ai.json +153 -153
- package/dist/capabilities/nvidia.json +25 -57
- package/dist/capabilities/oathbreaker.json +2 -2
- package/dist/capabilities/obscurify.json +27 -27
- package/dist/capabilities/oci.json +16 -7
- package/dist/capabilities/ofox.json +358 -358
- package/dist/capabilities/ollama-cloud.json +50 -50
- package/dist/capabilities/openai.json +79 -47
- package/dist/capabilities/opencode-go.json +88 -88
- package/dist/capabilities/openreason.json +5 -5
- package/dist/capabilities/openrouter.json +543 -533
- package/dist/capabilities/opper.json +28 -28
- package/dist/capabilities/orcarouter.json +238 -238
- package/dist/capabilities/outerlabs.json +30 -30
- package/dist/capabilities/ovhcloud.json +61 -7
- package/dist/capabilities/pareto.json +4 -4
- 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 +34 -34
- package/dist/capabilities/pioneer.json +26 -26
- package/dist/capabilities/poe.json +99 -99
- package/dist/capabilities/poolside.json +2 -2
- package/dist/capabilities/powerspring.json +12 -12
- package/dist/capabilities/primalabs.json +10 -10
- package/dist/capabilities/prime.json +117 -101
- package/dist/capabilities/privatemode-ai.json +11 -11
- package/dist/capabilities/proxystacks.json +6 -6
- package/dist/capabilities/qiniu-ai.json +13 -13
- package/dist/capabilities/refuseless.json +8 -8
- package/dist/capabilities/regolo-ai.json +11 -11
- package/dist/capabilities/requesty.json +171 -171
- package/dist/capabilities/ruapi.json +19 -19
- package/dist/capabilities/runcrate.json +17 -17
- package/dist/capabilities/runinfra.json +16 -16
- package/dist/capabilities/sakana.json +5 -5
- package/dist/capabilities/sambanova.json +6 -6
- package/dist/capabilities/sandbase.json +22 -22
- package/dist/capabilities/sarvam.json +12 -12
- package/dist/capabilities/scaleway.json +17 -17
- package/dist/capabilities/scnet-token-plan.json +14 -14
- package/dist/capabilities/scx-ai.json +29 -29
- package/dist/capabilities/sensenova.json +10 -10
- package/dist/capabilities/siliconflow-cn.json +58 -58
- package/dist/capabilities/siliconflow.json +61 -61
- package/dist/capabilities/snowflake-cortex.json +24 -24
- package/dist/capabilities/sokkan.json +9 -9
- package/dist/capabilities/sparrowcodes.json +18 -18
- package/dist/capabilities/standardcompute.json +94 -94
- package/dist/capabilities/steadyrouter.json +42 -42
- package/dist/capabilities/stepfun-ai-step-plan.json +6 -6
- package/dist/capabilities/stepfun-ai.json +5 -5
- package/dist/capabilities/stepfun-step-plan.json +5 -5
- package/dist/capabilities/stepfun.json +5 -5
- package/dist/capabilities/stepping-stone.json +20 -20
- package/dist/capabilities/superbot-gg.json +4 -4
- package/dist/capabilities/synthetic.json +12 -12
- package/dist/capabilities/synthorai.json +21 -21
- package/dist/capabilities/teamorouter.json +24 -24
- package/dist/capabilities/teapot-router.json +13 -13
- package/dist/capabilities/tencent-token-plan.json +56 -32
- package/dist/capabilities/tencent-tokenhub.json +43 -43
- package/dist/capabilities/tensorx.json +48 -48
- package/dist/capabilities/tenstorrent.json +2 -2
- package/dist/capabilities/the-grid-ai.json +33 -33
- package/dist/capabilities/thinkingmachines.json +78 -78
- package/dist/capabilities/tinfoil.json +10 -10
- package/dist/capabilities/toapis.json +2 -2
- package/dist/capabilities/togetherai.json +52 -50
- package/dist/capabilities/tokengo.json +19 -19
- package/dist/capabilities/tokenify.json +10 -10
- package/dist/capabilities/trustedrouter.json +5 -5
- package/dist/capabilities/trustedtokens.json +16 -16
- package/dist/capabilities/umans-ai-coding-plan.json +16 -16
- package/dist/capabilities/umans-ai.json +10 -10
- package/dist/capabilities/unrestricted.json +8 -8
- package/dist/capabilities/uplinkswitch.json +19 -19
- package/dist/capabilities/upstage.json +8 -8
- package/dist/capabilities/vancine.json +20 -20
- package/dist/capabilities/vercel.json +539 -539
- package/dist/capabilities/vivgrid.json +85 -85
- package/dist/capabilities/volcengine-coding-plan.json +36 -27
- package/dist/capabilities/volcengine.json +26 -26
- package/dist/capabilities/vultr.json +30 -30
- package/dist/capabilities/wafer.ai.json +19 -19
- package/dist/capabilities/wallaby.json +5 -5
- package/dist/capabilities/wally.json +8 -8
- package/dist/capabilities/wandb.json +19 -19
- package/dist/capabilities/watt.json +23 -23
- package/dist/capabilities/xai.json +7 -7
- package/dist/capabilities/xiaomi-token-plan-ams.json +2 -2
- package/dist/capabilities/xiaomi-token-plan-cn.json +2 -2
- package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -2
- package/dist/capabilities/xiaomi.json +2 -2
- package/dist/capabilities/xpersona.json +12 -12
- package/dist/capabilities/xxapi.json +30 -30
- package/dist/capabilities/zai-coding-plan.json +17 -17
- package/dist/capabilities/zai.json +28 -26
- package/dist/capabilities/zenifra.json +27 -27
- package/dist/capabilities/zenmux.json +164 -164
- package/dist/capabilities/zerogpu.json +11 -11
- package/dist/capabilities/zhipuai-coding-plan.json +4 -4
- package/dist/capabilities/zhipuai.json +22 -22
- package/dist/capabilities/zro.json +3 -3
- package/dist/channels/agent-channels.d.ts +9 -1
- package/dist/channels/attach-file-tool.d.ts +22 -0
- package/dist/channels/formatting.d.ts +8 -0
- package/dist/channels/index.cjs +13 -2
- package/dist/channels/index.d.ts +11 -1
- package/dist/channels/index.js +3 -3
- package/dist/channels/reply-guidance-processor.d.ts +26 -0
- package/dist/channels/reply-mode.d.ts +66 -0
- package/dist/channels/reply-reminder-processor.d.ts +23 -0
- package/dist/channels/reply-tool.d.ts +43 -0
- package/dist/channels/thread-link-processor.d.ts +48 -0
- package/dist/channels/thread-lookup.d.ts +16 -0
- package/dist/channels/tool-announcement-processor.d.ts +29 -0
- package/dist/channels/types.d.ts +30 -3
- package/dist/{channels-D7bBM9xD.cjs → channels-Cl-pRrWB.cjs} +122 -1
- package/dist/{channels-DSOCNoab.js → channels-DegTNzaq.js} +99 -2
- package/dist/coding-agent/index.cjs +1 -1
- package/dist/coding-agent/index.js +1 -1
- package/dist/datasets/experiment/index.d.ts +1 -1
- package/dist/datasets/experiment/item.d.ts +4 -3
- package/dist/datasets/experiment/scorer.d.ts +34 -11
- package/dist/datasets/index.cjs +3 -2
- package/dist/datasets/index.js +3 -3
- package/dist/{dist-ByO0vuJJ-BjMue5_p.cjs → dist-CufwpBZM-CwERFaas.cjs} +4 -4
- package/dist/{dist-ByO0vuJJ-CCXLBnvJ.js → dist-CufwpBZM-DK14Qe0Z.js} +4 -4
- package/dist/docs/SKILL.md +2 -1
- package/dist/docs/assets/SOURCE_MAP.json +817 -817
- package/dist/docs/references/docs-agents-resumable-streams.md +15 -6
- package/dist/docs/references/docs-channels.md +43 -0
- package/dist/docs/references/docs-deployment-workers.md +3 -1
- package/dist/docs/references/docs-evals-experiments.md +13 -3
- package/dist/docs/references/docs-harness-background-tasks.md +4 -4
- package/dist/docs/references/docs-harness-durable-agents.md +39 -48
- package/dist/docs/references/docs-knowledge-importers.md +1 -1
- package/dist/docs/references/docs-mastra-platform-observability-overview.md +1 -1
- package/dist/docs/references/docs-sandbox-overview.md +1 -0
- package/dist/docs/references/docs-server-pubsub.md +1 -1
- package/dist/docs/references/docs-workflows-overview.md +67 -3
- package/dist/docs/references/integrations-agentic-ui-assistant-ui.md +2 -0
- package/dist/docs/references/integrations-frameworks-angular.md +39 -0
- package/dist/docs/references/integrations-frameworks-astro.md +5 -2
- package/dist/docs/references/integrations-frameworks-electron.md +40 -0
- package/dist/docs/references/integrations-frameworks-next-js.md +5 -2
- package/dist/docs/references/integrations-frameworks-nuxt.md +5 -2
- package/dist/docs/references/integrations-frameworks-sveltekit.md +5 -2
- package/dist/docs/references/integrations-frameworks-vite-react.md +40 -0
- package/dist/docs/references/integrations.md +3 -0
- package/dist/docs/references/reference-agent-controller-agent-controller-class.md +6 -0
- package/dist/docs/references/reference-agents-channels.md +1 -1
- package/dist/docs/references/reference-agents-durable-agent.md +5 -3
- package/dist/docs/references/reference-agents-generate.md +2 -0
- package/dist/docs/references/reference-channels-thread-link.md +67 -0
- package/dist/docs/references/reference-configuration.md +1 -1
- package/dist/docs/references/reference-core-mastra-class.md +2 -0
- package/dist/docs/references/reference-knowledge-knowledge-class.md +1 -1
- package/dist/docs/references/reference-knowledge-knowledge-tools.md +11 -5
- package/dist/docs/references/reference-pubsub-caching-pubsub.md +2 -2
- package/dist/docs/references/reference-pubsub-redis-streams.md +2 -2
- package/dist/docs/references/reference-pubsub-valkey-streams.md +2 -2
- package/dist/docs/references/reference-workers-overview.md +2 -0
- package/dist/docs/references/reference-workflows-workflow-methods-create-run.md +2 -0
- package/dist/docs/references/reference-workflows-workflow.md +2 -0
- package/dist/docs/references/reference-workspace-factory-sandbox.md +2 -1
- package/dist/docs/references/reference.md +2 -0
- package/dist/error/index.cjs +2 -1
- package/dist/error/index.d.ts +1 -1
- package/dist/error/index.js +2 -2
- package/dist/error/provider-error.d.ts +2 -1
- package/dist/{error-BLwEXqOK.js → error-BC9Au-22.js} +13 -1
- package/dist/{error-BdEvO8za.cjs → error-L1V4uUbd.cjs} +18 -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/events/caching-pubsub.d.ts +28 -0
- package/dist/events/index.cjs +4 -1
- package/dist/events/index.js +2 -2
- package/dist/events/topics.d.ts +55 -9
- 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/{inmemory-BDD0w8gx.js → inmemory-BK3zLwvM.js} +42 -12
- package/dist/{inmemory-fgR8sq-U.cjs → inmemory-Dc86VWGB.cjs} +42 -12
- package/dist/knowledge/changes.d.ts +17 -5
- package/dist/knowledge/importers/runner.d.ts +6 -0
- package/dist/knowledge/index.cjs +78 -16
- package/dist/knowledge/index.d.ts +2 -2
- package/dist/knowledge/index.js +78 -16
- package/dist/knowledge/search-snippet.d.ts +30 -0
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/provider-types.generated.d.ts +8175 -8296
- package/dist/{llm-BOQR5g0t.cjs → llm-BKxlS9Kk.cjs} +3 -3
- package/dist/{llm-DMNEZIV9.js → llm-CMkzIFAk.js} +3 -3
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/{manager-BzNynLwT.js → manager-C-eQXmRq.js} +120 -70
- package/dist/{manager-CyCR9IpR.cjs → manager-CasaT35Q.cjs} +125 -69
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-CqBmnzjM.js → mastra-5EEmN3Ok.js} +28 -18
- package/dist/{mastra-D2B01_gg.cjs → mastra-C7Tj4U8c.cjs} +28 -18
- package/dist/memory/index.cjs +3 -3
- package/dist/memory/index.js +3 -3
- package/dist/{message-list-Cj0Sq_JP.cjs → message-list-DfN9mWeN.cjs} +121 -121
- package/dist/{message-list-KRbg-TnI.js → message-list-wI71UGxk.js} +1 -1
- package/dist/{model-CrXDhcbw.cjs → model-9HA-W0tg.cjs} +1 -1
- package/dist/{model-3AeJKHLU.js → model-DCLUL-8a.js} +1 -1
- package/dist/{netlify-DTXLQiG1.cjs → netlify-Cq3H-A9I.cjs} +12 -12
- package/dist/{netlify-DUPSTzi6.js → netlify-DaWURNSU.js} +11 -11
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/observability/index.cjs +1 -0
- package/dist/observability/index.d.ts +1 -1
- package/dist/observability/index.js +2 -2
- package/dist/{output-helpers-CedRCE17.js → output-helpers-CVzhy1Y0.js} +126 -56
- package/dist/{output-helpers-1Zu4Vt9C.cjs → output-helpers-DgsH4aTb.cjs} +143 -55
- 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/processors/runner.d.ts +2 -0
- package/dist/{provider-registry-BeB8RQO8.js → provider-registry-DWixjFX7.js} +21915 -22166
- package/dist/{provider-registry-B_rC-5aL.cjs → provider-registry-a649fS5r.cjs} +21915 -22166
- package/dist/provider-registry.json +22772 -23030
- package/dist/{registry-generator-Cv6GnxLG.js → registry-generator-BYJC7p8M.js} +1 -1
- package/dist/{registry-generator-DbBoIOby.cjs → registry-generator-BuKC7UKd.cjs} +1 -1
- package/dist/{rehydrate-3f-i1Ga2.js → rehydrate-DPhmASM6.js} +2 -2
- package/dist/{rehydrate-BWaa2eGN.cjs → rehydrate-DR2_WAz2.cjs} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/{run-registry-Bx06ZIN_.js → run-registry-D3X7XvUL.js} +2464 -731
- package/dist/{run-registry-Bk6QxNE4.cjs → run-registry-oUNF6szW.cjs} +2584 -785
- package/dist/storage/domains/inmemory-db.d.ts +1 -0
- package/dist/storage/domains/knowledge/base.d.ts +5 -0
- package/dist/storage/domains/knowledge/inmemory.d.ts +1 -0
- package/dist/storage/domains/knowledge/pages-inmemory.d.ts +10 -2
- package/dist/storage/domains/knowledge/pages.d.ts +30 -0
- package/dist/storage/index.cjs +2 -2
- package/dist/storage/index.js +2 -2
- package/dist/storage/run-fencing.d.ts +5 -0
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/{stream-BIXX67WE.cjs → stream-DQC1vpvl.cjs} +4 -4
- package/dist/{stream-DVy0Z-m0.js → stream-DoZ6F41o.js} +4 -4
- 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-PSKeNhuT.js → tool-loop-agent-C9YkvDRd.js} +4 -4
- package/dist/{tool-loop-agent-DDeKGwtr.cjs → tool-loop-agent-Cy4NDOMS.cjs} +4 -4
- package/dist/{utils-BJiQF8Pi.js → utils-9JyiKu5r.js} +1 -1
- package/dist/{utils-CAnUlnUm.cjs → utils-Bs2IYyOb.cjs} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-BAVwAgtT.js → validate-8j0phWFV.js} +1 -1
- package/dist/{validate-BMNxfs4Z.cjs → validate-BE3mVxVy.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-BlvJM_Hu.js → worker-BfWFqSH2.js} +2 -2
- package/dist/{worker-CFUKBBCF.cjs → worker-BiK1kfMa.cjs} +2 -2
- package/dist/{worker-CVoD3tts.js → worker-DIRdEwih.js} +2 -2
- package/dist/{worker-Brwa-HqM.cjs → worker-DwdgU6E9.cjs} +2 -2
- package/dist/{workflow-zvQGBMCM.cjs → workflow-CxQMcTbT.cjs} +4 -4
- package/dist/{workflow-BSLS7_vB.js → workflow-ni-keg2i.js} +4 -4
- 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/workflows/run-ownership.d.ts +74 -8
- package/dist/workflows/types.d.ts +16 -0
- package/dist/workflows/workflow.d.ts +4 -0
- package/package.json +5 -5
- package/src/llm/model/provider-types.generated.d.ts +8175 -8296
- /package/dist/_types/{@ai-sdk_provider-utils@4.0.66 → @ai-sdk_provider-utils@4.0.67}/dist/index.d.ts +0 -0
- /package/dist/_types/{@ai-sdk_provider-utils@4.0.66 → @ai-sdk_provider-utils@4.0.67}/package.json +0 -0
|
@@ -36,6 +36,16 @@ export declare function createDurableToolCallStep(): import("../../../../workflo
|
|
|
36
36
|
completionStartTime?: Date | undefined;
|
|
37
37
|
timeToFirstTokenMs?: number | undefined;
|
|
38
38
|
stepUsage?: any;
|
|
39
|
+
sideBySide?: boolean | undefined;
|
|
40
|
+
response?: {
|
|
41
|
+
id?: string | undefined;
|
|
42
|
+
modelId?: string | undefined;
|
|
43
|
+
servedBy?: {
|
|
44
|
+
provider: string;
|
|
45
|
+
modelId: string;
|
|
46
|
+
} | undefined;
|
|
47
|
+
reportedCost?: import("../../../../stream").ProviderMetadata | undefined;
|
|
48
|
+
} | undefined;
|
|
39
49
|
}, {
|
|
40
50
|
toolCallId: string;
|
|
41
51
|
toolName: string;
|
|
@@ -50,6 +60,16 @@ export declare function createDurableToolCallStep(): import("../../../../workflo
|
|
|
50
60
|
completionStartTime?: Date | undefined;
|
|
51
61
|
timeToFirstTokenMs?: number | undefined;
|
|
52
62
|
stepUsage?: any;
|
|
63
|
+
sideBySide?: boolean | undefined;
|
|
64
|
+
response?: {
|
|
65
|
+
id?: string | undefined;
|
|
66
|
+
modelId?: string | undefined;
|
|
67
|
+
servedBy?: {
|
|
68
|
+
provider: string;
|
|
69
|
+
modelId: string;
|
|
70
|
+
} | undefined;
|
|
71
|
+
reportedCost?: import("../../../../stream").ProviderMetadata | undefined;
|
|
72
|
+
} | undefined;
|
|
53
73
|
result?: any;
|
|
54
74
|
modelOutputComputed?: boolean | undefined;
|
|
55
75
|
mappingError?: {
|
package/dist/agent/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-oUNF6szW.cjs");
|
|
3
|
+
const require_stream = require("../stream-DQC1vpvl.cjs");
|
|
4
|
+
const require_message_list = require("../message-list-DfN9mWeN.cjs");
|
|
5
5
|
const require_signals = require("../signals-CWxAMEmE.cjs");
|
|
6
6
|
const require_to_prompt = require("../to-prompt-B9eZo2U5.cjs");
|
|
7
7
|
const require_schedules = require("../schedules-BZS8McF7.cjs");
|
package/dist/agent/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { dn as resolveThreadIdFromArgs, fn as supportedLanguageModelSpecifications, l as TripWire, ln as isSupportedLanguageModel, mn as tryStreamWithJsonFallback, pn as tryGenerateWithJsonFallback, un as resolveSuspendedToolRunId } from "../stream-
|
|
3
|
-
import { Q as TypeDetector, n as MessageList, t as convertMessages } from "../message-list-
|
|
1
|
+
import { A as agentInstructions, Dl as hasResumableStreams, It as DEFAULT_TOOL_DECLINE_REASON, Jl as isAgentCompatible, Lt as resolveDeclineReason, M as MAX_FS_SUBAGENT_DEPTH, N as AGENT_RESUME_CLAIM_STALE_MS, Ol as isDurableAgentLike, P as Agent, Ps as getGoalActivityDurationMs, j as assembleAgentFromFsEntry, k as agentConfig } from "../run-registry-D3X7XvUL.js";
|
|
2
|
+
import { dn as resolveThreadIdFromArgs, fn as supportedLanguageModelSpecifications, l as TripWire, ln as isSupportedLanguageModel, mn as tryStreamWithJsonFallback, pn as tryGenerateWithJsonFallback, un as resolveSuspendedToolRunId } from "../stream-DoZ6F41o.js";
|
|
3
|
+
import { Q as TypeDetector, n as MessageList, t as convertMessages } from "../message-list-wI71UGxk.js";
|
|
4
4
|
import { a as isCreatedAgentSignal, c as isUserAuthoredMessage, d as signalSpanAttributes, f as signalToDataPartFormat, h as signalToXmlMarkup, i as getMessageAuthor, l as mastraDBMessageToSignal, m as signalToMessage, n as createSignal, o as isMastraSignalMessage, p as signalToMastraDBMessage, r as dataPartToSignal, s as isTransientSignalMessage, t as createMessageSignal, u as resolveDeliveryAttributes } from "../signals-CqR_iWkg.js";
|
|
5
5
|
import { n as aiV5ModelMessageToV2PromptMessage } from "../to-prompt-BsDtVXrf.js";
|
|
6
6
|
import { d as ScheduleInputSchema, f as ScheduleOutputSchema, i as toWorkflowSchedule, n as toAgentSchedule, p as WORKFLOW_SCHEDULE_PREFIX, r as toScheduleView, s as defineSchedule, t as Schedules, u as AGENT_SCHEDULE_PREFIX } from "../schedules-DZfSx-7P.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_message_list = require("../../message-list-
|
|
2
|
+
const require_message_list = require("../../message-list-DfN9mWeN.cjs");
|
|
3
3
|
const require_to_prompt = require("../../to-prompt-B9eZo2U5.cjs");
|
|
4
4
|
exports.AIV4Adapter = require_message_list.AIV4Adapter;
|
|
5
5
|
exports.AIV5Adapter = require_message_list.AIV5Adapter;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { B as getResponseProviderItemIdFromPart, F as AIV4Adapter, H as hasResponseProviderItemId, I as dropCrossProviderExecutedParts, J as getResponseProviderItemIds, L as ensureAnthropicCompatibleMessages, M as AIV5Adapter, Q as TypeDetector, R as findToolCallArgs, U as pairOrphanedToolCalls, V as hasOpenAIReasoningItemId, W as sanitizeOrphanedToolPairs, X as getResponseProviderItemKeys, Y as getResponseProviderItemKey, f as coreContentToString, j as AIV6Adapter, k as CacheKeyGenerator, n as MessageList, o as MessageStateManager, p as messagesAreEqual, q as getResponseProviderItemId, t as convertMessages, u as MessageMerger, z as getOpenAIReasoningItemId } from "../../message-list-
|
|
1
|
+
import { B as getResponseProviderItemIdFromPart, F as AIV4Adapter, H as hasResponseProviderItemId, I as dropCrossProviderExecutedParts, J as getResponseProviderItemIds, L as ensureAnthropicCompatibleMessages, M as AIV5Adapter, Q as TypeDetector, R as findToolCallArgs, U as pairOrphanedToolCalls, V as hasOpenAIReasoningItemId, W as sanitizeOrphanedToolPairs, X as getResponseProviderItemKeys, Y as getResponseProviderItemKey, f as coreContentToString, j as AIV6Adapter, k as CacheKeyGenerator, n as MessageList, o as MessageStateManager, p as messagesAreEqual, q as getResponseProviderItemId, t as convertMessages, u as MessageMerger, z as getOpenAIReasoningItemId } from "../../message-list-wI71UGxk.js";
|
|
2
2
|
import { n as aiV5ModelMessageToV2PromptMessage, t as aiV4CoreMessageToV1PromptMessage } from "../../to-prompt-BsDtVXrf.js";
|
|
3
3
|
export { AIV4Adapter, AIV5Adapter, AIV6Adapter, CacheKeyGenerator, MessageList, MessageMerger, MessageStateManager, TypeDetector, aiV4CoreMessageToV1PromptMessage, aiV5ModelMessageToV2PromptMessage, convertMessages, coreContentToString, dropCrossProviderExecutedParts, ensureAnthropicCompatibleMessages, findToolCallArgs, getOpenAIReasoningItemId, getResponseProviderItemId, getResponseProviderItemIdFromPart, getResponseProviderItemIds, getResponseProviderItemKey, getResponseProviderItemKeys, hasOpenAIReasoningItemId, hasResponseProviderItemId, messagesAreEqual, pairOrphanedToolCalls, sanitizeOrphanedToolPairs };
|
|
@@ -27,9 +27,10 @@ export declare function snapshotRequestContextEntries(requestContext: RequestCon
|
|
|
27
27
|
* already rebuilt in the step's scope — falling back to it is what keeps
|
|
28
28
|
* request-scoped resolution (tenant/user, workspace, dynamic model/memory)
|
|
29
29
|
* working for tools rebuilt on a cross-process worker, including a delegated
|
|
30
|
-
* subagent's.
|
|
30
|
+
* subagent's. Pass `liveRunContext` only for the same run's original context,
|
|
31
|
+
* not an engine-rebuilt context or another caller's context.
|
|
31
32
|
*/
|
|
32
|
-
export declare function restoreRequestContext(entries?: Record<string, unknown>, runLevel?: RequestContext): RequestContext;
|
|
33
|
+
export declare function restoreRequestContext(entries?: Record<string, unknown>, runLevel?: RequestContext, liveRunContext?: RequestContext): RequestContext;
|
|
33
34
|
/** The token and user entries that `withoutLiveRequestKeys` drops, read from the live context. */
|
|
34
35
|
export declare function liveRequestEntries(runLevel?: RequestContext): [string, unknown][];
|
|
35
36
|
//# sourceMappingURL=request-context-snapshot.d.ts.map
|
|
@@ -43,7 +43,15 @@ export interface AgentRunRecordTarget {
|
|
|
43
43
|
resourceId?: string;
|
|
44
44
|
threadId?: string;
|
|
45
45
|
}
|
|
46
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Lifetime of a running or suspended run's record. Deliberately much longer
|
|
48
|
+
* than the stream log's retention: the record is a single small key, and it is
|
|
49
|
+
* what lets any replica authorize `observe()`/abort/resume on a run parked
|
|
50
|
+
* overnight on a tool approval — long after its replay log expired (the log
|
|
51
|
+
* is recreated with later indices and observers resync; see
|
|
52
|
+
* `MastraServerCache.listPushIndexed`). A finished run's record is deleted by
|
|
53
|
+
* run cleanup; this lifetime bounds it when cleanup never runs.
|
|
54
|
+
*/
|
|
47
55
|
export declare const AGENT_RUN_RECORD_TTL_MS: number;
|
|
48
56
|
export declare const agentRunRecordKey: (agentId: string, runId: string) => string;
|
|
49
57
|
export declare function writeAgentRunRecord(cache: MastraServerCache, record: AgentRunRecord, key?: string): Promise<void>;
|
|
@@ -146,7 +146,7 @@ export declare class AgentThreadStreamRuntime {
|
|
|
146
146
|
*/
|
|
147
147
|
isRunHoldingThreadLease(pubsub: PubSub | undefined, runId: string, threadId: string, resourceId?: string): Promise<boolean>;
|
|
148
148
|
/** @internal Qualify a shared thread lease before dispatching this execution. */
|
|
149
|
-
claimDurableThreadLease(pubsub: PubSub, runId: string, threadId: string, resourceId: string | undefined, generation: number | undefined, executionId?: string): Promise<void>;
|
|
149
|
+
claimDurableThreadLease(pubsub: PubSub, runId: string, threadId: string, resourceId: string | undefined, generation: number | undefined, executionId?: string, workerFenced?: boolean): Promise<void>;
|
|
150
150
|
/** @internal Renew only the captured execution's thread lease; never acquire or transfer it. */
|
|
151
151
|
renewDurableThreadLease(pubsub: PubSub, runId: string, threadId: string, resourceId?: string, generation?: number, executionId?: string): Promise<boolean>;
|
|
152
152
|
/**
|
|
@@ -155,6 +155,8 @@ export declare class AgentThreadStreamRuntime {
|
|
|
155
155
|
* (e.g. restarting) otherwise fences every redelivery of the run forever. Never takes a lease another owner holds.
|
|
156
156
|
*/
|
|
157
157
|
reclaimDurableThreadLease(pubsub: PubSub, runId: string, threadId: string, resourceId?: string, generation?: number, executionId?: string): Promise<boolean>;
|
|
158
|
+
/** @internal Missing ownership is not evidence that another run took the thread. */
|
|
159
|
+
isDurableThreadLeaseHeldByAnotherRun(pubsub: PubSub, runId: string, threadId: string, resourceId?: string): Promise<boolean>;
|
|
158
160
|
/** @internal Whether `error` from the thread lease backend means it is refusing every client, not just this one. */
|
|
159
161
|
isThreadLeaseBackendUnavailableToAll(pubsub: PubSub, error: unknown): boolean;
|
|
160
162
|
/** @internal Release only the terminal execution's thread lease, never a recovered successor's. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_provider_registry = require("../../provider-registry-
|
|
2
|
+
const require_provider_registry = require("../../provider-registry-a649fS5r.cjs");
|
|
3
3
|
// src/agent-builder/ee/types.ts
|
|
4
4
|
/**
|
|
5
5
|
* Default-on values for {@link AgentFeatures}. `browser` is defaulted
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getRegisteredProviders, o as isProviderRegistered, u as parseModelString } from "../../provider-registry-
|
|
1
|
+
import { a as getRegisteredProviders, o as isProviderRegistered, u as parseModelString } from "../../provider-registry-DWixjFX7.js";
|
|
2
2
|
// src/agent-builder/ee/types.ts
|
|
3
3
|
/**
|
|
4
4
|
* Default-on values for {@link AgentFeatures}. `browser` is defaulted
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_state_processor = require("../state-processor-kRNZ38Nf.cjs");
|
|
3
3
|
const require_tools = require("../tools-CGF5Ik6j.cjs");
|
|
4
|
-
const require_agent_controller = require("../agent-controller-
|
|
4
|
+
const require_agent_controller = require("../agent-controller-BTIxiD1u.cjs");
|
|
5
5
|
exports.AgentController = require_agent_controller.AgentController;
|
|
6
6
|
exports.MODEL_PERSISTENCE_VERSION = require_agent_controller.MODEL_PERSISTENCE_VERSION;
|
|
7
7
|
exports.MODEL_PERSISTENCE_VERSION_KEY = require_agent_controller.MODEL_PERSISTENCE_VERSION_KEY;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { f as taskCheckTool, h as taskWriteTool, m as taskUpdateTool, o as assignTaskIds, p as taskCompleteTool } from "../state-processor-B9kxpM53.js";
|
|
2
2
|
import { s as askUserTool, t as submitPlanTool } from "../tools-CDfyMpzN.js";
|
|
3
|
-
import { a as Session, c as defaultDisplayState, d as SessionStartupCancelledError, f as isSessionNotStartedError, i as MODEL_PERSISTENCE_VERSION_KEY, l as defaultOMProgressState, n as parseSubagentMeta, o as getSuspensionAddressKey, p as isSessionStartupCancelledError, r as MODEL_PERSISTENCE_VERSION, s as migratePersistedModelSelection, t as AgentController, u as SessionNotStartedError } from "../agent-controller-
|
|
3
|
+
import { a as Session, c as defaultDisplayState, d as SessionStartupCancelledError, f as isSessionNotStartedError, i as MODEL_PERSISTENCE_VERSION_KEY, l as defaultOMProgressState, n as parseSubagentMeta, o as getSuspensionAddressKey, p as isSessionStartupCancelledError, r as MODEL_PERSISTENCE_VERSION, s as migratePersistedModelSelection, t as AgentController, u as SessionNotStartedError } from "../agent-controller-C1bK0CXm.js";
|
|
4
4
|
export { AgentController, MODEL_PERSISTENCE_VERSION, MODEL_PERSISTENCE_VERSION_KEY, Session, SessionNotStartedError, SessionStartupCancelledError, askUserTool, assignTaskIds, defaultDisplayState, defaultOMProgressState, getSuspensionAddressKey, isSessionNotStartedError, isSessionStartupCancelledError, migratePersistedModelSelection, parseSubagentMeta, submitPlanTool, taskCheckTool, taskCompleteTool, taskUpdateTool, taskWriteTool };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Agent } from '../agent/index.js';
|
|
2
2
|
import type { SpanChunk } from '../agent/message-list/message-part-spans.js';
|
|
3
3
|
import { MessagePartSpans } from '../agent/message-list/message-part-spans.js';
|
|
4
|
-
import type { MastraDBMessage } from '../agent/message-list/state/types.js';
|
|
4
|
+
import type { MastraDBMessage, MastraMessagePart } from '../agent/message-list/state/types.js';
|
|
5
5
|
import type { AgentThreadSubscription } from '../agent/types.js';
|
|
6
6
|
import type { RequestContext } from '../request-context/index.js';
|
|
7
7
|
import type { Session, SessionMachinery } from './session.js';
|
|
@@ -20,7 +20,7 @@ type StreamDataChunk<TType extends `data-${string}`> = StreamChunkBase<TType> &
|
|
|
20
20
|
data?: unknown;
|
|
21
21
|
};
|
|
22
22
|
type StreamIgnoredChunk = StreamPayloadChunk<'start'> | StreamPayloadChunk<'thread-history'> | StreamPayloadChunk<'abort'> | StreamPayloadChunk<'response-metadata'> | StreamPayloadChunk<'reasoning-signature'> | StreamPayloadChunk<'source'> | StreamPayloadChunk<'file'> | StreamPayloadChunk<'reasoning-file'> | StreamPayloadChunk<'custom'> | StreamPayloadChunk<'raw'> | StreamPayloadChunk<'step-start'> | StreamPayloadChunk<'tool-output'> | StreamPayloadChunk<'tool-call-resumed'> | StreamPayloadChunk<'step-output'> | StreamPayloadChunk<'watch'> | StreamPayloadChunk<'background-task-started'> | StreamPayloadChunk<'background-task-completed'> | StreamPayloadChunk<'background-task-failed'> | StreamPayloadChunk<'background-task-progress'> | StreamPayloadChunk<'background-task-running'> | StreamPayloadChunk<'background-task-cancelled'> | StreamPayloadChunk<'background-task-output'> | StreamPayloadChunk<'background-task-suspended'> | StreamPayloadChunk<'background-task-resumed'> | StreamObjectChunk<'object'> | StreamObjectChunk<'object-result'>;
|
|
23
|
-
type StreamChunk = StreamIgnoredChunk | SpanChunk | StreamPayloadChunk<'tool-call-input-streaming-start'> | StreamPayloadChunk<'tool-call-delta'> | StreamPayloadChunk<'tool-call-input-streaming-end'> | StreamPayloadChunk<'tool-call'> | StreamPayloadChunk<'tool-result'> | StreamPayloadChunk<'tool-error'> | StreamPayloadChunk<'tool-output-denied'> | StreamPayloadChunk<'tool-call-approval'> | StreamPayloadChunk<'tool-call-suspended'> | StreamPayloadChunk<'error'> | StreamPayloadChunk<'tripwire'> | StreamPayloadChunk<'step-finish'> | StreamPayloadChunk<'finish'> | StreamPayloadChunk<'goal'> | StreamPayloadChunk<'is-task-complete'> | StreamDataChunk<'data-om-status'> | StreamDataChunk<'data-om-observation-start'> | StreamDataChunk<'data-om-observation-end'> | StreamDataChunk<'data-om-observation-failed'> | StreamDataChunk<'data-om-buffering-start'> | StreamDataChunk<'data-om-buffering-end'> | StreamDataChunk<'data-om-buffering-failed'> | StreamDataChunk<'data-signal'> | StreamDataChunk<'data-user-message'> | StreamDataChunk<'data-system-reminder'> | StreamDataChunk<'data-om-activation'> | StreamDataChunk<'data-om-thread-update'> | StreamDataChunk<'data-mastracode-tool-progress'> | StreamDataChunk<'data-sandbox-stdout'> | StreamDataChunk<'data-sandbox-stderr'> | StreamDataChunk<'data-sandbox-exit'>;
|
|
23
|
+
type StreamChunk = StreamIgnoredChunk | SpanChunk | StreamPayloadChunk<'tool-call-input-streaming-start'> | StreamPayloadChunk<'tool-call-delta'> | StreamPayloadChunk<'tool-call-input-streaming-end'> | StreamPayloadChunk<'tool-call'> | StreamPayloadChunk<'tool-result'> | StreamPayloadChunk<'tool-error'> | StreamPayloadChunk<'tool-output-denied'> | StreamPayloadChunk<'tool-call-approval'> | StreamPayloadChunk<'tool-call-suspended'> | StreamPayloadChunk<'error'> | StreamPayloadChunk<'tripwire'> | StreamPayloadChunk<'step-finish'> | StreamPayloadChunk<'finish'> | StreamPayloadChunk<'goal'> | StreamPayloadChunk<'is-task-complete'> | StreamDataChunk<'data-om-status'> | StreamDataChunk<'data-om-observation-start'> | StreamDataChunk<'data-om-observation-end'> | StreamDataChunk<'data-om-observation-failed'> | StreamDataChunk<'data-om-buffering-start'> | StreamDataChunk<'data-om-buffering-end'> | StreamDataChunk<'data-om-buffering-failed'> | StreamDataChunk<'data-signal'> | StreamDataChunk<'data-user-message'> | StreamDataChunk<'data-system-reminder'> | StreamDataChunk<'data-om-activation'> | StreamDataChunk<'data-om-thread-update'> | StreamDataChunk<'data-mastracode-tool-progress'> | StreamDataChunk<'data-mastracode-model-fallback'> | StreamDataChunk<'data-sandbox-stdout'> | StreamDataChunk<'data-sandbox-stderr'> | StreamDataChunk<'data-sandbox-exit'>;
|
|
24
24
|
type StreamState = {
|
|
25
25
|
resourceId: string;
|
|
26
26
|
threadId?: string;
|
|
@@ -36,6 +36,8 @@ type StreamState = {
|
|
|
36
36
|
/** Response ids offered by `step-start` — an id binds to at most one display message. */
|
|
37
37
|
offeredResponseIds: Set<string>;
|
|
38
38
|
completedToolPrelude: boolean;
|
|
39
|
+
/** Model-fallback parts saved under the next response's id, held until its `step-start` binds that id. */
|
|
40
|
+
pendingModelFallbackParts: MastraMessagePart[];
|
|
39
41
|
/**
|
|
40
42
|
* Set when a stream ends on a non-success finish reason (e.g. `content-filter`,
|
|
41
43
|
* `error`, `length`). Carries the user-facing message so the run finalizes
|
|
@@ -78,6 +80,7 @@ export declare class SessionRunEngine {
|
|
|
78
80
|
private emitInitialPart;
|
|
79
81
|
private finishCurrentMessage;
|
|
80
82
|
private finishCurrentMessageAndRotate;
|
|
83
|
+
private emitPendingModelFallbacks;
|
|
81
84
|
createStreamState(threadId?: string | undefined, resourceId?: string): StreamState;
|
|
82
85
|
/**
|
|
83
86
|
* Fold a `tool-result`/`tool-error` chunk into the invocation part and
|
|
@@ -1930,6 +1930,8 @@ export declare class Session<TState = unknown> {
|
|
|
1930
1930
|
role?: 'user' | 'assistant' | 'system';
|
|
1931
1931
|
metadata?: Record<string, unknown>;
|
|
1932
1932
|
}): Promise<MastraDBMessage | null>;
|
|
1933
|
+
/** @internal Keep the owning agent with the parked call after its execution scope is released. */
|
|
1934
|
+
__registerStreamSuspension(suspension: PendingSuspension, agent?: Agent): void;
|
|
1933
1935
|
/** @internal Capture the trusted owner snapshot while processing a run's stream. */
|
|
1934
1936
|
__captureRunThreadOwnerId(runId: string, requestContext: RequestContext): void;
|
|
1935
1937
|
/**
|
|
@@ -290,6 +290,29 @@ export interface AgentControllerConfig<TState = {}> {
|
|
|
290
290
|
* via each gateway's `resolveAuth()` / env-var configuration.
|
|
291
291
|
*/
|
|
292
292
|
gateways?: MastraModelGatewayInterface[];
|
|
293
|
+
/**
|
|
294
|
+
* Whether the model catalog and auth checks also consult the router's
|
|
295
|
+
* default gateways, which read provider credentials from the process
|
|
296
|
+
* environment. Set to `false` when only `gateways` may be used.
|
|
297
|
+
* @default true
|
|
298
|
+
*/
|
|
299
|
+
includeDefaultGateways?: boolean;
|
|
300
|
+
/**
|
|
301
|
+
* Whether runs add automatic provider-side fallback models for the selected
|
|
302
|
+
* model, such as retrying a blocked `claude-fable-5` turn on
|
|
303
|
+
* `claude-opus-4-8`. Set to `false` when only the agent's own model may run.
|
|
304
|
+
* @default true
|
|
305
|
+
*/
|
|
306
|
+
modelFallbacks?: boolean;
|
|
307
|
+
/**
|
|
308
|
+
* Whether backing agents are registered on the controller's Mastra, which
|
|
309
|
+
* lists them in `listAgents()` and lets the generic `/agents` server routes
|
|
310
|
+
* run them outside the controller. Set to `false` so they only run through
|
|
311
|
+
* this controller. Unregistered agents don't take the Mastra instance's
|
|
312
|
+
* `durable` defaults, and deferred notification delivery can't resolve them.
|
|
313
|
+
* @default true
|
|
314
|
+
*/
|
|
315
|
+
registerAgents?: boolean;
|
|
293
316
|
/**
|
|
294
317
|
* Observational Memory configuration defaults.
|
|
295
318
|
* The AgentController auto-manages OM state (model IDs, thresholds) internally
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const require_run_registry = require("./run-registry-
|
|
2
|
-
const require_message_list = require("./message-list-
|
|
1
|
+
const require_run_registry = require("./run-registry-oUNF6szW.cjs");
|
|
2
|
+
const require_message_list = require("./message-list-DfN9mWeN.cjs");
|
|
3
3
|
const require_signals = require("./signals-CWxAMEmE.cjs");
|
|
4
4
|
const require_ee_iTj2bRDt = require("./ee-iTj2bRDt-D3-QLGDF.cjs");
|
|
5
|
-
const require_channels = require("./channels-
|
|
6
|
-
const require_llm = require("./llm-
|
|
7
|
-
const require_mastra = require("./mastra-
|
|
8
|
-
const require_stream = require("./stream-
|
|
5
|
+
const require_channels = require("./channels-Cl-pRrWB.cjs");
|
|
6
|
+
const require_llm = require("./llm-BKxlS9Kk.cjs");
|
|
7
|
+
const require_mastra = require("./mastra-C7Tj4U8c.cjs");
|
|
8
|
+
const require_stream = require("./stream-DQC1vpvl.cjs");
|
|
9
9
|
const require_request_context = require("./request-context-D9RXYCy8.cjs");
|
|
10
10
|
const require_dynamic_argument = require("./dynamic-argument-CUc1BBOS.cjs");
|
|
11
11
|
const require_error = require("./error-D90lJ6M7.cjs");
|
|
12
12
|
const require_utils_safe_stringify = require("./utils/safe-stringify.cjs");
|
|
13
13
|
const require_workspace = require("./workspace-X2RHJZU9.cjs");
|
|
14
|
-
const require_output_helpers = require("./output-helpers-
|
|
14
|
+
const require_output_helpers = require("./output-helpers-DgsH4aTb.cjs");
|
|
15
15
|
const require_payload_transform = require("./payload-transform-CWgnsO9w.cjs");
|
|
16
16
|
const require_tools = require("./tools-CGF5Ik6j.cjs");
|
|
17
17
|
const require_tool = require("./tool-CYlT2UA-.cjs");
|
|
@@ -585,6 +585,12 @@ var SessionRunEngine = class {
|
|
|
585
585
|
state.toolPartById.clear();
|
|
586
586
|
state.completedToolPrelude = false;
|
|
587
587
|
}
|
|
588
|
+
emitPendingModelFallbacks(state) {
|
|
589
|
+
for (const part of state.pendingModelFallbackParts.splice(0)) {
|
|
590
|
+
const index = state.currentMessage.content.parts.push(part) - 1;
|
|
591
|
+
this.emitMessagePart(state, index);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
588
594
|
createStreamState(threadId = this.#session.thread.getId() ?? void 0, resourceId = this.#session.identity.getResourceId()) {
|
|
589
595
|
return {
|
|
590
596
|
resourceId,
|
|
@@ -598,7 +604,8 @@ var SessionRunEngine = class {
|
|
|
598
604
|
messageIdObserved: false,
|
|
599
605
|
toolPartById: /* @__PURE__ */ new Map(),
|
|
600
606
|
offeredResponseIds: /* @__PURE__ */ new Set(),
|
|
601
|
-
completedToolPrelude: false
|
|
607
|
+
completedToolPrelude: false,
|
|
608
|
+
pendingModelFallbackParts: []
|
|
602
609
|
};
|
|
603
610
|
}
|
|
604
611
|
/**
|
|
@@ -795,7 +802,10 @@ var SessionRunEngine = class {
|
|
|
795
802
|
const messageId = getString(payload.messageId);
|
|
796
803
|
if (!messageId) break;
|
|
797
804
|
if (state.offeredResponseIds.has(messageId)) {
|
|
798
|
-
if (messageId === state.currentMessage.id)
|
|
805
|
+
if (messageId === state.currentMessage.id) {
|
|
806
|
+
this.stampResponseModel(state.currentMessage, payload);
|
|
807
|
+
this.emitPendingModelFallbacks(state);
|
|
808
|
+
}
|
|
799
809
|
break;
|
|
800
810
|
}
|
|
801
811
|
if (state.offeredResponseIds.size > 0 || state.completedToolPrelude && state.currentMessage.content.parts.every((part) => part.type === "tool-invocation" && part.toolInvocation.state === "result")) this.finishCurrentMessageAndRotate(state);
|
|
@@ -803,6 +813,7 @@ var SessionRunEngine = class {
|
|
|
803
813
|
state.offeredResponseIds.add(messageId);
|
|
804
814
|
if (!this.isCurrentMessageObserved(state)) state.currentMessage.id = messageId;
|
|
805
815
|
this.stampResponseModel(state.currentMessage, payload);
|
|
816
|
+
if (state.currentMessage.id === messageId) this.emitPendingModelFallbacks(state);
|
|
806
817
|
break;
|
|
807
818
|
}
|
|
808
819
|
case "tool-call-input-streaming-start": {
|
|
@@ -1124,13 +1135,13 @@ var SessionRunEngine = class {
|
|
|
1124
1135
|
threadId: suspThreadId,
|
|
1125
1136
|
resourceId: suspResourceId
|
|
1126
1137
|
});
|
|
1127
|
-
this.#session.
|
|
1138
|
+
this.#session.__registerStreamSuspension({
|
|
1128
1139
|
toolCallId: suspToolCallId,
|
|
1129
1140
|
runId: suspRunId,
|
|
1130
1141
|
toolName: suspToolName,
|
|
1131
1142
|
threadId: suspThreadId,
|
|
1132
1143
|
resourceId: suspResourceId
|
|
1133
|
-
});
|
|
1144
|
+
}, runScope?.get(SUSPENDED_RUN_AGENT_KEY));
|
|
1134
1145
|
}
|
|
1135
1146
|
}
|
|
1136
1147
|
state.isSuspended = true;
|
|
@@ -1501,6 +1512,12 @@ var SessionRunEngine = class {
|
|
|
1501
1512
|
}
|
|
1502
1513
|
break;
|
|
1503
1514
|
}
|
|
1515
|
+
case "data-mastracode-model-fallback":
|
|
1516
|
+
state.pendingModelFallbackParts.push({
|
|
1517
|
+
type: chunk.type,
|
|
1518
|
+
data: chunk.data
|
|
1519
|
+
});
|
|
1520
|
+
break;
|
|
1504
1521
|
case "data-sandbox-stdout": {
|
|
1505
1522
|
const d = getDataRecord(chunk);
|
|
1506
1523
|
const output = getString(d?.output);
|
|
@@ -6234,6 +6251,13 @@ var Session = class {
|
|
|
6234
6251
|
#claimedToolResponses = /* @__PURE__ */ new Set();
|
|
6235
6252
|
#suspensionAgents = /* @__PURE__ */ new WeakMap();
|
|
6236
6253
|
#threadOwnerIdsByRunId = /* @__PURE__ */ new Map();
|
|
6254
|
+
/** @internal Keep the owning agent with the parked call after its execution scope is released. */
|
|
6255
|
+
__registerStreamSuspension(suspension, agent) {
|
|
6256
|
+
const previous = this.suspensions.get(suspension);
|
|
6257
|
+
const owner = (previous && this.#suspensionAgents.get(previous)) ?? agent;
|
|
6258
|
+
this.suspensions.register(suspension);
|
|
6259
|
+
if (owner) this.#suspensionAgents.set(this.suspensions.get(suspension), owner);
|
|
6260
|
+
}
|
|
6237
6261
|
/** @internal Capture the trusted owner snapshot while processing a run's stream. */
|
|
6238
6262
|
__captureRunThreadOwnerId(runId, requestContext) {
|
|
6239
6263
|
const threadOwnerId = requestContext.getRaw(THREAD_OWNER_ID_CONTEXT_KEY);
|
|
@@ -7656,7 +7680,7 @@ var AgentController = class {
|
|
|
7656
7680
|
this.#channels = new require_channels.AgentControllerChannels(config.channels);
|
|
7657
7681
|
this.#channels.__setController(this);
|
|
7658
7682
|
}
|
|
7659
|
-
this.#gatewayManager = new require_llm.GatewayManager([...config.gateways ?? [], ...require_llm.defaultGateways]);
|
|
7683
|
+
this.#gatewayManager = new require_llm.GatewayManager([...config.gateways ?? [], ...config.includeDefaultGateways === false ? [] : require_llm.defaultGateways]);
|
|
7660
7684
|
const remoteGateways = new Set(require_llm.defaultGateways);
|
|
7661
7685
|
this.#modelCatalog = new ModelCatalogCache(this.#gatewayManager, (gateway) => remoteGateways.has(gateway));
|
|
7662
7686
|
const defaultMode = config.defaultModeId ? config.modes.find((mode) => mode.id === config.defaultModeId) : config.modes.find((mode) => mode.default || mode.metadata?.default === true) ?? config.modes[0];
|
|
@@ -8713,7 +8737,13 @@ var AgentController = class {
|
|
|
8713
8737
|
const mastra = this.getMastra();
|
|
8714
8738
|
if (mastra && agent.getMastraInstance() !== mastra) {
|
|
8715
8739
|
if (this.#applicationPubSub && !agent.hasOwnPubSub()) agent.__setPubSub(mastra === this.#internalMastra ? this.#applicationPubSub : mastra.pubsub);
|
|
8716
|
-
if (
|
|
8740
|
+
if (this.config.registerAgents === false) {
|
|
8741
|
+
agent.__registerPrimitives({
|
|
8742
|
+
logger: mastra.getLogger(),
|
|
8743
|
+
storage: mastra.getStorage()
|
|
8744
|
+
});
|
|
8745
|
+
agent.__registerMastra(mastra);
|
|
8746
|
+
} else if (!mastra.listAgents()[agent.id]) mastra.addAgent(agent);
|
|
8717
8747
|
}
|
|
8718
8748
|
if (this.workspace && typeof agent.hasOwnWorkspace === "function" && !agent.hasOwnWorkspace()) agent.__setWorkspace(this.workspace);
|
|
8719
8749
|
if (this.browser && typeof agent.hasOwnBrowser === "function" && !agent.hasOwnBrowser() && typeof this.browser !== "function") agent.setBrowser(this.browser);
|
|
@@ -9120,7 +9150,7 @@ var AgentController = class {
|
|
|
9120
9150
|
toolCallConcurrency: { strategy: "called" },
|
|
9121
9151
|
onStepFinish: this.createUsageRecorder(context?.threadId ?? session.thread.getId())
|
|
9122
9152
|
};
|
|
9123
|
-
const fableFallback = buildFableFallbackProviderOptions(context?.session.modelId ?? session.model.get());
|
|
9153
|
+
const fableFallback = this.config.modelFallbacks === false ? void 0 : buildFableFallbackProviderOptions(context?.session.modelId ?? session.model.get());
|
|
9124
9154
|
if (fableFallback) shared.providerOptions = { anthropic: { ...fableFallback.anthropic } };
|
|
9125
9155
|
return shared;
|
|
9126
9156
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as MessageList } from "./message-list-
|
|
1
|
+
import { Ma as validateStorageMetadataFilter, P as Agent, Q as isSpanChunk, Rt as getServerSideFallbackInfo, Z as MessagePartSpans, _ as describeNonSuccessFinishReason, g as AGENTIC_LOOP_WORKFLOW_ID, h as AGENTIC_EXECUTION_WORKFLOW_ID, lc as DurableStepIds, m as agentThreadStreamRuntime, oi as InMemoryMemory, p as AgentThreadLeaseLostError, zn as CHAT_CHANNEL_RENDER_CONTEXT_KEY } from "./run-registry-D3X7XvUL.js";
|
|
2
|
+
import { n as MessageList } from "./message-list-wI71UGxk.js";
|
|
3
3
|
import { c as isUserAuthoredMessage, n as createSignal, u as resolveDeliveryAttributes } from "./signals-CqR_iWkg.js";
|
|
4
4
|
import { i as MastraFGAPermissions } from "./ee-iTj2bRDt-By_B9ngH.js";
|
|
5
|
-
import {
|
|
6
|
-
import { a as ModelRouterLanguageModel, l as defaultGateways, s as GatewayManager } from "./llm-
|
|
7
|
-
import { t as Mastra } from "./mastra-
|
|
8
|
-
import { Kt as TITLE_PINNED_THREAD_METADATA_KEY, Mn as createRunScopeKey } from "./stream-
|
|
5
|
+
import { a as AgentControllerChannels } from "./channels-DegTNzaq.js";
|
|
6
|
+
import { a as ModelRouterLanguageModel, l as defaultGateways, s as GatewayManager } from "./llm-CMkzIFAk.js";
|
|
7
|
+
import { t as Mastra } from "./mastra-5EEmN3Ok.js";
|
|
8
|
+
import { Kt as TITLE_PINNED_THREAD_METADATA_KEY, Mn as createRunScopeKey } from "./stream-DoZ6F41o.js";
|
|
9
9
|
import { c as MASTRA_THREAD_ID_KEY, i as MASTRA_MESSAGE_AUTHOR_KEY, o as MASTRA_RESOURCE_ID_KEY, u as RequestContext } from "./request-context-COnZHt2-.js";
|
|
10
10
|
import { n as resolveDynamicArgument } from "./dynamic-argument-BzPK3qPN.js";
|
|
11
11
|
import { i as MastraError, o as getErrorFromUnknown } from "./error-oh2DLsP2.js";
|
|
12
12
|
import { toStandardSchema } from "./schema/index.js";
|
|
13
13
|
import { safeStringify } from "./utils/safe-stringify.js";
|
|
14
14
|
import { o as Workspace, p as createWorkspaceTools } from "./workspace-DY2Nxiyi.js";
|
|
15
|
-
import {
|
|
15
|
+
import { x as isLeaseProvider } from "./output-helpers-CVzhy1Y0.js";
|
|
16
16
|
import { n as hasTransformedToolPayload, t as getTransformedToolPayload } from "./payload-transform-Dj3HUeD4.js";
|
|
17
17
|
import { s as askUserTool, t as submitPlanTool } from "./tools-CDfyMpzN.js";
|
|
18
18
|
import { r as createTool, s as isValidationError } from "./tool-Z3bykc1m.js";
|
|
@@ -585,6 +585,12 @@ var SessionRunEngine = class {
|
|
|
585
585
|
state.toolPartById.clear();
|
|
586
586
|
state.completedToolPrelude = false;
|
|
587
587
|
}
|
|
588
|
+
emitPendingModelFallbacks(state) {
|
|
589
|
+
for (const part of state.pendingModelFallbackParts.splice(0)) {
|
|
590
|
+
const index = state.currentMessage.content.parts.push(part) - 1;
|
|
591
|
+
this.emitMessagePart(state, index);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
588
594
|
createStreamState(threadId = this.#session.thread.getId() ?? void 0, resourceId = this.#session.identity.getResourceId()) {
|
|
589
595
|
return {
|
|
590
596
|
resourceId,
|
|
@@ -598,7 +604,8 @@ var SessionRunEngine = class {
|
|
|
598
604
|
messageIdObserved: false,
|
|
599
605
|
toolPartById: /* @__PURE__ */ new Map(),
|
|
600
606
|
offeredResponseIds: /* @__PURE__ */ new Set(),
|
|
601
|
-
completedToolPrelude: false
|
|
607
|
+
completedToolPrelude: false,
|
|
608
|
+
pendingModelFallbackParts: []
|
|
602
609
|
};
|
|
603
610
|
}
|
|
604
611
|
/**
|
|
@@ -795,7 +802,10 @@ var SessionRunEngine = class {
|
|
|
795
802
|
const messageId = getString(payload.messageId);
|
|
796
803
|
if (!messageId) break;
|
|
797
804
|
if (state.offeredResponseIds.has(messageId)) {
|
|
798
|
-
if (messageId === state.currentMessage.id)
|
|
805
|
+
if (messageId === state.currentMessage.id) {
|
|
806
|
+
this.stampResponseModel(state.currentMessage, payload);
|
|
807
|
+
this.emitPendingModelFallbacks(state);
|
|
808
|
+
}
|
|
799
809
|
break;
|
|
800
810
|
}
|
|
801
811
|
if (state.offeredResponseIds.size > 0 || state.completedToolPrelude && state.currentMessage.content.parts.every((part) => part.type === "tool-invocation" && part.toolInvocation.state === "result")) this.finishCurrentMessageAndRotate(state);
|
|
@@ -803,6 +813,7 @@ var SessionRunEngine = class {
|
|
|
803
813
|
state.offeredResponseIds.add(messageId);
|
|
804
814
|
if (!this.isCurrentMessageObserved(state)) state.currentMessage.id = messageId;
|
|
805
815
|
this.stampResponseModel(state.currentMessage, payload);
|
|
816
|
+
if (state.currentMessage.id === messageId) this.emitPendingModelFallbacks(state);
|
|
806
817
|
break;
|
|
807
818
|
}
|
|
808
819
|
case "tool-call-input-streaming-start": {
|
|
@@ -1124,13 +1135,13 @@ var SessionRunEngine = class {
|
|
|
1124
1135
|
threadId: suspThreadId,
|
|
1125
1136
|
resourceId: suspResourceId
|
|
1126
1137
|
});
|
|
1127
|
-
this.#session.
|
|
1138
|
+
this.#session.__registerStreamSuspension({
|
|
1128
1139
|
toolCallId: suspToolCallId,
|
|
1129
1140
|
runId: suspRunId,
|
|
1130
1141
|
toolName: suspToolName,
|
|
1131
1142
|
threadId: suspThreadId,
|
|
1132
1143
|
resourceId: suspResourceId
|
|
1133
|
-
});
|
|
1144
|
+
}, runScope?.get(SUSPENDED_RUN_AGENT_KEY));
|
|
1134
1145
|
}
|
|
1135
1146
|
}
|
|
1136
1147
|
state.isSuspended = true;
|
|
@@ -1501,6 +1512,12 @@ var SessionRunEngine = class {
|
|
|
1501
1512
|
}
|
|
1502
1513
|
break;
|
|
1503
1514
|
}
|
|
1515
|
+
case "data-mastracode-model-fallback":
|
|
1516
|
+
state.pendingModelFallbackParts.push({
|
|
1517
|
+
type: chunk.type,
|
|
1518
|
+
data: chunk.data
|
|
1519
|
+
});
|
|
1520
|
+
break;
|
|
1504
1521
|
case "data-sandbox-stdout": {
|
|
1505
1522
|
const d = getDataRecord(chunk);
|
|
1506
1523
|
const output = getString(d?.output);
|
|
@@ -6234,6 +6251,13 @@ var Session = class {
|
|
|
6234
6251
|
#claimedToolResponses = /* @__PURE__ */ new Set();
|
|
6235
6252
|
#suspensionAgents = /* @__PURE__ */ new WeakMap();
|
|
6236
6253
|
#threadOwnerIdsByRunId = /* @__PURE__ */ new Map();
|
|
6254
|
+
/** @internal Keep the owning agent with the parked call after its execution scope is released. */
|
|
6255
|
+
__registerStreamSuspension(suspension, agent) {
|
|
6256
|
+
const previous = this.suspensions.get(suspension);
|
|
6257
|
+
const owner = (previous && this.#suspensionAgents.get(previous)) ?? agent;
|
|
6258
|
+
this.suspensions.register(suspension);
|
|
6259
|
+
if (owner) this.#suspensionAgents.set(this.suspensions.get(suspension), owner);
|
|
6260
|
+
}
|
|
6237
6261
|
/** @internal Capture the trusted owner snapshot while processing a run's stream. */
|
|
6238
6262
|
__captureRunThreadOwnerId(runId, requestContext) {
|
|
6239
6263
|
const threadOwnerId = requestContext.getRaw(THREAD_OWNER_ID_CONTEXT_KEY);
|
|
@@ -7656,7 +7680,7 @@ var AgentController = class {
|
|
|
7656
7680
|
this.#channels = new AgentControllerChannels(config.channels);
|
|
7657
7681
|
this.#channels.__setController(this);
|
|
7658
7682
|
}
|
|
7659
|
-
this.#gatewayManager = new GatewayManager([...config.gateways ?? [], ...defaultGateways]);
|
|
7683
|
+
this.#gatewayManager = new GatewayManager([...config.gateways ?? [], ...config.includeDefaultGateways === false ? [] : defaultGateways]);
|
|
7660
7684
|
const remoteGateways = new Set(defaultGateways);
|
|
7661
7685
|
this.#modelCatalog = new ModelCatalogCache(this.#gatewayManager, (gateway) => remoteGateways.has(gateway));
|
|
7662
7686
|
const defaultMode = config.defaultModeId ? config.modes.find((mode) => mode.id === config.defaultModeId) : config.modes.find((mode) => mode.default || mode.metadata?.default === true) ?? config.modes[0];
|
|
@@ -8713,7 +8737,13 @@ var AgentController = class {
|
|
|
8713
8737
|
const mastra = this.getMastra();
|
|
8714
8738
|
if (mastra && agent.getMastraInstance() !== mastra) {
|
|
8715
8739
|
if (this.#applicationPubSub && !agent.hasOwnPubSub()) agent.__setPubSub(mastra === this.#internalMastra ? this.#applicationPubSub : mastra.pubsub);
|
|
8716
|
-
if (
|
|
8740
|
+
if (this.config.registerAgents === false) {
|
|
8741
|
+
agent.__registerPrimitives({
|
|
8742
|
+
logger: mastra.getLogger(),
|
|
8743
|
+
storage: mastra.getStorage()
|
|
8744
|
+
});
|
|
8745
|
+
agent.__registerMastra(mastra);
|
|
8746
|
+
} else if (!mastra.listAgents()[agent.id]) mastra.addAgent(agent);
|
|
8717
8747
|
}
|
|
8718
8748
|
if (this.workspace && typeof agent.hasOwnWorkspace === "function" && !agent.hasOwnWorkspace()) agent.__setWorkspace(this.workspace);
|
|
8719
8749
|
if (this.browser && typeof agent.hasOwnBrowser === "function" && !agent.hasOwnBrowser() && typeof this.browser !== "function") agent.setBrowser(this.browser);
|
|
@@ -9120,7 +9150,7 @@ var AgentController = class {
|
|
|
9120
9150
|
toolCallConcurrency: { strategy: "called" },
|
|
9121
9151
|
onStepFinish: this.createUsageRecorder(context?.threadId ?? session.thread.getId())
|
|
9122
9152
|
};
|
|
9123
|
-
const fableFallback = buildFableFallbackProviderOptions(context?.session.modelId ?? session.model.get());
|
|
9153
|
+
const fableFallback = this.config.modelFallbacks === false ? void 0 : buildFableFallbackProviderOptions(context?.session.modelId ?? session.model.get());
|
|
9124
9154
|
if (fableFallback) shared.providerOptions = { anthropic: { ...fableFallback.anthropic } };
|
|
9125
9155
|
return shared;
|
|
9126
9156
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_background_tasks = require("../background-tasks-
|
|
2
|
+
const require_background_tasks = require("../background-tasks-CVl6e0Jo.cjs");
|
|
3
3
|
exports.BACKGROUND_TASK_WORKFLOW_ID = require_background_tasks.BACKGROUND_TASK_WORKFLOW_ID;
|
|
4
4
|
exports.BackgroundTaskManager = require_background_tasks.BackgroundTaskManager;
|
|
5
5
|
exports.backgroundOverrideJsonSchema = require_background_tasks.backgroundOverrideJsonSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as BACKGROUND_TASK_WORKFLOW_ID, s as BackgroundTaskManager, n as backgroundOverrideJsonSchema, r as backgroundOverrideZodSchema, o as createBackgroundTask, t as generateBackgroundTaskSystemPrompt, i as isToolBackgroundEligible, a as resolveBackgroundConfig } from "../background-tasks-
|
|
1
|
+
export { c as BACKGROUND_TASK_WORKFLOW_ID, s as BackgroundTaskManager, n as backgroundOverrideJsonSchema, r as backgroundOverrideZodSchema, o as createBackgroundTask, t as generateBackgroundTaskSystemPrompt, i as isToolBackgroundEligible, a as resolveBackgroundConfig } from "../background-tasks-BbVsBghi.js";
|
|
@@ -18,7 +18,9 @@ import type { BackgroundTask, BackgroundTaskManagerConfig, EnqueueOptions, Enque
|
|
|
18
18
|
* - Expiry and adoption: `recoverStaleTasks` only reclaims a `running` task
|
|
19
19
|
* once its lease has expired (or was released on shutdown), fenced on the
|
|
20
20
|
* owner/lease it read so one manager wins. It re-runs when the earliest live
|
|
21
|
-
* lease lapses
|
|
21
|
+
* lease lapses, and the periodic sweep in `#sweepLapsedPins` reclaims rows
|
|
22
|
+
* whose owner died later. `restart()` is the one deliberate takeover of a
|
|
23
|
+
* live lease.
|
|
22
24
|
* - Loss: a failed renewal aborts the local run's signal when another owner
|
|
23
25
|
* holds the task or it was cancelled.
|
|
24
26
|
*
|
|
@@ -54,6 +56,7 @@ export declare class BackgroundTaskManager {
|
|
|
54
56
|
private pinSweepInterval?;
|
|
55
57
|
private sweepingPins;
|
|
56
58
|
private pinSweepPage;
|
|
59
|
+
private runningSweepPage;
|
|
57
60
|
private workerCallback?;
|
|
58
61
|
private resultCallback?;
|
|
59
62
|
private shuttingDown;
|