@mastra/mcp-docs-server 1.3.9 → 1.3.10-alpha.2
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 -5
- 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 +7 -7
- package/.docs/docs/agents/processors.md +66 -20
- package/.docs/docs/agents/structured-output.md +6 -6
- package/.docs/docs/agents/tools.md +10 -10
- 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 +8 -8
- package/.docs/docs/develop.md +1 -1
- package/.docs/docs/evals/custom-scorers.md +5 -5
- package/.docs/docs/evals/experiments.md +2 -2
- package/.docs/docs/evals/multi-turn.md +2 -2
- package/.docs/docs/evals/overview.md +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 +2 -2
- package/.docs/docs/guides/streaming.md +1 -1
- package/.docs/docs/harness/agent-controller.md +7 -7
- package/.docs/docs/harness/background-tasks.md +3 -3
- package/.docs/docs/harness/durable-agents.md +5 -5
- package/.docs/docs/harness/goals.md +5 -5
- package/.docs/docs/harness/overview.md +2 -2
- package/.docs/docs/harness/schedules.md +5 -5
- package/.docs/docs/index.md +6 -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/observability.md +1 -1
- package/.docs/docs/memory/memory-processors.md +7 -7
- 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 +2 -2
- package/.docs/docs/memory/working-memory.md +2 -2
- package/.docs/docs/observability/logging.md +5 -5
- package/.docs/docs/observability/tracing/overview.md +1 -0
- package/.docs/docs/sandbox/filesystem.md +1 -0
- 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/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/editor.md +39 -23
- package/.docs/docs/subagents.md +6 -6
- 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/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 +4 -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/environment-variables.md +0 -2
- package/.docs/models/gateways/custom-gateways.md +3 -3
- package/.docs/models/gateways/merge-gateway.md +2 -14
- package/.docs/models/gateways/netlify.md +2 -1
- package/.docs/models/gateways/openrouter.md +3 -2
- package/.docs/models/gateways/vercel.md +3 -9
- package/.docs/models/index.md +13 -15
- 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/aki-io.md +5 -6
- package/.docs/models/providers/alibaba-cn.md +2 -2
- package/.docs/models/providers/alibaba.md +2 -2
- package/.docs/models/providers/ambient.md +1 -1
- package/.docs/models/providers/auriko.md +2 -2
- package/.docs/models/providers/baseten.md +4 -4
- 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/commandcode.md +0 -1
- package/.docs/models/providers/coralbricks.md +1 -1
- package/.docs/models/providers/cortecs.md +3 -3
- package/.docs/models/providers/crossmodel.md +1 -3
- package/.docs/models/providers/crusoe.md +1 -7
- package/.docs/models/providers/daoxe.md +1 -1
- package/.docs/models/providers/deepinfra.md +2 -2
- package/.docs/models/providers/digitalocean.md +6 -10
- package/.docs/models/providers/dinference.md +0 -3
- package/.docs/models/providers/edenai.md +12 -2
- package/.docs/models/providers/empiriolabs.md +0 -1
- 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 +28 -23
- package/.docs/models/providers/friendli.md +4 -5
- package/.docs/models/providers/frogbot.md +2 -7
- package/.docs/models/providers/google.md +2 -5
- package/.docs/models/providers/greenpt.md +14 -20
- package/.docs/models/providers/groq.md +1 -1
- package/.docs/models/providers/huggingface.md +3 -1
- package/.docs/models/providers/iflowcn.md +2 -18
- package/.docs/models/providers/impossibl.md +2 -9
- 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 +3 -3
- package/.docs/models/providers/jalapeno.md +14 -19
- package/.docs/models/providers/jiekou.md +53 -63
- package/.docs/models/providers/kenari.md +34 -53
- package/.docs/models/providers/kilo.md +12 -11
- package/.docs/models/providers/lilac.md +2 -8
- package/.docs/models/providers/llama.md +2 -11
- package/.docs/models/providers/llmgateway-providers.md +8 -16
- package/.docs/models/providers/llmgateway.md +9 -8
- package/.docs/models/providers/llmtr.md +1 -6
- 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 +2 -7
- package/.docs/models/providers/mistral.md +4 -3
- package/.docs/models/providers/moark.md +0 -2
- package/.docs/models/providers/nan.md +1 -1
- package/.docs/models/providers/nano-gpt.md +16 -8
- package/.docs/models/providers/nearai.md +2 -1
- 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 +1 -1
- package/.docs/models/providers/ollama-cloud.md +2 -2
- package/.docs/models/providers/opencode-go.md +2 -3
- package/.docs/models/providers/opencode.md +85 -88
- 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 +2 -12
- package/.docs/models/providers/pioneer.md +7 -7
- 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/runinfra.md +1 -4
- package/.docs/models/providers/sarvam.md +1 -2
- package/.docs/models/providers/scaleway.md +12 -11
- package/.docs/models/providers/siliconflow-cn.md +35 -41
- package/.docs/models/providers/siliconflow.md +3 -6
- package/.docs/models/providers/stackit.md +2 -4
- package/.docs/models/providers/stepfun-ai.md +4 -4
- package/.docs/models/providers/stepfun.md +4 -4
- package/.docs/models/providers/submodel.md +1 -1
- package/.docs/models/providers/synthetic.md +0 -4
- 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/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/xai.md +19 -3
- package/.docs/models/providers/xiaomi-token-plan-ams.md +4 -4
- package/.docs/models/providers/xiaomi-token-plan-cn.md +4 -4
- package/.docs/models/providers/xiaomi-token-plan-sgp.md +4 -4
- package/.docs/models/providers/xiaomi.md +4 -4
- package/.docs/models/providers/xpersona.md +0 -1
- package/.docs/models/providers/zenmux.md +105 -125
- package/.docs/models/providers.md +0 -2
- 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 +2 -2
- package/.docs/reference/agent-controller/session.md +10 -10
- package/.docs/reference/agents/agent.md +23 -47
- package/.docs/reference/agents/channels.md +13 -11
- package/.docs/reference/agents/durable-agent.md +13 -13
- 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/inngest-agent.md +1 -1
- 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 +1 -1
- 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 +2 -2
- package/.docs/reference/client-js/agents.md +18 -2
- package/.docs/reference/client-js/datasets.md +1 -1
- package/.docs/reference/client-js/observability.md +26 -1
- 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 +4 -4
- package/.docs/reference/connect/channels.md +1 -1
- package/.docs/reference/connect/credential.md +1 -1
- package/.docs/reference/connect/tools.md +8 -10
- package/.docs/reference/core/getAgentById.md +1 -1
- package/.docs/reference/core/mastra-class.md +3 -3
- package/.docs/reference/core/mastra-model-gateway.md +1 -1
- package/.docs/reference/datasets/startExperiment.md +15 -0
- package/.docs/reference/editor/mastra-editor.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/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 +6 -6
- package/.docs/reference/evals/run-evals.md +1 -1
- 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/schedules.md +1 -1
- package/.docs/reference/file-based-agents/subagents.md +4 -4
- package/.docs/reference/file-based-agents/workspace.md +1 -1
- package/.docs/reference/index.md +2 -1
- package/.docs/reference/manual-install.md +2 -2
- package/.docs/reference/memory/memory-class.md +3 -3
- package/.docs/reference/memory/observational-memory.md +16 -16
- 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 +92 -11
- package/.docs/reference/observability/tracing/bridges/otel.md +1 -1
- 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 +5 -5
- package/.docs/reference/processors/language-detector.md +1 -1
- package/.docs/reference/processors/message-history-processor.md +2 -2
- package/.docs/reference/processors/model-selection-processor.md +7 -7
- package/.docs/reference/processors/moderation-processor.md +3 -3
- package/.docs/reference/processors/pii-detector.md +2 -2
- package/.docs/reference/processors/prefill-error-handler.md +2 -2
- package/.docs/reference/processors/processor-interface.md +66 -10
- package/.docs/reference/processors/prompt-injection-detector.md +1 -1
- package/.docs/reference/processors/provider-history-compat.md +2 -2
- 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 +2 -2
- package/.docs/reference/processors/token-cost-control.md +1 -1
- package/.docs/reference/processors/token-limiter-processor.md +4 -4
- package/.docs/reference/processors/tool-call-filter.md +3 -3
- package/.docs/reference/processors/tool-search-processor.md +4 -4
- 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 +11 -1
- package/.docs/reference/pubsub/unix-socket-pubsub.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/signals/create-notification-inbox-tool.md +4 -4
- package/.docs/reference/signals/notifications.md +249 -0
- package/.docs/reference/signals/task-signal-provider.md +2 -2
- package/.docs/reference/signals/thread-events.md +69 -0
- package/.docs/reference/storage/retention.md +1 -1
- package/.docs/reference/streaming/ChunkType.md +68 -0
- package/.docs/reference/streaming/agents/stream.md +4 -4
- package/.docs/reference/tools/create-code-mode.md +1 -1
- package/.docs/reference/tools/create-tool.md +19 -2
- package/.docs/reference/tools/mcp-client.md +202 -11
- package/.docs/reference/tools/mcp-server.md +7 -5
- 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/turbopuffer.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/run-methods/timeTravel.md +1 -1
- package/.docs/reference/workspace/local-filesystem.md +1 -1
- 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 +21 -2
- package/.docs/reference/workspace/process-manager.md +13 -2
- package/.docs/reference/workspace/sandbox.md +1 -1
- package/.docs/reference/workspace/workspace-class.md +12 -12
- package/package.json +11 -11
- package/.docs/docs/guides/mcp-events.md +0 -306
- package/.docs/docs/harness/signal-providers.md +0 -212
- package/.docs/docs/harness/signals.md +0 -546
- package/.docs/docs/mastra-platform/connect/end-user-connections.md +0 -116
- package/.docs/reference/connect/user-connect-routes.md +0 -68
|
@@ -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.
|
|
@@ -177,10 +177,10 @@ Switches the active mode.
|
|
|
177
177
|
|
|
178
178
|
### `switchModel(modelId, options?)`
|
|
179
179
|
|
|
180
|
-
Switches the session's active model and persists it as the current model for the active thread
|
|
180
|
+
Switches the session's active model and persists it as the current model for the active thread, independently of mode changes. Pass `{ thinkingLevel }` as the second argument to apply and persist a thinking level with the model.
|
|
181
181
|
|
|
182
182
|
```typescript
|
|
183
|
-
await session.switchModel('anthropic/claude-sonnet-
|
|
183
|
+
await session.switchModel('anthropic/claude-sonnet-5-5', {
|
|
184
184
|
thinkingLevel: 'high',
|
|
185
185
|
})
|
|
186
186
|
```
|
|
@@ -351,6 +351,22 @@ const { messages, initialHistoryPagination } = useChat({
|
|
|
351
351
|
|
|
352
352
|
The subscription also exposes `abort(options?)` and `unsubscribe()`. `await subscription.abort({ clearPendingSignals: true })` requests an abort and clears pending signals without closing the subscription. Omit the flag to preserve pending input. `unsubscribe()` closes the subscription without aborting the run.
|
|
353
353
|
|
|
354
|
+
### `abortRun(runId)`
|
|
355
|
+
|
|
356
|
+
Requests cancellation of a durable run by its ID, including a run without a memory thread. Cancelling the response body or aborting the client-wide `abortSignal` only disconnects the observer from durable execution. A per-call `abortSignal` passed to a streaming method requests cancellation for you. Use `abortRun()` to stop a run without that signal.
|
|
357
|
+
|
|
358
|
+
```typescript
|
|
359
|
+
const runId = crypto.randomUUID()
|
|
360
|
+
const response = await agent.stream('Research this topic', { runId })
|
|
361
|
+
|
|
362
|
+
// When the user chooses Stop:
|
|
363
|
+
const { aborted } = await agent.abortRun(runId)
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
**runId** (`string`): ID of the durable run to cancel.
|
|
367
|
+
|
|
368
|
+
Returns `{ aborted: boolean }`. A remote abort request is asynchronous, so `true` doesn't confirm that the worker has stopped. Unknown or completed runs return `false`. This method requires a durable agent and Agent execution permission. Run ownership checks apply. Runs with memory threads also require `memory:write` permission when fine-grained authorization is enabled. Non-durable agents return HTTP 501.
|
|
369
|
+
|
|
354
370
|
### `abortThread()`
|
|
355
371
|
|
|
356
372
|
Requests cancellation of the thread's active run. Set `clearPendingSignals: true` to clear pending signals before aborting.
|
|
@@ -748,7 +764,7 @@ response.processDataStream({
|
|
|
748
764
|
|
|
749
765
|
### Shape client tool output for the model
|
|
750
766
|
|
|
751
|
-
Client tools support `toModelOutput` to control what the model receives, including multimodal content such as images. Because client tools execute locally, the mapping also runs on the client after `execute` completes. The transformed output
|
|
767
|
+
Client tools support `toModelOutput` to control what the model receives, including multimodal content such as images. Because client tools execute locally, the mapping also runs on the client after `execute` completes. The client sends both the transformed output and the raw result back to the server, keeping the raw result available for storage and application logic.
|
|
752
768
|
|
|
753
769
|
```typescript
|
|
754
770
|
const screenshotTool = createTool({
|
|
@@ -849,7 +865,7 @@ const draft = await mastraClient.createStoredAgent({
|
|
|
849
865
|
instructions: 'You are a helpful assistant.',
|
|
850
866
|
model: {
|
|
851
867
|
provider: 'openai',
|
|
852
|
-
name: 'gpt-5',
|
|
868
|
+
name: 'gpt-5.6',
|
|
853
869
|
},
|
|
854
870
|
autoPublish: false,
|
|
855
871
|
})
|
|
@@ -130,7 +130,7 @@ Submitting to an experiment that has a target returns a `400`. Submitting after
|
|
|
130
130
|
|
|
131
131
|
## finalizeExperiment()
|
|
132
132
|
|
|
133
|
-
Marks a caller-driven experiment completed. The server
|
|
133
|
+
Marks a caller-driven experiment completed. The server handles bookkeeping for the caller by computing per-item counts from the persisted result rows: `succeededCount` (at least one attempt without an error), `failedCount` (every attempt errored), and `skippedCount` (never submitted). Idempotent: finalizing an already-completed experiment returns the stored record.
|
|
134
134
|
|
|
135
135
|
**datasetId** (`string`): ID of the dataset the experiment runs against.
|
|
136
136
|
|
|
@@ -107,7 +107,32 @@ Each summary includes identity, context, entity lineage, status, timestamps, `du
|
|
|
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
|
})
|
|
@@ -318,7 +318,7 @@ import { ModerationProcessor } from '@mastra/core/processors'
|
|
|
318
318
|
export const mastra = new Mastra({
|
|
319
319
|
processors: {
|
|
320
320
|
moderation: new ModerationProcessor({
|
|
321
|
-
model: 'openai/gpt-
|
|
321
|
+
model: 'openai/gpt-6-luna',
|
|
322
322
|
categories: ['hate', 'harassment', 'violence'],
|
|
323
323
|
}),
|
|
324
324
|
},
|
|
@@ -359,7 +359,7 @@ import { createToxicityScorer } from '@mastra/evals/scorers/prebuilt'
|
|
|
359
359
|
|
|
360
360
|
export const mastra = new Mastra({
|
|
361
361
|
scorers: {
|
|
362
|
-
toxicity: createToxicityScorer({ model: 'openai/gpt-
|
|
362
|
+
toxicity: createToxicityScorer({ model: 'openai/gpt-6-luna' }),
|
|
363
363
|
},
|
|
364
364
|
})
|
|
365
365
|
```
|
|
@@ -639,7 +639,7 @@ export const mastra = new Mastra({
|
|
|
639
639
|
})
|
|
640
640
|
```
|
|
641
641
|
|
|
642
|
-
Explicit values override copied source settings. Omitting this option preserves the existing workspace-copy behavior
|
|
642
|
+
Explicit values override copied source settings. Omitting this option preserves the existing workspace-copy behavior, which copies only a subset of the source workspace's settings.
|
|
643
643
|
|
|
644
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
645
|
|
|
@@ -53,7 +53,7 @@ Each value in the `providers` record form is `true`, `false`, or a `ChannelsProv
|
|
|
53
53
|
|
|
54
54
|
The resolved `ChannelsResolver` satisfies `@mastra/core`'s channels-resolver contract:
|
|
55
55
|
|
|
56
|
-
- **Callable**: returns the current `Record<string, ChannelProvider>` of providers with an active connection. Mastra invokes it at runtime
|
|
56
|
+
- **Callable**: returns the current `Record<string, ChannelProvider>` of providers with an active connection. Mastra invokes it at runtime, using the TTL cache to keep repeat calls cheap. Only the first resolution waits on the platform. After the TTL expires, resolution returns the stale snapshot immediately and refreshes in the background, skipping the refresh during a short cooldown after a failed fetch, so a new connection can appear one resolution later than the TTL suggests.
|
|
57
57
|
- `getRoutes()`: the union of API routes for every enabled channel, available synchronously so Mastra can mount them at construction. Routes exist before (and after) their provider has an active connection.
|
|
58
58
|
- `refresh()`: fetches connections from the platform now and updates the cache. Rejects if the platform fetch fails.
|
|
59
59
|
- `disconnect()`: clears the cached snapshot so the next resolution fetches fresh. It doesn't tear down providers, sessions, or credentials.
|
|
@@ -42,7 +42,7 @@ Most applications should prefer [`tools()`](https://mastra.ai/reference/connect/
|
|
|
42
42
|
|
|
43
43
|
**connectionId** (`string`): ID of the connection to fetch credentials for.
|
|
44
44
|
|
|
45
|
-
**options** (`{ client?: ConnectClientOptions
|
|
45
|
+
**options** (`{ client?: ConnectClientOptions }`): Optional platform client overrides (accessToken, orgId, baseUrl, fetch). See ConnectClientOptions in tools().
|
|
46
46
|
|
|
47
47
|
## Credential handling
|
|
48
48
|
|
|
@@ -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
|
```
|
|
@@ -37,8 +37,6 @@ See [Connect](https://mastra.ai/docs/mastra-platform/connect/overview) to get st
|
|
|
37
37
|
|
|
38
38
|
**options.requireApproval** (`boolean | string[]`): Default tool-approval policy applied to every provider without its own requireApproval. true gates every provider tool except the synthetic \<provider>\_\_list\_connections helper; an array of keys or \* globs gates matching provider tools, with the same exception. A provider opts out with requireApproval: false.
|
|
39
39
|
|
|
40
|
-
**options.resourceId** (`string | ((ctx?) => string | undefined | Promise<string | undefined>)`): End-user resource ID to resolve for: the agent gets global connections plus that user's own end-user connections, and every platform call asserts the ID. Pass a string (the per-request pattern tools: ctx => tools({ resourceId: ... }) stays cheap because identical options share one internal state) or a callback derived per resolution from the invocation context. A callback returning undefined resolves global-only. See End-user connections.
|
|
41
|
-
|
|
42
40
|
**options.client** (`ConnectClientOptions`): Platform client overrides. See ConnectClientOptions below.
|
|
43
41
|
|
|
44
42
|
**options.ttlMs** (`number`): How long a resolved snapshot stays fresh, in milliseconds. Default 30000. 0 revalidates on every resolution.
|
|
@@ -58,9 +56,9 @@ const connected = tools(ctx => ({
|
|
|
58
56
|
}))
|
|
59
57
|
```
|
|
60
58
|
|
|
61
|
-
The resolver memoizes snapshots per distinct options value, so requests producing the same options share one cached snapshot with the usual `ttlMs` and stale-while-revalidate semantics. Structurally equal options returned from different calls count as the same value
|
|
59
|
+
The resolver memoizes snapshots per distinct options value, so requests producing the same options share one cached snapshot with the usual `ttlMs` and stale-while-revalidate semantics. Structurally equal options returned from different calls count as the same value, except that non-serializable values such as a custom `client.fetch` compare by identity. The resolver keeps caches for at most 32 distinct options values and evicts the least recently used one past that, so derive options from a small, closed set of inputs such as roles, not from unbounded per-request data.
|
|
62
60
|
|
|
63
|
-
With the callback form, option validation runs at the first resolution that produces
|
|
61
|
+
With the callback form, option validation runs at the first resolution that produces an options value rather than at `tools()` time, and a validation error fails that resolution. `refresh()` fetches for the options the callback returns without a context (the same variant a direct `await connected()` call uses), and `disconnect()` closes every memoized variant.
|
|
64
62
|
|
|
65
63
|
### Per-provider options
|
|
66
64
|
|
|
@@ -88,7 +86,7 @@ Every field falls back to an environment variable, so a fully env-configured app
|
|
|
88
86
|
|
|
89
87
|
## The resolver
|
|
90
88
|
|
|
91
|
-
The returned `ToolsResolver` caches its tools. Within `ttlMs` of the last fetch, it returns the cache. The first call after expiry still returns the cache right away and starts a background fetch from the platform (stale-while-revalidate). Later calls use the updated snapshot once the fetch succeeds
|
|
89
|
+
The returned `ToolsResolver` caches its tools. Within `ttlMs` of the last fetch, it returns the cache. The first call after expiry still returns the cache right away and starts a background fetch from the platform (stale-while-revalidate). Later calls use the updated snapshot once the fetch succeeds, or keep using the cached snapshot if the refresh fails. Refreshes depend on calls to the resolver rather than idle polling. Use `await connected.refresh()` to wait for a fresh tool record.
|
|
92
90
|
|
|
93
91
|
Call the resolver directly when you need a plain tool record, for example for the `toolsets` option at generate time:
|
|
94
92
|
|
|
@@ -105,10 +103,10 @@ const response = await agent.generate('Summarize my open issues.', {
|
|
|
105
103
|
The resolver also exposes methods for manual control:
|
|
106
104
|
|
|
107
105
|
- `refresh()` fetches from the platform immediately, then updates the cache and returns the tool record. Rejects if the platform fetch fails.
|
|
108
|
-
- `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.
|
|
109
|
-
- `with(extra)` returns a new resolver that merges extra tools into every resolution
|
|
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. A later resolution rebuilds the state, and already-returned MCP tools reconnect on their next call.
|
|
107
|
+
- `with(extra)` returns a new resolver that merges extra tools into every resolution, giving extras priority on key collision. It accepts a static tool record or a function (sync or async) and calls chain. For the same merge using a spread of the resolver's result in a `tools` callback, see [Tools](https://mastra.ai/docs/mastra-platform/connect/tools).
|
|
110
108
|
|
|
111
|
-
|
|
109
|
+
Error handling depends on the cause:
|
|
112
110
|
|
|
113
111
|
- Configuration errors (missing project ID or token, a malformed provider ID, both `allowTools` and `disallowTools` at one level, invalid `ttlMs`) throw when you call `tools()`. With [the callback form](#per-request-options), they fail the first resolution that produces the invalid options instead.
|
|
114
112
|
- An enabled provider ID that the platform catalog confirms is unknown fails the resolution with `invalid_options`. An unknown tool key or zero-match glob in a per-provider filter does the same. If the catalog can't be reached, an unknown ID downgrades to a warning and is skipped.
|
|
@@ -146,7 +144,7 @@ Connections in `needs_reauth` status are skipped with a warning until someone [r
|
|
|
146
144
|
|
|
147
145
|
Beyond the generated toolsets, the resolver discovers any connected provider that advertises MCP capability in the platform catalog. Discovered tools use the same flat contract, namespaced as `<provider-id>_<tool-name>`. If a provider has both a generated toolset and an MCP capability, the MCP catalog is preferred.
|
|
148
146
|
|
|
149
|
-
The application sends only its platform token
|
|
147
|
+
The application sends only its platform token. Before proxying each protocol request to the provider's MCP server, the platform removes caller authentication and injects the provider credential. MCP sessions are reused across refreshes and closed when the connection changes, the provider is detached, or `disconnect()` is called.
|
|
150
148
|
|
|
151
149
|
Discovered MCP tools follow the same approval policy as generated tools: none require approval unless `requireApproval` asks for it, for example `'neon-mcp': { requireApproval: ['neon-mcp_run_sql'] }`. Passing the removed `autoApproveTools` key throws an `invalid_options` error at call time.
|
|
152
150
|
|
|
@@ -20,7 +20,7 @@ const supportAgent = new Agent({
|
|
|
20
20
|
id: 'support-agent-id',
|
|
21
21
|
name: 'Support Agent',
|
|
22
22
|
instructions: 'Answer support questions clearly and concisely.',
|
|
23
|
-
model: 'openai/gpt-
|
|
23
|
+
model: 'openai/gpt-6.1-sol',
|
|
24
24
|
})
|
|
25
25
|
|
|
26
26
|
export const mastra = new Mastra({
|
|
@@ -149,11 +149,11 @@ Requires persistent storage. With an in-memory store, there's nothing to recover
|
|
|
149
149
|
|
|
150
150
|
Recovery processes up to five agents concurrently, with up to five run waits per agent, independently of `recovery.workflowConcurrency`. Each built-in `recoverActiveRuns()` attempt waits up to 30 seconds in total for `recover()` setup and settlement of the whole recovered workflow, then frees its slot for another run. These limits bound waiting, not live executions. This isn't an overall recovery deadline: discovery and overridden custom recovery methods aren't bounded by this budget.
|
|
151
151
|
|
|
152
|
-
A timed-out attempt continues in the background. Its outcome is `status: 'skipped'` with `reason: 'recovery-timeout'` and a future `retryAt`. It contributes only to `skipped`, not `recovered`, `succeeded`, or `failed`. Mastra schedules re-checks automatically
|
|
152
|
+
A timed-out attempt continues in the background. Its outcome is `status: 'skipped'` with `reason: 'recovery-timeout'` and a future `retryAt`. It contributes only to `skipped`, not `recovered`, `succeeded`, or `failed`. Mastra schedules re-checks automatically, deferring them until the original attempt settles to avoid starting another execution. Recovery then checks the persisted snapshot and ownership before retrying and skips finished or suspended runs. The returned counts remain unchanged by late settlement.
|
|
153
153
|
|
|
154
154
|
When shutdown begins, recovery stops dispatching new agents and runs. The recovery traversal and original attempts, including timed-out setup or execution, participate in the same shared shutdown drain as active executions. A recovery wait timeout doesn't cancel the attempt or give it a separate shutdown drain window.
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
Mastra leaves a run under its current execution's control and counts it in `skipped`. Automatic re-checks begin once that execution's claim could have lapsed, allowing recovery after a process crash without another call. `shutdown()` cancels pending re-checks. See [run ownership](https://mastra.ai/docs/harness/durable-agents).
|
|
157
157
|
|
|
158
158
|
```typescript
|
|
159
159
|
const result = await mastra.recoverAllDurableAgents()
|
|
@@ -170,4 +170,4 @@ Returns:
|
|
|
170
170
|
|
|
171
171
|
**failed** (`number`): Runs whose restart threw an error.
|
|
172
172
|
|
|
173
|
-
**skipped** (`number`): Runs skipped because they are already active, recovery is already in progress, or the recovery wait timed out.
|
|
173
|
+
**skipped** (`number`): Runs skipped because they are already active, recovery is already in progress, or the recovery wait timed out. Skips with a future retryAt, including recovery timeouts, are automatically re-checked. Timeout re-checks wait for the original attempt to settle before deciding whether to retry.
|
|
@@ -52,7 +52,7 @@ class MyCustomGateway extends MastraModelGateway {
|
|
|
52
52
|
return {
|
|
53
53
|
'my-provider': {
|
|
54
54
|
name: 'My Provider',
|
|
55
|
-
models: ['openai/gpt-
|
|
55
|
+
models: ['openai/gpt-6.1-sol', 'anthropic/claude-sonnet-5-5'],
|
|
56
56
|
apiKeyEnvVar: 'MY_API_KEY',
|
|
57
57
|
gateway: this.id,
|
|
58
58
|
},
|
|
@@ -55,12 +55,27 @@ console.log(`${summary2.succeededCount}/${summary2.totalItems} succeeded`)
|
|
|
55
55
|
console.log(`Status: ${summary2.status}`)
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
### Compare models without changing the agent
|
|
59
|
+
|
|
60
|
+
Use `agentModel` to run the same agent against a different model. The registered agent keeps its own model, and the experiment's `metadata.agentModel` records the model the run used.
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
const summary = await dataset.startExperiment({
|
|
64
|
+
targetType: 'agent',
|
|
65
|
+
targetId: 'my-agent',
|
|
66
|
+
agentModel: 'anthropic/claude-haiku-5-5',
|
|
67
|
+
scorers: ['accuracy'],
|
|
68
|
+
})
|
|
69
|
+
```
|
|
70
|
+
|
|
58
71
|
## Parameters
|
|
59
72
|
|
|
60
73
|
**targetType** (`'agent' | 'workflow' | 'scorer'`): Type of registered target to run items against. Use with targetId.
|
|
61
74
|
|
|
62
75
|
**targetId** (`string`): ID of the registered target. Use with targetType.
|
|
63
76
|
|
|
77
|
+
**agentModel** (`MastraModelConfig`): Model to run the agent target with, instead of the agent's own model. Accepts a provider/modelId string, a model config object (for example { id, url, apiKey }), a model instance, or a { model, id } object. Model functions and fallback arrays aren't supported. Applies only when targetType is 'agent'. The model is passed with each call the experiment makes, so the registered agent and other experiments are unaffected. The agent version is picked the same way as without agentModel, and sub-agents keep their own models. The experiment's metadata and each run's trace metadata record it as agentModel (for example anthropic/claude-haiku-5-5).
|
|
78
|
+
|
|
64
79
|
**scorers** (`(MastraScorer | string)[] | AgentScorerConfig | WorkflowScorerConfig`): Scorers to evaluate each result. Accepts a flat array of MastraScorer instances or registered scorer IDs, or the same categorised config shape used by runEvals (AgentScorerConfig / WorkflowScorerConfig). When this option is provided, including as \[] or an empty categorized config, it overrides item-level and dataset-level scorer IDs for every item. When omitted, each item uses its own scorerIds when present, then falls back to the dataset scorer IDs. Sources aren't merged. Trajectory scorers (type: "trajectory") automatically receive a pre-extracted Trajectory as their output regardless of which form is used. Workflow step scorers are supported only through this run-level categorized configuration. Their results carry the originating stepId and keep targetScope: "span" (matching runEvals).
|
|
65
80
|
|
|
66
81
|
**name** (`string`): Display name for the experiment.
|
|
@@ -94,7 +94,7 @@ All namespaces extend a shared CRUD base class, so they expose the same `create`
|
|
|
94
94
|
|
|
95
95
|
**agent.getById** (`(id: string, options?: GetByIdOptions) => Promise<Agent | null>`): Return a hydrated Agent instance for a stored agent. Pass options with versionId, versionNumber, or status ("draft" | "published" | "archived") to target a specific version. Default version requests are cached.
|
|
96
96
|
|
|
97
|
-
**agent.update** (`(input: StorageUpdateAgentInput) => Promise<Agent>`): Partially update a stored agent. Creates a version from the provided snapshot fields
|
|
97
|
+
**agent.update** (`(input: StorageUpdateAgentInput) => Promise<Agent>`): Partially update a stored agent. Creates a version from the provided snapshot fields and invalidates the cache. The new version is an inactive draft unless you pass activeVersionId (and status) explicitly. Set memory to null to disable memory.
|
|
98
98
|
|
|
99
99
|
**agent.delete** (`(id: string) => Promise<void>`): Delete a stored agent and remove it from the Mastra runtime registry.
|
|
100
100
|
|
|
@@ -213,7 +213,7 @@ await editor.agent.create({
|
|
|
213
213
|
id: 'support-agent',
|
|
214
214
|
name: 'Support agent',
|
|
215
215
|
instructions: 'You are a friendly support agent for Acme.',
|
|
216
|
-
model: { provider: 'openai', name: 'gpt-5' },
|
|
216
|
+
model: { provider: 'openai', name: 'gpt-5.6' },
|
|
217
217
|
memory: { type: 'id', memoryId: 'supportMemory' },
|
|
218
218
|
})
|
|
219
219
|
```
|
|
@@ -75,7 +75,7 @@ import { runEvals } from '@mastra/core/evals'
|
|
|
75
75
|
import { createAnswerRelevancyScorer } from '@mastra/evals/scorers/prebuilt'
|
|
76
76
|
import { myAgent } from './agent'
|
|
77
77
|
|
|
78
|
-
const scorer = createAnswerRelevancyScorer({ model: 'openai/gpt-
|
|
78
|
+
const scorer = createAnswerRelevancyScorer({ model: 'openai/gpt-6.1-sol' })
|
|
79
79
|
|
|
80
80
|
const result = await runEvals({
|
|
81
81
|
data: [
|
|
@@ -66,7 +66,7 @@ import { runEvals } from '@mastra/core/evals'
|
|
|
66
66
|
import { createAnswerSimilarityScorer } from '@mastra/evals/scorers/prebuilt'
|
|
67
67
|
import { myAgent } from './agent'
|
|
68
68
|
|
|
69
|
-
const scorer = createAnswerSimilarityScorer({ model: 'openai/gpt-
|
|
69
|
+
const scorer = createAnswerSimilarityScorer({ model: 'openai/gpt-6.1-sol' })
|
|
70
70
|
|
|
71
71
|
const result = await runEvals({
|
|
72
72
|
data: [
|
|
@@ -88,7 +88,7 @@ import { runEvals } from '@mastra/core/evals'
|
|
|
88
88
|
import { createBiasScorer } from '@mastra/evals/scorers/prebuilt'
|
|
89
89
|
import { myAgent } from './agent'
|
|
90
90
|
|
|
91
|
-
const scorer = createBiasScorer({ model: 'openai/gpt-
|
|
91
|
+
const scorer = createBiasScorer({ model: 'openai/gpt-6.1-sol' })
|
|
92
92
|
|
|
93
93
|
const result = await runEvals({
|
|
94
94
|
data: [
|
|
@@ -202,7 +202,7 @@ const result = await runEvals({
|
|
|
202
202
|
checks.calledTool('get_weather'),
|
|
203
203
|
checks.noToolErrors(),
|
|
204
204
|
// LLM-based scorer
|
|
205
|
-
createAnswerRelevancyScorer({ model: 'openai/gpt-
|
|
205
|
+
createAnswerRelevancyScorer({ model: 'openai/gpt-6-luna' }),
|
|
206
206
|
],
|
|
207
207
|
})
|
|
208
208
|
```
|
|
@@ -102,7 +102,7 @@ MAP = (1.0 + 0.67) / 2 = 0.835 ≈ **0.83**
|
|
|
102
102
|
|
|
103
103
|
```typescript
|
|
104
104
|
const scorer = createContextPrecisionScorer({
|
|
105
|
-
model: 'openai/gpt-
|
|
105
|
+
model: 'openai/gpt-6.1-sol',
|
|
106
106
|
options: {
|
|
107
107
|
contextExtractor: (input, output) => {
|
|
108
108
|
// Extract context dynamically based on the query
|
|
@@ -121,7 +121,7 @@ const scorer = createContextPrecisionScorer({
|
|
|
121
121
|
|
|
122
122
|
```typescript
|
|
123
123
|
const scorer = createContextPrecisionScorer({
|
|
124
|
-
model: 'openai/gpt-
|
|
124
|
+
model: 'openai/gpt-6.1-sol',
|
|
125
125
|
options: {
|
|
126
126
|
context: [
|
|
127
127
|
// Simulate retrieved documents from vector database
|
|
@@ -146,7 +146,7 @@ import { createContextPrecisionScorer } from '@mastra/evals/scorers/prebuilt'
|
|
|
146
146
|
import { myAgent } from './agent'
|
|
147
147
|
|
|
148
148
|
const scorer = createContextPrecisionScorer({
|
|
149
|
-
model: 'openai/gpt-
|
|
149
|
+
model: 'openai/gpt-6.1-sol',
|
|
150
150
|
options: {
|
|
151
151
|
contextExtractor: (input, output) => {
|
|
152
152
|
// Extract context from agent's retrieved documents
|
|
@@ -105,7 +105,7 @@ Recall = 2/3 = 0.67
|
|
|
105
105
|
|
|
106
106
|
```typescript
|
|
107
107
|
const scorer = createContextRecallScorer({
|
|
108
|
-
model: 'openai/gpt-
|
|
108
|
+
model: 'openai/gpt-6.1-sol',
|
|
109
109
|
options: {
|
|
110
110
|
contextExtractor: (input, output) => {
|
|
111
111
|
const query = input?.inputMessages?.[0]?.content || ''
|
|
@@ -121,7 +121,7 @@ const scorer = createContextRecallScorer({
|
|
|
121
121
|
|
|
122
122
|
```typescript
|
|
123
123
|
const scorer = createContextRecallScorer({
|
|
124
|
-
model: 'openai/gpt-
|
|
124
|
+
model: 'openai/gpt-6.1-sol',
|
|
125
125
|
options: {
|
|
126
126
|
context: [
|
|
127
127
|
'Document 1: Einstein was born on 14 March 1879 in Ulm, Germany.',
|
|
@@ -142,7 +142,7 @@ import { createContextRecallScorer } from '@mastra/evals/scorers/prebuilt'
|
|
|
142
142
|
import { myAgent } from './agent'
|
|
143
143
|
|
|
144
144
|
const scorer = createContextRecallScorer({
|
|
145
|
-
model: 'openai/gpt-
|
|
145
|
+
model: 'openai/gpt-6.1-sol',
|
|
146
146
|
options: {
|
|
147
147
|
contextExtractor: (input, output) => {
|
|
148
148
|
// Extract context from tool invocation results in the agent output
|