@mastra/core 1.86.0-alpha.6 → 1.86.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_types/@internal_core@0.1.4/dist/memory/index.d.ts +25 -0
- package/dist/agent/agent.d.ts +87 -12
- package/dist/agent/agent.types.d.ts +34 -2
- package/dist/agent/durable/create-durable-agent.d.ts +1 -1
- package/dist/agent/durable/create-evented-agent.d.ts +6 -0
- package/dist/agent/durable/durable-agent.d.ts +30 -514
- package/dist/agent/durable/durable-stream-until-idle.d.ts +2 -1
- package/dist/agent/durable/evented-agent.d.ts +2 -5
- package/dist/agent/durable/execution-engine.d.ts +20 -3
- package/dist/agent/durable/index.cjs +61 -6351
- package/dist/agent/durable/index.d.ts +3 -2
- package/dist/agent/durable/index.js +50 -6340
- package/dist/agent/durable/stream-adapter.d.ts +5 -5
- package/dist/agent/durable/types.d.ts +454 -3
- package/dist/agent/durable/workflows/durable-loop-builder.d.ts +7 -9
- package/dist/agent/helpers.d.ts +1 -1
- package/dist/agent/index.cjs +4 -4
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +4 -4
- package/dist/agent/streams/execution-capability.d.ts +3 -2
- package/dist/agent/streams/execution-policy.d.ts +1 -1
- package/dist/agent/streams/types.d.ts +3 -3
- package/dist/agent/types.d.ts +30 -5
- package/dist/agent-builder/ee/index.cjs +1 -1
- package/dist/agent-builder/ee/index.js +1 -1
- package/dist/agent-controller/index.cjs +2 -2
- package/dist/agent-controller/index.js +2 -2
- package/dist/{agent-controller-c4KbZ8DY.js → agent-controller-B7POPub5.js} +9 -9
- package/dist/{agent-controller-6ORqG6hK.cjs → agent-controller-DEPayioq.cjs} +9 -9
- package/dist/{agent-skills-resolver-BIeWsb01.cjs → agent-skills-resolver-BMoCDoaK.cjs} +1 -1
- package/dist/{agent-skills-resolver-k04IRam7.js → agent-skills-resolver-CUEIMDbx.js} +1 -1
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/{background-tasks-Da0c3R-J.cjs → background-tasks-7iftnRK_.cjs} +1 -1
- package/dist/{background-tasks-CEglmAt7.js → background-tasks-Cv1ecD6S.js} +1 -1
- package/dist/browser/index.cjs +2 -2
- package/dist/browser/index.js +2 -2
- package/dist/{builder-DS826dWf.cjs → builder-DuJBbQDH.cjs} +3 -3
- package/dist/{builder-0V9N8S15.js → builder-Gg-xnX_E.js} +3 -3
- package/dist/capabilities/302ai.json +198 -198
- package/dist/capabilities/abliteratedllm.json +38 -38
- package/dist/capabilities/abliteration-ai.json +6 -6
- package/dist/capabilities/above.json +23 -23
- package/dist/capabilities/adaption.json +14 -14
- package/dist/capabilities/adzuki.json +22 -22
- package/dist/capabilities/agentrouter.json +7 -7
- package/dist/capabilities/agnes.json +2 -2
- package/dist/capabilities/ai-router.json +5 -5
- package/dist/capabilities/aiand.json +23 -23
- package/dist/capabilities/aigrow.json +15 -15
- package/dist/capabilities/aimlapi.json +143 -143
- package/dist/capabilities/aipg.json +2 -2
- package/dist/capabilities/aixy.json +16 -16
- package/dist/capabilities/aki-io.json +12 -12
- package/dist/capabilities/alibaba-cn.json +84 -84
- 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 +51 -51
- package/dist/capabilities/alibaba-token-plan.json +52 -52
- package/dist/capabilities/alibaba.json +69 -69
- package/dist/capabilities/ambient.json +12 -12
- package/dist/capabilities/amd.json +10 -10
- package/dist/capabilities/anthropic.json +64 -40
- package/dist/capabilities/anyapi.json +12 -12
- package/dist/capabilities/apiko.json +5 -5
- package/dist/capabilities/arcee.json +7 -7
- package/dist/capabilities/augure.json +8 -8
- package/dist/capabilities/auriko.json +21 -21
- package/dist/capabilities/bailing.json +2 -2
- package/dist/capabilities/baseten.json +26 -26
- package/dist/capabilities/bee.json +4 -4
- package/dist/capabilities/berget.json +4 -4
- package/dist/capabilities/bothub.json +17 -17
- package/dist/capabilities/boundless.json +41 -41
- package/dist/capabilities/bumo.json +43 -43
- package/dist/capabilities/byteplus.json +31 -31
- package/dist/capabilities/cerebras.json +4 -4
- package/dist/capabilities/cheapaimodel.json +6 -6
- package/dist/capabilities/cheapest-token.json +32 -32
- package/dist/capabilities/chutes.json +10 -10
- package/dist/capabilities/cline-pass.json +43 -43
- package/dist/capabilities/cloudcode.json +8 -8
- package/dist/capabilities/cloudferro-sherlock.json +4 -4
- package/dist/capabilities/cloudflare-workers-ai.json +31 -31
- package/dist/capabilities/commandcode.json +151 -151
- package/dist/capabilities/concentrate.json +287 -263
- package/dist/capabilities/cortecs.json +106 -106
- package/dist/capabilities/crossmodel.json +189 -189
- package/dist/capabilities/crusoe.json +3 -3
- package/dist/capabilities/daoxe.json +9 -9
- package/dist/capabilities/databricks.json +62 -62
- package/dist/capabilities/deepinfra.json +97 -88
- package/dist/capabilities/deepseek.json +3 -3
- package/dist/capabilities/digitalocean.json +114 -114
- package/dist/capabilities/dothoosh.json +36 -36
- package/dist/capabilities/doubleword.json +29 -29
- package/dist/capabilities/edenai.json +443 -442
- package/dist/capabilities/empiriolabs.json +172 -172
- package/dist/capabilities/engy.json +20 -20
- package/dist/capabilities/entrim.json +8 -8
- package/dist/capabilities/evroc.json +15 -15
- package/dist/capabilities/ezkielyna.json +7 -7
- package/dist/capabilities/fastrouter.json +82 -82
- package/dist/capabilities/fireworks-ai.json +50 -50
- package/dist/capabilities/freemodel.json +24 -24
- package/dist/capabilities/friendli.json +6 -6
- package/dist/capabilities/frogbot.json +98 -98
- package/dist/capabilities/gisoo.json +20 -20
- package/dist/capabilities/gmicloud.json +14 -14
- package/dist/capabilities/google.json +60 -60
- package/dist/capabilities/graphn.json +12 -12
- package/dist/capabilities/greenpt.json +33 -33
- package/dist/capabilities/groq.json +9 -9
- package/dist/capabilities/helicone.json +81 -81
- package/dist/capabilities/hopper.json +2 -2
- package/dist/capabilities/hostinger-router.json +12 -12
- package/dist/capabilities/hpc-ai.json +10 -10
- package/dist/capabilities/huawei-maas.json +15 -15
- package/dist/capabilities/hubris.json +27 -27
- package/dist/capabilities/huggingface.json +59 -50
- package/dist/capabilities/humain.json +2 -2
- package/dist/capabilities/hyper.json +25 -25
- package/dist/capabilities/impossibl.json +140 -140
- package/dist/capabilities/inception.json +2 -2
- package/dist/capabilities/inceptron.json +8 -8
- package/dist/capabilities/inco.json +4 -4
- package/dist/capabilities/infer.json +14 -14
- package/dist/capabilities/inferall.json +7 -7
- package/dist/capabilities/inference-coop.json +15 -15
- package/dist/capabilities/inferenceapis.json +18 -18
- package/dist/capabilities/inferris.json +4 -4
- package/dist/capabilities/infersia.json +13 -13
- package/dist/capabilities/infomaniak.json +2 -2
- package/dist/capabilities/io-net.json +5 -5
- package/dist/capabilities/isoquant.json +4 -4
- package/dist/capabilities/iteracompute.json +54 -54
- package/dist/capabilities/jalapeno.json +12 -12
- package/dist/capabilities/jiekou.json +63 -63
- package/dist/capabilities/joingonka.json +4 -4
- package/dist/capabilities/jzstoken.json +56 -56
- package/dist/capabilities/keln.json +27 -27
- package/dist/capabilities/kenari.json +117 -111
- package/dist/capabilities/kilo.json +625 -649
- 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 +21 -21
- package/dist/capabilities/korouter.json +33 -33
- package/dist/capabilities/kunavo.json +9 -9
- package/dist/capabilities/liquid.json +8 -8
- package/dist/capabilities/lithosai.json +3 -3
- package/dist/capabilities/llmgateway-providers.json +932 -905
- package/dist/capabilities/llmgateway.json +343 -343
- package/dist/capabilities/llmtr.json +25 -25
- package/dist/capabilities/longcat.json +2 -2
- package/dist/capabilities/lowrouter.json +48 -48
- package/dist/capabilities/lyceum.json +13 -13
- package/dist/capabilities/melious.json +13 -13
- package/dist/capabilities/merge-gateway.json +294 -294
- package/dist/capabilities/meta.json +10 -10
- package/dist/capabilities/minimax-cn-coding-plan.json +6 -6
- package/dist/capabilities/minimax-coding-plan.json +6 -6
- package/dist/capabilities/mistral.json +20 -20
- package/dist/capabilities/mixlayer.json +3 -3
- package/dist/capabilities/modal.json +14 -14
- package/dist/capabilities/model-oracle-ai.json +19 -19
- package/dist/capabilities/modelis.json +19 -19
- package/dist/capabilities/modular.json +5 -5
- package/dist/capabilities/moneo.json +17 -17
- package/dist/capabilities/moonshotai-cn.json +5 -5
- package/dist/capabilities/moonshotai.json +5 -5
- package/dist/capabilities/morph.json +14 -14
- package/dist/capabilities/munito-eu.json +8 -8
- package/dist/capabilities/munito.json +10 -10
- package/dist/capabilities/nan.json +28 -28
- package/dist/capabilities/nano-gpt.json +597 -567
- package/dist/capabilities/nearai.json +89 -89
- package/dist/capabilities/nebius.json +40 -31
- package/dist/capabilities/neon.json +135 -135
- package/dist/capabilities/neuralwatt.json +39 -39
- package/dist/capabilities/nokeep.json +2 -2
- package/dist/capabilities/novita-ai.json +158 -158
- package/dist/capabilities/nvidia.json +35 -35
- package/dist/capabilities/oathbreaker.json +2 -2
- package/dist/capabilities/obscurify.json +26 -26
- package/dist/capabilities/oci.json +6 -6
- package/dist/capabilities/ofox.json +352 -352
- package/dist/capabilities/ollama-cloud.json +52 -52
- package/dist/capabilities/openai.json +49 -56
- package/dist/capabilities/opencode-go.json +82 -81
- package/dist/capabilities/openreason.json +5 -5
- package/dist/capabilities/openrouter.json +557 -567
- package/dist/capabilities/opper.json +28 -22
- package/dist/capabilities/orcarouter.json +230 -230
- package/dist/capabilities/outerlabs.json +33 -33
- package/dist/capabilities/ovhcloud.json +6 -6
- package/dist/capabilities/pareto.json +6 -6
- package/dist/capabilities/perplexity-agent.json +58 -58
- package/dist/capabilities/perplexity.json +2 -2
- package/dist/capabilities/phala.json +22 -22
- package/dist/capabilities/pioneer.json +30 -30
- package/dist/capabilities/poe.json +122 -122
- package/dist/capabilities/poolside.json +3 -3
- package/dist/capabilities/powerspring.json +10 -10
- package/dist/capabilities/primalabs.json +8 -8
- package/dist/capabilities/prime.json +114 -97
- package/dist/capabilities/privatemode-ai.json +11 -11
- package/dist/capabilities/proxystacks.json +7 -7
- package/dist/capabilities/qiniu-ai.json +13 -13
- package/dist/capabilities/refuseless.json +7 -7
- package/dist/capabilities/regolo-ai.json +6 -6
- package/dist/capabilities/requesty.json +172 -189
- package/dist/capabilities/ruapi.json +18 -18
- package/dist/capabilities/runcrate.json +17 -17
- package/dist/capabilities/runinfra.json +16 -16
- package/dist/capabilities/sakana.json +6 -6
- package/dist/capabilities/sambanova.json +4 -4
- package/dist/capabilities/sandbase.json +24 -24
- package/dist/capabilities/sarvam.json +12 -12
- package/dist/capabilities/scaleway.json +19 -19
- package/dist/capabilities/scnet-token-plan.json +10 -10
- package/dist/capabilities/scx-ai.json +23 -23
- package/dist/capabilities/sensenova.json +14 -14
- package/dist/capabilities/siliconflow-cn.json +64 -64
- package/dist/capabilities/siliconflow.json +63 -63
- package/dist/capabilities/snowflake-cortex.json +23 -23
- package/dist/capabilities/sokkan.json +12 -12
- package/dist/capabilities/sparrowcodes.json +23 -23
- package/dist/capabilities/standardcompute.json +83 -83
- package/dist/capabilities/steadyrouter.json +39 -39
- 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 +16 -16
- package/dist/capabilities/superbot-gg.json +4 -4
- package/dist/capabilities/synthetic.json +14 -14
- package/dist/capabilities/synthorai.json +29 -29
- package/dist/capabilities/teamorouter.json +26 -26
- package/dist/capabilities/teapot-router.json +13 -13
- package/dist/capabilities/tencent-coding-plan.json +2 -2
- package/dist/capabilities/tencent-token-plan.json +30 -30
- package/dist/capabilities/tencent-tokenhub.json +8 -8
- package/dist/capabilities/tensorx.json +45 -45
- package/dist/capabilities/tenstorrent.json +8 -8
- package/dist/capabilities/the-grid-ai.json +35 -35
- package/dist/capabilities/thinkingmachines.json +59 -59
- package/dist/capabilities/tinfoil.json +5 -5
- package/dist/capabilities/toapis.json +2 -2
- package/dist/capabilities/togetherai.json +59 -59
- package/dist/capabilities/tokengo.json +24 -24
- package/dist/capabilities/tokenify.json +9 -9
- package/dist/capabilities/trustedrouter.json +5 -5
- package/dist/capabilities/trustedtokens.json +18 -18
- package/dist/capabilities/umans-ai-coding-plan.json +18 -18
- package/dist/capabilities/umans-ai.json +15 -15
- package/dist/capabilities/uncensuredai.json +4 -4
- package/dist/capabilities/unrestricted.json +4 -4
- package/dist/capabilities/uplinkswitch.json +21 -21
- package/dist/capabilities/upstage.json +7 -7
- package/dist/capabilities/vancine.json +20 -20
- package/dist/capabilities/vercel.json +568 -576
- package/dist/capabilities/vivgrid.json +78 -78
- package/dist/capabilities/volcengine-coding-plan.json +30 -30
- package/dist/capabilities/volcengine.json +35 -35
- package/dist/capabilities/vultr.json +27 -27
- package/dist/capabilities/wafer.ai.json +16 -16
- 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 +26 -26
- 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 +3 -3
- package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -2
- package/dist/capabilities/xiaomi.json +6 -6
- package/dist/capabilities/xpersona.json +12 -12
- package/dist/capabilities/xxapi.json +31 -31
- package/dist/capabilities/zai-coding-plan.json +13 -13
- package/dist/capabilities/zai.json +27 -27
- package/dist/capabilities/zenifra.json +27 -27
- package/dist/capabilities/zenmux.json +195 -195
- package/dist/capabilities/zerogpu.json +12 -12
- package/dist/capabilities/zhipuai-coding-plan.json +8 -8
- package/dist/capabilities/zhipuai.json +27 -27
- package/dist/capabilities/zro.json +6 -6
- package/dist/channels/agent-channels.d.ts +11 -0
- package/dist/channels/chat-tools.d.ts +156 -0
- package/dist/channels/index.cjs +7 -2
- package/dist/channels/index.d.ts +2 -0
- package/dist/channels/index.js +3 -3
- package/dist/{channels-C5DxhFRc.js → channels-BRVCOutx.js} +1 -1
- package/dist/{channels-B57qQolh.cjs → channels-MjTA9bFp.cjs} +1 -1
- package/dist/coding-agent/index.cjs +4 -4
- package/dist/coding-agent/index.js +4 -4
- package/dist/{constants-DaBkXs5H.cjs → constants-B9ZDvXZ4.cjs} +41 -0
- package/dist/{constants-BDHIyN28.js → constants-BmdTvEYN.js} +30 -1
- package/dist/datasets/dataset.d.ts +13 -6
- package/dist/datasets/experiment/durable.d.ts +16 -0
- package/dist/datasets/experiment/index.d.ts +2 -1
- package/dist/datasets/experiment/item.d.ts +26 -4
- package/dist/datasets/experiment/retries.d.ts +18 -0
- package/dist/datasets/experiment/types.d.ts +18 -0
- package/dist/datasets/experiment/workflow-id.d.ts +7 -0
- package/dist/datasets/experiment/workflow.d.ts +74 -0
- package/dist/datasets/index.cjs +3 -2
- package/dist/datasets/index.d.ts +2 -1
- package/dist/datasets/index.js +3 -3
- package/dist/docs/SKILL.md +2 -2
- package/dist/docs/assets/SOURCE_MAP.json +1309 -1304
- package/dist/docs/references/docs-deployment-workers.md +1 -1
- package/dist/docs/references/docs-evals-experiments.md +29 -1
- package/dist/docs/references/docs-harness-durable-agents.md +9 -5
- package/dist/docs/references/docs-knowledge-agents-and-tools.md +1 -0
- package/dist/docs/references/docs-knowledge-load-your-content.md +1 -1
- package/dist/docs/references/docs-mastra-platform-observability-overview.md +1 -1
- package/dist/docs/references/docs-server-pubsub.md +51 -8
- package/dist/docs/references/docs-signals-running-across-processes.md +2 -0
- package/dist/docs/references/docs-workflows-overview.md +1 -1
- package/dist/docs/references/docs-workflows-scheduled-workflows.md +1 -1
- package/dist/docs/references/integrations-channels-slack.md +4 -2
- package/dist/docs/references/integrations.md +6 -0
- package/dist/docs/references/reference-agents-agent.md +3 -1
- package/dist/docs/references/reference-agents-channels.md +146 -24
- package/dist/docs/references/reference-agents-durable-agent.md +28 -2
- package/dist/docs/references/reference-datasets-runExperimentItem.md +13 -1
- package/dist/docs/references/reference-datasets-startExperimentAsync.md +3 -1
- package/dist/docs/references/reference-editor-mastra-editor.md +3 -1
- package/dist/docs/references/reference-knowledge-knowledge-class.md +2 -2
- package/dist/docs/references/reference-knowledge-knowledge-tools.md +43 -20
- package/dist/docs/references/reference-processors-moderation-processor.md +2 -2
- package/dist/docs/references/reference-pubsub-base.md +5 -1
- package/dist/docs/references/reference-pubsub-event-emitter.md +2 -0
- package/dist/docs/references/reference-pubsub-redis-streams.md +1 -1
- package/dist/docs/references/reference-pubsub-unix-socket-pubsub.md +2 -0
- package/dist/docs/references/reference-streaming-ChunkType.md +1 -1
- package/dist/docs/references/reference-workers-overview.md +1 -1
- package/dist/docs/references/reference-workflows-run-methods-start.md +23 -0
- package/dist/docs/references/reference-workflows-run-methods-timeTravel.md +4 -0
- package/dist/docs/references/reference-workflows-run.md +1 -1
- package/dist/evals/index.cjs +2 -2
- package/dist/evals/index.js +2 -2
- package/dist/evals/scoreTraces/index.cjs +2 -2
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/events/caching-pubsub.d.ts +1 -0
- package/dist/events/event-emitter/index.d.ts +12 -5
- package/dist/events/index.cjs +15 -1
- package/dist/events/index.js +15 -1
- package/dist/events/pubsub.d.ts +29 -0
- package/dist/events/reach.d.ts +11 -0
- package/dist/events/unix-socket-pubsub.d.ts +14 -0
- package/dist/{filesystem-CUj0vclS.cjs → filesystem-B0AZrbj8.cjs} +1 -1
- package/dist/{filesystem-BBqrAmKK.js → filesystem-B3s0WRud.js} +1 -1
- package/dist/{filesystem-B_HACoLS.js → filesystem-B5X-5G0x.js} +1 -1
- package/dist/{filesystem-pZNvxjuW.cjs → filesystem-BDSpwBke.cjs} +1 -1
- package/dist/{filesystem-5Z777gYZ.js → filesystem-BsdkC311.js} +1 -1
- package/dist/{filesystem-BNHPgtjJ.cjs → filesystem-C-cyJfi1.cjs} +1 -1
- package/dist/{filesystem-U5o28b5w.cjs → filesystem-CEbD_77-.cjs} +1 -1
- package/dist/{filesystem-yHKEz2Pr.cjs → filesystem-CUAgLugE.cjs} +1 -1
- package/dist/{filesystem-Cb8iTPM-.js → filesystem-Cv79mHRk.js} +1 -1
- package/dist/{filesystem-DhiaddZe.cjs → filesystem-DsCQiBl2.cjs} +1 -1
- package/dist/{filesystem-DSYDB3ek.js → filesystem-DzM9pcQ8.js} +1 -1
- package/dist/{filesystem-gpIfFMed.js → filesystem-DzfqVTO_.js} +1 -1
- package/dist/{filesystem-versioned-CxbiSJF-.js → filesystem-versioned-Bijb_p9l.js} +44 -44
- package/dist/harness/index.cjs +2 -2
- package/dist/harness/index.js +2 -2
- 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 +7720 -7720
- package/dist/llm/model/shared.types.d.ts +31 -0
- package/dist/{llm-B0VtQDgT.js → llm-Djd8Qzi0.js} +2 -2
- package/dist/{llm-ByskI6z3.cjs → llm-DmUucguC.cjs} +2 -2
- package/dist/loop/base-loop-builder.d.ts +60 -0
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/loop/loop-builder.d.ts +10 -32
- package/dist/loop/workflows/agentic-execution/index.d.ts +1 -1
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +2 -2
- package/dist/loop/workflows/agentic-loop/index.d.ts +1 -1
- package/dist/{manager-C2RGNH68.js → manager-CO_Xz2zR.js} +461 -95
- package/dist/{manager-BJKx4lQf.cjs → manager-D27PkIPo.cjs} +477 -93
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.d.ts +13 -0
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-zUTq9ilk.js → mastra-Ch00nEAJ.js} +66 -25
- package/dist/{mastra-FXCeC5rF.cjs → mastra-qsVWpOTi.cjs} +66 -25
- package/dist/memory/index.cjs +2 -2
- package/dist/memory/index.js +2 -2
- package/dist/{model-BTNRPDgQ.js → model-CW-mfGYA.js} +1 -1
- package/dist/{model-BmTFNo62.cjs → model-Do6DTJoj.cjs} +1 -1
- package/dist/{netlify-B_XdjYPY.cjs → netlify-DU32SDT6.cjs} +1 -1
- package/dist/{netlify-BCSVhO5q.js → netlify-DZSAbdve.js} +1 -1
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/{output-helpers-CncZ3y-g.cjs → output-helpers-1Zu4Vt9C.cjs} +112 -69
- package/dist/{output-helpers-RlvE2WPA.js → output-helpers-CedRCE17.js} +113 -70
- 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/processors/pii-detector.d.ts +1 -0
- package/dist/{provider-registry-Ble43Wb4.js → provider-registry-deA0x-Gd.js} +21349 -21338
- package/dist/{provider-registry-D8O1G18A.cjs → provider-registry-zGezZVsL.cjs} +21349 -21338
- package/dist/provider-registry.json +21695 -21680
- package/dist/{registry-generator-BQ1noftK.cjs → registry-generator-BkQ1AxZn.cjs} +1 -1
- package/dist/{registry-generator-D1Zslex6.js → registry-generator-VvBfOKAD.js} +1 -1
- package/dist/{rehydrate-CgxEur9m.js → rehydrate-BjLV643n.js} +2 -2
- package/dist/{rehydrate-BiA_HUJH.cjs → rehydrate-DDYFpQsV.cjs} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/{run-registry-aomba2_Z.cjs → run-registry-5Suldxz3.cjs} +83965 -77543
- package/dist/{run-registry-BUFmc_78.js → run-registry-CGRPldLH.js} +84057 -77017
- package/dist/{scheduler-BuivoTeD.js → scheduler-B-VZUvv_.js} +1 -1
- package/dist/{scheduler-COSuIH7R.cjs → scheduler-D00X03jQ.cjs} +1 -1
- package/dist/schedules/index.cjs +1 -1
- package/dist/schedules/index.js +1 -1
- package/dist/{schedules-Dmu9qOgc.js → schedules-DZfSx-7P.js} +94 -94
- package/dist/{signal-provider-CicwpNwY.cjs → signal-provider-BFAvh_AJ.cjs} +1 -1
- package/dist/{signal-provider-BOtSN-_0.js → signal-provider-BslnAjWG.js} +1 -1
- package/dist/signals/index.cjs +3 -3
- package/dist/signals/index.js +3 -3
- package/dist/{signals-6EBDPHQX.cjs → signals-B1JSj-Ew.cjs} +2 -2
- package/dist/{signals-BH__LS8Y.js → signals-De9VnwL2.js} +2 -2
- package/dist/skills/index.cjs +2 -2
- package/dist/skills/index.js +2 -2
- package/dist/{source-8qxr6KJv.cjs → source-DDwx-87N.cjs} +1 -1
- package/dist/{source-DRqDgbCv.js → source-Did_2XQc.js} +1 -1
- package/dist/{state-processor-BRk8t1OR.js → state-processor-B9kxpM53.js} +140 -140
- package/dist/{state-processor-Bfs9LkY8.cjs → state-processor-kRNZ38Nf.cjs} +139 -139
- package/dist/storage/constants.cjs +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/agents/index.cjs +1 -1
- package/dist/storage/domains/agents/index.js +1 -1
- package/dist/storage/domains/knowledge/base.d.ts +5 -0
- package/dist/storage/domains/knowledge/inmemory.d.ts +1 -0
- package/dist/storage/domains/knowledge/pages.d.ts +24 -7
- package/dist/storage/domains/mcp-clients/index.cjs +1 -1
- package/dist/storage/domains/mcp-clients/index.js +1 -1
- package/dist/storage/domains/mcp-servers/index.cjs +1 -1
- package/dist/storage/domains/mcp-servers/index.js +1 -1
- package/dist/storage/domains/memory/base.d.ts +3 -1
- package/dist/storage/domains/memory/observational-memory-lifecycle.d.ts +1 -1
- package/dist/storage/domains/prompt-blocks/index.cjs +1 -1
- package/dist/storage/domains/prompt-blocks/index.js +1 -1
- package/dist/storage/domains/scorer-definitions/index.cjs +1 -1
- package/dist/storage/domains/scorer-definitions/index.js +1 -1
- package/dist/storage/domains/skills/index.cjs +1 -1
- package/dist/storage/domains/skills/index.js +1 -1
- package/dist/storage/domains/workspaces/index.cjs +1 -1
- package/dist/storage/domains/workspaces/index.js +1 -1
- package/dist/storage/index.cjs +12 -11
- package/dist/storage/index.js +12 -12
- package/dist/storage/types.d.ts +13 -0
- package/dist/stream/base/output.d.ts +42 -15
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/stream/types.d.ts +19 -0
- package/dist/{stream-S_NC5v9e.js → stream-Dpwx0whf.js} +1 -1
- package/dist/{stream-DUrp3Fcy.cjs → stream-Dvy_0o14.cjs} +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-BhCzpGfr.js → tool-loop-agent-PbWrEj1k.js} +3 -3
- package/dist/{tool-loop-agent-DU0BiemT.cjs → tool-loop-agent-UxOv3FoK.cjs} +3 -3
- package/dist/tools/index.cjs +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/types.d.ts +27 -1
- package/dist/{utils-CeEt4K7t.cjs → utils-BbMTlyBO.cjs} +1 -1
- package/dist/{utils-DYIai19q.js → utils-BnNi1BYM.js} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-BRikrNhF.js → validate-HSBcm96b.js} +1 -1
- package/dist/{validate-BckgxuJ0.cjs → validate-Skps-cM3.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.js +1 -1
- package/dist/{worker-BfhUD77l.cjs → worker-BE-0DyKL.cjs} +3 -3
- package/dist/{worker-DcBfwJqD.js → worker-BKrKHZzU.js} +3 -3
- package/dist/{worker-D9WwmcJa.cjs → worker-BNS5A3qP.cjs} +3 -3
- package/dist/{worker-Du5ybt5o.js → worker-DehaD4qD.js} +3 -3
- package/dist/{workflow-BWV5m9Mx.cjs → workflow-BjUTwaK9.cjs} +4 -4
- package/dist/{workflow-jNWVBYDJ.js → workflow-Bvw6yDjc.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 +18 -0
- package/dist/workflows/evented/workflow-event-processor/run-status.d.ts +37 -0
- package/dist/workflows/evented/workflow.d.ts +11 -1
- package/dist/workflows/index.cjs +6 -6
- package/dist/workflows/index.js +6 -6
- package/dist/workflows/workflow.d.ts +6 -1
- package/dist/workspace/index.cjs +2 -2
- package/dist/workspace/index.js +2 -2
- package/dist/{workspace-D7JRhn1Z.js → workspace-C05xDH60.js} +564 -411
- package/dist/{workspace-BQ2wZj5D.cjs → workspace-D1OzzlLw.cjs} +564 -411
- package/dist/{workspace-skills-CGiXfKzA.js → workspace-skills-38OY32_b.js} +531 -531
- package/package.json +6 -6
- package/src/llm/model/provider-types.generated.d.ts +7720 -7720
- package/dist/agent/durable/evented-execution-engine.d.ts +0 -20
- package/dist/{filesystem-versioned-D-OCaYSl.cjs → filesystem-versioned-DZGyPbNC.cjs} +43 -43
- package/dist/{schedules-qIHUKsj4.cjs → schedules-BZS8McF7.cjs} +93 -93
- package/dist/{workspace-skills-CUSjYHdi.cjs → workspace-skills-BcquhPDn.cjs} +530 -530
|
@@ -30,7 +30,9 @@ console.log(result.output)
|
|
|
30
30
|
console.log(scores)
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
Each call executes the item
|
|
33
|
+
Each call executes the item once, retrying up to `maxRetries` times when you pass it, and you pass run options such as `agentModel` or `itemTimeout` on every call because the experiment record doesn't store them.
|
|
34
|
+
|
|
35
|
+
Calling it on a target-less experiment throws `EXPERIMENT_HAS_NO_TARGET`. Use [`submitExperimentResult()`](https://mastra.ai/reference/datasets/submitExperimentResult) for those. Calls after finalization throw `EXPERIMENT_ALREADY_FINALIZED`, and an `itemId` that isn't visible at the pinned dataset version throws `DATASET_ITEM_NOT_FOUND`.
|
|
34
36
|
|
|
35
37
|
## Parameters
|
|
36
38
|
|
|
@@ -42,6 +44,16 @@ Each call executes the item exactly once, with no internal retry loop. Calling i
|
|
|
42
44
|
|
|
43
45
|
**requestContext** (`Record<string, unknown>`): Request context merged with the item's own request context (item values win).
|
|
44
46
|
|
|
47
|
+
**agentModel** (`string | object`): Model to run an agent target with, instead of the agent's own model. Accepts the same values as agentModel in \`startExperiment()\`. Throws for non-agent targets.
|
|
48
|
+
|
|
49
|
+
**itemTimeout** (`number`): Timeout in milliseconds for the item, covering every retry. A timed-out item records an error and isn't retried.
|
|
50
|
+
|
|
51
|
+
**maxRetries** (`number`): Retries after a failed execution. Defaults to 0. Uses exponential backoff. Aborts, timeouts, and tool mock errors aren't retried. The result row records retryCount.
|
|
52
|
+
|
|
53
|
+
**unmockedToolPolicy** (`'allow' | 'deny'`): Handling for agent tool calls that the item's toolMocks don't declare. Defaults to 'allow'. The item's own unmockedToolPolicy wins.
|
|
54
|
+
|
|
55
|
+
**versions** (`VersionOverrides`): Version overrides for sub-agents the target delegates to.
|
|
56
|
+
|
|
45
57
|
## Returns
|
|
46
58
|
|
|
47
59
|
**result** (`Promise<object>`): The persisted result and its scores.
|
|
@@ -34,7 +34,9 @@ console.log(`Current status: ${experiment.status}`)
|
|
|
34
34
|
|
|
35
35
|
## Parameters
|
|
36
36
|
|
|
37
|
-
Takes the same `StartExperimentConfig` as [`dataset.startExperiment()`](https://mastra.ai/reference/datasets/startExperiment)
|
|
37
|
+
Takes the same `StartExperimentConfig` as [`dataset.startExperiment()`](https://mastra.ai/reference/datasets/startExperiment), plus `durable`.
|
|
38
|
+
|
|
39
|
+
**durable** (`boolean`): Runs the experiment as an evented workflow with one step per item, so a stopped process doesn't leave it running. Needs workers and a pubsub that redelivers events, such as Redis Streams. Only serializable options are allowed: other options throw EXPERIMENT_NOT_DURABLE before anything is created. See Durable experiments.
|
|
38
40
|
|
|
39
41
|
When `persistence.experiments` is set to `'none'`, `startExperimentAsync()` doesn't persist an experiment record, progress updates, or item results. Score persistence remains controlled separately by `persistence.scores`. Without an experiment event observer, the run is fire-and-forget, and the experiment API can't report whether it completed or failed.
|
|
40
42
|
|
|
@@ -178,7 +178,7 @@ All namespaces extend a shared CRUD base class, so they expose the same `create`
|
|
|
178
178
|
|
|
179
179
|
### Agent namespace examples
|
|
180
180
|
|
|
181
|
-
Create a stored override for an existing code-defined agent:
|
|
181
|
+
Create a stored override for an existing code-defined agent. Use the code agent's `id`. The `name`, `instructions`, and `model` fields are required, so pass them even when they match the code agent:
|
|
182
182
|
|
|
183
183
|
```typescript
|
|
184
184
|
import { mastra } from '../mastra'
|
|
@@ -187,7 +187,9 @@ const editor = mastra.getEditor()!
|
|
|
187
187
|
|
|
188
188
|
await editor.agent.create({
|
|
189
189
|
id: 'support-agent',
|
|
190
|
+
name: 'Support agent',
|
|
190
191
|
instructions: 'You are a friendly support agent for Acme.',
|
|
192
|
+
model: { provider: 'openai', name: 'gpt-5.6' },
|
|
191
193
|
tools: {
|
|
192
194
|
search_kb: { description: 'Search the Acme knowledge base' },
|
|
193
195
|
},
|
|
@@ -42,7 +42,7 @@ export const knowledge = new Knowledge({
|
|
|
42
42
|
|
|
43
43
|
**storage** (`MastraCompositeStore`): Storage adapter. Without it, Knowledge uses the storage of the Mastra instance it is registered on.
|
|
44
44
|
|
|
45
|
-
**tools** (`boolean | { read?: boolean | { maxTokens?: number }; write?: boolean }`): Tools an attached agent gets. true gives all
|
|
45
|
+
**tools** (`boolean | { read?: boolean | { maxTokens?: number }; write?: boolean }`): Tools an attached agent gets. true gives all six: knowledge_list, knowledge_search, knowledge_read, knowledge_activity, knowledge_page and knowledge_note. { read: true } gives the first four. { write: true } gives the last two. { read: { maxTokens } } turns on read and caps each knowledge_read body or match result, each knowledge_list result, and each knowledge_activity result, at maxTokens: 1,000 by default, at least 100. See Read pages. (Default: `false`)
|
|
46
46
|
|
|
47
47
|
**pinnedContext** (`boolean | { maxPins?: number; maxTokens?: number }`): Pinned pages delivered to an attached agent every turn, plus the knowledge_pin tool. Needs Memory. maxPins defaults to 20 and maxTokens to 500, with no maximum. See Pinned context. (Default: `false`)
|
|
48
48
|
|
|
@@ -77,7 +77,7 @@ Returns the Knowledge tools for explicit wiring, such as an agent that isn't att
|
|
|
77
77
|
|
|
78
78
|
```typescript
|
|
79
79
|
const tools = knowledge.createTools({ write: false })
|
|
80
|
-
// knowledge_list, knowledge_search, knowledge_read
|
|
80
|
+
// knowledge_list, knowledge_search, knowledge_read, knowledge_activity
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
`principals` fixes the scope addresses every call acts as, for a host that runs the tools outside an agent run, such as an MCP server acting for an external agent. Each address must match a declared scope type, the store's declarations included. A call made with one that doesn't is refused. `createTools()` throws only for an empty list. The call's own run scopes are then ignored, and access follows the scope rules for these principals. Set them from the host's own authentication, never from the request. `author` is recorded on writes made through these tools.
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
# Knowledge tools
|
|
6
6
|
|
|
7
|
-
Knowledge gives agents
|
|
7
|
+
Knowledge gives agents seven tools. Which ones an agent gets depends on the Knowledge `tools` and `pinnedContext` options, or on the groups passed to [`createTools()`](https://mastra.ai/reference/knowledge/knowledge-class). See [Agents and tools](https://mastra.ai/docs/knowledge/agents-and-tools) for how agents use them.
|
|
8
8
|
|
|
9
|
-
| Group | Tools
|
|
10
|
-
| ----- |
|
|
11
|
-
| Read | `knowledge_list`, `knowledge_search`, `knowledge_read` | `tools: true` or `tools: { read: true }` |
|
|
12
|
-
| Write | `knowledge_page`, `knowledge_note`
|
|
13
|
-
| Pins | `knowledge_pin`
|
|
9
|
+
| Group | Tools | Enabled by |
|
|
10
|
+
| ----- | ---------------------------------------------------------------------------- | ----------------------------------------- |
|
|
11
|
+
| Read | `knowledge_list`, `knowledge_search`, `knowledge_read`, `knowledge_activity` | `tools: true` or `tools: { read: true }` |
|
|
12
|
+
| Write | `knowledge_page`, `knowledge_note` | `tools: true` or `tools: { write: true }` |
|
|
13
|
+
| Pins | `knowledge_pin` | `pinnedContext` |
|
|
14
14
|
|
|
15
15
|
Every tool acts with the run's scopes and the roles Knowledge declarations give them. A run that holds no scopes fails with:
|
|
16
16
|
|
|
@@ -140,6 +140,29 @@ A `range` is `{ start: { line, col? }, end: { line, col? } }`. Lines start at 1.
|
|
|
140
140
|
knowledge_read: read notes or mentionedIn on their own, without outline, section, match or from.
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
+
## `knowledge_activity`
|
|
144
|
+
|
|
145
|
+
Lists what changed in Knowledge over a period, newest first, so an agent can answer questions like "what changed since Q3?". It covers page creates, edits, moves, merges and deletes, and notes added, restamped, removed or restored. It shows only changes to pages and notes the run can read now.
|
|
146
|
+
|
|
147
|
+
**since** (`string`): Changes at or after this time: a date such as 2026-07-01 (UTC midnight), or a date-time with a zone such as 2026-07-01T09:30:00Z or 2026-07-01T09:30:00+02:00. A date-time without a zone, or a date that does not exist, is refused. Give since, until or both.
|
|
148
|
+
|
|
149
|
+
**until** (`string`): Changes before this time, in the same formats.
|
|
150
|
+
|
|
151
|
+
**from** (`string`): Only changes to this page, or to pages in this scope: a page reference.
|
|
152
|
+
|
|
153
|
+
**limit** (`number`): Maximum changes, 1 to 100. (Default: `25`)
|
|
154
|
+
|
|
155
|
+
**cursor** (`string`): The previous result's cursor. Pass the same since, until and from; a cursor from other ones is refused.
|
|
156
|
+
|
|
157
|
+
Returns `{ from?, changes, more?, cursor? }`. Each change is `{ at, action, page, author, note? }`:
|
|
158
|
+
|
|
159
|
+
- `page` is `{ ref, name }` with the page's current name, plus `deleted: true` when it has since been deleted.
|
|
160
|
+
- `note`, on a note change, is `{ ref, text, current: true }` with the note's **current** text, not its text when the change happened. A note that has since been removed shows `{ ref, removed: true }` and no text.
|
|
161
|
+
|
|
162
|
+
A change to a page or note the run can no longer read is left out. A result stops at `limit` changes, at the read cap, or after scanning eight batches, whichever comes first. The read cap never excludes the first readable change in those batches. When it stops early, `more` is `true` and `cursor` continues after the last change it consumed, including changes left out because they became unreadable. A result can contain no changes and still have `more: true` when it reaches the scan cap. Continue with its cursor to read older changes. A single note too large for the read cap comes back cut short with `truncated: true`.
|
|
163
|
+
|
|
164
|
+
The tool needs a store that filters activity by date: the in-memory store, LibSQL and PostgreSQL. On other stores it refuses rather than return the whole history.
|
|
165
|
+
|
|
143
166
|
## `knowledge_page`
|
|
144
167
|
|
|
145
168
|
Creates, edits, moves, merges and deletes pages. `scope` only names the destination: the home scope on create, the target scope on move. Edits and merges take no `scope`, and a delete ignores it. All three act on the page's own scope.
|
|
@@ -270,20 +293,20 @@ Pin audience "project:x" does not match a declared scope type.
|
|
|
270
293
|
|
|
271
294
|
## What each operation needs
|
|
272
295
|
|
|
273
|
-
| Operation | Role | On
|
|
274
|
-
| ---------------------------- | ------------- |
|
|
275
|
-
| Search, read, list
|
|
276
|
-
| Create a page | `contributor` | `scope`
|
|
277
|
-
| Edit a page | `editor` | The page's scope
|
|
278
|
-
| Move within a scope | `editor` | The page's scope
|
|
279
|
-
| Move to another scope | `owner` | Both scopes
|
|
280
|
-
| Merge | `owner` | The page that goes away
|
|
281
|
-
| | `editor` | The page that stays, in the same scope
|
|
282
|
-
| | `owner` | The page that stays, in another scope
|
|
283
|
-
| Delete a page | `owner` | The page's scope
|
|
284
|
-
| Add a note | `contributor` | The page's scope and each stamp
|
|
285
|
-
| Restamp, remove a note | `editor` | The page's scope (and `contributor` on each new stamp)
|
|
286
|
-
| Pin, unpin a page or listing | `editor` | The page's scope, plus authority over each audience
|
|
296
|
+
| Operation | Role | On |
|
|
297
|
+
| ---------------------------- | ------------- | ------------------------------------------------------------ |
|
|
298
|
+
| Search, read, list, activity | `viewer` | The page's scope (and, for a note change, the note's stamps) |
|
|
299
|
+
| Create a page | `contributor` | `scope` |
|
|
300
|
+
| Edit a page | `editor` | The page's scope |
|
|
301
|
+
| Move within a scope | `editor` | The page's scope |
|
|
302
|
+
| Move to another scope | `owner` | Both scopes |
|
|
303
|
+
| Merge | `owner` | The page that goes away |
|
|
304
|
+
| | `editor` | The page that stays, in the same scope |
|
|
305
|
+
| | `owner` | The page that stays, in another scope |
|
|
306
|
+
| Delete a page | `owner` | The page's scope |
|
|
307
|
+
| Add a note | `contributor` | The page's scope and each stamp |
|
|
308
|
+
| Restamp, remove a note | `editor` | The page's scope (and `contributor` on each new stamp) |
|
|
309
|
+
| Pin, unpin a page or listing | `editor` | The page's scope, plus authority over each audience |
|
|
287
310
|
|
|
288
311
|
A call that's in reach but needs a stronger role names the role it needs:
|
|
289
312
|
|
|
@@ -52,9 +52,9 @@ const processor = new ModerationProcessor({
|
|
|
52
52
|
|
|
53
53
|
**name** (`string`): Processor display name, always 'Moderation'
|
|
54
54
|
|
|
55
|
-
**processInput** (`(args: { messages: MastraDBMessage[]; abort: (reason?: string) => never; tracingContext?: TracingContext }) => Promise<MastraDBMessage[]>`): Processes input messages to moderate content before sending to LLM
|
|
55
|
+
**processInput** (`(args: { messages: MastraDBMessage[]; abort: (reason?: string) => never; requestContext?: RequestContext; tracingContext?: TracingContext }) => Promise<MastraDBMessage[]>`): Processes input messages to moderate content before sending to LLM. requestContext is passed to the moderation agent, including when it resolves a dynamic model.
|
|
56
56
|
|
|
57
|
-
**processOutputStream** (`(args: { part: ChunkType; streamParts: ChunkType[]; state: Record<string, any>; abort: (reason?: string) => never; tracingContext?: TracingContext }) => Promise<ChunkType | null | undefined>`): Processes streaming output parts to moderate content during streaming
|
|
57
|
+
**processOutputStream** (`(args: { part: ChunkType; streamParts: ChunkType[]; state: Record<string, any>; abort: (reason?: string) => never; writer?: unknown; requestContext?: RequestContext; tracingContext?: TracingContext }) => Promise<ChunkType | null | undefined>`): Processes streaming output parts to moderate content during streaming. When bufferSize is greater than 0 and a writer is passed, text deltas are buffered and checked together. The method returns null while text is buffered and returns the flushed text once a sentence ends or the buffer fills. With strategy: "filter", it also returns null when flushed text is flagged, and that text is dropped. When a non-text part such as finish arrives, the method flushes the buffer. If the flush returns text, the method returns that text and holds the non-text part so the processor runner can reprocess it next. If the buffer is empty or the filter drops the flushed text, the non-text part is returned directly. The runner also flushes any text still buffered when the stream ends. Agents handle this for you. If you call the method directly, reprocess held parts the same way, or leave bufferSize at 0. Without a writer, each text delta is checked separately. requestContext is passed to the moderation agent.
|
|
58
58
|
|
|
59
59
|
## Extended usage example
|
|
60
60
|
|
|
@@ -10,6 +10,8 @@ Mastra uses pub/sub internally for workflow event processing, streaming, and cro
|
|
|
10
10
|
|
|
11
11
|
For built-in implementations, see [`EventEmitterPubSub`](https://mastra.ai/reference/pubsub/event-emitter), [`UnixSocketPubSub`](https://mastra.ai/reference/pubsub/unix-socket-pubsub), [`CachingPubSub`](https://mastra.ai/reference/pubsub/caching-pubsub), [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams), and [`GoogleCloudPubSub`](https://mastra.ai/reference/pubsub/google-cloud-pubsub).
|
|
12
12
|
|
|
13
|
+
Mastra decides how to behave from an implementation's [properties](#properties), not from its class. Override the ones that describe your transport.
|
|
14
|
+
|
|
13
15
|
## Usage example
|
|
14
16
|
|
|
15
17
|
Extend `PubSub` and implement the four abstract methods to add a custom backend.
|
|
@@ -172,7 +174,9 @@ await pubsub.subscribeFromOffset('my-topic', 42, event => {
|
|
|
172
174
|
|
|
173
175
|
**supportsOffsets** (`boolean`): Whether subscribeFromOffset() honors numeric offsets. Defaults to false. A non-zero offset on an unsupported implementation falls back to replay subscription and emits a diagnostic warning when a logger is configured.
|
|
174
176
|
|
|
175
|
-
**
|
|
177
|
+
**deliversAcrossProcesses** (`boolean`): Whether a published event can reach a subscriber in another process. Defaults to true, so Mastra coordinates runs with other processes unless the implementation says otherwise. Return false only when every subscriber lives in the publishing process, as EventEmitterPubSub does.
|
|
178
|
+
|
|
179
|
+
**redeliversUnacked** (`boolean`): Whether an event delivered to a consumer that neither acks nor nacks it, for example because its process stopped, is delivered again to another consumer of the same group once the broker considers it abandoned. Defaults to false. Workflow recovery doesn't restart evented runs on a pubsub that returns true, so return true only when the broker does this, and only after 30 seconds or more. Evented workflows and agents that run on several processes need true. See evented workflows and agents.
|
|
176
180
|
|
|
177
181
|
## Types
|
|
178
182
|
|
|
@@ -10,6 +10,8 @@ Use it for single-process applications. For delivery across processes on one hos
|
|
|
10
10
|
|
|
11
11
|
Because it's in-process, events aren't persisted and aren't shared with other processes. Wrap it in [`CachingPubSub`](https://mastra.ai/reference/pubsub/caching-pubsub) when you need replay for resumable streams.
|
|
12
12
|
|
|
13
|
+
Evented workflows and agents run on `EventEmitterPubSub` in one process, which suits local development and tests. To run them on several instances, use a backend that redelivers unacknowledged events. See [evented workflows and agents](https://mastra.ai/docs/server/pubsub).
|
|
14
|
+
|
|
13
15
|
## Usage example
|
|
14
16
|
|
|
15
17
|
`EventEmitterPubSub` is used automatically when you don't configure a `pubsub` option, so most applications never construct it directly. Create one explicitly only when you want to configure or share it.
|
|
@@ -234,7 +234,7 @@ Keep `reclaimIdleMs` above 30 seconds (the default is 60 seconds). A lower value
|
|
|
234
234
|
|
|
235
235
|
Runs started on older versions can finish after upgrading, but don't have guaranteed crash recovery. An evented workflow run, including a nested workflow run, that was already running with `shouldPersistSnapshot` returning `false` has no stored record, so it fails at its next step after the upgrade. Let those runs finish before upgrading. Saved steps without occurrence identifiers keep their existing unguarded behavior. Other storage adapters keep distributed internal orchestration on the worker process. Worker takeover isn't verified with libSQL embedded replicas (`syncUrl`) shared by several workers.
|
|
236
236
|
|
|
237
|
-
Worker takeover needs a pubsub that delivers each event to one worker of a consumer group, as Redis Streams does.
|
|
237
|
+
Worker takeover needs a pubsub that delivers each event to one worker of a consumer group and redelivers the events a stopped worker held, as Redis Streams does. See [evented workflows and agents](https://mastra.ai/docs/server/pubsub) for the backends and storage adapters that qualify.
|
|
238
238
|
|
|
239
239
|
An interrupted step can execute again, so make external side effects idempotent. Completed step occurrences are protected against stale redeliveries, and a completed loop iteration reuses its saved result and loop decision. Guarded execution persists the records needed for recovery even when `shouldPersistSnapshot` returns `false`. Resume, time travel, restart races, and individual `foreach` items aren't covered by these occurrence guards. See [make tools safe to repeat](https://mastra.ai/docs/harness/durable-agents) for agent tools.
|
|
240
240
|
|
|
@@ -10,6 +10,8 @@ Use it when several local processes need to share a stream, such as coordinating
|
|
|
10
10
|
|
|
11
11
|
`UnixSocketPubSub` is a push transport: events arrive without a read loop, so Mastra doesn't run a pull worker for it.
|
|
12
12
|
|
|
13
|
+
It doesn't redeliver the events a stopped process held, so it isn't a backend for evented workflows or agents that run on several processes. See [evented workflows and agents](https://mastra.ai/docs/server/pubsub).
|
|
14
|
+
|
|
13
15
|
## Usage example
|
|
14
16
|
|
|
15
17
|
Pass a socket path that every participating process shares.
|
|
@@ -582,7 +582,7 @@ When consumed by [`Agent.streamUntilIdle()`](https://mastra.ai/reference/streami
|
|
|
582
582
|
|
|
583
583
|
**payload.agentId** (`string`): ID of the agent that dispatched the task
|
|
584
584
|
|
|
585
|
-
**payload.
|
|
585
|
+
**payload.suspendPayload** (`unknown`): Whatever the tool passed to suspend(data)
|
|
586
586
|
|
|
587
587
|
### background-task-resumed
|
|
588
588
|
|
|
@@ -66,7 +66,7 @@ Processes workflow events from the PubSub `workflows` topic. Requires a pull-cap
|
|
|
66
66
|
Polls storage for due cron schedules and publishes a `workflow.start` event to the `workflows` topic for each fire. The orchestration worker runs default-engine workflows in-process and evented workflows step by step.
|
|
67
67
|
|
|
68
68
|
- **Name**: `scheduler`
|
|
69
|
-
- **
|
|
69
|
+
- **Multiple instances**: Instances that share storage claim each fire atomically, so only one instance claims each fire. The scheduler makes up to three publish attempts per fire (two retries), so a retry after a lost broker response can publish the same fire again. A fire whose publish attempts all fail isn't replayed automatically.
|
|
70
70
|
|
|
71
71
|
### BackgroundTaskWorker
|
|
72
72
|
|
|
@@ -50,6 +50,8 @@ const result = await run.start({
|
|
|
50
50
|
|
|
51
51
|
**outputOptions.includeState** (`boolean`): Whether to include the workflow run state in the result.
|
|
52
52
|
|
|
53
|
+
**perStep** (`boolean`): Run one step, then stop. The run reports status paused. See Run one step at a time to continue it.
|
|
54
|
+
|
|
53
55
|
## Returns
|
|
54
56
|
|
|
55
57
|
**result** (`Promise<WorkflowResult<TState, TInput, TOutput, TSteps>>`): A promise that resolves to the workflow execution result containing step outputs and status
|
|
@@ -76,6 +78,27 @@ const result = await run.start({
|
|
|
76
78
|
})
|
|
77
79
|
```
|
|
78
80
|
|
|
81
|
+
## Run one step at a time
|
|
82
|
+
|
|
83
|
+
Pass `perStep: true` to run only the next step. The run then reports status `paused`, and `steps` holds the output of the step that ran.
|
|
84
|
+
|
|
85
|
+
A paused run isn't suspended, so `run.resume()` throws `This workflow run was not suspended`. Calling `run.start()` again reruns the workflow from its first step. To continue, call [`run.timeTravel()`](https://mastra.ai/reference/workflows/run-methods/timeTravel) on the same run with the ID of the next step. It reuses the stored results of the steps that already ran. If the previous step returned `null`, the next step receives `{}` instead, so return an object from steps that run before a `timeTravel()` continuation. The workflow needs configured [storage](https://mastra.ai/docs/storage), and the paused run's snapshot must still be in it. Otherwise, `timeTravel()` throws `Snapshot not found for run <runId>`:
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
const run = await workflow.createRun()
|
|
89
|
+
|
|
90
|
+
const first = await run.start({ inputData: { value: 1 }, perStep: true })
|
|
91
|
+
// first.status === 'paused'
|
|
92
|
+
|
|
93
|
+
// Run the next step only, then pause again
|
|
94
|
+
const second = await run.timeTravel({ step: 'step-2', perStep: true })
|
|
95
|
+
// second.status === 'paused'
|
|
96
|
+
|
|
97
|
+
// Run the remaining steps to completion
|
|
98
|
+
const final = await run.timeTravel({ step: 'step-3' })
|
|
99
|
+
// final.status === 'success'
|
|
100
|
+
```
|
|
101
|
+
|
|
79
102
|
## Related
|
|
80
103
|
|
|
81
104
|
- [Workflows overview](https://mastra.ai/docs/workflows/overview)
|
|
@@ -61,6 +61,8 @@ const result = await run.timeTravel({
|
|
|
61
61
|
|
|
62
62
|
**outputOptions.includeResumeLabels** (`boolean`): Whether to include resume labels in the result.
|
|
63
63
|
|
|
64
|
+
**perStep** (`boolean`): Run only the target step, then stop with status paused. Use it to continue a run started with perStep: true one step at a time. See Run one step at a time.
|
|
65
|
+
|
|
64
66
|
## Returns
|
|
65
67
|
|
|
66
68
|
**result** (`TOutput`): The workflow output. Present when status is 'success'.
|
|
@@ -181,6 +183,8 @@ Calling `timeTravel()` again after the previous call finished is still allowed a
|
|
|
181
183
|
- Time travel requires storage to be configured since it relies on persisted workflow snapshots
|
|
182
184
|
- When re-executing a workflow, the workflow loads the existing snapshot from storage (if available)
|
|
183
185
|
- Step results before the target step are reconstructed from the snapshot or provided context
|
|
186
|
+
- When the target is the first step, any `inputData` other than `undefined` replaces the stored workflow input, including `null`, `false`, `0`, and `''`. If you omit `inputData`, the step reuses the stored workflow input, even when that input is `null` or `undefined`
|
|
187
|
+
- For a later target, the step receives the output of the step before it. An output for that step in `context` takes precedence, then a truthy `inputData`, then the stored output. A falsy `inputData` such as `null`, `false`, `0`, or `''` is ignored. If none of these is set, or the stored output is `null` or `undefined`, the step receives `{}` instead, which can fail its input schema. Return an object from the previous step, or pass an object as `inputData` without a `context` output for the previous step
|
|
184
188
|
- Execution begins from the specified step with the provided or reconstructed input data
|
|
185
189
|
- If a step that precedes the target in the current workflow definition has no recorded entry in the snapshot (for example, the step was renamed since the run was recorded, or the run never reached it), `timeTravel` rejects with a descriptive error before anything executes and the stored snapshot is left unchanged
|
|
186
190
|
- The workflow continues to completion from that point forward
|
|
@@ -58,7 +58,7 @@ A workflow run's `status` indicates its current execution state. The possible va
|
|
|
58
58
|
|
|
59
59
|
**suspended** (`string`): Workflow execution is paused waiting for resume, with suspended step information
|
|
60
60
|
|
|
61
|
-
**paused** (`string`): Workflow execution stopped after a single step because the run uses per-step execution
|
|
61
|
+
**paused** (`string`): Workflow execution stopped after a single step because the run uses per-step execution. Continue it with run.timeTravel(), not run.resume(). See Run one step at a time
|
|
62
62
|
|
|
63
63
|
**canceled** (`string`): Workflow execution was canceled via the cancel() method. Subsequent steps do not run, and running steps stop only if they respond to their abortSignal
|
|
64
64
|
|
package/dist/evals/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_run_registry = require("../run-registry-
|
|
3
|
-
const require_constants = require("../constants-
|
|
2
|
+
const require_run_registry = require("../run-registry-5Suldxz3.cjs");
|
|
3
|
+
const require_constants = require("../constants-B9ZDvXZ4.cjs");
|
|
4
4
|
const require_collect_tool_mocks = require("../collect-tool-mocks-k9fM6oDl.cjs");
|
|
5
5
|
exports.MastraScorer = require_run_registry.MastraScorer;
|
|
6
6
|
exports.SCORING_PREDICATE_ROOTS = require_run_registry.SCORING_PREDICATE_ROOTS;
|
package/dist/evals/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Ar as
|
|
1
|
+
import { C as MastraScorer, D as isNotScorable, E as filterRun, O as notScorable, S as createClassifierScorer, T as createScorer, _ as runEvals, bc as evaluateScoringPredicate, w as ScorerRunError, xc as validateScoringPredicate, yc as SCORING_PREDICATE_ROOTS } from "../run-registry-CGRPldLH.js";
|
|
2
|
+
import { Ar as scoringEntityTypeSchema, Cr as extractTrajectory, Dr as saveScorePayloadSchema, Er as listScoresResponseSchema, Fr as scoringInputWithExtractStepResultAndScoreAndReasonSchema, Ir as scoringInputWithExtractStepResultSchema, Lr as scoringPromptsSchema, Mr as scoringHookInputSchema, Nr as scoringInputSchema, Or as scoreResultSchema, Pr as scoringInputWithExtractStepResultAndAnalyzeStepResultSchema, Rr as scoringSourceSchema, Tr as extractWorkflowTrajectory, jr as scoringExtractStepResultSchema, kr as scoreRowDataSchema, wr as extractTrajectoryFromTrace, zr as scoringValueSchema } from "../constants-BmdTvEYN.js";
|
|
3
3
|
import { t as collectToolMocks } from "../collect-tool-mocks-3s2BN8o7.js";
|
|
4
4
|
export { MastraScorer, SCORING_PREDICATE_ROOTS, ScorerRunError, collectToolMocks, createClassifierScorer, createScorer, evaluateScoringPredicate, extractTrajectory, extractTrajectoryFromTrace, extractWorkflowTrajectory, filterRun, isNotScorable, listScoresResponseSchema, notScorable, runEvals, saveScorePayloadSchema, scoreResultSchema, scoreRowDataSchema, scoringEntityTypeSchema, scoringExtractStepResultSchema, scoringHookInputSchema, scoringInputSchema, scoringInputWithExtractStepResultAndAnalyzeStepResultSchema, scoringInputWithExtractStepResultAndScoreAndReasonSchema, scoringInputWithExtractStepResultSchema, scoringPromptsSchema, scoringSourceSchema, scoringValueSchema, validateScoringPredicate };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_error = require("../../error-D90lJ6M7.cjs");
|
|
3
3
|
const require_utils = require("../../utils-D-eNsgDM.cjs");
|
|
4
|
-
const require_run_registry = require("../../run-registry-
|
|
5
|
-
const require_constants = require("../../constants-
|
|
4
|
+
const require_run_registry = require("../../run-registry-5Suldxz3.cjs");
|
|
5
|
+
const require_constants = require("../../constants-B9ZDvXZ4.cjs");
|
|
6
6
|
let zod_v4 = require("zod/v4");
|
|
7
7
|
// src/evals/scoreTraces/scoreTraces.ts
|
|
8
8
|
async function scoreTraces({ scorerId, targets, mastra }) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as MastraError, n as ErrorDomain, t as ErrorCategory } from "../../error-oh2DLsP2.js";
|
|
2
2
|
import { i as getEntityTypeForSpan } from "../../utils-DU_pU5SK.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Ds as createStep, Os as createWorkflow } from "../../run-registry-CGRPldLH.js";
|
|
4
|
+
import { Dr as saveScorePayloadSchema } from "../../constants-BmdTvEYN.js";
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
6
|
// src/evals/scoreTraces/scoreTraces.ts
|
|
7
7
|
async function scoreTraces({ scorerId, targets, mastra }) {
|
|
@@ -147,6 +147,7 @@ export declare class CachingPubSub extends PubSub {
|
|
|
147
147
|
__rawBus(): PubSub;
|
|
148
148
|
get supportsNativeBatching(): boolean;
|
|
149
149
|
get supportsOffsets(): boolean;
|
|
150
|
+
get deliversAcrossProcesses(): boolean;
|
|
150
151
|
get redeliversUnacked(): boolean;
|
|
151
152
|
/**
|
|
152
153
|
* Topics `shouldCache` leaves out only reach the inner transport. With
|
|
@@ -12,12 +12,17 @@ export interface EventEmitterPubSubOptions {
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* The default pubsub: delivers events inside the process that published them.
|
|
15
|
+
* It needs no external service, and nothing it holds outlives the process.
|
|
15
16
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* Evented workflows and evented agents run on it in one process: local
|
|
18
|
+
* development, tests, and a single server. It is not a transport for running
|
|
19
|
+
* them on several instances. Each instance has its own emitter, so an event
|
|
20
|
+
* never reaches another instance, and instances that share one storage each
|
|
21
|
+
* treat the others' runs as their own to recover. Use a pubsub that redelivers
|
|
22
|
+
* unacknowledged events for that.
|
|
23
|
+
*
|
|
24
|
+
* The leases, consumer groups and nack redelivery here coordinate subscribers
|
|
25
|
+
* of this one process. They give no guarantee across processes.
|
|
21
26
|
*/
|
|
22
27
|
export declare class EventEmitterPubSub extends PubSub implements LeaseProvider {
|
|
23
28
|
get supportedModes(): ReadonlyArray<PubSubDeliveryMode>;
|
|
@@ -28,6 +33,8 @@ export declare class EventEmitterPubSub extends PubSub implements LeaseProvider
|
|
|
28
33
|
* needed.
|
|
29
34
|
*/
|
|
30
35
|
get supportsNativeBatching(): boolean;
|
|
36
|
+
/** Every subscriber is a listener on this process's emitter. */
|
|
37
|
+
get deliversAcrossProcesses(): boolean;
|
|
31
38
|
/**
|
|
32
39
|
* Ack and nack are no-ops here: a message lives only in the process that
|
|
33
40
|
* published it, so nothing redelivers it once that process stops.
|
package/dist/events/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("../rolldown-runtime-BrhgMLW6.cjs");
|
|
3
|
-
const require_output_helpers = require("../output-helpers-
|
|
3
|
+
const require_output_helpers = require("../output-helpers-1Zu4Vt9C.cjs");
|
|
4
4
|
const require_file = require("../file-BEndQUN1.cjs");
|
|
5
5
|
let crypto = require("crypto");
|
|
6
6
|
let path = require("path");
|
|
@@ -465,6 +465,20 @@ function readFrames(socket, onFrame, maxFrameBytes) {
|
|
|
465
465
|
}
|
|
466
466
|
});
|
|
467
467
|
}
|
|
468
|
+
/**
|
|
469
|
+
* Delivers events between processes on one host over a Unix domain socket. One
|
|
470
|
+
* process is elected broker and the others connect to it; when the broker
|
|
471
|
+
* exits, the rest elect a new one. Leases are files next to the socket.
|
|
472
|
+
*
|
|
473
|
+
* It carries streams, signals and thread leases between local processes, such
|
|
474
|
+
* as several Mastra Code sessions on one machine.
|
|
475
|
+
*
|
|
476
|
+
* It is not a transport for evented workflows or evented agents spread over
|
|
477
|
+
* several processes. The broker is one of those processes and keeps no list of
|
|
478
|
+
* the events each consumer holds, so the step a stopped process was running is
|
|
479
|
+
* never handed to another one. Use a pubsub that redelivers unacknowledged
|
|
480
|
+
* events for that.
|
|
481
|
+
*/
|
|
468
482
|
var UnixSocketPubSub = class extends require_output_helpers.PubSub {
|
|
469
483
|
socketPath;
|
|
470
484
|
#leaseDirectory;
|
package/dist/events/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as PubSub, a as rehydrateError, c as RUN_LOG_TTL_MS, d as toCachedLogFrame, g as NoopLeaseProvider, h as EventEmitterPubSub, i as withCaching, l as cachedLogTtlMs, n as PublisherQueueLimitError, o as serializeError, r as CachingPubSub, s as RUN_LOCAL_TOPIC_PREFIXES, t as DefaultStepResult, u as isRunLocalTopic, v as isLeaseProvider, y as withAck } from "../output-helpers-CedRCE17.js";
|
|
2
2
|
import { n as DefaultGeneratedFileWithType, t as DefaultGeneratedFile } from "../file-DGZrR5f7.js";
|
|
3
3
|
import { createHash } from "crypto";
|
|
4
4
|
import { basename, dirname, join, sep } from "path";
|
|
@@ -462,6 +462,20 @@ function readFrames(socket, onFrame, maxFrameBytes) {
|
|
|
462
462
|
}
|
|
463
463
|
});
|
|
464
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
* Delivers events between processes on one host over a Unix domain socket. One
|
|
467
|
+
* process is elected broker and the others connect to it; when the broker
|
|
468
|
+
* exits, the rest elect a new one. Leases are files next to the socket.
|
|
469
|
+
*
|
|
470
|
+
* It carries streams, signals and thread leases between local processes, such
|
|
471
|
+
* as several Mastra Code sessions on one machine.
|
|
472
|
+
*
|
|
473
|
+
* It is not a transport for evented workflows or evented agents spread over
|
|
474
|
+
* several processes. The broker is one of those processes and keeps no list of
|
|
475
|
+
* the events each consumer holds, so the step a stopped process was running is
|
|
476
|
+
* never handed to another one. Use a pubsub that redelivers unacknowledged
|
|
477
|
+
* events for that.
|
|
478
|
+
*/
|
|
465
479
|
var UnixSocketPubSub = class extends PubSub {
|
|
466
480
|
socketPath;
|
|
467
481
|
#leaseDirectory;
|
package/dist/events/pubsub.d.ts
CHANGED
|
@@ -14,6 +14,21 @@ import type { Event, EventCallback, SubscribeOptions } from './types.js';
|
|
|
14
14
|
* broker push delivered over HTTP.
|
|
15
15
|
*/
|
|
16
16
|
export type PubSubDeliveryMode = 'pull' | 'push';
|
|
17
|
+
/**
|
|
18
|
+
* The event bus behind workflow execution, streams, signals, background tasks
|
|
19
|
+
* and schedules.
|
|
20
|
+
*
|
|
21
|
+
* Mastra decides how to behave from the capability getters below
|
|
22
|
+
* (`deliversAcrossProcesses`, `redeliversUnacked`, `supportedModes`, ...), never
|
|
23
|
+
* from which transport class the instance is. An implementation states what its
|
|
24
|
+
* transport does by overriding them.
|
|
25
|
+
*
|
|
26
|
+
* Evented workflows and evented agents can run on any implementation inside one
|
|
27
|
+
* process. Running them on several processes needs a pubsub that redelivers
|
|
28
|
+
* unacknowledged events and a workflows store with step guards.
|
|
29
|
+
*
|
|
30
|
+
* @see https://mastra.ai/docs/server/pubsub#evented-workflows-and-agents
|
|
31
|
+
*/
|
|
17
32
|
export declare abstract class PubSub {
|
|
18
33
|
abstract publish(topic: string, event: Omit<Event, 'id' | 'createdAt'>, options?: {
|
|
19
34
|
localOnly?: boolean;
|
|
@@ -97,6 +112,17 @@ export declare abstract class PubSub {
|
|
|
97
112
|
* Defaults to `false`.
|
|
98
113
|
*/
|
|
99
114
|
get supportsOffsets(): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Whether an event published here can reach a subscriber in another process.
|
|
117
|
+
* Defaults to `true`, so an implementation is treated as a shared transport
|
|
118
|
+
* unless it says otherwise: runs are fenced against other processes, and
|
|
119
|
+
* shutdown detaches from the evented runs other processes may still execute
|
|
120
|
+
* instead of stopping them.
|
|
121
|
+
*
|
|
122
|
+
* Return `false` only when every subscriber lives in the publishing process.
|
|
123
|
+
* Mastra then skips that cross-process coordination.
|
|
124
|
+
*/
|
|
125
|
+
get deliversAcrossProcesses(): boolean;
|
|
100
126
|
/**
|
|
101
127
|
* Whether a message delivered to a consumer that neither acks nor nacks it
|
|
102
128
|
* (for example because its process died) is delivered again to a consumer of
|
|
@@ -107,6 +133,9 @@ export declare abstract class PubSub {
|
|
|
107
133
|
* pass restarts the run. The broker's abandonment threshold must be at least
|
|
108
134
|
* 30 s, the evented step fence a dead worker leaves behind; a redelivery that
|
|
109
135
|
* arrives before the fence expires is dropped as a duplicate.
|
|
136
|
+
*
|
|
137
|
+
* Evented workflows and agents that run on several processes need `true`
|
|
138
|
+
* here. Without it, no other worker picks up the step a stopped worker held.
|
|
110
139
|
*/
|
|
111
140
|
get redeliversUnacked(): boolean;
|
|
112
141
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PubSub } from './pubsub.js';
|
|
2
|
+
/**
|
|
3
|
+
* Whether events published on `pubsub` can reach a subscriber in another
|
|
4
|
+
* process, read from the transport under any decorator.
|
|
5
|
+
*
|
|
6
|
+
* Only an explicit `false` counts as no. A pubsub built against a copy of
|
|
7
|
+
* `@mastra/core` that predates `deliversAcrossProcesses` has no such getter, and
|
|
8
|
+
* must keep being treated as a shared transport.
|
|
9
|
+
*/
|
|
10
|
+
export declare function reachesOtherProcesses(pubsub: PubSub): boolean;
|
|
11
|
+
//# sourceMappingURL=reach.d.ts.map
|
|
@@ -42,6 +42,20 @@ type UnixSocketPubSubOptions = {
|
|
|
42
42
|
* in sync as the consumer budget changes.
|
|
43
43
|
*/
|
|
44
44
|
export declare const MAX_LOCAL_REDELIVERIES = 6;
|
|
45
|
+
/**
|
|
46
|
+
* Delivers events between processes on one host over a Unix domain socket. One
|
|
47
|
+
* process is elected broker and the others connect to it; when the broker
|
|
48
|
+
* exits, the rest elect a new one. Leases are files next to the socket.
|
|
49
|
+
*
|
|
50
|
+
* It carries streams, signals and thread leases between local processes, such
|
|
51
|
+
* as several Mastra Code sessions on one machine.
|
|
52
|
+
*
|
|
53
|
+
* It is not a transport for evented workflows or evented agents spread over
|
|
54
|
+
* several processes. The broker is one of those processes and keeps no list of
|
|
55
|
+
* the events each consumer holds, so the step a stopped process was running is
|
|
56
|
+
* never handed to another one. Use a pubsub that redelivers unacknowledged
|
|
57
|
+
* events for that.
|
|
58
|
+
*/
|
|
45
59
|
export declare class UnixSocketPubSub extends PubSub implements LeaseProvider {
|
|
46
60
|
#private;
|
|
47
61
|
readonly socketPath: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_deep_equal = require("./deep-equal-TMDmByBC.cjs");
|
|
2
|
-
const require_filesystem_versioned = require("./filesystem-versioned-
|
|
2
|
+
const require_filesystem_versioned = require("./filesystem-versioned-DZGyPbNC.cjs");
|
|
3
3
|
// src/storage/domains/skills/base.ts
|
|
4
4
|
var SkillsStorage = class extends require_filesystem_versioned.VersionedStorageDomain {
|
|
5
5
|
listKey = "skills";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as deepEqual } from "./deep-equal-d1xU02ag.js";
|
|
2
|
-
import {
|
|
2
|
+
import { f as calculatePagination, m as normalizePerPage, o as VersionedStorageDomain, t as FilesystemVersionedHelpers } from "./filesystem-versioned-Bijb_p9l.js";
|
|
3
3
|
// src/storage/domains/workspaces/base.ts
|
|
4
4
|
var WorkspacesStorage = class extends VersionedStorageDomain {
|
|
5
5
|
listKey = "workspaces";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as deepEqual } from "./deep-equal-d1xU02ag.js";
|
|
2
|
-
import {
|
|
2
|
+
import { f as calculatePagination, m as normalizePerPage, o as VersionedStorageDomain, t as FilesystemVersionedHelpers } from "./filesystem-versioned-Bijb_p9l.js";
|
|
3
3
|
// src/storage/domains/mcp-clients/base.ts
|
|
4
4
|
var MCPClientsStorage = class extends VersionedStorageDomain {
|
|
5
5
|
listKey = "mcpClients";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_deep_equal = require("./deep-equal-TMDmByBC.cjs");
|
|
2
|
-
const require_filesystem_versioned = require("./filesystem-versioned-
|
|
2
|
+
const require_filesystem_versioned = require("./filesystem-versioned-DZGyPbNC.cjs");
|
|
3
3
|
// src/storage/domains/mcp-servers/base.ts
|
|
4
4
|
var MCPServersStorage = class extends require_filesystem_versioned.VersionedStorageDomain {
|
|
5
5
|
listKey = "mcpServers";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as deepEqual } from "./deep-equal-d1xU02ag.js";
|
|
2
|
-
import {
|
|
2
|
+
import { f as calculatePagination, m as normalizePerPage, o as VersionedStorageDomain, t as FilesystemVersionedHelpers } from "./filesystem-versioned-Bijb_p9l.js";
|
|
3
3
|
// src/storage/domains/skills/base.ts
|
|
4
4
|
var SkillsStorage = class extends VersionedStorageDomain {
|
|
5
5
|
listKey = "skills";
|