@mastra/core 1.86.0 → 1.87.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/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 +3 -1
- package/dist/agent/durable/index.d.ts +1 -1
- package/dist/agent/durable/index.js +2 -2
- package/dist/agent/durable/run-registry.d.ts +2 -0
- package/dist/agent/durable/segment-spans.d.ts +54 -1
- package/dist/agent/durable/types.d.ts +10 -0
- package/dist/agent/durable/workflows/durable-loop-builder.d.ts +57 -2
- package/dist/agent/durable/workflows/finalize-run.d.ts +2 -0
- 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 +2 -2
- package/dist/agent/index.js +2 -2
- package/dist/agent/request-context-snapshot.d.ts +3 -2
- package/dist/agent/streams/run-records.d.ts +9 -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-D5EKeS1H.js → agent-controller-B8LoFdtu.js} +43 -13
- package/dist/{agent-controller-D_5Dc8d3.cjs → agent-controller-DSnFynpa.cjs} +43 -13
- 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-BVxb0VGV.cjs → background-tasks-Ci5h0dhj.cjs} +139 -51
- package/dist/{background-tasks-idnlMbqD.js → background-tasks-IW7M4iD2.js} +139 -51
- package/dist/browser/index.cjs +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/{builder-CBWoYNck.cjs → builder-14Uptu8y.cjs} +2 -2
- package/dist/{builder-Cuq-j2w3.js → builder-DI2c2xjy.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 +200 -200
- package/dist/capabilities/abliteratedllm.json +34 -34
- package/dist/capabilities/abliteration-ai.json +8 -8
- package/dist/capabilities/above.json +24 -24
- package/dist/capabilities/adaption.json +15 -15
- package/dist/capabilities/adzuki.json +29 -29
- package/dist/capabilities/agentrouter.json +12 -12
- package/dist/capabilities/agnes.json +2 -2
- package/dist/capabilities/ai-router.json +5 -5
- package/dist/capabilities/aiand.json +25 -25
- package/dist/capabilities/aigrow.json +13 -13
- package/dist/capabilities/aimlapi.json +149 -152
- package/dist/capabilities/aixy.json +20 -20
- package/dist/capabilities/aki-io.json +10 -10
- package/dist/capabilities/alibaba-cn.json +85 -85
- 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 +44 -44
- package/dist/capabilities/alibaba-token-plan.json +47 -47
- package/dist/capabilities/alibaba.json +62 -62
- package/dist/capabilities/ambient.json +14 -14
- package/dist/capabilities/amd.json +8 -8
- package/dist/capabilities/anthropic.json +39 -39
- package/dist/capabilities/anyapi.json +13 -13
- package/dist/capabilities/apiko.json +5 -5
- package/dist/capabilities/arcee.json +11 -11
- package/dist/capabilities/augure.json +4 -4
- package/dist/capabilities/auriko.json +21 -21
- package/dist/capabilities/bailing.json +4 -4
- package/dist/capabilities/baseten.json +33 -33
- package/dist/capabilities/bee.json +5 -5
- package/dist/capabilities/berget.json +4 -4
- package/dist/capabilities/bothub.json +16 -16
- package/dist/capabilities/boundless.json +37 -37
- package/dist/capabilities/bumo.json +48 -48
- package/dist/capabilities/byteplus.json +25 -25
- package/dist/capabilities/cheapaimodel.json +5 -5
- package/dist/capabilities/cheapest-token.json +28 -28
- package/dist/capabilities/chutes.json +11 -14
- package/dist/capabilities/cline-pass.json +41 -41
- package/dist/capabilities/cloudcode.json +9 -9
- package/dist/capabilities/cloudferro-sherlock.json +4 -4
- package/dist/capabilities/cloudflare-workers-ai.json +18 -79
- package/dist/capabilities/commandcode.json +155 -155
- package/dist/capabilities/concentrate.json +279 -270
- package/dist/capabilities/cortecs.json +100 -100
- package/dist/capabilities/crossmodel.json +178 -178
- package/dist/capabilities/crusoe.json +9 -9
- package/dist/capabilities/daoxe.json +9 -9
- package/dist/capabilities/databricks.json +137 -137
- package/dist/capabilities/deepinfra.json +124 -61
- package/dist/capabilities/deepseek.json +3 -3
- package/dist/capabilities/digitalocean.json +113 -113
- package/dist/capabilities/dothoosh.json +32 -32
- package/dist/capabilities/doubleword.json +26 -26
- package/dist/capabilities/edenai.json +448 -473
- package/dist/capabilities/empiriolabs.json +163 -165
- package/dist/capabilities/engy.json +19 -19
- package/dist/capabilities/entrim.json +6 -6
- package/dist/capabilities/evroc.json +16 -16
- package/dist/capabilities/ezkielyna.json +12 -12
- package/dist/capabilities/fastrouter.json +73 -73
- package/dist/capabilities/fireworks-ai.json +83 -62
- package/dist/capabilities/freemodel.json +15 -15
- package/dist/capabilities/friendli.json +2 -2
- package/dist/capabilities/frogbot.json +99 -99
- package/dist/capabilities/gisoo.json +17 -17
- package/dist/capabilities/gmicloud.json +14 -14
- package/dist/capabilities/google.json +57 -57
- package/dist/capabilities/graphn.json +9 -9
- package/dist/capabilities/greenpt.json +36 -36
- package/dist/capabilities/groq.json +8 -8
- package/dist/capabilities/helicone.json +82 -82
- package/dist/capabilities/hopper.json +2 -2
- package/dist/capabilities/hostinger-router.json +10 -10
- package/dist/capabilities/hpc-ai.json +14 -14
- package/dist/capabilities/huawei-maas.json +16 -16
- package/dist/capabilities/hubris.json +29 -29
- package/dist/capabilities/huggingface.json +94 -84
- package/dist/capabilities/humain.json +2 -2
- package/dist/capabilities/hyper.json +23 -23
- package/dist/capabilities/impossibl.json +136 -136
- package/dist/capabilities/inception.json +2 -2
- package/dist/capabilities/inceptron.json +8 -8
- package/dist/capabilities/inco.json +2 -2
- package/dist/capabilities/infer.json +14 -14
- package/dist/capabilities/inferall.json +7 -7
- package/dist/capabilities/inference-coop.json +3 -3
- package/dist/capabilities/inferenceapis.json +20 -20
- package/dist/capabilities/inferris.json +3 -3
- package/dist/capabilities/infersia.json +8 -8
- package/dist/capabilities/inferx.json +3 -3
- package/dist/capabilities/infomaniak.json +2 -2
- package/dist/capabilities/io-net.json +4 -4
- package/dist/capabilities/isoquant.json +4 -4
- package/dist/capabilities/iteracompute.json +61 -61
- package/dist/capabilities/jalapeno.json +12 -12
- package/dist/capabilities/jiekou.json +60 -60
- package/dist/capabilities/joingonka.json +4 -4
- package/dist/capabilities/jzstoken.json +55 -55
- package/dist/capabilities/keln.json +25 -25
- package/dist/capabilities/kenari.json +122 -122
- package/dist/capabilities/kilo.json +633 -617
- package/dist/capabilities/kimi-code-plan-cn.json +6 -6
- package/dist/capabilities/kimi-code-plan-global.json +6 -6
- package/dist/capabilities/kitani.json +6 -6
- package/dist/capabilities/klavo.json +20 -20
- package/dist/capabilities/korouter.json +32 -32
- package/dist/capabilities/kunavo.json +9 -9
- package/dist/capabilities/liquid.json +12 -12
- package/dist/capabilities/lithosai.json +3 -3
- package/dist/capabilities/llmgateway-providers.json +912 -903
- package/dist/capabilities/llmgateway.json +346 -338
- package/dist/capabilities/llmtr.json +30 -30
- package/dist/capabilities/logits.json +2 -2
- package/dist/capabilities/lowrouter.json +53 -53
- package/dist/capabilities/lyceum.json +10 -10
- package/dist/capabilities/melious.json +12 -12
- package/dist/capabilities/merge-gateway.json +276 -276
- package/dist/capabilities/meta.json +10 -10
- package/dist/capabilities/mistral.json +21 -21
- package/dist/capabilities/mixlayer.json +2 -2
- package/dist/capabilities/modal.json +6 -6
- package/dist/capabilities/model-oracle-ai.json +25 -25
- package/dist/capabilities/modelis.json +15 -15
- package/dist/capabilities/modelscope.json +2 -2
- package/dist/capabilities/modular.json +6 -6
- package/dist/capabilities/moneo.json +14 -14
- package/dist/capabilities/moonshotai-cn.json +7 -7
- package/dist/capabilities/moonshotai.json +7 -7
- package/dist/capabilities/morph.json +16 -16
- package/dist/capabilities/munito-eu.json +6 -6
- package/dist/capabilities/munito.json +10 -10
- package/dist/capabilities/nan.json +24 -24
- package/dist/capabilities/nano-gpt.json +612 -579
- package/dist/capabilities/nearai.json +97 -97
- package/dist/capabilities/nebius.json +32 -32
- package/dist/capabilities/neon.json +131 -131
- package/dist/capabilities/neuralwatt.json +43 -43
- package/dist/capabilities/nokeep.json +4 -4
- package/dist/capabilities/novita-ai.json +148 -148
- package/dist/capabilities/nvidia.json +17 -49
- package/dist/capabilities/obscurify.json +26 -26
- package/dist/capabilities/oci.json +16 -7
- package/dist/capabilities/ofox.json +344 -344
- package/dist/capabilities/ollama-cloud.json +56 -56
- package/dist/capabilities/openai.json +81 -49
- package/dist/capabilities/opencode-go.json +90 -90
- package/dist/capabilities/openreason.json +5 -5
- package/dist/capabilities/openrouter.json +563 -547
- package/dist/capabilities/opper.json +29 -29
- package/dist/capabilities/orcarouter.json +252 -252
- package/dist/capabilities/outerlabs.json +33 -33
- package/dist/capabilities/ovhcloud.json +59 -5
- package/dist/capabilities/pareto.json +5 -5
- package/dist/capabilities/perplexity-agent.json +66 -66
- package/dist/capabilities/phala.json +30 -30
- package/dist/capabilities/pioneer.json +24 -24
- package/dist/capabilities/poe.json +117 -117
- package/dist/capabilities/poolside.json +2 -2
- package/dist/capabilities/powerspring.json +14 -14
- package/dist/capabilities/primalabs.json +11 -11
- package/dist/capabilities/prime.json +129 -113
- package/dist/capabilities/privatemode-ai.json +14 -14
- package/dist/capabilities/proxystacks.json +6 -6
- package/dist/capabilities/qiniu-ai.json +14 -14
- package/dist/capabilities/refuseless.json +5 -5
- package/dist/capabilities/regolo-ai.json +9 -9
- package/dist/capabilities/requesty.json +172 -172
- package/dist/capabilities/ruapi.json +18 -18
- package/dist/capabilities/runcrate.json +15 -15
- package/dist/capabilities/runinfra.json +16 -16
- package/dist/capabilities/sakana.json +6 -6
- package/dist/capabilities/sambanova.json +9 -9
- package/dist/capabilities/sandbase.json +21 -21
- package/dist/capabilities/sarvam.json +8 -8
- package/dist/capabilities/scaleway.json +18 -18
- package/dist/capabilities/scnet-token-plan.json +9 -9
- package/dist/capabilities/scx-ai.json +30 -30
- package/dist/capabilities/sensenova.json +8 -8
- package/dist/capabilities/siliconflow-cn.json +62 -62
- package/dist/capabilities/siliconflow.json +58 -58
- package/dist/capabilities/snowflake-cortex.json +22 -22
- package/dist/capabilities/sokkan.json +10 -10
- package/dist/capabilities/sparrowcodes.json +22 -22
- package/dist/capabilities/standardcompute.json +101 -101
- package/dist/capabilities/steadyrouter.json +43 -43
- 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 +22 -22
- package/dist/capabilities/subconscious.json +2 -2
- package/dist/capabilities/superbot-gg.json +4 -4
- package/dist/capabilities/synthetic.json +14 -14
- package/dist/capabilities/synthorai.json +22 -22
- package/dist/capabilities/teamorouter.json +23 -23
- package/dist/capabilities/teapot-router.json +16 -16
- package/dist/capabilities/tencent-token-plan.json +57 -33
- package/dist/capabilities/tencent-tokenhub.json +48 -48
- package/dist/capabilities/tensorx.json +46 -46
- package/dist/capabilities/tenstorrent.json +2 -2
- package/dist/capabilities/the-grid-ai.json +31 -31
- package/dist/capabilities/thinkingmachines.json +44 -44
- package/dist/capabilities/tinfoil.json +11 -11
- package/dist/capabilities/toapis.json +3 -3
- package/dist/capabilities/togetherai.json +53 -51
- package/dist/capabilities/tokengo.json +24 -24
- package/dist/capabilities/tokenify.json +10 -10
- package/dist/capabilities/trustedrouter.json +6 -6
- package/dist/capabilities/trustedtokens.json +16 -16
- package/dist/capabilities/umans-ai-coding-plan.json +15 -15
- package/dist/capabilities/umans-ai.json +9 -9
- package/dist/capabilities/unrestricted.json +8 -8
- package/dist/capabilities/uplinkswitch.json +21 -21
- package/dist/capabilities/upstage.json +6 -6
- package/dist/capabilities/vancine.json +21 -21
- package/dist/capabilities/vercel.json +578 -578
- package/dist/capabilities/vivgrid.json +81 -81
- package/dist/capabilities/volcengine-coding-plan.json +26 -26
- package/dist/capabilities/volcengine.json +27 -27
- package/dist/capabilities/vultr.json +25 -25
- package/dist/capabilities/wafer.ai.json +18 -18
- package/dist/capabilities/wallaby.json +5 -5
- package/dist/capabilities/wally.json +12 -12
- package/dist/capabilities/wandb.json +19 -19
- package/dist/capabilities/watt.json +22 -22
- 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 +11 -11
- package/dist/capabilities/xxapi.json +32 -32
- package/dist/capabilities/zai-coding-plan.json +16 -16
- package/dist/capabilities/zai.json +34 -32
- package/dist/capabilities/zenifra.json +26 -26
- package/dist/capabilities/zenmux.json +187 -187
- package/dist/capabilities/zerogpu.json +13 -13
- package/dist/capabilities/zhipuai-coding-plan.json +7 -7
- package/dist/capabilities/zhipuai.json +29 -29
- package/dist/capabilities/zro.json +6 -6
- package/dist/channels/agent-channels.d.ts +2 -1
- package/dist/channels/formatting.d.ts +8 -0
- package/dist/channels/index.cjs +4 -2
- package/dist/channels/index.d.ts +1 -1
- package/dist/channels/index.js +3 -3
- package/dist/channels/types.d.ts +5 -3
- package/dist/{channels-DSOCNoab.js → channels-Wh32drgu.js} +1 -1
- package/dist/{channels-D7bBM9xD.cjs → channels-tVV_de9Q.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 +789 -789
- package/dist/docs/references/docs-agents-resumable-streams.md +15 -6
- package/dist/docs/references/docs-deployment-workers.md +3 -1
- 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 +3 -3
- package/dist/docs/references/reference-agents-generate.md +2 -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.md +1 -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 +7986 -7970
- package/dist/{llm-DMNEZIV9.js → llm-B1zaFLYZ.js} +3 -3
- package/dist/{llm-BOQR5g0t.cjs → llm-BAiOsNAP.cjs} +3 -3
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/{manager-CyCR9IpR.cjs → manager-BVX9nVrM.cjs} +2 -2
- package/dist/{manager-BzNynLwT.js → manager-ChK9GdGz.js} +2 -2
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-CqBmnzjM.js → mastra-CUGfgEpZ.js} +28 -18
- package/dist/{mastra-D2B01_gg.cjs → mastra-HSmofHEJ.cjs} +28 -18
- package/dist/memory/index.cjs +2 -2
- package/dist/memory/index.js +2 -2
- package/dist/{model-3AeJKHLU.js → model-C47BJRtR.js} +1 -1
- package/dist/{model-CrXDhcbw.cjs → model-WahorgzJ.cjs} +1 -1
- package/dist/{netlify-DUPSTzi6.js → netlify-CfDXkuLf.js} +2 -2
- package/dist/{netlify-DTXLQiG1.cjs → netlify-D99AnEhW.cjs} +2 -2
- 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-B_rC-5aL.cjs → provider-registry-CO1NVbO5.cjs} +22281 -22258
- package/dist/{provider-registry-BeB8RQO8.js → provider-registry-CR385GJ4.js} +22281 -22258
- package/dist/provider-registry.json +22871 -22855
- package/dist/{registry-generator-Cv6GnxLG.js → registry-generator-B3erRqYS.js} +1 -1
- package/dist/{registry-generator-DbBoIOby.cjs → registry-generator-Cvp34qcB.cjs} +1 -1
- package/dist/{rehydrate-3f-i1Ga2.js → rehydrate-CJBLrZxs.js} +2 -2
- package/dist/{rehydrate-BWaa2eGN.cjs → rehydrate-Da4hNuaK.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-DdeEBsVW.js} +1639 -568
- package/dist/{run-registry-Bk6QxNE4.cjs → run-registry-TOOfO3hT.cjs} +1668 -567
- 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-DVy0Z-m0.js → stream-C5PagEDs.js} +3 -3
- package/dist/{stream-BIXX67WE.cjs → stream-DH7Qgz8l.cjs} +3 -3
- 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-DDeKGwtr.cjs → tool-loop-agent-CJTs4T8b.cjs} +3 -3
- package/dist/{tool-loop-agent-PSKeNhuT.js → tool-loop-agent-DVYJXlQJ.js} +3 -3
- package/dist/{utils-BJiQF8Pi.js → utils-D8upuTwy.js} +1 -1
- package/dist/{utils-CAnUlnUm.cjs → utils-xJi_N6Tx.cjs} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-BMNxfs4Z.cjs → validate-6eZ8Wssn.cjs} +1 -1
- package/dist/{validate-BAVwAgtT.js → validate-DTkW3Vlp.js} +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.js +1 -1
- package/dist/{worker-CFUKBBCF.cjs → worker-24ORi-wV.cjs} +2 -2
- package/dist/{worker-Brwa-HqM.cjs → worker-BO3u_WjZ.cjs} +2 -2
- package/dist/{worker-BlvJM_Hu.js → worker-DbcFkKJO.js} +2 -2
- package/dist/{worker-CVoD3tts.js → worker-Dqubrnf8.js} +2 -2
- package/dist/{workflow-zvQGBMCM.cjs → workflow-D5Fc5ieC.cjs} +4 -4
- package/dist/{workflow-BSLS7_vB.js → workflow-wXOf72fO.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 +6 -6
- package/src/llm/model/provider-types.generated.d.ts +7986 -7970
|
@@ -3,9 +3,48 @@ import type { WorkflowsStorage } from '../storage/domains/workflows/base.js';
|
|
|
3
3
|
import type { RunFence, RunOwnershipRecord } from '../storage/run-fencing.js';
|
|
4
4
|
export declare const WORKFLOW_RUN_LEASE_TTL_MS: number;
|
|
5
5
|
export declare const WORKFLOW_RUN_LEASE_RENEW_INTERVAL_MS: number;
|
|
6
|
+
/**
|
|
7
|
+
* How many times a run's lease can double past its base length, one doubling per restart over a
|
|
8
|
+
* lease that lapsed. Caps how much later a worker that really died is recovered.
|
|
9
|
+
*/
|
|
10
|
+
export declare const WORKFLOW_RUN_LEASE_MAX_DOUBLINGS = 3;
|
|
11
|
+
/** The longest `leaseTtlMs`, so that even after every doubling the lease stays within {@link MAX_LEASE_MS}. */
|
|
12
|
+
export declare const MAX_WORKFLOW_RUN_LEASE_TTL_MS: number;
|
|
13
|
+
/**
|
|
14
|
+
* The shortest `leaseTtlMs`. A run renews every third of its lease with one storage write, and
|
|
15
|
+
* `createRun()` options can come from a request body, so a tiny value must not set that rate.
|
|
16
|
+
*/
|
|
17
|
+
export declare const MIN_WORKFLOW_RUN_LEASE_TTL_MS = 1000;
|
|
18
|
+
/**
|
|
19
|
+
* `leaseTtlMs` as configured, rounded up to whole milliseconds and kept between
|
|
20
|
+
* {@link MIN_WORKFLOW_RUN_LEASE_TTL_MS} and {@link MAX_WORKFLOW_RUN_LEASE_TTL_MS}, or `fallback`
|
|
21
|
+
* when it is not a positive finite number. `fallback` is used as is, so the default lease from
|
|
22
|
+
* `MASTRA_AGENT_THREAD_LEASE_TTL_MS` can be shorter than the minimum.
|
|
23
|
+
*/
|
|
24
|
+
export declare function normalizeLeaseTtlMs(leaseTtlMs: unknown, fallback: number): number;
|
|
25
|
+
/**
|
|
26
|
+
* The lease a restart claims a run with. After a lease that lapsed without being released, its
|
|
27
|
+
* last owner stopped renewing (it crashed, or blocked its event loop past the lease), so the
|
|
28
|
+
* restart doubles that lease to give a step that blocks the same way room to finish. The previous
|
|
29
|
+
* length is the owners row's `leaseExpiresAt - updatedAt`, which stores write in one statement.
|
|
30
|
+
* Stores that read their clock twice there can come out a few milliseconds short; the result
|
|
31
|
+
* never drops below `baseMs` or the previous length, so that only trims the doubling.
|
|
32
|
+
*/
|
|
33
|
+
export declare function leaseAfterTakeover(baseMs: number, previous: RunOwnershipRecord | null): {
|
|
34
|
+
leaseMs: number;
|
|
35
|
+
previousLeaseMs?: number;
|
|
36
|
+
};
|
|
6
37
|
export interface WorkflowRunOwnership {
|
|
7
38
|
release(): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Runs `fn` with every workflows save it makes to `runId` (the claimed run, or a nested run the
|
|
41
|
+
* claim covers from then on) carrying this claim, so storage refuses it once another execution
|
|
42
|
+
* claimed the run.
|
|
43
|
+
*/
|
|
44
|
+
run<T>(runId: string, fn: () => T): T;
|
|
8
45
|
}
|
|
46
|
+
/** The handle of a run that holds no claim: saves stay unfenced and nothing is released. */
|
|
47
|
+
export declare const UNCLAIMED_WORKFLOW_RUN: WorkflowRunOwnership;
|
|
9
48
|
/**
|
|
10
49
|
* Runs `tick` `intervalMs` after it starts, then again `intervalMs` after
|
|
11
50
|
* each run of it settles, until the returned function is called. A tick that
|
|
@@ -21,33 +60,60 @@ export declare function repeatAfterSettled(tick: () => Promise<void>, intervalMs
|
|
|
21
60
|
immediately?: boolean;
|
|
22
61
|
}): () => void;
|
|
23
62
|
/**
|
|
24
|
-
* Renews the lease `fence` holds every
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* the
|
|
63
|
+
* Renews the lease `fence` holds, `leaseMs` long, every third of it (every
|
|
64
|
+
* {@link WORKFLOW_RUN_LEASE_RENEW_INTERVAL_MS} for the default lease) until
|
|
65
|
+
* the returned function is called, counting each interval from the end of the
|
|
66
|
+
* previous renewal. Stops by itself after the first renewal that finds the
|
|
67
|
+
* claim superseded, reporting it through `onLost`.
|
|
68
|
+
*
|
|
69
|
+
* When a renewal, or the returned function, finds that a lease length passed
|
|
70
|
+
* since the last renewal (or the claim, sent at `since`) that succeeded, the
|
|
71
|
+
* lease may have lapsed meanwhile: that is reported through `onStall`, once
|
|
72
|
+
* per stall in this process. Gaps after a failed renewal are left to `onError`.
|
|
28
73
|
*/
|
|
29
|
-
export declare function renewWorkflowLease({ store, fence, onLost, onError, }: {
|
|
74
|
+
export declare function renewWorkflowLease({ store, fence, leaseMs, since, onLost, onError, onStall, }: {
|
|
30
75
|
store: WorkflowsStorage;
|
|
31
76
|
fence: RunFence;
|
|
77
|
+
leaseMs?: number;
|
|
78
|
+
since?: number;
|
|
32
79
|
onLost: (owner: RunOwnershipRecord | null) => void;
|
|
33
80
|
onError: (error: unknown) => void;
|
|
81
|
+
onStall?: (sinceRenewalMs: number) => void;
|
|
34
82
|
}): () => void;
|
|
35
83
|
/**
|
|
36
84
|
* Marks this process as the live driver of a workflow run through the storage
|
|
37
85
|
* run-ownership lease (the one durable agents use), renewing it while the run
|
|
38
|
-
* executes.
|
|
39
|
-
*
|
|
86
|
+
* executes. The lease tells the recovery sweep on other replicas that the run
|
|
87
|
+
* is not orphaned, and saves made inside {@link WorkflowRunOwnership.run} carry
|
|
88
|
+
* it, so a process that lost the run can't overwrite the new owner's saves.
|
|
40
89
|
*
|
|
41
90
|
* Returns the current owner record instead of a handle when `force` is off and
|
|
42
91
|
* another execution holds a live lease. Stores without run fencing get a no-op
|
|
43
92
|
* handle, keeping their previous behaviour.
|
|
93
|
+
*
|
|
94
|
+
* The lease is `leaseMs` long. With `backOff`, a claim over a lease that lapsed
|
|
95
|
+
* takes a longer one (see {@link leaseAfterTakeover}).
|
|
44
96
|
*/
|
|
45
|
-
export declare function claimWorkflowRunOwnership({ store, runId, force, logger, }: {
|
|
97
|
+
export declare function claimWorkflowRunOwnership({ store, runId, force, logger, leaseMs: baseLeaseMs, backOff, }: {
|
|
46
98
|
store: WorkflowsStorage | undefined;
|
|
47
99
|
runId: string;
|
|
48
100
|
force: boolean;
|
|
49
101
|
logger?: IMastraLogger;
|
|
102
|
+
leaseMs?: number;
|
|
103
|
+
backOff?: boolean;
|
|
50
104
|
}): Promise<WorkflowRunOwnership | {
|
|
51
105
|
owner: RunOwnershipRecord | null;
|
|
52
106
|
}>;
|
|
107
|
+
/** The fence of the `RunFenceConflictError` in `error` or its cause chain, if there is one. */
|
|
108
|
+
export declare function runFenceConflictOf(error: unknown): RunFence | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Whether storage refused `error`'s save because the claim the current fence scope holds was
|
|
111
|
+
* replaced, so this execution lost its run. A conflict on another run (one a step started) is not.
|
|
112
|
+
*/
|
|
113
|
+
export declare function isOwnRunFenceConflict(error: unknown): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Makes the saves of `nestedRunId` carry the claim of the workflow run execution this runs in, when
|
|
116
|
+
* that claim covers `parentRunId`. Unlike `coverNestedRun`, it leaves a durable agent's fence alone.
|
|
117
|
+
*/
|
|
118
|
+
export declare function coverNestedWorkflowRun(parentRunId: string, nestedRunId: string): void;
|
|
53
119
|
//# sourceMappingURL=run-ownership.d.ts.map
|
|
@@ -476,8 +476,24 @@ export interface WorkflowOptions<TStorageVersion extends 1 | 2 = 1> {
|
|
|
476
476
|
* whose side effects must not be re-driven by a blanket restart — durable
|
|
477
477
|
* agent workflows set this to false because their recovery is owned by the
|
|
478
478
|
* dedicated opt-in path (`recovery.durableAgents: 'auto'`).
|
|
479
|
+
*
|
|
480
|
+
* It also decides whether a default-engine run holds a storage run lease while
|
|
481
|
+
* it executes. On storage with run fencing, a leased run's saves carry that
|
|
482
|
+
* lease, so once another process takes the run over, storage refuses this
|
|
483
|
+
* process's saves and its call rejects with `STORAGE_RUN_FENCE_CONFLICT`.
|
|
479
484
|
*/
|
|
480
485
|
autoRestartActiveRuns?: boolean;
|
|
486
|
+
/**
|
|
487
|
+
* How long, in milliseconds, the storage run lease of this workflow's runs lasts
|
|
488
|
+
* without a renewal. Only runs that take a lease use it (see
|
|
489
|
+
* `autoRestartActiveRuns`). The lease is renewed every third of it, so a step
|
|
490
|
+
* that blocks the event loop for longer than this lets another process take
|
|
491
|
+
* the run over. A restart over a lease that lapsed doubles it, up to 8 times
|
|
492
|
+
* this value. Defaults to `MASTRA_AGENT_THREAD_LEASE_TTL_MS` (15000).
|
|
493
|
+
* Values under 1000 are raised to 1000.
|
|
494
|
+
* `createRun({ leaseTtlMs })` overrides it for one run.
|
|
495
|
+
*/
|
|
496
|
+
leaseTtlMs?: number;
|
|
481
497
|
shouldPersistSnapshot?: ShouldPersistSnapshotFn;
|
|
482
498
|
/**
|
|
483
499
|
* Evaluates `shouldPersistSnapshot` before entering the durable operation so a
|
|
@@ -505,6 +505,8 @@ export declare class Workflow<TEngineType = DefaultEngineType, TSteps extends St
|
|
|
505
505
|
shouldPersistSnapshot?: WorkflowOptions['shouldPersistSnapshot'];
|
|
506
506
|
/** Overrides the workflow-wide tracing policy for this run only. */
|
|
507
507
|
tracingPolicy?: TracingPolicy;
|
|
508
|
+
/** Overrides the workflow's `leaseTtlMs` option for this run only. */
|
|
509
|
+
leaseTtlMs?: number;
|
|
508
510
|
parentWorkflow?: NestedWorkflowParent;
|
|
509
511
|
}): Promise<Run<TEngineType, TSteps, TState, TInput, TOutput, TRequestContext, TStorageVersion>>;
|
|
510
512
|
listScorers({ requestContext, }?: {
|
|
@@ -702,6 +704,8 @@ export declare class Run<TEngineType = DefaultEngineType, TSteps extends Step<st
|
|
|
702
704
|
storageVersion?: 1 | 2;
|
|
703
705
|
/** Whether the boot-time recovery sweep may restart this run, so it must hold an ownership lease while it executes. */
|
|
704
706
|
recoverable?: boolean;
|
|
707
|
+
/** The length of that lease, before any backoff. */
|
|
708
|
+
leaseTtlMs?: number;
|
|
705
709
|
});
|
|
706
710
|
get abortController(): AbortController;
|
|
707
711
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.87.0-alpha.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -967,18 +967,18 @@
|
|
|
967
967
|
"zod": "^4.6.7",
|
|
968
968
|
"zod-v3": "npm:zod@3.25.76",
|
|
969
969
|
"@internal/ai-sdk-v4": "0.0.99",
|
|
970
|
-
"@internal/ai-sdk-v5": "0.0.99",
|
|
971
|
-
"@internal/ai-v7": "0.0.99",
|
|
972
970
|
"@internal/ai-v6": "0.0.99",
|
|
971
|
+
"@internal/ai-v7": "0.0.99",
|
|
972
|
+
"@internal/ai-sdk-v5": "0.0.99",
|
|
973
973
|
"@internal/auth": "0.0.40",
|
|
974
974
|
"@internal/core": "0.1.4",
|
|
975
975
|
"@internal/deployer": "0.0.5",
|
|
976
976
|
"@internal/external-types": "0.0.102",
|
|
977
|
-
"@internal/lint": "0.0.152",
|
|
978
977
|
"@internal/llm-recorder": "0.0.88",
|
|
978
|
+
"@internal/lint": "0.0.152",
|
|
979
|
+
"@internal/types-builder": "0.0.127",
|
|
979
980
|
"@internal/test-utils": "0.0.88",
|
|
980
|
-
"@internal/voice": "0.0.48"
|
|
981
|
-
"@internal/types-builder": "0.0.127"
|
|
981
|
+
"@internal/voice": "0.0.48"
|
|
982
982
|
},
|
|
983
983
|
"engines": {
|
|
984
984
|
"node": ">=22.13.0"
|