@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
|
@@ -328,7 +328,7 @@ For the streaming version of the same chunk shape, see the [ChunkType reference]
|
|
|
328
328
|
|
|
329
329
|
**steps.response** (`object`): Response metadata for this step.
|
|
330
330
|
|
|
331
|
-
**finishReason** (`string`): The reason generation finished. Values include 'stop' (normal completion), 'tool-calls' (ended with tool calls), 'suspended' (
|
|
331
|
+
**finishReason** (`string`): The reason generation finished. Values include 'stop' (normal completion), 'tool-calls' (ended with tool calls), 'suspended' (paused for tool approval or because a tool called suspend()), or 'error' (error occurred).
|
|
332
332
|
|
|
333
333
|
**response** (`object`): Response metadata from the model provider. Useful for accessing rate limit headers and request IDs.
|
|
334
334
|
|
|
@@ -360,7 +360,7 @@ For the streaming version of the same chunk shape, see the [ChunkType reference]
|
|
|
360
360
|
|
|
361
361
|
**files** (`FileChunk[]`): Files generated by the model.
|
|
362
362
|
|
|
363
|
-
**suspendPayload** (`object`): Present when finishReason is 'suspended'. Contains tool call
|
|
363
|
+
**suspendPayload** (`object`): Present when finishReason is 'suspended'. Contains details about the pending tool call. For tool approval, use toolCallId with approveToolCallGenerate() or declineToolCallGenerate(). For a tool that called suspend(), suspendPayload holds the data the tool passed to suspend(), and you resume with resumeGenerate().
|
|
364
364
|
|
|
365
365
|
**suspendPayload.toolCallId** (`string`): Unique identifier for the pending tool call.
|
|
366
366
|
|
|
@@ -368,7 +368,13 @@ For the streaming version of the same chunk shape, see the [ChunkType reference]
|
|
|
368
368
|
|
|
369
369
|
**suspendPayload.args** (`Record<string, any>`): Arguments that will be passed to the tool.
|
|
370
370
|
|
|
371
|
-
**
|
|
371
|
+
**suspendPayload.suspendPayload** (`any`): Only when a tool called suspend(). Contains the data the tool passed to suspend(), matching the tool's suspendSchema.
|
|
372
|
+
|
|
373
|
+
**suspendPayload.resumeSchema** (`string`): JSON Schema, serialized as a string, describing the data resumeGenerate() or resumeStream() expects.
|
|
374
|
+
|
|
375
|
+
**resumeSchema** (`string`): JSON Schema, serialized as a string, describing the data resumeGenerate() or resumeStream() expects. Present when finishReason is suspended; the same value also appears inside suspendPayload.
|
|
376
|
+
|
|
377
|
+
**runId** (`string`): Unique identifier for this execution run. Required when resuming a suspended execution with approveToolCallGenerate(), declineToolCallGenerate(), resumeGenerate(), or their streaming equivalents.
|
|
372
378
|
|
|
373
379
|
**traceId** (`string`): The trace ID associated with this execution when Tracing is enabled. Use this to correlate logs and debug execution flow.
|
|
374
380
|
|
|
@@ -386,6 +392,54 @@ For the streaming version of the same chunk shape, see the [ChunkType reference]
|
|
|
386
392
|
|
|
387
393
|
## More examples
|
|
388
394
|
|
|
395
|
+
### Resuming a runtime-suspended generation
|
|
396
|
+
|
|
397
|
+
`generate()` returns `finishReason: 'suspended'` in two cases: a tool requires approval (see [`requireToolApproval`](#parameters)), or a tool's `execute` function calls `suspend()`.
|
|
398
|
+
|
|
399
|
+
This example covers a tool that calls `suspend()`. The tool declares a `suspendSchema` for the data it passes to `suspend()` and a `resumeSchema` for the data it needs to continue:
|
|
400
|
+
|
|
401
|
+
```typescript
|
|
402
|
+
const weatherTool = createTool({
|
|
403
|
+
id: 'get-weather',
|
|
404
|
+
inputSchema: z.object({ location: z.string().optional() }),
|
|
405
|
+
suspendSchema: z.object({ question: z.string() }),
|
|
406
|
+
resumeSchema: z.object({ location: z.string() }),
|
|
407
|
+
execute: async ({ location }, context) => {
|
|
408
|
+
if (!location) {
|
|
409
|
+
return await context?.agent?.suspend({
|
|
410
|
+
question: 'Which city would you like the weather for?',
|
|
411
|
+
})
|
|
412
|
+
}
|
|
413
|
+
return await fetchWeather(location)
|
|
414
|
+
},
|
|
415
|
+
})
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
In the suspended result, `suspendPayload.suspendPayload` contains the data the tool passed to `suspend()`. Resume the run with `resumeGenerate()`, passing data that matches the tool's `resumeSchema` and the suspended `runId`:
|
|
419
|
+
|
|
420
|
+
```typescript
|
|
421
|
+
const output = await agent.generate("What's the weather in London?")
|
|
422
|
+
|
|
423
|
+
if (output.finishReason === 'suspended') {
|
|
424
|
+
console.log(output.suspendPayload.toolCallId)
|
|
425
|
+
console.log(output.suspendPayload.suspendPayload) // { question: 'Which city would you like the weather for?' }
|
|
426
|
+
|
|
427
|
+
const resumed = await agent.resumeGenerate(
|
|
428
|
+
{ location: 'London' },
|
|
429
|
+
{
|
|
430
|
+
runId: output.runId!,
|
|
431
|
+
// Pass per-call options again, for example requestContext or onStepFinish.
|
|
432
|
+
},
|
|
433
|
+
)
|
|
434
|
+
|
|
435
|
+
console.log(resumed.text)
|
|
436
|
+
}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
If the resume data doesn't match the tool's `resumeSchema`, `resumeGenerate()` throws an error with the id `AGENT_RESUME_INVALID_DATA` and the run stays suspended, so you can retry with corrected data. When more than one tool call is suspended, pass `toolCallId` to resume a specific one.
|
|
440
|
+
|
|
441
|
+
For tool approval, use `approveToolCallGenerate()` and `declineToolCallGenerate()` instead, as shown in [human-in-the-loop](https://mastra.ai/docs/agents/human-in-the-loop). To resume from a stream, use `resumeStream()` with the same data.
|
|
442
|
+
|
|
389
443
|
### With model settings
|
|
390
444
|
|
|
391
445
|
Example of limiting output tokens and setting temperature:
|
|
@@ -207,12 +207,12 @@ await agent.generateLegacy(
|
|
|
207
207
|
sentiment: z.enum(['positive', 'negative', 'neutral']),
|
|
208
208
|
confidence: z.number(),
|
|
209
209
|
}),
|
|
210
|
-
model: 'openai/gpt-
|
|
210
|
+
model: 'openai/gpt-6.1-sol',
|
|
211
211
|
errorStrategy: 'warn',
|
|
212
212
|
},
|
|
213
213
|
// Output processors for response validation
|
|
214
214
|
outputProcessors: [
|
|
215
|
-
new ModerationProcessor({ model: 'openai/gpt-
|
|
215
|
+
new ModerationProcessor({ model: 'openai/gpt-6-luna' }),
|
|
216
216
|
new TokenLimiterProcessor({ maxTokens: 1000 }),
|
|
217
217
|
],
|
|
218
218
|
},
|
|
@@ -14,7 +14,7 @@ await agent.getLLM()
|
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
16
|
await agent.getLLM({
|
|
17
|
-
model: 'openai/gpt-
|
|
17
|
+
model: 'openai/gpt-6.1-sol',
|
|
18
18
|
})
|
|
19
19
|
```
|
|
20
20
|
|
|
@@ -35,7 +35,7 @@ await agent.getLLM({
|
|
|
35
35
|
```typescript
|
|
36
36
|
await agent.getLLM({
|
|
37
37
|
requestContext: new RequestContext(),
|
|
38
|
-
model: 'openai/gpt-
|
|
38
|
+
model: 'openai/gpt-6.1-sol',
|
|
39
39
|
})
|
|
40
40
|
```
|
|
41
41
|
|
|
@@ -33,7 +33,7 @@ export const supportAgent = new Agent({
|
|
|
33
33
|
id: 'support-agent',
|
|
34
34
|
name: 'Support Agent',
|
|
35
35
|
instructions: 'You help customers with support requests.',
|
|
36
|
-
model: 'openai/gpt-
|
|
36
|
+
model: 'openai/gpt-6.1-sol',
|
|
37
37
|
metadata: { type: 'support' },
|
|
38
38
|
})
|
|
39
39
|
|
|
@@ -49,7 +49,7 @@ export const supportAgent = new Agent({
|
|
|
49
49
|
id: 'support-agent',
|
|
50
50
|
name: 'Support Agent',
|
|
51
51
|
instructions: 'You help customers with support requests.',
|
|
52
|
-
model: 'openai/gpt-
|
|
52
|
+
model: 'openai/gpt-6.1-sol',
|
|
53
53
|
metadata: ({ requestContext }) => ({
|
|
54
54
|
type: 'support',
|
|
55
55
|
tenant: requestContext.get('tenant'),
|
|
@@ -35,11 +35,8 @@ interface SkillMetadata {
|
|
|
35
35
|
name: string
|
|
36
36
|
description: string
|
|
37
37
|
path: string
|
|
38
|
-
references: string[]
|
|
39
|
-
scripts: string[]
|
|
40
|
-
assets: string[]
|
|
41
38
|
license?: string
|
|
42
|
-
compatibility?:
|
|
39
|
+
compatibility?: unknown
|
|
43
40
|
'user-invocable'?: boolean
|
|
44
41
|
metadata?: Record<string, unknown>
|
|
45
42
|
}
|
|
@@ -20,7 +20,7 @@ const agent = new Agent({
|
|
|
20
20
|
id: 'network-agent',
|
|
21
21
|
name: 'Network Agent',
|
|
22
22
|
instructions: 'You are a network agent that can help users with a variety of tasks.',
|
|
23
|
-
model: 'openai/gpt-
|
|
23
|
+
model: 'openai/gpt-6.1-sol',
|
|
24
24
|
agents: {
|
|
25
25
|
agent1,
|
|
26
26
|
agent2,
|
|
@@ -25,7 +25,7 @@ export const browserAgent = new Agent({
|
|
|
25
25
|
name: 'Browser Agent',
|
|
26
26
|
instructions: `You can browse the web. Use browser_snapshot to see the page structure,
|
|
27
27
|
then interact with elements using their refs (e.g., @e5).`,
|
|
28
|
-
model: 'openai/gpt-
|
|
28
|
+
model: 'openai/gpt-6.1-sol',
|
|
29
29
|
browser,
|
|
30
30
|
})
|
|
31
31
|
```
|
|
@@ -26,7 +26,7 @@ export const browserAgent = new Agent({
|
|
|
26
26
|
name: 'Browser Agent',
|
|
27
27
|
instructions: `You can browse the web. Use browser_snapshot to see the page structure,
|
|
28
28
|
then interact with elements using their refs (e.g., @e5).`,
|
|
29
|
-
model: 'openai/gpt-
|
|
29
|
+
model: 'openai/gpt-6.1-sol',
|
|
30
30
|
browser,
|
|
31
31
|
})
|
|
32
32
|
```
|
|
@@ -28,7 +28,7 @@ export const browserAgent = new Agent({
|
|
|
28
28
|
id: 'browser-agent',
|
|
29
29
|
name: 'Browser Agent',
|
|
30
30
|
instructions: 'You can browse the web to find information.',
|
|
31
|
-
model: 'openai/gpt-
|
|
31
|
+
model: 'openai/gpt-6.1-sol',
|
|
32
32
|
browser,
|
|
33
33
|
})
|
|
34
34
|
```
|
|
@@ -53,7 +53,7 @@ export const browserAgent = new Agent({
|
|
|
53
53
|
|
|
54
54
|
**screencast.format** (`'jpeg' | 'png'`): Image format for screencast frames.
|
|
55
55
|
|
|
56
|
-
**screencast.quality** (`number`): Image quality (
|
|
56
|
+
**screencast.quality** (`number`): Image quality (0-100). Only applies to JPEG format.
|
|
57
57
|
|
|
58
58
|
**screencast.maxWidth** (`number`): Maximum width for screencast frames.
|
|
59
59
|
|
|
@@ -16,7 +16,7 @@ import { StagehandBrowser } from '@mastra/stagehand'
|
|
|
16
16
|
|
|
17
17
|
const browser = new StagehandBrowser({
|
|
18
18
|
headless: true,
|
|
19
|
-
model: 'openai/gpt-
|
|
19
|
+
model: 'openai/gpt-6.1-sol',
|
|
20
20
|
selfHeal: true,
|
|
21
21
|
})
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ export const browserAgent = new Agent({
|
|
|
26
26
|
instructions: `You can browse the web using natural language.
|
|
27
27
|
Use stagehand_act to perform actions like "click the login button".
|
|
28
28
|
Use stagehand_extract to get data from pages.`,
|
|
29
|
-
model: 'openai/gpt-
|
|
29
|
+
model: 'openai/gpt-6.1-sol',
|
|
30
30
|
browser,
|
|
31
31
|
})
|
|
32
32
|
```
|
|
@@ -278,7 +278,7 @@ const browser = new StagehandBrowser({
|
|
|
278
278
|
env: 'BROWSERBASE',
|
|
279
279
|
apiKey: process.env.BROWSERBASE_API_KEY,
|
|
280
280
|
projectId: process.env.BROWSERBASE_PROJECT_ID,
|
|
281
|
-
model: 'openai/gpt-
|
|
281
|
+
model: 'openai/gpt-6.1-sol',
|
|
282
282
|
})
|
|
283
283
|
```
|
|
284
284
|
|
|
@@ -289,7 +289,7 @@ Configure the AI model for Stagehand operations:
|
|
|
289
289
|
```typescript
|
|
290
290
|
// String format: "provider/model"
|
|
291
291
|
const browser = new StagehandBrowser({
|
|
292
|
-
model: 'openai/gpt-
|
|
292
|
+
model: 'openai/gpt-6.1-sol',
|
|
293
293
|
})
|
|
294
294
|
|
|
295
295
|
// Object format for custom configuration
|
|
@@ -57,6 +57,8 @@ await slack.configure({
|
|
|
57
57
|
|
|
58
58
|
**textFormat** (`'markdown' | 'plain'`): Dialect for the agent's final reply text, forwarded to the Slack adapter. 'markdown' (the default) posts replies as markdown so Slack renders bold text, links, and tables natively. 'plain' posts literal plain text, the escape hatch for agents prompted to emit Slack mrkdwn. Applies to buffered replies (streaming: false) and the streaming fallback; native streaming is always markdown. (Default: `'markdown'`)
|
|
59
59
|
|
|
60
|
+
**textDisplay** (`'show' | 'hidden'`): Whether the agent's reply text is posted to Slack. 'hidden' never posts it, so the agent's own messages reach Slack only through tools you give it. Tool display, approval prompts, errors, and typing status are unaffected. (Default: `'show'`)
|
|
61
|
+
|
|
60
62
|
**toolDisplay** (`ToolDisplay`): How tool calls are rendered in Slack: 'cards', 'text', 'timeline', 'grouped', 'hidden', or a function. 'hidden' suppresses tool call/result rendering entirely. 'timeline' and 'grouped' require streaming. With streaming: false, only static modes are available and the default is 'cards'. (Default: `'grouped'`)
|
|
61
63
|
|
|
62
64
|
**typingStatus** (`boolean | TypingStatusFn`): Show a typing indicator while the agent works. Set false to disable, or pass a function to return custom status text per stream chunk (return undefined to fall back to the default for that chunk). (Default: `true`)
|
|
@@ -204,6 +206,7 @@ When `connect()` builds a Slack app, the generated manifest requests a default s
|
|
|
204
206
|
| `users:read` | |
|
|
205
207
|
| `reactions:write` | |
|
|
206
208
|
| `files:read` | |
|
|
209
|
+
| `files:write` | |
|
|
207
210
|
| `assistant:write` | |
|
|
208
211
|
|
|
209
212
|
## Accessing the provider
|
|
@@ -1728,6 +1728,32 @@ The response stays nested under `data` so `truncated` is preserved. `truncated`
|
|
|
1728
1728
|
|
|
1729
1729
|
Servers whose observability store doesn't support trace aggregation return `501`. The CLI prints it like other request failures, as an `HTTP_ERROR` with the server response in `error.details.body`.
|
|
1730
1730
|
|
|
1731
|
+
#### `mastra api span query`
|
|
1732
|
+
|
|
1733
|
+
Queries completed observability spans across traces, including agent runs and tool calls nested inside other traces. The inline JSON input is required and uses the same request as [`querySpans()`](https://mastra.ai/reference/client-js/observability). Its `where` predicate filters span fields directly. Like other observability commands, it targets `https://observability.mastra.ai` by default.
|
|
1734
|
+
|
|
1735
|
+
```bash
|
|
1736
|
+
mastra api span query <input>
|
|
1737
|
+
mastra api span query '{"timeRange":{"from":"2026-08-07T00:00:00.000Z","to":"2026-08-08T00:00:00.000Z"},"where":{"op":"and","args":[{"op":"eq","left":{"path":"spanType"},"right":{"literal":"tool_call"}},{"op":"eq","left":{"path":"status"},"right":{"literal":"error"}}]}}'
|
|
1738
|
+
```
|
|
1739
|
+
|
|
1740
|
+
The response stays nested under `data` as `{ "spans": [], "page": { "next": "opaque-cursor" } }`. Pass a non-null `data.page.next` value back as `page.after` in the next query, keeping the same time range, predicate, and ordering. Run `mastra api span query --help` for more examples.
|
|
1741
|
+
|
|
1742
|
+
Servers whose observability store doesn't support span queries return `501`. Filters on identity, context, and parent or root entity fields return `422` when the store doesn't support them. Check `spanQueryContextFields` in the server's observability capabilities before using them. The CLI prints both as an `HTTP_ERROR` with the server response in `error.details.body`.
|
|
1743
|
+
|
|
1744
|
+
#### `mastra api span aggregate`
|
|
1745
|
+
|
|
1746
|
+
Groups the spans selected by a time range and optional `where` predicate, and returns one row of measures per group. It accepts the same measures, `interval`, `having`, `orderBy`, and `limit` as `trace aggregate`, but groups by span fields such as `spanType`, `entityName`, `status`, and `rootEntityName`.
|
|
1747
|
+
|
|
1748
|
+
```bash
|
|
1749
|
+
mastra api span aggregate <input>
|
|
1750
|
+
mastra api span aggregate '{"timeRange":{"from":"2026-08-01T00:00:00.000Z","to":"2026-08-08T00:00:00.000Z"},"where":{"op":"eq","left":{"path":"spanType"},"right":{"literal":"tool_call"}},"groupBy":["entityName"],"measures":["count","errorRate","duration.p95"],"orderBy":{"field":"errorRate","direction":"desc"},"limit":10}'
|
|
1751
|
+
```
|
|
1752
|
+
|
|
1753
|
+
Token and cost measures count usage on the span that recorded it, usually a `model_generation` span. They aren't added to parent spans such as `agent_run`. For span dimensions, measures, and limits, see [Aggregate spans](https://mastra.ai/reference/observability/tracing/advanced-queries). Run `mastra api span aggregate --help` for more examples.
|
|
1754
|
+
|
|
1755
|
+
Like `trace aggregate`, the command prints `rows` and `truncated` under `data`, and if the observability store can't aggregate spans, the CLI prints the server's `501` response as an `HTTP_ERROR`.
|
|
1756
|
+
|
|
1731
1757
|
#### `mastra api trace get`
|
|
1732
1758
|
|
|
1733
1759
|
Gets a lightweight timeline for one observability trace without fetching full span input, output, attributes, or metadata payloads. Pass `--verbose` to fetch the full trace payload.
|
|
@@ -81,11 +81,19 @@ Returns the controller's workspace status.
|
|
|
81
81
|
|
|
82
82
|
Returns: `Promise<AgentControllerWorkspaceStatus>`
|
|
83
83
|
|
|
84
|
-
### `session(
|
|
84
|
+
### `session(sessionId)`
|
|
85
85
|
|
|
86
|
-
Returns an `AgentControllerSession`
|
|
86
|
+
Returns an `AgentControllerSession` addressed by its session id. Every request goes to `/agent-controller/:controllerId/sessions/:sessionId/...`. Sessions are get-or-create on the server, so calling `create()` with the same `sessionId` resumes the existing conversation instead of forking it.
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
Sessions that share a resource but use different session ids each get their own run loop, thread binding, mode, model, and state. Their stored threads and resource-scoped memory belong to the shared resource. Pass the resource to `create()`:
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
const runA = client.getAgentController('code').session('run-a')
|
|
92
|
+
await runA.create({ resourceId: 'factory-1' })
|
|
93
|
+
|
|
94
|
+
const runB = client.getAgentController('code').session('run-b')
|
|
95
|
+
await runB.create({ resourceId: 'factory-1' })
|
|
96
|
+
```
|
|
89
97
|
|
|
90
98
|
## Session methods
|
|
91
99
|
|
|
@@ -93,6 +101,8 @@ Pass `scope` to address an independent session over the same `resourceId`. Sessi
|
|
|
93
101
|
|
|
94
102
|
Creates or resumes the session.
|
|
95
103
|
|
|
104
|
+
**resourceId** (`string`): Memory resource that owns the session's threads. Defaults to the session id, so a session created with only an id keeps one resource of its own.
|
|
105
|
+
|
|
96
106
|
**tags** (`Record<string, string>`): Scopes initial thread selection. A thread is a resume candidate only when its metadata matches every tag.
|
|
97
107
|
|
|
98
108
|
**threadId** (`string`): Binds the session to one exact thread, creating it with that ID when it does not exist.
|
|
@@ -170,7 +180,7 @@ Switches the active mode.
|
|
|
170
180
|
Switches the session's active model and persists it as the current model for the active thread. Switching modes doesn't change it. Pass `{ thinkingLevel }` as the second argument to apply and persist a thinking level with the model.
|
|
171
181
|
|
|
172
182
|
```typescript
|
|
173
|
-
await session.switchModel('anthropic/claude-sonnet-
|
|
183
|
+
await session.switchModel('anthropic/claude-sonnet-5-5', {
|
|
174
184
|
thinkingLevel: 'high',
|
|
175
185
|
})
|
|
176
186
|
```
|
|
@@ -321,6 +321,26 @@ await subscription.processDataStream({
|
|
|
321
321
|
|
|
322
322
|
Pass `withInitialHistory: true` (or `{ perPage }`) to receive the stored messages as a first `thread-history` chunk instead of fetching history separately. Finished runs aren't replayed after it, so completed answers don't stream again on reconnect.
|
|
323
323
|
|
|
324
|
+
In the React SDK, `useChat()` exposes the `hasMore` flag from that first page as `initialHistoryPagination`, so you can decide whether to offer loading older messages without another history request:
|
|
325
|
+
|
|
326
|
+
```typescript
|
|
327
|
+
import { useChat } from '@mastra/react'
|
|
328
|
+
|
|
329
|
+
const { messages, initialHistoryPagination } = useChat({
|
|
330
|
+
agentId: 'support-agent',
|
|
331
|
+
resourceId: 'user-123',
|
|
332
|
+
threadId: 'thread-abc',
|
|
333
|
+
enableThreadSignals: true,
|
|
334
|
+
withInitialHistory: { perPage: 20 },
|
|
335
|
+
})
|
|
336
|
+
|
|
337
|
+
// { hasMore: true }: older messages exist
|
|
338
|
+
// { hasMore: false }: the page reaches the start of the thread
|
|
339
|
+
// undefined: history is disabled, still loading, or the subscription ended
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
`initialHistoryPagination` only describes the initial subscription page for the current agent, resource, thread, and `withInitialHistory` value. It isn't changed by live output or `setMessages()`. After you load older pages yourself, use the `hasMore` value from those responses.
|
|
343
|
+
|
|
324
344
|
`subscribeToThread()` returns the underlying `Response` plus a `processDataStream()` helper. The helper reads the subscription stream until the connection closes or the request is aborted. Pass `reconnect: true` to resubscribe when the transport closes or a reconnect request fails, such as after a proxy idle timeout. If a reconnect request fails with a 4xx status (for example `401` or `403`) or `501`, `processDataStream()` stops reconnecting and rejects with the original `MastraClientError`. `408` and `429` are still retried.
|
|
325
345
|
|
|
326
346
|
**resourceId** (`string`): Resource ID for the memory thread.
|
|
@@ -829,7 +849,7 @@ const draft = await mastraClient.createStoredAgent({
|
|
|
829
849
|
instructions: 'You are a helpful assistant.',
|
|
830
850
|
model: {
|
|
831
851
|
provider: 'openai',
|
|
832
|
-
name: 'gpt-5',
|
|
852
|
+
name: 'gpt-5.6',
|
|
833
853
|
},
|
|
834
854
|
autoPublish: false,
|
|
835
855
|
})
|
|
@@ -61,7 +61,7 @@ You can also pass `requestContext` as a `Record<string, any>`.
|
|
|
61
61
|
|
|
62
62
|
**listAgentControllers()** (`Promise<AgentControllerInfo[]>`): Returns the agent controllers hosted on the connected Mastra instance. Each entry's id is the key the controller is registered under in new Mastra({ agentControllers }).
|
|
63
63
|
|
|
64
|
-
**getAgentController(controllerId)** (`AgentController`): Retrieves a specific agent controller by the key it is registered under in new Mastra({ agentControllers }), which can differ from the controller id. .session(
|
|
64
|
+
**getAgentController(controllerId)** (`AgentController`): Retrieves a specific agent controller by the key it is registered under in new Mastra({ agentControllers }), which can differ from the controller id. .session(sessionId) returns a session client; call await session.create() to create or resume the server session.
|
|
65
65
|
|
|
66
66
|
**listMemoryThreads(params)** (`Promise<StorageThreadType[]>`): Retrieves memory threads for the specified resource and agent. Requires a resourceId and an agentId.
|
|
67
67
|
|
|
@@ -90,7 +90,7 @@ const result = await mastraClient.querySpans({
|
|
|
90
90
|
console.log(result.spans)
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
Pages default to 100 rows and allow at most 1,000. The response is `{ spans, page: { next } }`, without a total count. Ordering accepts exactly one of `startedAt` or `
|
|
93
|
+
Pages default to 100 rows and allow at most 1,000. The response is `{ spans, page: { next } }`, without a total count. Ordering accepts exactly one of `startedAt`, `endedAt`, or `timeToFirstChunkMs`, ascending or descending, and defaults to descending start time. Spans without a `timeToFirstChunkMs` value sort last in both directions.
|
|
94
94
|
|
|
95
95
|
| Fields | Operators |
|
|
96
96
|
| -------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
@@ -98,16 +98,41 @@ Pages default to 100 rows and allow at most 1,000. The response is `{ spans, pag
|
|
|
98
98
|
| `organizationId`, `resourceId`, `runId`, `sessionId`, `userId`, `requestId`, `serviceName`, `experimentId`, `environment`, `executionSource` | Same string operators |
|
|
99
99
|
| Entity, parent entity and root entity `Type`, `Id`, `Name`, `VersionId` fields, such as `parentEntityId` | Same string operators |
|
|
100
100
|
| `name`, `spanType`, `status` | Same string operators; `name` also accepts `matches` / `notMatches` for normalized whole words and phrases |
|
|
101
|
-
| `startedAt`, `endedAt`, `durationMs`
|
|
101
|
+
| `startedAt`, `endedAt`, `durationMs`, `timeToFirstChunkMs` | Comparisons, membership and presence |
|
|
102
102
|
| `error` | `exists`, `notExists` |
|
|
103
103
|
|
|
104
104
|
Combine predicates with `and`, `or` and `not`. Membership uses `{ op: 'in', value: { path: 'spanType' }, set: ['agent_run', 'tool_call'] }`. A span's status is `error` when it has an error and `success` otherwise.
|
|
105
105
|
|
|
106
106
|
Each summary includes identity, context, entity lineage, status, timestamps, `durationMs`, model/provider and input/output/error previews. Model/provider are available in returned rows but aren't filterable.
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
Check `capabilities.spanQueryContextFields` from `getObservabilityCapabilities()` before using the additional identity, context and parent/root entity filters. A missing or false value means these filters aren't available. With an older adapter, requests using these filters return a structured `422` error.
|
|
109
109
|
|
|
110
|
-
DuckDB returns `null` for parent/root entity type, ID and name
|
|
110
|
+
DuckDB returns `null` for parent/root entity type, ID and name on spans written before `@mastra/duckdb` stored them. Equality filters on these fields don't match those spans.
|
|
111
|
+
|
|
112
|
+
### Aggregate spans
|
|
113
|
+
|
|
114
|
+
`aggregateSpans()` groups the spans `querySpans()` selects and returns one row per group. It counts spans at any depth, such as nested agent runs that trace aggregation misses:
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
const { capabilities } = await mastraClient.getObservabilityCapabilities()
|
|
118
|
+
|
|
119
|
+
if (capabilities.spanAggregate) {
|
|
120
|
+
const { rows, truncated } = await mastraClient.aggregateSpans({
|
|
121
|
+
timeRange: {
|
|
122
|
+
from: '2026-10-01T00:00:00.000Z',
|
|
123
|
+
to: '2026-10-08T00:00:00.000Z',
|
|
124
|
+
},
|
|
125
|
+
where: { op: 'eq', left: { path: 'spanType' }, right: { literal: 'agent_run' } },
|
|
126
|
+
groupBy: ['status'],
|
|
127
|
+
interval: '1d',
|
|
128
|
+
measures: ['count', 'errorRate'],
|
|
129
|
+
})
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
The request and response match `aggregateTraces()`, with span dimensions such as `spanType`, `name`, and `parentEntityName`. Token and cost measures belong to the span that recorded the usage and aren't added to parent spans. Check `capabilities.spanAggregate` before calling.
|
|
134
|
+
|
|
135
|
+
See [Aggregate spans](https://mastra.ai/reference/observability/tracing/advanced-queries) for selection, dimensions, per-span usage, and how to list the spans behind a group.
|
|
111
136
|
|
|
112
137
|
## Querying threads
|
|
113
138
|
|
|
@@ -22,7 +22,7 @@ import { createCodingAgent } from '@mastra/core/coding-agent'
|
|
|
22
22
|
const agent = createCodingAgent({
|
|
23
23
|
id: 'my-coding-agent',
|
|
24
24
|
name: 'My Coding Agent',
|
|
25
|
-
model: 'openai/gpt-5',
|
|
25
|
+
model: 'openai/gpt-5.6',
|
|
26
26
|
instructions: 'You are a helpful coding assistant.',
|
|
27
27
|
})
|
|
28
28
|
|
|
@@ -108,7 +108,7 @@ import { createCodingAgent } from '@mastra/core/coding-agent'
|
|
|
108
108
|
const agent = createCodingAgent({
|
|
109
109
|
id: 'my-coding-agent',
|
|
110
110
|
name: 'My Coding Agent',
|
|
111
|
-
model: 'openai/gpt-5',
|
|
111
|
+
model: 'openai/gpt-5.6',
|
|
112
112
|
instructions: 'You are a helpful coding assistant.',
|
|
113
113
|
basePath: '/srv/checkouts/my-app',
|
|
114
114
|
})
|
|
@@ -123,7 +123,7 @@ import { LocalFilesystem, LocalSandbox, Workspace } from '@mastra/core/workspace
|
|
|
123
123
|
const agent = createCodingAgent({
|
|
124
124
|
id: 'my-coding-agent',
|
|
125
125
|
name: 'My Coding Agent',
|
|
126
|
-
model: 'openai/gpt-5',
|
|
126
|
+
model: 'openai/gpt-5.6',
|
|
127
127
|
instructions: 'You are a helpful coding assistant.',
|
|
128
128
|
workspace: new Workspace({
|
|
129
129
|
filesystem: new LocalFilesystem({ basePath: '/srv/checkouts/my-app' }),
|
|
@@ -140,7 +140,7 @@ import { createCodingAgent } from '@mastra/core/coding-agent'
|
|
|
140
140
|
const agent = createCodingAgent({
|
|
141
141
|
id: 'my-coding-agent',
|
|
142
142
|
name: 'My Coding Agent',
|
|
143
|
-
model: 'openai/gpt-5',
|
|
143
|
+
model: 'openai/gpt-5.6',
|
|
144
144
|
instructions: 'You are a helpful coding assistant.',
|
|
145
145
|
workspace: undefined, // opt out of the default workspace
|
|
146
146
|
})
|
|
@@ -157,7 +157,7 @@ import { Memory } from '@mastra/memory'
|
|
|
157
157
|
const agent = createCodingAgent({
|
|
158
158
|
id: 'my-coding-agent',
|
|
159
159
|
name: 'My Coding Agent',
|
|
160
|
-
model: 'openai/gpt-5',
|
|
160
|
+
model: 'openai/gpt-5.6',
|
|
161
161
|
instructions: 'Plan multi-step work with the task tools, then carry it out.',
|
|
162
162
|
memory: new Memory(),
|
|
163
163
|
})
|
|
@@ -175,7 +175,7 @@ import { Memory } from '@mastra/memory'
|
|
|
175
175
|
const agent = createCodingAgent({
|
|
176
176
|
id: 'my-coding-agent',
|
|
177
177
|
name: 'My Coding Agent',
|
|
178
|
-
model: 'openai/gpt-5',
|
|
178
|
+
model: 'openai/gpt-5.6',
|
|
179
179
|
instructions: 'You are a helpful coding assistant.',
|
|
180
180
|
memory: new Memory(),
|
|
181
181
|
signals: [
|
|
@@ -213,11 +213,11 @@ import { Memory } from '@mastra/memory'
|
|
|
213
213
|
const agent = createCodingAgent({
|
|
214
214
|
id: 'my-coding-agent',
|
|
215
215
|
name: 'My Coding Agent',
|
|
216
|
-
model: 'openai/gpt-5',
|
|
216
|
+
model: 'openai/gpt-5.6',
|
|
217
217
|
instructions: 'You are a helpful coding assistant.',
|
|
218
218
|
memory: new Memory(),
|
|
219
219
|
goal: {
|
|
220
|
-
judge: 'openai/gpt-
|
|
220
|
+
judge: 'openai/gpt-6-luna',
|
|
221
221
|
maxRuns: 50,
|
|
222
222
|
},
|
|
223
223
|
})
|
|
@@ -34,7 +34,7 @@ export const mastra = new Mastra({
|
|
|
34
34
|
id: 'weather-agent',
|
|
35
35
|
name: 'Weather Agent',
|
|
36
36
|
instructions: 'You help with weather information',
|
|
37
|
-
model: 'openai/gpt-
|
|
37
|
+
model: 'openai/gpt-6.1-sol',
|
|
38
38
|
}),
|
|
39
39
|
},
|
|
40
40
|
})
|
|
@@ -99,6 +99,8 @@ export const mastra = new Mastra({
|
|
|
99
99
|
|
|
100
100
|
**waitTimeoutMs** (`number`): How long the agentic loop waits for a background task to complete before moving on. If a task has not finished within this time, the loop proceeds without setting isContinued. Default: undefined (do not wait). Can be overridden per-agent or per-tool.
|
|
101
101
|
|
|
102
|
+
**untilIdleMaxIdleMs** (`number`): Default idle timeout, in milliseconds, for agent.stream(..., { untilIdle: true }) calls that do not set maxIdleMs. The stream closes when background tasks are still running but no event has arrived for this long. Set it above your longest expected background task so its completion still triggers a continuation turn. A per-call untilIdle: { maxIdleMs } takes precedence. Default: 5 minutes. (Default: `300000`)
|
|
103
|
+
|
|
102
104
|
**onTaskComplete** (`(task: BackgroundTask) => void | Promise<void>`): Global callback invoked when any background task completes successfully. Fires in addition to per-tool and per-agent callbacks.
|
|
103
105
|
|
|
104
106
|
**onTaskFailed** (`(task: BackgroundTask) => void | Promise<void>`): Global callback invoked when any background task fails. Fires in addition to per-tool and per-agent callbacks.
|
|
@@ -316,7 +318,7 @@ import { ModerationProcessor } from '@mastra/core/processors'
|
|
|
316
318
|
export const mastra = new Mastra({
|
|
317
319
|
processors: {
|
|
318
320
|
moderation: new ModerationProcessor({
|
|
319
|
-
model: 'openai/gpt-
|
|
321
|
+
model: 'openai/gpt-6-luna',
|
|
320
322
|
categories: ['hate', 'harassment', 'violence'],
|
|
321
323
|
}),
|
|
322
324
|
},
|
|
@@ -357,7 +359,7 @@ import { createToxicityScorer } from '@mastra/evals/scorers/prebuilt'
|
|
|
357
359
|
|
|
358
360
|
export const mastra = new Mastra({
|
|
359
361
|
scorers: {
|
|
360
|
-
toxicity: createToxicityScorer({ model: 'openai/gpt-
|
|
362
|
+
toxicity: createToxicityScorer({ model: 'openai/gpt-6-luna' }),
|
|
361
363
|
},
|
|
362
364
|
})
|
|
363
365
|
```
|
|
@@ -615,6 +617,34 @@ export const mastra = new Mastra({
|
|
|
615
617
|
})
|
|
616
618
|
```
|
|
617
619
|
|
|
620
|
+
### bundler.pnpmWorkspaceSettings
|
|
621
|
+
|
|
622
|
+
**Type:** `Record<string, JSONValue>`\
|
|
623
|
+
**Default:** `{}`
|
|
624
|
+
|
|
625
|
+
Explicit settings to write to the generated `pnpm-workspace.yaml` when installing deployment dependencies with pnpm. Values can be strings, numbers, booleans, null, arrays, or nested objects. Other package managers ignore this option.
|
|
626
|
+
|
|
627
|
+
Use this option for pnpm install-policy settings that your deployment install should follow:
|
|
628
|
+
|
|
629
|
+
```typescript
|
|
630
|
+
import { Mastra } from '@mastra/core'
|
|
631
|
+
|
|
632
|
+
export const mastra = new Mastra({
|
|
633
|
+
bundler: {
|
|
634
|
+
pnpmWorkspaceSettings: {
|
|
635
|
+
blockExoticSubdeps: false,
|
|
636
|
+
minimumReleaseAge: 0,
|
|
637
|
+
},
|
|
638
|
+
},
|
|
639
|
+
})
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
Explicit values override copied source settings. Omitting this option preserves the existing workspace-copy behavior; it doesn't copy all settings from the source workspace.
|
|
643
|
+
|
|
644
|
+
Only these keys are supported: `allowBuilds`, `onlyBuiltDependencies`, `ignoredBuiltDependencies`, `minimumReleaseAge`, `minimumReleaseAgeExclude`, `trustPolicy`, `trustPolicyExclude`, `trustPolicyIgnoreAfter`, and `blockExoticSubdeps`. Any other key throws an error before pnpm runs, including keys Mastra generates for deployment output (`packages`, `overrides`, `patchedDependencies`, `allowUnusedPatches`, `supportedArchitectures`, `nodeLinker`) and settings that change TLS verification, registries, network access, store integrity, dependency extensions, catalogs, or build-script permissions. `neverBuiltDependencies` is rejected because pnpm 10 runs every build script it doesn't list. This option doesn't accept command-line flags and isn't a place for secrets.
|
|
645
|
+
|
|
646
|
+
Explicit `allowBuilds` and `onlyBuiltDependencies` values use the same validation as copied source build approvals.
|
|
647
|
+
|
|
618
648
|
## Server options
|
|
619
649
|
|
|
620
650
|
### server.apiRoutes
|
|
@@ -14,7 +14,7 @@ export const opsAgent = new Agent({
|
|
|
14
14
|
id: 'ops',
|
|
15
15
|
name: 'ops',
|
|
16
16
|
instructions: 'You help the team track work in Linear and GitHub.',
|
|
17
|
-
model: 'openai/gpt-
|
|
17
|
+
model: 'openai/gpt-6-luna',
|
|
18
18
|
tools: tools(),
|
|
19
19
|
})
|
|
20
20
|
```
|
|
@@ -103,7 +103,7 @@ const response = await agent.generate('Summarize my open issues.', {
|
|
|
103
103
|
The resolver also exposes methods for manual control:
|
|
104
104
|
|
|
105
105
|
- `refresh()` fetches from the platform immediately, then updates the cache and returns the tool record. Rejects if the platform fetch fails.
|
|
106
|
-
- `disconnect()` closes MCP transports
|
|
106
|
+
- `disconnect()` clears the cached snapshots and closes the MCP transports of the state behind this resolver. Resolvers created with identical options share that state, so this disconnects them too. The effect isn't permanent: a later resolution rebuilds the state, and already-returned MCP tools reconnect on their next call.
|
|
107
107
|
- `with(extra)` returns a new resolver that merges extra tools into every resolution; extras win on key collision. It accepts a static tool record or a function (sync or async) and calls chain. Spreading the resolver's result in a `tools` callback achieves the same merge; see [Tools](https://mastra.ai/docs/mastra-platform/connect/tools).
|
|
108
108
|
|
|
109
109
|
Errors fall into four groups:
|