@mastra/mcp-docs-server 1.3.9-alpha.9 → 1.3.10-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/docs/agents/code-mode.md +2 -2
- package/.docs/docs/agents/guardrails.md +5 -2
- package/.docs/docs/agents/human-in-the-loop.md +18 -5
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/overview.md +8 -7
- package/.docs/docs/agents/processors.md +72 -21
- package/.docs/docs/agents/structured-output.md +6 -6
- package/.docs/docs/agents/tools.md +10 -10
- package/.docs/docs/auth/composite-auth.md +4 -2
- package/.docs/docs/auth/custom-auth-provider.md +1 -1
- package/.docs/docs/auth/overview.md +3 -1
- package/.docs/docs/browser.md +13 -1
- package/.docs/docs/channels.md +33 -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 +26 -15
- package/.docs/docs/develop.md +1 -1
- package/.docs/docs/evals/custom-scorers.md +5 -5
- package/.docs/docs/evals/experiments.md +29 -4
- package/.docs/docs/evals/multi-turn.md +2 -2
- package/.docs/docs/evals/overview.md +4 -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 +4 -4
- package/.docs/docs/guides/streaming.md +1 -1
- package/.docs/docs/harness/agent-controller.md +18 -21
- package/.docs/docs/harness/background-tasks.md +14 -3
- package/.docs/docs/harness/durable-agents.md +15 -9
- package/.docs/docs/harness/goals.md +5 -5
- package/.docs/docs/harness/overview.md +2 -2
- package/.docs/docs/harness/schedules.md +13 -11
- package/.docs/docs/index.md +7 -6
- package/.docs/docs/mastra-platform/connect/channels.md +1 -1
- package/.docs/docs/mastra-platform/connect/tools.md +4 -4
- package/.docs/docs/mastra-platform/environments.md +1 -1
- package/.docs/docs/mastra-platform/observability.md +1 -1
- package/.docs/docs/mastra-platform/server.md +1 -1
- package/.docs/docs/mastra-platform/studio.md +1 -1
- package/.docs/docs/memory/memory-processors.md +21 -15
- package/.docs/docs/memory/message-history.md +5 -5
- package/.docs/docs/memory/multi-user-threads.md +1 -1
- package/.docs/docs/memory/observational-memory.md +14 -14
- package/.docs/docs/memory/semantic-recall.md +22 -2
- package/.docs/docs/memory/working-memory.md +3 -3
- package/.docs/docs/observability/logging.md +5 -5
- package/.docs/docs/observability/tracing/overview.md +1 -0
- package/.docs/docs/sandbox/filesystem.md +26 -11
- package/.docs/docs/sandbox/overview.md +1 -1
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/middleware.md +1 -1
- package/.docs/docs/server/overview.md +27 -0
- package/.docs/docs/server/request-context.md +3 -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 +94 -0
- package/.docs/docs/skills.md +4 -4
- package/.docs/docs/storage.md +1 -1
- package/.docs/docs/studio/auth.md +2 -2
- package/.docs/docs/studio/editor.md +39 -23
- package/.docs/docs/studio/observability.md +5 -1
- package/.docs/docs/subagents.md +6 -6
- package/.docs/docs/workflows/control-flow.md +14 -14
- package/.docs/docs/workflows/error-handling.md +1 -1
- package/.docs/integrations/agentic-ui/ai-sdk-ui.md +1 -1
- package/.docs/integrations/agentic-ui/copilotkit.md +1 -1
- package/.docs/integrations/agentic-ui/openui.md +1 -1
- 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 +1 -1
- package/.docs/integrations/databases/cloudflare-kv.md +4 -0
- 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 +1 -1
- package/.docs/integrations/databases/redis.md +1 -1
- package/.docs/integrations/databases/upstash.md +1 -1
- package/.docs/integrations/deploy/aws-bedrock-agentcore.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 +1 -1
- 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 +1 -1
- 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/langfuse.md +1 -1
- package/.docs/integrations/observability/langsmith.md +2 -2
- package/.docs/integrations/observability/opentelemetry.md +5 -5
- package/.docs/integrations/sandboxes/apple-container.md +1 -1
- package/.docs/integrations/sandboxes/blaxel.md +1 -1
- package/.docs/integrations/sandboxes/daytona.md +1 -1
- package/.docs/integrations/sandboxes/docker.md +1 -1
- package/.docs/integrations/sandboxes/e2b-desktop.md +1 -1
- package/.docs/integrations/sandboxes/e2b.md +6 -2
- package/.docs/integrations/sandboxes/modal.md +1 -1
- package/.docs/integrations/sandboxes/railway.md +1 -1
- package/.docs/integrations/sandboxes/sprites.md +1 -1
- package/.docs/integrations/sandboxes/vercel.md +2 -2
- package/.docs/integrations/tools/brightdata.md +1 -1
- package/.docs/integrations/tools/firecrawl.md +1 -1
- package/.docs/integrations/tools/parallel.md +1 -1
- package/.docs/integrations/tools/perplexity.md +1 -1
- package/.docs/integrations/tools/tavily.md +1 -1
- package/.docs/integrations/voice/livekit.md +2 -2
- package/.docs/integrations.md +1 -0
- package/.docs/models/embeddings.md +2 -1
- package/.docs/models/environment-variables.md +1 -3
- package/.docs/models/gateways/custom-gateways.md +3 -3
- package/.docs/models/gateways/merge-gateway.md +7 -13
- package/.docs/models/gateways/netlify.md +2 -1
- package/.docs/models/gateways/openrouter.md +3 -2
- package/.docs/models/gateways/vercel.md +8 -5
- package/.docs/models/index.md +14 -16
- package/.docs/models/providers/302ai.md +3 -3
- package/.docs/models/providers/abacus.md +70 -110
- package/.docs/models/providers/aimlapi.md +171 -171
- package/.docs/models/providers/aixy.md +3 -1
- package/.docs/models/providers/aki-io.md +5 -6
- package/.docs/models/providers/alibaba-cn.md +9 -57
- package/.docs/models/providers/alibaba-coding-plan-cn.md +8 -12
- package/.docs/models/providers/alibaba-coding-plan.md +8 -12
- package/.docs/models/providers/alibaba-token-plan-cn.md +0 -2
- package/.docs/models/providers/alibaba-token-plan.md +29 -30
- package/.docs/models/providers/alibaba.md +33 -62
- package/.docs/models/providers/ambient.md +1 -9
- package/.docs/models/providers/amd.md +13 -9
- package/.docs/models/providers/anthropic.md +4 -2
- package/.docs/models/providers/arcee.md +6 -4
- package/.docs/models/providers/auriko.md +2 -2
- package/.docs/models/providers/baseten.md +4 -14
- package/.docs/models/providers/berget.md +3 -4
- package/.docs/models/providers/bothub.md +4 -4
- package/.docs/models/providers/boundless.md +0 -4
- package/.docs/models/providers/cline-pass.md +2 -8
- package/.docs/models/providers/cloudflare-workers-ai.md +1 -1
- package/.docs/models/providers/commandcode.md +0 -1
- package/.docs/models/providers/coralbricks.md +1 -1
- package/.docs/models/providers/cortecs.md +1 -1
- package/.docs/models/providers/crossmodel.md +69 -73
- package/.docs/models/providers/crusoe.md +1 -7
- package/.docs/models/providers/daoxe.md +1 -1
- package/.docs/models/providers/databricks.md +5 -10
- package/.docs/models/providers/deepinfra.md +2 -2
- package/.docs/models/providers/digitalocean.md +8 -24
- package/.docs/models/providers/dinference.md +0 -3
- package/.docs/models/providers/edenai.md +29 -5
- package/.docs/models/providers/empiriolabs.md +1 -8
- package/.docs/models/providers/engy.md +2 -2
- package/.docs/models/providers/evroc.md +2 -2
- package/.docs/models/providers/fastrouter.md +41 -50
- package/.docs/models/providers/fireworks-ai.md +6 -5
- package/.docs/models/providers/friendli.md +4 -5
- package/.docs/models/providers/frogbot.md +2 -7
- package/.docs/models/providers/google.md +5 -5
- package/.docs/models/providers/greenpt.md +14 -20
- package/.docs/models/providers/groq.md +3 -8
- package/.docs/models/providers/huggingface.md +5 -6
- package/.docs/models/providers/iflowcn.md +2 -18
- package/.docs/models/providers/impossibl.md +2 -9
- package/.docs/models/providers/inception.md +3 -2
- package/.docs/models/providers/inceptron.md +8 -6
- package/.docs/models/providers/inco.md +1 -1
- package/.docs/models/providers/inference.md +5 -11
- package/.docs/models/providers/infomaniak.md +10 -12
- package/.docs/models/providers/io-net.md +11 -17
- package/.docs/models/providers/iteracompute.md +5 -5
- package/.docs/models/providers/jalapeno.md +14 -19
- package/.docs/models/providers/jiekou.md +53 -63
- package/.docs/models/providers/kenari.md +35 -54
- package/.docs/models/providers/kilo.md +19 -33
- package/.docs/models/providers/lilac.md +2 -8
- package/.docs/models/providers/liquid.md +77 -0
- package/.docs/models/providers/llama.md +2 -11
- package/.docs/models/providers/llmgateway-providers.md +10 -27
- package/.docs/models/providers/llmgateway.md +12 -21
- package/.docs/models/providers/llmtr.md +1 -6
- package/.docs/models/providers/longcat.md +6 -5
- package/.docs/models/providers/lowrouter.md +1 -1
- package/.docs/models/providers/lucidquery.md +2 -2
- package/.docs/models/providers/meganova.md +6 -7
- package/.docs/models/providers/melious.md +11 -15
- package/.docs/models/providers/minimax-cn-coding-plan.md +4 -11
- package/.docs/models/providers/minimax-cn.md +4 -10
- package/.docs/models/providers/minimax-coding-plan.md +4 -11
- package/.docs/models/providers/minimax.md +4 -10
- package/.docs/models/providers/mistral.md +7 -6
- package/.docs/models/providers/moark.md +0 -2
- package/.docs/models/providers/modal.md +11 -7
- package/.docs/models/providers/moonshotai-cn.md +2 -2
- package/.docs/models/providers/nan.md +1 -1
- package/.docs/models/providers/nano-gpt.md +28 -31
- package/.docs/models/providers/nearai.md +3 -2
- package/.docs/models/providers/neuralwatt.md +1 -4
- package/.docs/models/providers/novita-ai.md +2 -1
- package/.docs/models/providers/nvidia.md +15 -35
- package/.docs/models/providers/oci.md +0 -1
- package/.docs/models/providers/ofox.md +149 -157
- package/.docs/models/providers/ollama-cloud.md +7 -12
- package/.docs/models/providers/openai.md +4 -2
- package/.docs/models/providers/opencode-go.md +2 -3
- package/.docs/models/providers/opencode.md +85 -87
- package/.docs/models/providers/opper.md +1 -4
- package/.docs/models/providers/orcarouter.md +14 -16
- package/.docs/models/providers/pareto.md +1 -1
- package/.docs/models/providers/perplexity-agent.md +43 -29
- package/.docs/models/providers/perplexity.md +2 -8
- package/.docs/models/providers/pioneer.md +13 -118
- package/.docs/models/providers/poe.md +16 -70
- package/.docs/models/providers/prime.md +2 -1
- package/.docs/models/providers/qihang-ai.md +7 -11
- package/.docs/models/providers/qiniu-ai.md +9 -94
- package/.docs/models/providers/regolo-ai.md +5 -7
- package/.docs/models/providers/requesty.md +0 -4
- package/.docs/models/providers/runinfra.md +3 -5
- package/.docs/models/providers/sarvam.md +1 -2
- package/.docs/models/providers/scaleway.md +12 -13
- package/.docs/models/providers/siliconflow-cn.md +35 -41
- package/.docs/models/providers/siliconflow.md +3 -6
- package/.docs/models/providers/snowflake-cortex.md +22 -22
- package/.docs/models/providers/stackit.md +2 -4
- package/.docs/models/providers/stepfun-ai.md +5 -7
- package/.docs/models/providers/stepfun.md +8 -10
- package/.docs/models/providers/submodel.md +1 -1
- package/.docs/models/providers/synthetic.md +2 -5
- package/.docs/models/providers/tempr.md +1 -4
- package/.docs/models/providers/tencent-coding-plan.md +3 -10
- package/.docs/models/providers/tensorx.md +0 -13
- package/.docs/models/providers/the-grid-ai.md +2 -1
- package/.docs/models/providers/thinkingmachines.md +45 -9
- package/.docs/models/providers/togetherai.md +17 -23
- package/.docs/models/providers/tokengo.md +1 -1
- package/.docs/models/providers/umans-ai-coding-plan.md +12 -11
- package/.docs/models/providers/umans-ai.md +11 -10
- package/.docs/models/providers/unorouter.md +0 -13
- package/.docs/models/providers/vancine.md +0 -1
- package/.docs/models/providers/vivgrid.md +3 -3
- package/.docs/models/providers/volcengine-coding-plan.md +8 -12
- package/.docs/models/providers/volcengine.md +12 -18
- package/.docs/models/providers/vultr.md +0 -2
- package/.docs/models/providers/wafer.ai.md +3 -7
- package/.docs/models/providers/wandb.md +1 -1
- package/.docs/models/providers/xai.md +21 -4
- package/.docs/models/providers/xiaomi-token-plan-ams.md +4 -5
- package/.docs/models/providers/xiaomi-token-plan-cn.md +4 -5
- package/.docs/models/providers/xiaomi-token-plan-sgp.md +4 -5
- package/.docs/models/providers/xiaomi.md +4 -4
- package/.docs/models/providers/xpersona.md +0 -1
- package/.docs/models/providers/zai-coding-plan.md +0 -4
- package/.docs/models/providers/zenmux.md +105 -125
- package/.docs/models/providers/zhipuai-coding-plan.md +0 -1
- package/.docs/models/providers/zhipuai.md +12 -12
- package/.docs/models/providers.md +1 -3
- package/.docs/reference/acp/acp-agent.md +4 -4
- package/.docs/reference/acp/create-acp-tool.md +1 -1
- package/.docs/reference/agent-controller/agent-controller-class.md +18 -23
- package/.docs/reference/agent-controller/session.md +8 -8
- package/.docs/reference/agents/agent.md +22 -46
- package/.docs/reference/agents/channels.md +17 -9
- package/.docs/reference/agents/durable-agent.md +14 -10
- package/.docs/reference/agents/generate.md +57 -3
- package/.docs/reference/agents/generateLegacy.md +2 -2
- package/.docs/reference/agents/getLLM.md +2 -2
- package/.docs/reference/agents/getMetadata.md +2 -2
- package/.docs/reference/agents/getSkill.md +1 -1
- package/.docs/reference/agents/inngest-agent.md +1 -1
- package/.docs/reference/agents/listSkills.md +1 -4
- package/.docs/reference/agents/network.md +1 -1
- package/.docs/reference/browser/agent-browser.md +1 -1
- package/.docs/reference/browser/browser-viewer.md +1 -1
- package/.docs/reference/browser/firecrawl-browser.md +1 -1
- package/.docs/reference/browser/mastra-browser.md +2 -2
- package/.docs/reference/browser/stagehand-browser.md +4 -4
- package/.docs/reference/channels/slack-provider.md +3 -0
- package/.docs/reference/cli/mastra.md +26 -0
- package/.docs/reference/client-js/agent-controller.md +14 -4
- package/.docs/reference/client-js/agents.md +21 -1
- package/.docs/reference/client-js/mastra-client.md +1 -1
- package/.docs/reference/client-js/observability.md +29 -4
- package/.docs/reference/coding-agent/build-base-prompt.md +1 -1
- package/.docs/reference/coding-agent/create-coding-agent.md +8 -8
- package/.docs/reference/configuration.md +33 -3
- package/.docs/reference/connect/tools.md +2 -2
- package/.docs/reference/core/getAgentById.md +1 -1
- package/.docs/reference/core/mastra-class.md +2 -2
- package/.docs/reference/core/mastra-model-gateway.md +34 -5
- package/.docs/reference/datasets/delete.md +6 -0
- package/.docs/reference/editor/mastra-editor.md +11 -9
- package/.docs/reference/editor/tool-provider.md +2 -2
- package/.docs/reference/evals/answer-relevancy.md +1 -1
- package/.docs/reference/evals/answer-similarity.md +1 -1
- package/.docs/reference/evals/bias.md +1 -1
- package/.docs/reference/evals/checks.md +1 -1
- 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/create-classifier-scorer.md +6 -2
- package/.docs/reference/evals/faithfulness.md +1 -1
- package/.docs/reference/evals/hallucination.md +5 -5
- package/.docs/reference/evals/multi-turn-judge.md +2 -2
- package/.docs/reference/evals/noise-sensitivity.md +12 -12
- package/.docs/reference/evals/not-scorable.md +1 -1
- package/.docs/reference/evals/prompt-alignment.md +16 -16
- package/.docs/reference/evals/rubric.md +5 -5
- package/.docs/reference/evals/summarization.md +4 -4
- package/.docs/reference/evals/tool-call-accuracy.md +4 -4
- package/.docs/reference/evals/toxicity.md +1 -1
- package/.docs/reference/file-based-agents/config.md +3 -3
- package/.docs/reference/file-based-agents/instructions.md +1 -1
- package/.docs/reference/file-based-agents/processors.md +2 -0
- package/.docs/reference/file-based-agents/schedules.md +2 -2
- package/.docs/reference/file-based-agents/skills.md +1 -1
- package/.docs/reference/file-based-agents/subagents.md +5 -5
- package/.docs/reference/file-based-agents/workspace.md +1 -1
- package/.docs/reference/index.md +2 -0
- package/.docs/reference/manual-install.md +3 -2
- package/.docs/reference/memory/cloneThread.md +1 -1
- package/.docs/reference/memory/copyThread.md +1 -1
- package/.docs/reference/memory/deleteMessages.md +4 -1
- package/.docs/reference/memory/memory-class.md +5 -3
- package/.docs/reference/memory/observational-memory.md +16 -16
- package/.docs/reference/memory/serialized-memory-config.md +1 -1
- 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/vnext-to-standard-apis.md +2 -2
- package/.docs/reference/observability/tracing/advanced-queries.md +131 -41
- package/.docs/reference/observability/tracing/exporters/langfuse.md +1 -1
- package/.docs/reference/observability/tracing/interfaces.md +2 -0
- package/.docs/reference/processors/batch-parts-processor.md +1 -1
- package/.docs/reference/processors/classifier-processor.md +2 -2
- package/.docs/reference/processors/cyber-refusal-handler.md +1 -1
- package/.docs/reference/processors/file-upload-processor.md +1 -1
- 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 +2 -2
- 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 +76 -12
- package/.docs/reference/processors/prompt-injection-detector.md +1 -1
- package/.docs/reference/processors/provider-history-compat.md +1 -1
- package/.docs/reference/processors/regex-filter-processor.md +1 -1
- package/.docs/reference/processors/response-cache.md +1 -1
- 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 +3 -3
- package/.docs/reference/processors/system-prompt-scrubber.md +1 -1
- package/.docs/reference/processors/token-cost-control.md +1 -1
- package/.docs/reference/processors/token-limiter-processor.md +3 -3
- package/.docs/reference/processors/tool-call-filter.md +2 -2
- package/.docs/reference/processors/tool-search-processor.md +3 -3
- package/.docs/reference/processors/unicode-normalizer.md +1 -1
- 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 +1 -1
- package/.docs/reference/rag/chunking-and-embedding.md +1 -1
- 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 +13 -13
- package/.docs/reference/server/nestjs-adapter.md +1 -1
- package/.docs/reference/server/routes.md +159 -0
- package/.docs/reference/signals/create-notification-inbox-tool.md +4 -4
- package/.docs/reference/signals/notifications.md +249 -0
- package/.docs/reference/signals/signal-provider.md +2 -0
- package/.docs/reference/signals/task-signal-provider.md +3 -3
- package/.docs/reference/signals/thread-events.md +69 -0
- package/.docs/reference/streaming/ChunkType.md +68 -0
- package/.docs/reference/streaming/agents/stream.md +3 -3
- package/.docs/reference/tools/create-code-mode.md +1 -1
- package/.docs/reference/tools/create-tool.md +17 -0
- package/.docs/reference/tools/mcp-client.md +430 -3
- package/.docs/reference/tools/mcp-server.md +173 -1
- package/.docs/reference/tools/task-tools.md +1 -1
- package/.docs/reference/tools/vector-query-tool.md +1 -1
- package/.docs/reference/vectors/libsql.md +1 -1
- package/.docs/reference/vectors/mongodb.md +2 -2
- package/.docs/reference/vectors/oracledb.md +2 -2
- package/.docs/reference/vectors/pg.md +1 -1
- package/.docs/reference/vectors/upstash.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/workflows/workflow-methods/branch.md +1 -1
- package/.docs/reference/workspace/filesystem.md +17 -17
- package/.docs/reference/workspace/local-filesystem.md +52 -27
- package/.docs/reference/workspace/local-sandbox.md +1 -1
- package/.docs/reference/workspace/platform-filesystem.md +1 -1
- package/.docs/reference/workspace/platform-sandbox.md +23 -2
- package/.docs/reference/workspace/process-manager.md +13 -2
- package/.docs/reference/workspace/sandbox.md +16 -0
- package/.docs/reference/workspace/workspace-class.md +13 -12
- package/dist/index.js +1 -2
- package/dist/{src-Baf8l9Sp.js → src-DnH_jHt9.js} +2 -3
- package/dist/{src-Baf8l9Sp.js.map → src-DnH_jHt9.js.map} +1 -1
- package/dist/stdio.js +1 -1
- package/package.json +9 -9
- package/.docs/docs/harness/signal-providers.md +0 -212
- package/.docs/docs/harness/signals.md +0 -546
|
@@ -21,7 +21,7 @@ const agent = new Agent({
|
|
|
21
21
|
id: 'coding-agent',
|
|
22
22
|
name: 'Coding agent',
|
|
23
23
|
instructions: 'Help with software engineering tasks.',
|
|
24
|
-
model: 'anthropic/claude-sonnet-
|
|
24
|
+
model: 'anthropic/claude-sonnet-5-5',
|
|
25
25
|
})
|
|
26
26
|
|
|
27
27
|
const controller = new AgentController({
|
|
@@ -172,27 +172,25 @@ A message lifecycle starts with the initial message in `message_start`. Compact
|
|
|
172
172
|
|
|
173
173
|
#### `createSession(options)`
|
|
174
174
|
|
|
175
|
-
Get or create the live session registered
|
|
175
|
+
Get or create the live session registered under `id`. Call `init()` before this method.
|
|
176
176
|
|
|
177
177
|
```typescript
|
|
178
178
|
const session = await controller.createSession({
|
|
179
|
+
id: 'run-a',
|
|
179
180
|
resourceId: 'project-42',
|
|
180
|
-
scope: 'editor-window-1',
|
|
181
181
|
threadId: 'thread-7',
|
|
182
182
|
})
|
|
183
183
|
```
|
|
184
184
|
|
|
185
|
-
The same `
|
|
185
|
+
The same `id` returns the same `Session` instance. Sessions with different ids are independent even when they share a `resourceId`: each has its own run loop, thread binding, mode, model, and state, while their stored threads and resource-scoped memory belong to the shared resource. When `id` is omitted, it defaults to `resourceId`, so one session per resource needs no id. When `threadId` is supplied, the method switches a cached session to that thread or creates the thread when it doesn't exist.
|
|
186
186
|
|
|
187
|
-
**resourceId** (`string`): Memory resource and
|
|
188
|
-
|
|
189
|
-
**scope** (`string`): Optional registry namespace that allows multiple live sessions for one resource.
|
|
187
|
+
**resourceId** (`string`): Memory resource that owns the session's threads and resource-scoped memory. Defaults to the configured resourceId or controller id.
|
|
190
188
|
|
|
191
189
|
**threadId** (`string`): Exact thread to bind. Missing threads are created with this identifier.
|
|
192
190
|
|
|
193
191
|
**createInitialThread** (`boolean`): Create a thread when no existing thread matches. Set false to start the session without a thread; the first message or session.thread.ensureId() creates it, so unused sessions leave no empty thread behind. (Default: `true`)
|
|
194
192
|
|
|
195
|
-
**id** (`string`):
|
|
193
|
+
**id** (`string`): Session identifier and live-session registry key. Defaults to resourceId.
|
|
196
194
|
|
|
197
195
|
**ownerId** (`string`): Stable identity of the process-local Session host. Defaults to id. New threads use it as their initial owner, but later transfers do not change this value.
|
|
198
196
|
|
|
@@ -206,12 +204,12 @@ The same `resourceId` and `scope` return the same `Session` instance. A differen
|
|
|
206
204
|
|
|
207
205
|
Returns: `Promise<Session<TState>>`
|
|
208
206
|
|
|
209
|
-
#### `
|
|
207
|
+
#### `getSession(sessionId, requestContext?)`
|
|
210
208
|
|
|
211
|
-
Return the live session registered
|
|
209
|
+
Return the live session registered under `sessionId`, or `undefined` when none is live.
|
|
212
210
|
|
|
213
211
|
```typescript
|
|
214
|
-
const session = await controller.
|
|
212
|
+
const session = await controller.getSession('run-a')
|
|
215
213
|
```
|
|
216
214
|
|
|
217
215
|
Returns: `Promise<Session<TState> | undefined>`
|
|
@@ -220,7 +218,7 @@ Returns: `Promise<Session<TState> | undefined>`
|
|
|
220
218
|
|
|
221
219
|
Subscribe to process-local notifications after `createSession()` materializes a new live session, with isolated listener errors prevented from affecting other listeners. Call the returned function to unsubscribe.
|
|
222
220
|
|
|
223
|
-
By default listeners are fire-and-forget. Pass `{ blocking: true }` to make `createSession()` await the listener before resolving the new session, so the host can prepare session state before the caller can start a run. Blocking listeners run sequentially in registration order, before fire-and-forget listeners are notified. A blocking listener must not call `createSession()` for the same
|
|
221
|
+
By default listeners are fire-and-forget. Pass `{ blocking: true }` to make `createSession()` await the listener before resolving the new session, so the host can prepare session state before the caller can start a run. Blocking listeners run sequentially in registration order, before fire-and-forget listeners are notified. A blocking listener must not call `createSession()` for the same session `id`. That call would await its own hydration and deadlock.
|
|
224
222
|
|
|
225
223
|
```typescript
|
|
226
224
|
const unsubscribe = controller.onSessionCreated(
|
|
@@ -251,7 +249,7 @@ const unsubscribe = controller.onSessionDeleted(session => {
|
|
|
251
249
|
})
|
|
252
250
|
|
|
253
251
|
await controller.createSession({ resourceId: 'project-42' })
|
|
254
|
-
await controller.deleteSession({
|
|
252
|
+
await controller.deleteSession({ sessionId: 'project-42' })
|
|
255
253
|
unsubscribe()
|
|
256
254
|
```
|
|
257
255
|
|
|
@@ -259,22 +257,19 @@ This listener is best-effort and runs only in the current process. It isn't a pe
|
|
|
259
257
|
|
|
260
258
|
Returns: `() => void`
|
|
261
259
|
|
|
262
|
-
#### `deleteSession({
|
|
260
|
+
#### `deleteSession({ sessionId })`
|
|
263
261
|
|
|
264
|
-
Tear down the materialized session
|
|
262
|
+
Tear down the materialized session registered under `sessionId`. The method aborts active work, then removes thread subscriptions, the active thread lock, and the live session from the controller registry. It doesn't delete persisted threads or messages.
|
|
265
263
|
|
|
266
264
|
```typescript
|
|
267
|
-
const deleted = await controller.deleteSession({
|
|
268
|
-
resourceId: 'project-42',
|
|
269
|
-
scope: 'editor-window-1',
|
|
270
|
-
})
|
|
265
|
+
const deleted = await controller.deleteSession({ sessionId: 'run-a' })
|
|
271
266
|
```
|
|
272
267
|
|
|
273
|
-
Returns: `Promise<boolean>`. The result is `true` when a live session was removed and `false` when no matching live session exists or when another deletion is already in progress for the same
|
|
268
|
+
Returns: `Promise<boolean>`. The result is `true` when a live session was removed and `false` when no matching live session exists or when another deletion is already in progress for the same session.
|
|
274
269
|
|
|
275
270
|
#### `setResourceId(session, { resourceId })`
|
|
276
271
|
|
|
277
|
-
Move a live session to another resource and clear its active thread binding.
|
|
272
|
+
Move a live session to another resource and clear its active thread binding. The session stays registered under its id.
|
|
278
273
|
|
|
279
274
|
```typescript
|
|
280
275
|
await controller.setResourceId(session, { resourceId: 'project-43' })
|
|
@@ -353,12 +348,12 @@ Returns: `Promise<StorageListMessagesOutput>` with controller-format messages.
|
|
|
353
348
|
|
|
354
349
|
#### `generateThreadTitle(options)`
|
|
355
350
|
|
|
356
|
-
Generate and store a title from a thread's conversation without creating a Session. `threadId` is required. `
|
|
351
|
+
Generate and store a title from a thread's conversation without creating a Session. `threadId` is required. `sessionId`, `model`, and `requestContext` are optional; pass `sessionId` to borrow a live session's agent and request context. The method throws when the thread doesn't exist and returns `undefined` when the model produces no title.
|
|
357
352
|
|
|
358
353
|
```typescript
|
|
359
354
|
const title = await controller.generateThreadTitle({
|
|
360
355
|
threadId: 'thread-7',
|
|
361
|
-
|
|
356
|
+
sessionId: 'run-a',
|
|
362
357
|
})
|
|
363
358
|
```
|
|
364
359
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Session
|
|
6
6
|
|
|
7
|
-
A `Session` is the isolated runtime
|
|
7
|
+
A `Session` is the isolated runtime registered under one session id. Several sessions can share a resource, which owns their stored threads and resource-scoped memory. It owns its event bus, thread binding, state, mode and model selections, run control, approvals, suspensions, follow-ups, and display state. The [`AgentController`](https://mastra.ai/reference/agent-controller/agent-controller-class) supplies shared agents, configuration, storage, workspaces, and services.
|
|
8
8
|
|
|
9
9
|
Create sessions through `controller.createSession()`. Direct construction and controller wiring methods aren't application APIs.
|
|
10
10
|
|
|
@@ -164,7 +164,7 @@ session.abort()
|
|
|
164
164
|
|
|
165
165
|
#### `getWorkspace()`
|
|
166
166
|
|
|
167
|
-
Return the workspace resolved for this session. This preserves session-level overrides
|
|
167
|
+
Return the workspace resolved for this session. This preserves session-level overrides.
|
|
168
168
|
|
|
169
169
|
A workspace is optional. When neither the session nor the `AgentController` configures one, the session still runs without filesystem or sandbox access, and this returns `undefined`. Check the result before using it.
|
|
170
170
|
|
|
@@ -573,7 +573,7 @@ if (session.model.hasSelection()) {
|
|
|
573
573
|
Set the active model in memory without persisting it, reporting model use, or emitting a `model_changed` event.
|
|
574
574
|
|
|
575
575
|
```typescript
|
|
576
|
-
session.model.set({ modelId: 'anthropic/claude-sonnet-
|
|
576
|
+
session.model.set({ modelId: 'anthropic/claude-sonnet-5-5' })
|
|
577
577
|
```
|
|
578
578
|
|
|
579
579
|
### `session.model.switch(modelId, options?)`
|
|
@@ -583,7 +583,7 @@ Switch the session's active model. The model ID is persisted as the thread's `cu
|
|
|
583
583
|
Pass `{ thinkingLevel }` as the second argument to switch and persist both values in one operation. The level must be `'off'`, `'low'`, `'medium'`, `'high'`, `'xhigh'`, or `'max'`, and the controller's state schema must accept it. Both live values are updated before events are emitted. Omitting the option preserves the existing thinking-level override. Every `model_changed` event includes the current `{ modelId, thinkingLevel }`, even when the thinking level is unchanged. The level is `undefined` when the session has no override.
|
|
584
584
|
|
|
585
585
|
```typescript
|
|
586
|
-
await session.model.switch('anthropic/claude-sonnet-
|
|
586
|
+
await session.model.switch('anthropic/claude-sonnet-5-5', {
|
|
587
587
|
thinkingLevel: 'high',
|
|
588
588
|
})
|
|
589
589
|
```
|
|
@@ -632,7 +632,7 @@ Switch one role between automatic and explicit selection. Pass `'auto'` to follo
|
|
|
632
632
|
```typescript
|
|
633
633
|
await session.om.observer.switchModel({ modelId: 'auto' })
|
|
634
634
|
await session.om.reflector.switchModel({
|
|
635
|
-
modelId: 'anthropic/claude-haiku-
|
|
635
|
+
modelId: 'anthropic/claude-haiku-5-5',
|
|
636
636
|
})
|
|
637
637
|
```
|
|
638
638
|
|
|
@@ -692,11 +692,11 @@ Set the subagent model ID. Pass an `agentType` to set a per-type override, or om
|
|
|
692
692
|
|
|
693
693
|
```typescript
|
|
694
694
|
// Set the global subagent model
|
|
695
|
-
await session.subagents.model.set({ modelId: 'anthropic/claude-sonnet-
|
|
695
|
+
await session.subagents.model.set({ modelId: 'anthropic/claude-sonnet-5-5' })
|
|
696
696
|
|
|
697
697
|
// Set a per-type override
|
|
698
698
|
await session.subagents.model.set({
|
|
699
|
-
modelId: 'anthropic/claude-haiku-
|
|
699
|
+
modelId: 'anthropic/claude-haiku-5-5',
|
|
700
700
|
agentType: 'explore',
|
|
701
701
|
})
|
|
702
702
|
```
|
|
@@ -838,7 +838,7 @@ Thread-owned preferences include thinking level, observational memory settings,
|
|
|
838
838
|
|
|
839
839
|
A queued write keeps its source thread through asynchronous updates and validation. Switching from A to B while a write is pending doesn't apply A's preferences to B. Host-field updates still affect the host. A retained run and the active view of the same thread share update ordering. A resumed run sees edits made while it was parked. Events without a source address that affect the conversation display are emitted only while that source is active.
|
|
840
840
|
|
|
841
|
-
Inside a tool's controller request context, `state` is a snapshot taken when the context was built. Use `getState()` or `session.state.get()` to read the latest source-thread state after a write.
|
|
841
|
+
Inside a tool's controller request context, `sessionId`, `resourceId`, and `threadId` identify the session, its resource, and its active thread. `state` is a snapshot taken when the context was built. Use `getState()` or `session.state.get()` to read the latest source-thread state after a write.
|
|
842
842
|
|
|
843
843
|
### `session.state.get()`
|
|
844
844
|
|
|
@@ -20,7 +20,7 @@ export const agent = new Agent({
|
|
|
20
20
|
id: 'test-agent',
|
|
21
21
|
name: 'Test Agent',
|
|
22
22
|
instructions: 'You are a helpful assistant that provides concise answers.',
|
|
23
|
-
model: 'openai/gpt-
|
|
23
|
+
model: 'openai/gpt-6.1-sol',
|
|
24
24
|
})
|
|
25
25
|
|
|
26
26
|
// System message object
|
|
@@ -31,7 +31,7 @@ export const agent2 = new Agent({
|
|
|
31
31
|
role: 'system',
|
|
32
32
|
content: 'You are an expert programmer',
|
|
33
33
|
},
|
|
34
|
-
model: 'openai/gpt-
|
|
34
|
+
model: 'openai/gpt-6.1-sol',
|
|
35
35
|
})
|
|
36
36
|
|
|
37
37
|
// Array of system messages
|
|
@@ -42,7 +42,7 @@ export const agent3 = new Agent({
|
|
|
42
42
|
{ role: 'system', content: 'You are a helpful assistant' },
|
|
43
43
|
{ role: 'system', content: 'You have expertise in TypeScript' },
|
|
44
44
|
],
|
|
45
|
-
model: 'openai/gpt-
|
|
45
|
+
model: 'openai/gpt-6.1-sol',
|
|
46
46
|
})
|
|
47
47
|
```
|
|
48
48
|
|
|
@@ -65,7 +65,7 @@ export const agent = new Agent({
|
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
|
-
model: 'openai/gpt-
|
|
68
|
+
model: 'openai/gpt-6.1-sol',
|
|
69
69
|
})
|
|
70
70
|
```
|
|
71
71
|
|
|
@@ -94,7 +94,7 @@ export const agent = new Agent({
|
|
|
94
94
|
},
|
|
95
95
|
},
|
|
96
96
|
],
|
|
97
|
-
model: 'anthropic/claude-sonnet-
|
|
97
|
+
model: 'anthropic/claude-sonnet-5-5',
|
|
98
98
|
})
|
|
99
99
|
```
|
|
100
100
|
|
|
@@ -104,9 +104,9 @@ For the simplest setup, pass `model` as a string in `provider/model` format. Sep
|
|
|
104
104
|
|
|
105
105
|
Popular provider strings and credentials:
|
|
106
106
|
|
|
107
|
-
- **OpenAI**: `openai/gpt-
|
|
108
|
-
- **Anthropic**: `anthropic/claude-sonnet-
|
|
109
|
-
- **Google**: `google/gemini-
|
|
107
|
+
- **OpenAI**: `openai/gpt-6.1-sol` uses `OPENAI_API_KEY`.
|
|
108
|
+
- **Anthropic**: `anthropic/claude-sonnet-5-5` uses `ANTHROPIC_API_KEY`.
|
|
109
|
+
- **Google**: `google/gemini-3.8-flash` uses `GOOGLE_API_KEY` or `GOOGLE_GENERATIVE_AI_API_KEY`.
|
|
110
110
|
|
|
111
111
|
See [models](https://mastra.ai/models) for supported model IDs and [environment variables](https://mastra.ai/models/environment-variables) for the complete provider list.
|
|
112
112
|
|
|
@@ -246,35 +246,7 @@ agent.queueMessage('Also check whether the tests need updates.', {
|
|
|
246
246
|
|
|
247
247
|
`queueMessage()` accepts the same `message` and `options` shape as `sendMessage()` and returns `{ accepted: Promise<SendAgentSignalAccepted>, signal: CreatedAgentSignal, persisted?: Promise<void> }`, with the same `accepted` semantics as `sendMessage()`. Pass an optional `queueOwnerId` to group local queued messages for observation and cancellation. The owner ID is local metadata: it's neither serialized with the message nor an authorization mechanism.
|
|
248
248
|
|
|
249
|
-
Use `subscribeThreadEvents({ resourceId, threadId }, listener)` to observe
|
|
250
|
-
|
|
251
|
-
```typescript
|
|
252
|
-
const scope = {
|
|
253
|
-
resourceId: 'user-123',
|
|
254
|
-
threadId: 'thread-abc',
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
const unsubscribe = agent.subscribeThreadEvents(scope, event => {
|
|
258
|
-
if (event.type === 'queue-count-changed') {
|
|
259
|
-
console.log(`${event.count} messages are pending`)
|
|
260
|
-
}
|
|
261
|
-
})
|
|
262
|
-
|
|
263
|
-
agent.queueMessage('Review the failing test.', {
|
|
264
|
-
...scope,
|
|
265
|
-
ifIdle: { streamOptions: { maxSteps: 3 } },
|
|
266
|
-
})
|
|
267
|
-
|
|
268
|
-
unsubscribe()
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
`subscribeThreadEvents()` is distinct from `subscribeToThread()`, which streams agent output. It doesn't currently emit composite thread state, individual message lifecycle events, run events, or approval events. Mastra may add those as separate event types in the future.
|
|
272
|
-
|
|
273
|
-
AgentController Sessions observe the shared thread count when they subscribe, even before submitting a follow-up. `session.steer()` aborts the current run before sending the new input, without clearing queued follow-ups. Session cleanup stops observation and cancels unfinished local preparation, but leaves submitted messages in the Agent queue.
|
|
274
|
-
|
|
275
|
-
The count includes messages waiting in the local FIFO and a non-cancelled message while it acquires or transfers its lease. It drops at cancellation, execution handoff, forwarding to another owner, or failure, not when model generation completes. An idle `queueMessage()` handoff is immediate and isn't represented as a cancellable pending slot.
|
|
276
|
-
|
|
277
|
-
Use [`cancelQueuedMessages()`](#cancelqueuedmessagesoptions) to cancel selected pending input or an owner group. Queue-count events count only entries in the queue shared by `queueMessage()` and `queueSignal()`, not signals waiting for delivery into an active run. Owner-scoped observation and cancellation match the calling Agent, its local runtime, resource, thread, and owner ID.
|
|
249
|
+
Use [`subscribeThreadEvents({ resourceId, threadId }, listener)`](https://mastra.ai/reference/signals/thread-events) to observe locally pending messages on the shared thread. The listener currently receives only `queue-count-changed` events. For subscription options, count semantics, unsubscribe behavior, and owner-scoped observation, see the [Thread events reference](https://mastra.ai/reference/signals/thread-events).
|
|
278
250
|
|
|
279
251
|
### `queueSignal(signal, options)`
|
|
280
252
|
|
|
@@ -325,7 +297,7 @@ For `signalIds`, Mastra publishes all requested IDs through PubSub, even when no
|
|
|
325
297
|
|
|
326
298
|
Sends a signal to an active run or memory thread.
|
|
327
299
|
|
|
328
|
-
**signal** (`{ type: 'user' | 'state' | 'reactive' | 'notification' | 'user-message' | 'system-reminder'; tagName?: string; contents: string | Array<TextPart | FilePart>; attributes?: Record<string, JSONValue>; metadata?: Record<string, unknown>; providerOptions?: ProviderMetadata }`): Signal context to send to the thread. type is the semantic signal category. tagName controls the XML tag the model sees. For example, { type: 'notification', tagName: 'github-review' } renders as \<github-review>...\</github-review>. Legacy user-message and system-reminder payloads are still accepted and normalized. Unknown type values are rejected; use tagName for custom XML tags.
|
|
300
|
+
**signal** (`{ type: 'user' | 'state' | 'reactive' | 'notification' | 'user-message' | 'system-reminder'; tagName?: string; contents: string | Array<TextPart | FilePart>; attributes?: Record<string, JSONValue>; metadata?: Record<string, unknown>; providerOptions?: ProviderMetadata; transient?: boolean }`): Signal context to send to the thread. type is the semantic signal category. tagName controls the XML tag the model sees. For example, { type: 'notification', tagName: 'github-review' } renders as \<github-review>...\</github-review>. tagName and attribute names must be XML-safe: letters, numbers, periods, hyphens, and underscores, starting with a letter or underscore. Set transient: true to deliver the signal to the current model request without storing it; transient signals are never stored, state signals cannot be transient, and combining transient with a persist behavior discards the signal. Legacy user-message and system-reminder payloads are still accepted and normalized. Unknown type values are rejected; use tagName for custom XML tags.
|
|
329
301
|
|
|
330
302
|
**options** (`object`): Targeting and delivery behavior for the signal.
|
|
331
303
|
|
|
@@ -414,7 +386,7 @@ Returns `{ accepted: Promise<SendAgentSignalAccepted>, signal: CreatedAgentSigna
|
|
|
414
386
|
|
|
415
387
|
### `sendNotificationSignal(notification, options)`
|
|
416
388
|
|
|
417
|
-
Creates or coalesces a notification inbox record and resolves the notification delivery policy. It sends a notification signal when the decision is immediate.
|
|
389
|
+
Creates or coalesces a notification inbox record and resolves the notification delivery policy. It sends a notification signal when the decision is immediate. For record fields, statuses, priorities, policy evaluation, and dispatch configuration, see the [Notifications reference](https://mastra.ai/reference/signals/notifications).
|
|
418
390
|
|
|
419
391
|
```typescript
|
|
420
392
|
const result = await agent.sendNotificationSignal(
|
|
@@ -464,7 +436,7 @@ const result = await agent.sendNotificationSignal(
|
|
|
464
436
|
|
|
465
437
|
Returns `{ record: NotificationRecord, decision: NotificationDeliveryDecision, runId?: string, signal?: CreatedAgentSignal, persisted?: Promise<void>, accepted?: Promise<SendAgentSignalAccepted> }`. `record` is the stored inbox record. `decision` is the delivery-policy result. `signal` and `runId` are present when ingress emits a signal immediately, including the immediate summary emitted for active high-priority notifications. `persisted` is present when the emitted signal is persisted without waking an idle thread. `accepted` is present when a signal is emitted and resolves at decision-time, once Mastra decides what to do with it: `{ action: 'wake', runId, output }` when this process runs the agent (it started or won the lease to start the run), `{ action: 'deliver', runId }` when the signal is forwarded onto an existing run, or `{ action: 'persist' }` / `{ action: 'discard' }` when nothing ran. `runId` on the accepted result is present only on `wake` and `deliver`. On the `wake` action, `output` is the agent stream for in-process consumption.
|
|
466
438
|
|
|
467
|
-
Default delivery is priority-aware. `urgent` notifications deliver immediately. `high` notifications deliver immediately when the thread is idle. When the thread is active, Mastra emits a summary immediately and keeps `deliverAt` for later full delivery when the thread is idle. `medium` notifications deliver immediately when idle and batch into summaries when active. `low` notifications batch into summaries in both active and idle threads. Idle low-priority summaries reach subscribers without waking the model loop. For the full flow, visit [Signals](https://mastra.ai/docs/
|
|
439
|
+
Default delivery is priority-aware. `urgent` notifications deliver immediately. `high` notifications deliver immediately when the thread is idle. When the thread is active, Mastra emits a summary immediately and keeps `deliverAt` for later full delivery when the thread is idle. `medium` notifications deliver immediately when idle and batch into summaries when active. `low` notifications batch into summaries in both active and idle threads. Idle low-priority summaries reach subscribers without waking the model loop. For the full flow, visit [Signals](https://mastra.ai/docs/signals/notifications).
|
|
468
440
|
|
|
469
441
|
Configure `notifications.deliveryPolicy` on the agent when some notifications should wait for a different dispatch window or summary rollup:
|
|
470
442
|
|
|
@@ -473,7 +445,7 @@ export const supportAgent = new Agent({
|
|
|
473
445
|
id: 'support-agent',
|
|
474
446
|
name: 'Support Agent',
|
|
475
447
|
instructions: 'Help the user triage updates.',
|
|
476
|
-
model: 'openai/gpt-
|
|
448
|
+
model: 'openai/gpt-6.1-sol',
|
|
477
449
|
notifications: {
|
|
478
450
|
deliveryPolicy: {
|
|
479
451
|
priorities: {
|
|
@@ -528,7 +500,7 @@ Subscribes to raw stream chunks for a memory thread. Use this before calling `se
|
|
|
528
500
|
|
|
529
501
|
**options.hideSignals** (`boolean | AgentSignalType[]`): Use true to hide all recognized signals, false to show all, or an array to hide selected types from this subscription, including live, idle-persisted, and replayed signals. Other subscribers and the initiating stream keep their own policies.
|
|
530
502
|
|
|
531
|
-
**options.withInitialHistory** (`boolean | { perPage?: number }`): Emit the stored thread messages as one thread-history chunk first, then only retained parts newer than that history, then live parts. Completed runs already in storage aren't replayed; pending tool approvals are still emitted. perPage limits how many recent messages are loaded (default 40).
|
|
503
|
+
**options.withInitialHistory** (`boolean | { perPage?: number }`): Emit the stored thread messages as one thread-history chunk first, then only retained parts newer than that history, then live parts. Completed runs already in storage aren't replayed; pending tool approvals are still emitted. perPage limits how many recent messages are loaded (default 40). Without agent memory, or when the thread has no stored messages yet, the history chunk is emitted with an empty messages array.
|
|
532
504
|
|
|
533
505
|
By default, subscriptions include every signal type, including reactive reminders. To hide reminders for one subscriber without affecting another:
|
|
534
506
|
|
|
@@ -553,6 +525,8 @@ for await (const chunk of subscription.stream) {
|
|
|
553
525
|
}
|
|
554
526
|
```
|
|
555
527
|
|
|
528
|
+
The `thread-history` chunk carries the newest `perPage` messages and a `hasMore` flag. See [Thread subscription chunks](https://mastra.ai/reference/streaming/ChunkType) for its shape.
|
|
529
|
+
|
|
556
530
|
`hideSignals: true` hides all recognized signal types. Set it to `false` to show all signals. An array accepts `user`, `state`, `reactive`, `notification`, `user-message`, and `system-reminder`. Matching normalizes `system-reminder` to `reactive` and `user-message` to `user`. An omitted option, `false`, or `[]` excludes nothing. Each subscriber filters its own live and replayed chunks, including remote pubsub events and idle-persisted signals. Filtering preserves non-signal chunks, unknown or malformed signal chunks, ordering, and completion/error events, even when every signal type is excluded.
|
|
557
531
|
|
|
558
532
|
Exclusions don't change model context, storage, shared broadcasts, or another caller's output. They aren't a security boundary and don't replace `ifActive`/`ifIdle` delivery policies or `transient` persistence behavior. This option is supported by the in-process core API, not HTTP or client-js subscription requests. See [stream signal visibility](https://mastra.ai/reference/streaming/agents/stream) for transform ordering and the distinction from recall's exact stored-type matching and reminder-hidden history default.
|
|
@@ -611,7 +585,7 @@ Returns an `AgentThreadSubscription` object with these members:
|
|
|
611
585
|
|
|
612
586
|
**notifications** (`object`): Notification delivery configuration for durable notification signals.
|
|
613
587
|
|
|
614
|
-
**notifications.deliveryPolicy** (`NotificationDeliveryPolicyConfig`): Controls how notification records are delivered. Configure a default decision, per-priority decisions, per-source decisions, or a custom decide() function.
|
|
588
|
+
**notifications.deliveryPolicy** (`NotificationDeliveryPolicyConfig`): Controls how notification records are delivered. Configure a default decision, per-priority decisions, per-source decisions, or a custom decide() function. See Notifications for policy types and evaluation order.
|
|
615
589
|
|
|
616
590
|
**voice** (`CompositeVoice`): Voice settings for speech input and output.
|
|
617
591
|
|
|
@@ -664,7 +638,7 @@ export const agent = new Agent({
|
|
|
664
638
|
id: 'support-agent',
|
|
665
639
|
name: 'support-agent',
|
|
666
640
|
instructions: 'Help users with their questions.',
|
|
667
|
-
model: 'openai/gpt-
|
|
641
|
+
model: 'openai/gpt-6.1-sol',
|
|
668
642
|
hooks: {
|
|
669
643
|
beforeToolCall: ({ toolName, input }) => {
|
|
670
644
|
console.log(`Running ${toolName}`, input)
|
|
@@ -694,9 +668,11 @@ The hook context `metadata` includes `agentId` and `agentName`. Per-execution ho
|
|
|
694
668
|
|
|
695
669
|
## Editor overrides
|
|
696
670
|
|
|
697
|
-
When you register the [`MastraEditor`](https://mastra.ai/reference/editor/mastra-editor), the `editor` field controls which parts of
|
|
671
|
+
When you register the [`MastraEditor`](https://mastra.ai/reference/editor/mastra-editor), the `editor` field controls which parts of an agent are defined in code and which are owned by Studio. Fields owned by code are read-only in Studio and are stripped from saved overrides. Fields owned by Studio must be omitted from code; the agent reads them from stored overrides and fails closed when they're missing.
|
|
672
|
+
|
|
673
|
+
**editor** (`false | { instructions?: boolean; tools?: boolean | { description?: boolean } }`): Omit to allow editing instructions and tools, using values in code as defaults. Set to false to lock the agent. Set instructions: true to make Studio own the instructions; omit instructions from code. Set tools: true to make Studio own tool membership and descriptions; omit tools from code. Set tools: { description: true } to keep tool membership in code and allow only description edits.
|
|
698
674
|
|
|
699
|
-
|
|
675
|
+
When a field is owned by Studio, TypeScript rejects it in code: `instructions` with `editor: { instructions: true }` and `tools` with `editor: { tools: true }` are type errors. An agent whose instructions are owned by Studio fails closed until a stored version with instructions is published.
|
|
700
676
|
|
|
701
677
|
The agent's `id`, `name`, and `model` always come from code and can't be overridden through Editor. See [Editor](https://mastra.ai/docs/studio/editor) for usage.
|
|
702
678
|
|
|
@@ -19,7 +19,7 @@ export const supportAgent = new Agent({
|
|
|
19
19
|
id: 'support-agent',
|
|
20
20
|
name: 'Support Agent',
|
|
21
21
|
instructions: 'You are a helpful support assistant.',
|
|
22
|
-
model: 'openai/gpt-
|
|
22
|
+
model: 'openai/gpt-6.1-sol',
|
|
23
23
|
channels: {
|
|
24
24
|
adapters: {
|
|
25
25
|
slack: createSlackAdapter(),
|
|
@@ -41,7 +41,7 @@ The `channels` property accepts a `ChannelConfig` object with the following fiel
|
|
|
41
41
|
|
|
42
42
|
**inlineLinks** (`InlineLinkEntry[]`): Promote URLs found in message text to file parts so the model can process linked content. Each entry matches a domain. Disabled by default.
|
|
43
43
|
|
|
44
|
-
**tools** (`boolean`): Whether getTools() returns the channel-specific tools (add\_reaction, remove\_reaction). Set to false for models that do not support function calling. Channel tools are never added to the agent automatically — pass them explicitly via tools: { ...channels.getTools() }. (Default: `true`)
|
|
44
|
+
**tools** (`boolean`): Whether getTools() returns the channel-specific tools (add\_reaction, remove\_reaction). Set to false for models that do not support function calling. Channel tools are never added to the agent automatically — pass them explicitly via tools: { ...channels.getTools() }. They work on any run in a channel-backed thread, including runs that did not start from a chat message, such as a schedule or a Studio prompt. (Default: `true`)
|
|
45
45
|
|
|
46
46
|
**state** (`StateAdapter`): State adapter for subscriptions and deduplication. Defaults to MastraStateAdapter backed by the Mastra instance storage. Channels require storage to be configured. (Default: `MastraStateAdapter (from Mastra storage)`)
|
|
47
47
|
|
|
@@ -72,7 +72,7 @@ const agent = new Agent({
|
|
|
72
72
|
id: 'example',
|
|
73
73
|
name: 'Example',
|
|
74
74
|
instructions: '...',
|
|
75
|
-
model: 'openai/gpt-
|
|
75
|
+
model: 'openai/gpt-6.1-sol',
|
|
76
76
|
channels: {
|
|
77
77
|
adapters: {
|
|
78
78
|
discord: {
|
|
@@ -100,12 +100,14 @@ const agent = new Agent({
|
|
|
100
100
|
|
|
101
101
|
**formatError** (`(error: Error) => PostableMessage`): Override how errors are rendered in the chat. Return a user-friendly message instead of exposing the raw error. (Default: `"❌ Error: <error.message>"`)
|
|
102
102
|
|
|
103
|
-
**formatToolCall** (`(
|
|
103
|
+
**formatToolCall** (`(info: { toolName: string; args: Record<string, unknown>; result: unknown; isError?: boolean }) => PostableMessage | null`): \*\*Deprecated\*\* — use toolDisplay (function form) instead. When set, runs as a ToolDisplayFn that only fires on result/error events; running and approval events fall through to no render. Mutually exclusive with toolDisplay at the type level.
|
|
104
104
|
|
|
105
105
|
**streaming** (`boolean | { updateIntervalMs?: number }`): Stream agent text deltas to the channel as the agent generates them instead of buffering and posting once per step. Requires the underlying adapter to support post-and-edit streaming. Slack defaults to true; other adapters default to false. (Default: `false (true for Slack)`)
|
|
106
106
|
|
|
107
107
|
**textFormat** (`'markdown' | 'plain'`): Dialect for the agent's final reply text. 'markdown' (the default) posts replies as markdown: adapters with native markdown rendering (Slack) render it directly, others convert it to their platform format. 'plain' posts replies as literal plain text, restoring the pre-markdown behavior for agents prompted to emit a platform dialect such as Slack mrkdwn. Applies to final reply text only; tool cards, error messages, and tripwire notices are unaffected. Native streaming is always markdown regardless of this setting. (Default: `'markdown'`)
|
|
108
108
|
|
|
109
|
+
**textDisplay** (`'show' | 'hidden'`): Whether the agent's reply text is posted to the channel. 'hidden' never posts reply text, so the agent's own messages reach the channel only through tools you give it, such as a reply tool. Tool display, approval prompts, error messages, and typing status are unaffected, and the text still reaches the agent's stream and memory. (Default: `'show'`)
|
|
110
|
+
|
|
109
111
|
**toolDisplay** (`'cards' | 'text' | 'timeline' | 'grouped' | 'hidden' | ToolDisplayFn`): How tool calls are rendered in the channel. "cards" posts per-tool running/result cards as rich Block Kit. "text" posts the same lifecycle as plain text (no Block Kit). "timeline" and "grouped" stream tool state as inline task\_update chunks (requires streaming: true; Slack only today — other adapters may render a placeholder). "hidden" executes tools silently. Pass a function to render tool events yourself; return { kind: "post", message } for a discrete post/edit, { kind: "stream", chunk } to push into the streaming widget, or undefined to skip rendering that event. Add openIfEmpty: false to a stream result when its chunk should only apply to an active streaming session. Approve/deny prompts render as a separate built-in card in every string mode; a toolDisplay function receives the approval event and may replace the card by returning { kind: "post", message }. (Default: `'cards' ('grouped' for Slack)`)
|
|
110
112
|
|
|
111
113
|
**typingStatus** (`boolean | ((chunk: AgentChunkType, ctx: TypingStatusContext) => string | false | null | undefined | void)`): Control the platform typing indicator. true uses built-in defaults (is typing… on text, is calling {tool}… on tool-call, is waiting for approval… on tool-call-approval). false suppresses typing entirely — useful when a live streaming widget (e.g. toolDisplay: "grouped" in Slack) already conveys progress. Pass a function to set custom status copy per chunk; return a string to set the status, or false/null/undefined to leave it unchanged. Compose with defaultTypingStatus (exported from @mastra/core/channels) to fall back to defaults for chunks you don't handle. (Default: `true`)
|
|
@@ -151,7 +153,7 @@ const agent = new Agent({
|
|
|
151
153
|
id: 'streaming-agent',
|
|
152
154
|
name: 'Streaming Agent',
|
|
153
155
|
instructions: '...',
|
|
154
|
-
model: 'openai/gpt-
|
|
156
|
+
model: 'openai/gpt-6.1-sol',
|
|
155
157
|
channels: {
|
|
156
158
|
adapters: {
|
|
157
159
|
slack: {
|
|
@@ -179,7 +181,7 @@ const agent = new Agent({
|
|
|
179
181
|
id: 'custom-typing-agent',
|
|
180
182
|
name: 'Custom Typing Agent',
|
|
181
183
|
instructions: '...',
|
|
182
|
-
model: 'openai/gpt-
|
|
184
|
+
model: 'openai/gpt-6.1-sol',
|
|
183
185
|
channels: {
|
|
184
186
|
adapters: {
|
|
185
187
|
discord: {
|
|
@@ -213,7 +215,7 @@ const agent = new Agent({
|
|
|
213
215
|
id: 'custom-handler-agent',
|
|
214
216
|
name: 'Custom Handler Agent',
|
|
215
217
|
instructions: '...',
|
|
216
|
-
model: 'openai/gpt-
|
|
218
|
+
model: 'openai/gpt-6.1-sol',
|
|
217
219
|
channels: {
|
|
218
220
|
adapters: {
|
|
219
221
|
slack: createSlackAdapter(),
|
|
@@ -248,6 +250,8 @@ type ChannelHandler = (
|
|
|
248
250
|
type ChannelHandlerContext = {
|
|
249
251
|
mastra?: Mastra
|
|
250
252
|
requestContext: RequestContext
|
|
253
|
+
readonly signalMetadata: Record<string, unknown>
|
|
254
|
+
readonly skipped: readonly Message[]
|
|
251
255
|
}
|
|
252
256
|
```
|
|
253
257
|
|
|
@@ -271,6 +275,10 @@ onDirectMessage: async (thread, message, defaultHandler, ctx) => {
|
|
|
271
275
|
|
|
272
276
|
Anything the run reads from its request context can be decided per message this way, such as which user a platform sender maps to.
|
|
273
277
|
|
|
278
|
+
`ctx.signalMetadata` is the metadata attached to this message's Agent Signal, built fresh for every message. Add JSON-serializable, non-sensitive values before calling `defaultHandler`. Mastra may persist signal metadata and publish it through PubSub. Unlike `ctx.requestContext`, it follows the message whether it starts a new run or is delivered to one that is already active.
|
|
279
|
+
|
|
280
|
+
`ctx.skipped` lists earlier messages from the same sender that the Chat SDK batched into this turn when a `chatOptions.concurrency` strategy such as `burst`, `debounce`, or `queue` is set, oldest first. It's empty when nothing was batched.
|
|
281
|
+
|
|
274
282
|
## Resource ID resolution
|
|
275
283
|
|
|
276
284
|
By default a channel thread's memory `resourceId` is `${platform}:${message.author.userId}`. The sender owns the memory, scoped per platform. For apps with a shared identity, such as single sign-on (SSO), this splits memory: the same user gets `feishu:user_123` in a Feishu DM but `user_123` on the web.
|
|
@@ -285,7 +293,7 @@ const agent = new Agent({
|
|
|
285
293
|
id: 'sso-agent',
|
|
286
294
|
name: 'SSO Agent',
|
|
287
295
|
instructions: '...',
|
|
288
|
-
model: 'openai/gpt-
|
|
296
|
+
model: 'openai/gpt-6.1-sol',
|
|
289
297
|
channels: {
|
|
290
298
|
adapters: {
|
|
291
299
|
slack: createSlackAdapter(),
|
|
@@ -328,7 +336,7 @@ const agent = new Agent({
|
|
|
328
336
|
id: 'session-agent',
|
|
329
337
|
name: 'Session Agent',
|
|
330
338
|
instructions: '...',
|
|
331
|
-
model: 'openai/gpt-
|
|
339
|
+
model: 'openai/gpt-6.1-sol',
|
|
332
340
|
channels: {
|
|
333
341
|
adapters: {
|
|
334
342
|
slack: createSlackAdapter(),
|
|
@@ -21,7 +21,7 @@ const agent = new Agent({
|
|
|
21
21
|
id: 'my-agent',
|
|
22
22
|
name: 'My Agent',
|
|
23
23
|
instructions: 'You are a helpful assistant',
|
|
24
|
-
model: 'openai/gpt-
|
|
24
|
+
model: 'openai/gpt-6.1-sol',
|
|
25
25
|
})
|
|
26
26
|
|
|
27
27
|
const durableAgent = createDurableAgent({ agent })
|
|
@@ -53,7 +53,7 @@ const myAgent = new Agent({
|
|
|
53
53
|
id: 'my-agent',
|
|
54
54
|
name: 'My Agent',
|
|
55
55
|
instructions: 'You are a helpful assistant',
|
|
56
|
-
model: 'openai/gpt-
|
|
56
|
+
model: 'openai/gpt-6.1-sol',
|
|
57
57
|
durable: true, // or: { maxSteps: 10, cleanupTimeoutMs: 60_000 }
|
|
58
58
|
})
|
|
59
59
|
|
|
@@ -181,7 +181,9 @@ Returns: [`Promise<DurableAgentStreamResult>`](#durableagentstreamresult)
|
|
|
181
181
|
|
|
182
182
|
Reconnects to an existing run. Use this after a network disconnection. For the supported general reconnect flow, omit `offset` to replay all available cached events before receiving live events.
|
|
183
183
|
|
|
184
|
-
|
|
184
|
+
The observing agent must have the same effective `id` as the agent that started the run, both for live observations in the same process and for persisted observations from another process. The effective ID is the DurableAgent's `id`, including any ID override, rather than the wrapped agent's original ID. Different DurableAgent instances with the same effective ID can observe the same run.
|
|
185
|
+
|
|
186
|
+
If the live or persisted run identifies a different owner agent ID, `observe()` throws `DURABLE_AGENT_OBSERVE_AGENT_MISMATCH`. Legacy live entries without owner metadata retain their existing behavior.
|
|
185
187
|
|
|
186
188
|
For runs configured with `structuredOutput`, an observer in another process reconstructs `output.object` from the persisted schema and replayed text.
|
|
187
189
|
|
|
@@ -328,7 +330,9 @@ interface DurableAgentListActiveRunsResult {
|
|
|
328
330
|
|
|
329
331
|
Discovers runs stuck in `running` status for this agent and re-drives them from the last persisted snapshot. Accepts the same filters and pagination as `listActiveRuns()`, plus `runId`. Returns the outcome for each run.
|
|
330
332
|
|
|
331
|
-
|
|
333
|
+
Up to five run waits proceed concurrently, with results returned in discovery order. Each attempt has a single 30-second wait budget covering both `recover()` setup and settlement of the whole recovered workflow. When the budget expires, another run can use the slot. The outcome is `status: 'skipped'` with `reason: 'recovery-timeout'` and `retryAt` set 30 seconds ahead. The timeout doesn't cancel setup or execution, release a live claim, or count as success or failure. The attempt continues in the background, and its eventual outcome doesn't change the returned results. The concurrency limit bounds waiting, not live executions.
|
|
334
|
+
|
|
335
|
+
[`mastra.recoverAllDurableAgents()`](https://mastra.ai/reference/core/mastra-class) schedules timeout re-checks automatically. Direct callers of `recoverActiveRuns()` must schedule their own calls after `retryAt`. While the original bulk attempt remains pending, re-checks defer with another `recovery-timeout` and a future `retryAt`, without invoking `recover()` again. Once it settles, recovery checks the persisted snapshot and ownership before retrying. Finished or suspended runs aren't restarted.
|
|
332
336
|
|
|
333
337
|
The budget applies only to each run attempt in `recoverActiveRuns()`, not to discovery, a direct `recover()` call, or overridden custom recovery methods. When shutdown begins, recovery stops dispatching new runs. The original attempt remains tracked for Mastra's shared shutdown drain even after the wait times out.
|
|
334
338
|
|
|
@@ -352,12 +356,12 @@ await durableAgent.recoverActiveRuns({ runId: 'run-abc-123' })
|
|
|
352
356
|
|
|
353
357
|
A run that another execution still drives isn't taken over. Its entry has `status: 'skipped'` and a `reason`, and `recoverActiveRuns()` doesn't check it again. For a run held by another process, `retryAt` is the time after which that claim lapses unless renewed. Call `recoverActiveRuns({ runId })` after it to recover the run if its process crashed. [`mastra.recoverAllDurableAgents()`](https://mastra.ai/reference/core/mastra-class) schedules these re-checks itself.
|
|
354
358
|
|
|
355
|
-
| `reason` | Meaning
|
|
356
|
-
| --------------------- |
|
|
357
|
-
| `run-active` | Another execution, possibly in another process, holds the run. Sets `retryAt`.
|
|
358
|
-
| `run-active-locally` | This process is executing the run.
|
|
359
|
-
| `already-in-progress` | This process is already recovering the run.
|
|
360
|
-
| `recovery-timeout` | The
|
|
359
|
+
| `reason` | Meaning |
|
|
360
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
361
|
+
| `run-active` | Another execution, possibly in another process, holds the run. Sets `retryAt`. |
|
|
362
|
+
| `run-active-locally` | This process is executing the run. |
|
|
363
|
+
| `already-in-progress` | This process is already recovering the run. |
|
|
364
|
+
| `recovery-timeout` | The wait expired or an earlier bulk recovery attempt is still pending. Sets `retryAt`; re-checks don't duplicate the pending attempt. |
|
|
361
365
|
|
|
362
366
|
Returns:
|
|
363
367
|
|