@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
|
@@ -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({
|
|
@@ -147,9 +147,9 @@ Re-drives every orphaned `running` durable-agent run across all registered durab
|
|
|
147
147
|
|
|
148
148
|
Requires persistent storage. With an in-memory store, there's nothing to recover after a process restart.
|
|
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
|
|
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. While the original attempt is pending, re-checks defer without starting another execution. After it settles, recovery checks the persisted snapshot and ownership before retrying; finished or suspended runs aren't restarted. Late settlement doesn't change the returned counts.
|
|
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
|
|
|
@@ -10,10 +10,39 @@ Use `MastraModelGatewayInterface` when you want to provide a plain object gatewa
|
|
|
10
10
|
|
|
11
11
|
## Class overview
|
|
12
12
|
|
|
13
|
+
Install the OpenAI-compatible provider used in this example:
|
|
14
|
+
|
|
15
|
+
**npm**:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @ai-sdk/openai-compatible
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**pnpm**:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm add @ai-sdk/openai-compatible
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Yarn**:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
yarn add @ai-sdk/openai-compatible
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Bun**:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
bun add @ai-sdk/openai-compatible
|
|
37
|
+
```
|
|
38
|
+
|
|
13
39
|
```typescript
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
40
|
+
import {
|
|
41
|
+
MastraModelGateway,
|
|
42
|
+
type GatewayLanguageModel,
|
|
43
|
+
type ProviderConfig,
|
|
44
|
+
} from '@mastra/core/llm'
|
|
45
|
+
import { createOpenAICompatible } from '@ai-sdk/openai-compatible'
|
|
17
46
|
|
|
18
47
|
class MyCustomGateway extends MastraModelGateway {
|
|
19
48
|
readonly id = 'custom'
|
|
@@ -23,7 +52,7 @@ class MyCustomGateway extends MastraModelGateway {
|
|
|
23
52
|
return {
|
|
24
53
|
'my-provider': {
|
|
25
54
|
name: 'My Provider',
|
|
26
|
-
models: ['openai/gpt-
|
|
55
|
+
models: ['openai/gpt-6.1-sol', 'anthropic/claude-sonnet-5-5'],
|
|
27
56
|
apiKeyEnvVar: 'MY_API_KEY',
|
|
28
57
|
gateway: this.id,
|
|
29
58
|
},
|
|
@@ -48,7 +77,7 @@ class MyCustomGateway extends MastraModelGateway {
|
|
|
48
77
|
modelId: string
|
|
49
78
|
providerId: string
|
|
50
79
|
apiKey: string
|
|
51
|
-
}): Promise<
|
|
80
|
+
}): Promise<GatewayLanguageModel> {
|
|
52
81
|
const baseURL = this.buildUrl(`${providerId}/${modelId}`)
|
|
53
82
|
return createOpenAICompatible({
|
|
54
83
|
name: providerId,
|
|
@@ -18,10 +18,16 @@ const mastra = new Mastra({/* storage config */})
|
|
|
18
18
|
await mastra.datasets.delete({ id: 'dataset-id' })
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
When `organizationId` or `projectId` is provided, deletion is scoped to those values. A tenancy mismatch is a silent no-op.
|
|
22
|
+
|
|
21
23
|
## Parameters
|
|
22
24
|
|
|
23
25
|
**id** (`string`): ID of the dataset to delete.
|
|
24
26
|
|
|
27
|
+
**organizationId** (`string`): Organization ID used to scope the deletion.
|
|
28
|
+
|
|
29
|
+
**projectId** (`string`): Project ID used to scope the deletion.
|
|
30
|
+
|
|
25
31
|
## Returns
|
|
26
32
|
|
|
27
33
|
**result** (`Promise<void>`): Resolves when the dataset is deleted.
|
|
@@ -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
|
|
|
@@ -102,9 +102,9 @@ All namespaces extend a shared CRUD base class, so they expose the same `create`
|
|
|
102
102
|
|
|
103
103
|
**agent.listResolved** (`(args?: StorageListAgentsInput) => Promise<StorageListAgentsResolvedOutput>`): Same as list, but returns fully resolved configurations with references dereferenced.
|
|
104
104
|
|
|
105
|
-
**agent.applyStoredOverrides** (`(agent: Agent, options?: {
|
|
105
|
+
**agent.applyStoredOverrides** (`(agent: Agent, options?: { status?: "draft" | "published" } | { versionId: string }, requestContext?: RequestContext) => Promise<Agent>`): Apply any stored overrides (instructions and tools) to a code-defined agent. When overrides exist, it returns a fork with them applied and leaves the input agent unchanged, so use the returned Agent. Pass either a status or a specific versionId, not both. Called internally by mastra.getAgent() — you rarely call it directly.
|
|
106
106
|
|
|
107
|
-
**agent.clone** (`(agent: Agent, options: { newId: string; newName?: string; metadata?: Record<string, unknown>; authorId?: string; requestContext?: RequestContext
|
|
107
|
+
**agent.clone** (`(agent: Agent, options: { newId: string; newName?: string; metadata?: Record<string, unknown>; authorId?: string; visibility?: "private" | "public"; requestContext?: RequestContext }) => Promise<StorageResolvedAgentType>`): Create a new stored agent by cloning an existing agent and return the resolved stored agent record.
|
|
108
108
|
|
|
109
109
|
**agent.clearCache** (`(agentId?: string) => void`): Clear the in-memory cache for one agent or all agents. Called automatically after mutations.
|
|
110
110
|
|
|
@@ -160,17 +160,19 @@ All namespaces extend a shared CRUD base class, so they expose the same `create`
|
|
|
160
160
|
|
|
161
161
|
**scorer** (`EditorScorerNamespace`): CRUD operations for scorer configurations.
|
|
162
162
|
|
|
163
|
-
**scorer.create** (`(input:
|
|
163
|
+
**scorer.create** (`(input: StorageCreateScorerDefinitionInput) => Promise<StorageResolvedScorerDefinitionType>`): Create a new stored scorer definition and return the resolved definition.
|
|
164
164
|
|
|
165
|
-
**scorer.getById** (`(id: string, options?: GetByIdOptions) => Promise<
|
|
165
|
+
**scorer.getById** (`(id: string, options?: GetByIdOptions) => Promise<StorageResolvedScorerDefinitionType | null>`): Return the resolved scorer definition for a given id.
|
|
166
166
|
|
|
167
|
-
**scorer.update** (`(input:
|
|
167
|
+
**scorer.update** (`(input: StorageUpdateScorerDefinitionInput) => Promise<StorageResolvedScorerDefinitionType>`): Partially update a stored scorer.
|
|
168
168
|
|
|
169
169
|
**scorer.delete** (`(id: string) => Promise<void>`): Delete a stored scorer and remove it from the Mastra runtime registry.
|
|
170
170
|
|
|
171
|
-
**scorer.list** (`(args?:
|
|
171
|
+
**scorer.list** (`(args?: StorageListScorerDefinitionsInput) => Promise<StorageListScorerDefinitionsOutput>`): List stored scorers with optional pagination and filters.
|
|
172
172
|
|
|
173
|
-
**scorer.listResolved** (`(args?:
|
|
173
|
+
**scorer.listResolved** (`(args?: StorageListScorerDefinitionsInput) => Promise<StorageListScorerDefinitionsResolvedOutput>`): Same as list, but returns fully resolved scorer configurations.
|
|
174
|
+
|
|
175
|
+
**scorer.resolve** (`(storedScorer: StorageResolvedScorerDefinitionType) => MastraScorer | null`): Build a runnable MastraScorer from a resolved stored definition. Supports llm-judge definitions; returns null for preset types or when instructions or model configuration are missing.
|
|
174
176
|
|
|
175
177
|
**scorer.clearCache** (`(id?: string) => void`): Clear the in-memory cache for one scorer or all scorers.
|
|
176
178
|
|
|
@@ -211,7 +213,7 @@ await editor.agent.create({
|
|
|
211
213
|
id: 'support-agent',
|
|
212
214
|
name: 'Support agent',
|
|
213
215
|
instructions: 'You are a friendly support agent for Acme.',
|
|
214
|
-
model: { provider: 'openai', name: 'gpt-5' },
|
|
216
|
+
model: { provider: 'openai', name: 'gpt-5.6' },
|
|
215
217
|
memory: { type: 'id', memoryId: 'supportMemory' },
|
|
216
218
|
})
|
|
217
219
|
```
|
|
@@ -18,7 +18,7 @@ Providers expose metadata and the legacy discovery and resolution methods. Agent
|
|
|
18
18
|
|
|
19
19
|
**capabilities** (`ToolProviderCapabilities`): Static connection and revocation capabilities. Required for VNext providers.
|
|
20
20
|
|
|
21
|
-
**defaultScope** (`'per-author' | 'caller-supplied'`): Default connection identity scope. Defaults to 'per-author' when omitted.
|
|
21
|
+
**defaultScope** (`'per-author' | 'shared' | 'caller-supplied'`): Default connection identity scope. Defaults to 'per-author' when omitted.
|
|
22
22
|
|
|
23
23
|
**listToolkits()** (`() => Promise<ToolProviderListResult<ToolProviderToolkit>>`): Lists available toolkits through the legacy interface.
|
|
24
24
|
|
|
@@ -77,7 +77,7 @@ const editor = new MastraEditor({
|
|
|
77
77
|
|
|
78
78
|
**allowedTools** (`Readonly<Record<string, readonly string[]>>`): Per-toolkit tool slug allowlists. Supports exact matches and prefix wildcards.
|
|
79
79
|
|
|
80
|
-
**defaultScope** (`'per-author' | 'caller-supplied'`): Connection identity scope. Defaults to per-author. (Default: `'per-author'`)
|
|
80
|
+
**defaultScope** (`'per-author' | 'shared' | 'caller-supplied'`): Connection identity scope. Defaults to per-author. (Default: `'per-author'`)
|
|
81
81
|
|
|
82
82
|
**userIdResolver** (`ComposioUserIdResolver`): Server-side resolver that derives the effective Composio userId from authenticated context fields. Used for invoker and caller-supplied execution. The exact connected account always comes from the stored connection pin.
|
|
83
83
|
|
|
@@ -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
|
|
@@ -123,7 +123,7 @@ import { createContextRelevanceScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
|
123
123
|
|
|
124
124
|
// Stricter penalty configuration
|
|
125
125
|
const strictScorer = createContextRelevanceScorerLLM({
|
|
126
|
-
model: 'openai/gpt-
|
|
126
|
+
model: 'openai/gpt-6.1-sol',
|
|
127
127
|
options: {
|
|
128
128
|
context: [
|
|
129
129
|
'Einstein won the Nobel Prize for photoelectric effect',
|
|
@@ -141,7 +141,7 @@ const strictScorer = createContextRelevanceScorerLLM({
|
|
|
141
141
|
|
|
142
142
|
// Lenient penalty configuration
|
|
143
143
|
const lenientScorer = createContextRelevanceScorerLLM({
|
|
144
|
-
model: 'openai/gpt-
|
|
144
|
+
model: 'openai/gpt-6.1-sol',
|
|
145
145
|
options: {
|
|
146
146
|
context: [
|
|
147
147
|
'Einstein won the Nobel Prize for photoelectric effect',
|
|
@@ -187,7 +187,7 @@ console.log('Lenient penalties:', lenientResult.score) // Higher score, less pen
|
|
|
187
187
|
|
|
188
188
|
```typescript
|
|
189
189
|
const scorer = createContextRelevanceScorerLLM({
|
|
190
|
-
model: 'openai/gpt-
|
|
190
|
+
model: 'openai/gpt-6.1-sol',
|
|
191
191
|
options: {
|
|
192
192
|
contextExtractor: (input, output) => {
|
|
193
193
|
// Extract context based on the query
|
|
@@ -211,7 +211,7 @@ const scorer = createContextRelevanceScorerLLM({
|
|
|
211
211
|
|
|
212
212
|
```typescript
|
|
213
213
|
const scorer = createContextRelevanceScorerLLM({
|
|
214
|
-
model: 'openai/gpt-
|
|
214
|
+
model: 'openai/gpt-6.1-sol',
|
|
215
215
|
options: {
|
|
216
216
|
context: ['Relevant information...', 'Supporting details...'],
|
|
217
217
|
scale: 100, // Scale scores from 0-100 instead of 0-1
|
|
@@ -225,7 +225,7 @@ const scorer = createContextRelevanceScorerLLM({
|
|
|
225
225
|
|
|
226
226
|
```typescript
|
|
227
227
|
const scorer = createContextRelevanceScorerLLM({
|
|
228
|
-
model: 'openai/gpt-
|
|
228
|
+
model: 'openai/gpt-6.1-sol',
|
|
229
229
|
options: {
|
|
230
230
|
contextExtractor: (input, output) => {
|
|
231
231
|
const query = input?.inputMessages?.[0]?.content || ''
|
|
@@ -252,7 +252,7 @@ This example shows excellent context relevance where all context directly suppor
|
|
|
252
252
|
import { createContextRelevanceScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
253
253
|
|
|
254
254
|
const scorer = createContextRelevanceScorerLLM({
|
|
255
|
-
model: 'openai/gpt-
|
|
255
|
+
model: 'openai/gpt-6.1-sol',
|
|
256
256
|
options: {
|
|
257
257
|
context: [
|
|
258
258
|
'Einstein won the Nobel Prize for his discovery of the photoelectric effect in 1921.',
|
|
@@ -299,7 +299,7 @@ This example shows moderate relevance with some context being irrelevant or unus
|
|
|
299
299
|
import { createContextRelevanceScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
300
300
|
|
|
301
301
|
const scorer = createContextRelevanceScorerLLM({
|
|
302
|
-
model: 'openai/gpt-
|
|
302
|
+
model: 'openai/gpt-6.1-sol',
|
|
303
303
|
options: {
|
|
304
304
|
context: [
|
|
305
305
|
'Solar eclipses occur when the Moon blocks the Sun.',
|
|
@@ -341,7 +341,7 @@ console.log(result)
|
|
|
341
341
|
|
|
342
342
|
// With custom penalty configuration
|
|
343
343
|
const customScorer = createContextRelevanceScorerLLM({
|
|
344
|
-
model: 'openai/gpt-
|
|
344
|
+
model: 'openai/gpt-6.1-sol',
|
|
345
345
|
options: {
|
|
346
346
|
context: [
|
|
347
347
|
'Solar eclipses occur when the Moon blocks the Sun.',
|
|
@@ -388,7 +388,7 @@ This example shows poor context relevance with mostly irrelevant information:
|
|
|
388
388
|
import { createContextRelevanceScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
389
389
|
|
|
390
390
|
const scorer = createContextRelevanceScorerLLM({
|
|
391
|
-
model: 'openai/gpt-
|
|
391
|
+
model: 'openai/gpt-6.1-sol',
|
|
392
392
|
options: {
|
|
393
393
|
context: [
|
|
394
394
|
'The Great Barrier Reef is located in Australia.',
|
|
@@ -436,7 +436,7 @@ Extract context at runtime based on the run input:
|
|
|
436
436
|
import { createContextRelevanceScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
437
437
|
|
|
438
438
|
const scorer = createContextRelevanceScorerLLM({
|
|
439
|
-
model: 'openai/gpt-
|
|
439
|
+
model: 'openai/gpt-6.1-sol',
|
|
440
440
|
options: {
|
|
441
441
|
contextExtractor: (input, output) => {
|
|
442
442
|
// Extract query from input
|
|
@@ -479,7 +479,7 @@ Integrate with RAG pipelines to evaluate retrieved context:
|
|
|
479
479
|
import { createContextRelevanceScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
480
480
|
|
|
481
481
|
const scorer = createContextRelevanceScorerLLM({
|
|
482
|
-
model: 'openai/gpt-
|
|
482
|
+
model: 'openai/gpt-6.1-sol',
|
|
483
483
|
options: {
|
|
484
484
|
contextExtractor: (input, output) => {
|
|
485
485
|
// Extract from RAG retrieval results
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
`createClassifierScorer()` adapts one constructor-configured [`Classifier`](https://mastra.ai/reference/classifier/classifier) question to Mastra's scorer pipeline. It returns a normal `MastraScorer` with a numeric `score` and retains the selected answer, probabilities, usage, warnings, and safe response metadata in `analyzeStepResult`.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Each scorer run calls `Classifier.decide()` to evaluate all questions configured on the classifier, then projects only the answer selected by `question` into a score between 0 and 1. The `question` option doesn't limit which questions are sent to the model. The adapter doesn't aggregate questions, apply boolean thresholds, infer choice ordering, or call a second judge model.
|
|
10
|
+
|
|
11
|
+
To evaluate exactly one question per scorer run, use a separate classifier configured with only that question. For example, five rubric scorers that share a five-question classifier each evaluate all five questions on every run, rather than only their selected question.
|
|
10
12
|
|
|
11
13
|
Agent scorer runs contain message objects that `Classifier.decide()` can't accept directly, so `state` is required. Use it to extract JSON-compatible text, for example with the helpers from `@mastra/evals/scorers/utils`.
|
|
12
14
|
|
|
@@ -58,6 +60,8 @@ export const qualityScorer = createClassifierScorer({
|
|
|
58
60
|
})
|
|
59
61
|
```
|
|
60
62
|
|
|
63
|
+
This classifier configures three questions so the examples below can reuse it. Each `qualityScorer.run()` evaluates `quality`, `route`, and `factual`, but only the `quality` answer determines its score. To evaluate only `quality`, remove `route` and `factual` from this classifier's `questions`.
|
|
64
|
+
|
|
61
65
|
For a score question with N criteria, the classifier answers with a level from `0` to `N - 1`, and `result.score` divides that level by `N - 1`. With three criteria, `Partially correct` scores `0.5`.
|
|
62
66
|
|
|
63
67
|
## Choice questions
|
|
@@ -155,7 +159,7 @@ Running an ID-backed scorer before registering it with Mastra rejects with an er
|
|
|
155
159
|
|
|
156
160
|
**classifier** (`Classifier | string`): A classifier with constructor-configured questions, or its registered Mastra ID.
|
|
157
161
|
|
|
158
|
-
**question** (`keyof classifier.questions`): The
|
|
162
|
+
**question** (`keyof classifier.questions`): The configured question whose answer is projected into the score. All questions configured on the classifier are evaluated on each scorer run.
|
|
159
163
|
|
|
160
164
|
**scores** (`Record<ChoiceKey, number>`): Required exhaustive mapping for choice questions. Each value must be between 0 and 1. Rejected for score and boolean questions.
|
|
161
165
|
|
|
@@ -85,7 +85,7 @@ import { myAgent } from './agent'
|
|
|
85
85
|
|
|
86
86
|
// Context is typically populated from agent tool calls or RAG retrieval
|
|
87
87
|
const scorer = createFaithfulnessScorer({
|
|
88
|
-
model: 'openai/gpt-
|
|
88
|
+
model: 'openai/gpt-6.1-sol',
|
|
89
89
|
})
|
|
90
90
|
|
|
91
91
|
const result = await runEvals({
|
|
@@ -107,7 +107,7 @@ Use static context when you have known ground truth to compare against:
|
|
|
107
107
|
import { createHallucinationScorer } from '@mastra/evals/scorers/prebuilt'
|
|
108
108
|
|
|
109
109
|
const scorer = createHallucinationScorer({
|
|
110
|
-
model: 'openai/gpt-
|
|
110
|
+
model: 'openai/gpt-6.1-sol',
|
|
111
111
|
options: {
|
|
112
112
|
context: [
|
|
113
113
|
'The first iPhone was announced on January 9, 2007.',
|
|
@@ -127,7 +127,7 @@ import { createHallucinationScorer } from '@mastra/evals/scorers/prebuilt'
|
|
|
127
127
|
import { extractToolResults } from '@mastra/evals/scorers/utils'
|
|
128
128
|
|
|
129
129
|
const scorer = createHallucinationScorer({
|
|
130
|
-
model: 'openai/gpt-
|
|
130
|
+
model: 'openai/gpt-6.1-sol',
|
|
131
131
|
options: {
|
|
132
132
|
getContext: ({ run, step }) => {
|
|
133
133
|
// Extract tool results as context
|
|
@@ -148,7 +148,7 @@ import { createHallucinationScorer } from '@mastra/evals/scorers/prebuilt'
|
|
|
148
148
|
import { extractToolResults } from '@mastra/evals/scorers/utils'
|
|
149
149
|
|
|
150
150
|
const hallucinationScorer = createHallucinationScorer({
|
|
151
|
-
model: 'openai/gpt-
|
|
151
|
+
model: 'openai/gpt-6.1-sol',
|
|
152
152
|
options: {
|
|
153
153
|
getContext: ({ run }) => {
|
|
154
154
|
const toolResults = extractToolResults(run.output)
|
|
@@ -160,7 +160,7 @@ const hallucinationScorer = createHallucinationScorer({
|
|
|
160
160
|
const agent = new Agent({
|
|
161
161
|
id: 'my-agent',
|
|
162
162
|
name: 'my-agent',
|
|
163
|
-
model: 'openai/gpt-
|
|
163
|
+
model: 'openai/gpt-6.1-sol',
|
|
164
164
|
instructions: 'You are a helpful assistant.',
|
|
165
165
|
evals: {
|
|
166
166
|
scorers: [hallucinationScorer],
|
|
@@ -176,7 +176,7 @@ import { createHallucinationScorer } from '@mastra/evals/scorers/prebuilt'
|
|
|
176
176
|
import { myAgent } from './agent'
|
|
177
177
|
|
|
178
178
|
const scorer = createHallucinationScorer({
|
|
179
|
-
model: 'openai/gpt-
|
|
179
|
+
model: 'openai/gpt-6.1-sol',
|
|
180
180
|
options: {
|
|
181
181
|
context: ['Known fact 1', 'Known fact 2'],
|
|
182
182
|
},
|
|
@@ -49,7 +49,7 @@ const result = await runEvals({
|
|
|
49
49
|
scorers: [
|
|
50
50
|
{
|
|
51
51
|
scorer: createMultiTurnJudgeScorer({
|
|
52
|
-
model: 'anthropic/claude-haiku-
|
|
52
|
+
model: 'anthropic/claude-haiku-5-5',
|
|
53
53
|
criterion:
|
|
54
54
|
'The agent provided weather forecasts for London, Paris, and Tokyo, and gave weather-appropriate packing or clothing advice.',
|
|
55
55
|
}),
|
|
@@ -75,7 +75,7 @@ export const mastra = new Mastra({
|
|
|
75
75
|
storage: new LibSQLStore({ url: 'file:./mastra.db' }),
|
|
76
76
|
scorers: {
|
|
77
77
|
'multi-turn-judge-scorer': createMultiTurnJudgeScorer({
|
|
78
|
-
model: 'anthropic/claude-haiku-
|
|
78
|
+
model: 'anthropic/claude-haiku-5-5',
|
|
79
79
|
criterion: 'placeholder',
|
|
80
80
|
}),
|
|
81
81
|
},
|
|
@@ -65,7 +65,7 @@ describe('Agent Noise Resistance Tests', () => {
|
|
|
65
65
|
|
|
66
66
|
// Step 4: Evaluate using noise sensitivity scorer
|
|
67
67
|
const scorer = createNoiseSensitivityScorerLLM({
|
|
68
|
-
model: 'openai/gpt-
|
|
68
|
+
model: 'openai/gpt-6.1-sol',
|
|
69
69
|
options: {
|
|
70
70
|
baselineResponse,
|
|
71
71
|
noisyQuery,
|
|
@@ -260,7 +260,7 @@ describe('Agent Noise Resistance CI Tests', () => {
|
|
|
260
260
|
|
|
261
261
|
// Evaluate using noise sensitivity scorer
|
|
262
262
|
const scorer = createNoiseSensitivityScorerLLM({
|
|
263
|
-
model: 'openai/gpt-
|
|
263
|
+
model: 'openai/gpt-6.1-sol',
|
|
264
264
|
options: {
|
|
265
265
|
baselineResponse: testCase.baselineResponse,
|
|
266
266
|
noisyQuery: testCase.noisyQuery,
|
|
@@ -295,7 +295,7 @@ This example shows an agent that completely resists misinformation in a test sce
|
|
|
295
295
|
import { createNoiseSensitivityScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
296
296
|
|
|
297
297
|
const scorer = createNoiseSensitivityScorerLLM({
|
|
298
|
-
model: 'openai/gpt-
|
|
298
|
+
model: 'openai/gpt-6.1-sol',
|
|
299
299
|
options: {
|
|
300
300
|
baselineResponse:
|
|
301
301
|
'Regular exercise improves cardiovascular health, strengthens muscles, and enhances mental wellbeing.',
|
|
@@ -341,7 +341,7 @@ This example shows an agent partially distracted by irrelevant requests:
|
|
|
341
341
|
import { createNoiseSensitivityScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
342
342
|
|
|
343
343
|
const scorer = createNoiseSensitivityScorerLLM({
|
|
344
|
-
model: 'openai/gpt-
|
|
344
|
+
model: 'openai/gpt-6.1-sol',
|
|
345
345
|
options: {
|
|
346
346
|
baselineResponse:
|
|
347
347
|
'To bake a cake: Mix flour, sugar, eggs, and butter. Bake at 350°F for 30 minutes.',
|
|
@@ -386,7 +386,7 @@ This example shows an agent that incorporates misinformation:
|
|
|
386
386
|
import { createNoiseSensitivityScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
387
387
|
|
|
388
388
|
const scorer = createNoiseSensitivityScorerLLM({
|
|
389
|
-
model: 'openai/gpt-
|
|
389
|
+
model: 'openai/gpt-6.1-sol',
|
|
390
390
|
options: {
|
|
391
391
|
baselineResponse: 'Climate change is caused by greenhouse gas emissions from human activities.',
|
|
392
392
|
noisyQuery:
|
|
@@ -432,7 +432,7 @@ import { createNoiseSensitivityScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
|
432
432
|
|
|
433
433
|
// Lenient scoring - more forgiving of minor issues
|
|
434
434
|
const lenientScorer = createNoiseSensitivityScorerLLM({
|
|
435
|
-
model: 'openai/gpt-
|
|
435
|
+
model: 'openai/gpt-6.1-sol',
|
|
436
436
|
options: {
|
|
437
437
|
baselineResponse: 'Python is a high-level programming language.',
|
|
438
438
|
noisyQuery: 'What is Python? Also, snakes are dangerous!',
|
|
@@ -452,7 +452,7 @@ const lenientScorer = createNoiseSensitivityScorerLLM({
|
|
|
452
452
|
|
|
453
453
|
// Strict scoring - harsh on any deviation
|
|
454
454
|
const strictScorer = createNoiseSensitivityScorerLLM({
|
|
455
|
-
model: 'openai/gpt-
|
|
455
|
+
model: 'openai/gpt-6.1-sol',
|
|
456
456
|
options: {
|
|
457
457
|
baselineResponse: 'Python is a high-level programming language.',
|
|
458
458
|
noisyQuery: 'What is Python? Also, snakes are dangerous!',
|
|
@@ -503,7 +503,7 @@ async function evaluateNoiseResistance(testCases) {
|
|
|
503
503
|
|
|
504
504
|
for (const testCase of testCases) {
|
|
505
505
|
const scorer = createNoiseSensitivityScorerLLM({
|
|
506
|
-
model: 'openai/gpt-
|
|
506
|
+
model: 'openai/gpt-6.1-sol',
|
|
507
507
|
options: {
|
|
508
508
|
baselineResponse: testCase.baseline,
|
|
509
509
|
noisyQuery: testCase.noisyQuery,
|
|
@@ -550,9 +550,9 @@ import { createNoiseSensitivityScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
|
550
550
|
|
|
551
551
|
async function compareModelRobustness() {
|
|
552
552
|
const models = [
|
|
553
|
-
{ name: 'GPT-5.4', model: 'openai/gpt-
|
|
554
|
-
{ name: 'GPT-
|
|
555
|
-
{ name: 'Claude', model: 'anthropic/claude-opus-
|
|
553
|
+
{ name: 'GPT-5.4', model: 'openai/gpt-6.1-sol' },
|
|
554
|
+
{ name: 'GPT-6 Luna', model: 'openai/gpt-6-luna' },
|
|
555
|
+
{ name: 'Claude', model: 'anthropic/claude-opus-5-5' },
|
|
556
556
|
]
|
|
557
557
|
|
|
558
558
|
const testScenario = {
|
|
@@ -602,7 +602,7 @@ Include noise sensitivity tests in your security test suite to validate prompt i
|
|
|
602
602
|
import { createNoiseSensitivityScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
603
603
|
|
|
604
604
|
const scorer = createNoiseSensitivityScorerLLM({
|
|
605
|
-
model: 'openai/gpt-
|
|
605
|
+
model: 'openai/gpt-6.1-sol',
|
|
606
606
|
options: {
|
|
607
607
|
baselineResponse: 'I can help you with programming questions.',
|
|
608
608
|
noisyQuery:
|
|
@@ -21,7 +21,7 @@ export const refundJudge = createScorer({
|
|
|
21
21
|
description: 'Judges how well refund requests were handled',
|
|
22
22
|
type: 'agent',
|
|
23
23
|
judge: {
|
|
24
|
-
model: 'openai/gpt-
|
|
24
|
+
model: 'openai/gpt-6-luna',
|
|
25
25
|
instructions: 'You are a strict QA reviewer for customer-support refund handling.',
|
|
26
26
|
},
|
|
27
27
|
})
|