@mastra/mcp-docs-server 1.3.15-alpha.2 → 1.3.15
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/guardrails.md +1 -1
- package/.docs/docs/agents/human-in-the-loop.md +2 -2
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/overview.md +2 -2
- package/.docs/docs/agents/processors.md +2 -2
- package/.docs/docs/agents/tools.md +9 -3
- package/.docs/docs/auth/composite-auth.md +1 -1
- package/.docs/docs/auth/custom-auth-provider.md +5 -5
- package/.docs/docs/auth/fga.md +1 -1
- package/.docs/docs/auth/jwt.md +2 -2
- package/.docs/docs/auth/simple-auth.md +1 -1
- package/.docs/docs/browser.md +1 -1
- package/.docs/docs/channels.md +2 -2
- package/.docs/docs/connections/sdk-agents.md +1 -1
- package/.docs/docs/deployment/overview.md +5 -5
- package/.docs/docs/deployment/web-framework.md +3 -3
- package/.docs/docs/develop.md +1 -1
- package/.docs/docs/evals/built-in-scorers.md +1 -1
- package/.docs/docs/evals/custom-scorers.md +8 -8
- package/.docs/docs/evals/overview.md +1 -1
- package/.docs/docs/evals/quick-checks.md +1 -1
- package/.docs/docs/guides/authentication-identity.md +1 -1
- package/.docs/docs/guides/context-engineering.md +1 -1
- package/.docs/docs/guides/multi-agent-systems.md +2 -2
- package/.docs/docs/harness/agent-controller.md +3 -3
- package/.docs/docs/harness/background-tasks.md +1 -1
- package/.docs/docs/harness/durable-agents.md +1 -1
- package/.docs/docs/index.md +2 -2
- package/.docs/docs/license.md +1 -1
- package/.docs/docs/mastra-platform/access-tokens.md +84 -0
- package/.docs/docs/mastra-platform/api.md +2 -2
- package/.docs/docs/mastra-platform/configuration.md +10 -14
- package/.docs/docs/mastra-platform/database.md +30 -23
- package/.docs/docs/mastra-platform/{environments.md → deploy/environments.md} +7 -7
- package/.docs/docs/mastra-platform/{github.md → deploy/github.md} +3 -3
- package/.docs/docs/mastra-platform/{deploy.md → deploy/overview.md} +8 -10
- package/.docs/docs/mastra-platform/{regions.md → deploy/regions.md} +4 -4
- package/.docs/docs/mastra-platform/{server.md → deploy/server.md} +18 -10
- package/.docs/docs/mastra-platform/{studio.md → deploy/studio.md} +2 -2
- package/.docs/docs/mastra-platform/{trace-intelligence.md → observability/trace-intelligence.md} +6 -6
- package/.docs/docs/mastra-platform/overview.md +12 -12
- package/.docs/docs/mastra-platform/system-environment-variables.md +13 -13
- package/.docs/docs/mastra-platform/team-members.md +49 -0
- package/.docs/docs/mastra-platform/workspaces.md +11 -11
- package/.docs/docs/memory/memory-processors.md +2 -2
- package/.docs/docs/memory/message-history.md +1 -1
- package/.docs/docs/memory/multi-user-threads.md +1 -1
- package/.docs/docs/memory/observational-memory.md +3 -3
- package/.docs/docs/memory/semantic-recall.md +4 -4
- package/.docs/docs/memory/working-memory.md +16 -16
- package/.docs/docs/observability/integrations/exporters/mastra-storage.md +13 -13
- package/.docs/docs/observability/overview.md +2 -2
- package/.docs/docs/observability/tracing/overview.md +4 -2
- package/.docs/docs/sandbox/filesystem.md +1 -1
- package/.docs/docs/server/custom-api-routes.md +1 -1
- package/.docs/docs/server/middleware.md +1 -1
- package/.docs/docs/server/request-context.md +1 -1
- package/.docs/docs/signals/overview.md +1 -1
- package/.docs/docs/signals/sending-signals.md +1 -1
- package/.docs/docs/studio/auth.md +1 -1
- package/.docs/docs/studio/deployment.md +3 -3
- package/.docs/docs/studio/editor.md +2 -2
- package/.docs/docs/studio/observability.md +3 -3
- package/.docs/docs/studio/overview.md +1 -1
- package/.docs/docs/workflows/control-flow.md +4 -4
- package/.docs/docs/workflows/overview.md +3 -3
- package/.docs/docs/workflows/snapshots.md +2 -2
- package/.docs/integrations/agentic-ui/ai-sdk-ui.md +3 -3
- package/.docs/integrations/agentic-ui/assistant-ui.md +5 -5
- package/.docs/integrations/agentic-ui/copilotkit.md +4 -4
- package/.docs/integrations/agentic-ui/openui.md +2 -2
- package/.docs/integrations/auth/auth0.md +3 -3
- package/.docs/integrations/auth/better-auth.md +1 -1
- package/.docs/integrations/auth/clerk.md +1 -1
- package/.docs/integrations/auth/firebase.md +3 -3
- package/.docs/integrations/auth/google.md +2 -2
- package/.docs/integrations/auth/okta.md +3 -3
- package/.docs/integrations/auth/supabase.md +1 -1
- package/.docs/integrations/auth/workos.md +1 -1
- package/.docs/integrations/browsers/stagehand.md +1 -1
- package/.docs/integrations/channels/imessage.md +1 -1
- package/.docs/integrations/channels/ring.md +6 -6
- package/.docs/integrations/channels/slack.md +1 -1
- package/.docs/integrations/channels/whatsapp.md +1 -1
- package/.docs/integrations/databases/aurora-dsql.md +13 -13
- package/.docs/integrations/databases/clickhouse.md +2 -2
- package/.docs/integrations/databases/cloudflare-d1.md +4 -4
- package/.docs/integrations/databases/cloudflare-kv.md +10 -10
- package/.docs/integrations/databases/convex.md +6 -6
- package/.docs/integrations/databases/dynamodb.md +8 -8
- package/.docs/integrations/databases/elasticsearch.md +6 -6
- package/.docs/integrations/databases/lancedb.md +4 -4
- package/.docs/integrations/databases/mongodb.md +2 -2
- package/.docs/integrations/databases/mssql.md +2 -2
- package/.docs/integrations/databases/oracledb.md +2 -2
- package/.docs/integrations/databases/postgresql.md +14 -14
- package/.docs/integrations/databases/redis.md +7 -7
- package/.docs/integrations/databases/spanner.md +2 -2
- package/.docs/integrations/databases/upstash.md +5 -5
- package/.docs/integrations/databases/valkey.md +1 -1
- package/.docs/integrations/deploy/amazon-ec2.md +1 -1
- package/.docs/integrations/deploy/aws-bedrock-agentcore.md +1 -1
- package/.docs/integrations/deploy/aws-lambda.md +12 -12
- package/.docs/integrations/deploy/azure-app-services.md +2 -2
- package/.docs/integrations/deploy/cloudflare.md +2 -2
- package/.docs/integrations/deploy/digital-ocean.md +2 -2
- package/.docs/integrations/deploy/inngest.md +5 -5
- package/.docs/integrations/deploy/kubernetes-helm.md +20 -20
- package/.docs/integrations/deploy/neon.md +1 -1
- package/.docs/integrations/deploy/netlify.md +1 -1
- package/.docs/integrations/deploy/render.md +1 -1
- package/.docs/integrations/deploy/temporal.md +1 -1
- package/.docs/integrations/deploy/vercel.md +4 -4
- package/.docs/integrations/file-storage/google-cloud-storage.md +1 -1
- package/.docs/integrations/frameworks/angular.md +1 -1
- package/.docs/integrations/frameworks/astro.md +3 -3
- package/.docs/integrations/frameworks/electron.md +1 -1
- package/.docs/integrations/frameworks/express.md +1 -1
- package/.docs/integrations/frameworks/hono.md +1 -1
- package/.docs/integrations/frameworks/nestjs.md +2 -2
- package/.docs/integrations/frameworks/next-js.md +3 -3
- package/.docs/integrations/frameworks/nuxt.md +1 -1
- package/.docs/integrations/frameworks/sveltekit.md +1 -1
- package/.docs/integrations/frameworks/tanstack-start.md +3 -3
- package/.docs/integrations/frameworks/vite-react.md +3 -3
- package/.docs/integrations/observability/arize.md +9 -9
- package/.docs/integrations/observability/arthur.md +3 -3
- package/.docs/integrations/observability/braintrust.md +3 -3
- package/.docs/integrations/observability/confident-ai.md +5 -5
- package/.docs/integrations/observability/datadog.md +9 -9
- package/.docs/integrations/observability/laminar.md +2 -2
- package/.docs/integrations/observability/langfuse.md +14 -14
- package/.docs/integrations/observability/langsmith.md +9 -9
- package/.docs/integrations/observability/opentelemetry.md +23 -23
- package/.docs/integrations/observability/sentry.md +4 -4
- package/.docs/integrations/sandboxes/agentcore.md +1 -1
- package/.docs/integrations/sandboxes/apple-container.md +2 -2
- package/.docs/integrations/sandboxes/cloudflare-sandbox.md +6 -6
- package/.docs/integrations/sandboxes/daytona.md +5 -5
- package/.docs/integrations/sandboxes/docker.md +6 -6
- package/.docs/integrations/sandboxes/e2b-desktop.md +1 -1
- package/.docs/integrations/sandboxes/e2b.md +14 -14
- package/.docs/integrations/sandboxes/modal.md +1 -1
- package/.docs/integrations/sandboxes/railway.md +1 -1
- package/.docs/integrations/sandboxes/sprites.md +2 -2
- package/.docs/integrations/sandboxes/vercel.md +4 -4
- package/.docs/integrations/vectors/couchbase.md +1 -1
- package/.docs/integrations/vectors/duckdb.md +5 -5
- package/.docs/integrations/vectors/lance.md +3 -3
- package/.docs/integrations/vectors/mongodb.md +5 -5
- package/.docs/integrations/vectors/pg.md +11 -11
- package/.docs/integrations/vectors/qdrant.md +2 -2
- package/.docs/integrations/vectors/upstash.md +4 -4
- package/.docs/integrations/voice/azure.md +1 -1
- package/.docs/integrations/voice/cloudflare.md +1 -1
- package/.docs/integrations/voice/google.md +12 -12
- package/.docs/integrations/voice/inworld.md +2 -2
- package/.docs/integrations/voice/livekit.md +25 -25
- package/.docs/integrations/voice/openai.md +4 -4
- package/.docs/integrations/voice/sarvam.md +1 -1
- package/.docs/integrations/voice/speechify.md +1 -1
- package/.docs/integrations/voice/xai.md +1 -1
- package/.docs/integrations.md +2 -2
- package/.docs/models/environment-variables.md +92 -3
- package/.docs/models/gateways/merge-gateway.md +4 -1
- package/.docs/models/gateways/neon.md +1 -2
- package/.docs/models/gateways/netlify.md +7 -6
- package/.docs/models/gateways/openrouter.md +16 -11
- package/.docs/models/gateways/requesty.md +7 -17
- package/.docs/models/gateways/vercel.md +12 -16
- package/.docs/models/index.md +93 -30
- package/.docs/models/providers/302ai.md +2 -1
- package/.docs/models/providers/abacus.md +1 -1
- package/.docs/models/providers/abliteratedllm.md +95 -0
- package/.docs/models/providers/abliteration-ai.md +7 -6
- package/.docs/models/providers/adaption.md +87 -0
- package/.docs/models/providers/adzuki.md +92 -0
- package/.docs/models/providers/aigrow.md +89 -0
- package/.docs/models/providers/aimlapi.md +1 -7
- package/.docs/models/providers/aipg.md +82 -0
- package/.docs/models/providers/aistupidlevel.md +90 -0
- package/.docs/models/providers/aki-io.md +15 -13
- package/.docs/models/providers/ambient.md +13 -12
- package/.docs/models/providers/anonrouter.md +83 -0
- package/.docs/models/providers/anthropic.md +18 -20
- package/.docs/models/providers/apiko.md +83 -0
- package/.docs/models/providers/augure.md +86 -0
- package/.docs/models/providers/autarcho.md +81 -0
- package/.docs/models/providers/bailing.md +15 -12
- package/.docs/models/providers/bumo.md +100 -0
- package/.docs/models/providers/byteplus.md +94 -0
- package/.docs/models/providers/cedarllm.md +81 -0
- package/.docs/models/providers/cheapaimodel.md +85 -0
- package/.docs/models/providers/cheapest-token.md +99 -0
- package/.docs/models/providers/cheapllm.md +81 -0
- package/.docs/models/providers/chutes.md +8 -8
- package/.docs/models/providers/cline-pass.md +4 -3
- package/.docs/models/providers/cloudcode.md +86 -0
- package/.docs/models/providers/cloudflare-workers-ai.md +2 -1
- package/.docs/models/providers/commandcode.md +22 -1
- package/.docs/models/providers/confidential-ai.md +81 -0
- package/.docs/models/providers/cortecs.md +14 -14
- package/.docs/models/providers/crossmodel.md +7 -2
- package/.docs/models/providers/deepinfra.md +3 -1
- package/.docs/models/providers/digitalocean.md +5 -4
- package/.docs/models/providers/dothoosh.md +96 -0
- package/.docs/models/providers/doubleword.md +98 -0
- package/.docs/models/providers/edenai.md +52 -44
- package/.docs/models/providers/empiriolabs.md +2 -1
- package/.docs/models/providers/engy.md +2 -1
- package/.docs/models/providers/entrim.md +84 -0
- package/.docs/models/providers/ezkielyna.md +85 -0
- package/.docs/models/providers/fastrouter.md +21 -5
- package/.docs/models/providers/fiftyx.md +81 -0
- package/.docs/models/providers/fireworks-ai.md +1 -1
- package/.docs/models/providers/fortytwo.md +81 -0
- package/.docs/models/providers/frequency.md +81 -0
- package/.docs/models/providers/frogbot.md +30 -5
- package/.docs/models/providers/gisoo.md +96 -0
- package/.docs/models/providers/google.md +5 -4
- package/.docs/models/providers/graphn.md +87 -0
- package/.docs/models/providers/hetzner.md +1 -1
- package/.docs/models/providers/hostinger-router.md +88 -0
- package/.docs/models/providers/huawei-maas.md +88 -0
- package/.docs/models/providers/hubris.md +96 -0
- package/.docs/models/providers/huggingface.md +5 -1
- package/.docs/models/providers/humain.md +82 -0
- package/.docs/models/providers/hyper.md +24 -22
- package/.docs/models/providers/inceptron.md +4 -4
- package/.docs/models/providers/infer.md +17 -9
- package/.docs/models/providers/inferall.md +86 -0
- package/.docs/models/providers/inference-coop.md +88 -0
- package/.docs/models/providers/inferenceapis.md +91 -0
- package/.docs/models/providers/inferris.md +84 -0
- package/.docs/models/providers/infersia.md +86 -0
- package/.docs/models/providers/isoquant.md +82 -0
- package/.docs/models/providers/iteracompute.md +33 -16
- package/.docs/models/providers/jad-ai.md +83 -0
- package/.docs/models/providers/joingonka.md +83 -0
- package/.docs/models/providers/jzstoken.md +102 -0
- package/.docs/models/providers/keln.md +94 -0
- package/.docs/models/providers/kenari.md +47 -12
- package/.docs/models/providers/kilo.md +191 -100
- package/.docs/models/providers/kitani.md +89 -0
- package/.docs/models/providers/klavo.md +90 -0
- package/.docs/models/providers/korouter.md +99 -0
- package/.docs/models/providers/kunavo.md +96 -0
- package/.docs/models/providers/liquid.md +15 -8
- package/.docs/models/providers/lithosai.md +83 -0
- package/.docs/models/providers/llmgateway-providers.md +96 -43
- package/.docs/models/providers/llmgateway.md +33 -21
- package/.docs/models/providers/logits.md +82 -0
- package/.docs/models/providers/lowrouter.md +17 -4
- package/.docs/models/providers/lyceum.md +88 -0
- package/.docs/models/providers/mallard.md +81 -0
- package/.docs/models/providers/meragpt.md +81 -0
- package/.docs/models/providers/mistral.md +1 -1
- package/.docs/models/providers/moneo.md +92 -0
- package/.docs/models/providers/nan.md +11 -8
- package/.docs/models/providers/nano-gpt.md +77 -73
- package/.docs/models/providers/nearai.md +1 -1
- package/.docs/models/providers/nebius.md +3 -6
- package/.docs/models/providers/neuralwatt.md +28 -25
- package/.docs/models/providers/nodecode.md +81 -0
- package/.docs/models/providers/nokeep.md +83 -0
- package/.docs/models/providers/novita-ai.md +4 -1
- package/.docs/models/providers/oathbreaker.md +82 -0
- package/.docs/models/providers/obscurify.md +95 -0
- package/.docs/models/providers/ofox.md +7 -3
- package/.docs/models/providers/ollama-cloud.md +2 -1
- package/.docs/models/providers/openai.md +4 -2
- package/.docs/models/providers/opencode-go.md +3 -1
- package/.docs/models/providers/opencode.md +5 -3
- package/.docs/models/providers/opper.md +2 -1
- package/.docs/models/providers/outerlabs.md +98 -0
- package/.docs/models/providers/paraloncloud.md +81 -0
- package/.docs/models/providers/pareto.md +9 -7
- package/.docs/models/providers/phala.md +99 -0
- package/.docs/models/providers/phase.md +82 -0
- package/.docs/models/providers/powerspring.md +87 -0
- package/.docs/models/providers/prime.md +5 -5
- package/.docs/models/providers/proxystacks.md +84 -0
- package/.docs/models/providers/rayline.md +82 -0
- package/.docs/models/providers/refuseless.md +86 -0
- package/.docs/models/providers/ruapi.md +89 -0
- package/.docs/models/providers/runcrate.md +91 -0
- package/.docs/models/providers/runinfra.md +2 -1
- package/.docs/models/providers/sagg.md +81 -0
- package/.docs/models/providers/sambanova.md +10 -12
- package/.docs/models/providers/sandbase.md +90 -0
- package/.docs/models/providers/scx-ai.md +20 -10
- package/.docs/models/providers/sensenova.md +4 -4
- package/.docs/models/providers/siliconflow-cn.md +2 -1
- package/.docs/models/providers/sokkan.md +85 -0
- package/.docs/models/providers/sparrowcodes.md +99 -0
- package/.docs/models/providers/steadyrouter.md +101 -0
- package/.docs/models/providers/stepping-stone.md +95 -0
- package/.docs/models/providers/superbot-gg.md +82 -0
- package/.docs/models/providers/synthetic.md +14 -14
- package/.docs/models/providers/synthorai.md +92 -0
- package/.docs/models/providers/teamorouter.md +90 -0
- package/.docs/models/providers/teapot-router.md +87 -0
- package/.docs/models/providers/tencent-token-plan.md +23 -11
- package/.docs/models/providers/tenstorrent.md +84 -0
- package/.docs/models/providers/therouter.md +81 -0
- package/.docs/models/providers/tinfoil.md +1 -1
- package/.docs/models/providers/toapis.md +83 -0
- package/.docs/models/providers/tokenify.md +85 -0
- package/.docs/models/providers/tokenlab.md +81 -0
- package/.docs/models/providers/tokenwatt.md +81 -0
- package/.docs/models/providers/trustedtokens.md +90 -0
- package/.docs/models/providers/umans-ai-coding-plan.md +2 -5
- package/.docs/models/providers/umans-ai.md +5 -7
- package/.docs/models/providers/unbiased.md +81 -0
- package/.docs/models/providers/uncensuredai.md +83 -0
- package/.docs/models/providers/unrestricted.md +84 -0
- package/.docs/models/providers/uplinkswitch.md +92 -0
- package/.docs/models/providers/verda.md +81 -0
- package/.docs/models/providers/volcengine-coding-plan.md +16 -9
- package/.docs/models/providers/volcengine.md +2 -2
- package/.docs/models/providers/wafer.ai.md +20 -10
- package/.docs/models/providers/wallaby.md +7 -5
- package/.docs/models/providers/wally.md +9 -8
- package/.docs/models/providers/watt.md +98 -0
- package/.docs/models/providers/xxapi.md +96 -0
- package/.docs/models/providers/zenifra.md +22 -10
- package/.docs/models/providers/zerogpu.md +89 -0
- package/.docs/models/providers/zro.md +85 -0
- package/.docs/models/providers.md +92 -3
- package/.docs/reference/agents/agent.md +1 -1
- package/.docs/reference/agents/durable-agent.md +2 -2
- package/.docs/reference/agents/generateLegacy.md +4 -4
- package/.docs/reference/agents/network.md +2 -2
- package/.docs/reference/ai-sdk/overview.md +2 -2
- package/.docs/reference/build-with-ai.md +3 -3
- package/.docs/reference/channels/slack-provider.md +1 -1
- package/.docs/reference/classifier/classifier.md +1 -1
- package/.docs/reference/cli/mastra.md +4 -4
- package/.docs/reference/client-js/agent-controller.md +1 -1
- package/.docs/reference/client-js/memory.md +10 -10
- package/.docs/reference/client-js/observability.md +1 -1
- package/.docs/reference/client-js/responses.md +1 -1
- package/.docs/reference/client-js/tools.md +2 -2
- package/.docs/reference/client-js/vectors.md +6 -6
- package/.docs/reference/configuration.md +1 -1
- package/.docs/reference/connect/tools.md +1 -1
- package/.docs/reference/deployer.md +4 -4
- package/.docs/reference/evals/answer-relevancy.md +2 -2
- package/.docs/reference/evals/bias.md +2 -2
- package/.docs/reference/evals/checks.md +1 -1
- package/.docs/reference/evals/completeness.md +4 -4
- package/.docs/reference/evals/content-similarity.md +4 -4
- package/.docs/reference/evals/context-precision.md +6 -6
- package/.docs/reference/evals/context-recall.md +1 -1
- package/.docs/reference/evals/context-relevance.md +9 -9
- package/.docs/reference/evals/create-scorer.md +3 -3
- package/.docs/reference/evals/faithfulness.md +1 -1
- package/.docs/reference/evals/hallucination.md +6 -6
- package/.docs/reference/evals/keyword-coverage.md +2 -2
- package/.docs/reference/evals/multi-turn-judge.md +1 -1
- package/.docs/reference/evals/noise-sensitivity.md +16 -16
- package/.docs/reference/evals/prompt-alignment.md +25 -25
- package/.docs/reference/evals/run-evals.md +2 -2
- package/.docs/reference/evals/summarization.md +1 -1
- package/.docs/reference/evals/textual-difference.md +2 -2
- package/.docs/reference/evals/tone-consistency.md +2 -2
- package/.docs/reference/evals/tool-call-accuracy.md +10 -10
- package/.docs/reference/evals/toxicity.md +2 -2
- package/.docs/reference/evals/trajectory-accuracy.md +2 -2
- package/.docs/reference/manual-install.md +2 -2
- package/.docs/reference/memory/listThreads.md +1 -1
- package/.docs/reference/migrations/agentnetwork.md +1 -1
- package/.docs/reference/migrations/mastra-cloud.md +9 -9
- package/.docs/reference/migrations/mcp-v2.md +1 -1
- package/.docs/reference/migrations/upgrade-to-v1/deployment.md +1 -1
- package/.docs/reference/migrations/upgrade-to-v1/overview.md +8 -8
- package/.docs/reference/migrations/upgrade-to-v1/tracing.md +3 -3
- package/.docs/reference/observability/tracing/advanced-queries.md +1 -1
- package/.docs/reference/observability/tracing/bridges/datadog.md +4 -4
- package/.docs/reference/observability/tracing/bridges/otel.md +4 -4
- package/.docs/reference/observability/tracing/exporters/arize.md +4 -4
- package/.docs/reference/observability/tracing/exporters/arthur.md +3 -3
- package/.docs/reference/observability/tracing/exporters/braintrust.md +2 -2
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +2 -2
- package/.docs/reference/observability/tracing/exporters/confident-ai.md +2 -2
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/datadog.md +3 -3
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +5 -5
- package/.docs/reference/observability/tracing/exporters/laminar.md +2 -2
- package/.docs/reference/observability/tracing/exporters/langfuse.md +3 -3
- package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/mastra-storage-exporter.md +5 -5
- package/.docs/reference/observability/tracing/exporters/otel.md +4 -4
- package/.docs/reference/observability/tracing/exporters/posthog.md +2 -2
- package/.docs/reference/observability/tracing/exporters/sentry.md +4 -4
- package/.docs/reference/observability/tracing/instances.md +1 -1
- package/.docs/reference/processors/model-selection-processor.md +2 -2
- package/.docs/reference/processors/processor-interface.md +3 -3
- package/.docs/reference/processors/stream-error-retry-processor.md +1 -1
- package/.docs/reference/processors/system-prompt-scrubber.md +1 -1
- package/.docs/reference/processors/token-limiter-processor.md +1 -1
- package/.docs/reference/processors/unicode-normalizer.md +1 -1
- package/.docs/reference/project-structure.md +2 -2
- package/.docs/reference/pubsub/google-cloud-pubsub.md +1 -1
- package/.docs/reference/pubsub/lease-provider.md +1 -1
- package/.docs/reference/pubsub/redis-streams.md +1 -1
- package/.docs/reference/pubsub/unix-socket-pubsub.md +1 -1
- package/.docs/reference/rag/chunk.md +1 -1
- package/.docs/reference/rag/chunking-and-embedding.md +4 -4
- package/.docs/reference/rag/database-config.md +4 -4
- package/.docs/reference/rag/graph-rag-guide.md +3 -3
- package/.docs/reference/rag/metadata-filters.md +4 -4
- package/.docs/reference/rag/overview.md +4 -0
- package/.docs/reference/rag/rerank.md +1 -1
- package/.docs/reference/rag/rerankWithScorer.md +1 -1
- package/.docs/reference/rag/retrieval.md +8 -6
- package/.docs/reference/rag/vector-databases.md +7 -7
- package/.docs/reference/server/nestjs-adapter.md +1 -1
- package/.docs/reference/server/register-api-route.md +5 -5
- package/.docs/reference/storage/composite.md +1 -1
- package/.docs/reference/storage/overview.md +1 -1
- package/.docs/reference/storage/retention.md +2 -2
- package/.docs/reference/storage/turso.md +1 -1
- package/.docs/reference/streaming/agents/MastraModelOutput.md +5 -5
- package/.docs/reference/streaming/agents/stream.md +5 -5
- package/.docs/reference/streaming/agents/streamLegacy.md +4 -4
- package/.docs/reference/templates/overview.md +1 -1
- package/.docs/reference/tools/bedrock-kb-tool.md +8 -8
- package/.docs/reference/tools/create-tool.md +1 -1
- package/.docs/reference/tools/mcp-client.md +9 -9
- package/.docs/reference/tools/mcp-server.md +17 -17
- package/.docs/reference/tools/vector-query-tool.md +6 -6
- package/.docs/reference/voice/composite-voice.md +3 -3
- package/.docs/reference/voice/overview.md +5 -5
- package/.docs/reference/voice/speech-to-speech.md +2 -2
- package/.docs/reference/voice/voice.close.md +1 -1
- package/.docs/reference/voice/voice.connect.md +1 -1
- package/.docs/reference/voice/voice.listen.md +1 -1
- package/.docs/reference/voice/voice.speak.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 +1 -1
- package/package.json +4 -4
- /package/.docs/docs/mastra-platform/{observability.md → observability/overview.md} +0 -0
|
@@ -109,7 +109,7 @@ Visit [Middleware](https://mastra.ai/docs/server/middleware) for how to use serv
|
|
|
109
109
|
|
|
110
110
|
## Studio
|
|
111
111
|
|
|
112
|
-
When developing locally, you can define presets in a JSON file and load them into [Studio](https://mastra.ai/docs/studio/overview) with the [`--request-context-presets`](https://mastra.ai/reference/cli/mastra) CLI flag. This adds a dropdown to the request context editor in Studio so you can
|
|
112
|
+
When developing locally, you can define presets in a JSON file and load them into [Studio](https://mastra.ai/docs/studio/overview) with the [`--request-context-presets`](https://mastra.ai/reference/cli/mastra) CLI flag. This adds a dropdown to the request context editor in Studio so you can switch between configurations without manually editing JSON each time.
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
115
|
mastra dev --request-context-presets ./presets.json
|
|
@@ -18,7 +18,7 @@ For a one-off request, use [`agent.stream()`](https://mastra.ai/reference/stream
|
|
|
18
18
|
|
|
19
19
|
Create an agent, subscribe to a thread, then send input to that thread. Subscribing first means the subscription is already open when the input starts a run.
|
|
20
20
|
|
|
21
|
-
### Use an
|
|
21
|
+
### Use an agent
|
|
22
22
|
|
|
23
23
|
This example stores thread history with [Memory](https://mastra.ai/docs/memory/overview), using a local libSQL database, so the same conversation is available across runs and process restarts. Memory accepts any supported storage adapter, and the thread is created on the first run.
|
|
24
24
|
|
|
@@ -151,7 +151,7 @@ subscription.abort({ clearPendingSignals: true })
|
|
|
151
151
|
|
|
152
152
|
Without a subscription, call [`agent.abortThreadStream()`](https://mastra.ai/reference/agents/agent) with the same option. Listeners stay subscribed and a later message can start a run. With shared PubSub, the clear request reaches the owning process but clears only its local queue. Neither abort nor cancellation revokes an acceptance that already resolved. Continuations are separate, so aborting the original doesn't cancel them.
|
|
153
153
|
|
|
154
|
-
## AgentController and
|
|
154
|
+
## AgentController and session
|
|
155
155
|
|
|
156
156
|
Most applications use the `Agent` methods directly. AgentController's `Session` wraps them and manages the subscription:
|
|
157
157
|
|
|
@@ -10,7 +10,7 @@ Without authentication, Studio and all API routes are publicly accessible.
|
|
|
10
10
|
|
|
11
11
|
> **Note:** In production, the Studio sign-in screen with a third-party provider, role-based access control (RBAC), and fine-grained authorization (FGA) require a Mastra Enterprise Edition (EE) license. Simple Auth, JWT, and authentication on API routes don't. Every feature works without a license in development. See [what requires an EE license](https://mastra.ai/docs/license). [Contact sales](https://mastra.ai/contact) for more information.
|
|
12
12
|
|
|
13
|
-
> **Note:** Studio deployed on Mastra platform works differently. By default, the platform injects its own auth so only your organization members can sign in, and your `server.auth` applies to API routes only. Set `MASTRA_PLATFORM_STUDIO_AUTH=disabled` to opt out. See [Authentication on Mastra platform](https://mastra.ai/docs/mastra-platform/studio).
|
|
13
|
+
> **Note:** Studio deployed on Mastra platform works differently. By default, the platform injects its own auth so only your organization members can sign in, and your `server.auth` applies to API routes only. Set `MASTRA_PLATFORM_STUDIO_AUTH=disabled` to opt out. See [Authentication on Mastra platform](https://mastra.ai/docs/mastra-platform/deploy/studio).
|
|
14
14
|
|
|
15
15
|
## When to use Studio Auth
|
|
16
16
|
|
|
@@ -11,7 +11,7 @@ You can deploy Studio in two primary ways:
|
|
|
11
11
|
- The Mastra platform provides a hosted Studio for you and allows you to share access with your team via link
|
|
12
12
|
- Self-host Studio on your own infrastructure, either alongside your Mastra server or separately as a standalone SPA
|
|
13
13
|
|
|
14
|
-
On this page you'll learn how to deploy Studio on your own infrastructure. As the finer details of deployment can vary widely based on your needs and setup,
|
|
14
|
+
On this page you'll learn how to deploy Studio on your own infrastructure. As the finer details of deployment can vary widely based on your needs and setup, this page covers the general principles and options available to you.
|
|
15
15
|
|
|
16
16
|
## Quickstart
|
|
17
17
|
|
|
@@ -65,13 +65,13 @@ The command uses Node's built-in `http` module and [`serve-handler`](https://www
|
|
|
65
65
|
|
|
66
66
|
## Mastra platform
|
|
67
67
|
|
|
68
|
-
For hosted Studio on Mastra platform, see [Studio on Mastra platform](https://mastra.ai/docs/mastra-platform/studio).
|
|
68
|
+
For hosted Studio on Mastra platform, see [Studio on Mastra platform](https://mastra.ai/docs/mastra-platform/deploy/studio).
|
|
69
69
|
|
|
70
70
|
## Running a server
|
|
71
71
|
|
|
72
72
|
Running `mastra studio` as a long-running process is no different from running any other Node.js service. The same deployment practices and tools apply here. Use process managers such as PM2 or Docker. Cloud services that support Node.js applications are another option. As with any web service, configure CORS correctly and monitor errors.
|
|
73
73
|
|
|
74
|
-
> **Warning:** Once Studio is connected to your Mastra server, it has full access to your agents, workflows, and tools. Be sure to secure it
|
|
74
|
+
> **Warning:** Once Studio is connected to your Mastra server, it has full access to your agents, workflows, and tools. Be sure to secure it in production (e.g. behind authentication, VPN, etc.) to prevent unauthorized access.
|
|
75
75
|
>
|
|
76
76
|
> Visit the [Authentication](https://mastra.ai/docs/studio/auth) docs to learn more.
|
|
77
77
|
|
|
@@ -12,7 +12,7 @@ A [deployed Studio](https://mastra.ai/docs/studio/deployment) makes Editor avail
|
|
|
12
12
|
|
|
13
13
|
> **📹 Watch:** Watch the [Mastra Editor workshop](https://www.youtube.com/watch?v=XTjuRoI7t_k\&pp=ygUWbWFzdHJhIGVkaXRvciB3b3Jrc2hvcA%3D%3D) for a guided walkthrough.
|
|
14
14
|
|
|
15
|
-
## When to use
|
|
15
|
+
## When to use editor
|
|
16
16
|
|
|
17
17
|
Use Editor when an agent is defined in code but the people responsible for its behavior shouldn't edit the codebase. It works well when instructions or tools change often and need testing before they reach users. If developers own every change and release agent configuration with the application, keep the [agent configuration in code](https://mastra.ai/docs/agents/overview) instead.
|
|
18
18
|
|
|
@@ -63,7 +63,7 @@ export const mastra = new Mastra({
|
|
|
63
63
|
})
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
## Use
|
|
66
|
+
## Use editor in Studio
|
|
67
67
|
|
|
68
68
|
In [Studio](https://mastra.ai/docs/studio/overview), open **Agents**, select an agent, then select **Editor**. Collaborators can update the agent's instructions and tools based on its Editor permissions.
|
|
69
69
|
|
|
@@ -14,7 +14,7 @@ All require an observability storage backend to be configured.
|
|
|
14
14
|
|
|
15
15
|
## Quickstart
|
|
16
16
|
|
|
17
|
-
For detailed instructions, follow the [observability instructions](https://mastra.ai/docs/observability/overview). To get
|
|
17
|
+
For detailed instructions, follow the [observability instructions](https://mastra.ai/docs/observability/overview). To get started fast, add the `@mastra/observability` package to your project and configure it with [LibSQL](https://mastra.ai/integrations/databases/libsql) and [DuckDB](https://mastra.ai/integrations/vectors/duckdb) for a local development setup that supports both traces and metrics.
|
|
18
18
|
|
|
19
19
|
**npm**:
|
|
20
20
|
|
|
@@ -84,7 +84,7 @@ export const mastra = new Mastra({
|
|
|
84
84
|
|
|
85
85
|
## Mastra platform
|
|
86
86
|
|
|
87
|
-
For hosted traces, logs, and metrics across projects and deploys, see [Observability on Mastra platform](https://mastra.ai/docs/mastra-platform/observability).
|
|
87
|
+
For hosted traces, logs, and metrics across projects and deploys, see [Observability on Mastra platform](https://mastra.ai/docs/mastra-platform/observability/overview).
|
|
88
88
|
|
|
89
89
|
## Metrics
|
|
90
90
|
|
|
@@ -122,4 +122,4 @@ Log forwarding is enabled by default when you configure observability. See [logg
|
|
|
122
122
|
- [Metrics overview](https://mastra.ai/docs/observability/metrics/overview)
|
|
123
123
|
- [Traces usage](https://mastra.ai/docs/observability/tracing/overview)
|
|
124
124
|
- [Logging](https://mastra.ai/docs/observability/logging)
|
|
125
|
-
- [Mastra platform observability](https://mastra.ai/docs/mastra-platform/observability)
|
|
125
|
+
- [Mastra platform observability](https://mastra.ai/docs/mastra-platform/observability/overview)
|
|
@@ -45,7 +45,7 @@ Studio lets you edit your [agents](https://mastra.ai/docs/agents/overview), [wor
|
|
|
45
45
|
|
|
46
46
|
## Deploy Studio
|
|
47
47
|
|
|
48
|
-
When you're ready to share Studio with your team, you can deploy it to production using [Studio on Mastra platform](https://mastra.ai/docs/mastra-platform/studio) or your own infrastructure. Visit the [deployment docs](https://mastra.ai/docs/studio/deployment) to learn how.
|
|
48
|
+
When you're ready to share Studio with your team, you can deploy it to production using [Studio on Mastra platform](https://mastra.ai/docs/mastra-platform/deploy/studio) or your own infrastructure. Visit the [deployment docs](https://mastra.ai/docs/studio/deployment) to learn how.
|
|
49
49
|
|
|
50
50
|
## Primitives
|
|
51
51
|
|
|
@@ -423,7 +423,7 @@ The `.map()` method provides additional helper functions for more complex mappin
|
|
|
423
423
|
- [`getInitData<any>()`](https://mastra.ai/reference/workflows/workflow-methods/map): Access the workflow's initial input data
|
|
424
424
|
- [`mapVariable()`](https://mastra.ai/reference/workflows/workflow-methods/map): Use declarative object syntax to extract and rename fields
|
|
425
425
|
|
|
426
|
-
### Parallel and
|
|
426
|
+
### Parallel and branch outputs
|
|
427
427
|
|
|
428
428
|
Both `.parallel()` and `.branch()` return an object keyed by child step `id`. Use `.map()` to reshape that output for the next operation. This example maps two parallel results into the shared input required by `.branch()`:
|
|
429
429
|
|
|
@@ -502,7 +502,7 @@ Workflows support different looping methods that let you repeat steps until or w
|
|
|
502
502
|
|
|
503
503
|
### Looping with `.dountil()`
|
|
504
504
|
|
|
505
|
-
Use `.dountil()` to run a step
|
|
505
|
+
Use `.dountil()` to run a step until a condition becomes true.
|
|
506
506
|
|
|
507
507
|
```typescript
|
|
508
508
|
import { createWorkflow, createStep } from '@mastra/core/workflows';
|
|
@@ -526,7 +526,7 @@ export const testWorkflow = createWorkflow({})
|
|
|
526
526
|
|
|
527
527
|
### Looping with `.dowhile()`
|
|
528
528
|
|
|
529
|
-
Use `.dowhile()` to run a step
|
|
529
|
+
Use `.dowhile()` to run a step while a condition remains true.
|
|
530
530
|
|
|
531
531
|
```typescript
|
|
532
532
|
import { createWorkflow, createStep } from '@mastra/core/workflows';
|
|
@@ -958,7 +958,7 @@ workflow.parallel([pipelineA, pipelineB])
|
|
|
958
958
|
|
|
959
959
|
| Pattern | What happens | Common use case |
|
|
960
960
|
| ---------------------- | --------------------------------- | ------------------------------------------------------ |
|
|
961
|
-
| `.then().then()` | Sequential steps |
|
|
961
|
+
| `.then().then()` | Sequential steps | Short pipelines |
|
|
962
962
|
| `.parallel().then()` | Run in parallel, then combine | Fan-out/fan-in |
|
|
963
963
|
| `.foreach().then()` | Process all items, then aggregate | Map-reduce |
|
|
964
964
|
| `.foreach().foreach()` | Creates array of arrays | Avoid - use nested workflow or `.map()` with `.flat()` |
|
|
@@ -10,7 +10,7 @@ Workflows let you define complex task sequences with clear, structured steps ins
|
|
|
10
10
|
|
|
11
11
|
## When to use workflows
|
|
12
12
|
|
|
13
|
-
Use workflows for tasks that are
|
|
13
|
+
Use workflows for tasks that are defined upfront and involve multiple steps with a specific execution order. They give you fine-grained control over how data flows and transforms between steps, and which primitives are called at each stage.
|
|
14
14
|
|
|
15
15
|
## Core principles
|
|
16
16
|
|
|
@@ -351,7 +351,7 @@ if (result.status === 'success') {
|
|
|
351
351
|
|
|
352
352
|
### Workflow result type
|
|
353
353
|
|
|
354
|
-
Both `run.start()` and `stream.result` return a discriminated union based on the `status` property, which can be `success`, `failed`, `suspended`, `tripwire`, or `paused`. You can always
|
|
354
|
+
Both `run.start()` and `stream.result` return a discriminated union based on the `status` property, which can be `success`, `failed`, `suspended`, `tripwire`, or `paused`. You can always read `result.status`, `result.input`, `result.steps`, and optionally `result.state` regardless of the status.
|
|
355
355
|
|
|
356
356
|
Additionally, depending on the status, different properties are available:
|
|
357
357
|
|
|
@@ -585,7 +585,7 @@ Visit [Request Context](https://mastra.ai/docs/server/request-context) for more
|
|
|
585
585
|
|
|
586
586
|
## Related
|
|
587
587
|
|
|
588
|
-
For a closer look at workflows, see
|
|
588
|
+
For a closer look at workflows, see the [Workflow Guide](https://mastra.ai/blog/building-an-ai-recruiter), which walks through the core concepts with a practical example.
|
|
589
589
|
|
|
590
590
|
- [Workflow State](https://mastra.ai/docs/workflows/workflow-state)
|
|
591
591
|
- [Control Flow](https://mastra.ai/docs/workflows/control-flow)
|
|
@@ -155,8 +155,8 @@ export const mastra = new Mastra({
|
|
|
155
155
|
|
|
156
156
|
1. **Ensure Serializability**: Any data that needs to be included in the snapshot must be serializable (convertible to JSON).
|
|
157
157
|
2. **Minimize Snapshot Size**: Avoid storing large data objects directly in the workflow context. Instead, store references to them (like IDs) and retrieve the data when needed.
|
|
158
|
-
3. **Handle Resume Context
|
|
159
|
-
4. **Set Up Proper Monitoring**: Implement monitoring for suspended workflows and especially long-running ones, plus to ensure they
|
|
158
|
+
3. **Handle Resume Context**. When resuming a workflow, consider what context to provide. This will be merged with the existing snapshot data.
|
|
159
|
+
4. **Set Up Proper Monitoring**: Implement monitoring for suspended workflows and especially long-running ones, plus to ensure they resume correctly.
|
|
160
160
|
5. **Consider Storage Scaling**: For applications with many suspended workflows, ensure your storage solution is appropriately scaled.
|
|
161
161
|
|
|
162
162
|
## Custom snapshot metadata
|
|
@@ -355,7 +355,7 @@ When the tool runs inside a [subagent](https://mastra.ai/docs/agents/human-in-th
|
|
|
355
355
|
|
|
356
356
|
When your agent has [memory](https://mastra.ai/docs/memory/overview) configured, Mastra loads conversation history from storage on the server. Send only the new message from the client instead of the full conversation history.
|
|
357
357
|
|
|
358
|
-
Sending the full history is redundant and can cause message-ordering bugs because client-side timestamps can conflict with the timestamps stored in your database. Mastra filters echoed history before loading stored messages and keeps the stored copy as the base when message IDs match
|
|
358
|
+
Sending the full history is redundant and can cause message-ordering bugs because client-side timestamps can conflict with the timestamps stored in your database. Mastra filters echoed history before loading stored messages and keeps the stored copy as the base when message IDs match. The stored timestamps, provider metadata, and reasoning are preserved, and only new tool results are layered on top.
|
|
359
359
|
|
|
360
360
|
```typescript
|
|
361
361
|
import { useChat } from '@ai-sdk/react'
|
|
@@ -701,7 +701,7 @@ export const mastra = new Mastra({
|
|
|
701
701
|
|
|
702
702
|
**Frontend**:
|
|
703
703
|
|
|
704
|
-
Check for `data-workflow` parts to render workflow status snapshots. If you need the full payload for the step that
|
|
704
|
+
Check for `data-workflow` parts to render workflow status snapshots. If you need the full payload for the step that changed last, also read `data-workflow-step` parts.
|
|
705
705
|
|
|
706
706
|
```typescript
|
|
707
707
|
import { useChat } from '@ai-sdk/react'
|
|
@@ -1512,7 +1512,7 @@ Key points:
|
|
|
1512
1512
|
- Read `data-tool-agent-step` when you need the full payload for the nested step that finished
|
|
1513
1513
|
- `AgentDataPart` and `AgentStepDataPart` include the same `ancestry`, `depth`, and optional `parentAgentId` fields
|
|
1514
1514
|
- The `AgentDataPart` has `id` (on the part) and `data.text` (the current nested-agent text snapshot)
|
|
1515
|
-
- A tool that throws inside the nested agent is reported in `data.toolErrors`, each entry `{ toolCallId, toolName, args?, errorText, providerExecuted? }`. `errorText` is a JSON-safe string,
|
|
1515
|
+
- A tool that throws inside the nested agent is reported in `data.toolErrors`, each entry `{ toolCallId, toolName, args?, errorText, providerExecuted? }`. `errorText` is a JSON-safe string, which means the failure survives serialization to the client instead of arriving as `{}`
|
|
1516
1516
|
- `toolErrors` resets at each nested step boundary, like `toolCalls` and `toolResults`. For a finished step, read it from `data-tool-agent-step` (`data.step.toolErrors`) or from `data.steps[]` on the final snapshot
|
|
1517
1517
|
- The tool still returns its own output after the stream completes
|
|
1518
1518
|
|
|
@@ -40,7 +40,7 @@ Run Mastra as a standalone server and connect your Next.js frontend (with Assist
|
|
|
40
40
|
cd mastra-server # Replace with the actual directory name you provided
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
You now have a basic Mastra server project ready.
|
|
43
|
+
You now have a basic Mastra server project ready. Your project now has these files and folders:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
46
|
src
|
|
@@ -111,7 +111,7 @@ Run Mastra as a standalone server and connect your Next.js frontend (with Assist
|
|
|
111
111
|
npm run dev
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
By default, the Mastra server will run on `http://localhost:4111`. Keep this server running for the next steps where
|
|
114
|
+
By default, the Mastra server will run on `http://localhost:4111`. Keep this server running for the next steps, where you'll set up the Assistant UI frontend to connect to it.
|
|
115
115
|
|
|
116
116
|
4. Go up one directory to your project root.
|
|
117
117
|
|
|
@@ -127,7 +127,7 @@ Run Mastra as a standalone server and connect your Next.js frontend (with Assist
|
|
|
127
127
|
|
|
128
128
|
> **Note:** For detailed setup instructions, including adding API keys, basic configuration, and manual setup steps, please refer to [assistant-ui's official documentation](https://assistant-ui.com/docs).
|
|
129
129
|
|
|
130
|
-
5. The default Assistant UI setup configures the chat runtime to use a local API route (`/api/chat`) within the Next.js project.
|
|
130
|
+
5. The default Assistant UI setup configures the chat runtime to use a local API route (`/api/chat`) within the Next.js project. Because the Mastra agent runs on a separate server, update the frontend to point to that server's endpoint.
|
|
131
131
|
|
|
132
132
|
Open the file in your assistant-ui frontend project that contains the `useChatRuntime` hook (usually `app/assistant.tsx` or `src/app/assistant.tsx`). Find the `useChatRuntime` hook and change the `api` property to the full URL of your Mastra agent's stream endpoint:
|
|
133
133
|
|
|
@@ -149,12 +149,12 @@ Run Mastra as a standalone server and connect your Next.js frontend (with Assist
|
|
|
149
149
|
|
|
150
150
|
Now, the Assistant UI frontend will send chat requests directly to your running Mastra server.
|
|
151
151
|
|
|
152
|
-
6. You're ready to connect the pieces!
|
|
152
|
+
6. You're ready to connect the pieces! Ensure both the Mastra server and the Assistant UI frontend are running. Start the Next.js development server:
|
|
153
153
|
|
|
154
154
|
```bash
|
|
155
155
|
npm run dev
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
You
|
|
158
|
+
You can now chat with your agent in the browser.
|
|
159
159
|
|
|
160
160
|
Congratulations! You have successfully integrated Mastra with Assistant UI using a separate server approach. Your Assistant UI frontend now communicates with a standalone Mastra agent server.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# CopilotKit
|
|
6
6
|
|
|
7
|
-
[CopilotKit](https://www.copilotkit.ai/) provides React components to
|
|
7
|
+
[CopilotKit](https://www.copilotkit.ai/) provides React components to integrate customizable AI copilots into your application. Combined with Mastra, you can build AI apps with bidirectional state synchronization and interactive UIs.
|
|
8
8
|
|
|
9
9
|
CopilotKit talks to Mastra through the [AG-UI protocol](https://docs.ag-ui.com/). The `@ag-ui/mastra` package exposes your Mastra agents as an AG-UI endpoint, and CopilotKit's React hooks and components consume it. This unlocks a spectrum of experiences on top of ordinary chat: [generative UI, human-in-the-loop, and frontend tools](#generative-ui), plus deploying the same agent to [messaging channels like Slack](#channels).
|
|
10
10
|
|
|
@@ -369,7 +369,7 @@ export default function Page() {
|
|
|
369
369
|
}
|
|
370
370
|
```
|
|
371
371
|
|
|
372
|
-
Because Mastra streams tool-call arguments incrementally, the `render` function
|
|
372
|
+
Because Mastra streams tool-call arguments incrementally, the `render` function runs as the arguments arrive, so the UI can paint progressively while the agent works.
|
|
373
373
|
|
|
374
374
|
#### Components as tools
|
|
375
375
|
|
|
@@ -395,7 +395,7 @@ The agent invokes `callout` like any other tool, and CopilotKit renders `Callout
|
|
|
395
395
|
|
|
396
396
|
#### State rendering
|
|
397
397
|
|
|
398
|
-
Render UI from the agent's state and re-render as it streams. On Mastra, agent state is the agent's working memory, streamed to the client as it changes. Read it with `useAgent
|
|
398
|
+
Render UI from the agent's state and re-render as it streams. On Mastra, agent state is the agent's working memory, streamed to the client as it changes. Read it with `useAgent`. Because `agent.state` is reactive, the component updates automatically:
|
|
399
399
|
|
|
400
400
|
```tsx
|
|
401
401
|
import { useAgent } from '@copilotkit/react-core/v2'
|
|
@@ -608,7 +608,7 @@ channel.onMention(async ({ thread }) => {
|
|
|
608
608
|
await channel.start()
|
|
609
609
|
```
|
|
610
610
|
|
|
611
|
-
The agent receives ordinary AG-UI input and emits ordinary AG-UI events; the platform mechanics stay behind the adapter, so the same Mastra agent runs unchanged across every channel. Rich messages are written as JSX and rendered to each platform's native format (Block Kit on Slack, for example)
|
|
611
|
+
The agent receives ordinary AG-UI input and emits ordinary AG-UI events; the platform mechanics stay behind the adapter, so the same Mastra agent runs unchanged across every channel. Rich messages are written as JSX and rendered to each platform's native format (Block Kit on Slack, for example). An interactive card therefore degrades gracefully where a platform has no equivalent.
|
|
612
612
|
|
|
613
613
|
### Slack
|
|
614
614
|
|
|
@@ -63,7 +63,7 @@ Embed Mastra in your Next.js API route and connect an OpenUI `<AgentInterface />
|
|
|
63
63
|
└── library.ts
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
The chat route lives in `src/app/api/chat/route.ts`, the chat surface in `src/app/page.tsx`, and the component library in `src/library.ts`. The OpenUI CLI writes `src/generated/system-prompt.txt` from your library
|
|
66
|
+
The chat route lives in `src/app/api/chat/route.ts`, the chat surface in `src/app/page.tsx`, and the component library in `src/library.ts`. The OpenUI CLI writes `src/generated/system-prompt.txt` from your library. Regenerate it whenever the library changes.
|
|
67
67
|
|
|
68
68
|
Add your OpenAI key to `.env.local`:
|
|
69
69
|
|
|
@@ -290,4 +290,4 @@ yarn dlx @openuidev/cli generate src/library.ts --out src/generated/system-promp
|
|
|
290
290
|
bun x @openuidev/cli generate src/library.ts --out src/generated/system-prompt.txt
|
|
291
291
|
```
|
|
292
292
|
|
|
293
|
-
The
|
|
293
|
+
The API route reads the generated prompt and merges it into the agent's `instructions`, which tells the agent exactly which components it can emit.
|
|
@@ -8,7 +8,7 @@ The `@mastra/auth-auth0` package provides authentication for Mastra using Auth0.
|
|
|
8
8
|
|
|
9
9
|
## Prerequisites
|
|
10
10
|
|
|
11
|
-
This example uses Auth0 authentication.
|
|
11
|
+
This example uses Auth0 authentication. Ensure you have:
|
|
12
12
|
|
|
13
13
|
1. Create an Auth0 account at [auth0.com](https://auth0.com/)
|
|
14
14
|
2. Set up an Application in your Auth0 Dashboard
|
|
@@ -85,11 +85,11 @@ export const mastra = new Mastra({
|
|
|
85
85
|
|
|
86
86
|
## Configuration
|
|
87
87
|
|
|
88
|
-
### User
|
|
88
|
+
### User authorization
|
|
89
89
|
|
|
90
90
|
By default, `MastraAuthAuth0` allows all authenticated users who have valid Auth0 tokens for the specified audience. The token verification ensures that:
|
|
91
91
|
|
|
92
|
-
1. The token is
|
|
92
|
+
1. The token is signed by Auth0
|
|
93
93
|
2. The token isn't expired
|
|
94
94
|
3. The token audience matches your configured audience
|
|
95
95
|
4. The token issuer matches your Auth0 domain
|
|
@@ -8,7 +8,7 @@ The `@mastra/auth-better-auth` package provides authentication for Mastra using
|
|
|
8
8
|
|
|
9
9
|
## Prerequisites
|
|
10
10
|
|
|
11
|
-
This example uses Better Auth.
|
|
11
|
+
This example uses Better Auth. Ensure your Better Auth instance is configured and your environment variables are set.
|
|
12
12
|
|
|
13
13
|
```env
|
|
14
14
|
# Required by Better Auth
|
|
@@ -47,7 +47,7 @@ The `@mastra/auth-clerk` package provides authentication for Mastra using Clerk.
|
|
|
47
47
|
|
|
48
48
|
### Prerequisites
|
|
49
49
|
|
|
50
|
-
This example uses Clerk authentication.
|
|
50
|
+
This example uses Clerk authentication. Ensure you add your Clerk credentials to your `.env` file and ensure your Clerk project is configured correctly.
|
|
51
51
|
|
|
52
52
|
```env
|
|
53
53
|
CLERK_PUBLISHABLE_KEY=pk_test_...
|
|
@@ -8,7 +8,7 @@ The `@mastra/auth-firebase` package provides authentication for Mastra using Fir
|
|
|
8
8
|
|
|
9
9
|
## Prerequisites
|
|
10
10
|
|
|
11
|
-
This example uses Firebase Authentication.
|
|
11
|
+
This example uses Firebase Authentication. Ensure you have:
|
|
12
12
|
|
|
13
13
|
1. Create a Firebase project in the [Firebase Console](https://console.firebase.google.com/)
|
|
14
14
|
2. Enable Authentication and configure your preferred sign-in methods (Google, Email/Password, etc.)
|
|
@@ -95,9 +95,9 @@ The `MastraAuthFirebase` class can be configured through constructor options or
|
|
|
95
95
|
- `FIREBASE_SERVICE_ACCOUNT`: Path to Firebase service account JSON file
|
|
96
96
|
- `FIRESTORE_DATABASE_ID` or `FIREBASE_DATABASE_ID`: Firestore database ID
|
|
97
97
|
|
|
98
|
-
> **Note:** When constructor options aren't provided, the class automatically reads these environment variables. As a result, you can call `new MastraAuthFirebase()` without any arguments if your environment variables are
|
|
98
|
+
> **Note:** When constructor options aren't provided, the class automatically reads these environment variables. As a result, you can call `new MastraAuthFirebase()` without any arguments if your environment variables are configured correctly.
|
|
99
99
|
|
|
100
|
-
### User
|
|
100
|
+
### User authorization
|
|
101
101
|
|
|
102
102
|
By default, `MastraAuthFirebase` uses Firestore to manage user access. It expects a `user_access` collection with documents keyed by user UIDs. The presence of a document in this collection determines whether a user is authorized.
|
|
103
103
|
|
|
@@ -10,7 +10,7 @@ Use it when your Studio users sign in with Google and access should be limited t
|
|
|
10
10
|
|
|
11
11
|
## Prerequisites
|
|
12
12
|
|
|
13
|
-
This guide uses Google Workspace authentication.
|
|
13
|
+
This guide uses Google Workspace authentication. Ensure you have:
|
|
14
14
|
|
|
15
15
|
1. Create or select a Google Cloud project
|
|
16
16
|
2. Set up an OAuth client for web applications
|
|
@@ -23,7 +23,7 @@ For Google Groups RBAC, also configure a Google Workspace service account with d
|
|
|
23
23
|
https://www.googleapis.com/auth/admin.directory.group.readonly
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Ensure your environment variables are set.
|
|
27
27
|
|
|
28
28
|
```env
|
|
29
29
|
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
|
|
@@ -8,14 +8,14 @@ The `@mastra/auth-okta` package provides authentication and role-based access co
|
|
|
8
8
|
|
|
9
9
|
## Prerequisites
|
|
10
10
|
|
|
11
|
-
This guide uses Okta authentication.
|
|
11
|
+
This guide uses Okta authentication. Ensure you have:
|
|
12
12
|
|
|
13
13
|
1. Create an Okta account at [okta.com](https://www.okta.com/)
|
|
14
14
|
2. Set up an OAuth application in the Okta Admin Console (Web app, Authorization Code grant)
|
|
15
15
|
3. Add your redirect URI to the application's sign-in redirect URIs
|
|
16
16
|
4. Create an API token (required for RBAC)
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Ensure your environment variables are set.
|
|
19
19
|
|
|
20
20
|
```env
|
|
21
21
|
OKTA_DOMAIN=dev-123456.okta.com
|
|
@@ -247,7 +247,7 @@ curl -X POST http://localhost:4111/api/agents/weatherAgent/generate \
|
|
|
247
247
|
## Troubleshooting
|
|
248
248
|
|
|
249
249
|
- **401 on every request**: Verify your Okta domain, client ID, and client secret are correct. Check that the redirect URI in your Okta application matches `OKTA_REDIRECT_URI`.
|
|
250
|
-
- **401 with `unexpected "aud" claim value` in the server logs**: The Bearer token's audience doesn't match the configured audience.
|
|
250
|
+
- **401 with `unexpected "aud" claim value` in the server logs**: The Bearer token's audience doesn't match the configured audience. A common cause is sending an access token while the audience is still the default client ID. Set `OKTA_AUDIENCE` to the audience of the authorization server that issued the token. See [Bearer token](#bearer-token).
|
|
251
251
|
- **Cookies not sent cross-origin**: Set `credentials: "include"` in `MastraClient` and configure `server.cors` with your frontend origin and `credentials: true`.
|
|
252
252
|
- **Session lost on restart**: Set `OKTA_COOKIE_PASSWORD` to a stable value (at least 32 characters). Without it, an auto-generated key is used that changes on each restart.
|
|
253
253
|
- **RBAC returns empty permissions**: Verify `OKTA_API_TOKEN` is set and the token has permission to list user groups. Check that group names in `roleMapping` match your Okta group names exactly.
|
|
@@ -47,7 +47,7 @@ The `@mastra/auth-supabase` package provides authentication for Mastra using Sup
|
|
|
47
47
|
|
|
48
48
|
### Prerequisites
|
|
49
49
|
|
|
50
|
-
This example uses Supabase Auth.
|
|
50
|
+
This example uses Supabase Auth. Ensure you add your Supabase credentials to your `.env` file and ensure your Supabase project is configured correctly.
|
|
51
51
|
|
|
52
52
|
```env
|
|
53
53
|
SUPABASE_URL=https://your-project.supabase.co
|
|
@@ -47,7 +47,7 @@ The `@mastra/auth-workos` package provides authentication for Mastra using WorkO
|
|
|
47
47
|
|
|
48
48
|
### Prerequisites
|
|
49
49
|
|
|
50
|
-
This example uses WorkOS authentication.
|
|
50
|
+
This example uses WorkOS authentication. Ensure you have:
|
|
51
51
|
|
|
52
52
|
1. Create a WorkOS account at [workos.com](https://workos.com/)
|
|
53
53
|
2. Set up an Application in your WorkOS Dashboard
|
|
@@ -10,7 +10,7 @@ The `@mastra/stagehand` package provides browser automation using the [Stagehand
|
|
|
10
10
|
|
|
11
11
|
Use Stagehand when you need:
|
|
12
12
|
|
|
13
|
-
- Natural language element targeting ("select the login
|
|
13
|
+
- Natural language element targeting ("select the login control")
|
|
14
14
|
- AI-powered data extraction from pages
|
|
15
15
|
- Native Browserbase cloud integration
|
|
16
16
|
- Simpler tool interface for common actions
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# iMessage
|
|
6
6
|
|
|
7
|
-
iMessage channels let a Mastra agent receive direct messages and group messages from iMessage.
|
|
7
|
+
iMessage channels let a Mastra agent receive direct messages and group messages from iMessage. Mastra connects to iMessage through the vendor-maintained [Photon](https://app.photon.codes) and [Linq](https://linqapp.com) adapters. Mastra handles the agent wiring and the webhook route, and the adapter docs cover number provisioning, credentials, and webhook registration.
|
|
8
8
|
|
|
9
9
|
## Choose an adapter
|
|
10
10
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Ring signals let a Mastra agent receive doorbell presses, motion, and other events from Ring doorbells and cameras. Each event arrives in an agent thread as a [notification signal](https://mastra.ai/docs/signals/notifications), and the agent can fetch a snapshot or video clip to see who is at the door.
|
|
8
8
|
|
|
9
|
-
Events and media come from the [Ring Partner API](https://developer.amazon.com/docs/ring/api-documentation.html)
|
|
9
|
+
Events and media come from the [Ring Partner API](https://developer.amazon.com/docs/ring/api-documentation.html), which doesn't expose lights, sirens, locks, or two-way talk.
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
@@ -101,7 +101,7 @@ Linking connects a Ring account to your agent. Set it up in two places, in this
|
|
|
101
101
|
1. The [Ring Developer Console](https://developer.amazon.com/ring/console/apps) on Amazon's developer site, where you configure your developer app.
|
|
102
102
|
2. [ring.com](https://ring.com), where you link the developer app to the Ring account that owns the device.
|
|
103
103
|
|
|
104
|
-
### Ring
|
|
104
|
+
### Ring developer console
|
|
105
105
|
|
|
106
106
|
The routes Ring needs are added automatically to your Mastra server under `/ring`:
|
|
107
107
|
|
|
@@ -178,7 +178,7 @@ To pick the thread per event, set `target` to a function. The function receives
|
|
|
178
178
|
|
|
179
179
|
- `event.data.type`: The event type, from [Events and priorities](#events-and-priorities).
|
|
180
180
|
- `event.data.attributes.source`: For device events, the ID of the device that sent the event. For app integration events, the account ID. For subscription events, `subscriptions`.
|
|
181
|
-
- `event.data.attributes.timestamp`:
|
|
181
|
+
- `event.data.attributes.timestamp`: When the device event happened, in epoch milliseconds, and unset for subscription events.
|
|
182
182
|
- `event.data.attributes.sub_type`: For motion events, what caused the motion: `human`, `vehicle`, `package_delivery`, `other_motion`, or `motion` when Smart Alerts are off. For subscription events, `paid` or `trial`.
|
|
183
183
|
- `event.meta.account_id`: The ID of the Ring account the device belongs to.
|
|
184
184
|
|
|
@@ -200,7 +200,7 @@ Return `undefined` to drop the event. The function can be `async`. The [RingSign
|
|
|
200
200
|
The agent gets two tools:
|
|
201
201
|
|
|
202
202
|
- `ring_snapshot`: Fetches a still image for an event and passes it to the model, so the agent can describe what it sees. If Ring has no image right after the event, it uses the most recent image before it.
|
|
203
|
-
- `ring_clip`: Fetches a video clip that starts at the event. Ring needs time to process a recording,
|
|
203
|
+
- `ring_clip`: Fetches a video clip that starts at the event. Because Ring needs time to process a recording, the tool retries until the clip is ready. By default, the model doesn't receive the video. See [Let the model see media](#let-the-model-see-media).
|
|
204
204
|
|
|
205
205
|
### Let the model see media
|
|
206
206
|
|
|
@@ -216,13 +216,13 @@ new RingSignals({
|
|
|
216
216
|
|
|
217
217
|
When `visibleToModel` is `false`, the model gets only the tool's text result and link, and can't describe what the media shows.
|
|
218
218
|
|
|
219
|
-
> **Note:** Check that your model supports video input before you turn on `visibleToModel` for clips. Gemini models accept video input
|
|
219
|
+
> **Note:** Check that your model supports video input before you turn on `visibleToModel` for clips. Gemini models accept video input, while Anthropic and OpenAI models don't. Anthropic drops the video with a warning, and other model APIs may reject the request.
|
|
220
220
|
>
|
|
221
221
|
> Video input counts toward the model's context window for every second of footage. A clip at the default 15 seconds uses a few thousand tokens. A clip at the maximum `durationMs` of 15 minutes can use hundreds of thousands, so keep `durationMs` short when the model watches clips. The video isn't saved in memory, so it only uses context on the step that fetched it.
|
|
222
222
|
|
|
223
223
|
### Media links
|
|
224
224
|
|
|
225
|
-
Ring doesn't give out shareable links to its media. Downloading a snapshot or clip needs the Ring account's tokens, so a browser or chat app can't fetch it from Ring directly. When you set `baseUrl`, the tools return a signed link to your own server instead, under `<baseUrl>/ring/media/`. Opening the link makes your server fetch the media from Ring and pass it on. Nothing is stored
|
|
225
|
+
Ring doesn't give out shareable links to its media. Downloading a snapshot or clip needs the Ring account's tokens, so a browser or chat app can't fetch it from Ring directly. When you set `baseUrl`, the tools return a signed link to your own server instead, under `<baseUrl>/ring/media/`. Opening the link makes your server fetch the media from Ring and pass it on. Nothing is stored. Recent media is cached in memory for a few minutes.
|
|
226
226
|
|
|
227
227
|
Set `RING_BASE_URL` to your Mastra server's URL. Use `http://localhost:4111` or a tunnel URL in development, and your deployed URL in production.
|
|
228
228
|
|
|
@@ -408,7 +408,7 @@ Channels on serverless platforms may need `waitUntil` and shared pub/sub configu
|
|
|
408
408
|
|
|
409
409
|
### Idle servers
|
|
410
410
|
|
|
411
|
-
Platform servers scale down to idle when they aren't receiving traffic, and that's fine for Slack. The next event, such as a mention or direct message, wakes the server by delivering its webhook request, and the server resumes handling requests. The first response after the server has been idle can take a little longer while it starts up, which is expected. Slack expects a `200` acknowledgement within 3 seconds and retries the event up to three times when delivery fails or times out, so a
|
|
411
|
+
Platform servers scale down to idle when they aren't receiving traffic, and that's fine for Slack. The next event, such as a mention or direct message, wakes the server by delivering its webhook request, and the server resumes handling requests. The first response after the server has been idle can take a little longer while it starts up, which is expected. Slack expects a `200` acknowledgement within 3 seconds and retries the event up to three times when delivery fails or times out, so a slow cold start may take a retry before the agent responds. Subsequent messages respond at normal speed while the server stays warm.
|
|
412
412
|
|
|
413
413
|
## Related
|
|
414
414
|
|
|
@@ -93,7 +93,7 @@ Use your public Mastra server URL as the base URL:
|
|
|
93
93
|
https://your-app.example.com/api/agents/whatsapp-agent/channels/whatsapp/webhook
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
Use this URL for incoming WhatsApp event delivery. The generated Mastra route handles POST events from WhatsApp
|
|
96
|
+
Use this URL for incoming WhatsApp event delivery. The generated Mastra route handles POST events from WhatsApp. Follow the Chat SDK WhatsApp adapter docs for the Meta callback and webhook verification flow.
|
|
97
97
|
|
|
98
98
|
## Related
|
|
99
99
|
|