@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,6 +1,6 @@
|
|
|
1
|
-
const require_execution_fence = require("./execution-fence-
|
|
2
|
-
const require_scheduler = require("./scheduler-
|
|
3
|
-
const require_background_tasks = require("./background-tasks-
|
|
1
|
+
const require_execution_fence = require("./execution-fence-C8Q0wWkG.cjs");
|
|
2
|
+
const require_scheduler = require("./scheduler-DE5lcHJA.cjs");
|
|
3
|
+
const require_background_tasks = require("./background-tasks-CeARf1DK.cjs");
|
|
4
4
|
const require_request_context = require("./request-context-D9RXYCy8.cjs");
|
|
5
5
|
// src/worker/worker.ts
|
|
6
6
|
/**
|
|
@@ -210,6 +210,7 @@ var OrchestrationWorker = class extends MastraWorker {
|
|
|
210
210
|
#config;
|
|
211
211
|
#transport;
|
|
212
212
|
#processor;
|
|
213
|
+
#processors = /* @__PURE__ */ new WeakMap();
|
|
213
214
|
#strategy;
|
|
214
215
|
#running = false;
|
|
215
216
|
#releaseConsumer;
|
|
@@ -221,15 +222,38 @@ var OrchestrationWorker = class extends MastraWorker {
|
|
|
221
222
|
}
|
|
222
223
|
async init(deps) {
|
|
223
224
|
await super.init(deps);
|
|
224
|
-
if (!deps.mastra) throw new Error("OrchestrationWorker requires Mastra instance");
|
|
225
|
+
if (!deps.mastra && !this.#config.resolveMastra) throw new Error("OrchestrationWorker requires Mastra instance or resolveMastra");
|
|
225
226
|
const modes = deps.pubsub.supportedModes ?? ["pull"];
|
|
226
227
|
if (!modes.includes("pull")) throw new Error(`OrchestrationWorker requires a pull-capable PubSub, but the configured pubsub only supports: ${modes.join(", ")}. Either remove OrchestrationWorker from the workers list or use a pull-capable PubSub (e.g. Redis Streams).`);
|
|
227
228
|
const remoteUrl = process.env.MASTRA_STEP_EXECUTION_URL;
|
|
228
229
|
if (remoteUrl) this.#strategy = new HttpRemoteStrategy({ serverUrl: remoteUrl });
|
|
229
|
-
this.#processor =
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
if (deps.mastra) this.#processor = this.#processorFor(deps.mastra);
|
|
231
|
+
}
|
|
232
|
+
#processorFor(mastra) {
|
|
233
|
+
let processor = this.#processors.get(mastra);
|
|
234
|
+
if (!processor) {
|
|
235
|
+
processor = new require_execution_fence.WorkflowEventProcessor({
|
|
236
|
+
mastra,
|
|
237
|
+
stepExecutionStrategy: this.#strategy
|
|
238
|
+
});
|
|
239
|
+
this.#processors.set(mastra, processor);
|
|
240
|
+
}
|
|
241
|
+
return processor;
|
|
242
|
+
}
|
|
243
|
+
#localProcessor() {
|
|
244
|
+
if (!this.#processor) throw new Error("OrchestrationWorker not initialized");
|
|
245
|
+
return {
|
|
246
|
+
processor: this.#processor,
|
|
247
|
+
mastra: this.deps?.mastra
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
async #resolveProcessor(event, resolve) {
|
|
251
|
+
const resolved = await resolve(event);
|
|
252
|
+
return resolved && {
|
|
253
|
+
processor: this.#processorFor(resolved.mastra),
|
|
254
|
+
mastra: resolved.mastra,
|
|
255
|
+
release: resolved.release
|
|
256
|
+
};
|
|
233
257
|
}
|
|
234
258
|
async start() {
|
|
235
259
|
if (this.#running) return;
|
|
@@ -262,46 +286,106 @@ var OrchestrationWorker = class extends MastraWorker {
|
|
|
262
286
|
return this.#running;
|
|
263
287
|
}
|
|
264
288
|
async #processEvent(event, ack, nack, extend) {
|
|
265
|
-
|
|
289
|
+
const logger = this.deps?.logger;
|
|
290
|
+
const fields = eventFields(event);
|
|
291
|
+
if ((event.deliveryAttempt ?? 1) > 1) logger?.warn("OrchestrationWorker: redelivered event", fields);
|
|
292
|
+
else logger?.debug("OrchestrationWorker: received event", fields);
|
|
266
293
|
const heartbeat = extend ? setInterval(() => {
|
|
267
294
|
extend().catch((e) => {
|
|
268
|
-
|
|
295
|
+
logger?.error("OrchestrationWorker: error extending event lease", { error: e });
|
|
269
296
|
});
|
|
270
297
|
}, this.#config.leaseRenewIntervalMs ?? DEFAULT_LEASE_RENEW_INTERVAL_MS) : void 0;
|
|
271
|
-
let
|
|
298
|
+
let resolved;
|
|
272
299
|
try {
|
|
273
|
-
|
|
300
|
+
const outcome = await this.#runEvent(event, fields, (r) => resolved = r);
|
|
301
|
+
await this.#settle(outcome, ack, nack);
|
|
274
302
|
} finally {
|
|
275
303
|
if (heartbeat) clearInterval(heartbeat);
|
|
276
|
-
}
|
|
277
|
-
if (result.ok) {
|
|
278
304
|
try {
|
|
279
|
-
await
|
|
305
|
+
await resolved?.release?.();
|
|
280
306
|
} catch (e) {
|
|
281
|
-
|
|
307
|
+
logger?.error("OrchestrationWorker: error releasing resolved Mastra", {
|
|
308
|
+
...fields,
|
|
309
|
+
error: e
|
|
310
|
+
});
|
|
282
311
|
}
|
|
283
|
-
return;
|
|
284
312
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
313
|
+
}
|
|
314
|
+
/** Resolves the instance, prepares it and handles the event. Never throws. */
|
|
315
|
+
async #runEvent(event, fields, retain) {
|
|
316
|
+
const logger = this.deps?.logger;
|
|
317
|
+
const receivedAt = Date.now();
|
|
318
|
+
let resolved;
|
|
319
|
+
try {
|
|
320
|
+
const resolve = this.#config.resolveMastra;
|
|
321
|
+
resolved = resolve ? await this.#resolveProcessor(event, resolve) : this.#localProcessor();
|
|
322
|
+
} catch (e) {
|
|
323
|
+
logger?.error("OrchestrationWorker: error resolving Mastra for event", {
|
|
324
|
+
...fields,
|
|
325
|
+
error: e
|
|
326
|
+
});
|
|
327
|
+
return {
|
|
328
|
+
ok: false,
|
|
329
|
+
retry: true
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
if (!resolved) {
|
|
333
|
+
logger?.warn("OrchestrationWorker: no Mastra resolved for event, dropping it", fields);
|
|
334
|
+
return { ok: true };
|
|
335
|
+
}
|
|
336
|
+
retain(resolved);
|
|
337
|
+
const resolveMs = Date.now() - receivedAt;
|
|
338
|
+
let result;
|
|
339
|
+
try {
|
|
340
|
+
if (this.#config.resolveMastra) await resolved.mastra?.__prepareWorkflowEvent(event);
|
|
341
|
+
result = await (resolved.mastra?.__delegateWorkflowEvent(event) ?? resolved.processor.handle(event));
|
|
342
|
+
} catch (e) {
|
|
343
|
+
logger?.error("OrchestrationWorker: event handler threw", {
|
|
344
|
+
...fields,
|
|
345
|
+
error: e
|
|
346
|
+
});
|
|
347
|
+
result = {
|
|
348
|
+
ok: false,
|
|
349
|
+
retry: true
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
const handled = {
|
|
353
|
+
...fields,
|
|
354
|
+
resolveMs,
|
|
355
|
+
durationMs: Date.now() - receivedAt
|
|
356
|
+
};
|
|
357
|
+
if (result.ok) logger?.debug("OrchestrationWorker: handled event", handled);
|
|
358
|
+
else logger?.error("OrchestrationWorker: error processing event", {
|
|
359
|
+
...handled,
|
|
288
360
|
retry: result.retry
|
|
289
361
|
});
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
362
|
+
return result;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Acks on success. Only asks the transport to redeliver on retryable failures;
|
|
366
|
+
* on terminal failures (e.g. WorkflowEventProcessor exhausted its delivery
|
|
367
|
+
* budget and already published workflow.fail) it acks so the poisoned event
|
|
368
|
+
* drops out of the queue instead of looping forever.
|
|
369
|
+
*/
|
|
370
|
+
async #settle(result, ack, nack) {
|
|
371
|
+
const settle = !result.ok && result.retry ? nack : ack;
|
|
372
|
+
try {
|
|
373
|
+
await settle?.();
|
|
300
374
|
} catch (e) {
|
|
301
|
-
this.deps?.logger?.error(
|
|
375
|
+
this.deps?.logger?.error(`OrchestrationWorker: error ${settle === nack ? "nacking" : "acking"} event`, { error: e });
|
|
302
376
|
}
|
|
303
377
|
}
|
|
304
378
|
};
|
|
379
|
+
/** What identifies one delivery of an event in the worker's logs. */
|
|
380
|
+
function eventFields(event) {
|
|
381
|
+
return {
|
|
382
|
+
type: event.type,
|
|
383
|
+
runId: event.runId,
|
|
384
|
+
eventId: event.id,
|
|
385
|
+
deliveryAttempt: event.deliveryAttempt,
|
|
386
|
+
stepIndex: event.stepIndex
|
|
387
|
+
};
|
|
388
|
+
}
|
|
305
389
|
// src/worker/workers/scheduler-worker.ts
|
|
306
390
|
/**
|
|
307
391
|
* Drives cron-based workflow and agent schedules. On each tick it polls
|
|
@@ -361,7 +445,8 @@ var SchedulerWorker = class extends MastraWorker {
|
|
|
361
445
|
...this.#config,
|
|
362
446
|
isTargetReady,
|
|
363
447
|
isTargetCurrent,
|
|
364
|
-
canExecuteLocally
|
|
448
|
+
canExecuteLocally,
|
|
449
|
+
publishLocalWorkflowStart: mastra && ((event) => mastra.__publishLocalScheduledWorkflowStart(event))
|
|
365
450
|
}
|
|
366
451
|
});
|
|
367
452
|
this.#scheduler.__setLogger(deps.logger);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $s as resolveAgentById, Ac as getStepEntry, Fs as WorkflowEventProcessor, Is as StepExecutor, Ll as assertDrainTimeout, Ls as computeScheduleDefinitionHash, Rl as waitMs, kc as getNestedWorkflow } from "./execution-fence
|
|
2
|
-
import { t as Scheduler } from "./scheduler-
|
|
3
|
-
import { l as BackgroundTaskManager } from "./background-tasks-
|
|
1
|
+
import { $s as resolveAgentById, Ac as getStepEntry, Fs as WorkflowEventProcessor, Is as StepExecutor, Ll as assertDrainTimeout, Ls as computeScheduleDefinitionHash, Rl as waitMs, kc as getNestedWorkflow } from "./execution-fence-DGFyUV5h.js";
|
|
2
|
+
import { t as Scheduler } from "./scheduler-D1qdie5k.js";
|
|
3
|
+
import { l as BackgroundTaskManager } from "./background-tasks-B7UygDdO.js";
|
|
4
4
|
import { u as RequestContext } from "./request-context-COnZHt2-.js";
|
|
5
5
|
// src/worker/worker.ts
|
|
6
6
|
/**
|
|
@@ -210,6 +210,7 @@ var OrchestrationWorker = class extends MastraWorker {
|
|
|
210
210
|
#config;
|
|
211
211
|
#transport;
|
|
212
212
|
#processor;
|
|
213
|
+
#processors = /* @__PURE__ */ new WeakMap();
|
|
213
214
|
#strategy;
|
|
214
215
|
#running = false;
|
|
215
216
|
#releaseConsumer;
|
|
@@ -221,15 +222,38 @@ var OrchestrationWorker = class extends MastraWorker {
|
|
|
221
222
|
}
|
|
222
223
|
async init(deps) {
|
|
223
224
|
await super.init(deps);
|
|
224
|
-
if (!deps.mastra) throw new Error("OrchestrationWorker requires Mastra instance");
|
|
225
|
+
if (!deps.mastra && !this.#config.resolveMastra) throw new Error("OrchestrationWorker requires Mastra instance or resolveMastra");
|
|
225
226
|
const modes = deps.pubsub.supportedModes ?? ["pull"];
|
|
226
227
|
if (!modes.includes("pull")) throw new Error(`OrchestrationWorker requires a pull-capable PubSub, but the configured pubsub only supports: ${modes.join(", ")}. Either remove OrchestrationWorker from the workers list or use a pull-capable PubSub (e.g. Redis Streams).`);
|
|
227
228
|
const remoteUrl = process.env.MASTRA_STEP_EXECUTION_URL;
|
|
228
229
|
if (remoteUrl) this.#strategy = new HttpRemoteStrategy({ serverUrl: remoteUrl });
|
|
229
|
-
this.#processor =
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
if (deps.mastra) this.#processor = this.#processorFor(deps.mastra);
|
|
231
|
+
}
|
|
232
|
+
#processorFor(mastra) {
|
|
233
|
+
let processor = this.#processors.get(mastra);
|
|
234
|
+
if (!processor) {
|
|
235
|
+
processor = new WorkflowEventProcessor({
|
|
236
|
+
mastra,
|
|
237
|
+
stepExecutionStrategy: this.#strategy
|
|
238
|
+
});
|
|
239
|
+
this.#processors.set(mastra, processor);
|
|
240
|
+
}
|
|
241
|
+
return processor;
|
|
242
|
+
}
|
|
243
|
+
#localProcessor() {
|
|
244
|
+
if (!this.#processor) throw new Error("OrchestrationWorker not initialized");
|
|
245
|
+
return {
|
|
246
|
+
processor: this.#processor,
|
|
247
|
+
mastra: this.deps?.mastra
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
async #resolveProcessor(event, resolve) {
|
|
251
|
+
const resolved = await resolve(event);
|
|
252
|
+
return resolved && {
|
|
253
|
+
processor: this.#processorFor(resolved.mastra),
|
|
254
|
+
mastra: resolved.mastra,
|
|
255
|
+
release: resolved.release
|
|
256
|
+
};
|
|
233
257
|
}
|
|
234
258
|
async start() {
|
|
235
259
|
if (this.#running) return;
|
|
@@ -262,46 +286,106 @@ var OrchestrationWorker = class extends MastraWorker {
|
|
|
262
286
|
return this.#running;
|
|
263
287
|
}
|
|
264
288
|
async #processEvent(event, ack, nack, extend) {
|
|
265
|
-
|
|
289
|
+
const logger = this.deps?.logger;
|
|
290
|
+
const fields = eventFields(event);
|
|
291
|
+
if ((event.deliveryAttempt ?? 1) > 1) logger?.warn("OrchestrationWorker: redelivered event", fields);
|
|
292
|
+
else logger?.debug("OrchestrationWorker: received event", fields);
|
|
266
293
|
const heartbeat = extend ? setInterval(() => {
|
|
267
294
|
extend().catch((e) => {
|
|
268
|
-
|
|
295
|
+
logger?.error("OrchestrationWorker: error extending event lease", { error: e });
|
|
269
296
|
});
|
|
270
297
|
}, this.#config.leaseRenewIntervalMs ?? DEFAULT_LEASE_RENEW_INTERVAL_MS) : void 0;
|
|
271
|
-
let
|
|
298
|
+
let resolved;
|
|
272
299
|
try {
|
|
273
|
-
|
|
300
|
+
const outcome = await this.#runEvent(event, fields, (r) => resolved = r);
|
|
301
|
+
await this.#settle(outcome, ack, nack);
|
|
274
302
|
} finally {
|
|
275
303
|
if (heartbeat) clearInterval(heartbeat);
|
|
276
|
-
}
|
|
277
|
-
if (result.ok) {
|
|
278
304
|
try {
|
|
279
|
-
await
|
|
305
|
+
await resolved?.release?.();
|
|
280
306
|
} catch (e) {
|
|
281
|
-
|
|
307
|
+
logger?.error("OrchestrationWorker: error releasing resolved Mastra", {
|
|
308
|
+
...fields,
|
|
309
|
+
error: e
|
|
310
|
+
});
|
|
282
311
|
}
|
|
283
|
-
return;
|
|
284
312
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
313
|
+
}
|
|
314
|
+
/** Resolves the instance, prepares it and handles the event. Never throws. */
|
|
315
|
+
async #runEvent(event, fields, retain) {
|
|
316
|
+
const logger = this.deps?.logger;
|
|
317
|
+
const receivedAt = Date.now();
|
|
318
|
+
let resolved;
|
|
319
|
+
try {
|
|
320
|
+
const resolve = this.#config.resolveMastra;
|
|
321
|
+
resolved = resolve ? await this.#resolveProcessor(event, resolve) : this.#localProcessor();
|
|
322
|
+
} catch (e) {
|
|
323
|
+
logger?.error("OrchestrationWorker: error resolving Mastra for event", {
|
|
324
|
+
...fields,
|
|
325
|
+
error: e
|
|
326
|
+
});
|
|
327
|
+
return {
|
|
328
|
+
ok: false,
|
|
329
|
+
retry: true
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
if (!resolved) {
|
|
333
|
+
logger?.warn("OrchestrationWorker: no Mastra resolved for event, dropping it", fields);
|
|
334
|
+
return { ok: true };
|
|
335
|
+
}
|
|
336
|
+
retain(resolved);
|
|
337
|
+
const resolveMs = Date.now() - receivedAt;
|
|
338
|
+
let result;
|
|
339
|
+
try {
|
|
340
|
+
if (this.#config.resolveMastra) await resolved.mastra?.__prepareWorkflowEvent(event);
|
|
341
|
+
result = await (resolved.mastra?.__delegateWorkflowEvent(event) ?? resolved.processor.handle(event));
|
|
342
|
+
} catch (e) {
|
|
343
|
+
logger?.error("OrchestrationWorker: event handler threw", {
|
|
344
|
+
...fields,
|
|
345
|
+
error: e
|
|
346
|
+
});
|
|
347
|
+
result = {
|
|
348
|
+
ok: false,
|
|
349
|
+
retry: true
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
const handled = {
|
|
353
|
+
...fields,
|
|
354
|
+
resolveMs,
|
|
355
|
+
durationMs: Date.now() - receivedAt
|
|
356
|
+
};
|
|
357
|
+
if (result.ok) logger?.debug("OrchestrationWorker: handled event", handled);
|
|
358
|
+
else logger?.error("OrchestrationWorker: error processing event", {
|
|
359
|
+
...handled,
|
|
288
360
|
retry: result.retry
|
|
289
361
|
});
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
362
|
+
return result;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Acks on success. Only asks the transport to redeliver on retryable failures;
|
|
366
|
+
* on terminal failures (e.g. WorkflowEventProcessor exhausted its delivery
|
|
367
|
+
* budget and already published workflow.fail) it acks so the poisoned event
|
|
368
|
+
* drops out of the queue instead of looping forever.
|
|
369
|
+
*/
|
|
370
|
+
async #settle(result, ack, nack) {
|
|
371
|
+
const settle = !result.ok && result.retry ? nack : ack;
|
|
372
|
+
try {
|
|
373
|
+
await settle?.();
|
|
300
374
|
} catch (e) {
|
|
301
|
-
this.deps?.logger?.error(
|
|
375
|
+
this.deps?.logger?.error(`OrchestrationWorker: error ${settle === nack ? "nacking" : "acking"} event`, { error: e });
|
|
302
376
|
}
|
|
303
377
|
}
|
|
304
378
|
};
|
|
379
|
+
/** What identifies one delivery of an event in the worker's logs. */
|
|
380
|
+
function eventFields(event) {
|
|
381
|
+
return {
|
|
382
|
+
type: event.type,
|
|
383
|
+
runId: event.runId,
|
|
384
|
+
eventId: event.id,
|
|
385
|
+
deliveryAttempt: event.deliveryAttempt,
|
|
386
|
+
stepIndex: event.stepIndex
|
|
387
|
+
};
|
|
388
|
+
}
|
|
305
389
|
// src/worker/workers/scheduler-worker.ts
|
|
306
390
|
/**
|
|
307
391
|
* Drives cron-based workflow and agent schedules. On each tick it polls
|
|
@@ -361,7 +445,8 @@ var SchedulerWorker = class extends MastraWorker {
|
|
|
361
445
|
...this.#config,
|
|
362
446
|
isTargetReady,
|
|
363
447
|
isTargetCurrent,
|
|
364
|
-
canExecuteLocally
|
|
448
|
+
canExecuteLocally,
|
|
449
|
+
publishLocalWorkflowStart: mastra && ((event) => mastra.__publishLocalScheduledWorkflowStart(event))
|
|
365
450
|
}
|
|
366
451
|
});
|
|
367
452
|
this.#scheduler.__setLogger(deps.logger);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $s as resolveAgentById } from "./execution-fence
|
|
1
|
+
import { $s as resolveAgentById } from "./execution-fence-DGFyUV5h.js";
|
|
2
2
|
import { u as RequestContext } from "./request-context-COnZHt2-.js";
|
|
3
|
-
import { l as MastraWorker, o as PullTransport } from "./worker-
|
|
3
|
+
import { l as MastraWorker, o as PullTransport } from "./worker-DWOK2M_5.js";
|
|
4
4
|
import { l as parseFsAgentScheduleRowId } from "./schedules-DZfSx-7P.js";
|
|
5
5
|
// src/schedules/worker.ts
|
|
6
6
|
/** PubSub topic on which the scheduler publishes `agent-schedule.fire` events. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_stream = require("./stream-
|
|
1
|
+
const require_stream = require("./stream-DqKDB3nL.cjs");
|
|
2
2
|
require("./utils-D-eNsgDM.cjs");
|
|
3
|
-
const require_output_helpers = require("./output-helpers-
|
|
4
|
-
const require_execution_fence = require("./execution-fence-
|
|
5
|
-
const require_background_tasks = require("./background-tasks-
|
|
3
|
+
const require_output_helpers = require("./output-helpers-D4O_oFne.cjs");
|
|
4
|
+
const require_execution_fence = require("./execution-fence-C8Q0wWkG.cjs");
|
|
5
|
+
const require_background_tasks = require("./background-tasks-CeARf1DK.cjs");
|
|
6
6
|
let zod = require("zod");
|
|
7
7
|
// src/background-tasks/workflow.ts
|
|
8
8
|
const inputSchema = zod.z.object({ taskId: zod.z.string() });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { dn as resolveSuspendedToolRunId } from "./stream-
|
|
1
|
+
import { dn as resolveSuspendedToolRunId } from "./stream-H_wVxqdK.js";
|
|
2
2
|
import "./utils-DU_pU5SK.js";
|
|
3
|
-
import {
|
|
4
|
-
import { Os as createWorkflow, Pc as createStep } from "./execution-fence
|
|
5
|
-
import { d as nextAttemptStart, f as suspendEnvelope, m as unwrapSuspendData, p as toolSuspendPayload, u as BACKGROUND_TASK_WORKFLOW_ID } from "./background-tasks-
|
|
3
|
+
import { g as slimProgressChunk } from "./output-helpers-D-qplq22.js";
|
|
4
|
+
import { Os as createWorkflow, Pc as createStep } from "./execution-fence-DGFyUV5h.js";
|
|
5
|
+
import { d as nextAttemptStart, f as suspendEnvelope, m as unwrapSuspendData, p as toolSuspendPayload, u as BACKGROUND_TASK_WORKFLOW_ID } from "./background-tasks-B7UygDdO.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
// src/background-tasks/workflow.ts
|
|
8
8
|
const inputSchema = z.object({ taskId: z.string() });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_builder = require("../../builder-
|
|
2
|
+
const require_builder = require("../../builder-Dmf04g9P.cjs");
|
|
3
3
|
exports.WORKFLOW_BUILDER_AUTHORING_CONSTRAINTS = require_builder.WORKFLOW_BUILDER_AUTHORING_CONSTRAINTS;
|
|
4
4
|
exports.WORKFLOW_BUILDER_AUTHORING_PLAYBOOK = require_builder.WORKFLOW_BUILDER_AUTHORING_PLAYBOOK;
|
|
5
5
|
exports.WORKFLOW_BUILDER_MAPPING_CONFIG_DESCRIPTION = require_builder.WORKFLOW_BUILDER_MAPPING_CONFIG_DESCRIPTION;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { U as WORKFLOW_BUILDER_AUTHORING_CONSTRAINTS, W as WORKFLOW_BUILDER_AUTHORING_PLAYBOOK, i as WORKFLOW_BUILDER_MAPPING_CONFIG_DESCRIPTION, t as WORKFLOW_BUILDER_SUPPORTED_STEP_TYPES, B as compareWorkflowBuilderSchemas, r as createWorkflowBuilderAgent, a as deleteStoredWorkflowResponseSchema, V as inspectWorkflowBuilderSchemas, o as listStoredWorkflowsResponseSchema, n as normalizeWorkflowBuilderDefinition, H as preflightWorkflowDefinition, s as storedWorkflowDefinitionSchema, c as upsertStoredWorkflowResponseSchema, l as workflowBuilderAgentEntryInputSchema, u as workflowBuilderAgentEntrySchema, d as workflowBuilderClassifierEntryInputSchema, f as workflowBuilderClassifierEntrySchema, p as workflowBuilderConditionalEntryInputSchema, m as workflowBuilderConditionalEntrySchema, h as workflowBuilderDefinitionInputSchema, g as workflowBuilderDefinitionSchema, _ as workflowBuilderForeachEntryInputSchema, v as workflowBuilderForeachEntrySchema, y as workflowBuilderGraphEntryInputSchema, b as workflowBuilderGraphEntrySchema, x as workflowBuilderLoopEntryInputSchema, S as workflowBuilderLoopEntrySchema, C as workflowBuilderMappingConfigSchema, w as workflowBuilderMappingDescriptorSchema, T as workflowBuilderMappingEntryInputSchema, E as workflowBuilderMappingEntrySchema, D as workflowBuilderNestedWorkflowEntryInputSchema, O as workflowBuilderNestedWorkflowEntrySchema, k as workflowBuilderParallelEntryInputSchema, A as workflowBuilderParallelEntrySchema, j as workflowBuilderPredicateSchema, M as workflowBuilderScheduleConfigSchema, N as workflowBuilderScheduleSchema, P as workflowBuilderSleepEntryInputSchema, F as workflowBuilderSleepEntrySchema, I as workflowBuilderSleepUntilEntryInputSchema, L as workflowBuilderSleepUntilEntrySchema, R as workflowBuilderToolEntryInputSchema, z as workflowBuilderToolEntrySchema } from "../../builder-
|
|
1
|
+
export { U as WORKFLOW_BUILDER_AUTHORING_CONSTRAINTS, W as WORKFLOW_BUILDER_AUTHORING_PLAYBOOK, i as WORKFLOW_BUILDER_MAPPING_CONFIG_DESCRIPTION, t as WORKFLOW_BUILDER_SUPPORTED_STEP_TYPES, B as compareWorkflowBuilderSchemas, r as createWorkflowBuilderAgent, a as deleteStoredWorkflowResponseSchema, V as inspectWorkflowBuilderSchemas, o as listStoredWorkflowsResponseSchema, n as normalizeWorkflowBuilderDefinition, H as preflightWorkflowDefinition, s as storedWorkflowDefinitionSchema, c as upsertStoredWorkflowResponseSchema, l as workflowBuilderAgentEntryInputSchema, u as workflowBuilderAgentEntrySchema, d as workflowBuilderClassifierEntryInputSchema, f as workflowBuilderClassifierEntrySchema, p as workflowBuilderConditionalEntryInputSchema, m as workflowBuilderConditionalEntrySchema, h as workflowBuilderDefinitionInputSchema, g as workflowBuilderDefinitionSchema, _ as workflowBuilderForeachEntryInputSchema, v as workflowBuilderForeachEntrySchema, y as workflowBuilderGraphEntryInputSchema, b as workflowBuilderGraphEntrySchema, x as workflowBuilderLoopEntryInputSchema, S as workflowBuilderLoopEntrySchema, C as workflowBuilderMappingConfigSchema, w as workflowBuilderMappingDescriptorSchema, T as workflowBuilderMappingEntryInputSchema, E as workflowBuilderMappingEntrySchema, D as workflowBuilderNestedWorkflowEntryInputSchema, O as workflowBuilderNestedWorkflowEntrySchema, k as workflowBuilderParallelEntryInputSchema, A as workflowBuilderParallelEntrySchema, j as workflowBuilderPredicateSchema, M as workflowBuilderScheduleConfigSchema, N as workflowBuilderScheduleSchema, P as workflowBuilderSleepEntryInputSchema, F as workflowBuilderSleepEntrySchema, I as workflowBuilderSleepUntilEntryInputSchema, L as workflowBuilderSleepUntilEntrySchema, R as workflowBuilderToolEntryInputSchema, z as workflowBuilderToolEntrySchema } from "../../builder-CpAEmMdR.js";
|
|
@@ -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
|
exports.EventedExecutionEngine = require_execution_fence.EventedExecutionEngine;
|
|
4
4
|
exports.EventedRun = require_execution_fence.EventedRun;
|
|
5
5
|
exports.EventedWorkflow = require_execution_fence.EventedWorkflow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Oc as EventedExecutionEngine, ks as EventedRun, As as EventedWorkflow, Is as StepExecutor, Fs as WorkflowEventProcessor, js as cloneStep, Ms as cloneWorkflow, Ns as createStep, Ps as createWorkflow } from "../../execution-fence
|
|
1
|
+
export { Oc as EventedExecutionEngine, ks as EventedRun, As as EventedWorkflow, Is as StepExecutor, Fs as WorkflowEventProcessor, js as cloneStep, Ms as cloneWorkflow, Ns as createStep, Ps as createWorkflow } from "../../execution-fence-DGFyUV5h.js";
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import type { MastraServerCache } from '../../cache/base.js';
|
|
2
|
+
import type { PubSub } from '../../events/pubsub.js';
|
|
1
3
|
import type { Mastra } from '../../mastra/index.js';
|
|
2
4
|
import type { WorkflowsStorage } from '../../storage/domains/workflows/base.js';
|
|
5
|
+
/**
|
|
6
|
+
* Whether each process keeps its own copy of the run logs `cache` holds while
|
|
7
|
+
* `pubsub` carries the runs to other processes. Only `InMemoryServerCache` is
|
|
8
|
+
* known to be process-local; any other cache is assumed to be shared.
|
|
9
|
+
*/
|
|
10
|
+
export declare function keepsRunLogsInProcess(pubsub: PubSub, cache: MastraServerCache | undefined): boolean;
|
|
3
11
|
/**
|
|
4
12
|
* Evented runs spread over several processes need a pubsub that hands a stopped
|
|
5
13
|
* worker's event to another worker, and a store whose step guards let one
|
|
@@ -26,4 +34,16 @@ export type UnsharedAgentSignalsReason = 'no-memory-thread' | 'unsupported-memor
|
|
|
26
34
|
* process holding it runs the step.
|
|
27
35
|
*/
|
|
28
36
|
export declare function warnUnsharedAgentSignals(mastra: Mastra, reason: UnsharedAgentSignalsReason): void;
|
|
37
|
+
/**
|
|
38
|
+
* An evented agent's steps append their stream frames to the run's log in the
|
|
39
|
+
* server cache, which also holds the run's ownership record. With a cache each
|
|
40
|
+
* process keeps to itself, a step in another process publishes its frames
|
|
41
|
+
* unnumbered, so `observe(runId, { offset })` can't skip them, and another
|
|
42
|
+
* process can't observe or stop the run. Logs once per Mastra instance, apart
|
|
43
|
+
* from {@link warnUnsupportedEventedSetup} so that one does not hide this.
|
|
44
|
+
*
|
|
45
|
+
* Called when an evented agent is registered, in every process that can run
|
|
46
|
+
* its steps, including dedicated workers that never start a run.
|
|
47
|
+
*/
|
|
48
|
+
export declare function warnProcessLocalServerCache(mastra: Mastra): void;
|
|
29
49
|
//# sourceMappingURL=setup-warning.d.ts.map
|
package/dist/workflows/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_execution_fence = require("../execution-fence-
|
|
3
|
-
const require_stream = require("../stream-
|
|
2
|
+
const require_execution_fence = require("../execution-fence-C8Q0wWkG.cjs");
|
|
3
|
+
const require_stream = require("../stream-DqKDB3nL.cjs");
|
|
4
4
|
const require_predicate_index = require("../predicate/index.cjs");
|
|
5
5
|
const require_schedules = require("../schedules-BZS8McF7.cjs");
|
|
6
|
-
const require_scheduler = require("../scheduler-
|
|
7
|
-
const require_validate = require("../validate-
|
|
8
|
-
const require_rehydrate = require("../rehydrate-
|
|
6
|
+
const require_scheduler = require("../scheduler-DE5lcHJA.cjs");
|
|
7
|
+
const require_validate = require("../validate-u6_TUYSo.cjs");
|
|
8
|
+
const require_rehydrate = require("../rehydrate-BtwY0ima.cjs");
|
|
9
9
|
// src/workflows/state-reader.ts
|
|
10
10
|
const getStep = (state, stepId) => state.steps?.[stepId];
|
|
11
11
|
const getFirstStepResult = (step) => {
|
package/dist/workflows/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Al as validateStepRequestContext, Cl as isSingleStepEntry, Dl as runCountDeprecationMessage, Ds as createEventedWorkflow, El as resolveForeachConcurrency, Es as cloneWorkflow, Fc as isProcessor, Fl as getEntryId, Ic as mapVariable, Il as getEntryWorkflow, Lc as predicateToCondition, Ls as computeScheduleDefinitionHash, Mc as Workflow, Ml as validateStepStateData, Nc as cloneStep, Nl as validateStepSuspendData, Ol as setLongTimeout, Os as createWorkflow, Pc as createStep, Pl as waitForSuspendedSnapshot, Qc as ExecutionEngine, Rc as evaluatePredicate, Sl as isEntryFinished, Tl as omitPriorSuspensionFields, Wc as DefaultExecutionEngine, _l as getRestartStartIndex, al as createStepFromTool, bl as getStepIds, cl as abortableSleep, dl as cleanStepResult, fl as createDeprecationProxy, gl as defineStateAccessors, hl as defineLazyWriter, il as createStepFromClassifier, jc as Run, jl as validateStepResumeData, kl as validateStepInput, ll as applyStateDelta, ml as createTimeTravelExecutionParams, nl as createMappingStep, ol as RESUME_SNAPSHOT_POLL_INTERVAL_MS, pl as createRestartExecutionParams, rl as createStepFromAgent, sl as RESUME_SNAPSHOT_WAIT_STATUSES, ul as assertTimeTravelGraphMatchesSnapshot, vl as getResumeLabelsByStepId, wl as omitPriorCompletionFields, xl as hydrateSerializedStepErrors, yl as getSingleStepEntryId, zl as workflowTermination } from "../execution-fence
|
|
2
|
-
import { Ot as getStepResult, kt as getStepResultAsync } from "../stream-
|
|
1
|
+
import { Al as validateStepRequestContext, Cl as isSingleStepEntry, Dl as runCountDeprecationMessage, Ds as createEventedWorkflow, El as resolveForeachConcurrency, Es as cloneWorkflow, Fc as isProcessor, Fl as getEntryId, Ic as mapVariable, Il as getEntryWorkflow, Lc as predicateToCondition, Ls as computeScheduleDefinitionHash, Mc as Workflow, Ml as validateStepStateData, Nc as cloneStep, Nl as validateStepSuspendData, Ol as setLongTimeout, Os as createWorkflow, Pc as createStep, Pl as waitForSuspendedSnapshot, Qc as ExecutionEngine, Rc as evaluatePredicate, Sl as isEntryFinished, Tl as omitPriorSuspensionFields, Wc as DefaultExecutionEngine, _l as getRestartStartIndex, al as createStepFromTool, bl as getStepIds, cl as abortableSleep, dl as cleanStepResult, fl as createDeprecationProxy, gl as defineStateAccessors, hl as defineLazyWriter, il as createStepFromClassifier, jc as Run, jl as validateStepResumeData, kl as validateStepInput, ll as applyStateDelta, ml as createTimeTravelExecutionParams, nl as createMappingStep, ol as RESUME_SNAPSHOT_POLL_INTERVAL_MS, pl as createRestartExecutionParams, rl as createStepFromAgent, sl as RESUME_SNAPSHOT_WAIT_STATUSES, ul as assertTimeTravelGraphMatchesSnapshot, vl as getResumeLabelsByStepId, wl as omitPriorCompletionFields, xl as hydrateSerializedStepErrors, yl as getSingleStepEntryId, zl as workflowTermination } from "../execution-fence-DGFyUV5h.js";
|
|
2
|
+
import { Ot as getStepResult, kt as getStepResultAsync } from "../stream-H_wVxqdK.js";
|
|
3
3
|
import { derivePredicateLabel, predicateSchema } from "../predicate/index.js";
|
|
4
4
|
import { _ as validateCron, h as computeNextFireAt } from "../schedules-DZfSx-7P.js";
|
|
5
|
-
import { i as runScheduleTick, n as WorkflowScheduler, r as claimScheduleFire, t as Scheduler } from "../scheduler-
|
|
6
|
-
import { a as jsonSchemaToZod, c as analyzeMapConfig, d as toJsonSchemaOrUndefined, f as validateWorkflowRefs, h as forEachSingleStepEntryWithPath, i as validateWorkflowSchemas, l as parseMapConfig, m as forEachSingleStepEntry, n as validateDynamicWorkflow, o as validateStorableJsonSchema, p as collectNestedWorkflowIds, r as validateWorkflowStructure, s as inferGraphSchemas, t as assertValidDynamicWorkflow, u as schemaCompatibility } from "../validate-
|
|
7
|
-
import { n as entryOptionFields, r as toStorableGraph, t as rehydrateWorkflow } from "../rehydrate-
|
|
5
|
+
import { i as runScheduleTick, n as WorkflowScheduler, r as claimScheduleFire, t as Scheduler } from "../scheduler-D1qdie5k.js";
|
|
6
|
+
import { a as jsonSchemaToZod, c as analyzeMapConfig, d as toJsonSchemaOrUndefined, f as validateWorkflowRefs, h as forEachSingleStepEntryWithPath, i as validateWorkflowSchemas, l as parseMapConfig, m as forEachSingleStepEntry, n as validateDynamicWorkflow, o as validateStorableJsonSchema, p as collectNestedWorkflowIds, r as validateWorkflowStructure, s as inferGraphSchemas, t as assertValidDynamicWorkflow, u as schemaCompatibility } from "../validate-DQB9spZ1.js";
|
|
7
|
+
import { n as entryOptionFields, r as toStorableGraph, t as rehydrateWorkflow } from "../rehydrate-4xHubfOY.js";
|
|
8
8
|
// src/workflows/state-reader.ts
|
|
9
9
|
const getStep = (state, stepId) => state.steps?.[stepId];
|
|
10
10
|
const getFirstStepResult = (step) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Event } from '../../events/types.js';
|
|
1
2
|
import type { ScheduleTarget } from '../../storage/domains/schedules/base.js';
|
|
2
3
|
/**
|
|
3
4
|
* Declarative schedule configuration for a workflow. When set on a workflow,
|
|
@@ -141,6 +142,8 @@ export type SchedulerConfig = {
|
|
|
141
142
|
* Wired up by `SchedulerWorker` from `Mastra.__hasLocalWorkflowExecution()`.
|
|
142
143
|
*/
|
|
143
144
|
canExecuteLocally?: () => boolean;
|
|
145
|
+
/** @internal Publish a local start associated with the claiming Mastra instance. */
|
|
146
|
+
publishLocalWorkflowStart?: (event: Omit<Event, 'id' | 'createdAt'>) => Promise<void>;
|
|
144
147
|
/**
|
|
145
148
|
* Number of consecutive ticks a schedule's target workflow may be missing
|
|
146
149
|
* before the scheduler deletes the row. Defaults to 3 (≈30s with the
|
|
@@ -57,10 +57,10 @@ export declare function isUtf8Text(content: Uint8Array): boolean;
|
|
|
57
57
|
export declare function mediaToModelOutput(output: unknown): {
|
|
58
58
|
type: 'content';
|
|
59
59
|
value: ({
|
|
60
|
-
type: 'text';
|
|
61
|
-
text: string;
|
|
62
60
|
data?: undefined;
|
|
63
61
|
mediaType?: undefined;
|
|
62
|
+
type: 'text';
|
|
63
|
+
text: string;
|
|
64
64
|
} | {
|
|
65
65
|
text?: undefined;
|
|
66
66
|
type: 'media';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.88.0-alpha.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -925,7 +925,7 @@
|
|
|
925
925
|
"ws": "^8.23.0",
|
|
926
926
|
"xxhash-wasm": "^1.1.0",
|
|
927
927
|
"yaml": "^2.9.1",
|
|
928
|
-
"@mastra/schema-compat": "1.4.
|
|
928
|
+
"@mastra/schema-compat": "1.4.3-alpha.0"
|
|
929
929
|
},
|
|
930
930
|
"peerDependencies": {
|
|
931
931
|
"@json-render/chat": "^0.22.0",
|
|
@@ -958,7 +958,7 @@
|
|
|
958
958
|
"@ai-sdk/togetherai-v7": "npm:@ai-sdk/togetherai@3.0.83",
|
|
959
959
|
"@ai-sdk/xai-v7": "npm:@ai-sdk/xai@5.0.35",
|
|
960
960
|
"@ast-grep/napi": "^0.40.5",
|
|
961
|
-
"@babel/core": "^8.
|
|
961
|
+
"@babel/core": "^8.1.4",
|
|
962
962
|
"@copilotkit/aimock": "^1.46.0",
|
|
963
963
|
"@json-render/chat": "^0.22.0",
|
|
964
964
|
"@modelcontextprotocol/server": "2.4.0",
|
|
@@ -987,19 +987,19 @@
|
|
|
987
987
|
"vscode-languageserver-protocol": "^3.18.5",
|
|
988
988
|
"zod": "^4.6.7",
|
|
989
989
|
"zod-v3": "npm:zod@3.25.76",
|
|
990
|
-
"@internal/ai-sdk-v4": "0.0.100",
|
|
991
990
|
"@internal/ai-sdk-v5": "0.0.100",
|
|
991
|
+
"@internal/ai-sdk-v4": "0.0.100",
|
|
992
992
|
"@internal/ai-v6": "0.0.100",
|
|
993
993
|
"@internal/ai-v7": "0.0.100",
|
|
994
994
|
"@internal/auth": "0.0.41",
|
|
995
|
+
"@internal/core": "0.1.4",
|
|
995
996
|
"@internal/deployer": "0.0.6",
|
|
996
997
|
"@internal/external-types": "0.0.103",
|
|
997
998
|
"@internal/lint": "0.0.153",
|
|
998
999
|
"@internal/llm-recorder": "0.0.89",
|
|
999
|
-
"@internal/core": "0.1.4",
|
|
1000
1000
|
"@internal/test-utils": "0.0.89",
|
|
1001
|
-
"@internal/
|
|
1002
|
-
"@internal/
|
|
1001
|
+
"@internal/types-builder": "0.0.128",
|
|
1002
|
+
"@internal/voice": "0.0.49"
|
|
1003
1003
|
},
|
|
1004
1004
|
"engines": {
|
|
1005
1005
|
"node": ">=22.13.0"
|