@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
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Modal
|
|
4
|
+
|
|
5
|
+
Access 1 Modal model through Mastra's model router. Authentication is handled automatically using the `MODAL_PROXY_TOKEN` environment variable.
|
|
6
|
+
|
|
7
|
+
Learn more in the [Modal documentation](https://modal.com/docs/guide/endpoints).
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
MODAL_PROXY_TOKEN=your-api-token
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Agent } from "@mastra/core/agent";
|
|
15
|
+
|
|
16
|
+
const agent = new Agent({
|
|
17
|
+
id: "my-agent",
|
|
18
|
+
name: "My Agent",
|
|
19
|
+
instructions: "You are a helpful assistant",
|
|
20
|
+
model: "modal/thinkingmachines/Inkling-NVFP4"
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Generate a response
|
|
24
|
+
const response = await agent.generate("Hello!");
|
|
25
|
+
|
|
26
|
+
// Stream a response
|
|
27
|
+
const stream = await agent.stream("Tell me a story");
|
|
28
|
+
for await (const chunk of stream) {
|
|
29
|
+
console.log(chunk);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Modal documentation](https://modal.com/docs/guide/endpoints) for details.
|
|
34
|
+
|
|
35
|
+
## Models
|
|
36
|
+
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| -------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `modal/thinkingmachines/Inkling-NVFP4` | 1.0M | | | | | | $1 | $5 |
|
|
40
|
+
|
|
41
|
+
## Advanced configuration
|
|
42
|
+
|
|
43
|
+
### Custom headers
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
const agent = new Agent({
|
|
47
|
+
id: "custom-agent",
|
|
48
|
+
name: "custom-agent",
|
|
49
|
+
model: {
|
|
50
|
+
url: "https://inference.us-west.modal.direct/v1",
|
|
51
|
+
id: "modal/thinkingmachines/Inkling-NVFP4",
|
|
52
|
+
apiKey: process.env.MODAL_PROXY_TOKEN,
|
|
53
|
+
headers: {
|
|
54
|
+
"X-Custom-Header": "value"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Dynamic model selection
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
const agent = new Agent({
|
|
64
|
+
id: "dynamic-agent",
|
|
65
|
+
name: "Dynamic Agent",
|
|
66
|
+
model: ({ requestContext }) => {
|
|
67
|
+
const useAdvanced = requestContext.task === "complex";
|
|
68
|
+
return useAdvanced
|
|
69
|
+
? "modal/thinkingmachines/Inkling-NVFP4"
|
|
70
|
+
: "modal/thinkingmachines/Inkling-NVFP4";
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Weights & Biases
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 31 Weights & Biases models through Mastra's model router. Authentication is handled automatically using the `WANDB_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Weights & Biases documentation](https://docs.wandb.ai).
|
|
8
8
|
|
|
@@ -50,6 +50,7 @@ for await (const chunk of stream) {
|
|
|
50
50
|
| `wandb/moonshotai/Kimi-K2.5` | 262K | | | | | | $0.60 | $3 |
|
|
51
51
|
| `wandb/moonshotai/Kimi-K2.6` | 262K | | | | | | $0.65 | $3 |
|
|
52
52
|
| `wandb/moonshotai/Kimi-K2.7-Code` | 262K | | | | | | $0.71 | $4 |
|
|
53
|
+
| `wandb/moonshotai/Kimi-K3` | 1.0M | | | | | | $3 | $15 |
|
|
53
54
|
| `wandb/nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-FP8` | 262K | | | | | | $0.20 | $0.80 |
|
|
54
55
|
| `wandb/nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B` | 262K | | | | | | $0.75 | $3 |
|
|
55
56
|
| `wandb/openai/gpt-oss-120b` | 131K | | | | | | $0.03 | $0.17 |
|
|
@@ -89,6 +89,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
89
89
|
- [MiniMax Token Plan (minimaxi.com)](https://mastra.ai/models/providers/minimax-cn-coding-plan)
|
|
90
90
|
- [Mixlayer](https://mastra.ai/models/providers/mixlayer)
|
|
91
91
|
- [Moark](https://mastra.ai/models/providers/moark)
|
|
92
|
+
- [Modal](https://mastra.ai/models/providers/modal)
|
|
92
93
|
- [Model Oracle AI](https://mastra.ai/models/providers/model-oracle-ai)
|
|
93
94
|
- [ModelScope](https://mastra.ai/models/providers/modelscope)
|
|
94
95
|
- [Moonshot AI](https://mastra.ai/models/providers/moonshotai)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# AcpAgent class
|
|
4
4
|
|
|
5
|
-
The `AcpAgent` class wraps an Agent Client Protocol (ACP)-compatible coding agent as a Mastra subagent. Use it when a parent Mastra agent should delegate repository inspection
|
|
5
|
+
The `AcpAgent` class wraps an Agent Client Protocol (ACP)-compatible coding agent as a Mastra subagent. Use it when a parent Mastra agent should delegate repository inspection and code edits. It can also delegate other ACP-backed tasks to the subagent.
|
|
6
6
|
|
|
7
7
|
If you want the parent agent to call the ACP agent as a tool instead, use [`createACPTool()`](https://mastra.ai/reference/acp/create-acp-tool).
|
|
8
8
|
|
|
@@ -27,7 +27,7 @@ export const codeSupervisor = new Agent({
|
|
|
27
27
|
id: 'code-supervisor',
|
|
28
28
|
name: 'Code Supervisor',
|
|
29
29
|
instructions: 'Delegate code editing tasks to the code-agent subagent.',
|
|
30
|
-
model: 'openai/gpt-5.
|
|
30
|
+
model: 'openai/gpt-5.6-sol',
|
|
31
31
|
agents: {
|
|
32
32
|
codeAgent,
|
|
33
33
|
},
|
|
@@ -143,7 +143,7 @@ await codeAgent.setModel('claude-sonnet-4-6')
|
|
|
143
143
|
|
|
144
144
|
## Session lifecycle
|
|
145
145
|
|
|
146
|
-
`AcpAgent` starts the configured `command` on first use
|
|
146
|
+
`AcpAgent` starts the configured `command` on first use and initializes the ACP client. It then creates an ACP session. By default, `persistSession` is `true`, so the process and session stay alive across `generate()`, `stream()`, `getAvailableModels()`, and `setModel()` calls.
|
|
147
147
|
|
|
148
148
|
Set `persistSession: false` when each prompt should run in a fresh ACP process:
|
|
149
149
|
|
|
@@ -220,7 +220,7 @@ export const codeAgent = new AcpAgent({
|
|
|
220
220
|
})
|
|
221
221
|
```
|
|
222
222
|
|
|
223
|
-
Use this callback to enforce local policy
|
|
223
|
+
Use this callback to enforce local policy or inspect the permission title. It can also route the decision to your own approval flow.
|
|
224
224
|
|
|
225
225
|
## Related
|
|
226
226
|
|
|
@@ -26,7 +26,7 @@ export const codeSupervisor = new Agent({
|
|
|
26
26
|
id: 'code-supervisor',
|
|
27
27
|
name: 'Code Supervisor',
|
|
28
28
|
instructions: 'Use the code-agent tool when a task requires repository inspection or code edits.',
|
|
29
|
-
model: 'openai/gpt-5.
|
|
29
|
+
model: 'openai/gpt-5.6-sol',
|
|
30
30
|
tools: {
|
|
31
31
|
codeAgentTool,
|
|
32
32
|
},
|
|
@@ -87,7 +87,7 @@ export const codeSupervisor = new Agent({
|
|
|
87
87
|
|
|
88
88
|
## Session lifecycle
|
|
89
89
|
|
|
90
|
-
Each tool execution creates an ACP connection
|
|
90
|
+
Each tool execution creates an ACP connection and starts the configured `command`. It initializes the ACP client and creates an ACP session before sending the `task` with ACP `session/prompt`.
|
|
91
91
|
|
|
92
92
|
By default, `persistSession` is `true` for the ACP connection created during tool execution. Set `persistSession: false` when the ACP process should stop as soon as that prompt completes.
|
|
93
93
|
|
|
@@ -124,7 +124,7 @@ export const codeAgentTool = createACPTool({
|
|
|
124
124
|
})
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
-
Use this callback to enforce local policy
|
|
127
|
+
Use this callback to enforce local policy or inspect the permission title. It can also route the decision to your own approval flow.
|
|
128
128
|
|
|
129
129
|
## Extension methods
|
|
130
130
|
|
|
@@ -4,9 +4,9 @@
|
|
|
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` class
|
|
7
|
+
The `AgentController` class coordinates agent modes with shared state, memory, and storage. It provides a control layer that a TUI or other UI can drive. The layer manages threads and model or mode switches. It sends messages and handles tool approvals while tracking events.
|
|
8
8
|
|
|
9
|
-
Per-conversation state
|
|
9
|
+
Per-conversation state (identity, the active thread, mode and model selection, run state, grants, and the display snapshot) lives on the [`Session`](https://mastra.ai/reference/agent-controller/session), accessed through `agentController.session`.
|
|
10
10
|
|
|
11
11
|
For a conceptual introduction, see the [AgentController overview](https://mastra.ai/docs/agent-controller/overview).
|
|
12
12
|
|
|
@@ -84,7 +84,7 @@ await agentController.sendMessage({ content: 'Hello!' })
|
|
|
84
84
|
|
|
85
85
|
**modes.additionalTools** (`ToolsInput`): Tools layered on top of the backing agent's tools. Mutually exclusive with tools.
|
|
86
86
|
|
|
87
|
-
**modes.availableTools** (`string[]`): Per-mode tool visibility allowlist. When set, only tools whose final exposed names appear in this list are visible to the model and executable during this mode's runs. undefined = all tools visible; \[] = no tools. Per-tool and per-category deny rules take precedence over this list. Workspace tools use the same list
|
|
87
|
+
**modes.availableTools** (`string[]`): Per-mode tool visibility allowlist. When set, only tools whose final exposed names appear in this list are visible to the model and executable during this mode's runs. undefined = all tools visible; \[] = no tools. Per-tool and per-category deny rules take precedence over this list. Workspace tools use the same list: reference them by exposed names (view, write\_file, etc.).
|
|
88
88
|
|
|
89
89
|
**modes.agent** (`Agent`): The agent for this mode. Deprecated in favor of the top-level agent config with mode-level overrides.
|
|
90
90
|
|
|
@@ -164,7 +164,7 @@ await agentController.sendMessage({ content: 'Hello!' })
|
|
|
164
164
|
|
|
165
165
|
#### `init()`
|
|
166
166
|
|
|
167
|
-
Initialize the agentController. Loads storage, initializes a static workspace (
|
|
167
|
+
Initialize the agentController. Loads storage, initializes a static workspace (runtime-defined factory workspaces are resolved per-session during `createSession`), propagates memory and workspace to mode agents, and starts interval handlers. Call this before using the agentController.
|
|
168
168
|
|
|
169
169
|
```typescript
|
|
170
170
|
await agentController.init()
|
|
@@ -174,11 +174,11 @@ await agentController.init()
|
|
|
174
174
|
|
|
175
175
|
Create a new, fully-wired `Session` and bring it online. The session starts in the default mode with the seeded model, connects to the AgentController's shared machinery (agent, storage/lock, config catalog), and has a current thread (the most recent thread for the resource, or a freshly created one). Call `init()` once before creating sessions so shared storage is ready.
|
|
176
176
|
|
|
177
|
-
The AgentController owns no session of its own
|
|
177
|
+
The AgentController owns no session of its own: every consumer creates its own session and drives all work through it. A `resourceId` maps to exactly one session per AgentController (get-or-create): calling `createSession` with the same `resourceId` returns the existing session, so reconnects resume rather than fork the conversation. Different `resourceId`s produce independent sessions with isolated event bus, mode, model, state, and current thread. Use `session.thread.create()` and `session.thread.switch()` to manage multiple conversations within one session.
|
|
178
178
|
|
|
179
|
-
`id` and `ownerId` are required
|
|
179
|
+
`id` and `ownerId` are required: they mirror `SessionRecord.id` and `SessionRecord.ownerId` and are stable for the life of the session. `resourceId` is optional and defaults to `config.resourceId` then `config.id`.
|
|
180
180
|
|
|
181
|
-
Each session owns its own `Workspace` and `Browser` instance. When `workspace` is omitted, the AgentController resolves its configured workspace (a static instance or a
|
|
181
|
+
Each session owns its own `Workspace` and `Browser` instance. When `workspace` is omitted, the AgentController resolves its configured workspace (a static instance or a runtime-defined factory) and passes it to the session. Pass a `workspace` override to give a specific session a different workspace than the AgentController default. The workspace is initialized during session creation; `workspace_ready` and `workspace_status_changed` events are emitted on the session bus after `init()` completes, and late subscribers receive a replay of the last workspace status.
|
|
182
182
|
|
|
183
183
|
```typescript
|
|
184
184
|
const session = await agentController.createSession({
|
|
@@ -270,7 +270,7 @@ const mastra = agentController.getMastra()
|
|
|
270
270
|
|
|
271
271
|
#### `getWorkspace()`
|
|
272
272
|
|
|
273
|
-
Return the AgentController-level workspace if it's a static `Workspace` instance. Dynamic factory workspaces aren't resolved here
|
|
273
|
+
Return the AgentController-level workspace if it's a static `Workspace` instance. Dynamic factory workspaces aren't resolved here: use [`resolveWorkspace()`](#resolveworkspace-session-requestcontext-) to resolve a factory against a session's request context.
|
|
274
274
|
|
|
275
275
|
```typescript
|
|
276
276
|
const workspace = agentController.getWorkspace()
|
|
@@ -278,7 +278,7 @@ const workspace = agentController.getWorkspace()
|
|
|
278
278
|
|
|
279
279
|
#### `resolveWorkspace({ session, requestContext? })`
|
|
280
280
|
|
|
281
|
-
Eagerly resolve and cache the workspace. For
|
|
281
|
+
Eagerly resolve and cache the workspace. For runtime-defined workspaces (factory function), this triggers the factory against the session's request context and caches the result so `getWorkspace()` returns it. Returns the resolved workspace or `undefined` if none is configured.
|
|
282
282
|
|
|
283
283
|
```typescript
|
|
284
284
|
const workspace = await agentController.resolveWorkspace({ session })
|
|
@@ -292,7 +292,7 @@ const workspace = await agentController.resolveWorkspace({ session, requestConte
|
|
|
292
292
|
|
|
293
293
|
#### `hasWorkspace()`
|
|
294
294
|
|
|
295
|
-
Whether a workspace is configured on this AgentController (static instance or
|
|
295
|
+
Whether a workspace is configured on this AgentController (static instance or runtime-defined factory). Sessions without an explicit workspace override fall back to this.
|
|
296
296
|
|
|
297
297
|
```typescript
|
|
298
298
|
if (agentController.hasWorkspace()) {
|
|
@@ -346,11 +346,11 @@ const models = await agentController.listAvailableModels()
|
|
|
346
346
|
|
|
347
347
|
### Threads
|
|
348
348
|
|
|
349
|
-
The agentController owns thread lifecycle transitions
|
|
349
|
+
The agentController owns thread lifecycle transitions (creating, switching, cloning, renaming, and deleting threads) because they coordinate the shared thread lock and emit events. The active thread binding and thread/message reads live on [`session.thread`](https://mastra.ai/reference/agent-controller/session).
|
|
350
350
|
|
|
351
351
|
#### `createThread({ title? })`
|
|
352
352
|
|
|
353
|
-
|
|
353
|
+
Creates a new thread and initializes its metadata. The method saves it to storage and acquires a thread lock before emitting a `thread_created` event.
|
|
354
354
|
|
|
355
355
|
```typescript
|
|
356
356
|
const thread = await agentController.createThread({ title: 'New conversation' })
|
|
@@ -358,13 +358,13 @@ const thread = await agentController.createThread({ title: 'New conversation' })
|
|
|
358
358
|
|
|
359
359
|
#### `switchThread({ threadId })`
|
|
360
360
|
|
|
361
|
-
Switch to a different thread.
|
|
361
|
+
Switch to a different thread. This aborts in-progress operations and acquires a lock on the new thread. It releases the previous thread lock and loads the new thread metadata. It then emits a `thread_changed` event.
|
|
362
362
|
|
|
363
363
|
```typescript
|
|
364
364
|
await agentController.switchThread({ threadId: 'thread-abc123' })
|
|
365
365
|
```
|
|
366
366
|
|
|
367
|
-
To list threads from storage, use [`session.thread.list()`](https://mastra.ai/reference/agent-controller/session). By default it returns only threads for the current resource and hides transient [forked subagent](#forked-subagents) threads
|
|
367
|
+
To list threads from storage, use [`session.thread.list()`](https://mastra.ai/reference/agent-controller/session). By default it returns only threads for the current resource and hides transient [forked subagent](#forked-subagents) threads. Pass `includeForkedSubagents: true` to opt back into seeing them: e.g. for a debug panel.
|
|
368
368
|
|
|
369
369
|
#### `renameThread({ title })`
|
|
370
370
|
|
|
@@ -376,7 +376,7 @@ await agentController.renameThread({ title: 'Updated title' })
|
|
|
376
376
|
|
|
377
377
|
#### `cloneThread({ sourceThreadId?, title?, resourceId? })`
|
|
378
378
|
|
|
379
|
-
Clone an existing thread and switch to the clone. Copies all messages
|
|
379
|
+
Clone an existing thread and switch to the clone. Copies all messages and acquires a lock on the new thread. It then releases the lock on the previous thread and emits a `thread_created` event. If `sourceThreadId` is omitted, the current thread is cloned. When [Observational Memory](https://mastra.ai/docs/memory/observational-memory) is enabled, OM records are cloned with remapped message IDs.
|
|
380
380
|
|
|
381
381
|
```typescript
|
|
382
382
|
// Clone the current thread
|
|
@@ -432,7 +432,7 @@ Reading messages is owned by [`session.thread`](https://mastra.ai/reference/agen
|
|
|
432
432
|
|
|
433
433
|
### Memory
|
|
434
434
|
|
|
435
|
-
The `memory` property bundles thread management operations into a single namespace. `memory.createThread`, `memory.switchThread`, and `memory.renameThread` delegate to the corresponding AgentController lifecycle methods documented above
|
|
435
|
+
The `memory` property bundles thread management operations into a single namespace. `memory.createThread`, `memory.switchThread`, and `memory.renameThread` delegate to the corresponding AgentController lifecycle methods documented above. `memory.listThreads` delegates to [`session.thread.list()`](https://mastra.ai/reference/agent-controller/session).
|
|
436
436
|
|
|
437
437
|
#### `memory.deleteThread({ threadId })`
|
|
438
438
|
|
|
@@ -470,7 +470,7 @@ agentController.followUp({ content: 'Now apply those changes' })
|
|
|
470
470
|
|
|
471
471
|
### Tool approvals
|
|
472
472
|
|
|
473
|
-
Responding to a pending tool approval is owned by the session
|
|
473
|
+
Responding to a pending tool approval is owned by the session: see [`session.respondToToolApproval()`](https://mastra.ai/reference/agent-controller/session). The agentController owns the permission _policy_ that decides when approval is required, documented under [Permissions](#permissions) below.
|
|
474
474
|
|
|
475
475
|
### Tool suspensions and plans
|
|
476
476
|
|
|
@@ -478,7 +478,7 @@ Responding to a pending tool approval is owned by the session — see [`session.
|
|
|
478
478
|
|
|
479
479
|
Respond to a pending tool suspension. Interactive built-in tools such as `ask_user` and `request_access` pause through the native tool-suspension primitive, which emits a `tool_suspended` event carrying `toolCallId`, `toolName`, and `suspendPayload`. Pass `resumeData` to resume the suspended tool with the user's response.
|
|
480
480
|
|
|
481
|
-
Provide `toolCallId` to select which suspension to resume. It's required when more than one tool is suspended
|
|
481
|
+
Provide `toolCallId` to select which suspension to resume. It's required when more than one tool is suspended concurrently (for example, parallel `ask_user` calls). When omitted, it resolves to the sole pending suspension.
|
|
482
482
|
|
|
483
483
|
```typescript
|
|
484
484
|
agentController.subscribe(event => {
|
|
@@ -558,14 +558,14 @@ The observer/reflector model selection and observation/reflection thresholds liv
|
|
|
558
558
|
|
|
559
559
|
### Forked subagents
|
|
560
560
|
|
|
561
|
-
By default, a subagent runs with a fresh context
|
|
561
|
+
By default, a subagent runs with a fresh context: it doesn't see the parent conversation. **Forked subagents** opt into a different model: the subagent runs on a clone of the parent thread and reuses the parent agent's full configuration. This is useful when the subagent needs the full context of the conversation so far (e.g., recalling earlier user-supplied facts), and when prompt-cache hit rates matter.
|
|
562
562
|
|
|
563
563
|
#### Enabling forked mode
|
|
564
564
|
|
|
565
565
|
Set `forked: true` either on the `AgentControllerSubagent` definition (per-type default) or on each `subagent` tool call (per-invocation override):
|
|
566
566
|
|
|
567
567
|
```typescript
|
|
568
|
-
// Per-type default
|
|
568
|
+
// Per-type default: every call to this subagent forks unless overridden.
|
|
569
569
|
const subagents: AgentControllerSubagent[] = [
|
|
570
570
|
{
|
|
571
571
|
id: 'collaborator',
|
|
@@ -577,20 +577,20 @@ const subagents: AgentControllerSubagent[] = [
|
|
|
577
577
|
]
|
|
578
578
|
```
|
|
579
579
|
|
|
580
|
-
The model can also pass `forked: true` (or `forked: false`) per-invocation in the `subagent` tool input
|
|
580
|
+
The model can also pass `forked: true` (or `forked: false`) per-invocation in the `subagent` tool input. The per-invocation value wins.
|
|
581
581
|
|
|
582
582
|
#### Semantics and constraints
|
|
583
583
|
|
|
584
584
|
- **Memory required.** Forked mode calls `memory.cloneThread` to create the fork, so the agentController must have `memory` configured and an active parent thread. Calls without those return a structured error rather than throwing.
|
|
585
|
-
- **Parent agent reused.** The fork runs through the parent agent's `stream(...)` call. The parent's instructions, tools, model, `maxSteps`, and `stopWhen` apply. The subagent definition's `instructions`, `tools`, `allowedAgentControllerTools`, `allowedWorkspaceTools`, `defaultModelId`, `maxSteps`, and `stopWhen` are ignored in forked mode
|
|
586
|
-
- **Toolsets inherited, recursive forks blocked at runtime.** Forks inherit the parent's toolsets verbatim (`ask_user`, `submit_plan`, user-configured agentController tools, _including the `subagent` tool itself_) so the LLM request prefix
|
|
585
|
+
- **Parent agent reused.** The fork runs through the parent agent's `stream(...)` call. The parent's instructions, tools, model, `maxSteps`, and `stopWhen` apply. The subagent definition's `instructions`, `tools`, `allowedAgentControllerTools`, `allowedWorkspaceTools`, `defaultModelId`, `maxSteps`, and `stopWhen` are ignored in forked mode. This preserves the prompt-cache prefix.
|
|
586
|
+
- **Toolsets inherited, recursive forks blocked at runtime.** Forks inherit the parent's toolsets verbatim (`ask_user`, `submit_plan`, user-configured agentController tools, _including the `subagent` tool itself_) so the LLM request prefix, system prompt + tool list + tool schemas + tool descriptions, stays byte-identical to the parent's. This is what preserves the prompt cache. The `subagent` entry is kept on the model side but its `execute` is replaced inside the fork with a stub that returns a non-error "tool unavailable inside a forked subagent" message: nested forks are blocked at the runtime layer without perturbing the cached prefix.
|
|
587
587
|
- **Fork threads are tagged.** Each fork thread is created with `metadata.forkedSubagent === true` and `metadata.parentThreadId === <parent>`. By default, [`session.thread.list()`](https://mastra.ai/reference/agent-controller/session) hides these so they don't show up in user-facing thread pickers / startup flows. Pass `includeForkedSubagents: true` to see them in admin / debug tooling.
|
|
588
|
-
- **Save-queue flushed before clone.** The agent stream batches message saves through a debounced `SaveQueueManager`, so the parent's latest user / assistant turn may not be on disk yet when the subagent tool call fires. The fork tool flushes pending saves first via the `flushMessages` callback on `AgentToolExecutionContext` before cloning, so the fork actually carries the latest turn. Flush failures are non-fatal
|
|
588
|
+
- **Save-queue flushed before clone.** The agent stream batches message saves through a debounced `SaveQueueManager`, so the parent's latest user / assistant turn may not be on disk yet when the subagent tool call fires. The fork tool flushes pending saves first via the `flushMessages` callback on `AgentToolExecutionContext` before cloning, so the fork actually carries the latest turn. Flush failures are non-fatal: the clone still runs.
|
|
589
589
|
- **Parent thread untouched.** All subagent activity (messages, OM writes) lands on the fork. The parent thread is never appended to during a forked subagent run.
|
|
590
590
|
|
|
591
591
|
#### When to prefer non-forked mode
|
|
592
592
|
|
|
593
|
-
Forked mode trades isolation for context inheritance.
|
|
593
|
+
Forked mode trades isolation for context inheritance. Use the default (non-forked) mode when the subagent needs a restricted toolset or a different system prompt. The same applies when using a cheaper model. Pass any required context explicitly in the `task` description.
|
|
594
594
|
|
|
595
595
|
### Events
|
|
596
596
|
|
|
@@ -598,7 +598,7 @@ Forked mode trades isolation for context inheritance. If the subagent should run
|
|
|
598
598
|
|
|
599
599
|
Register an event listener. Returns an unsubscribe function.
|
|
600
600
|
|
|
601
|
-
Use this method for all consumers
|
|
601
|
+
Use this method for all consumers: UI, Server-Sent Events (SSE), terminal UI (TUI), bridge rendering, audit logs, debugging, analytics, and deterministic replay. For display rendering, watch for the `display_state_changed` event and read the latest snapshot from [`session.displayState.get()`](https://mastra.ai/reference/agent-controller/session). After every event the agentController emits `display_state_changed`, so high-frequency events such as `message_update`, `tool_update`, and `tool_input_delta` are coalesced into the next snapshot.
|
|
602
602
|
|
|
603
603
|
```typescript
|
|
604
604
|
// Render from the coalesced display-state snapshot:
|
|
@@ -694,21 +694,21 @@ The agentController emits events through registered listeners. The following tab
|
|
|
694
694
|
| `shell_output` | A tool emitted shell output (stdout or stderr). |
|
|
695
695
|
| `display_state_changed` | The canonical `AgentControllerDisplayState` snapshot changed. Read it from [`session.displayState.get()`](https://mastra.ai/reference/agent-controller/session). |
|
|
696
696
|
|
|
697
|
-
The agentController also emits low-level streaming content chunks
|
|
697
|
+
The agentController also emits low-level streaming content chunks: `text`, `thinking`, `tool_call`, `tool_result`, `image`, and `file`. These are the raw pieces that get assembled into messages. Most UIs render from `message_update` (or read the [`session.displayState`](https://mastra.ai/reference/agent-controller/session) snapshot) rather than subscribing to them directly.
|
|
698
698
|
|
|
699
699
|
## Built-in tools
|
|
700
700
|
|
|
701
701
|
The agentController provides built-in tools to agents in every mode:
|
|
702
702
|
|
|
703
|
-
| Tool | Description
|
|
704
|
-
| --------------- |
|
|
705
|
-
| `ask_user` | Ask the user a question and wait for their response. Supports free text, single-select choices, and multi-select choices.
|
|
706
|
-
| `submit_plan` | Submit a plan for user review and approval.
|
|
707
|
-
| `task_write` | Create or replace a structured task list for tracking progress. Assigns task IDs when omitted and returns the structured task list snapshot.
|
|
708
|
-
| `task_update` | Update one tracked task by ID and return the structured task list snapshot.
|
|
709
|
-
| `task_complete` | Mark one tracked task completed by ID and return the structured task list snapshot.
|
|
710
|
-
| `task_check` | Check the completion status of the current task list and return `tasks`, `summary`, `incompleteTasks`, and `isError` fields.
|
|
711
|
-
| `subagent` | Spawn a focused subagent with constrained tools (only available when `subagents` is configured). Pass `forked: true` to inherit the parent conversation
|
|
703
|
+
| Tool | Description |
|
|
704
|
+
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
705
|
+
| `ask_user` | Ask the user a question and wait for their response. Supports free text, single-select choices, and multi-select choices. |
|
|
706
|
+
| `submit_plan` | Submit a plan for user review and approval. |
|
|
707
|
+
| `task_write` | Create or replace a structured task list for tracking progress. Assigns task IDs when omitted and returns the structured task list snapshot. |
|
|
708
|
+
| `task_update` | Update one tracked task by ID and return the structured task list snapshot. |
|
|
709
|
+
| `task_complete` | Mark one tracked task completed by ID and return the structured task list snapshot. |
|
|
710
|
+
| `task_check` | Check the completion status of the current task list and return `tasks`, `summary`, `incompleteTasks`, and `isError` fields. |
|
|
711
|
+
| `subagent` | Spawn a focused subagent with constrained tools (only available when `subagents` is configured). Pass `forked: true` to inherit the parent conversation. See [Forked subagents](#forked-subagents). |
|
|
712
712
|
|
|
713
713
|
### `ask_user` selections
|
|
714
714
|
|
|
@@ -4,7 +4,7 @@
|
|
|
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
|
-
A `Session` owns all the state tied to a single conversation. The [`AgentController`](https://mastra.ai/reference/agent-controller/agent-controller-class) is the shared host
|
|
7
|
+
A `Session` owns all the state tied to a single conversation. The [`AgentController`](https://mastra.ai/reference/agent-controller/agent-controller-class) is the shared host (agents, storage, config, the thread lock, and the event bus) while the `Session` holds everything that's per-conversation: identity, the active thread binding and reads, mode and model selection, run and abort state, the live agent stream, tool suspensions, follow-ups, approvals, permission grants, token usage, and the display-state snapshot.
|
|
8
8
|
|
|
9
9
|
Access the session through `agentController.session`.
|
|
10
10
|
|
|
@@ -72,7 +72,7 @@ Returns: `Workspace`
|
|
|
72
72
|
|
|
73
73
|
### Permissions
|
|
74
74
|
|
|
75
|
-
Session-scoped grants auto-approve tools without prompting. Grants are ephemeral
|
|
75
|
+
Session-scoped grants auto-approve tools without prompting. Grants are ephemeral: they reset when the session restarts and are never persisted.
|
|
76
76
|
|
|
77
77
|
#### `grantCategory(category)`
|
|
78
78
|
|
|
@@ -123,7 +123,7 @@ const runId = agentController.session.getCurrentRunId()
|
|
|
123
123
|
|
|
124
124
|
#### `abortRun()`
|
|
125
125
|
|
|
126
|
-
Abort the in-flight run: aborts the live stream
|
|
126
|
+
Abort the in-flight run: aborts the live stream and requests abort on the run. It also clears parked tool suspensions.
|
|
127
127
|
|
|
128
128
|
```typescript
|
|
129
129
|
agentController.session.abortRun()
|
|
@@ -278,7 +278,7 @@ const mode = agentController.session.mode.resolve()
|
|
|
278
278
|
|
|
279
279
|
### `session.mode.switch({ modeId })`
|
|
280
280
|
|
|
281
|
-
Switch to a different mode. Aborts any in-progress generation
|
|
281
|
+
Switch to a different mode. Aborts any in-progress generation and saves the current model to the outgoing mode. It then loads the incoming mode's model and emits `mode_changed` and `model_changed` events.
|
|
282
282
|
|
|
283
283
|
```typescript
|
|
284
284
|
await agentController.session.mode.switch({ modeId: 'build' })
|
|
@@ -374,7 +374,7 @@ const observerModel = agentController.session.om.observer.resolvedModel()
|
|
|
374
374
|
|
|
375
375
|
## Permissions
|
|
376
376
|
|
|
377
|
-
`session.permissions` owns the persisted tool-approval _policy_
|
|
377
|
+
`session.permissions` owns the persisted tool-approval _policy_: the per-category and per-tool rules consulted during approval resolution. These are distinct from the in-memory session _grants_ documented under [Methods → Permissions](#permissions); grants reset each session, whereas these rules are persisted in session state.
|
|
378
378
|
|
|
379
379
|
### `session.permissions.getRules()`
|
|
380
380
|
|
|
@@ -559,7 +559,7 @@ After every event the agentController emits `display_state_changed`, so high-fre
|
|
|
559
559
|
|
|
560
560
|
## State
|
|
561
561
|
|
|
562
|
-
`session.state` owns the schema-validated AgentController state for the conversation. It holds the current snapshot
|
|
562
|
+
`session.state` owns the schema-validated AgentController state for the conversation. It holds the current snapshot and validates updates against the `stateSchema` passed to the AgentController. Updates are serialized, and every change emits a `state_changed` event.
|
|
563
563
|
|
|
564
564
|
### `session.state.get()`
|
|
565
565
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Agent class
|
|
4
4
|
|
|
5
|
-
The `Agent` class is the foundation for creating AI agents in Mastra. It provides methods for generating responses
|
|
5
|
+
The `Agent` class is the foundation for creating AI agents in Mastra. It provides methods for generating responses and streaming interactions. It also handles voice capabilities.
|
|
6
6
|
|
|
7
7
|
## Usage examples
|
|
8
8
|
|
|
@@ -18,7 +18,7 @@ export const agent = new Agent({
|
|
|
18
18
|
id: 'test-agent',
|
|
19
19
|
name: 'Test Agent',
|
|
20
20
|
instructions: 'You are a helpful assistant that provides concise answers.',
|
|
21
|
-
model: 'openai/gpt-5.
|
|
21
|
+
model: 'openai/gpt-5.6-sol',
|
|
22
22
|
})
|
|
23
23
|
|
|
24
24
|
// System message object
|
|
@@ -29,7 +29,7 @@ export const agent2 = new Agent({
|
|
|
29
29
|
role: 'system',
|
|
30
30
|
content: 'You are an expert programmer',
|
|
31
31
|
},
|
|
32
|
-
model: 'openai/gpt-5.
|
|
32
|
+
model: 'openai/gpt-5.6-sol',
|
|
33
33
|
})
|
|
34
34
|
|
|
35
35
|
// Array of system messages
|
|
@@ -40,7 +40,7 @@ export const agent3 = new Agent({
|
|
|
40
40
|
{ role: 'system', content: 'You are a helpful assistant' },
|
|
41
41
|
{ role: 'system', content: 'You have expertise in TypeScript' },
|
|
42
42
|
],
|
|
43
|
-
model: 'openai/gpt-5.
|
|
43
|
+
model: 'openai/gpt-5.6-sol',
|
|
44
44
|
})
|
|
45
45
|
```
|
|
46
46
|
|
|
@@ -63,7 +63,7 @@ export const agent = new Agent({
|
|
|
63
63
|
},
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
|
-
model: 'openai/gpt-5.
|
|
66
|
+
model: 'openai/gpt-5.6-sol',
|
|
67
67
|
})
|
|
68
68
|
```
|
|
69
69
|
|
|
@@ -102,7 +102,7 @@ For the simplest setup, pass `model` as a string in `provider/model` format. Sep
|
|
|
102
102
|
|
|
103
103
|
Popular provider strings and credentials:
|
|
104
104
|
|
|
105
|
-
- **OpenAI**: `openai/gpt-5.
|
|
105
|
+
- **OpenAI**: `openai/gpt-5.6-sol` uses `OPENAI_API_KEY`.
|
|
106
106
|
- **Anthropic**: `anthropic/claude-sonnet-4-6` uses `ANTHROPIC_API_KEY`.
|
|
107
107
|
- **Google**: `google/gemini-2.5-pro` uses `GOOGLE_API_KEY` or `GOOGLE_GENERATIVE_AI_API_KEY`.
|
|
108
108
|
|
|
@@ -229,7 +229,7 @@ agent.sendMessage('Continue with the next step.', {
|
|
|
229
229
|
})
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
-
Returns `{ accepted: Promise<SendAgentSignalAccepted>, signal: CreatedAgentSignal, persisted?: Promise<void> }`. `accepted` resolves at decision-time, once Mastra decides what to do with the message: `{ action: 'wake', runId, output }` when this process runs the agent (it started or won the lease to start the run), `{ action: 'deliver', runId }` when the message is forwarded onto an existing run (including when this process loses a cross-process wake race), or `{ action: 'persist' }` / `{ action: 'discard' }` when nothing ran. `runId` is the authoritative id of the run that handled the message and is present only on `wake` and `deliver
|
|
232
|
+
Returns `{ accepted: Promise<SendAgentSignalAccepted>, signal: CreatedAgentSignal, persisted?: Promise<void> }`. `accepted` resolves at decision-time, once Mastra decides what to do with the message: `{ action: 'wake', runId, output }` when this process runs the agent (it started or won the lease to start the run), `{ action: 'deliver', runId }` when the message is forwarded onto an existing run (including when this process loses a cross-process wake race), or `{ action: 'persist' }` / `{ action: 'discard' }` when nothing ran. `runId` is the authoritative id of the run that handled the message and is present only on `wake` and `deliver`. For `persist`/`discard` use `result.signal.id` to correlate the stored message. `accepted` resolves for routing (a generation error on a `wake` run surfaces through `output.consumeStream()`) and rejects only when the message couldn't be routed or started at all (e.g. a misconfigured agent). `persisted` is only present for `persist` behavior and resolves when Mastra finishes writing the message to memory. On the `wake` action, `output` is the agent stream for in-process consumption.
|
|
233
233
|
|
|
234
234
|
### `queueMessage(message, options)`
|
|
235
235
|
|
|
@@ -272,7 +272,7 @@ Sends a signal to an active run or memory thread.
|
|
|
272
272
|
|
|
273
273
|
**options.ifIdle.attributes** (`Record<string, string | number | boolean>`): Attributes merged into the signal when Mastra accepts it while the target thread is idle.
|
|
274
274
|
|
|
275
|
-
Returns `{ accepted: Promise<SendAgentSignalAccepted>, signal: CreatedAgentSignal, persisted?: Promise<void> }`. `accepted` resolves at decision-time, once Mastra decides what to do with the signal: `{ action: 'wake', runId, output }` when this process runs the agent (it started or won the lease to start the run), `{ action: 'deliver', runId }` when the signal is forwarded onto an existing run (including when this process loses a cross-process wake race), or `{ action: 'persist' }` / `{ action: 'discard' }` when nothing ran. `action` mirrors the winning `behavior` from `ifActive`/`ifIdle`. `runId` is the authoritative id of the run that handled the signal and is present only on `wake` and `deliver
|
|
275
|
+
Returns `{ accepted: Promise<SendAgentSignalAccepted>, signal: CreatedAgentSignal, persisted?: Promise<void> }`. `accepted` resolves at decision-time, once Mastra decides what to do with the signal: `{ action: 'wake', runId, output }` when this process runs the agent (it started or won the lease to start the run), `{ action: 'deliver', runId }` when the signal is forwarded onto an existing run (including when this process loses a cross-process wake race), or `{ action: 'persist' }` / `{ action: 'discard' }` when nothing ran. `action` mirrors the winning `behavior` from `ifActive`/`ifIdle`. `runId` is the authoritative id of the run that handled the signal and is present only on `wake` and `deliver`. For `persist`/`discard` use `result.signal.id` to correlate the stored signal. `accepted` resolves for routing (a generation error on a `wake` run surfaces through `output.consumeStream()`) and rejects only when the signal couldn't be routed or started at all (e.g. a misconfigured agent). `persisted` is only present for `persist` behavior and resolves when Mastra finishes writing the signal to memory. On the `wake` action, `output` is the agent stream for in-process consumption.
|
|
276
276
|
|
|
277
277
|
In serverless handlers, await `accepted` and pass the `wake` output to your platform's `waitUntil` equivalent so the winning process can drain the stream after the HTTP response returns.
|
|
278
278
|
|
|
@@ -333,11 +333,11 @@ const result = await agent.sendStateSignal(
|
|
|
333
333
|
|
|
334
334
|
**options** (`object`): Targeting and delivery behavior for the state signal. Accepts the same options as sendSignal().
|
|
335
335
|
|
|
336
|
-
Returns `{ accepted: Promise<SendAgentSignalAccepted>, signal: CreatedAgentSignal, persisted?: Promise<void>, skipped?: false }` when Mastra accepts new state. Returns `{ skipped: true, reason: 'unchanged' }` when the same `cacheKey` and mode are already current for the state lane. `accepted` resolves at decision-time, once Mastra decides what to do with the signal: `{ action: 'wake', runId, output }` when this process runs the agent (it started or won the lease to start the run), `{ action: 'deliver', runId }` when the signal is forwarded onto an existing run (including when this process loses a cross-process wake race), or `{ action: 'persist' }` / `{ action: 'discard' }` when nothing ran. `runId` is the authoritative id of the run that handled the signal and is present only on `wake` and `deliver
|
|
336
|
+
Returns `{ accepted: Promise<SendAgentSignalAccepted>, signal: CreatedAgentSignal, persisted?: Promise<void>, skipped?: false }` when Mastra accepts new state. Returns `{ skipped: true, reason: 'unchanged' }` when the same `cacheKey` and mode are already current for the state lane. `accepted` resolves at decision-time, once Mastra decides what to do with the signal: `{ action: 'wake', runId, output }` when this process runs the agent (it started or won the lease to start the run), `{ action: 'deliver', runId }` when the signal is forwarded onto an existing run (including when this process loses a cross-process wake race), or `{ action: 'persist' }` / `{ action: 'discard' }` when nothing ran. `runId` is the authoritative id of the run that handled the signal and is present only on `wake` and `deliver`. For `persist`/`discard` use `result.signal.id` to correlate the stored signal. On the `wake` action, `output` is the agent stream for in-process consumption.
|
|
337
337
|
|
|
338
338
|
### `sendNotificationSignal(notification, options)`
|
|
339
339
|
|
|
340
|
-
Creates or coalesces a notification inbox record
|
|
340
|
+
Creates or coalesces a notification inbox record and resolves the notification delivery policy. It sends a notification signal when the decision is immediate.
|
|
341
341
|
|
|
342
342
|
```typescript
|
|
343
343
|
const result = await agent.sendNotificationSignal(
|
|
@@ -387,7 +387,7 @@ const result = await agent.sendNotificationSignal(
|
|
|
387
387
|
|
|
388
388
|
Returns `{ record: NotificationRecord, decision: NotificationDeliveryDecision, runId?: string, signal?: CreatedAgentSignal, persisted?: Promise<void>, accepted?: Promise<SendAgentSignalAccepted> }`. `record` is the stored inbox record. `decision` is the delivery-policy result. `signal` and `runId` are present when ingress emits a signal immediately, including the immediate summary emitted for active high-priority notifications. `persisted` is present when the emitted signal is persisted without waking an idle thread. `accepted` is present when a signal is emitted and resolves at decision-time, once Mastra decides what to do with it: `{ action: 'wake', runId, output }` when this process runs the agent (it started or won the lease to start the run), `{ action: 'deliver', runId }` when the signal is forwarded onto an existing run, or `{ action: 'persist' }` / `{ action: 'discard' }` when nothing ran. `runId` on the accepted result is present only on `wake` and `deliver`. On the `wake` action, `output` is the agent stream for in-process consumption.
|
|
389
389
|
|
|
390
|
-
Default delivery is priority-aware. `urgent` notifications deliver immediately. `high` notifications deliver immediately when the thread is idle
|
|
390
|
+
Default delivery is priority-aware. `urgent` notifications deliver immediately. `high` notifications deliver immediately when the thread is idle. When the thread is active, Mastra emits a summary immediately and keeps `deliverAt` for later full delivery when the thread is idle. `medium` notifications deliver immediately when idle and batch into summaries when active. `low` notifications batch into summaries in both active and idle threads. Idle low-priority summaries reach subscribers without waking the model loop. For the full flow, visit [Signals](https://mastra.ai/docs/long-running-agents/signals).
|
|
391
391
|
|
|
392
392
|
Configure `notifications.deliveryPolicy` on the agent when some notifications should wait for a different dispatch window or summary rollup:
|
|
393
393
|
|
|
@@ -396,7 +396,7 @@ export const supportAgent = new Agent({
|
|
|
396
396
|
id: 'support-agent',
|
|
397
397
|
name: 'Support Agent',
|
|
398
398
|
instructions: 'Help the user triage updates.',
|
|
399
|
-
model: 'openai/gpt-5.
|
|
399
|
+
model: 'openai/gpt-5.6-sol',
|
|
400
400
|
notifications: {
|
|
401
401
|
deliveryPolicy: {
|
|
402
402
|
priorities: {
|
|
@@ -417,7 +417,7 @@ export const supportAgent = new Agent({
|
|
|
417
417
|
|
|
418
418
|
### `subscribeToThread(options)`
|
|
419
419
|
|
|
420
|
-
Subscribes to raw stream chunks for a memory thread. Use this before calling `sendMessage()`, `queueMessage()`, or `sendSignal()
|
|
420
|
+
Subscribes to raw stream chunks for a memory thread. Use this before calling `sendMessage()`, `queueMessage()`, or `sendSignal()`. It lets you render stream output and observe signal echoes, including when a signal aborts the active run.
|
|
421
421
|
|
|
422
422
|
**options** (`object`): Thread subscription target.
|
|
423
423
|
|
|
@@ -530,7 +530,7 @@ export const agent = new Agent({
|
|
|
530
530
|
id: 'support-agent',
|
|
531
531
|
name: 'support-agent',
|
|
532
532
|
instructions: 'Help users with their questions.',
|
|
533
|
-
model: 'openai/gpt-5.
|
|
533
|
+
model: 'openai/gpt-5.6-sol',
|
|
534
534
|
hooks: {
|
|
535
535
|
beforeToolCall: ({ toolName, input }) => {
|
|
536
536
|
console.log(`Running ${toolName}`, input)
|