@mastra/core 1.87.0-alpha.1 → 1.87.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_types/@ai-sdk_openai@4.0.106/dist/index.d.ts +2034 -0
- package/dist/_types/@ai-sdk_openai@4.0.106/package.json +1 -0
- package/dist/a2a/index.cjs +1 -1
- package/dist/a2a/index.js +1 -1
- package/dist/agent/agent.d.ts +3 -1
- package/dist/agent/durable/index.cjs +1 -1
- package/dist/agent/durable/index.js +1 -1
- package/dist/agent/durable/run-message-refs.d.ts +3 -2
- package/dist/agent/index.cjs +5 -4
- package/dist/agent/index.d.ts +2 -0
- package/dist/agent/index.js +5 -5
- package/dist/agent/merge-persona.d.ts +15 -0
- package/dist/agent/message-list/adapters/AIV5Adapter.d.ts +15 -1
- package/dist/agent/message-list/index.cjs +2 -2
- package/dist/agent/message-list/index.js +2 -2
- package/dist/agent/message-list/state/types.d.ts +5 -1
- package/dist/agent/message-list/types.d.ts +1 -1
- package/dist/agent/message-list/utils/provider-compat.d.ts +9 -1
- package/dist/agent-builder/ee/index.cjs +1 -1
- package/dist/agent-builder/ee/index.js +1 -1
- package/dist/agent-controller/agent-controller.d.ts +6 -0
- package/dist/agent-controller/index.cjs +2 -2
- package/dist/agent-controller/index.js +2 -2
- package/dist/agent-controller/worker-run-binding.d.ts +15 -0
- package/dist/{agent-controller-C1bK0CXm.js → agent-controller--gKWI81G.js} +50 -8
- package/dist/{agent-controller-BTIxiD1u.cjs → agent-controller-BolLBwDm.cjs} +50 -8
- package/dist/background-tasks/index.cjs +2 -1
- package/dist/background-tasks/index.d.ts +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/background-tasks/resolve-config.d.ts +30 -1
- package/dist/background-tasks/system-prompt.d.ts +8 -2
- package/dist/background-tasks/types.d.ts +47 -1
- package/dist/{background-tasks-BbVsBghi.js → background-tasks-CgzXjBfE.js} +156 -33
- package/dist/{background-tasks-CVl6e0Jo.cjs → background-tasks-DYtlijQ1.cjs} +167 -32
- package/dist/browser/index.cjs +2 -2
- package/dist/browser/index.js +2 -2
- package/dist/{builder-BRJPSTig.cjs → builder-Dz-g-9CZ.cjs} +2 -2
- package/dist/{builder-C8XzrtBQ.js → builder-emNPaIaC.js} +2 -2
- package/dist/capabilities/302ai.json +202 -202
- package/dist/capabilities/abliteratedllm.json +39 -30
- package/dist/capabilities/abliteration-ai.json +9 -9
- package/dist/capabilities/above.json +20 -20
- package/dist/capabilities/adaption.json +16 -16
- package/dist/capabilities/adzuki.json +24 -24
- package/dist/capabilities/agentrouter.json +6 -6
- package/dist/capabilities/agnes.json +2 -2
- package/dist/capabilities/ai-router.json +9 -9
- package/dist/capabilities/aiand.json +25 -25
- package/dist/capabilities/aigrow.json +14 -14
- package/dist/capabilities/aimlapi.json +140 -143
- package/dist/capabilities/aixy.json +15 -15
- package/dist/capabilities/aki-io.json +16 -16
- package/dist/capabilities/alibaba-cn.json +98 -92
- package/dist/capabilities/alibaba-coding-plan-cn.json +4 -4
- package/dist/capabilities/alibaba-coding-plan.json +4 -4
- package/dist/capabilities/alibaba-token-plan-cn.json +54 -54
- package/dist/capabilities/alibaba-token-plan.json +54 -54
- package/dist/capabilities/alibaba.json +100 -66
- package/dist/capabilities/ambient.json +17 -10
- package/dist/capabilities/amd.json +9 -9
- package/dist/capabilities/anthropic.json +47 -47
- package/dist/capabilities/anyapi.json +13 -13
- package/dist/capabilities/apiko.json +5 -5
- package/dist/capabilities/arcee.json +6 -6
- package/dist/capabilities/augure.json +7 -7
- package/dist/capabilities/auriko.json +15 -15
- package/dist/capabilities/bailing.json +3 -3
- package/dist/capabilities/baseten.json +34 -34
- package/dist/capabilities/bee.json +4 -4
- package/dist/capabilities/berget.json +16 -3
- package/dist/capabilities/bothub.json +12 -12
- package/dist/capabilities/boundless.json +37 -37
- package/dist/capabilities/bumo.json +42 -42
- package/dist/capabilities/byteplus.json +27 -27
- package/dist/capabilities/cerebras.json +4 -4
- package/dist/capabilities/cheapaimodel.json +8 -8
- package/dist/capabilities/cheapest-token.json +31 -31
- package/dist/capabilities/chutes.json +10 -10
- package/dist/capabilities/claudinio.json +10 -1
- package/dist/capabilities/cline-pass.json +38 -38
- package/dist/capabilities/cloudcode.json +7 -14
- package/dist/capabilities/cloudflare-workers-ai.json +15 -15
- package/dist/capabilities/commandcode.json +124 -124
- package/dist/capabilities/concentrate.json +275 -292
- package/dist/capabilities/cortecs.json +107 -107
- package/dist/capabilities/crossmodel.json +180 -180
- package/dist/capabilities/crusoe.json +34 -5
- package/dist/capabilities/daoxe.json +8 -8
- package/dist/capabilities/databricks.json +127 -127
- package/dist/capabilities/deepinfra.json +102 -93
- package/dist/capabilities/deepseek.json +4 -4
- package/dist/capabilities/digitalocean.json +114 -114
- package/dist/capabilities/dothoosh.json +28 -28
- package/dist/capabilities/doubleword.json +25 -25
- package/dist/capabilities/edenai.json +283 -295
- package/dist/capabilities/empiriolabs.json +173 -173
- package/dist/capabilities/engy.json +18 -18
- package/dist/capabilities/entrim.json +2 -2
- package/dist/capabilities/evroc.json +14 -14
- package/dist/capabilities/ezkielyna.json +6 -6
- package/dist/capabilities/fastrouter.json +71 -71
- package/dist/capabilities/fireworks-ai.json +132 -71
- package/dist/capabilities/fortytwo.json +9 -3
- package/dist/capabilities/freemodel.json +12 -12
- package/dist/capabilities/friendli.json +8 -8
- package/dist/capabilities/frogbot.json +96 -96
- package/dist/capabilities/gisoo.json +18 -18
- package/dist/capabilities/gmicloud.json +22 -22
- package/dist/capabilities/google.json +54 -54
- package/dist/capabilities/graphn.json +16 -16
- package/dist/capabilities/greenpt.json +35 -35
- package/dist/capabilities/groq.json +2 -2
- package/dist/capabilities/helicone.json +78 -78
- package/dist/capabilities/hetzner.json +35 -3
- package/dist/capabilities/hopper.json +2 -2
- package/dist/capabilities/hostinger-router.json +14 -14
- package/dist/capabilities/hpc-ai.json +10 -10
- package/dist/capabilities/huawei-maas.json +15 -15
- package/dist/capabilities/hubris.json +29 -29
- package/dist/capabilities/huggingface.json +105 -155
- package/dist/capabilities/hyper.json +21 -29
- package/dist/capabilities/impossibl.json +144 -144
- package/dist/capabilities/inception.json +2 -2
- package/dist/capabilities/inceptron.json +6 -6
- package/dist/capabilities/inco.json +4 -4
- package/dist/capabilities/infer.json +20 -20
- package/dist/capabilities/inferall.json +11 -11
- package/dist/capabilities/inference-coop.json +12 -12
- package/dist/capabilities/inferenceapis.json +18 -18
- package/dist/capabilities/inferris.json +3 -3
- package/dist/capabilities/infersia.json +12 -12
- package/dist/capabilities/infomaniak.json +2 -2
- package/dist/capabilities/io-net.json +2 -2
- package/dist/capabilities/isoquant.json +4 -4
- package/dist/capabilities/iteracompute.json +57 -57
- package/dist/capabilities/jad-ai.json +3 -3
- package/dist/capabilities/jalapeno.json +12 -12
- package/dist/capabilities/jiekou.json +63 -63
- package/dist/capabilities/jzstoken.json +52 -53
- package/dist/capabilities/keln.json +21 -21
- package/dist/capabilities/kenari.json +120 -128
- package/dist/capabilities/kilo.json +597 -601
- 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 +18 -18
- package/dist/capabilities/korouter.json +35 -35
- package/dist/capabilities/kunavo.json +9 -9
- package/dist/capabilities/liquid.json +10 -10
- package/dist/capabilities/lithosai.json +2 -2
- package/dist/capabilities/llmgateway-providers.json +959 -890
- package/dist/capabilities/llmgateway.json +344 -343
- package/dist/capabilities/llmtr.json +24 -24
- package/dist/capabilities/lowrouter.json +60 -60
- package/dist/capabilities/lyceum.json +18 -10
- package/dist/capabilities/melious.json +14 -14
- package/dist/capabilities/merge-gateway.json +266 -265
- package/dist/capabilities/meta.json +11 -11
- package/dist/capabilities/minimax-cn-coding-plan.json +2 -2
- package/dist/capabilities/minimax-cn.json +5 -5
- package/dist/capabilities/minimax-coding-plan.json +2 -2
- package/dist/capabilities/minimax.json +5 -5
- package/dist/capabilities/mistral.json +22 -22
- package/dist/capabilities/mixlayer.json +5 -5
- package/dist/capabilities/modal.json +7 -7
- package/dist/capabilities/model-oracle-ai.json +27 -27
- package/dist/capabilities/modelis.json +20 -20
- package/dist/capabilities/modular.json +25 -3
- package/dist/capabilities/moneo.json +6 -6
- package/dist/capabilities/moonshotai-cn.json +5 -5
- package/dist/capabilities/moonshotai.json +5 -5
- package/dist/capabilities/morph.json +16 -16
- package/dist/capabilities/munito-eu.json +8 -8
- package/dist/capabilities/munito.json +8 -8
- package/dist/capabilities/nan.json +25 -25
- package/dist/capabilities/nano-gpt.json +577 -564
- package/dist/capabilities/nearai.json +87 -87
- package/dist/capabilities/nebius.json +32 -32
- package/dist/capabilities/neon.json +123 -123
- package/dist/capabilities/neuralwatt.json +37 -37
- package/dist/capabilities/nokeep.json +5 -5
- package/dist/capabilities/novita-ai.json +144 -144
- package/dist/capabilities/nvidia.json +40 -23
- package/dist/capabilities/oathbreaker.json +24 -1
- package/dist/capabilities/obscurify.json +22 -22
- package/dist/capabilities/oci.json +8 -8
- package/dist/capabilities/ofox.json +306 -306
- package/dist/capabilities/ollama-cloud.json +61 -61
- package/dist/capabilities/openai.json +53 -53
- package/dist/capabilities/opencode-go.json +88 -88
- package/dist/capabilities/openreason.json +5 -5
- package/dist/capabilities/openrouter.json +507 -497
- package/dist/capabilities/opper.json +26 -26
- package/dist/capabilities/orcarouter.json +203 -203
- package/dist/capabilities/outerlabs.json +27 -27
- package/dist/capabilities/ovhcloud.json +21 -21
- package/dist/capabilities/pareto.json +5 -5
- package/dist/capabilities/perplexity-agent.json +61 -61
- package/dist/capabilities/perplexity.json +2 -2
- package/dist/capabilities/phala.json +27 -27
- package/dist/capabilities/pioneer.json +28 -28
- package/dist/capabilities/poe.json +123 -123
- package/dist/capabilities/poolside.json +3 -3
- package/dist/capabilities/powerspring.json +12 -12
- package/dist/capabilities/primalabs.json +7 -7
- package/dist/capabilities/prime.json +117 -107
- package/dist/capabilities/privatemode-ai.json +12 -12
- package/dist/capabilities/proxystacks.json +3 -3
- package/dist/capabilities/qiniu-ai.json +15 -15
- package/dist/capabilities/refuseless.json +8 -8
- package/dist/capabilities/regolo-ai.json +8 -8
- package/dist/capabilities/requesty.json +384 -169
- package/dist/capabilities/ruapi.json +36 -20
- package/dist/capabilities/runcrate.json +7 -7
- package/dist/capabilities/runinfra.json +10 -10
- package/dist/capabilities/sakana.json +5 -5
- package/dist/capabilities/sambanova.json +6 -6
- package/dist/capabilities/sandbase.json +24 -24
- package/dist/capabilities/sarvam.json +11 -11
- package/dist/capabilities/scaleway.json +19 -19
- package/dist/capabilities/scnet-token-plan.json +11 -11
- package/dist/capabilities/scx-ai.json +31 -31
- package/dist/capabilities/sensenova.json +14 -14
- package/dist/capabilities/siliconflow-cn.json +41 -41
- package/dist/capabilities/siliconflow.json +53 -53
- package/dist/capabilities/snowflake-cortex.json +18 -18
- package/dist/capabilities/sokkan.json +4 -4
- package/dist/capabilities/sparrowcodes.json +18 -18
- package/dist/capabilities/standardcompute.json +84 -84
- package/dist/capabilities/steadyrouter.json +41 -41
- 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 +11 -11
- package/dist/capabilities/synthetic.json +14 -14
- package/dist/capabilities/synthorai.json +25 -25
- package/dist/capabilities/teamorouter.json +20 -20
- package/dist/capabilities/teapot-router.json +14 -14
- package/dist/capabilities/tencent-token-plan-intl.json +126 -0
- package/dist/capabilities/tencent-token-plan.json +36 -36
- package/dist/capabilities/tencent-tokenhub.json +54 -39
- package/dist/capabilities/tensorx.json +43 -43
- package/dist/capabilities/tenstorrent.json +6 -6
- package/dist/capabilities/the-grid-ai.json +28 -28
- package/dist/capabilities/thinkingmachines.json +73 -73
- package/dist/capabilities/tinfoil.json +10 -10
- package/dist/capabilities/toapis.json +3 -3
- package/dist/capabilities/togetherai.json +48 -48
- package/dist/capabilities/tokengo.json +17 -17
- package/dist/capabilities/tokenify.json +10 -10
- package/dist/capabilities/tokenwatt.json +10 -2
- package/dist/capabilities/trustedrouter.json +7 -7
- package/dist/capabilities/trustedtokens.json +13 -13
- package/dist/capabilities/umans-ai-coding-plan.json +14 -14
- package/dist/capabilities/umans-ai.json +12 -12
- package/dist/capabilities/uncensuredai.json +2 -2
- package/dist/capabilities/unrestricted.json +8 -8
- package/dist/capabilities/uplinkswitch.json +20 -20
- package/dist/capabilities/upstage.json +6 -6
- package/dist/capabilities/vancine.json +21 -21
- package/dist/capabilities/vercel.json +508 -505
- package/dist/capabilities/vivgrid.json +84 -75
- package/dist/capabilities/volcengine-coding-plan.json +28 -28
- package/dist/capabilities/volcengine.json +29 -28
- package/dist/capabilities/vultr.json +28 -28
- package/dist/capabilities/wafer.ai.json +17 -17
- package/dist/capabilities/wally.json +12 -12
- package/dist/capabilities/wandb.json +16 -16
- package/dist/capabilities/watt.json +21 -21
- package/dist/capabilities/xai.json +7 -7
- package/dist/capabilities/xiaomi-token-plan-ams.json +2 -2
- package/dist/capabilities/xiaomi-token-plan-cn.json +2 -2
- package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -2
- package/dist/capabilities/xiaomi.json +2 -2
- package/dist/capabilities/xpersona.json +13 -13
- package/dist/capabilities/xxapi.json +26 -26
- package/dist/capabilities/zai-coding-plan.json +20 -20
- package/dist/capabilities/zai.json +34 -34
- package/dist/capabilities/zenifra.json +31 -31
- package/dist/capabilities/zenmux.json +178 -178
- package/dist/capabilities/zerogpu.json +12 -12
- package/dist/capabilities/zhipuai-coding-plan.json +8 -8
- package/dist/capabilities/zhipuai.json +30 -30
- package/dist/capabilities/zro.json +3 -3
- package/dist/channels/agent-channels.d.ts +22 -0
- package/dist/channels/index.cjs +2 -2
- package/dist/channels/index.js +2 -2
- package/dist/channels/output-processor.d.ts +12 -0
- package/dist/channels/state-adapter.d.ts +3 -1
- package/dist/channels/stream-helpers.d.ts +17 -0
- package/dist/{channels-Cl-pRrWB.cjs → channels-BVnDIsZS.cjs} +1 -1
- package/dist/{channels-DegTNzaq.js → channels-CndspFXP.js} +1 -1
- package/dist/coding-agent/index.cjs +2 -2
- package/dist/coding-agent/index.js +2 -2
- package/dist/{constants-B9ZDvXZ4.cjs → constants-Bou0hEgY.cjs} +4 -0
- package/dist/{constants-BmdTvEYN.js → constants-CFWgIaqA.js} +4 -0
- package/dist/datasets/experiment/scorer.d.ts +16 -5
- package/dist/datasets/index.cjs +2 -2
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +2 -1
- package/dist/docs/assets/SOURCE_MAP.json +1070 -1055
- package/dist/docs/references/docs-agents-code-mode.md +36 -0
- package/dist/docs/references/docs-agents-networks.md +1 -1
- package/dist/docs/references/docs-agents-tools.md +6 -0
- package/dist/docs/references/docs-auth-simple-auth.md +8 -8
- package/dist/docs/references/docs-browser.md +3 -1
- package/dist/docs/references/docs-evals-custom-scorers.md +1 -1
- package/dist/docs/references/docs-harness-background-tasks.md +38 -0
- package/dist/docs/references/docs-knowledge-agents-and-tools.md +2 -0
- package/dist/docs/references/docs-mastra-platform-observability-overview.md +3 -189
- package/dist/docs/references/docs-memory-message-history.md +25 -0
- package/dist/docs/references/docs-sandbox-lsp.md +5 -6
- package/dist/docs/references/docs-sandbox-overview.md +20 -0
- package/dist/docs/references/docs-sandbox-skills.md +2 -0
- package/dist/docs/references/docs-signals-sending-signals.md +1 -1
- package/dist/docs/references/integrations.md +1 -0
- package/dist/docs/references/reference-agent-controller-session.md +1 -1
- package/dist/docs/references/reference-agents-generate.md +1 -1
- package/dist/docs/references/reference-agents-network.md +1 -1
- package/dist/docs/references/reference-configuration.md +8 -8
- package/dist/docs/references/reference-core-getWorkspaceById.md +37 -0
- package/dist/docs/references/reference-evals-create-scorer.md +5 -5
- package/dist/docs/references/reference-evals-run-evals.md +1 -1
- package/dist/docs/references/reference-knowledge-knowledge-tools.md +3 -3
- package/dist/docs/references/reference-manual-install.md +1 -1
- package/dist/docs/references/reference-memory-observational-memory.md +8 -0
- package/dist/docs/references/reference-observability-tracing-interfaces.md +10 -6
- package/dist/docs/references/reference-processors-processor-interface.md +3 -2
- package/dist/docs/references/reference-processors-system-prompt-scrubber.md +1 -1
- package/dist/docs/references/reference-processors-tool-search-processor.md +3 -3
- package/dist/docs/references/reference-pubsub-base.md +5 -3
- package/dist/docs/references/reference-pubsub-caching-pubsub.md +3 -1
- package/dist/docs/references/reference-storage-overview.md +1 -1
- package/dist/docs/references/reference-storage-retention.md +20 -20
- package/dist/docs/references/reference-tools-create-code-mode.md +22 -0
- package/dist/docs/references/reference-tools-vector-query-tool.md +8 -0
- package/dist/docs/references/reference-voice-overview.md +11 -26
- package/dist/docs/references/reference-voice-speech-to-speech.md +1 -1
- package/dist/docs/references/reference-voice-voice.listen.md +1 -0
- package/dist/docs/references/reference-voice-voice.speak.md +1 -3
- package/dist/docs/references/reference-workspace-factory-sandbox.md +6 -6
- package/dist/docs/references/reference-workspace-sandbox.md +14 -0
- package/dist/docs/references/reference.md +1 -0
- 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/index.cjs +1 -1
- package/dist/events/index.js +1 -1
- 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/agent-scopes.d.ts +17 -0
- package/dist/knowledge/declarations.d.ts +2 -0
- package/dist/knowledge/held-scopes-state-processor.d.ts +50 -0
- package/dist/knowledge/importers/host.d.ts +7 -1
- package/dist/knowledge/importers/runner.d.ts +12 -0
- package/dist/knowledge/importers/types.d.ts +4 -0
- package/dist/knowledge/index.cjs +209 -38
- package/dist/knowledge/index.d.ts +12 -2
- package/dist/knowledge/index.js +208 -39
- package/dist/knowledge/page-tools.d.ts +23 -0
- package/dist/knowledge/pinned-state-processor.d.ts +2 -2
- package/dist/knowledge/run.d.ts +5 -0
- package/dist/knowledge/scope-runtime.d.ts +6 -0
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/base.types.d.ts +3 -1
- package/dist/llm/model/mastra-gateway-provider-tools.d.ts +9 -6
- package/dist/llm/model/model.d.ts +1 -1
- package/dist/llm/model/model.loop.d.ts +1 -1
- package/dist/llm/model/model.loop.types.d.ts +3 -1
- package/dist/llm/model/provider-options.d.ts +4 -3
- package/dist/llm/model/provider-types.generated.d.ts +7657 -7592
- package/dist/{llm-BKxlS9Kk.cjs → llm-B1semiTO.cjs} +38 -78
- package/dist/{llm-CMkzIFAk.js → llm-CytL7cpw.js} +38 -78
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/{manager-CasaT35Q.cjs → manager-BwyfS4ha.cjs} +106 -35
- package/dist/{manager-C-eQXmRq.js → manager-DnTzA9GL.js} +106 -35
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-5EEmN3Ok.js → mastra-DTkZPpch.js} +17 -17
- package/dist/{mastra-C7Tj4U8c.cjs → mastra-Dj35Lj_J.cjs} +17 -17
- package/dist/memory/index.cjs +3 -3
- package/dist/memory/index.js +3 -3
- package/dist/{message-list-wI71UGxk.js → message-list-BGm1DCiG.js} +230 -129
- package/dist/{message-list-DfN9mWeN.cjs → message-list-vR3uLAHL.cjs} +230 -129
- package/dist/{model-DCLUL-8a.js → model-DyQ07rPH.js} +4 -3
- package/dist/{model-9HA-W0tg.cjs → model-eDfetuno.cjs} +4 -3
- package/dist/{netlify-Cq3H-A9I.cjs → netlify-BC4v7Ufv.cjs} +41364 -30461
- package/dist/{netlify-DaWURNSU.js → netlify-BUvdxfHe.js} +41361 -30464
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/observability/types/tracing.d.ts +1 -1
- 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/tool-search.d.ts +2 -2
- package/dist/processors/runner.d.ts +12 -0
- package/dist/{provider-registry-a649fS5r.cjs → provider-registry-Bn01gq9y.cjs} +21872 -21660
- package/dist/{provider-registry-DWixjFX7.js → provider-registry-CP_5SNiw.js} +21873 -21661
- package/dist/provider-registry.json +22748 -22596
- package/dist/{registry-generator-BYJC7p8M.js → registry-generator-CDPyxbzt.js} +1 -1
- package/dist/{registry-generator-BuKC7UKd.cjs → registry-generator-CNFKGRFQ.cjs} +1 -1
- package/dist/{rehydrate-DPhmASM6.js → rehydrate-CnGNY2zq.js} +2 -2
- package/dist/{rehydrate-DR2_WAz2.cjs → rehydrate-DExpzlNS.cjs} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/{run-registry-D3X7XvUL.js → run-registry-BL_kKvFE.js} +724 -125
- package/dist/{run-registry-oUNF6szW.cjs → run-registry-CibQoN6K.cjs} +766 -125
- package/dist/storage/constants.cjs +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/knowledge/base.d.ts +16 -1
- package/dist/storage/domains/knowledge/importers-inmemory.d.ts +1 -0
- package/dist/storage/domains/knowledge/importers.d.ts +8 -0
- package/dist/storage/domains/knowledge/inmemory.d.ts +1 -0
- package/dist/storage/domains/knowledge/pages-inmemory.d.ts +5 -1
- package/dist/storage/index.cjs +3 -3
- package/dist/storage/index.js +3 -3
- package/dist/storage/types.d.ts +8 -0
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/{stream-DoZ6F41o.js → stream-1DGoEkG2.js} +37 -14
- package/dist/{stream-DQC1vpvl.cjs → stream-D_7tMaJe.cjs} +37 -14
- package/dist/test-utils/llm-mock.cjs +1 -1
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/{to-prompt-B9eZo2U5.cjs → to-prompt-CG-LyaBY.cjs} +9 -0
- package/dist/{to-prompt-BsDtVXrf.js → to-prompt-CMlVGYxC.js} +9 -0
- package/dist/tool-loop-agent/index.cjs +1 -1
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/{tool-loop-agent-C9YkvDRd.js → tool-loop-agent-BXya_RYj.js} +4 -4
- package/dist/{tool-loop-agent-Cy4NDOMS.cjs → tool-loop-agent-CLB1r3X3.cjs} +4 -4
- package/dist/tools/code-mode/index.d.ts +2 -0
- package/dist/tools/code-mode/log-collector.d.ts +49 -0
- package/dist/tools/code-mode/types.d.ts +71 -0
- package/dist/tools/index.cjs +3 -1
- package/dist/tools/index.js +2 -2
- package/dist/{tools-CGF5Ik6j.cjs → tools-BEYxowf0.cjs} +429 -61
- package/dist/{tools-CDfyMpzN.js → tools-tPy2FwMI.js} +418 -62
- package/dist/{utils-Bs2IYyOb.cjs → utils-B-KOMA_Q.cjs} +7 -6
- package/dist/{utils-9JyiKu5r.js → utils-C55ZdVaj.js} +7 -6
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-8j0phWFV.js → validate-BDfYr72F.js} +1 -1
- package/dist/{validate-BE3mVxVy.cjs → validate-CmZhnsmX.cjs} +1 -1
- package/dist/vector/index.cjs +2 -2
- package/dist/vector/index.js +2 -2
- package/dist/worker/index.cjs +1 -1
- package/dist/worker/index.js +1 -1
- package/dist/worker/workers/orchestration-worker.d.ts +1 -0
- package/dist/{worker-BfWFqSH2.js → worker-BG1rw_dg.js} +5 -5
- package/dist/{worker-BiK1kfMa.cjs → worker-BoybIUTI.cjs} +10 -4
- package/dist/{worker-DIRdEwih.js → worker-CuK2RaC0.js} +2 -2
- package/dist/{worker-DwdgU6E9.cjs → worker-D2B-x7Le.cjs} +2 -2
- package/dist/{workflow-ni-keg2i.js → workflow-Bt09PcH1.js} +3 -3
- package/dist/{workflow-CxQMcTbT.cjs → workflow-CTKqeRXU.cjs} +3 -3
- package/dist/workflows/builder/index.cjs +1 -1
- package/dist/workflows/builder/index.js +1 -1
- package/dist/workflows/evented/index.cjs +1 -1
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +4 -4
- package/dist/workflows/index.js +4 -4
- package/dist/workflows/step.d.ts +2 -0
- package/dist/workflows/workflow.d.ts +2 -0
- package/dist/workspace/index.cjs +3 -1
- package/dist/workspace/index.d.ts +1 -1
- package/dist/workspace/index.js +2 -2
- package/dist/workspace/lsp/manager.d.ts +19 -4
- package/dist/workspace/sandbox/mastra-sandbox.d.ts +17 -0
- package/dist/workspace/sandbox/teardown-context.d.ts +74 -0
- package/dist/workspace/tools/index.d.ts +1 -0
- package/dist/workspace/tools/media.d.ts +20 -1
- package/dist/workspace/tools/recreate-sandbox.d.ts +24 -0
- package/dist/{workspace-X2RHJZU9.cjs → workspace-C8Zo5_qK.cjs} +387 -109
- package/dist/{workspace-DY2Nxiyi.js → workspace-DOAil8mG.js} +376 -110
- package/package.json +8 -8
- package/src/llm/model/provider-types.generated.d.ts +7657 -7592
|
@@ -143,12 +143,12 @@ const agentScorer = createScorer({
|
|
|
143
143
|
})
|
|
144
144
|
.preprocess(({ run }) => {
|
|
145
145
|
// run.input is automatically typed as ScorerRunInputForAgent
|
|
146
|
-
const userMessage = run.
|
|
146
|
+
const userMessage = run.input.inputMessages[0]?.content.content
|
|
147
147
|
return { userMessage }
|
|
148
148
|
})
|
|
149
149
|
.generateScore(({ run, results }) => {
|
|
150
150
|
// run.output is automatically typed as ScorerRunOutputForAgent
|
|
151
|
-
const response = run.output[0]?.content
|
|
151
|
+
const response = run.output[0]?.content.content ?? ''
|
|
152
152
|
return response.length > 10 ? 1.0 : 0.5
|
|
153
153
|
})
|
|
154
154
|
```
|
|
@@ -191,11 +191,11 @@ const agentTraceScorer = createScorer({
|
|
|
191
191
|
type: 'agent',
|
|
192
192
|
}).generateScore(({ run }) => {
|
|
193
193
|
// Trace data is automatically transformed to agent format
|
|
194
|
-
const userMessages = run.
|
|
195
|
-
const agentResponse = run.output[0]?.content
|
|
194
|
+
const userMessages = run.input.inputMessages
|
|
195
|
+
const agentResponse = run.output[0]?.content.content ?? ''
|
|
196
196
|
|
|
197
197
|
// Score based on response length
|
|
198
|
-
return agentResponse
|
|
198
|
+
return agentResponse.length > 50 ? 0 : 1
|
|
199
199
|
})
|
|
200
200
|
|
|
201
201
|
// Register with Mastra for trace scoring
|
|
@@ -298,7 +298,7 @@ const workflowResult = await runEvals({
|
|
|
298
298
|
},
|
|
299
299
|
},
|
|
300
300
|
onItemComplete: ({ item, targetResult, scorerResults }) => {
|
|
301
|
-
console.log(`Workflow completed for: ${item.
|
|
301
|
+
console.log(`Workflow completed for: ${item.input.query}`)
|
|
302
302
|
if (scorerResults.workflow) {
|
|
303
303
|
console.log('Workflow scores:', scorerResults.workflow)
|
|
304
304
|
}
|
|
@@ -83,7 +83,7 @@ These searches also return `more`:
|
|
|
83
83
|
|
|
84
84
|
## `knowledge_list`
|
|
85
85
|
|
|
86
|
-
Lists the page tree under a starting point, so an agent can see how a scope or section is organized before it searches or reads. Without `from`, it lists
|
|
86
|
+
Lists the page tree under a starting point, so an agent can see how a scope or section is organized before it searches or reads. Without `from`, it lists every scope the run holds. Each entry has its `role` when there is one, and `can` says what the run may do there: `write`, `read` or `none`. Scopes with no page the run can read yet are listed too, with `empty: true`. A held scope the run can't read shows only its address, not its stored name or description.
|
|
87
87
|
|
|
88
88
|
**from** (`string`): Where to start: a page reference.
|
|
89
89
|
|
|
@@ -95,13 +95,13 @@ Lists the page tree under a starting point, so an agent can see how a scope or s
|
|
|
95
95
|
|
|
96
96
|
**cursor** (`string`): The previous result's nextCursor, or the cursor more gives. Pass the same from. A cursor keeps the depth and limit of the result it came from.
|
|
97
97
|
|
|
98
|
-
Returns `{ from?, entries, nextCursor?, more? }`. `from` is `{ ref, name }`. Each entry is `{ ref, name, depth, children, scope? }`, plus `description` when `descriptions` is `true`: `depth` is 1 for the starting point's children, `children` counts the readable child pages (and child scopes, for a scope), and `scope` is `true` for a scope.
|
|
98
|
+
Returns `{ from?, entries, nextCursor?, more? }`. `from` is `{ ref, name }`. Each entry is `{ ref, name, depth, children, scope? }`, plus `description` when `descriptions` is `true`: `depth` is 1 for the starting point's children, `children` counts the readable child pages (and child scopes, for a scope), and `scope` is `true` for a scope. Held-scope entries also include `role?`, `can?` (`write`, `read` or `none`) and `empty?`. An `empty: true` entry has no page the run can read yet, and its `name` is the scope address.
|
|
99
99
|
|
|
100
100
|
A result stops at `limit` entries or at the read cap (about 1,000 tokens of entries by default), whichever comes first, and always holds at least one entry. When it stops early, `more` says how many entries were left out and gives the cursor that continues where it stopped.
|
|
101
101
|
|
|
102
102
|
## `knowledge_read`
|
|
103
103
|
|
|
104
|
-
Reads a page: its body, notes, child pages, and the notes on other pages that mention it. A scope address reads that scope's page, which lists its pages and child scopes. Without `page`, it
|
|
104
|
+
Reads a page: its body, notes, child pages, and the notes on other pages that mention it. A scope address reads that scope's page, which lists its pages and child scopes. Without `page`, it returns `{ scopes }`: every scope the run holds, including scopes before any pages exist. Each scope is `{ address, name, description?, role?, can, empty? }`. `role` is there when the run has one. `can` says what the run may do there: `write`, `read` or `none`. A scope with no page the run can read yet has `empty: true`, and its `name` is the scope address. A held scope the run can't read shows only its address, not its stored name or description.
|
|
105
105
|
|
|
106
106
|
**page** (`string`): A page reference.
|
|
107
107
|
|
|
@@ -135,7 +135,7 @@ If you prefer not to use the `mastra` CLI, you can set up your project yourself
|
|
|
135
135
|
mkdir -p src/mastra/tools && touch src/mastra/tools/weather-tool.ts
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
Use `import { createTool } from "@mastra/core/tools"`.
|
|
138
|
+
Use `import { createTool } from "@mastra/core/tools"`. Define tools via createTool() with id, description, inputSchema (zod), execute
|
|
139
139
|
|
|
140
140
|
Add the following code:
|
|
141
141
|
|
|
@@ -978,6 +978,14 @@ The standalone `ObservationalMemory` class accepts all the same options as the `
|
|
|
978
978
|
|
|
979
979
|
**obscureThreadIds** (`boolean`): When enabled, thread IDs are hashed before being included in observation context. This prevents the LLM from recognizing patterns in thread identifiers. Automatically enabled when using resource scope through the Memory class. (Default: `false`)
|
|
980
980
|
|
|
981
|
+
## Hosted observational memory
|
|
982
|
+
|
|
983
|
+
A memory implementation that runs Observational Memory itself, instead of through the `observational-memory` processor (for example a hosted backend), can extend `MastraMemory` and override these methods. Memory routes then report its settings and records. The base class returns `undefined` from each method, which means the memory doesn't provide them.
|
|
984
|
+
|
|
985
|
+
**getObservationalMemoryConfig** (`(args: { requestContext?: RequestContext }) => Promise<ObservationalMemorySettings | undefined>`): Returns the Observational Memory settings: enabled, scope (thread or resource), and optionally messageTokens and observationTokens thresholds.
|
|
986
|
+
|
|
987
|
+
**getObservationalMemoryRecords** (`(args: GetObservationalMemoryRecordsInput) => Promise<ObservationalMemoryRecords | undefined>`): Returns the current record (null before the first observation) and past generations in history, newest first. Input accepts threadId, resourceId, historyLimit, from, to, offset and requestContext. Callers check thread access before calling it.
|
|
988
|
+
|
|
981
989
|
## Recall tool
|
|
982
990
|
|
|
983
991
|
When `retrieval` is truthy, Mastra registers a `recall` tool that pages through raw messages behind observation group ranges. With the default resource scope, the tool can list threads (`mode: "threads"`) and browse another thread through `threadId`. It also supports cross-thread search. Set `retrieval: { vector: true }` for semantic search (`mode: "search"`), or use `scope: 'thread'` to restrict the tool to the current thread. The tool is automatically added to the agent.
|
|
@@ -193,10 +193,10 @@ Span interface, used internally for tracing.
|
|
|
193
193
|
|
|
194
194
|
```typescript
|
|
195
195
|
interface Span<TType extends SpanType> {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
id: string
|
|
197
|
+
traceId: string
|
|
198
|
+
type: TType
|
|
199
|
+
name: string
|
|
200
200
|
|
|
201
201
|
/** Entity that created the span */
|
|
202
202
|
entityType?: EntityType
|
|
@@ -587,7 +587,12 @@ interface ModelGenerationAttributes {
|
|
|
587
587
|
tools?: ModelToolDefinition[]
|
|
588
588
|
|
|
589
589
|
/** Type of result/output this model call produced */
|
|
590
|
-
resultType?:
|
|
590
|
+
resultType?:
|
|
591
|
+
| 'tool_selection'
|
|
592
|
+
| 'response_generation'
|
|
593
|
+
| 'reasoning'
|
|
594
|
+
| 'planning'
|
|
595
|
+
| 'title_generation'
|
|
591
596
|
|
|
592
597
|
/** Token usage statistics */
|
|
593
598
|
usage?: UsageStats
|
|
@@ -762,7 +767,6 @@ Tool Call attributes.
|
|
|
762
767
|
|
|
763
768
|
```typescript
|
|
764
769
|
interface ToolCallAttributes {
|
|
765
|
-
toolId?: string
|
|
766
770
|
toolType?: string
|
|
767
771
|
toolDescription?: string
|
|
768
772
|
toolCallId?: string
|
|
@@ -330,7 +330,7 @@ processInputStep?<TTripwireMetadata = unknown>(
|
|
|
330
330
|
|
|
331
331
|
The object form can return any combination of these properties:
|
|
332
332
|
|
|
333
|
-
**model** (`LanguageModelV2 |
|
|
333
|
+
**model** (`LanguageModelV2 | ModelRouterModelId | OpenAICompatibleConfig | MastraLanguageModel`): Change the model for this step. Can be a model instance, a router ID like 'openai/gpt-5.5', or an OpenAI-compatible config.
|
|
334
334
|
|
|
335
335
|
**toolChoice** (`ToolChoice`): Change tool selection behavior for this step.
|
|
336
336
|
|
|
@@ -467,9 +467,10 @@ processLLMRequest?(
|
|
|
467
467
|
|
|
468
468
|
#### Return value
|
|
469
469
|
|
|
470
|
-
`processLLMRequest` returns `ProcessLLMRequestResult`, which is `{ prompt?: LanguageModelV2Prompt } | undefined | void`.
|
|
470
|
+
`processLLMRequest` returns `ProcessLLMRequestResult`, which is `{ prompt?: LanguageModelV2Prompt; response?: CachedLLMStepResponse } | undefined | void`.
|
|
471
471
|
|
|
472
472
|
- Return `{ prompt }` to replace the outbound prompt for the current provider call.
|
|
473
|
+
- Return `{ response }` with cached chunks to skip the model call and emit those chunks instead.
|
|
473
474
|
- Return `undefined` or `void` to forward the original prompt unchanged.
|
|
474
475
|
|
|
475
476
|
#### Use cases
|
|
@@ -56,7 +56,7 @@ const processor = new SystemPromptScrubber({
|
|
|
56
56
|
|
|
57
57
|
## Extended usage example
|
|
58
58
|
|
|
59
|
-
For production streaming, set `bufferSize` (for example `bufferSize: 200`) so `SystemPromptScrubber` makes one detection call per sentence instead of one per chunk. Buffering also catches content that's split across chunks. Text then reaches the client in sentence-sized pieces.
|
|
59
|
+
For production streaming, set `bufferSize` (for example `bufferSize: 200`) so `SystemPromptScrubber` makes one detection call per sentence instead of one per chunk. Buffering also catches content that's split across chunks. Text then reaches the client in sentence-sized pieces. The buffer is also checked when it reaches `bufferSize` characters, so a longer sentence can be checked and delivered in several pieces.
|
|
60
60
|
|
|
61
61
|
When using `SystemPromptScrubber` as an output processor, it's recommended to combine it with `BatchPartsProcessor` to optimize performance. The `BatchPartsProcessor` batches stream chunks together before passing them to the scrubber, reducing the number of LLM calls required for detection.
|
|
62
62
|
|
|
@@ -31,7 +31,7 @@ const toolSearch = new ToolSearchProcessor({
|
|
|
31
31
|
|
|
32
32
|
**options.tools** (`Record<string, Tool>`): All tools that can be searched and loaded dynamically. These tools are not immediately available to the agent — they must be discovered via search and loaded on demand.
|
|
33
33
|
|
|
34
|
-
**options.includeResolvedTools** (`boolean`): Also make the tools the agent resolved for this request (MCP tools requiring the caller's credentials, or anything returned by a dynamic tools function) searchable, and withhold them from the prompt until the agent loads them.
|
|
34
|
+
**options.includeResolvedTools** (`boolean`): Also make the tools the agent resolved for this request (MCP tools requiring the caller's credentials, or anything returned by a dynamic tools function) searchable, and withhold them from the prompt until the agent loads them. This option never withholds the meta-tools — which meta-tools appear is controlled by search.autoLoad and the activeTools allowlist. Request-resolved tools are indexed per request, so each request searches and loads its own tool instances.
|
|
35
35
|
|
|
36
36
|
**options.search** (`{ topK?: number; minScore?: number; autoLoad?: boolean }`): Configuration for the search behavior.
|
|
37
37
|
|
|
@@ -124,7 +124,7 @@ The `phase` value describes where the filter is being applied:
|
|
|
124
124
|
- `load`: Blocks `load_tool` from loading disallowed tools.
|
|
125
125
|
- `active`: Hides already-loaded tools from the current request if they're no longer allowed.
|
|
126
126
|
|
|
127
|
-
If the hook throws or rejects, `ToolSearchProcessor` treats the tool as disallowed for that request. The hook may run for every matching search candidate, so keep async policy checks cheap or cached. The `search_tools` meta-tool is
|
|
127
|
+
If the hook throws or rejects, `ToolSearchProcessor` treats the tool as disallowed for that request. The hook may run for every matching search candidate, so keep async policy checks cheap or cached. The `search_tools` meta-tool is available unless you exclude it through `activeTools`. `load_tool` is available unless `search.autoLoad` is enabled or you exclude it through `activeTools`. When the processor runs with a meta-tool excluded from `activeTools`, it withholds that meta-tool and omits it from the system instructions, tool descriptions, search results, and not-found messages. This reflects the `activeTools` the processor sees when it runs. A `prepareStep` that narrows `activeTools` later in the step can't retract instructions or descriptions the processor already added. Tools passed directly through the agent or `processInputStep` remain available unless you filter them outside `ToolSearchProcessor`, or enable `includeResolvedTools`.
|
|
128
128
|
|
|
129
129
|
## Searching request-resolved tools
|
|
130
130
|
|
|
@@ -154,7 +154,7 @@ const agent = new Agent({
|
|
|
154
154
|
|
|
155
155
|
Each request is indexed on its own, so a tool loaded by one caller never resolves to another caller's instance of the same tool name.
|
|
156
156
|
|
|
157
|
-
This option applies to every tool resolved for the request, including memory, workspace, skill, and browser tools.
|
|
157
|
+
This option applies to every tool resolved for the request, including memory, workspace, skill, and browser tools. It withholds the resolved tools from the prompt, but it never withholds the meta-tools. `search.autoLoad` and `activeTools` still control which meta-tools appear. Only the resolved tools the agent hasn't loaded are withheld, so a tool loaded earlier remains eligible for the returned tool map alongside the meta-tools. That eligibility is still subject to the filter's `active` phase, which hides an already-loaded tool whose policy no longer allows it, and to the step's final `activeTools` allowlist. Any tool the agent relies on implicitly must be found through search before it can be called, unless it knows the tool name and `load_tool` is available. `load_tool` looks up a supplied name without consulting `injectCatalog`, so `injectCatalog` is required only for catalog-based direct loading: it puts the catalog in the system prompt so the agent can pick a name it hasn't seen. Catalog-based direct loading requires `injectCatalog` enabled, `search.autoLoad: false`, and a `load_tool` that `activeTools` doesn't exclude. With `search.autoLoad: true`, `load_tool` isn't exposed and `search_tools` activates matching tools.
|
|
158
158
|
|
|
159
159
|
## Extended usage example
|
|
160
160
|
|
|
@@ -172,7 +172,7 @@ await pubsub.subscribeFromOffset('my-topic', 42, event => {
|
|
|
172
172
|
|
|
173
173
|
**supportsNativeBatching** (`boolean`): Whether the implementation honors options.batch on subscribe(). Defaults to false. Backends that integrate batching internally override this and return true.
|
|
174
174
|
|
|
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
|
|
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 logs a warning with console.warn. Implementations can override onUnsupportedOffset() to use their own logger.
|
|
176
176
|
|
|
177
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
178
|
|
|
@@ -224,10 +224,12 @@ Per-subscription batching policy. The callback signature doesn't change. A batch
|
|
|
224
224
|
|
|
225
225
|
### `EventCallback`
|
|
226
226
|
|
|
227
|
-
The callback signature for subscribers: `(event: Event, ack?: () => Promise<void>, nack?: () => Promise<void>) => void
|
|
227
|
+
The callback signature for subscribers: `(event: Event, ack?: () => Promise<void>, nack?: () => Promise<void>, extend?: () => Promise<void>) => void | Promise<void>`.
|
|
228
228
|
|
|
229
229
|
**event** (`Event`): The delivered event.
|
|
230
230
|
|
|
231
231
|
**ack** (`() => Promise<void>`): Acknowledge successful processing. The event is removed from the queue.
|
|
232
232
|
|
|
233
|
-
**nack** (`() => Promise<void>`): Negative acknowledge. The event is requeued for redelivery after a delay.
|
|
233
|
+
**nack** (`() => Promise<void>`): Negative acknowledge. The event is requeued for redelivery after a delay.
|
|
234
|
+
|
|
235
|
+
**extend** (`() => Promise<void>`): Renew the delivery's lease so the broker doesn't redeliver the event while the handler is still running. Omitted by backends that can't extend a delivery.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# CachingPubSub
|
|
6
6
|
|
|
7
|
-
`CachingPubSub` wraps any [`PubSub`](https://mastra.ai/reference/pubsub/base) implementation and adds event caching and replay. It records
|
|
7
|
+
`CachingPubSub` wraps any [`PubSub`](https://mastra.ai/reference/pubsub/base) implementation and adds event caching and replay. It records published events per topic in a cache, so a subscriber that connects late or reconnects after a disconnect can replay the events it missed before continuing with live events.
|
|
8
8
|
|
|
9
9
|
Use it to build resumable streams on top of a transport that doesn't keep history, such as [`EventEmitterPubSub`](https://mastra.ai/reference/pubsub/event-emitter). Transports that already persist events, such as [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams), don't need this wrapper.
|
|
10
10
|
|
|
@@ -58,6 +58,8 @@ const pubsub = withCaching(new EventEmitterPubSub(), new InMemoryServerCache())
|
|
|
58
58
|
|
|
59
59
|
Caches the event with the topic's next index, then publishes it to the inner pub/sub. Consecutive publishes get consecutive indexes. A topic whose log expired or was cleared normally restarts above every index it issued before, so a reconnecting subscriber doesn't mistake new events for already-seen ones. That depends on the cache: `ConvexServerCache` numbers densely instead, and a clock-seeded cache can repeat an index when a log is recreated within the clock's resolution or after the clock moves backwards.
|
|
60
60
|
|
|
61
|
+
A publish with `{ localOnly: true }` skips the cache and goes straight to the inner pub/sub, so live subscribers receive it but it can't be replayed.
|
|
62
|
+
|
|
61
63
|
```typescript
|
|
62
64
|
await pubsub.publish('my-topic', {
|
|
63
65
|
type: 'example',
|
|
@@ -132,7 +132,7 @@ inputtextNOT NULLInput provided to the agentoutputtextNOT NULLOutput generated b
|
|
|
132
132
|
}
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
agent_nametextNOT NULLmetric_nametextNOT NULLe.g Faithfulness, Hallucination, etc.instructionstextNOT NULLSystem prompt or instructions for the agenttest_infojsonbNOT NULLAdditional test metadata and
|
|
135
|
+
agent_nametextNOT NULLmetric_nametextNOT NULLe.g Faithfulness, Hallucination, etc.instructionstextNOT NULLSystem prompt or instructions for the agenttest_infojsonbNOT NULLAdditional test metadata and configurationglobal_run_idtextNOT NULLGroups related evaluation runs (e.g. all unit tests in a CI run)run_idtextNOT NULLUnique identifier for the run being evaluatedcreated_attimestampNOT NULL
|
|
136
136
|
|
|
137
137
|
**Traces**:
|
|
138
138
|
|
|
@@ -98,26 +98,26 @@ Set the `retention` field on the store config.
|
|
|
98
98
|
|
|
99
99
|
Each domain specifies its age-prunable tables and the timestamp column that anchors comparison, chosen so `maxAge` matches the meaning of the data. Append-only logs use creation time, live state uses last activity, and jobs or runs use completion time so in-flight work isn't pruned.
|
|
100
100
|
|
|
101
|
-
| Domain | Table key | Anchor column | `maxAge` measures
|
|
102
|
-
| ----------------- | ------------------ | ---------------- |
|
|
103
|
-
| `memory` | `threads` | `createdAt` | Thread age
|
|
104
|
-
| `memory` | `messages` | `createdAt` | Message age
|
|
105
|
-
| `memory` | `resources` | `createdAt` | Resource age
|
|
106
|
-
| `memory` | `runFences` | `retiredAt` | Time since the durable agent execution holding the fence settled. Fences of running executions (`NULL`) are never pruned
|
|
107
|
-
| `threadState` | `threadState` | `updatedAt` | Inactivity: state for still-active threads survives
|
|
108
|
-
| `observability` | `spans` | `startedAt` | Span age
|
|
109
|
-
| `observability` | `metrics` | `timestamp` | Metric event age (vNext only)
|
|
110
|
-
| `observability` | `logs` | `timestamp` | Log event age (vNext only)
|
|
111
|
-
| `observability` | `scores` | `timestamp` | Score event age (vNext only)
|
|
112
|
-
| `observability` | `feedback` | `timestamp` | Feedback event age (vNext only)
|
|
113
|
-
| `scores` | `scorers` | `createdAt` | Score record age
|
|
114
|
-
| `workflows` | `workflowSnapshot` | `updatedAt` | Inactivity, suspended or long-running workflows survive
|
|
115
|
-
| `workflows` | `runOwnership` | `updatedAt` | Inactivity. A running durable agent execution renews its claim every
|
|
116
|
-
| `backgroundTasks` | `backgroundTasks` | `completedAt` | Time since completion, in-flight tasks (`NULL`) are never pruned
|
|
117
|
-
| `experiments` | `experiments` | `completedAt` | Time since completion, running experiments are never pruned
|
|
118
|
-
| `notifications` | `notifications` | `createdAt` | Notification age
|
|
119
|
-
| `harness` | `sessions` | `createdAt` | Session record age
|
|
120
|
-
| `schedules` | `triggers` | `actual_fire_at` | Fire-history age (epoch-ms column)
|
|
101
|
+
| Domain | Table key | Anchor column | `maxAge` measures |
|
|
102
|
+
| ----------------- | ------------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
103
|
+
| `memory` | `threads` | `createdAt` | Thread age |
|
|
104
|
+
| `memory` | `messages` | `createdAt` | Message age |
|
|
105
|
+
| `memory` | `resources` | `createdAt` | Resource age |
|
|
106
|
+
| `memory` | `runFences` | `retiredAt` | Time since the durable agent execution holding the fence settled. Fences of running executions (`NULL`) are never pruned |
|
|
107
|
+
| `threadState` | `threadState` | `updatedAt` | Inactivity: state for still-active threads survives |
|
|
108
|
+
| `observability` | `spans` | `startedAt` | Span age |
|
|
109
|
+
| `observability` | `metrics` | `timestamp` | Metric event age (vNext only) |
|
|
110
|
+
| `observability` | `logs` | `timestamp` | Log event age (vNext only) |
|
|
111
|
+
| `observability` | `scores` | `timestamp` | Score event age (vNext only) |
|
|
112
|
+
| `observability` | `feedback` | `timestamp` | Feedback event age (vNext only) |
|
|
113
|
+
| `scores` | `scorers` | `createdAt` | Score record age |
|
|
114
|
+
| `workflows` | `workflowSnapshot` | `updatedAt` | Inactivity, suspended or long-running workflows survive |
|
|
115
|
+
| `workflows` | `runOwnership` | `updatedAt` | Inactivity. A running durable agent execution renews its claim every 5 seconds by default, so keep `maxAge` well above its 15-second default lease. Configure these with `MASTRA_AGENT_THREAD_LEASE_RENEW_INTERVAL_MS` and `MASTRA_AGENT_THREAD_LEASE_TTL_MS` |
|
|
116
|
+
| `backgroundTasks` | `backgroundTasks` | `completedAt` | Time since completion, in-flight tasks (`NULL`) are never pruned |
|
|
117
|
+
| `experiments` | `experiments` | `completedAt` | Time since completion, running experiments are never pruned |
|
|
118
|
+
| `notifications` | `notifications` | `createdAt` | Notification age |
|
|
119
|
+
| `harness` | `sessions` | `createdAt` | Session record age |
|
|
120
|
+
| `schedules` | `triggers` | `actual_fire_at` | Fire-history age (epoch-ms column) |
|
|
121
121
|
|
|
122
122
|
> **Note:**
|
|
123
123
|
>
|
|
@@ -64,8 +64,30 @@ export const shopAgent = new Agent({
|
|
|
64
64
|
|
|
65
65
|
**config.id** (`string`): The generated tool id.
|
|
66
66
|
|
|
67
|
+
**config.maxCalls** (`number`): Maximum number of external\_\* calls a single program may attempt. Exceeding it fails the whole run with a CodeModeLimitError, even when the program catches the rejection. Must be a positive integer. Unset by default.
|
|
68
|
+
|
|
69
|
+
**config.maxConcurrentCalls** (`number`): Maximum number of external\_\* calls allowed to run at once. Additional calls queue in arrival order instead of failing. Must be a positive integer. Unset by default.
|
|
70
|
+
|
|
71
|
+
**config.maxResultBytes** (`number`): Maximum UTF-8 byte size of each nested tool result. A larger result fails the whole run with a CodeModeLimitError, even when the program catches the rejection. Applies to each nested tool result, not the program's final return value. Must be a non-negative integer. Unset by default.
|
|
72
|
+
|
|
73
|
+
**config.maxLogBytes** (`number`): Maximum UTF-8 bytes of captured console logs. Each retained line costs at least one byte, so a finite cap also bounds the line count. Overflow truncates the logs and the program still succeeds. 0 captures no logs. Must be a non-negative integer. Unset by default.
|
|
74
|
+
|
|
75
|
+
**config.maxLogLines** (`number`): Maximum number of captured console log lines. Overflow truncates the logs and the program still succeeds. 0 captures no logs. Must be a non-negative integer. Unset by default.
|
|
76
|
+
|
|
67
77
|
**transport** (`CodeModeTransport`): Optional transport implementation used to run the generated code in the sandbox. The default transport uses stdio JSON-RPC over the workspace sandbox process API. Transports that declare requiresSandbox: false (such as IsolatedVmCodeModeTransport and QuickJsCodeModeTransport) run without a sandbox.
|
|
68
78
|
|
|
79
|
+
## Execution limits
|
|
80
|
+
|
|
81
|
+
All five execution limits are opt-in. When unset, call counts, concurrency, result size, and captured logs are unlimited. Set them to bound what model-authored code can consume:
|
|
82
|
+
|
|
83
|
+
- `maxCalls` and `maxResultBytes` fail the whole run with a `CodeModeLimitError` when exceeded, even if the program catches the individual rejection. Use them to cap how many tools a program can reach and how much data each nested result can carry.
|
|
84
|
+
- `maxConcurrentCalls` queues calls in arrival order instead of failing, so a program that fans out with `Promise.all` still completes, with less host-side pressure at once.
|
|
85
|
+
- `maxLogBytes` and `maxLogLines` truncate the captured logs instead of failing. The program still succeeds, and `logs` in the result stays within the cap. Each retained line costs at least one byte, so a byte cap also bounds the line count.
|
|
86
|
+
|
|
87
|
+
The limits layer on top of `timeout` and, for in-process transports, their own runtime budgets such as the QuickJS `maxInterruptTicks`. For multi-tenant deployments, set explicit call, concurrency, result, log, and timeout budgets rather than relying on defaults.
|
|
88
|
+
|
|
89
|
+
When the calling tool's abort signal fires, the run is cancelled and any in-flight `external_*` calls are aborted.
|
|
90
|
+
|
|
69
91
|
## Returns
|
|
70
92
|
|
|
71
93
|
Returns a `CodeModeResult` object.
|
|
@@ -71,6 +71,14 @@ const queryTool = createVectorQueryTool({
|
|
|
71
71
|
|
|
72
72
|
**databaseConfig.chroma.whereDocument** (`Record<string, any>`): Document content filtering conditions
|
|
73
73
|
|
|
74
|
+
**databaseConfig.mongodb** (`MongoDBConfig`): Configuration specific to MongoDB Atlas vector search
|
|
75
|
+
|
|
76
|
+
**databaseConfig.mongodb.numCandidates** (`number`): Number of candidates considered before selecting the top-K results. Must be at least topK. Defaults to 20 \* topK, capped at 10,000.
|
|
77
|
+
|
|
78
|
+
**databaseConfig.turbopuffer** (`TurbopufferConfig`): Configuration specific to turbopuffer
|
|
79
|
+
|
|
80
|
+
**databaseConfig.turbopuffer.consistency** (`'strong' | 'eventual'`): Query consistency level. 'strong' (default) sees all data written before the query started; 'eventual' has lower latency but may miss recent writes.
|
|
81
|
+
|
|
74
82
|
**providerOptions** (`Record<string, Record<string, any>>`): Provider-specific options for the embedding model (e.g., outputDimensionality). Only works with AI SDK EmbeddingModelV2 models. For V1 models, configure options when creating the model itself.
|
|
75
83
|
|
|
76
84
|
**vectorStore** (`MastraVector | VectorStoreResolver`): Direct vector store instance or a resolver function for dynamic selection. Use a function for multi-tenant applications where the vector store is selected based on request context. When provided, vectorStoreName becomes optional.
|
|
@@ -762,16 +762,12 @@ Each voice provider can be configured with different models and options. Below a
|
|
|
762
762
|
// OpenAI Voice Configuration
|
|
763
763
|
const voice = new OpenAIVoice({
|
|
764
764
|
speechModel: {
|
|
765
|
-
name: '
|
|
765
|
+
name: 'tts-1-hd', // 'tts-1' or 'tts-1-hd'
|
|
766
766
|
apiKey: process.env.OPENAI_API_KEY,
|
|
767
|
-
language: 'en-US', // Language code
|
|
768
|
-
voiceType: 'neural', // Type of voice model
|
|
769
767
|
},
|
|
770
768
|
listeningModel: {
|
|
771
|
-
name: 'whisper-1',
|
|
769
|
+
name: 'whisper-1',
|
|
772
770
|
apiKey: process.env.OPENAI_API_KEY,
|
|
773
|
-
language: 'en-US', // Language code
|
|
774
|
-
format: 'wav', // Audio format
|
|
775
771
|
},
|
|
776
772
|
speaker: 'alloy', // Example speaker name
|
|
777
773
|
})
|
|
@@ -785,19 +781,14 @@ Visit the [OpenAI Voice Reference](https://mastra.ai/integrations/voice/openai)
|
|
|
785
781
|
// Azure Voice Configuration
|
|
786
782
|
const voice = new AzureVoice({
|
|
787
783
|
speechModel: {
|
|
788
|
-
name: 'en-US-JennyNeural', // Example model name
|
|
789
784
|
apiKey: process.env.AZURE_SPEECH_KEY,
|
|
790
785
|
region: process.env.AZURE_SPEECH_REGION,
|
|
791
|
-
|
|
792
|
-
style: 'cheerful', // Voice style
|
|
793
|
-
pitch: '+0Hz', // Pitch adjustment
|
|
794
|
-
rate: '1.0', // Speech rate
|
|
786
|
+
voiceName: 'en-US-JennyNeural',
|
|
795
787
|
},
|
|
796
788
|
listeningModel: {
|
|
797
|
-
name: 'en-US', // Example model name
|
|
798
789
|
apiKey: process.env.AZURE_SPEECH_KEY,
|
|
799
790
|
region: process.env.AZURE_SPEECH_REGION,
|
|
800
|
-
|
|
791
|
+
language: 'en-US',
|
|
801
792
|
},
|
|
802
793
|
})
|
|
803
794
|
```
|
|
@@ -828,16 +819,12 @@ Visit the [ElevenLabs Voice Reference](https://mastra.ai/integrations/voice/elev
|
|
|
828
819
|
// Google Voice Configuration
|
|
829
820
|
const voice = new GoogleVoice({
|
|
830
821
|
speechModel: {
|
|
831
|
-
name: 'en-US-Studio-O', // Example model name
|
|
832
822
|
apiKey: process.env.GOOGLE_API_KEY,
|
|
833
|
-
languageCode: 'en-US', // Language code
|
|
834
|
-
gender: 'FEMALE', // Voice gender
|
|
835
|
-
speakingRate: 1.0, // Speaking rate
|
|
836
823
|
},
|
|
837
824
|
listeningModel: {
|
|
838
|
-
|
|
839
|
-
sampleRateHertz: 16000, // Sample rate
|
|
825
|
+
apiKey: process.env.GOOGLE_API_KEY,
|
|
840
826
|
},
|
|
827
|
+
speaker: 'en-US-Studio-O',
|
|
841
828
|
})
|
|
842
829
|
```
|
|
843
830
|
|
|
@@ -848,14 +835,12 @@ Visit the [Google Voice Reference](https://mastra.ai/integrations/voice/google)
|
|
|
848
835
|
```typescript
|
|
849
836
|
// Cloudflare Voice Configuration
|
|
850
837
|
const voice = new CloudflareVoice({
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
language: 'en-US', // Language code
|
|
856
|
-
format: 'mp3', // Audio format
|
|
838
|
+
listeningModel: {
|
|
839
|
+
model: '@cf/openai/whisper-large-v3-turbo',
|
|
840
|
+
apiKey: process.env.CLOUDFLARE_AI_API_KEY,
|
|
841
|
+
account_id: process.env.CLOUDFLARE_ACCOUNT_ID,
|
|
857
842
|
},
|
|
858
|
-
// Cloudflare
|
|
843
|
+
// Cloudflare supports speech-to-text only. In a Worker, pass `binding: env.AI` instead of an API key.
|
|
859
844
|
})
|
|
860
845
|
```
|
|
861
846
|
|
|
@@ -153,7 +153,7 @@ const agent = new Agent({
|
|
|
153
153
|
model: 'openai/gpt-6.1-sol',
|
|
154
154
|
voice: new GeminiLiveVoice({
|
|
155
155
|
apiKey: process.env.GOOGLE_API_KEY,
|
|
156
|
-
model: 'gemini-
|
|
156
|
+
model: 'gemini-3.1-flash-live-preview',
|
|
157
157
|
speaker: 'Puck',
|
|
158
158
|
debug: true,
|
|
159
159
|
// Vertex AI option:
|
|
@@ -18,6 +18,7 @@ Returns one of the following:
|
|
|
18
18
|
|
|
19
19
|
- `Promise<string>`: A promise that resolves to the transcribed text
|
|
20
20
|
- `Promise<NodeJS.ReadableStream>`: A promise that resolves to a stream of transcribed text (for streaming transcription)
|
|
21
|
+
- `Promise<object>`: For providers that return structured results, such as Deepgram, which resolves to `{ transcript, words, raw }` plus `speakerSegments` when diarization is enabled
|
|
21
22
|
- `Promise<void>`: For real-time providers that emit 'writing' events instead of returning text directly
|
|
22
23
|
|
|
23
24
|
## Provider-specific options
|
|
@@ -35,9 +35,7 @@ Each voice provider may support additional options specific to their implementat
|
|
|
35
35
|
|
|
36
36
|
**options** (`Options`): Configuration options.
|
|
37
37
|
|
|
38
|
-
**options.
|
|
39
|
-
|
|
40
|
-
**options.similarity_boost** (`number`): Voice clarity and similarity to the original voice.
|
|
38
|
+
**options.outputFormat** (`string`): Audio output format passed to ElevenLabs, for example 'mp3_44100_128'.
|
|
41
39
|
|
|
42
40
|
### Google
|
|
43
41
|
|
|
@@ -26,12 +26,12 @@ export const factory = new MastraFactory({
|
|
|
26
26
|
|
|
27
27
|
## Provider classes
|
|
28
28
|
|
|
29
|
-
| Class | Package | Settings
|
|
30
|
-
| ------------------------ | ---------------------------- |
|
|
31
|
-
| `PlatformFactorySandbox` | `@mastra/platform-workspace` | `cpuCount`, `memoryMb`, `idleTimeoutMinutes`, `publicPorts` | `start`, `get` |
|
|
32
|
-
| `E2BFactorySandbox` | `@mastra/e2b` | `cpuCount`, `memoryMb`, `idleTimeoutMinutes`
|
|
33
|
-
| `DockerFactorySandbox` | `@mastra/docker` | `baseImage`, `owner`
|
|
34
|
-
| `LocalFactorySandbox` | `@mastra/factory` | None
|
|
29
|
+
| Class | Package | Settings | Builds |
|
|
30
|
+
| ------------------------ | ---------------------------- | --------------------------------------------------------------------- | ---------------------- |
|
|
31
|
+
| `PlatformFactorySandbox` | `@mastra/platform-workspace` | `cpuCount`, `memoryMb`, `docker`, `idleTimeoutMinutes`, `publicPorts` | `start`, `get` |
|
|
32
|
+
| `E2BFactorySandbox` | `@mastra/e2b` | `cpuCount`, `memoryMb`, `idleTimeoutMinutes` | `start`, `get`, `list` |
|
|
33
|
+
| `DockerFactorySandbox` | `@mastra/docker` | `baseImage`, `owner` | `start`, `get` |
|
|
34
|
+
| `LocalFactorySandbox` | `@mastra/factory` | None | No |
|
|
35
35
|
|
|
36
36
|
Each provider class takes the same runtime options as its sandbox class (minus `id`, `sandboxId` and `template`, which the class fills in per session), plus `template` options for the repository template and `defaults` for settings the environment leaves unset.
|
|
37
37
|
|
|
@@ -129,6 +129,20 @@ Clean up sandbox resources. Called by `workspace.destroy()`.
|
|
|
129
129
|
await sandbox.destroy()
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
+
### `_reset(options?)`
|
|
133
|
+
|
|
134
|
+
Replace the sandbox's environment while keeping the instance usable. Use it to recover from an environment that stopped responding. Sandboxes built on `MastraSandbox` have it.
|
|
135
|
+
|
|
136
|
+
`_reset()` calls the provider's `destroy()`, then leaves the instance `stopped`. The next command starts a fresh environment, and `onStart` runs again. Unlike `_destroy()`, it releases the environment before waiting on an in-flight start. A start hung on the dead environment then fails fast instead of blocking the reset. It also doesn't mark the instance destroyed. An environment that's already gone (a 410, or a 404 with no code or `not_found`) counts as released. Everything in the old environment that isn't saved elsewhere is lost.
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
await sandbox._reset({ timeoutMs: 30_000 })
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
`_reset()` rejects if the destroy or a start in flight doesn't settle within `timeoutMs` (default 30 seconds), or if the sandbox is already destroyed. It also rejects if, after those waits, the sandbox is `destroying` or `destroyed`, for example because `_destroy()` ran during the reset.
|
|
143
|
+
|
|
144
|
+
**Returns:** `Promise<void>`
|
|
145
|
+
|
|
132
146
|
### `snapshot()`
|
|
133
147
|
|
|
134
148
|
Persists the sandbox's current state when the provider supports snapshots. Other providers resolve without doing work.
|
|
@@ -120,6 +120,7 @@ The Reference section provides documentation of Mastra's API, including paramete
|
|
|
120
120
|
- [.getToolById()](https://mastra.ai/reference/core/getToolById)
|
|
121
121
|
- [.getVector()](https://mastra.ai/reference/core/getVector)
|
|
122
122
|
- [.getWorkflow()](https://mastra.ai/reference/core/getWorkflow)
|
|
123
|
+
- [.getWorkspaceById()](https://mastra.ai/reference/core/getWorkspaceById)
|
|
123
124
|
- [.listAgents()](https://mastra.ai/reference/core/listAgents)
|
|
124
125
|
- [.listClassifiers()](https://mastra.ai/reference/core/listClassifiers)
|
|
125
126
|
- [.listGateways()](https://mastra.ai/reference/core/listGateways)
|
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-CibQoN6K.cjs");
|
|
3
|
+
const require_constants = require("../constants-Bou0hEgY.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 { C as MastraScorer, D as isNotScorable, E as filterRun,
|
|
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-
|
|
1
|
+
import { Bc as validateScoringPredicate, C as MastraScorer, D as isNotScorable, E as filterRun, O as notScorable, Rc as SCORING_PREDICATE_ROOTS, S as createClassifierScorer, T as createScorer, v as runEvals, w as ScorerRunError, zc as evaluateScoringPredicate } from "../run-registry-BL_kKvFE.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-CFWgIaqA.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-CibQoN6K.cjs");
|
|
5
|
+
const require_constants = require("../../constants-Bou0hEgY.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 { Dr as saveScorePayloadSchema } from "../../constants-
|
|
3
|
+
import { Js as createWorkflow, qs as createStep } from "../../run-registry-BL_kKvFE.js";
|
|
4
|
+
import { Dr as saveScorePayloadSchema } from "../../constants-CFWgIaqA.js";
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
6
|
// src/evals/scoreTraces/scoreTraces.ts
|
|
7
7
|
async function scoreTraces({ scorerId, targets, mastra }) {
|
package/dist/events/index.cjs
CHANGED
|
@@ -656,7 +656,7 @@ var UnixSocketPubSub = class extends require_output_helpers.PubSub {
|
|
|
656
656
|
}
|
|
657
657
|
if (existing) await this.unsubscribe(topic, cb);
|
|
658
658
|
const group = options?.group;
|
|
659
|
-
const hadMembership = this.#
|
|
659
|
+
const hadMembership = [...subscriptions.values()].some((s) => s.group === group && !this.#leavingSubscriptions.has(s));
|
|
660
660
|
const wasConnected = Boolean(this.#clientSocket && !this.#clientSocket.destroyed);
|
|
661
661
|
subscriptions.set(cb, {
|
|
662
662
|
callback: cb,
|
package/dist/events/index.js
CHANGED
|
@@ -653,7 +653,7 @@ var UnixSocketPubSub = class extends PubSub {
|
|
|
653
653
|
}
|
|
654
654
|
if (existing) await this.unsubscribe(topic, cb);
|
|
655
655
|
const group = options?.group;
|
|
656
|
-
const hadMembership = this.#
|
|
656
|
+
const hadMembership = [...subscriptions.values()].some((s) => s.group === group && !this.#leavingSubscriptions.has(s));
|
|
657
657
|
const wasConnected = Boolean(this.#clientSocket && !this.#clientSocket.destroyed);
|
|
658
658
|
subscriptions.set(cb, {
|
|
659
659
|
callback: cb,
|