@mastra/mcp-docs-server 1.2.11 → 1.2.12-alpha.3
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/agent-builder/access-control.md +3 -3
- package/.docs/docs/agent-builder/browser.md +1 -1
- package/.docs/docs/agent-builder/channels.md +1 -1
- package/.docs/docs/agent-builder/configuration.md +3 -3
- package/.docs/docs/agent-builder/deploying.md +2 -2
- package/.docs/docs/agent-builder/integrations.md +8 -8
- package/.docs/docs/agent-builder/memory.md +2 -2
- package/.docs/docs/agent-builder/overview.md +1 -1
- package/.docs/docs/agent-controller/channels.md +8 -6
- package/.docs/docs/agent-controller/modes.md +6 -6
- package/.docs/docs/agent-controller/overview.md +13 -9
- package/.docs/docs/agent-controller/session.md +27 -9
- package/.docs/docs/agent-controller/subagents.md +9 -6
- package/.docs/docs/agent-controller/threads-and-state.md +12 -8
- package/.docs/docs/agent-controller/tool-approvals.md +7 -3
- package/.docs/docs/agents/a2a.md +4 -2
- package/.docs/docs/agents/acp.md +5 -5
- package/.docs/docs/agents/agent-approval.md +13 -11
- package/.docs/docs/agents/code-mode.md +29 -6
- package/.docs/docs/agents/guardrails.md +8 -8
- package/.docs/docs/agents/networks.md +2 -2
- package/.docs/docs/agents/overview.md +9 -7
- package/.docs/docs/agents/processors.md +15 -15
- package/.docs/docs/agents/skills.md +6 -6
- package/.docs/docs/agents/structured-output.md +6 -6
- package/.docs/docs/agents/supervisor-agents.md +19 -13
- package/.docs/docs/agents/using-tools.md +48 -21
- package/.docs/docs/browser/agent-browser.md +4 -4
- package/.docs/docs/browser/browser-viewer.md +2 -2
- package/.docs/docs/browser/firecrawl.md +1 -1
- package/.docs/docs/browser/overview.md +2 -2
- package/.docs/docs/browser/recording.md +1 -1
- package/.docs/docs/browser/stagehand.md +7 -7
- package/.docs/docs/capabilities/channels/discord.md +1 -1
- package/.docs/docs/capabilities/channels/other-adapters.md +1 -1
- package/.docs/docs/capabilities/channels/overview.md +9 -5
- package/.docs/docs/capabilities/channels/slack.md +2 -2
- package/.docs/docs/capabilities/channels/teams.md +1 -1
- package/.docs/docs/capabilities/channels/telegram.md +1 -1
- package/.docs/docs/capabilities/channels/whatsapp.md +1 -1
- package/.docs/docs/deployment/mastra-server.md +1 -1
- package/.docs/docs/deployment/overview.md +6 -2
- package/.docs/docs/deployment/sandbox.md +3 -1
- package/.docs/docs/deployment/workers.md +137 -0
- package/.docs/docs/editor/overview.md +37 -31
- package/.docs/docs/editor/prompts.md +8 -4
- package/.docs/docs/editor/tools.md +3 -3
- package/.docs/docs/evals/built-in-scorers.md +4 -4
- package/.docs/docs/evals/custom-scorers.md +5 -5
- package/.docs/docs/evals/datasets/running-experiments.md +7 -7
- package/.docs/docs/evals/evals-with-memory.md +4 -4
- package/.docs/docs/evals/gates-and-verdicts.md +4 -4
- package/.docs/docs/evals/multi-turn.md +12 -12
- package/.docs/docs/evals/overview.md +6 -4
- package/.docs/docs/evals/quick-checks.md +2 -2
- package/.docs/docs/getting-started/build-with-ai.md +6 -4
- package/.docs/docs/getting-started/file-based-agents.md +6 -4
- package/.docs/docs/getting-started/manual-install.md +1 -1
- package/.docs/docs/index.md +9 -90
- package/.docs/docs/long-running-agents/background-tasks.md +10 -10
- package/.docs/docs/long-running-agents/durable-agents.md +46 -5
- package/.docs/docs/long-running-agents/goals.md +15 -11
- package/.docs/docs/long-running-agents/schedules.md +3 -3
- package/.docs/docs/long-running-agents/signal-providers.md +8 -6
- package/.docs/docs/long-running-agents/signals.md +9 -5
- package/.docs/docs/mastra-platform/configuration.md +3 -3
- package/.docs/docs/mastra-platform/database.md +8 -8
- package/.docs/docs/mastra-platform/deploy.md +8 -4
- package/.docs/docs/mastra-platform/environments.md +8 -4
- package/.docs/docs/mastra-platform/github.md +3 -1
- package/.docs/docs/mastra-platform/server.md +1 -1
- package/.docs/docs/mastra-platform/studio.md +2 -2
- package/.docs/docs/mastra-platform/workspace.md +6 -6
- package/.docs/docs/mcp/mcp-apps.md +1 -1
- package/.docs/docs/mcp/overview.md +9 -9
- package/.docs/docs/memory/memory-processors.md +10 -10
- package/.docs/docs/memory/message-history.md +11 -5
- package/.docs/docs/memory/multi-user-threads.md +6 -6
- package/.docs/docs/memory/observational-memory.md +27 -25
- package/.docs/docs/memory/overview.md +10 -10
- package/.docs/docs/memory/semantic-recall.md +3 -3
- package/.docs/docs/memory/working-memory.md +8 -8
- package/.docs/docs/observability/integrations/bridges/datadog.md +6 -6
- package/.docs/docs/observability/integrations/bridges/otel.md +5 -5
- package/.docs/docs/observability/integrations/exporters/datadog.md +1 -1
- package/.docs/docs/observability/integrations/exporters/laminar.md +1 -1
- package/.docs/docs/observability/integrations/exporters/langfuse.md +3 -3
- package/.docs/docs/observability/integrations/exporters/langsmith.md +4 -4
- package/.docs/docs/observability/integrations/exporters/mastra-platform.md +1 -1
- package/.docs/docs/observability/integrations/exporters/mastra-storage.md +1 -1
- package/.docs/docs/observability/integrations/exporters/otel.md +26 -4
- package/.docs/docs/observability/integrations/exporters/sentry.md +1 -1
- package/.docs/docs/observability/integrations/overview.md +1 -1
- package/.docs/docs/observability/integrations/processors/sensitive-data-filter.md +1 -1
- package/.docs/docs/observability/logging.md +1 -1
- package/.docs/docs/observability/metrics/overview.md +1 -1
- package/.docs/docs/observability/metrics/querying.md +8 -8
- package/.docs/docs/observability/overview.md +4 -4
- package/.docs/docs/observability/tracing/overview.md +18 -12
- package/.docs/docs/rag/chunking-and-embedding.md +1 -1
- package/.docs/docs/rag/graph-rag.md +7 -7
- package/.docs/docs/rag/overview.md +2 -2
- package/.docs/docs/rag/retrieval.md +18 -18
- package/.docs/docs/rag/vector-databases.md +2 -2
- package/.docs/docs/server/auth/composite-auth.md +2 -2
- package/.docs/docs/server/auth/fga.md +6 -6
- package/.docs/docs/server/auth/firebase.md +2 -2
- package/.docs/docs/server/auth/simple-auth.md +1 -1
- package/.docs/docs/server/auth/workers.md +133 -0
- package/.docs/docs/server/custom-adapters.md +4 -4
- package/.docs/docs/server/mastra-client.md +3 -3
- package/.docs/docs/server/mastra-server.md +2 -2
- package/.docs/docs/server/middleware.md +1 -1
- package/.docs/docs/server/pubsub.md +7 -4
- package/.docs/docs/server/request-context.md +11 -11
- package/.docs/docs/server/server-adapters.md +2 -2
- package/.docs/docs/storage/overview.md +2 -2
- package/.docs/docs/studio/auth.md +5 -5
- package/.docs/docs/studio/deployment.md +1 -1
- package/.docs/docs/studio/observability.md +2 -2
- package/.docs/docs/studio/overview.md +11 -9
- package/.docs/docs/voice/overview.md +26 -26
- package/.docs/docs/voice/realtime-voice.md +8 -8
- package/.docs/docs/voice/speech-to-speech.md +9 -9
- package/.docs/docs/voice/speech-to-text.md +3 -3
- package/.docs/docs/voice/text-to-speech.md +6 -6
- package/.docs/docs/what-is-mastra.md +161 -0
- package/.docs/docs/workflows/agents-and-tools.md +3 -3
- package/.docs/docs/workflows/control-flow.md +10 -8
- package/.docs/docs/workflows/error-handling.md +2 -2
- package/.docs/docs/workflows/overview.md +7 -6
- package/.docs/docs/workflows/scheduled-workflows.md +12 -12
- package/.docs/docs/workflows/snapshots.md +3 -3
- package/.docs/docs/workflows/suspend-and-resume.md +1 -1
- package/.docs/docs/workflows/time-travel.md +3 -1
- package/.docs/docs/workflows/workflow-state.md +1 -1
- package/.docs/docs/workspace/filesystem.md +10 -10
- package/.docs/docs/workspace/lsp.md +1 -1
- package/.docs/docs/workspace/overview.md +12 -12
- package/.docs/docs/workspace/sandbox.md +9 -7
- package/.docs/docs/workspace/search.md +3 -3
- package/.docs/docs/workspace/skills.md +7 -7
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +6 -6
- package/.docs/guides/build-your-ui/copilotkit/generative-ui.md +9 -9
- package/.docs/guides/build-your-ui/copilotkit/overview.md +2 -2
- package/.docs/guides/build-your-ui/openui.md +2 -2
- package/.docs/guides/concepts/multi-agent-systems.md +5 -5
- package/.docs/guides/concepts/streaming.md +10 -10
- package/.docs/guides/deployment/amazon-ec2.md +1 -1
- package/.docs/guides/deployment/aws-lambda.md +1 -1
- package/.docs/guides/deployment/azure-app-services.md +1 -1
- package/.docs/guides/deployment/cloudflare.md +1 -1
- package/.docs/guides/deployment/inngest.md +6 -6
- package/.docs/guides/deployment/kubernetes.md +1 -1
- package/.docs/guides/deployment/mastra-workers.md +232 -0
- package/.docs/guides/deployment/temporal.md +1 -1
- package/.docs/guides/deployment/vercel.md +1 -1
- package/.docs/guides/getting-started/astro.md +1 -1
- package/.docs/guides/getting-started/electron.md +1 -1
- package/.docs/guides/getting-started/nestjs.md +5 -5
- package/.docs/guides/getting-started/vite-react.md +1 -1
- package/.docs/guides/guide/ai-recruiter.md +1 -1
- package/.docs/guides/guide/chef-michel.md +2 -2
- package/.docs/guides/guide/code-review-bot.md +2 -2
- package/.docs/guides/guide/coding-agent.md +5 -5
- package/.docs/guides/guide/dev-assistant.md +2 -2
- package/.docs/guides/guide/docs-manager.md +4 -4
- package/.docs/guides/guide/firecrawl.md +1 -1
- package/.docs/guides/guide/github-actions-pr-description.md +5 -5
- package/.docs/guides/guide/research-assistant.md +4 -4
- package/.docs/guides/guide/research-coordinator.md +5 -5
- package/.docs/guides/guide/signal-provider.md +1 -1
- package/.docs/guides/guide/slack-assistant.md +1 -1
- package/.docs/guides/guide/stock-agent.md +3 -3
- package/.docs/guides/guide/web-search.md +4 -4
- package/.docs/guides/guide/whatsapp-chat-bot.md +2 -2
- package/.docs/guides/index.md +1 -1
- package/.docs/guides/migrations/agentnetwork.md +4 -4
- package/.docs/guides/migrations/ai-sdk-v4-to-v5.md +1 -1
- package/.docs/guides/migrations/mastra-cloud.md +6 -6
- package/.docs/guides/migrations/network-to-supervisor.md +9 -9
- package/.docs/guides/migrations/upgrade-to-v1/agent.md +6 -6
- package/.docs/guides/migrations/upgrade-to-v1/cli.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/client.md +3 -3
- package/.docs/guides/migrations/upgrade-to-v1/evals.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/memory.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/overview.md +3 -3
- package/.docs/guides/migrations/upgrade-to-v1/processors.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/storage.md +11 -11
- package/.docs/guides/migrations/upgrade-to-v1/tools.md +3 -3
- package/.docs/guides/migrations/upgrade-to-v1/tracing.md +2 -2
- package/.docs/guides/migrations/upgrade-to-v1/voice.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/workflows.md +1 -1
- package/.docs/guides/migrations/vnext-to-standard-apis.md +2 -2
- package/.docs/models/environment-variables.md +1 -0
- package/.docs/models/gateways/custom-gateways.md +3 -3
- package/.docs/models/gateways/openrouter.md +1 -3
- package/.docs/models/gateways/vercel.md +2 -1
- package/.docs/models/index.md +6 -6
- package/.docs/models/providers/baseten.md +1 -1
- package/.docs/models/providers/chutes.md +2 -1
- package/.docs/models/providers/crossmodel.md +2 -2
- package/.docs/models/providers/deepinfra.md +1 -1
- package/.docs/models/providers/hyper.md +3 -3
- package/.docs/models/providers/llmgateway.md +4 -3
- package/.docs/models/providers/modal.md +73 -0
- package/.docs/models/providers/wandb.md +2 -1
- package/.docs/models/providers.md +1 -0
- package/.docs/reference/acp/acp-agent.md +4 -4
- package/.docs/reference/acp/create-acp-tool.md +3 -3
- package/.docs/reference/agent-controller/agent-controller-class.md +36 -36
- package/.docs/reference/agent-controller/session.md +6 -6
- package/.docs/reference/agents/agent.md +14 -14
- package/.docs/reference/agents/channels.md +29 -13
- package/.docs/reference/agents/durable-agent.md +54 -5
- package/.docs/reference/agents/generate.md +3 -3
- package/.docs/reference/agents/generateLegacy.md +1 -1
- package/.docs/reference/agents/getDefaultOptions.md +1 -1
- package/.docs/reference/agents/getDefaultStreamOptions.md +1 -1
- package/.docs/reference/agents/getLLM.md +2 -2
- package/.docs/reference/agents/getMetadata.md +2 -2
- package/.docs/reference/agents/inngest-agent.md +1 -1
- package/.docs/reference/agents/listScorers.md +1 -1
- package/.docs/reference/agents/listSkills.md +1 -1
- package/.docs/reference/agents/listSuspendedRuns.md +2 -2
- package/.docs/reference/agents/network.md +1 -1
- package/.docs/reference/ai-sdk/chat-route.md +1 -1
- package/.docs/reference/ai-sdk/network-route.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +1 -1
- package/.docs/reference/ai-sdk/workflow-route.md +1 -1
- package/.docs/reference/ai-sdk/workflow-snapshot-to-stream.md +2 -2
- package/.docs/reference/auth/auth0.md +1 -1
- package/.docs/reference/auth/fga.md +2 -2
- package/.docs/reference/auth/google.md +2 -2
- package/.docs/reference/auth/okta.md +1 -1
- package/.docs/reference/auth/workos.md +2 -2
- package/.docs/reference/browser/agent-browser.md +3 -3
- package/.docs/reference/browser/browser-viewer.md +4 -4
- package/.docs/reference/browser/firecrawl-browser.md +1 -1
- package/.docs/reference/browser/mastra-browser.md +4 -4
- package/.docs/reference/browser/stagehand-browser.md +8 -8
- package/.docs/reference/channels/slack-provider.md +2 -2
- package/.docs/reference/cli/create-mastra.md +1 -1
- package/.docs/reference/cli/mastra.md +155 -24
- package/.docs/reference/client-js/agents.md +26 -9
- package/.docs/reference/client-js/memory.md +2 -2
- package/.docs/reference/client-js/workflows.md +1 -1
- package/.docs/reference/coding-agent/build-base-prompt.md +2 -2
- package/.docs/reference/coding-agent/create-coding-agent.md +2 -2
- package/.docs/reference/configuration.md +7 -7
- package/.docs/reference/core/getAgentById.md +1 -1
- package/.docs/reference/core/getMCPServer.md +1 -1
- package/.docs/reference/core/getScorer.md +1 -1
- package/.docs/reference/core/mastra-class.md +48 -1
- package/.docs/reference/core/mastra-model-gateway.md +1 -1
- package/.docs/reference/datasets/addItem.md +1 -1
- package/.docs/reference/datasets/listItems.md +1 -1
- package/.docs/reference/deployer/netlify.md +4 -4
- package/.docs/reference/deployer/vercel.md +7 -7
- package/.docs/reference/editor/agent-builder/agent-builder-options.md +4 -4
- package/.docs/reference/editor/agent-builder/builder-agent-defaults.md +6 -6
- package/.docs/reference/editor/agent-builder/builder-models.md +3 -3
- package/.docs/reference/editor/blob-store-provider.md +1 -1
- package/.docs/reference/editor/browser-provider.md +3 -3
- package/.docs/reference/editor/filesystem-provider.md +4 -4
- package/.docs/reference/editor/mastra-editor.md +5 -5
- package/.docs/reference/editor/processor-provider.md +3 -3
- package/.docs/reference/editor/sandbox-provider.md +4 -4
- package/.docs/reference/editor/storage-browser-ref.md +6 -6
- package/.docs/reference/editor/storage-workspace-ref.md +4 -4
- package/.docs/reference/editor/tool-provider.md +1 -1
- package/.docs/reference/evals/answer-relevancy.md +5 -5
- package/.docs/reference/evals/answer-similarity.md +1 -1
- package/.docs/reference/evals/bias.md +4 -4
- package/.docs/reference/evals/checks.md +3 -3
- package/.docs/reference/evals/completeness.md +5 -5
- package/.docs/reference/evals/content-similarity.md +5 -5
- package/.docs/reference/evals/context-precision.md +5 -5
- package/.docs/reference/evals/context-recall.md +11 -11
- package/.docs/reference/evals/context-relevance.md +15 -15
- package/.docs/reference/evals/create-scorer.md +1 -1
- package/.docs/reference/evals/faithfulness.md +4 -4
- package/.docs/reference/evals/filter-run.md +2 -2
- package/.docs/reference/evals/hallucination.md +11 -11
- package/.docs/reference/evals/keyword-coverage.md +6 -6
- package/.docs/reference/evals/mastra-scorer.md +2 -2
- package/.docs/reference/evals/noise-sensitivity.md +15 -15
- package/.docs/reference/evals/prompt-alignment.md +20 -20
- package/.docs/reference/evals/rubric.md +2 -2
- package/.docs/reference/evals/run-evals.md +3 -3
- package/.docs/reference/evals/scorer-utils.md +4 -4
- package/.docs/reference/evals/textual-difference.md +4 -4
- package/.docs/reference/evals/tool-call-accuracy.md +4 -4
- package/.docs/reference/evals/toxicity.md +5 -5
- package/.docs/reference/evals/trajectory-accuracy.md +10 -10
- package/.docs/reference/file-based-agents/config.md +3 -3
- package/.docs/reference/file-based-agents/instructions.md +3 -3
- package/.docs/reference/file-based-agents/logger.md +1 -1
- package/.docs/reference/file-based-agents/observability.md +1 -1
- package/.docs/reference/file-based-agents/processors.md +1 -1
- package/.docs/reference/file-based-agents/skills.md +1 -1
- package/.docs/reference/file-based-agents/storage.md +1 -1
- package/.docs/reference/file-based-agents/studio.md +1 -1
- package/.docs/reference/file-based-agents/subagents.md +4 -4
- package/.docs/reference/file-based-agents/tools.md +1 -1
- package/.docs/reference/file-based-agents/workspace.md +1 -1
- package/.docs/reference/index.md +2 -0
- package/.docs/reference/logging/pino-logger.md +3 -3
- package/.docs/reference/memory/clone-utilities.md +1 -1
- package/.docs/reference/memory/cloneThread.md +3 -3
- package/.docs/reference/memory/listThreads.md +1 -1
- package/.docs/reference/memory/memory-class.md +4 -4
- package/.docs/reference/memory/observational-memory.md +15 -15
- package/.docs/reference/memory/recall.md +2 -2
- package/.docs/reference/memory/serialized-memory-config.md +4 -4
- package/.docs/reference/memory/summarizeConversation.md +3 -3
- package/.docs/reference/memory/summarizeThread.md +3 -3
- package/.docs/reference/observability/feedback.md +1 -1
- package/.docs/reference/observability/metrics/automatic-metrics.md +7 -7
- package/.docs/reference/observability/tracing/bridges/datadog.md +2 -2
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +3 -3
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +1 -1
- package/.docs/reference/observability/tracing/exporters/langfuse.md +1 -1
- package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +4 -4
- package/.docs/reference/observability/tracing/exporters/mastra-storage-exporter.md +1 -1
- package/.docs/reference/observability/tracing/interfaces.md +1 -1
- package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +1 -1
- package/.docs/reference/observability/tracing/span-filtering.md +1 -1
- package/.docs/reference/processors/batch-parts-processor.md +1 -1
- package/.docs/reference/processors/cost-guard-processor.md +1 -1
- package/.docs/reference/processors/language-detector.md +1 -1
- package/.docs/reference/processors/message-history-processor.md +1 -1
- package/.docs/reference/processors/moderation-processor.md +2 -2
- package/.docs/reference/processors/pii-detector.md +3 -3
- package/.docs/reference/processors/processor-interface.md +13 -13
- package/.docs/reference/processors/prompt-injection-detector.md +2 -2
- 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 +8 -8
- package/.docs/reference/processors/semantic-recall-processor.md +1 -1
- package/.docs/reference/processors/skill-search-processor.md +1 -1
- package/.docs/reference/processors/system-prompt-scrubber.md +2 -2
- package/.docs/reference/processors/token-limiter-processor.md +4 -4
- package/.docs/reference/processors/tool-call-filter.md +2 -2
- package/.docs/reference/processors/tool-search-processor.md +9 -9
- package/.docs/reference/processors/unicode-normalizer.md +2 -2
- package/.docs/reference/processors/working-memory-processor.md +1 -1
- package/.docs/reference/project-structure.md +1 -1
- package/.docs/reference/pubsub/base.md +4 -4
- package/.docs/reference/pubsub/google-cloud-pubsub.md +2 -2
- package/.docs/reference/pubsub/lease-provider.md +4 -4
- 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 +5 -5
- package/.docs/reference/rag/database-config.md +2 -2
- package/.docs/reference/rag/metadata-filters.md +2 -2
- package/.docs/reference/rag/rerank.md +1 -1
- package/.docs/reference/schedules/overview.md +1 -1
- package/.docs/reference/server/register-api-route.md +1 -1
- package/.docs/reference/server/routes.md +7 -7
- package/.docs/reference/signals/create-notification-inbox-tool.md +1 -1
- package/.docs/reference/signals/signal-provider.md +8 -8
- package/.docs/reference/storage/clickhouse.md +4 -4
- package/.docs/reference/storage/cloudflare-d1.md +4 -4
- package/.docs/reference/storage/convex.md +4 -4
- package/.docs/reference/storage/dsql.md +3 -3
- package/.docs/reference/storage/dynamodb.md +7 -7
- package/.docs/reference/storage/lance.md +1 -1
- package/.docs/reference/storage/mongodb.md +2 -2
- package/.docs/reference/storage/mssql.md +1 -1
- package/.docs/reference/storage/postgresql.md +2 -2
- package/.docs/reference/storage/redis.md +1 -1
- package/.docs/reference/storage/retention.md +33 -33
- package/.docs/reference/storage/spanner.md +8 -8
- package/.docs/reference/storage/upstash.md +1 -1
- package/.docs/reference/streaming/ChunkType.md +2 -2
- package/.docs/reference/streaming/agents/MastraModelOutput.md +1 -1
- package/.docs/reference/streaming/agents/stream.md +2 -2
- package/.docs/reference/streaming/agents/streamUntilIdle.md +2 -2
- package/.docs/reference/streaming/workflows/observeStream.md +1 -1
- package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
- package/.docs/reference/streaming/workflows/stream.md +1 -1
- package/.docs/reference/streaming/workflows/timeTravelStream.md +2 -2
- package/.docs/reference/templates/overview.md +1 -1
- package/.docs/reference/tools/brightdata.md +1 -1
- package/.docs/reference/tools/create-code-mode.md +3 -3
- package/.docs/reference/tools/create-tool.md +1 -1
- package/.docs/reference/tools/graph-rag-tool.md +1 -1
- package/.docs/reference/tools/isolated-vm-transport.md +74 -0
- package/.docs/reference/tools/mcp-client.md +15 -15
- package/.docs/reference/tools/mcp-server.md +21 -21
- package/.docs/reference/tools/submit-plan-tool.md +1 -1
- package/.docs/reference/tools/tavily.md +1 -1
- package/.docs/reference/tools/vector-query-tool.md +5 -5
- package/.docs/reference/vectors/astra.md +1 -1
- package/.docs/reference/vectors/chroma.md +2 -2
- package/.docs/reference/vectors/convex.md +2 -2
- package/.docs/reference/vectors/couchbase.md +4 -4
- package/.docs/reference/vectors/libsql.md +2 -2
- package/.docs/reference/vectors/mongodb.md +3 -3
- package/.docs/reference/vectors/pg.md +5 -5
- package/.docs/reference/vectors/qdrant.md +2 -2
- package/.docs/reference/vectors/s3vectors.md +4 -4
- package/.docs/reference/vectors/turbopuffer.md +1 -1
- package/.docs/reference/vectors/upstash.md +1 -1
- package/.docs/reference/voice/aws-nova-sonic.md +1 -1
- package/.docs/reference/voice/azure.md +1 -1
- package/.docs/reference/voice/google-gemini-live.md +4 -4
- package/.docs/reference/voice/inworld-realtime.md +7 -7
- package/.docs/reference/voice/livekit.md +13 -13
- package/.docs/reference/voice/mistral.md +1 -1
- package/.docs/reference/voice/openai-realtime.md +1 -1
- package/.docs/reference/voice/sarvam.md +1 -1
- package/.docs/reference/voice/voice.addInstructions.md +1 -1
- package/.docs/reference/voice/voice.addTools.md +1 -1
- package/.docs/reference/voice/voice.events.md +1 -1
- package/.docs/reference/voice/voice.getSpeakers.md +2 -2
- package/.docs/reference/voice/voice.on.md +2 -2
- package/.docs/reference/voice/xai-realtime.md +2 -2
- package/.docs/reference/workers/overview.md +85 -0
- package/.docs/reference/workflows/run-methods/cancel.md +1 -1
- package/.docs/reference/workflows/run-methods/startAsync.md +1 -1
- package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
- package/.docs/reference/workflows/workflow-methods/foreach.md +1 -1
- package/.docs/reference/workflows/workflow-methods/sleep.md +1 -1
- package/.docs/reference/workflows/workflow-state-reader.md +2 -2
- package/.docs/reference/workspace/agentfs-filesystem.md +1 -1
- package/.docs/reference/workspace/apple-container-sandbox.md +2 -2
- package/.docs/reference/workspace/daytona-sandbox.md +3 -3
- package/.docs/reference/workspace/docker-sandbox.md +2 -2
- package/.docs/reference/workspace/e2b-sandbox.md +2 -2
- package/.docs/reference/workspace/files-sdk-filesystem.md +3 -3
- package/.docs/reference/workspace/google-drive-filesystem.md +4 -4
- package/.docs/reference/workspace/local-filesystem.md +3 -3
- package/.docs/reference/workspace/local-sandbox.md +3 -3
- package/.docs/reference/workspace/modal-sandbox.md +1 -1
- package/.docs/reference/workspace/platform-filesystem.md +3 -3
- package/.docs/reference/workspace/platform-sandbox.md +2 -2
- package/.docs/reference/workspace/process-manager.md +1 -1
- package/.docs/reference/workspace/railway-sandbox.md +4 -4
- package/.docs/reference/workspace/s3-filesystem.md +1 -1
- package/.docs/reference/workspace/sandbox.md +1 -1
- package/.docs/reference/workspace/vercel-sandbox.md +1 -1
- package/.docs/reference/workspace/workspace-class.md +10 -10
- package/CHANGELOG.md +21 -0
- package/package.json +3 -3
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **Note:** The Agent Builder is part of the Mastra Enterprise Edition. Production deployments require a valid EE license. [Contact sales](https://mastra.ai/contact) for more information.
|
|
6
6
|
|
|
7
|
-
The Agent Builder
|
|
7
|
+
The Agent Builder includes with two supported roles: `admin` and `member`. Wire them through `Mastra.server.rbac`. Without an RBAC provider, every authenticated user has full Builder access; without authentication, the Builder is open to anyone who can reach the server.
|
|
8
8
|
|
|
9
9
|
## Roles
|
|
10
10
|
|
|
@@ -15,11 +15,11 @@ The Agent Builder ships with two supported roles: `admin` and `member`. Wire the
|
|
|
15
15
|
|
|
16
16
|
## Minimum permissions
|
|
17
17
|
|
|
18
|
-
The Builder UI calls several resources on load, so a usable `member` role needs explicit grants on each. The Builder action layer (`/agent-builder/*`) is one resource
|
|
18
|
+
The Builder UI calls several resources on load, so a usable `member` role needs explicit grants on each. The Builder action layer (`/agent-builder/*`) is one resource. The data it reads and writes lives under separate resources.
|
|
19
19
|
|
|
20
20
|
| Permission | Used for |
|
|
21
21
|
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
22
|
-
| `agent-builder:*` | Load Builder actions and run Builder workflows. The derived Builder actions are `agent-builder:read` and `agent-builder:execute
|
|
22
|
+
| `agent-builder:*` | Load Builder actions and run Builder workflows. The derived Builder actions are `agent-builder:read` and `agent-builder:execute`. The wildcard grants both. |
|
|
23
23
|
| `agents:read`, `agents:execute` | List registered agents and chat with the Builder agent |
|
|
24
24
|
| `stored-agents:*` | List, view, create, and edit agents |
|
|
25
25
|
| `stored-skills:*` | List, view, create, and edit stored skills |
|
|
@@ -50,7 +50,7 @@ new MastraEditor({
|
|
|
50
50
|
- `name`: Display name shown in the Builder UI.
|
|
51
51
|
- `createBrowser(config)`: Hydrates a stored browser config into a runtime `MastraBrowser`. This is where you inject runtime-only credentials (API keys, project IDs) that aren't stored in the agent snapshot.
|
|
52
52
|
|
|
53
|
-
Browser classes
|
|
53
|
+
Browser classes release as separate packages (e.g., `@mastra/stagehand`, `@mastra/agent-browser`). The provider entry is a plain object wrapping the class, register one entry per browser you want the Builder to expose to end users. See the [StorageBrowserRef reference](https://mastra.ai/reference/editor/storage-browser-ref) for the full `browser` field schema, including all `StorageBrowserConfig` options.
|
|
54
54
|
|
|
55
55
|
## Feature toggle
|
|
56
56
|
|
|
@@ -66,7 +66,7 @@ The Slack provider handles app creation, OAuth, slash commands, and message rout
|
|
|
66
66
|
`SlackProvider` requires one environment variable and accepts one optional override:
|
|
67
67
|
|
|
68
68
|
- `SLACK_APP_CONFIG_REFRESH_TOKEN` (required): The refresh token from your Slack app configuration tokens, available under **Your App Configuration Tokens** on [api.slack.com/apps](https://api.slack.com/apps). The refresh token doesn't expire, but the access tokens it issues rotate every 12 hours and are auto-persisted to `Mastra.storage`.
|
|
69
|
-
- `baseUrl` (optional): The public URL Slack should send events and OAuth callbacks to. Defaults to the running Mastra server's host and port (for example, `http://localhost:4111` in local development). Pass `baseUrl` explicitly when the public URL differs from the server's resolved address
|
|
69
|
+
- `baseUrl` (optional): The public URL Slack should send events and OAuth callbacks to. Defaults to the running Mastra server's host and port (for example, `http://localhost:4111` in local development). Pass `baseUrl` explicitly when the public URL differs from the server's resolved address: typically a tunnel for local development (`cloudflared tunnel --url http://localhost:4111`) or a deployed URL in production.
|
|
70
70
|
|
|
71
71
|
## Storage requirement
|
|
72
72
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **Note:** The Agent Builder is part of the Mastra Enterprise Edition. Production deployments require a valid EE license. [Contact sales](https://mastra.ai/contact) for more information.
|
|
6
6
|
|
|
7
|
-
The Agent Builder is configured through `MastraEditor.builder`.
|
|
7
|
+
The Agent Builder is configured through `MastraEditor.builder`. Top-level keys control its behavior: `features` toggles UI visibility and `configuration` pins admin-controlled defaults onto every new agent.
|
|
8
8
|
|
|
9
9
|
## Quickstart
|
|
10
10
|
|
|
@@ -55,7 +55,7 @@ new MastraEditor({
|
|
|
55
55
|
})
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
The
|
|
58
|
+
The UI consumes these `AgentFeatures` keys: `tools`, `agents`, `workflows`, `scorers`, `skills`, `memory`, `variables`, `favorites`, `avatarUpload`, `model`, and `browser`. See the [AgentBuilderOptions reference](https://mastra.ai/reference/editor/agent-builder/agent-builder-options) for the full schema.
|
|
59
59
|
|
|
60
60
|
## Admin defaults
|
|
61
61
|
|
|
@@ -95,7 +95,7 @@ export const mastra = new Mastra({
|
|
|
95
95
|
|
|
96
96
|
With no `configuration.agent.tools.allowed` set, both `weather-info` and `web-search` appear in the Builder's tool picker. End users can attach either tool to any agent they create.
|
|
97
97
|
|
|
98
|
-
Entries match on `tool.id`, `Agent.id`, or `workflow.id
|
|
98
|
+
Entries match on `tool.id`, `Agent.id`, or `workflow.id`, the string the entity reports at runtime, not the export name.
|
|
99
99
|
|
|
100
100
|
MCP tools work the same way: load them via `MCPClient.getTools()` and spread the result into the `tools` map.
|
|
101
101
|
|
|
@@ -10,8 +10,8 @@ Production deployments swap the local primitives in the Quickstart for cloud-bac
|
|
|
10
10
|
|
|
11
11
|
1. **EE license**: A valid `MASTRA_EE_LICENSE` so the server will start with the Builder enabled.
|
|
12
12
|
2. **Hosted storage**: A shared store for agents, skills, runs, and memory.
|
|
13
|
-
3. **Shared workspace filesystem**: Survives across instances
|
|
14
|
-
4. **Cloud sandbox**: Runs agent commands safely
|
|
13
|
+
3. **Shared workspace filesystem**: Survives across instances. `local` is single-node only.
|
|
14
|
+
4. **Cloud sandbox**: Runs agent commands safely. `local` is unsafe in shared environments.
|
|
15
15
|
5. **Auth and RBAC**: Gates the Builder UI and `/agent-builder/*` routes.
|
|
16
16
|
6. **Public base URL for channels**: Slack and other channel providers need a reachable URL.
|
|
17
17
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Tool providers let Builder-created agents call tools from third-party apps such as Gmail, Slack, or GitHub. The Builder reuses the same tool providers as the editor, so any provider registered on `MastraEditor` is available in the Builder.
|
|
8
8
|
|
|
9
|
-
This page covers
|
|
9
|
+
This page covers Builder-specific connection setup, scope selection, and management. To register a provider and enable its toolkits, see [Tools](https://mastra.ai/docs/editor/tools).
|
|
10
10
|
|
|
11
11
|
## Setup at a glance
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ To connect a toolkit like Gmail and use it from a Builder agent:
|
|
|
14
14
|
|
|
15
15
|
1. [Register a tool provider](#register-a-tool-provider) on `MastraEditor` with your Composio API key.
|
|
16
16
|
2. [Set up a Composio auth config](#set-up-a-composio-auth-config) for the toolkit and enable it.
|
|
17
|
-
3. [
|
|
17
|
+
3. In the Builder, [connect the toolkit](#connect-a-toolkit) and authorize the connection.
|
|
18
18
|
4. [Choose a connection scope](#connection-scope) if the default author-owned account isn't what you want.
|
|
19
19
|
|
|
20
20
|
The rest of this page covers each step in detail.
|
|
@@ -29,7 +29,7 @@ Before agents can use integration tools in the Builder:
|
|
|
29
29
|
|
|
30
30
|
## Register a tool provider
|
|
31
31
|
|
|
32
|
-
The Builder reuses the editor's tool providers. Register each provider you want to expose on the `toolProviders` map of `MastraEditor`. Mastra
|
|
32
|
+
The Builder reuses the editor's tool providers. Register each provider you want to expose on the `toolProviders` map of `MastraEditor`. Mastra includes providers for [Composio](https://composio.dev) and [Arcade](https://arcade.dev). Add a provider by giving it a key and an instance.
|
|
33
33
|
|
|
34
34
|
```typescript
|
|
35
35
|
import { Mastra } from '@mastra/core'
|
|
@@ -49,13 +49,13 @@ export const mastra = new Mastra({
|
|
|
49
49
|
})
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
Each provider's toolkits become available in the Builder once it's registered. Use `allowedToolkits` to restrict which toolkits the provider exposes
|
|
52
|
+
Each provider's toolkits become available in the Builder once it's registered. Use `allowedToolkits` to restrict which toolkits the provider exposes, by slug, such as `gmail` or `googlecalendar`. Omit it to expose every toolkit the provider offers. To add another provider, import it and add another entry to `toolProviders`. For the full list of providers and their options, see [Tools, Integration providers](https://mastra.ai/docs/editor/tools).
|
|
53
53
|
|
|
54
54
|
`ComposioToolProvider` needs a Composio **project** API key (the `x-api-key` type from a project's settings in the [Composio dashboard](https://dashboard.composio.dev)). Store it in an environment variable, as shown with `COMPOSIO_API_KEY` above.
|
|
55
55
|
|
|
56
56
|
## Set up a Composio auth config
|
|
57
57
|
|
|
58
|
-
Each toolkit a user can connect needs its own auth config in the [Composio dashboard](https://dashboard.composio.dev). An auth config defines how Composio authenticates with an app
|
|
58
|
+
Each toolkit a user can connect needs its own auth config in the [Composio dashboard](https://dashboard.composio.dev). An auth config defines how Composio authenticates with an app, its OAuth client, scopes, and credentials. Each toolkit needs its own because requirements vary by app: some share common OAuth methods, while others need extra setup. Without an enabled config, the connection flow fails.
|
|
59
59
|
|
|
60
60
|
1. Open the [Composio dashboard](https://dashboard.composio.dev) and select the toolkit you want to enable, for example **Gmail** or **GitHub**.
|
|
61
61
|
2. Create an auth config for the toolkit and complete the app-specific setup. Composio's [auth config docs](https://docs.composio.dev/docs/authenticating-tools) cover the fields each app requires.
|
|
@@ -63,7 +63,7 @@ Each toolkit a user can connect needs its own auth config in the [Composio dashb
|
|
|
63
63
|
|
|
64
64
|
Keep exactly one auth config enabled per toolkit. When a user connects the toolkit, the provider resolves the single enabled config for that toolkit and starts the OAuth flow against it.
|
|
65
65
|
|
|
66
|
-
> **Warning:** The provider throws if a toolkit has zero enabled auth configs or more than one. With no enabled config, the connection flow fails with an error like `No ENABLED auth config for toolkit "github"
|
|
66
|
+
> **Warning:** The provider throws if a toolkit has zero enabled auth configs or more than one. With no enabled config, the connection flow fails with an error like `No ENABLED auth config for toolkit "github"`. Enable one in the Composio dashboard to fix it. Enable exactly one auth config per toolkit you expose in the Builder.
|
|
67
67
|
|
|
68
68
|
## Connect a toolkit
|
|
69
69
|
|
|
@@ -76,7 +76,7 @@ The connected account is bound to the agent, and its tools are ready to use on t
|
|
|
76
76
|
|
|
77
77
|
## Connection scope
|
|
78
78
|
|
|
79
|
-
Each connection determines which account a tool call uses at runtime, and its _scope_ controls who shares that credential. A scope maps each call to a _bucket_
|
|
79
|
+
Each connection determines which account a tool call uses at runtime, and its _scope_ controls who shares that credential. A scope maps each call to a _bucket_, the identity partition that a connected account is stored under. Scope is a tenancy decision made by you, the app author, not by the end user connecting an account, so you set it on the provider, not in the Builder UI.
|
|
80
80
|
|
|
81
81
|
- `per-author` (default): the connection belongs to the agent's author. Any invoker runs the agent with the author's account. Use this for personal agents or a single shared team account.
|
|
82
82
|
- `shared`: every caller uses one shared bucket, regardless of who invokes the agent. Use this for a platform-owned account that all users should share.
|
|
@@ -92,7 +92,7 @@ const composio = new ComposioToolProvider({
|
|
|
92
92
|
})
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
With `caller-supplied`, the host app must forward a `resourceId` on every request so each tenant
|
|
95
|
+
With `caller-supplied`, the host app must forward a `resourceId` on every request so each tenant is routed to its own bucket. Set `mapUserToResourceId` on the server's auth config to derive the `resourceId` from the authenticated user, so every request carries it automatically:
|
|
96
96
|
|
|
97
97
|
```typescript
|
|
98
98
|
export const mastra = new Mastra({
|
|
@@ -23,7 +23,7 @@ new MastraEditor({
|
|
|
23
23
|
})
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
Observational memory lets the agent learn long-lived facts from past conversations. Storage on the `Mastra` instance is required
|
|
26
|
+
Observational memory lets the agent learn long-lived facts from past conversations. Storage on the `Mastra` instance is required, see the [Memory overview](https://mastra.ai/docs/memory/overview) for the prerequisites.
|
|
27
27
|
|
|
28
28
|
## Observational memory model
|
|
29
29
|
|
|
@@ -41,7 +41,7 @@ new MastraEditor({
|
|
|
41
41
|
agent: {
|
|
42
42
|
memory: {
|
|
43
43
|
observationalMemory: {
|
|
44
|
-
model: 'openai/gpt-5.
|
|
44
|
+
model: 'openai/gpt-5.6-sol',
|
|
45
45
|
},
|
|
46
46
|
},
|
|
47
47
|
},
|
|
@@ -58,7 +58,7 @@ yarn add @mastra/editor @mastra/libsql
|
|
|
58
58
|
bun add @mastra/editor @mastra/libsql
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
The example below defines a storage adapter
|
|
61
|
+
The example below defines a storage adapter and registers a builder agent, plus enables the editor as explained in the prerequisites:
|
|
62
62
|
|
|
63
63
|
```typescript
|
|
64
64
|
import { Mastra } from '@mastra/core/mastra'
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# Channels
|
|
4
4
|
|
|
5
|
-
Channels connect an AgentController to messaging platforms like Slack, Discord, and Telegram, so a controller-backed session runs inside a chat thread. Inbound platform messages route into a controller [`Session`](https://mastra.ai/docs/agent-controller/session), and the agent's
|
|
5
|
+
Channels connect an AgentController to messaging platforms like Slack, Discord, and Telegram, so a controller-backed session runs inside a chat thread. Inbound platform messages route into a controller [`Session`](https://mastra.ai/docs/agent-controller/session), and the agent's output renders back to the platform with native streaming. The response can also include tool approval cards and typing status.
|
|
6
6
|
|
|
7
|
-
AgentController channels
|
|
7
|
+
AgentController channels use the same channel layer as [agent channels](https://mastra.ai/docs/capabilities/channels/overview). The adapters and configuration shape are shared. Both channel types also use the same rendering pipeline.
|
|
8
|
+
|
|
9
|
+
Message routing differs by channel type. Agent channels route messages straight into the agent loop. With AgentController channels, messages enter a durable session that tracks the active mode, model, permission grants, and state across the whole conversation.
|
|
8
10
|
|
|
9
11
|
## Configure a controller
|
|
10
12
|
|
|
@@ -77,7 +79,7 @@ Point the platform's webhook, event, or interactions URL to this path. See [Webh
|
|
|
77
79
|
|
|
78
80
|
## One session per chat thread
|
|
79
81
|
|
|
80
|
-
Each chat thread maps to one durable controller session. The first message in a Slack or Discord thread creates a Mastra thread and a controller session keyed to it
|
|
82
|
+
Each chat thread maps to one durable controller session. The first message in a Slack or Discord thread creates a Mastra thread and a controller session keyed to it. Every later message in that chat thread reuses both. The session carries the active mode, model, permission grants, and state for the life of the conversation, as with a session driven from a terminal or web UI.
|
|
81
83
|
|
|
82
84
|
By default the session key derives from the platform and the external thread ID (`channel:slack:<THREAD_ID>`). Pass `resolveResourceId` in the channels configuration to control the mapping yourself.
|
|
83
85
|
|
|
@@ -87,7 +89,7 @@ Avoid mapping multiple active chat threads to one session. A session works on on
|
|
|
87
89
|
|
|
88
90
|
Tools that require approval render as interactive cards with Approve and Deny buttons, the same as [agent channel tool approvals](https://mastra.ai/docs/capabilities/channels/overview). The controller run pauses at the session's approval gate until a user acts on the card, then resumes and streams the continuation back to the thread.
|
|
89
91
|
|
|
90
|
-
|
|
92
|
+
These behaviors follow from routing approvals through the session:
|
|
91
93
|
|
|
92
94
|
- A new message in the thread while an approval is pending declines that approval, the same as sending a new message in a terminal session. The new message supersedes the pending ask.
|
|
93
95
|
- On adapters that can't render approval buttons (`toolDisplay: 'text'`), tools run without approval prompts so runs can't stall on a card nobody can act on.
|
|
@@ -96,8 +98,8 @@ See [Tool approvals and permissions](https://mastra.ai/docs/agent-controller/too
|
|
|
96
98
|
|
|
97
99
|
## Limits
|
|
98
100
|
|
|
99
|
-
- Adapters can be constructed manually
|
|
100
|
-
- Controller sessions are in-memory objects, so channels-backed controllers need a long-lived server. Serverless deployment isn't supported for controller channels
|
|
101
|
+
- Adapters can be constructed manually with the same configuration. The managed connect flow (`mastra.channels.slack.connect(...)`) also supports controller-owned installations: call it with an options object (`connect({ id, name })`) to connect a controller that has no registered agent. Adapters without controller support must still be constructed manually.
|
|
102
|
+
- Controller sessions are in-memory objects, so channels-backed controllers need a long-lived server. Serverless deployment isn't supported for controller channels. Agent channels support it as described in [Serverless deployment](https://mastra.ai/docs/capabilities/channels/overview).
|
|
101
103
|
- Pending tool approvals don't survive a server restart. An approval card acted on after a restart is ignored as stale.
|
|
102
104
|
- Mode switching from chat (for example, a `/mode` slash command) isn't available yet.
|
|
103
105
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Modes
|
|
4
4
|
|
|
5
|
-
Modes define the different behaviors an AgentController can run. Each mode layers its own instructions and tool overrides on top of a shared backing agent, so the same agent can act as a planner in one mode and an executor in another. The AgentController keeps exactly one mode active at a time
|
|
5
|
+
Modes define the different behaviors an AgentController can run. Each mode layers its own instructions and tool overrides on top of a shared backing agent, so the same agent can act as a planner in one mode and an executor in another. The AgentController keeps exactly one mode active at a time and carries the thread and state across switches, plus handles the transition between them.
|
|
6
6
|
|
|
7
|
-
Every AgentController needs at least one mode
|
|
7
|
+
Every AgentController needs at least one mode, the `modes` array is required, and the AgentController throws at construction if it's empty. A single-purpose AgentController still defines one mode. Multiple modes are how you give a session more than one behavior to switch between.
|
|
8
8
|
|
|
9
9
|
A mode supplies three things that change how the agent behaves:
|
|
10
10
|
|
|
@@ -83,7 +83,7 @@ You can't set both `tools` and `additionalTools` on the same mode.
|
|
|
83
83
|
|
|
84
84
|
### Restricting tool visibility
|
|
85
85
|
|
|
86
|
-
`tools` and `additionalTools` control which tools are **added** to a mode's run
|
|
86
|
+
`tools` and `additionalTools` control which tools are **added** to a mode's run, they don't hide the backing agent's own tools. To restrict which of those tools the model can actually see and call, set `availableTools`:
|
|
87
87
|
|
|
88
88
|
```typescript
|
|
89
89
|
const reviewMode = {
|
|
@@ -96,11 +96,11 @@ const reviewMode = {
|
|
|
96
96
|
|
|
97
97
|
`availableTools` is a per-mode visibility allowlist that matches each tool by its final exposed name:
|
|
98
98
|
|
|
99
|
-
- **`undefined`** (default): no mode-level restriction
|
|
99
|
+
- **`undefined`** (default): no mode-level restriction: every tool is visible.
|
|
100
100
|
- **`[]`**: no tools are available for this mode.
|
|
101
101
|
- A denied tool stays hidden even when the list includes it. Per-tool and per-category `deny` rules in your permission config always take precedence.
|
|
102
102
|
|
|
103
|
-
Workspace tools use the same list as every other tool
|
|
103
|
+
Workspace tools use the same list as every other tool, reference them by their exposed names (`view`, `write_file`, `find_files`, etc.). Visibility is enforced at LLM-call time, so the model never sees, and can't attempt to call, a tool outside the allowlist.
|
|
104
104
|
|
|
105
105
|
### Mode transitions
|
|
106
106
|
|
|
@@ -119,7 +119,7 @@ On plan approval, the AgentController automatically switches to `build` mode. On
|
|
|
119
119
|
|
|
120
120
|
## Switching modes
|
|
121
121
|
|
|
122
|
-
The active mode lives on the Session, so call `agentController.session.mode.switch()` to change it. The switch aborts any in-progress generation
|
|
122
|
+
The active mode lives on the Session, so call `agentController.session.mode.switch()` to change it. The switch aborts any in-progress generation and saves the current model to the outgoing mode, plus emits a `mode_changed` event. It then resolves the incoming mode's model and, when one resolves, applies it and emits a `model_changed` event:
|
|
123
123
|
|
|
124
124
|
```typescript
|
|
125
125
|
await agentController.session.mode.switch({ modeId: 'build' })
|
|
@@ -4,15 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
> **Beta:** The `AgentController` feature is in beta stage and subject to breaking changes in minor versions until it graduates from its beta status.
|
|
6
6
|
|
|
7
|
-
The AgentController is a session controller for building interactive agent applications.
|
|
7
|
+
The AgentController is a session controller for building interactive agent applications.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
It handles the runtime concerns between your UI and the agent loop. These include conversation threads, mode switches, and persistent state. It also gates tool execution with approvals and coordinates subagents. You can focus on what your agent does rather than how to wire it together.
|
|
10
10
|
|
|
11
|
-
[
|
|
11
|
+
An AgentController exposes a [`Session`](https://mastra.ai/docs/agent-controller/session), the per-conversation runtime state that tracks the active mode, model, thread binding, permission grants, follow-up queue, and token usage. The AgentController is the shared host. The Session is the conversation running inside it. In a multi-user host, the same AgentController can back many Sessions at once.
|
|
12
|
+
|
|
13
|
+
[Mastra Code](https://code.mastra.ai/) is the flagship AgentController implementation. It's a terminal-based coding agent with multi-model support, persistent conversations, and plan-then-execute workflows.
|
|
12
14
|
|
|
13
15
|
## What you can build
|
|
14
16
|
|
|
15
|
-
The AgentController gives you the runtime pieces to
|
|
17
|
+
The AgentController gives you the runtime pieces to release interactive agent applications. Each outcome below maps to a capability you can use today:
|
|
16
18
|
|
|
17
19
|
- **Resume a conversation exactly where the user left off.** Persistent [threads and state](https://mastra.ai/docs/agent-controller/threads-and-state) reload the active mode, model, and progress across restarts, so a coding agent or assistant picks up mid-task instead of starting over.
|
|
18
20
|
- **Gate destructive actions behind human approval.** [Tool approvals and permission policies](https://mastra.ai/docs/agent-controller/tool-approvals) let you require confirmation for risky operations like file writes or deployments, while trusted tools run automatically.
|
|
@@ -32,15 +34,15 @@ Use the AgentController when your application needs:
|
|
|
32
34
|
- Subagent orchestration to delegate focused subtasks with constrained tools
|
|
33
35
|
- Session continuity with persistent threads, state, and observational memory across restarts
|
|
34
36
|
|
|
35
|
-
You could assemble all of this yourself on top of the [Agent class](https://mastra.ai/docs/agents/overview), which exposes the full agent loop, tools, and memory. The AgentController
|
|
37
|
+
You could assemble all of this yourself on top of the [Agent class](https://mastra.ai/docs/agents/overview), which exposes the full agent loop, tools, and memory. The AgentController provides opinionated defaults for an ongoing session where the agent acts as a collaborator rather than a one-shot endpoint. Reach for the Agent class directly when you want full control or a request-response call. Reach for the AgentController when you want the collaborative-session model without building the runtime around it.
|
|
36
38
|
|
|
37
39
|
## Key capabilities
|
|
38
40
|
|
|
39
|
-
- **Session**: Per-conversation state
|
|
41
|
+
- **Session**: Per-conversation state: active thread, mode, model, grants, follow-ups, token usage, and the display snapshot: accessed through `agentController.session`. See [Session](https://mastra.ai/docs/agent-controller/session).
|
|
40
42
|
- **Modes**: Define distinct agent personalities (instructions, tools, model) and switch between them without losing conversation context. See [Modes](https://mastra.ai/docs/agent-controller/modes).
|
|
41
43
|
- **Threads and state**: Persist conversations and structured state across sessions, users, and mode switches. See [Threads and state](https://mastra.ai/docs/agent-controller/threads-and-state).
|
|
42
44
|
- **Subagents**: Spawn focused child agents with constrained tools for subtasks, optionally forking the parent conversation. See [Subagents](https://mastra.ai/docs/agent-controller/subagents).
|
|
43
|
-
- **Tool approvals and permissions**: Configure which tools require user confirmation
|
|
45
|
+
- **Tool approvals and permissions**: Configure which tools require user confirmation and grant session-wide exceptions, plus handle interactive tool suspension. See [Tool approvals](https://mastra.ai/docs/agent-controller/tool-approvals).
|
|
44
46
|
- **Model management**: Switch models per-mode at runtime, track usage, and resolve gateway-backed models through Mastra's [model router](https://mastra.ai/models).
|
|
45
47
|
- **Follow-ups and steering**: Queue messages while the agent is running, or inject mid-stream instructions to redirect the agent. Built on [signals](https://mastra.ai/docs/long-running-agents/signals).
|
|
46
48
|
- **Event system**: Subscribe to typed events (message updates, mode changes, tool approvals) or coalesced `AgentControllerDisplayState` snapshots to drive your UI. See [Events](https://mastra.ai/reference/agent-controller/agent-controller-class).
|
|
@@ -59,7 +61,7 @@ const agent = new Agent({
|
|
|
59
61
|
id: 'assistant',
|
|
60
62
|
name: 'assistant',
|
|
61
63
|
instructions: 'Help the user plan and complete tasks.',
|
|
62
|
-
model: 'openai/gpt-5.
|
|
64
|
+
model: 'openai/gpt-5.6-sol',
|
|
63
65
|
})
|
|
64
66
|
|
|
65
67
|
const agentController = new AgentController({
|
|
@@ -119,7 +121,9 @@ The AgentController sits between your application layer and the underlying agent
|
|
|
119
121
|
└───────────────────────────────────────┘
|
|
120
122
|
```
|
|
121
123
|
|
|
122
|
-
Your app sends commands
|
|
124
|
+
Your app sends commands, send a message, switch mode, approve a tool call, and receives typed events such as `message_update` and `tool_approval_required`.
|
|
125
|
+
|
|
126
|
+
The AgentController manages the lifecycle internally. It persists threads and routes requests to the correct mode agent. It also enforces permissions and emits events as state changes.
|
|
123
127
|
|
|
124
128
|
## Next steps
|
|
125
129
|
|
|
@@ -2,13 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
# Session
|
|
4
4
|
|
|
5
|
-
A [`Session`](https://mastra.ai/reference/agent-controller/session) holds the live state of an AgentController
|
|
5
|
+
A [`Session`](https://mastra.ai/reference/agent-controller/session) holds the live state of an AgentController. It identifies the user and active thread, along with the selected mode and model. It also stores permission grants, queued follow-ups, token usage, application state, and the display snapshot.
|
|
6
|
+
|
|
7
|
+
You reach it through `agentController.session`.
|
|
6
8
|
|
|
7
9
|
## What the Session tracks
|
|
8
10
|
|
|
9
|
-
The Session is the live state of a single user's interaction with the AgentController.
|
|
11
|
+
The Session is the live state of a single user's interaction with the AgentController.
|
|
12
|
+
|
|
13
|
+
It answers who owns the session and which thread is bound. It also identifies the selected mode and model while tracking approvals, queued or running work, application state, and the snapshot to render.
|
|
14
|
+
|
|
15
|
+
A session has one active thread at a time but can list, switch between, and clone many threads over its lifetime. Anything that describes the current state lives here. The AgentController owns the shared infrastructure every session runs on.
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
Each session has its own identity and state. One AgentController can therefore serve many users at once, with a separate `resourceId` and Session preventing mode, grant, or active-thread data from leaking between users.
|
|
18
|
+
|
|
19
|
+
Calling `createSession` with the same `resourceId` returns the existing session (get-or-create), so a resource always resumes its own session.
|
|
12
20
|
|
|
13
21
|
The rest of this page walks through the Session's state. Each part is a focused sub-object on `agentController.session`:
|
|
14
22
|
|
|
@@ -17,7 +25,7 @@ The rest of this page walks through the Session's state. Each part is a focused
|
|
|
17
25
|
- **What's happening right now**: [Run state](#run-state) reflects the in-flight generation, and [Follow-ups](#follow-ups) holds messages queued to send when it finishes.
|
|
18
26
|
- **What you store and render**: [State](#state) holds your application's structured data, and [Display state](#display-state) is the single snapshot your UI renders from.
|
|
19
27
|
|
|
20
|
-
The AgentController performs actions that change this state
|
|
28
|
+
The AgentController performs actions that change this state, switching threads, modes, or models, because those operations coordinate shared infrastructure and emit events. The Session is where you read the result. The sections below note this split where it matters.
|
|
21
29
|
|
|
22
30
|
## Identity
|
|
23
31
|
|
|
@@ -30,7 +38,7 @@ const resourceId = agentController.session.identity.getResourceId()
|
|
|
30
38
|
const threadId = agentController.session.thread.getId()
|
|
31
39
|
```
|
|
32
40
|
|
|
33
|
-
The session `id` and `ownerId` are stable for the life of the session
|
|
41
|
+
The session `id` and `ownerId` are stable for the life of the session, they don't change when the resource ID is switched. They mirror the `id` and `ownerId` fields on `SessionRecord` in storage, so storage layers can key sessions by a stable identifier rather than the mutable resource ID.
|
|
34
42
|
|
|
35
43
|
The resource ID is set when creating a session via [`agentController.createSession()`](https://mastra.ai/reference/agent-controller/agent-controller-class) and defaults to the agentController `id`. See [Resource IDs](https://mastra.ai/docs/agent-controller/threads-and-state) for how it scopes threads.
|
|
36
44
|
|
|
@@ -67,7 +75,7 @@ See [Modes](https://mastra.ai/docs/agent-controller/modes) for how modes carry t
|
|
|
67
75
|
|
|
68
76
|
## Permission grants
|
|
69
77
|
|
|
70
|
-
The AgentController owns permission _policy_
|
|
78
|
+
The AgentController owns permission _policy_, which categories or tools require approval. The Session owns the _grants_ a user makes during the conversation. A grant lets a tool run for the rest of the session without prompting again:
|
|
71
79
|
|
|
72
80
|
```typescript
|
|
73
81
|
// Grant a category or tool for the rest of the session
|
|
@@ -105,7 +113,9 @@ Queue a follow-up with `agentController.followUp({ content })`. To redirect the
|
|
|
105
113
|
|
|
106
114
|
## State
|
|
107
115
|
|
|
108
|
-
`session.state` holds the conversation's application state
|
|
116
|
+
`session.state` holds the conversation's application state, structured values that agents and the UI share, such as model preferences, feature flags, or progress.
|
|
117
|
+
|
|
118
|
+
The AgentController defines the shape with a `stateSchema`. The Session owns the live snapshot and validates updates against that schema. Every write emits `state_changed`:
|
|
109
119
|
|
|
110
120
|
```typescript
|
|
111
121
|
const state = agentController.session.state.get()
|
|
@@ -116,9 +126,17 @@ See [Threads and state](https://mastra.ai/docs/agent-controller/threads-and-stat
|
|
|
116
126
|
|
|
117
127
|
## Display state
|
|
118
128
|
|
|
119
|
-
A conversation emits
|
|
129
|
+
A conversation emits fine-grained events for streamed tokens and tool activity. Other events cover pending approvals, task updates, and token usage.
|
|
130
|
+
|
|
131
|
+
Subscribing to each event type and reassembling the current picture yourself is tedious and error-prone.
|
|
132
|
+
|
|
133
|
+
`session.displayState` does that work for you.
|
|
134
|
+
|
|
135
|
+
It's a reducer-maintained snapshot.
|
|
136
|
+
|
|
137
|
+
The Session keeps one `AgentControllerDisplayState` object and folds every agentController event into it as it happens, so the snapshot always reflects the latest state.
|
|
120
138
|
|
|
121
|
-
It
|
|
139
|
+
It captures everything a UI needs to render. The snapshot shows whether the agent is running, what it's streaming, and which tools or subagents are active. It also includes pending approvals, the current task list, token usage, and queued follow-ups.
|
|
122
140
|
|
|
123
141
|
Because it's a single object, you can drive an entire UI from one place: read the current snapshot with `get()`, and re-render whenever the AgentController emits `display_state_changed` (fired after every other event):
|
|
124
142
|
|
|
@@ -16,7 +16,7 @@ const agent = new Agent({
|
|
|
16
16
|
id: 'assistant',
|
|
17
17
|
name: 'assistant',
|
|
18
18
|
instructions: 'Use subagents when a focused task needs a narrower toolset.',
|
|
19
|
-
model: 'openai/gpt-5.
|
|
19
|
+
model: 'openai/gpt-5.6-sol',
|
|
20
20
|
})
|
|
21
21
|
|
|
22
22
|
const agentController = new AgentController({
|
|
@@ -47,17 +47,17 @@ const agentController = new AgentController({
|
|
|
47
47
|
|
|
48
48
|
The parent agent can then call the auto-generated `subagent` tool with a `task` description and optional `agentType`.
|
|
49
49
|
|
|
50
|
-
When you define a subagent,
|
|
50
|
+
When you define a subagent, give its `description` and `instructions` a clear, narrow scope. The `description` is what the parent model reads to decide _when_ to delegate, so state the single job the subagent is for and, by implication, what it's not for, "Reads files and gathers context without making changes" tells the parent to reach for it during exploration and to handle edits elsewhere. The `instructions` then keep the child agent inside that job. A subagent scoped to one task with a focused toolset stays predictable and is easier for the parent to route to. A broadly described subagent invites the parent to over-delegate and blurs the boundary between types. Pair the narrow scope with `allowedWorkspaceTools` so the subagent can only do what its description promises.
|
|
51
51
|
|
|
52
52
|
For the full list of subagent configuration options, see [`AgentController` reference](https://mastra.ai/reference/agent-controller/agent-controller-class).
|
|
53
53
|
|
|
54
54
|
## Forked subagents
|
|
55
55
|
|
|
56
|
-
A default subagent starts with a fresh context: it can't see the parent conversation, so you pass everything it needs in the `task` description. That's the right model for self-contained work, but it has two costs. The subagent has no access to what's already happened, and it builds a brand-new request prefix
|
|
56
|
+
A default subagent starts with a fresh context: it can't see the parent conversation, so you pass everything it needs in the `task` description. That's the right model for self-contained work, but it has two costs. The subagent has no access to what's already happened, and it builds a brand-new request prefix, a different system prompt and tool schemas, so it can't reuse the parent's prompt cache.
|
|
57
57
|
|
|
58
58
|
**Forked subagents** solve both. Instead of a fresh agent, a fork clones the parent thread and runs the parent agent itself, so it sees the full conversation history and keeps the same system prompt and tool schemas as the parent. The identical prefix means the model's prompt cache still hits, which makes context-heavy delegation cheaper and faster.
|
|
59
59
|
|
|
60
|
-
Use a fork when the subtask depends on the conversation so far
|
|
60
|
+
Use a fork when the subtask depends on the conversation so far, prior messages, earlier tool results, or the parent's tool environment, and you want to run it without paying to rebuild that context. Use a default subagent when the task is self-contained and benefits from a narrower toolset or a tighter system prompt, or alternatively a cheaper model.
|
|
61
61
|
|
|
62
62
|
Enable forked mode per-type:
|
|
63
63
|
|
|
@@ -76,9 +76,12 @@ Or per-invocation via the `subagent` tool's `forked` input parameter, which over
|
|
|
76
76
|
|
|
77
77
|
Because a fork reuses the parent agent to keep the prompt prefix stable, the subagent's own definition is mostly set aside:
|
|
78
78
|
|
|
79
|
-
- Memory must be configured on the AgentController, since forking clones the parent thread.
|
|
79
|
+
- Memory must be configured on the AgentController, since forking clones the parent thread.
|
|
80
|
+
|
|
81
|
+
Without it, the fork call returns an error.
|
|
82
|
+
|
|
80
83
|
- The fork runs with the parent agent's instructions, tools, and model. The subagent definition's own `instructions`, `tools`, and `defaultModelId` are ignored, and a per-invocation `modelId` is ignored too.
|
|
81
|
-
- Only the subagent definition's `description` still matters
|
|
84
|
+
- Only the subagent definition's `description` still matters: it's what the parent model reads to decide when to delegate.
|
|
82
85
|
- Fork threads are tagged with `metadata.forkedSubagent === true` and hidden from `session.thread.list()` by default.
|
|
83
86
|
- Recursive forks are blocked at runtime: the inherited `subagent` tool is disabled inside a fork to prevent infinite nesting.
|
|
84
87
|
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
# Threads and state
|
|
4
4
|
|
|
5
|
-
Threads and state are how an AgentController conversation survives beyond a single exchange. A **thread** is the persistent record of a conversation
|
|
5
|
+
Threads and state are how an AgentController conversation survives beyond a single exchange. A **thread** is the persistent record of a conversation, its messages and metadata, saved to storage so a user can close the app and resume the same conversation later, or switch between several conversations. **State** is structured data attached to the conversation, values like model preferences, feature flags, or progress, that agents and your UI read and write as the conversation runs.
|
|
6
6
|
|
|
7
|
-
The
|
|
7
|
+
The thread and state work together: the thread is the message history, and state is the shared scratchpad alongside it.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Both persist across mode switches, model changes, and restarts, so nothing is lost when a user switches from plan mode to build mode or reopens the app the next day.
|
|
10
|
+
|
|
11
|
+
Thread _lifecycle_ transitions, create, switch, clone, delete, live on the AgentController because they coordinate the shared thread lock and emit events. The active thread binding and thread/message _reads_ live on the [`Session`](https://mastra.ai/docs/agent-controller/session) as `agentController.session.thread`.
|
|
10
12
|
|
|
11
13
|
## Threads
|
|
12
14
|
|
|
13
|
-
A thread holds one conversation's full message history. The AgentController binds the Session to one active thread at a time
|
|
15
|
+
A thread holds one conversation's full message history. The AgentController binds the Session to one active thread at a time. Messages you send and the agent's replies are appended to that thread and saved to storage. Threads let users resume a past conversation or keep several conversations side by side, or alternatively branch one into alternatives.
|
|
14
16
|
|
|
15
17
|
### Creating and selecting threads
|
|
16
18
|
|
|
@@ -29,7 +31,9 @@ const thread = await agentController.createThread({ title: 'New conversation' })
|
|
|
29
31
|
|
|
30
32
|
### Switching threads
|
|
31
33
|
|
|
32
|
-
Switch to an existing thread.
|
|
34
|
+
Switch to an existing thread.
|
|
35
|
+
|
|
36
|
+
The agentController aborts any in-progress generation and acquires a lock on the new thread, plus emits a `thread_changed` event:
|
|
33
37
|
|
|
34
38
|
```typescript
|
|
35
39
|
await agentController.switchThread({ threadId: 'thread-abc123' })
|
|
@@ -74,7 +78,7 @@ const agentController = new AgentController({
|
|
|
74
78
|
|
|
75
79
|
## State
|
|
76
80
|
|
|
77
|
-
Where a thread stores the conversation's messages, state stores structured values that describe the conversation but aren't messages
|
|
81
|
+
Where a thread stores the conversation's messages, state stores structured values that describe the conversation but aren't messages, model preferences, feature flags, UI settings, or progress markers. Agents can read and update state during a run, and your UI can react to changes, so state is how the agent and the interface stay in sync on shared facts. You define its shape with a schema, and every update is validated against that schema before it's applied.
|
|
78
82
|
|
|
79
83
|
### Defining a state schema
|
|
80
84
|
|
|
@@ -89,7 +93,7 @@ const agent = new Agent({
|
|
|
89
93
|
id: 'assistant',
|
|
90
94
|
name: 'assistant',
|
|
91
95
|
instructions: 'Help the user manage a stateful session.',
|
|
92
|
-
model: 'openai/gpt-5.
|
|
96
|
+
model: 'openai/gpt-5.6-sol',
|
|
93
97
|
})
|
|
94
98
|
|
|
95
99
|
const agentController = new AgentController({
|
|
@@ -134,7 +138,7 @@ The resource ID is part of a conversation's identity, so you read it from the Se
|
|
|
134
138
|
const resourceId = agentController.session.identity.getResourceId()
|
|
135
139
|
```
|
|
136
140
|
|
|
137
|
-
The session also has a stable `id` and `ownerId` (read with `session.identity.getId()` and `session.identity.getOwnerId()`). Unlike the resource ID, these don't change when you switch resources
|
|
141
|
+
The session also has a stable `id` and `ownerId` (read with `session.identity.getId()` and `session.identity.getOwnerId()`). Unlike the resource ID, these don't change when you switch resources, see [Session identity](https://mastra.ai/docs/agent-controller/session) for details.
|
|
138
142
|
|
|
139
143
|
## Related
|
|
140
144
|
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
# Tool approvals and permissions
|
|
4
4
|
|
|
5
|
-
The AgentController provides a permission system that controls which tools require user approval before execution.
|
|
5
|
+
The AgentController provides a permission system that controls which tools require user approval before execution.
|
|
6
|
+
|
|
7
|
+
You can configure policies at the category level or per-tool, and grant session-wide exceptions for trusted tools.
|
|
8
|
+
|
|
9
|
+
This gives agents with access to destructive or sensitive tools, file writes, command execution, API calls, a human-in-the-loop checkpoint before those tools run.
|
|
6
10
|
|
|
7
11
|
## Permission policies
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
Policies control tool behavior:
|
|
10
14
|
|
|
11
15
|
- `allow`: The tool runs without prompting
|
|
12
16
|
- `ask`: The tool pauses and emits a `tool_approval_required` event; the user must approve or decline
|
|
@@ -62,7 +66,7 @@ agentController.session.respondToToolApproval({ decision: 'always_allow_category
|
|
|
62
66
|
|
|
63
67
|
## Session grants
|
|
64
68
|
|
|
65
|
-
The AgentController owns permission _policy_ (which categories require approval)
|
|
69
|
+
The AgentController owns permission _policy_ (which categories require approval). The [`Session`](https://mastra.ai/docs/agent-controller/session) owns the _grants_ a user makes during a conversation. Grant a category or tool for the rest of the session so it runs without further prompting:
|
|
66
70
|
|
|
67
71
|
```typescript
|
|
68
72
|
// Grant all edit tools for this session
|
package/.docs/docs/agents/a2a.md
CHANGED
|
@@ -53,7 +53,9 @@ An agent card includes fields like the agent name, description, endpoint URL, pr
|
|
|
53
53
|
}
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
A2A represents work as messages and tasks. Messages carry text, file, or structured data parts.
|
|
56
|
+
A2A represents work as messages and tasks. Messages carry text, file, or structured data parts.
|
|
57
|
+
|
|
58
|
+
Tasks are stateful units of work with IDs and lifecycle states. Clients can follow long-running work and send follow-up turns. They can also cancel work or resubscribe after a disconnect.
|
|
57
59
|
|
|
58
60
|
## Get started
|
|
59
61
|
|
|
@@ -83,7 +85,7 @@ export const supportAgent = new Agent({
|
|
|
83
85
|
id: 'support-agent',
|
|
84
86
|
name: 'Support Agent',
|
|
85
87
|
instructions: 'Answer user questions and delegate weather questions when needed.',
|
|
86
|
-
model: 'openai/gpt-5.
|
|
88
|
+
model: 'openai/gpt-5.6-sol',
|
|
87
89
|
agents: {
|
|
88
90
|
remoteWeatherAgent,
|
|
89
91
|
},
|