@mastra/core 1.87.0 → 1.88.0-alpha.0
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_ai-v6@0.0.100/dist/index.d.ts +97 -2049
- package/dist/agent/agent.d.ts +10 -2
- package/dist/agent/durable/create-evented-agent.d.ts +2 -1
- package/dist/agent/durable/execution-engine.d.ts +4 -2
- package/dist/agent/durable/index.cjs +3 -2
- package/dist/agent/durable/index.js +3 -2
- package/dist/agent/durable/segment-spans.d.ts +7 -0
- package/dist/agent/durable/stored-signal-drain.d.ts +1 -1
- package/dist/agent/durable/types.d.ts +6 -0
- package/dist/agent/index.cjs +2 -2
- package/dist/agent/index.js +2 -2
- package/dist/agent/request-context-snapshot.d.ts +5 -0
- package/dist/agent/thread-stream-runtime.d.ts +26 -4
- 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-vUU_atR-.js → agent-controller-CQDCmsFD.js} +15 -9
- package/dist/{agent-controller-DckvJ7bq.cjs → agent-controller-NQKYmY0W.cjs} +15 -9
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/{background-tasks-HAzB0JtC.js → background-tasks-B7UygDdO.js} +1 -1
- package/dist/{background-tasks-By_1e9Gf.cjs → background-tasks-CeARf1DK.cjs} +1 -1
- package/dist/browser/index.cjs +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/{builder-CmtDqFLe.js → builder-CpAEmMdR.js} +2 -2
- package/dist/{builder-Dx8GMhFn.cjs → builder-Dmf04g9P.cjs} +2 -2
- package/dist/capabilities/302ai.json +196 -196
- package/dist/capabilities/abliteratedllm.json +33 -33
- package/dist/capabilities/abliteration-ai.json +9 -9
- package/dist/capabilities/above.json +13 -13
- package/dist/capabilities/adaption.json +7 -7
- package/dist/capabilities/adzuki.json +20 -20
- package/dist/capabilities/agentrouter.json +10 -10
- package/dist/capabilities/agnes.json +2 -2
- package/dist/capabilities/ai-router.json +6 -6
- package/dist/capabilities/aiand.json +27 -18
- package/dist/capabilities/aigrow.json +14 -14
- package/dist/capabilities/aimlapi.json +146 -146
- package/dist/capabilities/aipg.json +2 -2
- package/dist/capabilities/aixy.json +17 -17
- package/dist/capabilities/aki-io.json +14 -14
- package/dist/capabilities/alibaba-cn.json +94 -94
- package/dist/capabilities/alibaba-coding-plan-cn.json +5 -5
- package/dist/capabilities/alibaba-coding-plan.json +5 -5
- package/dist/capabilities/alibaba-token-plan-cn.json +50 -50
- package/dist/capabilities/alibaba-token-plan.json +53 -53
- package/dist/capabilities/alibaba.json +71 -71
- package/dist/capabilities/ambient.json +8 -8
- package/dist/capabilities/amd-tokenlab.json +4 -4
- package/dist/capabilities/amd.json +11 -11
- package/dist/capabilities/anthropic.json +36 -36
- package/dist/capabilities/anyapi.json +18 -18
- package/dist/capabilities/apiko.json +2 -2
- package/dist/capabilities/arcee.json +9 -9
- package/dist/capabilities/augure.json +5 -5
- package/dist/capabilities/auriko.json +23 -23
- package/dist/capabilities/bailing.json +5 -5
- package/dist/capabilities/baseten.json +47 -38
- package/dist/capabilities/bee.json +5 -5
- package/dist/capabilities/bothub.json +14 -14
- package/dist/capabilities/boundless.json +37 -37
- package/dist/capabilities/bumo.json +40 -40
- package/dist/capabilities/byteplus.json +22 -22
- package/dist/capabilities/cerebras.json +4 -4
- package/dist/capabilities/cheapaimodel.json +10 -10
- package/dist/capabilities/cheapest-token.json +25 -25
- package/dist/capabilities/chutes.json +34 -32
- package/dist/capabilities/cline-pass.json +29 -29
- package/dist/capabilities/cloudcode.json +7 -7
- package/dist/capabilities/cloudflare-workers-ai.json +15 -15
- package/dist/capabilities/commandcode.json +146 -146
- package/dist/capabilities/concentrate.json +286 -277
- package/dist/capabilities/cortecs.json +109 -109
- package/dist/capabilities/crossmodel.json +194 -194
- package/dist/capabilities/crusoe.json +13 -13
- package/dist/capabilities/daoxe.json +7 -7
- package/dist/capabilities/databricks.json +128 -120
- package/dist/capabilities/deepinfra.json +102 -102
- package/dist/capabilities/deepseek.json +4 -4
- package/dist/capabilities/digitalocean.json +113 -114
- package/dist/capabilities/dothoosh.json +29 -29
- package/dist/capabilities/doubleword.json +26 -26
- package/dist/capabilities/edenai.json +287 -278
- package/dist/capabilities/empiriolabs.json +169 -169
- package/dist/capabilities/engy.json +24 -18
- package/dist/capabilities/entrim.json +6 -6
- package/dist/capabilities/evroc.json +13 -13
- package/dist/capabilities/ezkielyna.json +9 -9
- package/dist/capabilities/fastrouter.json +79 -79
- package/dist/capabilities/fireworks-ai.json +92 -92
- package/dist/capabilities/freemodel.json +10 -10
- package/dist/capabilities/friendli.json +26 -5
- package/dist/capabilities/frogbot.json +97 -97
- package/dist/capabilities/gisoo.json +19 -19
- package/dist/capabilities/gmicloud.json +7 -7
- package/dist/capabilities/google.json +53 -53
- package/dist/capabilities/graphn.json +14 -14
- package/dist/capabilities/greenpt.json +34 -34
- package/dist/capabilities/groq.json +4 -4
- package/dist/capabilities/helicone.json +88 -88
- package/dist/capabilities/hetzner.json +4 -4
- package/dist/capabilities/hostinger-router.json +10 -10
- package/dist/capabilities/hpc-ai.json +2 -2
- package/dist/capabilities/huawei-maas.json +15 -15
- package/dist/capabilities/hubris.json +28 -28
- package/dist/capabilities/huggingface.json +87 -85
- package/dist/capabilities/hyper.json +24 -24
- package/dist/capabilities/impossibl.json +114 -114
- package/dist/capabilities/inception.json +3 -3
- package/dist/capabilities/inceptron.json +8 -8
- package/dist/capabilities/inco.json +2 -2
- package/dist/capabilities/infer.json +17 -17
- package/dist/capabilities/inferall.json +5 -5
- package/dist/capabilities/inference-coop.json +2 -2
- package/dist/capabilities/inferenceapis.json +27 -27
- package/dist/capabilities/inferris.json +3 -3
- package/dist/capabilities/infersia.json +11 -11
- package/dist/capabilities/infomaniak.json +2 -2
- package/dist/capabilities/io-net.json +2 -2
- package/dist/capabilities/iteracompute.json +38 -38
- package/dist/capabilities/jalapeno.json +10 -10
- package/dist/capabilities/jiekou.json +34 -34
- package/dist/capabilities/joingonka.json +4 -4
- package/dist/capabilities/jzstoken.json +49 -49
- package/dist/capabilities/keln.json +24 -24
- package/dist/capabilities/kenari.json +122 -137
- package/dist/capabilities/kilo.json +615 -614
- package/dist/capabilities/kimchi.json +14 -14
- package/dist/capabilities/kimi-code-plan-cn.json +9 -9
- package/dist/capabilities/kimi-code-plan-global.json +9 -9
- package/dist/capabilities/kitani.json +6 -6
- package/dist/capabilities/klavo.json +20 -20
- package/dist/capabilities/korouter.json +35 -35
- package/dist/capabilities/kunavo.json +10 -10
- package/dist/capabilities/liquid.json +9 -9
- package/dist/capabilities/lithosai.json +2 -2
- package/dist/capabilities/llmgateway-providers.json +959 -923
- package/dist/capabilities/llmgateway.json +349 -340
- package/dist/capabilities/llmtr.json +29 -29
- package/dist/capabilities/logits.json +2 -2
- package/dist/capabilities/lowrouter.json +53 -53
- package/dist/capabilities/lyceum.json +12 -12
- package/dist/capabilities/melious.json +9 -9
- package/dist/capabilities/merge-gateway.json +271 -263
- package/dist/capabilities/meta.json +11 -11
- package/dist/capabilities/minimax-cn-coding-plan.json +5 -5
- package/dist/capabilities/minimax-cn.json +5 -5
- package/dist/capabilities/minimax-coding-plan.json +5 -5
- package/dist/capabilities/minimax.json +5 -5
- package/dist/capabilities/mistral.json +16 -16
- package/dist/capabilities/mixlayer.json +4 -4
- package/dist/capabilities/modal.json +11 -11
- package/dist/capabilities/model-oracle-ai.json +19 -19
- package/dist/capabilities/modelis.json +16 -16
- package/dist/capabilities/modular.json +5 -5
- package/dist/capabilities/moneo.json +10 -10
- package/dist/capabilities/moonshotai-cn.json +6 -6
- package/dist/capabilities/moonshotai.json +6 -6
- package/dist/capabilities/morph.json +18 -18
- package/dist/capabilities/munito-eu.json +8 -8
- package/dist/capabilities/munito.json +10 -10
- package/dist/capabilities/nan.json +33 -33
- package/dist/capabilities/nano-gpt.json +557 -567
- package/dist/capabilities/nearai.json +77 -77
- package/dist/capabilities/nebius.json +42 -34
- package/dist/capabilities/neon.json +127 -127
- package/dist/capabilities/neuralwatt.json +37 -37
- package/dist/capabilities/nokeep.json +4 -4
- package/dist/capabilities/novita-ai.json +115 -115
- package/dist/capabilities/nvidia.json +17 -17
- package/dist/capabilities/oathbreaker.json +5 -5
- package/dist/capabilities/obscurify.json +29 -29
- package/dist/capabilities/oci.json +6 -6
- package/dist/capabilities/ofox.json +265 -265
- package/dist/capabilities/ollama-cloud.json +52 -52
- package/dist/capabilities/openai.json +58 -61
- package/dist/capabilities/opencode-go.json +90 -90
- package/dist/capabilities/openreason.json +6 -6
- package/dist/capabilities/openrouter.json +550 -548
- package/dist/capabilities/opper.json +26 -26
- package/dist/capabilities/orcarouter.json +310 -294
- package/dist/capabilities/outerlabs.json +29 -29
- package/dist/capabilities/ovhcloud.json +22 -22
- package/dist/capabilities/pareto.json +4 -4
- package/dist/capabilities/perplexity-agent.json +69 -69
- package/dist/capabilities/perplexity.json +2 -2
- package/dist/capabilities/phala.json +30 -30
- package/dist/capabilities/poe.json +111 -111
- package/dist/capabilities/poolside.json +2 -2
- package/dist/capabilities/powerspring.json +9 -9
- package/dist/capabilities/primalabs.json +11 -11
- package/dist/capabilities/prime.json +127 -119
- package/dist/capabilities/privatemode-ai.json +6 -6
- package/dist/capabilities/proxystacks.json +3 -3
- package/dist/capabilities/qiniu-ai.json +13 -13
- package/dist/capabilities/refuseless.json +5 -5
- package/dist/capabilities/regolo-ai.json +10 -10
- package/dist/capabilities/requesty.json +200 -200
- package/dist/capabilities/ruapi.json +20 -20
- package/dist/capabilities/runcrate.json +13 -13
- package/dist/capabilities/runinfra.json +19 -19
- package/dist/capabilities/sakana.json +5 -5
- package/dist/capabilities/sambanova.json +9 -9
- package/dist/capabilities/sandbase.json +22 -22
- package/dist/capabilities/sarvam.json +14 -14
- package/dist/capabilities/scaleway.json +17 -17
- package/dist/capabilities/scnet-token-plan.json +8 -8
- package/dist/capabilities/scx-ai.json +22 -22
- package/dist/capabilities/sensenova.json +11 -11
- package/dist/capabilities/siliconflow-cn.json +59 -59
- package/dist/capabilities/siliconflow.json +57 -57
- package/dist/capabilities/snowflake-cortex.json +19 -19
- package/dist/capabilities/sokkan.json +10 -10
- package/dist/capabilities/sparrowcodes.json +20 -20
- package/dist/capabilities/standardcompute.json +85 -85
- package/dist/capabilities/steadyrouter.json +40 -40
- package/dist/capabilities/stepfun-ai-step-plan.json +5 -5
- 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 +18 -18
- 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 +17 -17
- package/dist/capabilities/teapot-router.json +13 -13
- package/dist/capabilities/tencent-token-plan-intl.json +22 -22
- package/dist/capabilities/tencent-token-plan.json +42 -42
- package/dist/capabilities/tencent-tokenhub.json +44 -44
- package/dist/capabilities/tensorx.json +43 -43
- package/dist/capabilities/tenstorrent.json +2 -2
- package/dist/capabilities/the-grid-ai.json +30 -30
- package/dist/capabilities/thinkingmachines.json +78 -78
- package/dist/capabilities/tinfoil.json +13 -13
- package/dist/capabilities/toapis.json +2 -2
- package/dist/capabilities/togetherai.json +54 -54
- package/dist/capabilities/tokengo.json +23 -23
- package/dist/capabilities/tokenharbor.json +217 -217
- package/dist/capabilities/tokenify.json +9 -9
- package/dist/capabilities/trustedrouter.json +6 -6
- package/dist/capabilities/trustedtokens.json +12 -12
- package/dist/capabilities/umans-ai-coding-plan.json +17 -17
- package/dist/capabilities/umans-ai.json +11 -11
- package/dist/capabilities/uncensuredai.json +5 -5
- package/dist/capabilities/unrestricted.json +4 -4
- package/dist/capabilities/uplinkswitch.json +20 -20
- package/dist/capabilities/upstage.json +2 -2
- package/dist/capabilities/vancine.json +20 -20
- package/dist/capabilities/vercel.json +580 -571
- package/dist/capabilities/vivgrid.json +61 -61
- package/dist/capabilities/volcengine-coding-plan.json +26 -26
- package/dist/capabilities/volcengine.json +24 -24
- package/dist/capabilities/vultr.json +15 -15
- package/dist/capabilities/wafer.ai.json +19 -19
- package/dist/capabilities/wallaby.json +5 -5
- package/dist/capabilities/wally.json +11 -11
- package/dist/capabilities/wandb.json +21 -21
- package/dist/capabilities/watt.json +19 -19
- package/dist/capabilities/xai.json +2 -2
- package/dist/capabilities/xpersona.json +13 -13
- package/dist/capabilities/xxapi.json +27 -27
- package/dist/capabilities/zai-coding-plan.json +11 -11
- package/dist/capabilities/zai.json +32 -32
- package/dist/capabilities/zenifra.json +27 -27
- package/dist/capabilities/zenmux.json +178 -178
- package/dist/capabilities/zerogpu.json +12 -12
- package/dist/capabilities/zhipuai-coding-plan.json +3 -3
- package/dist/capabilities/zhipuai.json +28 -28
- package/dist/capabilities/zro.json +7 -7
- package/dist/channels/index.cjs +2 -2
- package/dist/channels/index.js +2 -2
- package/dist/{channels-DChC1kXm.js → channels-BQ--aLCA.js} +1 -1
- package/dist/{channels-BamLzaJG.cjs → channels-CTCBsS5M.cjs} +1 -1
- package/dist/coding-agent/index.cjs +1 -1
- package/dist/coding-agent/index.js +1 -1
- package/dist/datasets/index.cjs +2 -2
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +804 -804
- package/dist/docs/references/docs-agents-human-in-the-loop.md +1 -1
- package/dist/docs/references/docs-agents-resumable-streams.md +3 -3
- package/dist/docs/references/docs-channels.md +8 -2
- package/dist/docs/references/docs-deployment-workers.md +10 -4
- package/dist/docs/references/docs-harness-durable-agents.md +17 -15
- package/dist/docs/references/docs-server-mcp.md +68 -0
- package/dist/docs/references/docs-server-pubsub.md +25 -16
- package/dist/docs/references/docs-signals-running-across-processes.md +9 -3
- package/dist/docs/references/docs-signals-sending-signals.md +1 -1
- package/dist/docs/references/docs-workflows-overview.md +3 -3
- package/dist/docs/references/reference-agents-agent.md +3 -1
- package/dist/docs/references/reference-agents-durable-agent.md +3 -3
- package/dist/docs/references/reference-configuration.md +60 -0
- package/dist/docs/references/reference-pubsub-base.md +1 -1
- package/dist/docs/references/reference-pubsub-caching-pubsub.md +1 -1
- package/dist/docs/references/reference-pubsub-google-cloud-pubsub.md +13 -7
- package/dist/docs/references/reference-pubsub-lease-provider.md +4 -0
- package/dist/docs/references/reference-pubsub-redis-streams.md +18 -9
- package/dist/docs/references/reference-pubsub-valkey-streams.md +25 -7
- 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 +3 -11
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.js +1 -1
- package/dist/events/pubsub.d.ts +2 -1
- package/dist/{execution-fence-BBKnrhWR.cjs → execution-fence-C8Q0wWkG.cjs} +841 -219
- package/dist/{execution-fence--VdnD7p4.js → execution-fence-DGFyUV5h.js} +841 -219
- 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/index.cjs +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/provider-types.generated.d.ts +7689 -7673
- package/dist/llm/reasoning/account-switch.d.ts +50 -0
- package/dist/llm/reasoning/index.cjs +65 -0
- package/dist/llm/reasoning/index.d.ts +1 -0
- package/dist/llm/reasoning/index.js +61 -1
- package/dist/{llm-DknPJDW6.cjs → llm-RIAYOAtD.cjs} +2 -2
- package/dist/{llm-ccA_1Q-H.js → llm-YNjDFSui.js} +2 -2
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/loop/suspended-run-auto-resume.d.ts +15 -0
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts +1 -1
- package/dist/{manager-DWX6-Cx4.js → manager-DZhtdV6Q.js} +2 -2
- package/dist/{manager-D9F0i7O2.cjs → manager-Y-jYcS7T.cjs} +2 -2
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.d.ts +35 -11
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-BzWL4xI8.cjs → mastra-B2-HBq1-.cjs} +108 -20
- package/dist/{mastra-oUDN81l8.js → mastra-BJ54VxOO.js} +108 -20
- package/dist/memory/index.cjs +2 -2
- package/dist/memory/index.js +2 -2
- package/dist/{model-BwxfS6T_.js → model-cS3d5rmF.js} +1 -1
- package/dist/{model-BnD7SPlA.cjs → model-lzZPXaEV.cjs} +1 -1
- package/dist/{netlify-CS0VDbb9.cjs → netlify-1lti1j4Z.cjs} +1 -1
- package/dist/{netlify-DcY9gHCJ.js → netlify-ClBjc0Xg.js} +1 -1
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/{output-helpers-k2-48ssH.js → output-helpers-D-qplq22.js} +13 -15
- package/dist/{output-helpers-By5FbLpp.cjs → output-helpers-D4O_oFne.cjs} +12 -14
- package/dist/processor-provider/index.cjs +1 -1
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +2 -2
- package/dist/processors/index.js +2 -2
- package/dist/{provider-registry-OggbU6OE.cjs → provider-registry-C6jd3Uxi.cjs} +21565 -21544
- package/dist/{provider-registry-BvbEoScB.js → provider-registry-C_XQJvu2.js} +21565 -21544
- package/dist/provider-registry.json +22006 -21980
- package/dist/{registry-generator-CDaf48a6.cjs → registry-generator-BYdAlox6.cjs} +1 -1
- package/dist/{registry-generator-BFOQQHyt.js → registry-generator-DBrTbThj.js} +1 -1
- package/dist/{rehydrate-CFoKaNlm.js → rehydrate-4xHubfOY.js} +2 -2
- package/dist/{rehydrate-QeS0NjGw.cjs → rehydrate-BtwY0ima.cjs} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/{scheduler-0ShtMM1I.js → scheduler-D1qdie5k.js} +4 -2
- package/dist/{scheduler-CMjK0LoQ.cjs → scheduler-DE5lcHJA.cjs} +4 -2
- package/dist/server/index.d.ts +1 -1
- package/dist/server/types.d.ts +57 -0
- package/dist/storage/domains/memory/base.d.ts +6 -1
- package/dist/storage/index.cjs +2 -2
- package/dist/storage/index.js +2 -2
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/{stream-CNqAlDJF.cjs → stream-DqKDB3nL.cjs} +1 -1
- package/dist/{stream-D2rv1Ut1.js → stream-H_wVxqdK.js} +1 -1
- 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-Dusqj7-j.cjs → tool-loop-agent-D4gSdYuN.cjs} +3 -3
- package/dist/{tool-loop-agent-CFsOjueT.js → tool-loop-agent-DvZcOxWe.js} +3 -3
- package/dist/{utils-CIuOHPoS.cjs → utils-Dd4m7z13.cjs} +1 -1
- package/dist/{utils-DLnCt6E9.js → utils-h5k_ChdS.js} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-ShLcQTA5.js → validate-DQB9spZ1.js} +1 -1
- package/dist/{validate-1zReLtWc.cjs → validate-u6_TUYSo.cjs} +1 -1
- package/dist/vector/index.cjs +1 -1
- package/dist/vector/index.js +1 -1
- package/dist/worker/index.cjs +1 -1
- package/dist/worker/index.d.ts +1 -1
- package/dist/worker/index.js +1 -1
- package/dist/worker/workers/orchestration-worker.d.ts +13 -0
- package/dist/{worker-CQ8rTJwQ.cjs → worker-0F7Nukyf.cjs} +2 -2
- package/dist/{worker-BPNrwCFs.cjs → worker-D-cq8McN.cjs} +117 -32
- package/dist/{worker-ngt-F1Iv.js → worker-DWOK2M_5.js} +117 -32
- package/dist/{worker-CKcQcPl8.js → worker-DmUkyJY_.js} +2 -2
- package/dist/{workflow-B_e5wMmz.cjs → workflow-DXE15e-w.cjs} +4 -4
- package/dist/{workflow-XDIVRsu4.js → workflow-DamOke3z.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/evented/setup-warning.d.ts +20 -0
- package/dist/workflows/index.cjs +5 -5
- package/dist/workflows/index.js +5 -5
- package/dist/workflows/scheduler/types.d.ts +3 -0
- package/dist/workspace/tools/media.d.ts +2 -2
- package/package.json +7 -7
- package/src/llm/model/provider-types.generated.d.ts +7689 -7673
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const require_execution_fence = require("./execution-fence-
|
|
2
|
-
const require_background_tasks = require("./background-tasks-
|
|
1
|
+
const require_execution_fence = require("./execution-fence-C8Q0wWkG.cjs");
|
|
2
|
+
const require_background_tasks = require("./background-tasks-CeARf1DK.cjs");
|
|
3
3
|
const require_inmemory = require("./inmemory-Dc86VWGB.cjs");
|
|
4
|
-
const require_manager = require("./manager-
|
|
4
|
+
const require_manager = require("./manager-Y-jYcS7T.cjs");
|
|
5
5
|
const require_error = require("./error-D90lJ6M7.cjs");
|
|
6
|
-
const require_output_helpers = require("./output-helpers-
|
|
6
|
+
const require_output_helpers = require("./output-helpers-D4O_oFne.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-1lti1j4Z.cjs");
|
|
10
|
+
const require_llm = require("./llm-RIAYOAtD.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");
|
|
@@ -17,14 +17,15 @@ const require_utils = require("./utils-D-eNsgDM.cjs");
|
|
|
17
17
|
const require_request_context = require("./request-context-D9RXYCy8.cjs");
|
|
18
18
|
const require_source = require("./source-C_nWbqI0.cjs");
|
|
19
19
|
const require_feature_telemetry = require("./feature-telemetry-Cw0L1tHo.cjs");
|
|
20
|
-
const require_tool_loop_agent = require("./tool-loop-agent-
|
|
20
|
+
const require_tool_loop_agent = require("./tool-loop-agent-D4gSdYuN.cjs");
|
|
21
21
|
const require_payload_transform = require("./payload-transform-CWgnsO9w.cjs");
|
|
22
|
-
const require_utils$1 = require("./utils-
|
|
23
|
-
const require_worker = require("./worker-
|
|
24
|
-
const require_builder = require("./builder-
|
|
25
|
-
const require_validate = require("./validate-
|
|
26
|
-
const require_rehydrate = require("./rehydrate-
|
|
27
|
-
const require_stream = require("./stream-
|
|
22
|
+
const require_utils$1 = require("./utils-Dd4m7z13.cjs");
|
|
23
|
+
const require_worker = require("./worker-D-cq8McN.cjs");
|
|
24
|
+
const require_builder = require("./builder-Dmf04g9P.cjs");
|
|
25
|
+
const require_validate = require("./validate-u6_TUYSo.cjs");
|
|
26
|
+
const require_rehydrate = require("./rehydrate-BtwY0ima.cjs");
|
|
27
|
+
const require_stream = require("./stream-DqKDB3nL.cjs");
|
|
28
|
+
let _isaacs_ttlcache = require("@isaacs/ttlcache");
|
|
28
29
|
let zod_v4 = require("zod/v4");
|
|
29
30
|
// src/notifications/workflow.ts
|
|
30
31
|
const NOTIFICATION_DISPATCH_WORKFLOW_ID = "__mastra_notification_dispatcher";
|
|
@@ -334,6 +335,7 @@ async function syncFsAgentSchedules({ agents, store, logger, knownRows }) {
|
|
|
334
335
|
}
|
|
335
336
|
}
|
|
336
337
|
// src/mastra/index.ts
|
|
338
|
+
/** Docs for this @mastra/core version are bundled at node_modules/@mastra/core/dist/docs/SKILL.md. Read it before guessing APIs from these types. */
|
|
337
339
|
function normalizeApiRoutes(routes) {
|
|
338
340
|
return routes.flatMap((route) => Array.isArray(route) ? route : [route]);
|
|
339
341
|
}
|
|
@@ -490,6 +492,7 @@ function serializableWorkerConfig(config) {
|
|
|
490
492
|
* ```
|
|
491
493
|
*/
|
|
492
494
|
const attachedLoggerOwners = /* @__PURE__ */ new WeakMap();
|
|
495
|
+
const localScheduledStarts = new _isaacs_ttlcache.TTLCache({ ttl: 36e5 });
|
|
493
496
|
/**
|
|
494
497
|
* Pubsub topic used to tell every process running the default worker set that
|
|
495
498
|
* a schedule now exists and the scheduler tick loop should start. Lets a
|
|
@@ -754,6 +757,11 @@ var Mastra = class Mastra {
|
|
|
754
757
|
* calls also set without starting the workflow consumer.
|
|
755
758
|
*/
|
|
756
759
|
#executionWorkersStarted = false;
|
|
760
|
+
/**
|
|
761
|
+
* Set once `shutdown({ drain: 'step' })` stopped the orchestration workers:
|
|
762
|
+
* this process no longer takes workflow events, although it is still alive.
|
|
763
|
+
*/
|
|
764
|
+
#workflowIntakeStopped = false;
|
|
757
765
|
#workflowEventProcessor;
|
|
758
766
|
#pushSubscription;
|
|
759
767
|
#inFlightPushEvents = /* @__PURE__ */ new Set();
|
|
@@ -2863,6 +2871,7 @@ var Mastra = class Mastra {
|
|
|
2863
2871
|
*/
|
|
2864
2872
|
__hasLocalWorkflowExecution() {
|
|
2865
2873
|
if (this.#pushSubscription) return true;
|
|
2874
|
+
if (this.#workflowIntakeStopped) return false;
|
|
2866
2875
|
return !!this.#workers.find((w) => w.name === "orchestration")?.isRunning;
|
|
2867
2876
|
}
|
|
2868
2877
|
/**
|
|
@@ -2874,7 +2883,7 @@ var Mastra = class Mastra {
|
|
|
2874
2883
|
*/
|
|
2875
2884
|
async __ensureExperimentWorkflow() {
|
|
2876
2885
|
if (this.__hasInternalWorkflow("__mastra-experiment")) return;
|
|
2877
|
-
const { buildExperimentWorkflow } = await Promise.resolve().then(() => require("./manager-
|
|
2886
|
+
const { buildExperimentWorkflow } = await Promise.resolve().then(() => require("./manager-Y-jYcS7T.cjs")).then((n) => n.workflow_exports);
|
|
2878
2887
|
if (this.__hasInternalWorkflow("__mastra-experiment")) return;
|
|
2879
2888
|
this.__registerInternalWorkflow(buildExperimentWorkflow(), void 0, { distributed: true });
|
|
2880
2889
|
}
|
|
@@ -5075,7 +5084,7 @@ var Mastra = class Mastra {
|
|
|
5075
5084
|
if (!this.#workerFilter || this.#workerFilter.has("agent-schedule")) {
|
|
5076
5085
|
let agentScheduleWorker = this.#findAgentScheduleWorker();
|
|
5077
5086
|
if (!agentScheduleWorker) {
|
|
5078
|
-
const { AgentScheduleWorker } = await Promise.resolve().then(() => require("./worker-
|
|
5087
|
+
const { AgentScheduleWorker } = await Promise.resolve().then(() => require("./worker-0F7Nukyf.cjs"));
|
|
5079
5088
|
agentScheduleWorker = new AgentScheduleWorker();
|
|
5080
5089
|
agentScheduleWorker.__registerMastra(this);
|
|
5081
5090
|
this.#workers.push(agentScheduleWorker);
|
|
@@ -5648,6 +5657,16 @@ var Mastra = class Mastra {
|
|
|
5648
5657
|
async removeTopicListener(topic, listener) {
|
|
5649
5658
|
await this.#pubsub.unsubscribe(topic, this.#ackingTopicListener(listener));
|
|
5650
5659
|
}
|
|
5660
|
+
/**
|
|
5661
|
+
* @internal Registers what a workflow event may need on this instance: the durable loop
|
|
5662
|
+
* workflow of every agent added so far, and the experiment workflow for experiment events.
|
|
5663
|
+
* Workers that process this instance's events with their own processor call it before each event;
|
|
5664
|
+
* it does the same setup handleWorkflowEvent does.
|
|
5665
|
+
*/
|
|
5666
|
+
async __prepareWorkflowEvent(event) {
|
|
5667
|
+
this.#initializeDurableAgents();
|
|
5668
|
+
if (event.data?.workflowId === "__mastra-experiment") await this.__ensureExperimentWorkflow();
|
|
5669
|
+
}
|
|
5651
5670
|
/** Build native durable agents' engines and register their workflows, so event ownership checks can find them. */
|
|
5652
5671
|
#initializeDurableAgents() {
|
|
5653
5672
|
for (const agent of Object.values(this.#agents ?? {})) if (require_execution_fence.hasDurableExecution(agent) && !require_execution_fence.isDurableAgentLike(agent)) agent.__initializeDurableExecution();
|
|
@@ -5689,10 +5708,25 @@ var Mastra = class Mastra {
|
|
|
5689
5708
|
if (this.#workflowEventConsumer === consumer) this.#workflowEventConsumer = void 0;
|
|
5690
5709
|
};
|
|
5691
5710
|
}
|
|
5711
|
+
/** @internal */
|
|
5712
|
+
__publishLocalScheduledWorkflowStart(event) {
|
|
5713
|
+
const localScheduleDispatchId = crypto.randomUUID();
|
|
5714
|
+
localScheduledStarts.set(localScheduleDispatchId, {
|
|
5715
|
+
claimant: this,
|
|
5716
|
+
deliveries: /* @__PURE__ */ new Map()
|
|
5717
|
+
});
|
|
5718
|
+
return this.#pubsub.publish("workflows", {
|
|
5719
|
+
...event,
|
|
5720
|
+
data: {
|
|
5721
|
+
...event.data,
|
|
5722
|
+
localScheduleDispatchId
|
|
5723
|
+
}
|
|
5724
|
+
}, { localOnly: true });
|
|
5725
|
+
}
|
|
5692
5726
|
/**
|
|
5693
|
-
* Hands a
|
|
5694
|
-
*
|
|
5695
|
-
*
|
|
5727
|
+
* Hands a local scheduled start to the scheduler's instance, or a durable-agent
|
|
5728
|
+
* event to the instance executing its run. Returns undefined when the caller
|
|
5729
|
+
* should process the event.
|
|
5696
5730
|
*
|
|
5697
5731
|
* Mastra instances sharing an in-process pubsub join the same consumer
|
|
5698
5732
|
* group, so any of them can receive a step of a run another one started.
|
|
@@ -5705,6 +5739,25 @@ var Mastra = class Mastra {
|
|
|
5705
5739
|
* @internal
|
|
5706
5740
|
*/
|
|
5707
5741
|
__delegateWorkflowEvent(event) {
|
|
5742
|
+
if (event.type === "workflow.start" && typeof event.data?.localScheduleDispatchId === "string") {
|
|
5743
|
+
const localStart = localScheduledStarts.get(event.data.localScheduleDispatchId);
|
|
5744
|
+
if (localStart && localStart.claimant.#pubsub.__rawBus() === this.#pubsub.__rawBus()) {
|
|
5745
|
+
const attempt = event.deliveryAttempt;
|
|
5746
|
+
const existing = localStart.deliveries.get(attempt);
|
|
5747
|
+
if (existing) return existing;
|
|
5748
|
+
const delivery = localStart.claimant.#consumeDelegatedWorkflowEvent(event);
|
|
5749
|
+
if (!delivery) return void 0;
|
|
5750
|
+
const result = attempt === void 0 ? delivery.then((outcome) => {
|
|
5751
|
+
if (!outcome.ok && outcome.retry) localStart.deliveries.delete(attempt);
|
|
5752
|
+
return outcome;
|
|
5753
|
+
}, (error) => {
|
|
5754
|
+
localStart.deliveries.delete(attempt);
|
|
5755
|
+
throw error;
|
|
5756
|
+
}) : delivery;
|
|
5757
|
+
localStart.deliveries.set(attempt, result);
|
|
5758
|
+
return result;
|
|
5759
|
+
}
|
|
5760
|
+
}
|
|
5708
5761
|
if (!event.runId) return void 0;
|
|
5709
5762
|
const context = new require_request_context.RequestContext(Object.entries(event.data?.requestContext ?? {}));
|
|
5710
5763
|
const execution = require_execution_fence.getExecutionClaimScope(context, event.runId, event.data?.parentWorkflow);
|
|
@@ -5739,6 +5792,7 @@ var Mastra = class Mastra {
|
|
|
5739
5792
|
* without run fencing.
|
|
5740
5793
|
*/
|
|
5741
5794
|
async startWorkers(name) {
|
|
5795
|
+
if (this.#shuttingDown) return;
|
|
5742
5796
|
if (this.#storage) await this.#storage.init();
|
|
5743
5797
|
this.#initializeDurableAgents();
|
|
5744
5798
|
await this.__ensureExperimentWorkflow();
|
|
@@ -5760,7 +5814,7 @@ var Mastra = class Mastra {
|
|
|
5760
5814
|
this.#workers.push(sw);
|
|
5761
5815
|
}
|
|
5762
5816
|
if (!this.#findAgentScheduleWorker()) {
|
|
5763
|
-
const { AgentScheduleWorker } = await Promise.resolve().then(() => require("./worker-
|
|
5817
|
+
const { AgentScheduleWorker } = await Promise.resolve().then(() => require("./worker-0F7Nukyf.cjs"));
|
|
5764
5818
|
const asw = new AgentScheduleWorker();
|
|
5765
5819
|
asw.__registerMastra(this);
|
|
5766
5820
|
this.#workers.push(asw);
|
|
@@ -5788,6 +5842,7 @@ var Mastra = class Mastra {
|
|
|
5788
5842
|
}
|
|
5789
5843
|
for (const worker of targets) {
|
|
5790
5844
|
if (worker.isRunning) continue;
|
|
5845
|
+
if (this.#shuttingDown) return;
|
|
5791
5846
|
await worker.init(deps);
|
|
5792
5847
|
await worker.start();
|
|
5793
5848
|
}
|
|
@@ -5894,6 +5949,7 @@ var Mastra = class Mastra {
|
|
|
5894
5949
|
async __ensureExecutionWorkersStarted() {
|
|
5895
5950
|
if (this.#executionWorkersStarted) return;
|
|
5896
5951
|
if (this.#workersDisabled) return;
|
|
5952
|
+
if (this.#shuttingDown) return;
|
|
5897
5953
|
if (!this.#executionWorkersStartPromise) this.#executionWorkersStartPromise = require_execution_fence.runOutsideRunFenceScope(() => this.#startExecutionWorkers()).finally(() => {
|
|
5898
5954
|
this.#executionWorkersStartPromise = void 0;
|
|
5899
5955
|
});
|
|
@@ -5912,6 +5968,7 @@ var Mastra = class Mastra {
|
|
|
5912
5968
|
if (worker.name !== "orchestration" && worker.name !== "backgroundTasks") continue;
|
|
5913
5969
|
if (this.#workerFilter && !this.#workerFilter.has(worker.name)) continue;
|
|
5914
5970
|
if (worker.isRunning) continue;
|
|
5971
|
+
if (this.#shuttingDown) return;
|
|
5915
5972
|
await worker.init(deps);
|
|
5916
5973
|
await worker.start();
|
|
5917
5974
|
}
|
|
@@ -5950,6 +6007,26 @@ var Mastra = class Mastra {
|
|
|
5950
6007
|
this.#warnedStrandedLocalWorkflowIds.clear();
|
|
5951
6008
|
}
|
|
5952
6009
|
/**
|
|
6010
|
+
* Stop the orchestration worker ahead of the rest of shutdown, for `shutdown({ drain: 'step' })`: it stops reading
|
|
6011
|
+
* workflow events and waits, until `deadline`, for the ones it is handling. Another process on the same pubsub
|
|
6012
|
+
* takes the events published from then on.
|
|
6013
|
+
*/
|
|
6014
|
+
async #stopWorkflowIntake(deadline) {
|
|
6015
|
+
if (!this.#pubsub.__rawBus().redeliversUnacked) {
|
|
6016
|
+
this.#logger?.warn("shutdown({ drain: 'step' }) needs a pubsub that redelivers unacknowledged events (for example Redis Streams); draining runs instead");
|
|
6017
|
+
return;
|
|
6018
|
+
}
|
|
6019
|
+
this.#workflowIntakeStopped = true;
|
|
6020
|
+
const drainTimeout = Math.max(0, deadline - Date.now());
|
|
6021
|
+
await Promise.all(this.#workers.filter((worker) => worker.name === "orchestration" && worker.isRunning).map(async (worker) => {
|
|
6022
|
+
try {
|
|
6023
|
+
await worker.stop({ drainTimeout });
|
|
6024
|
+
} catch (error) {
|
|
6025
|
+
this.#logger?.error("Failed to stop taking workflow events during shutdown", { error });
|
|
6026
|
+
}
|
|
6027
|
+
}));
|
|
6028
|
+
}
|
|
6029
|
+
/**
|
|
5953
6030
|
* Hand back the thread runs this Mastra still holds once its durable executions are abandoned: announce each run's
|
|
5954
6031
|
* end, stop its lease renewal and release its thread lease, so another process can take the thread right away.
|
|
5955
6032
|
*/
|
|
@@ -6210,7 +6287,7 @@ var Mastra = class Mastra {
|
|
|
6210
6287
|
#syncGatewayRegistry() {
|
|
6211
6288
|
try {
|
|
6212
6289
|
if (process.env.MASTRA_DEV !== "true" && process.env.MASTRA_DEV !== "1") return;
|
|
6213
|
-
Promise.resolve().then(() => require("./provider-registry-
|
|
6290
|
+
Promise.resolve().then(() => require("./provider-registry-C6jd3Uxi.cjs")).then((n) => n.provider_registry_exports).then(async ({ GatewayRegistry }) => {
|
|
6214
6291
|
const registry = GatewayRegistry.getInstance();
|
|
6215
6292
|
const customGateways = Object.values(this.#gateways || {});
|
|
6216
6293
|
registry.registerCustomGateways(customGateways);
|
|
@@ -6271,6 +6348,16 @@ var Mastra = class Mastra {
|
|
|
6271
6348
|
* call that ignores the abort), or the lease backend doesn't answer or
|
|
6272
6349
|
* fails the release, the lease is kept until it expires. Handing runs back can take up to about 1.5 seconds past
|
|
6273
6350
|
* `drainTimeout`.
|
|
6351
|
+
*
|
|
6352
|
+
* With `drain: 'step'` the instance first stops taking workflow events, so
|
|
6353
|
+
* another process on the same pubsub continues its evented runs. The steps
|
|
6354
|
+
* it is executing still get `drainTimeout` to finish, and the runs it
|
|
6355
|
+
* started are still awaited within the same window while they finish on the
|
|
6356
|
+
* other process. Use it when another process is running during the
|
|
6357
|
+
* shutdown, as in a rolling deploy: with no other process, runs wait for the
|
|
6358
|
+
* next one to start. It is supported on Redis Streams and Valkey Streams,
|
|
6359
|
+
* and ignored on a pubsub that does not redeliver unacknowledged events.
|
|
6360
|
+
* Defaults to `'run'`.
|
|
6274
6361
|
*/
|
|
6275
6362
|
async shutdown(options) {
|
|
6276
6363
|
const drainTimeout = require_execution_fence.assertDrainTimeout(options?.drainTimeout ?? require_execution_fence.waitMs(DEFAULT_SHUTDOWN_DRAIN_TIMEOUT_MS, 50), "shutdown");
|
|
@@ -6280,6 +6367,7 @@ var Mastra = class Mastra {
|
|
|
6280
6367
|
this.#durableRecoveryRechecks.clear();
|
|
6281
6368
|
this.#stopWorkflowRecoveryLoop?.();
|
|
6282
6369
|
this.__unregisterHooks();
|
|
6370
|
+
if (options?.drain === "step") await this.#stopWorkflowIntake(deadline);
|
|
6283
6371
|
const awaited = /* @__PURE__ */ new Set();
|
|
6284
6372
|
for (;;) {
|
|
6285
6373
|
const pendingRuns = [
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { $c as createConcurrencyLimiter, Bc as createNestedRunParentStatusLookup, Bl as hasDurableExecution, Fo as getStorageSource, Fs as WorkflowEventProcessor, Hc as nestedRunRecoveryAction, Hl as isDurableAgentLike, Jc as WORKFLOW_RUN_LEASE_TTL_MS, Ll as assertDrainTimeout, Lr as dispatchDueNotifications, Ls as computeScheduleDefinitionHash, Ns as createStep, Po as augmentWithInit, Ps as createWorkflow, Rl as waitMs, Uc as nestedRunStatusOf, Vc as nestedRunParentOf, Xc as repeatAfterSettled, Yc as renewWorkflowLease, Zc as runFenceConflictOf, br as WorkflowsInMemory, bu as runOutsideRunFenceScope, el as normalizeConcurrency, i as agentThreadStreamRuntime, mt as __registerMastraCtor, n as getExecutionClaimScope, na as BackgroundTasksInMemory, oc as getActiveDurableAgentWorkflowExecutions, rc as abandonDurableAgentExecutions, sc as getExecutingInstances, tl as runWithConcurrency, u as createOnScorerHook, uc as isDurableAgentExecutionDetached, vr as InMemoryStore, yn as AgentChannels, zc as cancelNestedRun } from "./execution-fence
|
|
2
|
-
import { l as BackgroundTaskManager } from "./background-tasks-
|
|
1
|
+
import { $c as createConcurrencyLimiter, Bc as createNestedRunParentStatusLookup, Bl as hasDurableExecution, Fo as getStorageSource, Fs as WorkflowEventProcessor, Hc as nestedRunRecoveryAction, Hl as isDurableAgentLike, Jc as WORKFLOW_RUN_LEASE_TTL_MS, Ll as assertDrainTimeout, Lr as dispatchDueNotifications, Ls as computeScheduleDefinitionHash, Ns as createStep, Po as augmentWithInit, Ps as createWorkflow, Rl as waitMs, Uc as nestedRunStatusOf, Vc as nestedRunParentOf, Xc as repeatAfterSettled, Yc as renewWorkflowLease, Zc as runFenceConflictOf, br as WorkflowsInMemory, bu as runOutsideRunFenceScope, el as normalizeConcurrency, i as agentThreadStreamRuntime, mt as __registerMastraCtor, n as getExecutionClaimScope, na as BackgroundTasksInMemory, oc as getActiveDurableAgentWorkflowExecutions, rc as abandonDurableAgentExecutions, sc as getExecutingInstances, tl as runWithConcurrency, u as createOnScorerHook, uc as isDurableAgentExecutionDetached, vr as InMemoryStore, yn as AgentChannels, zc as cancelNestedRun } from "./execution-fence-DGFyUV5h.js";
|
|
2
|
+
import { l as BackgroundTaskManager } from "./background-tasks-B7UygDdO.js";
|
|
3
3
|
import { t as InMemoryServerCache } from "./inmemory-BK3zLwvM.js";
|
|
4
|
-
import { t as DatasetsManager } from "./manager-
|
|
4
|
+
import { t as DatasetsManager } from "./manager-DZhtdV6Q.js";
|
|
5
5
|
import { i as MastraError, n as ErrorDomain, t as ErrorCategory } from "./error-oh2DLsP2.js";
|
|
6
|
-
import {
|
|
6
|
+
import { f as isRunLocalTopic, v as EventEmitterPubSub } from "./output-helpers-D-qplq22.js";
|
|
7
7
|
import { a as registerHook, r as deregisterHook } from "./hooks-Bth8Cjpj.js";
|
|
8
8
|
import { LicenseClient } from "./license/index.js";
|
|
9
|
-
import { g as getGatewayId } from "./netlify-
|
|
10
|
-
import { l as defaultGateways } from "./llm-
|
|
9
|
+
import { g as getGatewayId } from "./netlify-ClBjc0Xg.js";
|
|
10
|
+
import { l as defaultGateways } from "./llm-YNjDFSui.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";
|
|
@@ -17,14 +17,15 @@ import { f as resolveCurrentSpan } from "./utils-DU_pU5SK.js";
|
|
|
17
17
|
import { u as RequestContext } from "./request-context-COnZHt2-.js";
|
|
18
18
|
import { r as InMemoryDB } from "./source-B3He4_mz.js";
|
|
19
19
|
import { r as trackFeatureUsage } from "./feature-telemetry-DdR8J_5o.js";
|
|
20
|
-
import { r as isToolLoopAgentLike, t as toolLoopAgentToMastraAgent } from "./tool-loop-agent-
|
|
20
|
+
import { r as isToolLoopAgentLike, t as toolLoopAgentToMastraAgent } from "./tool-loop-agent-DvZcOxWe.js";
|
|
21
21
|
import { r as normalizeToolPayloadTransformPolicy } from "./payload-transform-Dj3HUeD4.js";
|
|
22
|
-
import { v as readPositiveIntEnv } from "./utils-
|
|
23
|
-
import { a as OrchestrationWorker, i as ORCHESTRATION_GROUP, n as BackgroundTaskWorker, r as SchedulerWorker } from "./worker-
|
|
24
|
-
import { n as normalizeWorkflowBuilderDefinition } from "./builder-
|
|
25
|
-
import { d as toJsonSchemaOrUndefined, p as collectNestedWorkflowIds, t as assertValidDynamicWorkflow } from "./validate-
|
|
26
|
-
import { t as rehydrateWorkflow } from "./rehydrate-
|
|
27
|
-
import { Rn as createRunScope } from "./stream-
|
|
22
|
+
import { v as readPositiveIntEnv } from "./utils-h5k_ChdS.js";
|
|
23
|
+
import { a as OrchestrationWorker, i as ORCHESTRATION_GROUP, n as BackgroundTaskWorker, r as SchedulerWorker } from "./worker-DWOK2M_5.js";
|
|
24
|
+
import { n as normalizeWorkflowBuilderDefinition } from "./builder-CpAEmMdR.js";
|
|
25
|
+
import { d as toJsonSchemaOrUndefined, p as collectNestedWorkflowIds, t as assertValidDynamicWorkflow } from "./validate-DQB9spZ1.js";
|
|
26
|
+
import { t as rehydrateWorkflow } from "./rehydrate-4xHubfOY.js";
|
|
27
|
+
import { Rn as createRunScope } from "./stream-H_wVxqdK.js";
|
|
28
|
+
import { TTLCache } from "@isaacs/ttlcache";
|
|
28
29
|
import { z } from "zod/v4";
|
|
29
30
|
// src/notifications/workflow.ts
|
|
30
31
|
const NOTIFICATION_DISPATCH_WORKFLOW_ID = "__mastra_notification_dispatcher";
|
|
@@ -334,6 +335,7 @@ async function syncFsAgentSchedules({ agents, store, logger, knownRows }) {
|
|
|
334
335
|
}
|
|
335
336
|
}
|
|
336
337
|
// src/mastra/index.ts
|
|
338
|
+
/** Docs for this @mastra/core version are bundled at node_modules/@mastra/core/dist/docs/SKILL.md. Read it before guessing APIs from these types. */
|
|
337
339
|
function normalizeApiRoutes(routes) {
|
|
338
340
|
return routes.flatMap((route) => Array.isArray(route) ? route : [route]);
|
|
339
341
|
}
|
|
@@ -490,6 +492,7 @@ function serializableWorkerConfig(config) {
|
|
|
490
492
|
* ```
|
|
491
493
|
*/
|
|
492
494
|
const attachedLoggerOwners = /* @__PURE__ */ new WeakMap();
|
|
495
|
+
const localScheduledStarts = new TTLCache({ ttl: 36e5 });
|
|
493
496
|
/**
|
|
494
497
|
* Pubsub topic used to tell every process running the default worker set that
|
|
495
498
|
* a schedule now exists and the scheduler tick loop should start. Lets a
|
|
@@ -754,6 +757,11 @@ var Mastra = class Mastra {
|
|
|
754
757
|
* calls also set without starting the workflow consumer.
|
|
755
758
|
*/
|
|
756
759
|
#executionWorkersStarted = false;
|
|
760
|
+
/**
|
|
761
|
+
* Set once `shutdown({ drain: 'step' })` stopped the orchestration workers:
|
|
762
|
+
* this process no longer takes workflow events, although it is still alive.
|
|
763
|
+
*/
|
|
764
|
+
#workflowIntakeStopped = false;
|
|
757
765
|
#workflowEventProcessor;
|
|
758
766
|
#pushSubscription;
|
|
759
767
|
#inFlightPushEvents = /* @__PURE__ */ new Set();
|
|
@@ -2863,6 +2871,7 @@ var Mastra = class Mastra {
|
|
|
2863
2871
|
*/
|
|
2864
2872
|
__hasLocalWorkflowExecution() {
|
|
2865
2873
|
if (this.#pushSubscription) return true;
|
|
2874
|
+
if (this.#workflowIntakeStopped) return false;
|
|
2866
2875
|
return !!this.#workers.find((w) => w.name === "orchestration")?.isRunning;
|
|
2867
2876
|
}
|
|
2868
2877
|
/**
|
|
@@ -2874,7 +2883,7 @@ var Mastra = class Mastra {
|
|
|
2874
2883
|
*/
|
|
2875
2884
|
async __ensureExperimentWorkflow() {
|
|
2876
2885
|
if (this.__hasInternalWorkflow("__mastra-experiment")) return;
|
|
2877
|
-
const { buildExperimentWorkflow } = await import("./manager-
|
|
2886
|
+
const { buildExperimentWorkflow } = await import("./manager-DZhtdV6Q.js").then((n) => n.b);
|
|
2878
2887
|
if (this.__hasInternalWorkflow("__mastra-experiment")) return;
|
|
2879
2888
|
this.__registerInternalWorkflow(buildExperimentWorkflow(), void 0, { distributed: true });
|
|
2880
2889
|
}
|
|
@@ -5075,7 +5084,7 @@ var Mastra = class Mastra {
|
|
|
5075
5084
|
if (!this.#workerFilter || this.#workerFilter.has("agent-schedule")) {
|
|
5076
5085
|
let agentScheduleWorker = this.#findAgentScheduleWorker();
|
|
5077
5086
|
if (!agentScheduleWorker) {
|
|
5078
|
-
const { AgentScheduleWorker } = await import("./worker-
|
|
5087
|
+
const { AgentScheduleWorker } = await import("./worker-DmUkyJY_.js");
|
|
5079
5088
|
agentScheduleWorker = new AgentScheduleWorker();
|
|
5080
5089
|
agentScheduleWorker.__registerMastra(this);
|
|
5081
5090
|
this.#workers.push(agentScheduleWorker);
|
|
@@ -5648,6 +5657,16 @@ var Mastra = class Mastra {
|
|
|
5648
5657
|
async removeTopicListener(topic, listener) {
|
|
5649
5658
|
await this.#pubsub.unsubscribe(topic, this.#ackingTopicListener(listener));
|
|
5650
5659
|
}
|
|
5660
|
+
/**
|
|
5661
|
+
* @internal Registers what a workflow event may need on this instance: the durable loop
|
|
5662
|
+
* workflow of every agent added so far, and the experiment workflow for experiment events.
|
|
5663
|
+
* Workers that process this instance's events with their own processor call it before each event;
|
|
5664
|
+
* it does the same setup handleWorkflowEvent does.
|
|
5665
|
+
*/
|
|
5666
|
+
async __prepareWorkflowEvent(event) {
|
|
5667
|
+
this.#initializeDurableAgents();
|
|
5668
|
+
if (event.data?.workflowId === "__mastra-experiment") await this.__ensureExperimentWorkflow();
|
|
5669
|
+
}
|
|
5651
5670
|
/** Build native durable agents' engines and register their workflows, so event ownership checks can find them. */
|
|
5652
5671
|
#initializeDurableAgents() {
|
|
5653
5672
|
for (const agent of Object.values(this.#agents ?? {})) if (hasDurableExecution(agent) && !isDurableAgentLike(agent)) agent.__initializeDurableExecution();
|
|
@@ -5689,10 +5708,25 @@ var Mastra = class Mastra {
|
|
|
5689
5708
|
if (this.#workflowEventConsumer === consumer) this.#workflowEventConsumer = void 0;
|
|
5690
5709
|
};
|
|
5691
5710
|
}
|
|
5711
|
+
/** @internal */
|
|
5712
|
+
__publishLocalScheduledWorkflowStart(event) {
|
|
5713
|
+
const localScheduleDispatchId = crypto.randomUUID();
|
|
5714
|
+
localScheduledStarts.set(localScheduleDispatchId, {
|
|
5715
|
+
claimant: this,
|
|
5716
|
+
deliveries: /* @__PURE__ */ new Map()
|
|
5717
|
+
});
|
|
5718
|
+
return this.#pubsub.publish("workflows", {
|
|
5719
|
+
...event,
|
|
5720
|
+
data: {
|
|
5721
|
+
...event.data,
|
|
5722
|
+
localScheduleDispatchId
|
|
5723
|
+
}
|
|
5724
|
+
}, { localOnly: true });
|
|
5725
|
+
}
|
|
5692
5726
|
/**
|
|
5693
|
-
* Hands a
|
|
5694
|
-
*
|
|
5695
|
-
*
|
|
5727
|
+
* Hands a local scheduled start to the scheduler's instance, or a durable-agent
|
|
5728
|
+
* event to the instance executing its run. Returns undefined when the caller
|
|
5729
|
+
* should process the event.
|
|
5696
5730
|
*
|
|
5697
5731
|
* Mastra instances sharing an in-process pubsub join the same consumer
|
|
5698
5732
|
* group, so any of them can receive a step of a run another one started.
|
|
@@ -5705,6 +5739,25 @@ var Mastra = class Mastra {
|
|
|
5705
5739
|
* @internal
|
|
5706
5740
|
*/
|
|
5707
5741
|
__delegateWorkflowEvent(event) {
|
|
5742
|
+
if (event.type === "workflow.start" && typeof event.data?.localScheduleDispatchId === "string") {
|
|
5743
|
+
const localStart = localScheduledStarts.get(event.data.localScheduleDispatchId);
|
|
5744
|
+
if (localStart && localStart.claimant.#pubsub.__rawBus() === this.#pubsub.__rawBus()) {
|
|
5745
|
+
const attempt = event.deliveryAttempt;
|
|
5746
|
+
const existing = localStart.deliveries.get(attempt);
|
|
5747
|
+
if (existing) return existing;
|
|
5748
|
+
const delivery = localStart.claimant.#consumeDelegatedWorkflowEvent(event);
|
|
5749
|
+
if (!delivery) return void 0;
|
|
5750
|
+
const result = attempt === void 0 ? delivery.then((outcome) => {
|
|
5751
|
+
if (!outcome.ok && outcome.retry) localStart.deliveries.delete(attempt);
|
|
5752
|
+
return outcome;
|
|
5753
|
+
}, (error) => {
|
|
5754
|
+
localStart.deliveries.delete(attempt);
|
|
5755
|
+
throw error;
|
|
5756
|
+
}) : delivery;
|
|
5757
|
+
localStart.deliveries.set(attempt, result);
|
|
5758
|
+
return result;
|
|
5759
|
+
}
|
|
5760
|
+
}
|
|
5708
5761
|
if (!event.runId) return void 0;
|
|
5709
5762
|
const context = new RequestContext(Object.entries(event.data?.requestContext ?? {}));
|
|
5710
5763
|
const execution = getExecutionClaimScope(context, event.runId, event.data?.parentWorkflow);
|
|
@@ -5739,6 +5792,7 @@ var Mastra = class Mastra {
|
|
|
5739
5792
|
* without run fencing.
|
|
5740
5793
|
*/
|
|
5741
5794
|
async startWorkers(name) {
|
|
5795
|
+
if (this.#shuttingDown) return;
|
|
5742
5796
|
if (this.#storage) await this.#storage.init();
|
|
5743
5797
|
this.#initializeDurableAgents();
|
|
5744
5798
|
await this.__ensureExperimentWorkflow();
|
|
@@ -5760,7 +5814,7 @@ var Mastra = class Mastra {
|
|
|
5760
5814
|
this.#workers.push(sw);
|
|
5761
5815
|
}
|
|
5762
5816
|
if (!this.#findAgentScheduleWorker()) {
|
|
5763
|
-
const { AgentScheduleWorker } = await import("./worker-
|
|
5817
|
+
const { AgentScheduleWorker } = await import("./worker-DmUkyJY_.js");
|
|
5764
5818
|
const asw = new AgentScheduleWorker();
|
|
5765
5819
|
asw.__registerMastra(this);
|
|
5766
5820
|
this.#workers.push(asw);
|
|
@@ -5788,6 +5842,7 @@ var Mastra = class Mastra {
|
|
|
5788
5842
|
}
|
|
5789
5843
|
for (const worker of targets) {
|
|
5790
5844
|
if (worker.isRunning) continue;
|
|
5845
|
+
if (this.#shuttingDown) return;
|
|
5791
5846
|
await worker.init(deps);
|
|
5792
5847
|
await worker.start();
|
|
5793
5848
|
}
|
|
@@ -5894,6 +5949,7 @@ var Mastra = class Mastra {
|
|
|
5894
5949
|
async __ensureExecutionWorkersStarted() {
|
|
5895
5950
|
if (this.#executionWorkersStarted) return;
|
|
5896
5951
|
if (this.#workersDisabled) return;
|
|
5952
|
+
if (this.#shuttingDown) return;
|
|
5897
5953
|
if (!this.#executionWorkersStartPromise) this.#executionWorkersStartPromise = runOutsideRunFenceScope(() => this.#startExecutionWorkers()).finally(() => {
|
|
5898
5954
|
this.#executionWorkersStartPromise = void 0;
|
|
5899
5955
|
});
|
|
@@ -5912,6 +5968,7 @@ var Mastra = class Mastra {
|
|
|
5912
5968
|
if (worker.name !== "orchestration" && worker.name !== "backgroundTasks") continue;
|
|
5913
5969
|
if (this.#workerFilter && !this.#workerFilter.has(worker.name)) continue;
|
|
5914
5970
|
if (worker.isRunning) continue;
|
|
5971
|
+
if (this.#shuttingDown) return;
|
|
5915
5972
|
await worker.init(deps);
|
|
5916
5973
|
await worker.start();
|
|
5917
5974
|
}
|
|
@@ -5950,6 +6007,26 @@ var Mastra = class Mastra {
|
|
|
5950
6007
|
this.#warnedStrandedLocalWorkflowIds.clear();
|
|
5951
6008
|
}
|
|
5952
6009
|
/**
|
|
6010
|
+
* Stop the orchestration worker ahead of the rest of shutdown, for `shutdown({ drain: 'step' })`: it stops reading
|
|
6011
|
+
* workflow events and waits, until `deadline`, for the ones it is handling. Another process on the same pubsub
|
|
6012
|
+
* takes the events published from then on.
|
|
6013
|
+
*/
|
|
6014
|
+
async #stopWorkflowIntake(deadline) {
|
|
6015
|
+
if (!this.#pubsub.__rawBus().redeliversUnacked) {
|
|
6016
|
+
this.#logger?.warn("shutdown({ drain: 'step' }) needs a pubsub that redelivers unacknowledged events (for example Redis Streams); draining runs instead");
|
|
6017
|
+
return;
|
|
6018
|
+
}
|
|
6019
|
+
this.#workflowIntakeStopped = true;
|
|
6020
|
+
const drainTimeout = Math.max(0, deadline - Date.now());
|
|
6021
|
+
await Promise.all(this.#workers.filter((worker) => worker.name === "orchestration" && worker.isRunning).map(async (worker) => {
|
|
6022
|
+
try {
|
|
6023
|
+
await worker.stop({ drainTimeout });
|
|
6024
|
+
} catch (error) {
|
|
6025
|
+
this.#logger?.error("Failed to stop taking workflow events during shutdown", { error });
|
|
6026
|
+
}
|
|
6027
|
+
}));
|
|
6028
|
+
}
|
|
6029
|
+
/**
|
|
5953
6030
|
* Hand back the thread runs this Mastra still holds once its durable executions are abandoned: announce each run's
|
|
5954
6031
|
* end, stop its lease renewal and release its thread lease, so another process can take the thread right away.
|
|
5955
6032
|
*/
|
|
@@ -6210,7 +6287,7 @@ var Mastra = class Mastra {
|
|
|
6210
6287
|
#syncGatewayRegistry() {
|
|
6211
6288
|
try {
|
|
6212
6289
|
if (process.env.MASTRA_DEV !== "true" && process.env.MASTRA_DEV !== "1") return;
|
|
6213
|
-
import("./provider-registry-
|
|
6290
|
+
import("./provider-registry-C_XQJvu2.js").then((n) => n.d).then(async ({ GatewayRegistry }) => {
|
|
6214
6291
|
const registry = GatewayRegistry.getInstance();
|
|
6215
6292
|
const customGateways = Object.values(this.#gateways || {});
|
|
6216
6293
|
registry.registerCustomGateways(customGateways);
|
|
@@ -6271,6 +6348,16 @@ var Mastra = class Mastra {
|
|
|
6271
6348
|
* call that ignores the abort), or the lease backend doesn't answer or
|
|
6272
6349
|
* fails the release, the lease is kept until it expires. Handing runs back can take up to about 1.5 seconds past
|
|
6273
6350
|
* `drainTimeout`.
|
|
6351
|
+
*
|
|
6352
|
+
* With `drain: 'step'` the instance first stops taking workflow events, so
|
|
6353
|
+
* another process on the same pubsub continues its evented runs. The steps
|
|
6354
|
+
* it is executing still get `drainTimeout` to finish, and the runs it
|
|
6355
|
+
* started are still awaited within the same window while they finish on the
|
|
6356
|
+
* other process. Use it when another process is running during the
|
|
6357
|
+
* shutdown, as in a rolling deploy: with no other process, runs wait for the
|
|
6358
|
+
* next one to start. It is supported on Redis Streams and Valkey Streams,
|
|
6359
|
+
* and ignored on a pubsub that does not redeliver unacknowledged events.
|
|
6360
|
+
* Defaults to `'run'`.
|
|
6274
6361
|
*/
|
|
6275
6362
|
async shutdown(options) {
|
|
6276
6363
|
const drainTimeout = assertDrainTimeout(options?.drainTimeout ?? waitMs(DEFAULT_SHUTDOWN_DRAIN_TIMEOUT_MS, 50), "shutdown");
|
|
@@ -6280,6 +6367,7 @@ var Mastra = class Mastra {
|
|
|
6280
6367
|
this.#durableRecoveryRechecks.clear();
|
|
6281
6368
|
this.#stopWorkflowRecoveryLoop?.();
|
|
6282
6369
|
this.__unregisterHooks();
|
|
6370
|
+
if (options?.drain === "step") await this.#stopWorkflowIntake(deadline);
|
|
6283
6371
|
const awaited = /* @__PURE__ */ new Set();
|
|
6284
6372
|
for (;;) {
|
|
6285
6373
|
const pendingRuns = [
|
package/dist/memory/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_stream = require("../stream-
|
|
3
|
-
const require_execution_fence = require("../execution-fence-
|
|
2
|
+
const require_stream = require("../stream-DqKDB3nL.cjs");
|
|
3
|
+
const require_execution_fence = require("../execution-fence-C8Q0wWkG.cjs");
|
|
4
4
|
const require_message_list = require("../message-list-C0F2sDNC.cjs");
|
|
5
5
|
exports.AUTHORED_USER_TURN = require_message_list.AUTHORED_USER_TURN;
|
|
6
6
|
exports.DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS = require_execution_fence.DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS;
|
package/dist/memory/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Jt as getThreadOMMetadata, Qt as setThreadOMMetadata, Xt as isThreadTitlePinned, Yt as isObservationalMemoryEnabled, Zt as parseMemoryRequestContext, qt as TITLE_PINNED_THREAD_METADATA_KEY } from "../stream-
|
|
2
|
-
import { Ao as MemoryProcessor, Co as buildMessageEmbeddingRows, Do as resolveMaxChunkChars, Eo as messageVectorId, Jn as getMemoryRunState, Mo as filterSystemReminderMessages, No as isSystemReminderMessage, Oo as upsertMessageVectors, So as MESSAGE_EMBEDDING_CHARS_PER_TOKEN, To as extractMessageEmbeddingText, Yn as MockMemory, as as normalizeMessageHistoryConfig, es as groupLinkedToolMessages, is as isAfterMemoryTokenBoundary, jo as memoryDefaultOptions, ko as MastraMemory, ns as advanceMemoryTokenBoundary, qn as MemoryRunState, rs as getMemoryTokenBoundary, ts as loadMessageHistory, wo as chunkMessageText, xo as DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS } from "../execution-fence
|
|
1
|
+
import { Jt as getThreadOMMetadata, Qt as setThreadOMMetadata, Xt as isThreadTitlePinned, Yt as isObservationalMemoryEnabled, Zt as parseMemoryRequestContext, qt as TITLE_PINNED_THREAD_METADATA_KEY } from "../stream-H_wVxqdK.js";
|
|
2
|
+
import { Ao as MemoryProcessor, Co as buildMessageEmbeddingRows, Do as resolveMaxChunkChars, Eo as messageVectorId, Jn as getMemoryRunState, Mo as filterSystemReminderMessages, No as isSystemReminderMessage, Oo as upsertMessageVectors, So as MESSAGE_EMBEDDING_CHARS_PER_TOKEN, To as extractMessageEmbeddingText, Yn as MockMemory, as as normalizeMessageHistoryConfig, es as groupLinkedToolMessages, is as isAfterMemoryTokenBoundary, jo as memoryDefaultOptions, ko as MastraMemory, ns as advanceMemoryTokenBoundary, qn as MemoryRunState, rs as getMemoryTokenBoundary, ts as loadMessageHistory, wo as chunkMessageText, xo as DEFAULT_MESSAGE_EMBEDDING_MAX_CHUNK_CHARS } from "../execution-fence-DGFyUV5h.js";
|
|
3
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-RgFlLrxG.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 };
|
|
@@ -4,7 +4,7 @@ import { i as MastraError, n as ErrorDomain, t as ErrorCategory } from "./error-
|
|
|
4
4
|
import { n as executeWithContextSync, t as executeWithContext } from "./utils-DU_pU5SK.js";
|
|
5
5
|
import { _ as resolveObservabilityContext } from "./observability-DPDWibyH.js";
|
|
6
6
|
import { isStandardSchemaWithJSON, standardSchemaToJSONSchema, toStandardSchema } from "./schema/index.js";
|
|
7
|
-
import { i as delay, u as isZodType$1 } from "./utils-
|
|
7
|
+
import { i as delay, u as isZodType$1 } from "./utils-h5k_ChdS.js";
|
|
8
8
|
import { i as isZodArray, t as getZodDef } from "./zod-utils-BDDS_mxU.js";
|
|
9
9
|
import { AnthropicSchemaCompatLayer, DeepSeekSchemaCompatLayer, GoogleSchemaCompatLayer, MetaSchemaCompatLayer, OpenAIReasoningSchemaCompatLayer, OpenAISchemaCompatLayer, applyCompatLayer, jsonSchema } from "@mastra/schema-compat";
|
|
10
10
|
// src/stream/aisdk/v4/usage.ts
|
|
@@ -3,7 +3,7 @@ const require_base = require("./base-BIzR1D3_.cjs");
|
|
|
3
3
|
const require_error = require("./error-D90lJ6M7.cjs");
|
|
4
4
|
const require_utils = require("./utils-D-eNsgDM.cjs");
|
|
5
5
|
const require_observability = require("./observability-VaoaeadK.cjs");
|
|
6
|
-
const require_utils$1 = require("./utils-
|
|
6
|
+
const require_utils$1 = require("./utils-Dd4m7z13.cjs");
|
|
7
7
|
const require_zod_utils = require("./zod-utils-Cl5jw5N_.cjs");
|
|
8
8
|
let _mastra_schema_compat = require("@mastra/schema-compat");
|
|
9
9
|
let _mastra_schema_compat_schema = require("@mastra/schema-compat/schema");
|
|
@@ -29127,7 +29127,7 @@ function createOpenRouter(options = {}) {
|
|
|
29127
29127
|
}
|
|
29128
29128
|
createOpenRouter({ compatibility: "strict" });
|
|
29129
29129
|
// src/llm/model/gateways/constants.ts
|
|
29130
|
-
const MASTRA_USER_AGENT = `mastra/1.
|
|
29130
|
+
const MASTRA_USER_AGENT = `mastra/1.88.0-alpha.0`;
|
|
29131
29131
|
const PROVIDERS_WITH_INSTALLED_PACKAGES = [
|
|
29132
29132
|
"anthropic",
|
|
29133
29133
|
"cerebras",
|
|
@@ -29126,7 +29126,7 @@ function createOpenRouter(options = {}) {
|
|
|
29126
29126
|
}
|
|
29127
29127
|
createOpenRouter({ compatibility: "strict" });
|
|
29128
29128
|
// src/llm/model/gateways/constants.ts
|
|
29129
|
-
const MASTRA_USER_AGENT = `mastra/1.
|
|
29129
|
+
const MASTRA_USER_AGENT = `mastra/1.88.0-alpha.0`;
|
|
29130
29130
|
const PROVIDERS_WITH_INSTALLED_PACKAGES = [
|
|
29131
29131
|
"anthropic",
|
|
29132
29132
|
"cerebras",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_execution_fence = require("../execution-fence-
|
|
2
|
+
const require_execution_fence = require("../execution-fence-C8Q0wWkG.cjs");
|
|
3
3
|
const require_tool = require("../tool-Dn9WSDVn.cjs");
|
|
4
4
|
let zod_v4 = require("zod/v4");
|
|
5
5
|
// src/notifications/tool.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Br as notificationSignalAttributes, Fr as InMemoryNotificationsStorage, Gr as readNotificationRoutingRequirement, Hr as notificationSummaryContents, Ir as NotificationsStorage, Jr as resolveDeliveryFailureUpdate, Kr as MAX_NOTIFICATION_DELIVERY_ATTEMPTS, Lr as dispatchDueNotifications, Rr as createNotificationSignal, Ur as notificationSummarySignalMetadata, Vr as notificationSignalMetadata, Wr as summarizeNotifications, Yr as resolveNotificationDeliveryDecision, qr as defaultNotificationDeliveryDecision, zr as createNotificationSummarySignal } from "../execution-fence
|
|
1
|
+
import { Br as notificationSignalAttributes, Fr as InMemoryNotificationsStorage, Gr as readNotificationRoutingRequirement, Hr as notificationSummaryContents, Ir as NotificationsStorage, Jr as resolveDeliveryFailureUpdate, Kr as MAX_NOTIFICATION_DELIVERY_ATTEMPTS, Lr as dispatchDueNotifications, Rr as createNotificationSignal, Ur as notificationSummarySignalMetadata, Vr as notificationSignalMetadata, Wr as summarizeNotifications, Yr as resolveNotificationDeliveryDecision, qr as defaultNotificationDeliveryDecision, zr as createNotificationSummarySignal } from "../execution-fence-DGFyUV5h.js";
|
|
2
2
|
import { r as createTool } from "../tool-DIFduuTw.js";
|
|
3
3
|
import { z } from "zod/v4";
|
|
4
4
|
// src/notifications/tool.ts
|