@mastra/mcp-docs-server 1.3.9 → 1.3.10-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/.docs/docs/agents/code-mode.md +2 -2
- package/.docs/docs/agents/guardrails.md +13 -5
- package/.docs/docs/agents/human-in-the-loop.md +27 -5
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/overview.md +7 -7
- package/.docs/docs/agents/processors.md +69 -20
- package/.docs/docs/agents/structured-output.md +6 -6
- package/.docs/docs/agents/tools.md +15 -10
- package/.docs/docs/browser.md +13 -1
- package/.docs/docs/channels.md +48 -6
- package/.docs/docs/connections/a2a.md +1 -1
- package/.docs/docs/connections/acp.md +2 -2
- package/.docs/docs/connections/mcp.md +159 -50
- package/.docs/docs/connections/overview.md +1 -1
- package/.docs/docs/connections/sdk-agents.md +8 -8
- package/.docs/docs/deployment/mastra-server.md +2 -0
- package/.docs/docs/deployment/monorepo.md +2 -0
- package/.docs/docs/develop.md +1 -1
- package/.docs/docs/evals/custom-scorers.md +5 -5
- package/.docs/docs/evals/experiments.md +2 -2
- package/.docs/docs/evals/multi-turn.md +2 -2
- package/.docs/docs/evals/overview.md +6 -4
- package/.docs/docs/evals/quick-checks.md +2 -2
- package/.docs/docs/guides/build-an-eval-loop.md +3 -3
- package/.docs/docs/guides/context-engineering.md +13 -6
- package/.docs/docs/guides/mcp-authentication-authorization.md +2 -2
- package/.docs/docs/guides/streaming.md +1 -1
- package/.docs/docs/harness/agent-controller.md +7 -7
- package/.docs/docs/harness/background-tasks.md +7 -3
- package/.docs/docs/harness/durable-agents.md +11 -6
- package/.docs/docs/harness/goals.md +7 -5
- package/.docs/docs/harness/overview.md +2 -2
- package/.docs/docs/harness/schedules.md +10 -5
- package/.docs/docs/index.md +6 -6
- package/.docs/docs/mastra-platform/connect/channels.md +1 -1
- package/.docs/docs/mastra-platform/connect/providers.md +27 -26
- package/.docs/docs/mastra-platform/connect/tools.md +4 -4
- package/.docs/docs/mastra-platform/deploy.md +2 -0
- package/.docs/docs/mastra-platform/observability.md +1 -1
- package/.docs/docs/mastra-platform/server.md +10 -6
- package/.docs/docs/mastra-platform/studio.md +1 -1
- package/.docs/docs/mastra-platform/system-environment-variables.md +3 -0
- package/.docs/docs/mastra-platform/workspaces.md +1 -1
- package/.docs/docs/memory/memory-processors.md +7 -7
- package/.docs/docs/memory/message-history.md +8 -5
- package/.docs/docs/memory/multi-user-threads.md +1 -1
- package/.docs/docs/memory/observational-memory.md +24 -14
- package/.docs/docs/memory/overview.md +6 -0
- package/.docs/docs/memory/semantic-recall.md +7 -3
- package/.docs/docs/memory/working-memory.md +2 -2
- package/.docs/docs/observability/integrations/exporters/mastra-storage.md +2 -1
- package/.docs/docs/observability/logging.md +8 -5
- package/.docs/docs/observability/tracing/overview.md +17 -0
- package/.docs/docs/sandbox/filesystem.md +1 -0
- package/.docs/docs/sandbox/overview.md +1 -1
- package/.docs/docs/sandbox/search.md +11 -0
- package/.docs/docs/server/custom-adapters.md +53 -1
- package/.docs/docs/server/custom-api-routes.md +2 -0
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/middleware.md +1 -1
- package/.docs/docs/server/request-context.md +9 -3
- package/.docs/docs/server/server-adapters.md +12 -204
- package/.docs/docs/signals/notifications.md +233 -0
- package/.docs/docs/signals/overview.md +94 -0
- package/.docs/docs/signals/running-across-processes.md +132 -0
- package/.docs/docs/signals/sending-signals.md +166 -0
- package/.docs/docs/signals/signal-providers.md +278 -0
- package/.docs/docs/signals/state-signals.md +103 -0
- package/.docs/docs/signals/thread-streams.md +125 -0
- package/.docs/docs/skills.md +4 -4
- package/.docs/docs/storage.md +1 -1
- package/.docs/docs/studio/editor.md +39 -23
- package/.docs/docs/studio/overview.md +2 -0
- package/.docs/docs/subagents.md +13 -7
- package/.docs/docs/workflows/agents-and-tools.md +16 -1
- package/.docs/docs/workflows/control-flow.md +57 -0
- package/.docs/docs/workflows/human-in-the-loop.md +3 -0
- package/.docs/docs/workflows/overview.md +9 -1
- package/.docs/docs/workflows/scheduled-workflows.md +10 -2
- package/.docs/docs/workflows/suspend-and-resume.md +6 -0
- package/.docs/docs/workflows/workflow-state.md +12 -0
- package/.docs/integrations/agentic-ui/ai-sdk-ui.md +1 -1
- package/.docs/integrations/agentic-ui/copilotkit.md +3 -1
- package/.docs/integrations/agentic-ui/openui.md +1 -1
- package/.docs/integrations/auth/better-auth.md +2 -0
- package/.docs/integrations/auth/google.md +2 -0
- package/.docs/integrations/auth/okta.md +2 -0
- package/.docs/integrations/browsers/agent-browser.md +1 -1
- package/.docs/integrations/browsers/browser-viewer.md +1 -1
- package/.docs/integrations/browsers/firecrawl.md +1 -1
- package/.docs/integrations/browsers/stagehand.md +6 -6
- package/.docs/integrations/channels/discord.md +1 -1
- package/.docs/integrations/channels/github.md +2 -2
- package/.docs/integrations/channels/imessage.md +2 -50
- package/.docs/integrations/channels/slack.md +1 -1
- package/.docs/integrations/channels/teams.md +1 -1
- package/.docs/integrations/channels/telegram.md +1 -1
- package/.docs/integrations/channels/whatsapp.md +1 -1
- package/.docs/integrations/databases/aurora-dsql.md +3 -3
- package/.docs/integrations/databases/cloudflare-kv.md +4 -0
- package/.docs/integrations/databases/dynamodb.md +4 -4
- package/.docs/integrations/databases/elasticsearch.md +1 -1
- package/.docs/integrations/databases/mongodb.md +1 -1
- package/.docs/integrations/databases/oracledb.md +1 -1
- package/.docs/integrations/databases/postgresql.md +5 -5
- package/.docs/integrations/databases/redis.md +1 -1
- package/.docs/integrations/databases/upstash.md +1 -1
- package/.docs/integrations/deploy/inngest.md +1 -0
- package/.docs/integrations/deploy/kubernetes.md +1 -1
- package/.docs/integrations/deploy/neon.md +2 -1
- package/.docs/integrations/deploy/render.md +2 -2
- package/.docs/integrations/file-storage/agentfs.md +1 -1
- package/.docs/integrations/file-storage/amazon-s3.md +20 -3
- package/.docs/integrations/file-storage/archil.md +4 -4
- package/.docs/integrations/file-storage/azure-blob.md +1 -1
- package/.docs/integrations/file-storage/google-cloud-storage.md +1 -1
- package/.docs/integrations/file-storage/google-drive.md +1 -1
- package/.docs/integrations/file-storage/mesa.md +2 -2
- package/.docs/integrations/file-storage/neon.md +210 -0
- package/.docs/integrations/file-storage/vercel-files.md +5 -1
- package/.docs/integrations/frameworks/express.md +0 -64
- package/.docs/integrations/observability/datadog.md +5 -0
- package/.docs/integrations/observability/langfuse.md +1 -1
- package/.docs/integrations/observability/langsmith.md +35 -2
- package/.docs/integrations/observability/opentelemetry.md +32 -9
- package/.docs/integrations/observability/sentry.md +22 -22
- package/.docs/integrations/sandboxes/apple-container.md +1 -1
- package/.docs/integrations/sandboxes/blaxel.md +1 -1
- package/.docs/integrations/sandboxes/cloudflare-sandbox.md +1 -1
- package/.docs/integrations/sandboxes/daytona.md +4 -4
- package/.docs/integrations/sandboxes/docker.md +2 -2
- package/.docs/integrations/sandboxes/e2b-desktop.md +1 -1
- package/.docs/integrations/sandboxes/e2b.md +9 -7
- package/.docs/integrations/sandboxes/modal.md +4 -4
- package/.docs/integrations/sandboxes/railway.md +4 -4
- package/.docs/integrations/sandboxes/sprites.md +1 -1
- package/.docs/integrations/sandboxes/vercel.md +6 -6
- package/.docs/integrations/tools/brightdata.md +2 -2
- package/.docs/integrations/tools/firecrawl.md +1 -1
- package/.docs/integrations/tools/parallel.md +4 -4
- package/.docs/integrations/tools/perplexity.md +2 -2
- package/.docs/integrations/tools/tavily.md +2 -2
- package/.docs/integrations/voice/azure.md +4 -4
- package/.docs/integrations/voice/cloudflare.md +3 -3
- package/.docs/integrations/voice/deepgram.md +2 -2
- package/.docs/integrations/voice/elevenlabs.md +4 -4
- package/.docs/integrations/voice/gladia.md +10 -10
- package/.docs/integrations/voice/google.md +11 -11
- package/.docs/integrations/voice/inworld.md +23 -23
- package/.docs/integrations/voice/livekit.md +11 -8
- package/.docs/integrations/voice/mistral.md +2 -2
- package/.docs/integrations/voice/modelslab.md +1 -1
- package/.docs/integrations/voice/murf.md +1 -1
- package/.docs/integrations/voice/openai.md +5 -5
- package/.docs/integrations/voice/sarvam.md +6 -6
- package/.docs/integrations/voice/speechify.md +25 -12
- package/.docs/integrations/voice/xai.md +3 -3
- package/.docs/integrations.md +1 -0
- package/.docs/models/environment-variables.md +2 -2
- package/.docs/models/gateways/custom-gateways.md +3 -3
- package/.docs/models/gateways/merge-gateway.md +4 -14
- package/.docs/models/gateways/neon.md +2 -1
- package/.docs/models/gateways/netlify.md +3 -5
- package/.docs/models/gateways/openrouter.md +6 -6
- package/.docs/models/gateways/vercel.md +7 -9
- package/.docs/models/index.md +21 -15
- package/.docs/models/providers/302ai.md +7 -3
- package/.docs/models/providers/abacus.md +74 -110
- package/.docs/models/providers/abliteration-ai.md +4 -0
- package/.docs/models/providers/above.md +4 -0
- package/.docs/models/providers/agentrouter.md +4 -0
- package/.docs/models/providers/agnes.md +4 -0
- package/.docs/models/providers/ai-router.md +4 -0
- package/.docs/models/providers/ai21.md +4 -0
- package/.docs/models/providers/aiand.md +8 -7
- package/.docs/models/providers/aimlapi.md +172 -173
- package/.docs/models/providers/ainetcafe.md +4 -0
- package/.docs/models/providers/aixy.md +4 -0
- package/.docs/models/providers/aki-io.md +9 -6
- package/.docs/models/providers/alibaba-cn.md +6 -2
- package/.docs/models/providers/alibaba-coding-plan-cn.md +4 -0
- package/.docs/models/providers/alibaba-coding-plan.md +4 -0
- package/.docs/models/providers/alibaba-token-plan-cn.md +4 -0
- package/.docs/models/providers/alibaba-token-plan.md +4 -0
- package/.docs/models/providers/alibaba.md +6 -2
- package/.docs/models/providers/ambient.md +6 -2
- package/.docs/models/providers/amd.md +4 -0
- package/.docs/models/providers/anthropic.md +4 -0
- package/.docs/models/providers/anyapi.md +4 -0
- package/.docs/models/providers/arcee.md +4 -0
- package/.docs/models/providers/atomic-chat.md +4 -0
- package/.docs/models/providers/auriko.md +6 -2
- package/.docs/models/providers/bailing.md +4 -0
- package/.docs/models/providers/baseten.md +8 -4
- package/.docs/models/providers/bee.md +4 -0
- package/.docs/models/providers/berget.md +7 -4
- package/.docs/models/providers/blueclaw.md +4 -0
- package/.docs/models/providers/bothub.md +8 -4
- package/.docs/models/providers/boundless.md +4 -4
- package/.docs/models/providers/cerebras.md +4 -0
- package/.docs/models/providers/chutes.md +18 -11
- package/.docs/models/providers/clarifai.md +4 -0
- package/.docs/models/providers/claudinio.md +4 -0
- package/.docs/models/providers/cline-pass.md +6 -6
- package/.docs/models/providers/cloudferro-sherlock.md +4 -0
- package/.docs/models/providers/cloudflare-workers-ai.md +4 -0
- package/.docs/models/providers/commandcode.md +6 -2
- package/.docs/models/providers/coralbricks.md +5 -1
- package/.docs/models/providers/cortecs.md +9 -4
- package/.docs/models/providers/crof.md +4 -0
- package/.docs/models/providers/crossmodel.md +5 -3
- package/.docs/models/providers/crusoe.md +5 -7
- package/.docs/models/providers/daoxe.md +5 -1
- package/.docs/models/providers/databricks.md +4 -0
- package/.docs/models/providers/deepinfra.md +6 -2
- package/.docs/models/providers/deepseek.md +4 -0
- package/.docs/models/providers/digitalocean.md +11 -10
- package/.docs/models/providers/dinference.md +4 -3
- package/.docs/models/providers/drun.md +4 -0
- package/.docs/models/providers/ebcloud.md +4 -0
- package/.docs/models/providers/echo.md +4 -0
- package/.docs/models/providers/edenai.md +33 -9
- package/.docs/models/providers/empiriolabs.md +8 -5
- package/.docs/models/providers/engy.md +6 -2
- package/.docs/models/providers/evroc.md +6 -2
- package/.docs/models/providers/fastrouter.md +45 -50
- package/.docs/models/providers/firepass.md +4 -0
- package/.docs/models/providers/fireworks-ai.md +32 -23
- package/.docs/models/providers/firmware.md +4 -0
- package/.docs/models/providers/freemodel.md +4 -0
- package/.docs/models/providers/friendli.md +15 -13
- package/.docs/models/providers/frogbot.md +6 -7
- package/.docs/models/providers/github-models.md +4 -0
- package/.docs/models/providers/gmicloud.md +4 -0
- package/.docs/models/providers/google.md +6 -5
- package/.docs/models/providers/greenpt.md +18 -20
- package/.docs/models/providers/groq.md +5 -1
- package/.docs/models/providers/helicone.md +4 -0
- package/.docs/models/providers/hetzner.md +4 -0
- package/.docs/models/providers/hpc-ai.md +4 -0
- package/.docs/models/providers/huggingface.md +7 -0
- package/.docs/models/providers/hyper.md +4 -0
- package/.docs/models/providers/iflowcn.md +6 -18
- package/.docs/models/providers/impossibl.md +6 -9
- package/.docs/models/providers/inception.md +4 -0
- package/.docs/models/providers/inceptron.md +12 -6
- package/.docs/models/providers/inco.md +5 -1
- package/.docs/models/providers/infer.md +4 -0
- package/.docs/models/providers/inference.md +9 -11
- package/.docs/models/providers/inferx.md +4 -0
- package/.docs/models/providers/infomaniak.md +14 -12
- package/.docs/models/providers/io-net.md +15 -17
- package/.docs/models/providers/iteracompute.md +7 -3
- package/.docs/models/providers/jalapeno.md +18 -19
- package/.docs/models/providers/jiekou.md +57 -63
- package/.docs/models/providers/kenari.md +38 -53
- package/.docs/models/providers/kilo.md +31 -27
- package/.docs/models/providers/kimi-code-plan-cn.md +7 -1
- package/.docs/models/providers/kimi-code-plan-global.md +7 -1
- package/.docs/models/providers/kimi-for-coding.md +4 -0
- package/.docs/models/providers/kiro.md +4 -0
- package/.docs/models/providers/klokintegration.md +4 -0
- package/.docs/models/providers/kosmik.md +4 -0
- package/.docs/models/providers/kuae-cloud-coding-plan.md +4 -0
- package/.docs/models/providers/lilac.md +6 -8
- package/.docs/models/providers/liquid.md +4 -0
- package/.docs/models/providers/llama.md +6 -11
- package/.docs/models/providers/llmgateway-providers.md +25 -23
- package/.docs/models/providers/llmgateway.md +20 -13
- package/.docs/models/providers/llmtech.md +4 -0
- package/.docs/models/providers/llmtr.md +5 -6
- package/.docs/models/providers/lmstudio.md +4 -0
- package/.docs/models/providers/longcat.md +4 -0
- package/.docs/models/providers/lowrouter.md +7 -2
- package/.docs/models/providers/lucidquery.md +6 -2
- package/.docs/models/providers/lynkr.md +4 -0
- package/.docs/models/providers/meganova.md +10 -7
- package/.docs/models/providers/melious.md +6 -7
- package/.docs/models/providers/meta.md +4 -0
- package/.docs/models/providers/minimax-cn-coding-plan.md +4 -0
- package/.docs/models/providers/minimax-cn.md +4 -0
- package/.docs/models/providers/minimax-coding-plan.md +4 -0
- package/.docs/models/providers/minimax.md +4 -0
- package/.docs/models/providers/mistral.md +8 -3
- package/.docs/models/providers/mixlayer.md +4 -0
- package/.docs/models/providers/moark.md +4 -2
- package/.docs/models/providers/modal.md +4 -0
- package/.docs/models/providers/model-oracle-ai.md +4 -0
- package/.docs/models/providers/modelis.md +4 -0
- package/.docs/models/providers/modelscope.md +4 -0
- package/.docs/models/providers/moonshotai-cn.md +8 -2
- package/.docs/models/providers/moonshotai.md +8 -2
- package/.docs/models/providers/morph.md +18 -6
- package/.docs/models/providers/munito-eu.md +84 -0
- package/.docs/models/providers/munito.md +85 -0
- package/.docs/models/providers/nan.md +5 -1
- package/.docs/models/providers/nano-gpt.md +651 -613
- package/.docs/models/providers/nearai.md +7 -2
- package/.docs/models/providers/nebius.md +33 -27
- package/.docs/models/providers/neosmith.md +4 -0
- package/.docs/models/providers/neuralwatt.md +5 -4
- package/.docs/models/providers/nova.md +4 -0
- package/.docs/models/providers/novita-ai.md +8 -1
- package/.docs/models/providers/nvidia.md +19 -35
- package/.docs/models/providers/oci.md +4 -1
- package/.docs/models/providers/ofox.md +5 -1
- package/.docs/models/providers/ollama-cloud.md +6 -2
- package/.docs/models/providers/openai.md +6 -1
- package/.docs/models/providers/opencode-go.md +9 -4
- package/.docs/models/providers/opencode.md +88 -88
- package/.docs/models/providers/openreason.md +4 -0
- package/.docs/models/providers/opper.md +5 -4
- package/.docs/models/providers/orcarouter.md +18 -16
- package/.docs/models/providers/ovhcloud.md +4 -0
- package/.docs/models/providers/pareto.md +5 -1
- package/.docs/models/providers/pendra.md +4 -0
- package/.docs/models/providers/perplexity-agent.md +6 -12
- package/.docs/models/providers/perplexity.md +4 -0
- package/.docs/models/providers/pioneer.md +11 -7
- package/.docs/models/providers/poe.md +20 -70
- package/.docs/models/providers/poolside.md +4 -0
- package/.docs/models/providers/prime.md +8 -2
- package/.docs/models/providers/privatemode-ai.md +4 -0
- package/.docs/models/providers/qihang-ai.md +11 -11
- package/.docs/models/providers/qiniu-ai.md +13 -94
- package/.docs/models/providers/reflection.md +4 -0
- package/.docs/models/providers/regolo-ai.md +9 -7
- package/.docs/models/providers/requesty.md +10 -1
- package/.docs/models/providers/routing-run.md +4 -0
- package/.docs/models/providers/runinfra.md +5 -4
- package/.docs/models/providers/sakana.md +4 -0
- package/.docs/models/providers/sambanova.md +4 -0
- package/.docs/models/providers/sarvam.md +5 -2
- package/.docs/models/providers/scaleway.md +16 -11
- package/.docs/models/providers/scnet-token-plan.md +4 -0
- package/.docs/models/providers/scx-ai.md +4 -0
- package/.docs/models/providers/scx.md +4 -0
- package/.docs/models/providers/sensenova.md +4 -0
- package/.docs/models/providers/siliconflow-cn.md +39 -41
- package/.docs/models/providers/siliconflow.md +7 -6
- package/.docs/models/providers/snowflake-cortex.md +4 -0
- package/.docs/models/providers/stackit.md +6 -4
- package/.docs/models/providers/standardcompute.md +4 -0
- package/.docs/models/providers/stepfun-ai-step-plan.md +4 -0
- package/.docs/models/providers/stepfun-ai.md +8 -4
- package/.docs/models/providers/stepfun-step-plan.md +4 -0
- package/.docs/models/providers/stepfun.md +8 -4
- package/.docs/models/providers/subconscious.md +4 -0
- package/.docs/models/providers/submodel.md +5 -1
- package/.docs/models/providers/synthetic.md +4 -4
- package/.docs/models/providers/tempr.md +5 -4
- package/.docs/models/providers/tencent-coding-plan.md +7 -10
- package/.docs/models/providers/tencent-token-plan.md +4 -0
- package/.docs/models/providers/tencent-tokenhub.md +4 -0
- package/.docs/models/providers/tensorx.md +4 -13
- package/.docs/models/providers/the-grid-ai.md +6 -1
- package/.docs/models/providers/thinkingmachines.md +4 -0
- package/.docs/models/providers/tinfoil.md +4 -0
- package/.docs/models/providers/togetherai.md +4 -0
- package/.docs/models/providers/tokengo.md +5 -1
- package/.docs/models/providers/tokenrouter.md +4 -0
- package/.docs/models/providers/trustedrouter.md +4 -0
- package/.docs/models/providers/umans-ai-coding-plan.md +16 -11
- package/.docs/models/providers/umans-ai.md +15 -10
- package/.docs/models/providers/unorouter.md +4 -13
- package/.docs/models/providers/upstage.md +4 -0
- package/.docs/models/providers/vancine.md +4 -1
- package/.docs/models/providers/vispark.md +4 -0
- package/.docs/models/providers/vivgrid.md +30 -39
- package/.docs/models/providers/volcengine-coding-plan.md +12 -12
- package/.docs/models/providers/volcengine.md +16 -18
- package/.docs/models/providers/vultr.md +4 -2
- package/.docs/models/providers/wafer.ai.md +7 -7
- package/.docs/models/providers/wallaby.md +4 -0
- package/.docs/models/providers/wandb.md +9 -5
- package/.docs/models/providers/xai.md +23 -3
- package/.docs/models/providers/xiaomi-token-plan-ams.md +8 -4
- package/.docs/models/providers/xiaomi-token-plan-cn.md +8 -4
- package/.docs/models/providers/xiaomi-token-plan-sgp.md +8 -4
- package/.docs/models/providers/xiaomi.md +8 -4
- package/.docs/models/providers/xpersona.md +4 -1
- package/.docs/models/providers/zai-coding-plan.md +4 -0
- package/.docs/models/providers/zai.md +4 -0
- package/.docs/models/providers/zeldoc.md +4 -0
- package/.docs/models/providers/zenifra.md +4 -0
- package/.docs/models/providers/zenmux.md +109 -125
- package/.docs/models/providers/zhipuai-coding-plan.md +4 -0
- package/.docs/models/providers/zhipuai.md +4 -0
- package/.docs/models/providers.md +2 -2
- package/.docs/reference/acp/acp-agent.md +5 -5
- package/.docs/reference/acp/create-acp-tool.md +2 -2
- package/.docs/reference/agent-controller/agent-controller-class.md +3 -3
- package/.docs/reference/agent-controller/session.md +10 -10
- package/.docs/reference/agents/agent.md +28 -48
- package/.docs/reference/agents/channels.md +35 -14
- package/.docs/reference/agents/createSkill.md +1 -1
- package/.docs/reference/agents/durable-agent.md +31 -23
- package/.docs/reference/agents/generate.md +61 -4
- package/.docs/reference/agents/generateLegacy.md +4 -4
- package/.docs/reference/agents/getLLM.md +2 -2
- package/.docs/reference/agents/getMetadata.md +2 -2
- package/.docs/reference/agents/inngest-agent.md +3 -1
- package/.docs/reference/agents/network.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +1 -1
- package/.docs/reference/auth/auth0.md +2 -2
- package/.docs/reference/auth/better-auth.md +7 -3
- package/.docs/reference/auth/clerk.md +1 -1
- package/.docs/reference/auth/firebase.md +4 -4
- package/.docs/reference/auth/google.md +6 -6
- package/.docs/reference/auth/jwt.md +1 -1
- package/.docs/reference/auth/neon.md +6 -6
- package/.docs/reference/auth/okta.md +9 -8
- package/.docs/reference/auth/workos.md +3 -3
- package/.docs/reference/browser/agent-browser.md +2 -2
- package/.docs/reference/browser/browser-viewer.md +1 -1
- package/.docs/reference/browser/firecrawl-browser.md +2 -2
- package/.docs/reference/browser/mastra-browser.md +1 -1
- package/.docs/reference/browser/stagehand-browser.md +5 -5
- package/.docs/reference/channels/slack-provider.md +7 -2
- package/.docs/reference/channels/teams-provider.md +2 -2
- package/.docs/reference/channels/telegram-provider.md +2 -2
- package/.docs/reference/cli/mastra.md +26 -0
- package/.docs/reference/client-js/agent-controller.md +5 -2
- package/.docs/reference/client-js/agents.md +22 -2
- package/.docs/reference/client-js/conversations.md +3 -3
- package/.docs/reference/client-js/datasets.md +1 -1
- package/.docs/reference/client-js/observability.md +39 -15
- package/.docs/reference/client-js/responses.md +4 -4
- package/.docs/reference/client-js/workflows.md +2 -0
- package/.docs/reference/code-sdk/mount-agent-controller.md +2 -2
- package/.docs/reference/coding-agent/build-base-prompt.md +1 -1
- package/.docs/reference/coding-agent/create-coding-agent.md +9 -9
- package/.docs/reference/configuration.md +4 -4
- package/.docs/reference/connect/channels.md +2 -2
- package/.docs/reference/connect/credential.md +1 -1
- package/.docs/reference/connect/providers.md +166 -112
- package/.docs/reference/connect/tools.md +17 -19
- package/.docs/reference/core/getAgentById.md +1 -1
- package/.docs/reference/core/mastra-class.md +7 -5
- package/.docs/reference/core/mastra-model-gateway.md +7 -2
- package/.docs/reference/datasets/startExperiment.md +17 -2
- package/.docs/reference/deployer.md +6 -3
- package/.docs/reference/editor/blob-store-provider.md +2 -2
- package/.docs/reference/editor/mastra-editor.md +2 -2
- package/.docs/reference/editor/tool-provider.md +1 -1
- package/.docs/reference/evals/answer-relevancy.md +3 -3
- package/.docs/reference/evals/answer-similarity.md +5 -3
- package/.docs/reference/evals/bias.md +3 -3
- package/.docs/reference/evals/checks.md +1 -1
- package/.docs/reference/evals/content-similarity.md +2 -2
- package/.docs/reference/evals/context-precision.md +3 -3
- package/.docs/reference/evals/context-recall.md +3 -3
- package/.docs/reference/evals/context-relevance.md +11 -11
- package/.docs/reference/evals/faithfulness.md +1 -1
- package/.docs/reference/evals/hallucination.md +8 -8
- package/.docs/reference/evals/multi-turn-judge.md +2 -2
- package/.docs/reference/evals/noise-sensitivity.md +13 -13
- package/.docs/reference/evals/not-scorable.md +1 -1
- package/.docs/reference/evals/prompt-alignment.md +26 -25
- package/.docs/reference/evals/rubric.md +6 -6
- package/.docs/reference/evals/run-evals.md +1 -1
- package/.docs/reference/evals/scorer-utils.md +6 -4
- package/.docs/reference/evals/summarization.md +4 -4
- package/.docs/reference/evals/tone-consistency.md +5 -5
- package/.docs/reference/evals/tool-call-accuracy.md +8 -8
- package/.docs/reference/evals/toxicity.md +1 -1
- package/.docs/reference/evals/trajectory-accuracy.md +1 -1
- package/.docs/reference/file-based-agents/config.md +3 -3
- package/.docs/reference/file-based-agents/schedules.md +2 -2
- package/.docs/reference/file-based-agents/subagents.md +4 -4
- package/.docs/reference/file-based-agents/workspace.md +1 -1
- package/.docs/reference/index.md +2 -1
- package/.docs/reference/logging/pino-logger.md +1 -1
- package/.docs/reference/manual-install.md +2 -2
- package/.docs/reference/memory/memory-class.md +5 -5
- package/.docs/reference/memory/observational-memory.md +25 -25
- package/.docs/reference/memory/summarizeConversation.md +3 -3
- package/.docs/reference/memory/summarizeThread.md +3 -3
- package/.docs/reference/migrations/agentnetwork.md +4 -4
- package/.docs/reference/migrations/mcp-v2.md +1 -1
- package/.docs/reference/migrations/upgrade-to-v1/agent.md +1 -1
- package/.docs/reference/migrations/upgrade-to-v1/storage.md +1 -1
- package/.docs/reference/migrations/upgrade-to-v1/tools.md +7 -1
- package/.docs/reference/migrations/vnext-to-standard-apis.md +3 -3
- package/.docs/reference/observability/metrics/automatic-metrics.md +10 -8
- package/.docs/reference/observability/tracing/advanced-queries.md +92 -11
- package/.docs/reference/observability/tracing/bridges/otel.md +1 -1
- package/.docs/reference/observability/tracing/exporters/confident-ai.md +2 -2
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +3 -3
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/langfuse.md +1 -1
- package/.docs/reference/observability/tracing/exporters/langsmith.md +8 -0
- package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +4 -0
- package/.docs/reference/observability/tracing/exporters/mastra-storage-exporter.md +5 -1
- package/.docs/reference/observability/tracing/exporters/sentry.md +5 -5
- package/.docs/reference/observability/tracing/interfaces.md +23 -1
- package/.docs/reference/processors/batch-parts-processor.md +2 -2
- package/.docs/reference/processors/classifier-processor.md +3 -3
- package/.docs/reference/processors/cyber-refusal-handler.md +1 -1
- package/.docs/reference/processors/file-upload-processor.md +9 -9
- package/.docs/reference/processors/language-detector.md +1 -1
- package/.docs/reference/processors/message-history-processor.md +2 -2
- package/.docs/reference/processors/model-selection-processor.md +7 -7
- package/.docs/reference/processors/moderation-processor.md +3 -3
- package/.docs/reference/processors/pii-detector.md +2 -2
- package/.docs/reference/processors/prefill-error-handler.md +2 -2
- package/.docs/reference/processors/processor-interface.md +71 -15
- package/.docs/reference/processors/prompt-injection-detector.md +1 -1
- package/.docs/reference/processors/provider-history-compat.md +13 -12
- package/.docs/reference/processors/regex-filter-processor.md +1 -1
- package/.docs/reference/processors/response-cache.md +2 -2
- package/.docs/reference/processors/semantic-recall-processor.md +2 -2
- package/.docs/reference/processors/skill-search-processor.md +1 -1
- package/.docs/reference/processors/stream-error-retry-processor.md +12 -8
- package/.docs/reference/processors/system-prompt-scrubber.md +2 -2
- package/.docs/reference/processors/token-cost-control.md +1 -1
- package/.docs/reference/processors/token-limiter-processor.md +4 -4
- package/.docs/reference/processors/tool-call-filter.md +3 -3
- package/.docs/reference/processors/tool-search-processor.md +6 -6
- package/.docs/reference/processors/unicode-normalizer.md +2 -2
- package/.docs/reference/processors/working-memory-processor.md +2 -2
- package/.docs/reference/pubsub/lease-provider.md +2 -2
- package/.docs/reference/pubsub/redis-streams.md +11 -1
- package/.docs/reference/pubsub/unix-socket-pubsub.md +1 -1
- package/.docs/reference/rag/chunking-and-embedding.md +2 -2
- package/.docs/reference/rag/database-config.md +20 -15
- package/.docs/reference/rag/extract-params.md +2 -2
- package/.docs/reference/rag/graph-rag-guide.md +2 -2
- package/.docs/reference/rag/metadata-filters.md +1 -1
- package/.docs/reference/rag/rerank.md +1 -1
- package/.docs/reference/rag/retrieval.md +24 -13
- package/.docs/reference/schedules/overview.md +17 -1
- package/.docs/reference/server/koa-adapter.md +2 -0
- package/.docs/reference/server/nestjs-adapter.md +1 -1
- package/.docs/reference/signals/create-notification-inbox-tool.md +4 -4
- package/.docs/reference/signals/notifications.md +249 -0
- package/.docs/reference/signals/task-signal-provider.md +2 -2
- package/.docs/reference/signals/thread-events.md +69 -0
- package/.docs/reference/storage/overview.md +30 -13
- package/.docs/reference/storage/retention.md +1 -1
- package/.docs/reference/streaming/ChunkType.md +86 -0
- package/.docs/reference/streaming/agents/MastraModelOutput.md +3 -3
- package/.docs/reference/streaming/agents/stream.md +6 -6
- package/.docs/reference/streaming/agents/streamLegacy.md +2 -2
- package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
- package/.docs/reference/tools/ask-user-tool.md +1 -1
- package/.docs/reference/tools/bedrock-kb-tool.md +2 -2
- package/.docs/reference/tools/create-code-mode.md +2 -2
- package/.docs/reference/tools/create-tool.md +19 -2
- package/.docs/reference/tools/document-chunker-tool.md +1 -1
- package/.docs/reference/tools/mcp-client.md +207 -16
- package/.docs/reference/tools/mcp-server.md +9 -7
- package/.docs/reference/tools/task-tools.md +4 -2
- package/.docs/reference/tools/vector-query-tool.md +2 -1
- package/.docs/reference/vectors/astra.md +3 -1
- package/.docs/reference/vectors/azure-ai-search.md +2 -2
- package/.docs/reference/vectors/chroma.md +2 -2
- package/.docs/reference/vectors/convex.md +1 -1
- package/.docs/reference/vectors/couchbase.md +12 -5
- package/.docs/reference/vectors/duckdb.md +5 -5
- package/.docs/reference/vectors/libsql.md +1 -1
- package/.docs/reference/vectors/mongodb.md +8 -8
- package/.docs/reference/vectors/oracledb.md +2 -2
- package/.docs/reference/vectors/pg.md +2 -2
- package/.docs/reference/vectors/pinecone.md +1 -1
- package/.docs/reference/vectors/qdrant.md +1 -1
- package/.docs/reference/vectors/s3vectors.md +3 -0
- package/.docs/reference/vectors/turbopuffer.md +1 -1
- package/.docs/reference/vectors/upstash.md +9 -5
- package/.docs/reference/vectors/vectorize.md +4 -2
- package/.docs/reference/vectors/weaviate.md +1 -1
- package/.docs/reference/voice/overview.md +24 -24
- package/.docs/reference/voice/speech-to-speech.md +6 -6
- package/.docs/reference/voice/speech-to-text.md +1 -1
- package/.docs/reference/voice/text-to-speech.md +1 -1
- package/.docs/reference/voice/voice.addInstructions.md +1 -1
- package/.docs/reference/voice/voice.send.md +1 -1
- package/.docs/reference/voice/voice.speak.md +1 -1
- package/.docs/reference/voice/voice.updateConfig.md +1 -1
- package/.docs/reference/workflows/run-methods/restart.md +1 -1
- package/.docs/reference/workflows/run-methods/resume.md +1 -1
- package/.docs/reference/workflows/run-methods/start.md +1 -1
- package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
- package/.docs/reference/workflows/run.md +2 -2
- package/.docs/reference/workflows/step.md +4 -0
- package/.docs/reference/workflows/workflow-methods/agent.md +2 -0
- package/.docs/reference/workflows/workflow-methods/classifier.md +5 -0
- package/.docs/reference/workflows/workflow-methods/dountil.md +1 -1
- package/.docs/reference/workflows/workflow-methods/map.md +2 -0
- package/.docs/reference/workflows/workflow.md +2 -2
- package/.docs/reference/workspace/factory-sandbox.md +11 -2
- package/.docs/reference/workspace/filesystem.md +2 -2
- package/.docs/reference/workspace/local-filesystem.md +1 -1
- package/.docs/reference/workspace/local-sandbox.md +4 -4
- package/.docs/reference/workspace/platform-filesystem.md +4 -4
- package/.docs/reference/workspace/platform-sandbox.md +31 -10
- package/.docs/reference/workspace/process-manager.md +13 -2
- package/.docs/reference/workspace/sandbox.md +1 -1
- package/.docs/reference/workspace/workspace-class.md +13 -13
- package/dist/index.js +1 -1
- package/dist/{src-DnH_jHt9.js → src-Cv7bX2-6.js} +10 -19
- package/dist/{src-DnH_jHt9.js.map → src-Cv7bX2-6.js.map} +1 -1
- package/dist/stdio.js +2 -3
- package/package.json +15 -15
- package/.docs/docs/guides/mcp-events.md +0 -306
- package/.docs/docs/harness/signal-providers.md +0 -212
- package/.docs/docs/harness/signals.md +0 -546
- package/.docs/docs/mastra-platform/connect/end-user-connections.md +0 -116
- package/.docs/reference/connect/user-connect-routes.md +0 -68
|
@@ -12,15 +12,32 @@ Mastra storage is organized into domains. Each domain owns a set of tables or co
|
|
|
12
12
|
|
|
13
13
|
Not every storage adapter implements every domain. Composite storage lets you mix adapters per domain when the adapter packages export the corresponding domain classes.
|
|
14
14
|
|
|
15
|
-
| Domain
|
|
16
|
-
|
|
|
17
|
-
| `memory`
|
|
18
|
-
| `workflows`
|
|
19
|
-
| `workflowDefinitions`
|
|
20
|
-
| `scores`
|
|
21
|
-
| `observability`
|
|
22
|
-
| `datasets`
|
|
23
|
-
| `experiments`
|
|
15
|
+
| Domain | Description |
|
|
16
|
+
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| `memory` | Conversation persistence: messages, threads, and resources (including working memory). |
|
|
18
|
+
| `workflows` | Workflow run snapshots used for suspend and resume. |
|
|
19
|
+
| `workflowDefinitions` | Persisted [dynamic workflow](https://mastra.ai/docs/workflows/dynamic-workflows) definitions (beta). Loaded and live-registered on boot. |
|
|
20
|
+
| `scores` | Evaluation score records from eval runs. |
|
|
21
|
+
| `observability` | Traces and spans used by observability exporters and Studio. |
|
|
22
|
+
| `datasets` | Dataset records, versioned items, and dataset versions used by experiments. |
|
|
23
|
+
| `experiments` | Experiment runs and per-item experiment results. |
|
|
24
|
+
| `agents` | Stored agent definitions and their versions, used by the Mastra Editor. |
|
|
25
|
+
| `promptBlocks` | Stored prompt blocks and their versions, used by the Mastra Editor. |
|
|
26
|
+
| `scorerDefinitions` | Stored scorer definitions, used by the Mastra Editor. |
|
|
27
|
+
| `mcpClients` | Stored MCP client configurations, used by the Mastra Editor. |
|
|
28
|
+
| `mcpServers` | Stored MCP server configurations, used by the Mastra Editor. |
|
|
29
|
+
| `workspaces` | Stored workspace configurations, used by the Mastra Editor. |
|
|
30
|
+
| `skills` | Stored skills and their versions, used by the Mastra Editor. |
|
|
31
|
+
| `favorites` | Per-user favorites on stored entities. |
|
|
32
|
+
| `blobs` | Content-addressable blobs keyed by SHA-256 hash. Stores file contents for skill versioning. |
|
|
33
|
+
| `backgroundTasks` | Background task state: creation, status updates, and cleanup. |
|
|
34
|
+
| `schedules` | Schedules polled by the scheduler to trigger workflow and agent runs. |
|
|
35
|
+
| `channels` | Channel installations and configuration for multi-platform integrations. |
|
|
36
|
+
| `harness` | Harness session records. |
|
|
37
|
+
| `toolProviderConnections` | User-assigned names for tool provider connections. |
|
|
38
|
+
| `notifications` | Notification records. |
|
|
39
|
+
| `threadState` | Durable per-thread state, such as task lists and goals. |
|
|
40
|
+
| `knowledge` | Knowledge graph nodes and records (experimental). |
|
|
24
41
|
|
|
25
42
|
The schema definitions below cover the built-in database-backed tables documented for `memory`, `workflows`, `scores`, and `observability`. Other domains, and non-database adapters, use implementation-specific storage structures.
|
|
26
43
|
|
|
@@ -30,11 +47,11 @@ The schema definitions below cover the built-in database-backed tables documente
|
|
|
30
47
|
|
|
31
48
|
Stores conversation messages and their metadata. Each message belongs to a thread and contains the actual content along with metadata about the sender role and message type.
|
|
32
49
|
|
|
33
|
-
idtextPRIMARYKEYNOT NULLUnique identifier for the
|
|
50
|
+
idtextPRIMARYKEYNOT NULLUnique identifier for the messagethread_idtextFK → threads.idNOT NULLParent thread referenceresourceIdtextCAN BE NULLID of the resource that owns this messagecontenttextNOT NULLJSON of the message content in V2 format. Example: `{ format: 2, parts: [...] }`roletextNOT NULLEnum of `user | assistant`createdAttimestampNOT NULLUsed for thread message ordering
|
|
34
51
|
|
|
35
52
|
The message `content` column contains a JSON object conforming to the `MastraMessageContentV2` type, which is designed to align closely with the AI SDK `UIMessage` message shape.
|
|
36
53
|
|
|
37
|
-
formatintegerNOT NULLMessage format version (currently 2)partsarray (JSON)NOT NULLArray of message parts (text, tool-invocation, file, reasoning, etc.). The structure of items in this array varies by `type`.
|
|
54
|
+
formatintegerNOT NULLMessage format version (currently 2)partsarray (JSON)NOT NULLArray of message parts (text, tool-invocation, file, reasoning, etc.). The structure of items in this array varies by `type`.experimental_attachmentsarray (JSON)CAN BE NULLOptional array of file attachmentscontenttextCAN BE NULLOptional main text content of the messagetoolInvocationsarray (JSON)CAN BE NULLOptional array summarizing tool calls and resultsreasoningobject (JSON)CAN BE NULLOptional information about the reasoning process behind the assistant's responseannotationsobject (JSON)CAN BE NULLOptional additional metadata or annotations
|
|
38
55
|
|
|
39
56
|
**Threads**:
|
|
40
57
|
|
|
@@ -76,7 +93,7 @@ createdAttimestampNOT NULLWhen the resource record was first createdupdatedAttim
|
|
|
76
93
|
|
|
77
94
|
When `suspend()` is called on a workflow, its state is saved in the following format. When `resume()` is called, that state is rehydrated.
|
|
78
95
|
|
|
79
|
-
|
|
96
|
+
workflow_nametextNOT NULLName of the workflowrun_idtextNOT NULLUnique identifier for the workflow execution. Used to track state across suspend/resume cyclessnapshotjsonbNOT NULLWorkflow state as JSON. Example:
|
|
80
97
|
|
|
81
98
|
```json
|
|
82
99
|
{
|
|
@@ -115,7 +132,7 @@ inputtextNOT NULLInput provided to the agentoutputtextNOT NULLOutput generated b
|
|
|
115
132
|
}
|
|
116
133
|
```
|
|
117
134
|
|
|
118
|
-
|
|
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_iduuidv4NOT NULLGroups related evaluation runs (e.g. all unit tests in a CI run)run_iduuidv4NOT NULLUnique identifier for the run being evaluated (format: `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`)created_attimestampNOT NULL
|
|
119
136
|
|
|
120
137
|
**Traces**:
|
|
121
138
|
|
|
@@ -294,7 +294,7 @@ const storage = new MongoDBStore({
|
|
|
294
294
|
|
|
295
295
|
## Reclaiming disk
|
|
296
296
|
|
|
297
|
-
`prune()` deletes rows but doesn't shrink the database file. On SQLite/libSQL the freed pages go on a freelist
|
|
297
|
+
`prune()` deletes rows but doesn't shrink the database file. On SQLite/libSQL the freed pages go on a freelist for reuse by future writes. Reusing these pages prevents unbounded file growth for most users.
|
|
298
298
|
|
|
299
299
|
Handing that free space back to the OS is a separate concern that Mastra doesn't manage. If you specifically need to shrink the file, run the underlying database's compaction (for example `VACUUM` on self-hosted libSQL) yourself in a maintenance window. A full `VACUUM` locks the file and needs roughly twice the file size in free disk. On PostgreSQL, autovacuum reclaims dead tuples for reuse automatically. A manual `VACUUM FULL` is only needed if you must return disk to the OS.
|
|
300
300
|
|
|
@@ -698,6 +698,92 @@ Emitted when the stream is forcibly terminated due to content being blocked by a
|
|
|
698
698
|
|
|
699
699
|
**payload.processorId** (`string`): ID of the processor that triggered the tripwire
|
|
700
700
|
|
|
701
|
+
## Thread subscription chunks
|
|
702
|
+
|
|
703
|
+
### data-user-message-pending
|
|
704
|
+
|
|
705
|
+
A transient user-message projection emitted when a thread accepts a steer or queued follow-up, before the agent consumes it. Subscribers can show the input immediately, then reconcile it with the delivered `data-user-message` chunk by `data.id`.
|
|
706
|
+
|
|
707
|
+
The chunk isn't saved to conversation history. `data.metadata.status` is `pending` for a steer that joins the active run and `queued` for a follow-up that runs afterward.
|
|
708
|
+
|
|
709
|
+
```typescript
|
|
710
|
+
type UserMessagePendingChunk = {
|
|
711
|
+
type: 'data-user-message-pending'
|
|
712
|
+
runId: string
|
|
713
|
+
traceId?: string
|
|
714
|
+
from: ChunkFrom
|
|
715
|
+
metadata?: Record<string, any>
|
|
716
|
+
transient: true
|
|
717
|
+
data: AgentSignalDataPart['data'] & {
|
|
718
|
+
metadata: Record<string, unknown> & {
|
|
719
|
+
status: 'pending' | 'queued'
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
```
|
|
724
|
+
|
|
725
|
+
### data-user-message-cancelled
|
|
726
|
+
|
|
727
|
+
A transient removal event emitted when accepted user input is cancelled before delivery. Subscribers can remove the pending projection whose `data.id` matches the cancelled signal.
|
|
728
|
+
|
|
729
|
+
The chunk is emitted only after the input has been removed, confirming removal rather than a cancellation request. It remains transient and isn't saved to conversation history.
|
|
730
|
+
|
|
731
|
+
```typescript
|
|
732
|
+
type UserMessageCancelledChunk = {
|
|
733
|
+
type: 'data-user-message-cancelled'
|
|
734
|
+
runId: string
|
|
735
|
+
traceId?: string
|
|
736
|
+
from: ChunkFrom
|
|
737
|
+
metadata?: Record<string, any>
|
|
738
|
+
transient: true
|
|
739
|
+
data: {
|
|
740
|
+
id: string
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
### thread-history
|
|
746
|
+
|
|
747
|
+
The stored history of a thread, emitted at the start of a thread subscription.
|
|
748
|
+
|
|
749
|
+
`thread-history` arrives only when you call [`agent.subscribeToThread()`](https://mastra.ai/reference/agents/agent) with `withInitialHistory: true`. It's the first chunk, followed by retained parts newer than the history and then live parts. Without agent memory, or when the thread has no stored messages yet, the chunk is still emitted first with an empty `messages` array and `hasMore: false`.
|
|
750
|
+
|
|
751
|
+
**type** (`"thread-history"`): Chunk type identifier
|
|
752
|
+
|
|
753
|
+
**runId** (`string`): Empty string. The chunk belongs to the subscription rather than an execution run.
|
|
754
|
+
|
|
755
|
+
**traceId** (`string`): Trace ID of the run that produced this chunk. Undefined when tracing is disabled.
|
|
756
|
+
|
|
757
|
+
**from** (`ChunkFrom`): Source of the chunk. Always AGENT for thread history.
|
|
758
|
+
|
|
759
|
+
**metadata** (`Record<string, any>`): Additional chunk metadata.
|
|
760
|
+
|
|
761
|
+
**payload** (`ThreadHistoryPayload`): Stored history for the subscription
|
|
762
|
+
|
|
763
|
+
**payload.messages** (`MastraDBMessage[]`): Stored thread messages, oldest first. Contains the newest perPage messages, where perPage defaults to 40.
|
|
764
|
+
|
|
765
|
+
**payload.hasMore** (`boolean`): Whether older messages exist beyond this page.
|
|
766
|
+
|
|
767
|
+
**payload.activeRunId** (`string | null`): Run holding thread ownership during hydration, or null when idle. Use thread-run-status for the outcome.
|
|
768
|
+
|
|
769
|
+
For queue-count events on the same thread, see the [Thread events reference](https://mastra.ai/reference/signals/thread-events).
|
|
770
|
+
|
|
771
|
+
### thread-run-status
|
|
772
|
+
|
|
773
|
+
`ThreadRunStatusChunk` reports a run's outcome independently of stored-message replay. It's exported from `@mastra/core/stream` and emitted only when `subscribeToThread()` receives `withRunStatus: true`. The option defaults to `false`.
|
|
774
|
+
|
|
775
|
+
Live output precedes its status. `success`, `failed`, and `aborted` are final outcomes. `suspended` is resumable, so the same run can later emit more output and a final outcome. A status doesn't close the subscription.
|
|
776
|
+
|
|
777
|
+
**type** (`"thread-run-status"`): Chunk type identifier.
|
|
778
|
+
|
|
779
|
+
**runId** (`string`): ID of the run whose outcome is reported.
|
|
780
|
+
|
|
781
|
+
**from** (`ChunkFrom`): Always AGENT for thread run outcomes.
|
|
782
|
+
|
|
783
|
+
**payload** (`{ status: "success" | "failed" | "aborted" | "suspended" }`): Run outcome. Suspended runs can resume.
|
|
784
|
+
|
|
785
|
+
With `withInitialHistory`, `thread-history` arrives first. Opted-in late subscribers then receive one outcome per still-retained finished run, including runs outside that history page. Final outcomes are deduplicated within a subscription. Suspensions are deduplicated per execution segment. Reconnecting can redeliver outcomes. Recovery depends on PubSub retention and isn't a permanent audit log. See [Thread streams](https://mastra.ai/docs/signals/thread-streams).
|
|
786
|
+
|
|
701
787
|
## Usage example
|
|
702
788
|
|
|
703
789
|
```typescript
|
|
@@ -75,15 +75,15 @@ These properties resolve to final values after the stream completes:
|
|
|
75
75
|
|
|
76
76
|
**usage.cachedInputTokens** (`number`): Number of input tokens that were a cache hit
|
|
77
77
|
|
|
78
|
-
**finishReason** (`Promise<string | undefined>`): Reason why generation stopped (e.g., 'stop', 'length', '
|
|
78
|
+
**finishReason** (`Promise<string | undefined>`): Reason why generation stopped (e.g., 'stop', 'length', 'tool_calls', 'content_filter'). Undefined if the stream hasn't finished.
|
|
79
79
|
|
|
80
80
|
**finishReason.stop** (`'stop'`): Model finished naturally
|
|
81
81
|
|
|
82
82
|
**finishReason.length** (`'length'`): Hit maximum token limit
|
|
83
83
|
|
|
84
|
-
**finishReason.
|
|
84
|
+
**finishReason.tool_calls** (`'tool_calls'`): Model called tools
|
|
85
85
|
|
|
86
|
-
**finishReason.
|
|
86
|
+
**finishReason.content_filter** (`'content_filter'`): Content was filtered
|
|
87
87
|
|
|
88
88
|
**response** (`Promise<Response>`): Response metadata and messages from the model provider.
|
|
89
89
|
|
|
@@ -122,7 +122,7 @@ const stream = await agent.stream('message for agent')
|
|
|
122
122
|
|
|
123
123
|
**options.output** (`Zod schema | JsonSchema7`): \*\*Deprecated.\*\* Use structuredOutput without a model to achieve the same thing. Defines the expected structure of the output. Can be a JSON Schema object or a Zod schema.
|
|
124
124
|
|
|
125
|
-
**options.scopes** (`string[]`): Scopes the run acts as, written as \<type>:\<value> (for example org:acme, resource:user-123, thread:conversation-123). Memory reads its resource and thread from resource: and thread: scopes. Other scopes are passed to tools and processors. Combined with the agent's scopes and the
|
|
125
|
+
**options.scopes** (`string[]`): Scopes the run acts as, written as \<type>:\<value> (for example org:acme, resource:user-123, thread:conversation-123). Memory reads its resource and thread from resource: and thread: scopes. Other scopes are passed to tools and processors. Combined with the agent's scopes and the mastra__scopes request context key. Throws if a resource: or thread: scope conflicts with another resource or thread value.
|
|
126
126
|
|
|
127
127
|
**options.memory** (`object`): Configuration for memory. This is the preferred way to manage memory.
|
|
128
128
|
|
|
@@ -192,7 +192,7 @@ const stream = await agent.stream('message for agent')
|
|
|
192
192
|
|
|
193
193
|
**options.toolCallConcurrency** (`number`): Maximum number of tool calls to execute concurrently. Defaults to 1 when approval may be required, otherwise 10.
|
|
194
194
|
|
|
195
|
-
**options.eagerToolExecution** (`boolean`): Defaults to true. A tool call whose arguments have finished streaming starts executing immediately, instead of waiting for the model to finish the whole step. Set it to false to restore the previous scheduling. Tool results and message history keep their model-call order either way. Only server-side tools are started early: approval-gated, suspend-schema-declaring, provider-executed, client-side, background-dispatched (by argument or by backgroundTasks config), missing and inactive tools are left to the post-stream pass, as is any run using autoResumeSuspendedTools or an output processor that runs after the stream completes. That last case is wider than it sounds: a processor workflow you build yourself counts whatever it contains, because its contents are not inspected, and so does structuredOutput when given an explicit model. A processor implementing processToolResult is excluded too when a provider-executed tool is configured: that hook runs inside the stream when a provider result arrives there, and its abort bails the turn before the post-stream pass, so starting a tool early would change whether it runs, not just when. Without a provider tool, the hook only sees results after the pass and early dispatch stays on. Also left to the post-stream pass is any run using toolCallConcurrency.strategy: 'called' (the full set of called tools is not known until the step finishes). Eager executions honour the same toolCallConcurrency limit (they are counted separately from the post-stream pass, so the limit constrains each rather than being pooled across both)
|
|
195
|
+
**options.eagerToolExecution** (`boolean`): Defaults to true. A tool call whose arguments have finished streaming starts executing immediately, instead of waiting for the model to finish the whole step. Set it to false to restore the previous scheduling. Tool results and message history keep their model-call order either way. Only server-side tools are started early: approval-gated, suspend-schema-declaring, provider-executed, client-side, background-dispatched (by argument or by backgroundTasks config), missing and inactive tools are left to the post-stream pass, as is any run using autoResumeSuspendedTools or an output processor that runs after the stream completes. That last case is wider than it sounds: a processor workflow you build yourself counts whatever it contains, because its contents are not inspected, and so does structuredOutput when given an explicit model. A processor implementing processToolResult is excluded too when a provider-executed tool is configured: that hook runs inside the stream when a provider result arrives there, and its abort bails the turn before the post-stream pass, so starting a tool early would change whether it runs, not just when. Without a provider tool, the hook only sees results after the pass and early dispatch stays on. Also left to the post-stream pass is any run using toolCallConcurrency.strategy: 'called' (the full set of called tools is not known until the step finishes). Eager executions honour the same toolCallConcurrency limit (they are counted separately from the post-stream pass, so the limit constrains each rather than being pooled across both). Aborting the run gives running tool executions a 250 ms grace period to settle and keeps successful results completed within that window. Canceled tool calls emit a tool-result chunk carrying a cancellation notice and record it in conversation history, so the next turn knows the tool started and its effects are unknown. Check the tool's status before retrying. Later results or errors are ignored. The grace period bounds the wait for tool cleanup, not the overall run deadline. For in-process agents, the remaining modelSettings.timeout.totalMs budget can expire first, producing MastraTimeoutError instead of the cancellation notice. This timeout precedence has not been verified for durable agents. This does not forcibly stop tool code or an already-running onOutput hook. Already-started tool code and external side effects may continue after cancellation. If the last model fails mid-stream with no retry, its calls still run through the post-stream pass, which adopts eager work instead of restarting it. Unless the caller cancels the run, retry and fallback allow running tools to finish and write every started call's result or error into the conversation before the replacement attempt begins, even if the retry never runs. A tool that calls suspend() at runtime without declaring a suspend schema cannot be detected in advance; the early attempt hands its suspension back to that call's own post-stream iteration, which raises the real suspension with the tool's own payload, so the tool body runs exactly once — the same as it would without early execution. Because that pre-suspend work already happened, an attempt holding such a call is never retried or failed over: the run suspends on that call instead, so resuming it is the only way the tool runs again. Not supported by durable agents, which reject an explicit true.
|
|
196
196
|
|
|
197
197
|
**options.providerOptions** (`Record<string, Record<string, JSONValue>>`): Additional provider-specific options that are passed through to the underlying LLM provider. The structure is { providerName: { optionKey: value } }. For example: { openai: { reasoningEffort: 'high' }, anthropic: { maxTokens: 1000 } }.
|
|
198
198
|
|
|
@@ -250,7 +250,7 @@ const stream = await agent.stream('message for agent')
|
|
|
250
250
|
|
|
251
251
|
## `stopWhen` errors
|
|
252
252
|
|
|
253
|
-
If a `stopWhen` predicate throws, `fullStream` rejects with that error
|
|
253
|
+
If a `stopWhen` predicate throws, `fullStream` rejects with that error without emitting a `step-finish`, `finish`, or `error` chunk for the failure. Catch the rejection around stream consumption:
|
|
254
254
|
|
|
255
255
|
```ts
|
|
256
256
|
async function consumeStream() {
|
|
@@ -264,7 +264,7 @@ async function consumeStream() {
|
|
|
264
264
|
}
|
|
265
265
|
```
|
|
266
266
|
|
|
267
|
-
Durable transports reconstruct cross-process errors from their serialized name and message. The original stack, cause, and subclass identity
|
|
267
|
+
Durable transports reconstruct cross-process errors from their serialized name and message. The original stack, cause, and subclass identity aren't available to the stream consumer.
|
|
268
268
|
|
|
269
269
|
## Signal visibility
|
|
270
270
|
|
|
@@ -282,7 +282,7 @@ for await (const chunk of stream.fullStream) {
|
|
|
282
282
|
|
|
283
283
|
Set `hideSignals: true` to hide all recognized signal types, or `hideSignals: false` to show all signals. An array selects individual types.
|
|
284
284
|
|
|
285
|
-
The array accepts `user`, `state`, `reactive`, `notification`, and the legacy aliases `user-message` and `system-reminder`. An omitted option, `false`, or `[]` excludes nothing. Streaming normalizes `system-reminder` to `reactive` and `user-message` to `user`, then matches the encoded signal type in `data-signal` or `data-user-message` chunks. Unknown or malformed signal chunks pass through, as do text, errors, and completion events.
|
|
285
|
+
The array accepts `user`, `state`, `reactive`, `notification`, and the legacy aliases `user-message` and `system-reminder`. An omitted option, `false`, or `[]` excludes nothing. Streaming normalizes `system-reminder` to `reactive` and `user-message` to `user`, then matches the encoded signal type in `data-signal`, `data-user-message`, or `data-user-message-pending` chunks. Unknown or malformed signal chunks pass through, as do text, errors, and completion events.
|
|
286
286
|
|
|
287
287
|
Exclusions apply after `experimentalTransform`, so transforms still receive the unfiltered input. Adapters consuming `fullStream` inherit the filter, but aggregate `content`, `getFullOutput()`, response messages, callbacks, model context, and saved messages remain unchanged.
|
|
288
288
|
|
|
@@ -419,7 +419,7 @@ await agent.stream('message for agent', {
|
|
|
419
419
|
sentiment: z.enum(['positive', 'negative', 'neutral']),
|
|
420
420
|
confidence: z.number(),
|
|
421
421
|
}),
|
|
422
|
-
model: 'openai/gpt-
|
|
422
|
+
model: 'openai/gpt-6.1-sol',
|
|
423
423
|
errorStrategy: 'warn',
|
|
424
424
|
},
|
|
425
425
|
// Output processors for streaming response validation
|
|
@@ -24,7 +24,7 @@ await agent.streamLegacy('message for agent')
|
|
|
24
24
|
|
|
25
25
|
**options.context** (`CoreMessage[]`): Additional context messages to provide to the agent.
|
|
26
26
|
|
|
27
|
-
**options.
|
|
27
|
+
**options.experimental_output** (`Zod schema | JsonSchema7`): Enables structured output generation alongside text generation and tool calls. The model will generate responses that conform to the provided schema.
|
|
28
28
|
|
|
29
29
|
**options.instructions** (`string`): Custom instructions that override the agent's default instructions for this specific generation. Useful for dynamically modifying agent behavior without creating a new agent instance.
|
|
30
30
|
|
|
@@ -54,7 +54,7 @@ await agent.streamLegacy('message for agent')
|
|
|
54
54
|
|
|
55
55
|
**options.onFinish** (`StreamTextOnFinishCallback<any> | StreamObjectOnFinishCallback<OUTPUT>`): Callback function called when streaming completes. Receives the final result.
|
|
56
56
|
|
|
57
|
-
**options.onStepFinish** (`StreamTextOnStepFinishCallback<any> | never`): Callback function called after each execution step. Receives step
|
|
57
|
+
**options.onStepFinish** (`StreamTextOnStepFinishCallback<any> | never`): Callback function called after each execution step. Receives the step result (text, tool calls, tool results, usage, finish reason) plus the runId. Unavailable for structured output
|
|
58
58
|
|
|
59
59
|
**options.resourceId** (`string`): \*\*Deprecated.\*\* Use memory.resource instead. Identifier for the user or resource interacting with the agent. Must be provided if threadId is provided.
|
|
60
60
|
|
|
@@ -60,7 +60,7 @@ if (result!.status === 'suspended') {
|
|
|
60
60
|
|
|
61
61
|
**stream.status** (`Promise<RunStatus>`): A promise that resolves to the current workflow run status
|
|
62
62
|
|
|
63
|
-
**stream.result** (`Promise<WorkflowResult<TState, TOutput, TSteps>>`): A promise that resolves to the final workflow result
|
|
63
|
+
**stream.result** (`Promise<WorkflowResult<TState, TInput, TOutput, TSteps>>`): A promise that resolves to the final workflow result
|
|
64
64
|
|
|
65
65
|
**stream.usage** (`Promise<{ inputTokens: number; outputTokens: number; totalTokens: number, reasoningTokens?: number, cacheInputTokens?: number }>`): A promise that resolves to token usage statistics
|
|
66
66
|
|
|
@@ -60,7 +60,7 @@ The model calls this tool with the following parameters:
|
|
|
60
60
|
|
|
61
61
|
**options.description** (`string`): Explanation of what this option means.
|
|
62
62
|
|
|
63
|
-
**selectionMode** (`'single_select' | 'multi_select'`): Controls how many options the user can select. Defaults to '
|
|
63
|
+
**selectionMode** (`'single_select' | 'multi_select'`): Controls how many options the user can select. Defaults to 'single_select' when options are provided. Requires options.
|
|
64
64
|
|
|
65
65
|
## Suspend payload
|
|
66
66
|
|
|
@@ -41,11 +41,11 @@ const agent = new Agent({
|
|
|
41
41
|
|
|
42
42
|
**knowledgeBaseId** (`string`): The ID of the Amazon Bedrock Knowledge Base to query.
|
|
43
43
|
|
|
44
|
-
**region** (`string`): AWS region where the Knowledge Base is deployed. Defaults to
|
|
44
|
+
**region** (`string`): AWS region where the Knowledge Base is deployed. Defaults to AWS_REGION environment variable or us-east-1.
|
|
45
45
|
|
|
46
46
|
**numberOfResults** (`number`): Maximum number of results to return. Defaults to 5.
|
|
47
47
|
|
|
48
|
-
**useAgenticRetrieval** (`boolean`): Use AgenticRetrieveStream for complex queries with query decomposition and managed reranking. Falls back to standard Retrieve on failure. Defaults to true (disable with
|
|
48
|
+
**useAgenticRetrieval** (`boolean`): Use AgenticRetrieveStream for complex queries with query decomposition and managed reranking. Falls back to standard Retrieve on failure. Defaults to true (disable with USE_AGENTIC_RETRIEVAL=false env var).
|
|
49
49
|
|
|
50
50
|
**userId** (`string`): Default AWS user ID for document-level access control. A userId in the Mastra request context takes precedence.
|
|
51
51
|
|
|
@@ -47,7 +47,7 @@ export const shopAgent = new Agent({
|
|
|
47
47
|
id: 'shop-assistant',
|
|
48
48
|
name: 'shop-assistant',
|
|
49
49
|
instructions: ['You are a helpful shopping assistant.', instructions],
|
|
50
|
-
model: 'openai/gpt-
|
|
50
|
+
model: 'openai/gpt-6.1-sol',
|
|
51
51
|
tools: { execute_typescript: tool },
|
|
52
52
|
})
|
|
53
53
|
```
|
|
@@ -70,7 +70,7 @@ export const shopAgent = new Agent({
|
|
|
70
70
|
|
|
71
71
|
Returns a `CodeModeResult` object.
|
|
72
72
|
|
|
73
|
-
**tool** (`Tool<any, any>`): The generated code mode tool. By default, its id is
|
|
73
|
+
**tool** (`Tool<any, any>`): The generated code mode tool. By default, its id is execute_typescript.
|
|
74
74
|
|
|
75
75
|
**instructions** (`string`): Generated model instructions with typed external\_\* declarations for the configured tools.
|
|
76
76
|
|
|
@@ -35,6 +35,21 @@ export const weatherTool = createTool({
|
|
|
35
35
|
|
|
36
36
|
The first `execute` parameter is the validated value from `inputSchema`. Destructure schema fields directly in the function signature, as shown with `{ location }`. The optional second parameter contains the execution context.
|
|
37
37
|
|
|
38
|
+
### Display-only tools
|
|
39
|
+
|
|
40
|
+
For a tool that only asks the client to display something, set `renderOnly: true` instead of defining `execute`:
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
const showCard = createTool({
|
|
44
|
+
id: 'show-card',
|
|
45
|
+
description: 'Display a product card',
|
|
46
|
+
inputSchema: z.object({ productId: z.string() }),
|
|
47
|
+
renderOnly: true,
|
|
48
|
+
})
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Mastra streams the tool call and returns `{ acknowledged: true }` as its result, allowing the agent to continue generating text without a client round trip. This also works for tools owned by sub-agents. Their calls appear as nested `tool-output` stream events. Don't set an incompatible `outputSchema` on a render-only tool. The acknowledgement means the call was emitted, **not** that the browser rendered it. Don't use this for client actions whose outcome matters to the agent. For those, omit `execute` and return the result from the client, or use a suspending server tool when a sub-agent needs user input.
|
|
52
|
+
|
|
38
53
|
## Parameters
|
|
39
54
|
|
|
40
55
|
**id** (`string`): A unique identifier for the tool.
|
|
@@ -47,6 +62,8 @@ The first `execute` parameter is the validated value from `inputSchema`. Destruc
|
|
|
47
62
|
|
|
48
63
|
**outputSchema** (`StandardJSONSchemaV1`): A Standard JSON Schema defining the expected output structure of the tool's execute function.
|
|
49
64
|
|
|
65
|
+
**renderOnly** (`boolean`): When true, streams a display-only tool call and automatically returns { acknowledged: true } to the model so it can continue. Cannot be used with execute. The acknowledgement does not confirm that the client rendered the call.
|
|
66
|
+
|
|
50
67
|
**strict** (`boolean`): When true, Mastra enables strict tool input generation on model adapters that support it. This helps supported providers return arguments that match the tool schema more closely.
|
|
51
68
|
|
|
52
69
|
**outputValidation** (`'strict' | 'warn'`): How a result that fails outputSchema validation is handled. Both modes log a warning. 'strict' replaces the result with a validation error object. 'warn' returns the tool's actual result unchanged, for tools whose side effects have already happened. (Default: `'strict'`)
|
|
@@ -215,7 +232,7 @@ export const weatherTool = createTool({
|
|
|
215
232
|
})
|
|
216
233
|
```
|
|
217
234
|
|
|
218
|
-
Mastra forwards `strict: true` to model adapters that support strict tool calling
|
|
235
|
+
Mastra forwards `strict: true` to model adapters that support strict tool calling and ignores the option for other adapters.
|
|
219
236
|
|
|
220
237
|
## Example with `toModelOutput`
|
|
221
238
|
|
|
@@ -473,7 +490,7 @@ Client-executed tools don't define an `execute` function. The browser runs the t
|
|
|
473
490
|
|
|
474
491
|
For client-executed results, the follow-up request must include both the assistant tool call and the tool result, which `@mastra/client-js` sends automatically. A request that carries only the tool result doesn't fire the hook. In this case the callback receives `{ toolCallId, toolName, output, abortSignal }` only.
|
|
475
492
|
|
|
476
|
-
|
|
493
|
+
At-least-once delivery means a retried request runs the hook again. Keep the hook idempotent and treat client output as untrusted data: the server doesn't validate the result against `outputSchema`, so the `output` type is a static type only.
|
|
477
494
|
|
|
478
495
|
### Hook execution order
|
|
479
496
|
|
|
@@ -37,7 +37,7 @@ const { chunks } = await chunker.execute()
|
|
|
37
37
|
|
|
38
38
|
### `ChunkParams`
|
|
39
39
|
|
|
40
|
-
**strategy** (`'recursive'`): The chunking strategy to use (Default: `'recursive'`)
|
|
40
|
+
**strategy** (`'character' | 'recursive' | 'token' | 'markdown' | 'html' | 'json' | 'latex' | 'sentence' | 'semantic-markdown'`): The chunking strategy to use (Default: `'recursive'`)
|
|
41
41
|
|
|
42
42
|
**maxSize** (`number`): Maximum size of each chunk in tokens/characters (Default: `512`)
|
|
43
43
|
|