@mastra/mcp-docs-server 1.2.17-alpha.9 → 1.2.17
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/course/02-agent-tools-mcp/32-conclusion.md +1 -1
- package/.docs/docs/agents/code-mode.md +3 -3
- package/.docs/docs/agents/guardrails.md +1 -1
- package/.docs/docs/agents/{agent-approval.md → human-in-the-loop.md} +5 -5
- package/.docs/docs/agents/networks.md +3 -3
- package/.docs/docs/agents/overview.md +7 -7
- package/.docs/docs/agents/processors.md +3 -3
- package/.docs/docs/agents/{using-tools.md → tools.md} +7 -7
- package/.docs/docs/{server/auth → auth}/custom-auth-provider.md +1 -1
- package/.docs/docs/{server/auth → auth}/fga.md +27 -1
- package/.docs/docs/{server/auth.md → auth/overview.md} +4 -4
- package/.docs/docs/{server/auth → auth}/simple-auth.md +1 -1
- package/.docs/docs/{server/auth → auth}/workers.md +2 -2
- package/.docs/docs/{capabilities/channels.md → channels.md} +2 -2
- package/.docs/docs/{agents → connections}/a2a.md +2 -2
- package/.docs/docs/{agents → connections}/acp.md +18 -6
- package/.docs/docs/{mcp/overview.md → connections/mcp.md} +1 -1
- package/.docs/docs/connections/overview.md +5 -5
- package/.docs/docs/{agents → connections}/sdk-agents.md +3 -1
- package/.docs/docs/deployment/cloud-providers.md +1 -0
- package/.docs/docs/deployment/mastra-server.md +2 -2
- package/.docs/docs/deployment/overview.md +2 -1
- package/.docs/docs/deployment/sandbox.md +3 -3
- package/.docs/docs/deployment/workers.md +4 -4
- package/.docs/docs/guides/multi-agent-systems.md +7 -7
- package/.docs/docs/guides/streaming.md +1 -1
- package/.docs/docs/harness/agent-controller.md +5 -3
- package/.docs/docs/{long-running-agents → harness}/background-tasks.md +5 -5
- package/.docs/docs/{long-running-agents → harness}/durable-agents.md +18 -2
- package/.docs/docs/{long-running-agents → harness}/goals.md +6 -6
- package/.docs/docs/harness/overview.md +11 -10
- package/.docs/docs/{long-running-agents → harness}/schedules.md +5 -5
- package/.docs/docs/{long-running-agents → harness}/signal-providers.md +4 -4
- package/.docs/docs/mastra-platform/deploy.md +1 -1
- package/.docs/docs/mastra-platform/overview.md +1 -1
- package/.docs/docs/mastra-platform/server.md +1 -1
- package/.docs/docs/memory/message-history.md +1 -1
- package/.docs/docs/memory/overview.md +4 -4
- package/.docs/docs/memory/working-memory.md +1 -1
- package/.docs/docs/observability/integrations/exporters/mastra-storage.md +1 -1
- package/.docs/docs/{workspace → sandbox}/filesystem.md +2 -2
- package/.docs/docs/{workspace → sandbox}/lsp.md +3 -3
- package/.docs/docs/{workspace/sandbox.md → sandbox/overview.md} +4 -3
- package/.docs/docs/{workspace → sandbox}/search.md +2 -2
- package/.docs/docs/{workspace → sandbox}/skills.md +5 -5
- package/.docs/docs/server/custom-api-routes.md +2 -2
- package/.docs/docs/server/mastra-client.md +2 -2
- package/.docs/docs/server/{mastra-server.md → overview.md} +3 -3
- package/.docs/docs/server/pubsub.md +2 -2
- package/.docs/docs/server/server-adapters.md +4 -4
- package/.docs/docs/{agents/skills.md → skills.md} +4 -4
- package/.docs/docs/{storage/overview.md → storage.md} +2 -1
- package/.docs/docs/studio/auth.md +4 -4
- package/.docs/docs/studio/overview.md +2 -2
- package/.docs/docs/{capabilities/subagents.md → subagents.md} +35 -5
- package/.docs/docs/workflows/agents-and-tools.md +1 -1
- package/.docs/docs/workflows/control-flow.md +0 -4
- package/.docs/docs/workflows/human-in-the-loop.md +0 -4
- package/.docs/docs/workflows/overview.md +1 -1
- package/.docs/docs/workflows/scheduled-workflows.md +2 -2
- package/.docs/docs/workflows/snapshots.md +1 -1
- package/.docs/docs/workflows/suspend-and-resume.md +0 -4
- package/.docs/integrations/agentic-ui/ai-sdk-ui.md +1 -1
- package/.docs/integrations/agentic-ui/copilotkit.md +1 -1
- package/.docs/integrations/auth/google.md +2 -2
- package/.docs/integrations/auth/workos.md +1 -1
- package/.docs/integrations/browsers/agent-browser.md +2 -2
- package/.docs/integrations/browsers/browser-viewer.md +6 -6
- package/.docs/integrations/browsers/firecrawl.md +1 -1
- package/.docs/integrations/browsers/stagehand.md +2 -2
- package/.docs/integrations/channels/discord.md +2 -2
- package/.docs/integrations/channels/github.md +1 -1
- package/.docs/integrations/channels/imessage.md +4 -4
- package/.docs/integrations/channels/slack.md +5 -5
- package/.docs/integrations/channels/teams.md +2 -2
- package/.docs/integrations/channels/telegram.md +2 -2
- package/.docs/integrations/channels/whatsapp.md +2 -2
- package/.docs/integrations/databases/postgresql.md +1 -0
- package/.docs/integrations/deploy/amazon-ec2.md +2 -2
- package/.docs/integrations/deploy/aws-lambda.md +3 -3
- package/.docs/integrations/deploy/azure-app-services.md +2 -2
- package/.docs/integrations/deploy/cloudflare.md +2 -2
- package/.docs/integrations/deploy/digital-ocean.md +3 -3
- package/.docs/integrations/deploy/kubernetes.md +11 -11
- package/.docs/integrations/deploy/netlify.md +3 -3
- package/.docs/integrations/deploy/render.md +389 -0
- package/.docs/integrations/deploy/vercel.md +2 -2
- package/.docs/integrations/file-storage/amazon-s3.md +1 -1
- package/.docs/integrations/file-storage/azure-blob.md +1 -1
- package/.docs/integrations/file-storage/google-cloud-storage.md +1 -1
- package/.docs/integrations/file-storage/mesa.md +2 -2
- package/.docs/integrations/file-storage/vercel-files.md +1 -1
- package/.docs/integrations/frameworks/astro.md +6 -2
- package/.docs/integrations/frameworks/electron.md +1 -1
- package/.docs/integrations/frameworks/express.md +1 -1
- package/.docs/integrations/frameworks/hono.md +1 -1
- package/.docs/integrations/frameworks/nestjs.md +1 -1
- package/.docs/integrations/frameworks/next-js.md +6 -2
- package/.docs/integrations/frameworks/nuxt.md +1 -1
- package/.docs/integrations/frameworks/sveltekit.md +1 -1
- package/.docs/integrations/frameworks/vite-react.md +6 -2
- package/.docs/integrations/sandboxes/agentcore.md +1 -1
- package/.docs/integrations/sandboxes/apple-container.md +1 -1
- package/.docs/integrations/sandboxes/cloudflare-sandbox.md +118 -0
- package/.docs/integrations/sandboxes/daytona.md +1 -1
- package/.docs/integrations/sandboxes/docker.md +4 -3
- package/.docs/integrations/sandboxes/e2b.md +1 -1
- package/.docs/integrations/sandboxes/modal.md +1 -1
- package/.docs/integrations/sandboxes/railway.md +11 -0
- package/.docs/integrations.md +4 -0
- package/.docs/models/environment-variables.md +8 -2
- package/.docs/models/gateways/merge-gateway.md +212 -0
- package/.docs/models/gateways/openrouter.md +3 -1
- package/.docs/models/gateways/vercel.md +22 -1
- package/.docs/models/gateways.md +1 -0
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/alibaba-token-plan-cn.md +2 -1
- package/.docs/models/providers/alibaba-token-plan.md +2 -1
- package/.docs/models/providers/ambient.md +2 -2
- package/.docs/models/providers/amd.md +73 -0
- package/.docs/models/providers/arcee.md +79 -0
- package/.docs/models/providers/baseten.md +1 -1
- package/.docs/models/providers/cerebras.md +2 -3
- package/.docs/models/providers/chutes.md +2 -1
- package/.docs/models/providers/cloudflare-workers-ai.md +3 -2
- package/.docs/models/providers/cortecs.md +2 -1
- package/.docs/models/providers/crof.md +1 -1
- package/.docs/models/providers/crossmodel.md +3 -2
- package/.docs/models/providers/deepinfra.md +5 -1
- package/.docs/models/providers/digitalocean.md +3 -2
- package/.docs/models/providers/edenai.md +19 -5
- package/.docs/models/providers/empiriolabs.md +10 -1
- package/.docs/models/providers/hetzner.md +6 -8
- package/.docs/models/providers/huggingface.md +4 -1
- package/.docs/models/providers/hyper.md +9 -8
- package/.docs/models/providers/inferx.md +19 -13
- package/.docs/models/providers/jalapeno.md +89 -0
- package/.docs/models/providers/kilo.md +13 -12
- package/.docs/models/providers/kosmik.md +73 -0
- package/.docs/models/providers/llmgateway.md +3 -3
- package/.docs/models/providers/llmtr.md +35 -10
- package/.docs/models/providers/nano-gpt.md +15 -17
- package/.docs/models/providers/ofox.md +3 -3
- package/.docs/models/providers/opencode-go.md +2 -2
- package/.docs/models/providers/requesty.md +3 -3
- package/.docs/models/providers/runinfra.md +76 -0
- package/.docs/models/providers/sakana.md +3 -2
- package/.docs/models/providers/scnet-token-plan.md +85 -0
- package/.docs/models/providers/scx-ai.md +76 -0
- package/.docs/models/providers/togetherai.md +2 -1
- package/.docs/models/providers/umans-ai-coding-plan.md +2 -1
- package/.docs/models/providers/umans-ai.md +2 -1
- package/.docs/models/providers/vivgrid.md +2 -1
- package/.docs/models/providers/wandb.md +2 -1
- package/.docs/models/providers/xai.md +2 -1
- package/.docs/models/providers.md +7 -2
- package/.docs/reference/acp/acp-agent.md +2 -2
- package/.docs/reference/acp/create-acp-tool.md +1 -1
- package/.docs/reference/agent-controller/agent-controller-class.md +2 -2
- package/.docs/reference/agents/agent.md +2 -2
- package/.docs/reference/agents/channels.md +2 -2
- package/.docs/reference/agents/createSkill.md +2 -2
- package/.docs/reference/agents/durable-agent.md +1 -1
- package/.docs/reference/agents/generate.md +3 -1
- package/.docs/reference/agents/getSkill.md +1 -1
- package/.docs/reference/agents/listSkills.md +1 -1
- package/.docs/reference/agents/listSuspendedRuns.md +6 -6
- package/.docs/reference/agents/listTools.md +2 -2
- package/.docs/reference/agents/network.md +3 -1
- package/.docs/reference/ai-sdk/chat-route.md +1 -1
- package/.docs/reference/ai-sdk/handle-chat-stream.md +1 -1
- package/.docs/reference/ai-sdk/handle-network-stream.md +2 -2
- package/.docs/reference/ai-sdk/handle-workflow-stream.md +1 -1
- package/.docs/reference/ai-sdk/network-route.md +2 -2
- package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +1 -1
- package/.docs/reference/ai-sdk/workflow-route.md +1 -1
- package/.docs/reference/auth/fga.md +7 -5
- package/.docs/reference/auth/jwt.md +1 -1
- package/.docs/reference/browser/agent-browser.md +2 -2
- package/.docs/reference/browser/browser-viewer.md +2 -2
- package/.docs/reference/browser/firecrawl-browser.md +1 -1
- package/.docs/reference/browser/mastra-browser.md +1 -1
- package/.docs/reference/browser/stagehand-browser.md +2 -2
- package/.docs/reference/build-with-ai.md +2 -2
- package/.docs/reference/channels/channel-provider.md +1 -1
- package/.docs/reference/channels/slack-provider.md +1 -1
- package/.docs/reference/cli/mastra.md +2 -0
- package/.docs/reference/client-js/agents.md +24 -4
- package/.docs/reference/coding-agent/create-coding-agent.md +142 -13
- package/.docs/reference/configuration.md +6 -6
- package/.docs/reference/core/getEditor.md +1 -1
- package/.docs/reference/core/getMCPServer.md +1 -1
- package/.docs/reference/core/getMCPServerById.md +1 -1
- package/.docs/reference/core/getTool.md +1 -1
- package/.docs/reference/core/getToolById.md +1 -1
- package/.docs/reference/core/listMCPServers.md +1 -1
- package/.docs/reference/core/listTools.md +1 -1
- package/.docs/reference/core/removeWorkspace.md +1 -1
- package/.docs/reference/editor/mastra-editor.md +2 -2
- package/.docs/reference/editor/prompt-blocks.md +2 -2
- package/.docs/reference/editor/tool-provider.md +108 -1
- package/.docs/reference/editor/tools.md +1 -1
- package/.docs/reference/editor/versioning.md +3 -3
- package/.docs/reference/evals/prompt-alignment.md +18 -0
- package/.docs/reference/evals/rubric.md +1 -1
- package/.docs/reference/file-based-agents/memory.md +2 -2
- package/.docs/reference/file-based-agents/server.md +3 -3
- package/.docs/reference/file-based-agents/skills.md +1 -1
- package/.docs/reference/file-based-agents/storage.md +3 -3
- package/.docs/reference/file-based-agents/subagents.md +1 -1
- package/.docs/reference/file-based-agents/workspace.md +3 -3
- package/.docs/reference/index.md +1 -0
- package/.docs/reference/manual-install.md +3 -3
- package/.docs/reference/memory/memory-class.md +1 -0
- package/.docs/reference/memory/settled.md +57 -0
- package/.docs/reference/migrations/network-to-supervisor.md +2 -2
- package/.docs/reference/processors/provider-history-compat.md +6 -5
- package/.docs/reference/processors/skill-search-processor.md +3 -1
- package/.docs/reference/processors/token-limiter-processor.md +4 -0
- package/.docs/reference/processors/tool-call-filter.md +7 -7
- package/.docs/reference/processors/tool-search-processor.md +1 -1
- package/.docs/reference/project-structure.md +1 -1
- package/.docs/reference/pubsub/lease-provider.md +3 -3
- package/.docs/reference/pubsub/redis-streams.md +1 -1
- package/.docs/reference/rag/graph-rag.md +71 -8
- package/.docs/reference/rag/retrieval.md +26 -18
- package/.docs/reference/schedules/overview.md +1 -1
- package/.docs/reference/streaming/ChunkType.md +2 -2
- package/.docs/reference/streaming/agents/stream.md +29 -4
- package/.docs/reference/streaming/agents/streamUntilIdle.md +1 -1
- package/.docs/reference/tools/ask-user-tool.md +1 -1
- package/.docs/reference/tools/create-code-mode.md +1 -1
- package/.docs/reference/tools/create-tool.md +4 -4
- package/.docs/reference/tools/mcp-client.md +2 -0
- package/.docs/reference/tools/mcp-server.md +97 -4
- package/.docs/reference/tools/submit-plan-tool.md +1 -1
- package/.docs/reference/tools/task-tools.md +2 -2
- package/.docs/reference/vectors/vectorize.md +12 -2
- package/.docs/reference/workers/overview.md +2 -2
- package/.docs/reference/workspace/local-filesystem.md +1 -1
- package/.docs/reference/workspace/local-sandbox.md +4 -3
- package/.docs/reference/workspace/platform-sandbox.md +11 -0
- package/.docs/reference/workspace/process-manager.md +20 -4
- package/.docs/reference/workspace/sandbox.md +1 -1
- package/.docs/reference/workspace/workspace-class.md +5 -5
- package/CHANGELOG.md +73 -0
- package/package.json +6 -6
- package/.docs/models/providers/merge-gateway.md +0 -265
- /package/.docs/docs/{server/auth → auth}/composite-auth.md +0 -0
- /package/.docs/docs/{server/auth → auth}/jwt.md +0 -0
- /package/.docs/docs/{browser/overview.md → browser.md} +0 -0
- /package/.docs/docs/{getting-started/develop.md → develop.md} +0 -0
- /package/.docs/docs/{long-running-agents → harness}/signals.md +0 -0
- /package/.docs/docs/{editor/overview.md → studio/editor.md} +0 -0
|
@@ -497,5 +497,5 @@ await controller.stopIntervals()
|
|
|
497
497
|
- [AgentController guide](https://mastra.ai/docs/harness/agent-controller)
|
|
498
498
|
- [Session reference](https://mastra.ai/reference/agent-controller/session)
|
|
499
499
|
- [Agents](https://mastra.ai/docs/agents/overview)
|
|
500
|
-
- [Sandbox](https://mastra.ai/docs/
|
|
501
|
-
- [Channels](https://mastra.ai/docs/
|
|
500
|
+
- [Sandbox](https://mastra.ai/docs/sandbox/overview)
|
|
501
|
+
- [Channels](https://mastra.ai/docs/channels)
|
|
@@ -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. 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/
|
|
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/harness/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
|
|
|
@@ -564,7 +564,7 @@ When you register the [`MastraEditor`](https://mastra.ai/reference/editor/mastra
|
|
|
564
564
|
|
|
565
565
|
**editor** (`false | { instructions?: boolean; tools?: boolean | { description?: boolean } }`): Omit to allow editing instructions and tools. Set to false to lock the agent. Set instructions: true to allow instruction edits. Set tools: true to allow tool membership and description edits, or tools: { description: true } to allow only description edits.
|
|
566
566
|
|
|
567
|
-
The agent's `id`, `name`, and `model` always come from code and can't be overridden through Editor. See [Editor](https://mastra.ai/docs/editor
|
|
567
|
+
The agent's `id`, `name`, and `model` always come from code and can't be overridden through Editor. See [Editor](https://mastra.ai/docs/studio/editor) for usage.
|
|
568
568
|
|
|
569
569
|
## Returns
|
|
570
570
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**Added in:** `@mastra/core@1.22.0`
|
|
6
6
|
|
|
7
|
-
Channels connect agents to messaging platforms. Configure them via the `channels` property on the `Agent` constructor. The object you pass is a `ChannelConfig`. See the [Channels overview](https://mastra.ai/docs/
|
|
7
|
+
Channels connect agents to messaging platforms. Configure them via the `channels` property on the `Agent` constructor. The object you pass is a `ChannelConfig`. See the [Channels overview](https://mastra.ai/docs/channels) for concepts and platform setup instructions.
|
|
8
8
|
|
|
9
9
|
## Usage example
|
|
10
10
|
|
|
@@ -382,6 +382,6 @@ type InlineLinkEntry =
|
|
|
382
382
|
|
|
383
383
|
## Related
|
|
384
384
|
|
|
385
|
-
- [Channels overview](https://mastra.ai/docs/
|
|
385
|
+
- [Channels overview](https://mastra.ai/docs/channels): Concepts, quickstart, and platform setup
|
|
386
386
|
- [Agent class](https://mastra.ai/reference/agents/agent): Constructor parameters and methods
|
|
387
387
|
- [Chat SDK adapters](https://chat-sdk.dev/adapters): Adapter configuration and platform setup
|
|
@@ -74,7 +74,7 @@ createSkill({ name: '', description: 'test', instructions: 'test' })
|
|
|
74
74
|
|
|
75
75
|
## Related
|
|
76
76
|
|
|
77
|
-
- [Agent skills](https://mastra.ai/docs/
|
|
78
|
-
- [Workspace skills](https://mastra.ai/docs/
|
|
77
|
+
- [Agent skills](https://mastra.ai/docs/skills)
|
|
78
|
+
- [Workspace skills](https://mastra.ai/docs/sandbox/skills)
|
|
79
79
|
- [`.getSkill()` reference](https://mastra.ai/reference/agents/getSkill)
|
|
80
80
|
- [`.listSkills()` reference](https://mastra.ai/reference/agents/listSkills)
|
|
@@ -338,7 +338,7 @@ Returns: [`Promise<DurableAgentStreamResult>`](#durableagentstreamresult)
|
|
|
338
338
|
|
|
339
339
|
**onSuspended** (`(data: AgentSuspendedEventData) => void | Promise<void>`): Called when the run suspends, for example for tool approval.
|
|
340
340
|
|
|
341
|
-
**onAbort** (`AgentExecutionOptions['onAbort']`): Called when the run is aborted via abortSignal or result.abort().
|
|
341
|
+
**onAbort** (`AgentExecutionOptions['onAbort']`): Called when the run is aborted via abortSignal or result.abort(). Receives the steps completed before the abort and, in text, the assistant text streamed so far.
|
|
342
342
|
|
|
343
343
|
**onIterationComplete** (`AgentExecutionOptions['onIterationComplete']`): Called after every agentic-loop iteration with the latest messageList, finishReason, and isFinal flag. Observation-only on durable agents: returning continue: false or feedback does not influence the loop.
|
|
344
344
|
|
|
@@ -78,7 +78,7 @@ const result = await agent.generate('message for agent')
|
|
|
78
78
|
|
|
79
79
|
**options.onError** (`({ error }: { error: Error | string }) => Promise<void> | void`): Callback function called when an error occurs during generation.
|
|
80
80
|
|
|
81
|
-
**options.onAbort** (`(event: any) => Promise<void> | void`): Callback function called when the generation is aborted.
|
|
81
|
+
**options.onAbort** (`(event: { steps: any[]; text?: string }) => Promise<void> | void`): Callback function called when the generation is aborted. steps contains the steps that completed before the abort, and text contains the assistant text generated so far for the step that was in flight.
|
|
82
82
|
|
|
83
83
|
**options.activeTools** (`Array<keyof ToolSet> | undefined`): Array of tool names that should be active during execution. If undefined, all available tools are active.
|
|
84
84
|
|
|
@@ -164,6 +164,8 @@ const result = await agent.generate('message for agent')
|
|
|
164
164
|
|
|
165
165
|
**options.modelSettings.frequencyPenalty** (`number`): Penalty for token frequency (-2 to 2). Reduces repetition of frequent tokens.
|
|
166
166
|
|
|
167
|
+
**options.modelSettings.timeout** (`object`): Time-based execution budget for the run. Accepts totalMs, the maximum duration of the entire agent run across every loop iteration, tool call and retry, and stepMs, the maximum duration of a single model call including the time spent consuming its stream. Exceeding either budget fails with a MastraTimeoutError. A totalMs timeout ends the run and does not try fallback models, because it is a hard deadline for the whole run. A stepMs timeout is not retried against the same model but does advance to the next entry in models when fallback models are configured.
|
|
168
|
+
|
|
167
169
|
**options.modelSettings.stopSequences** (`string[]`): Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated.
|
|
168
170
|
|
|
169
171
|
**options.toolChoice** (`'auto' | 'none' | 'required' | { type: 'tool'; toolName: string }`): Controls how tools are selected during generation.
|
|
@@ -55,6 +55,6 @@ When both agent-level skills and workspace skills are configured, `.getSkill()`
|
|
|
55
55
|
|
|
56
56
|
## Related
|
|
57
57
|
|
|
58
|
-
- [Agent skills](https://mastra.ai/docs/
|
|
58
|
+
- [Agent skills](https://mastra.ai/docs/skills)
|
|
59
59
|
- [`.listSkills()` reference](https://mastra.ai/reference/agents/listSkills)
|
|
60
60
|
- [`createSkill()` reference](https://mastra.ai/reference/agents/createSkill)
|
|
@@ -50,6 +50,6 @@ When both agent-level skills and workspace skills are configured, `.listSkills()
|
|
|
50
50
|
|
|
51
51
|
## Related
|
|
52
52
|
|
|
53
|
-
- [Agent skills](https://mastra.ai/docs/
|
|
53
|
+
- [Agent skills](https://mastra.ai/docs/skills)
|
|
54
54
|
- [`.getSkill()` reference](https://mastra.ai/reference/agents/getSkill)
|
|
55
55
|
- [`createSkill()` reference](https://mastra.ai/reference/agents/createSkill)
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
**Added in:** `@mastra/core@1.43.0`
|
|
6
6
|
|
|
7
|
-
The `.listSuspendedRuns()` method lists suspended agent runs from workflow snapshot storage: runs waiting on a tool call requiring [approval](https://mastra.ai/docs/agents/
|
|
7
|
+
The `.listSuspendedRuns()` method lists suspended agent runs from workflow snapshot storage: runs waiting on a tool call requiring [approval](https://mastra.ai/docs/agents/human-in-the-loop), or on a tool that called `suspend()`. Because discovery is backed by storage rather than in-memory state, it works after a server restart and across multiple server instances.
|
|
8
8
|
|
|
9
|
-
Pass the returned `runId` to [`resumeStream()`](https://mastra.ai/docs/agents/
|
|
9
|
+
Pass the returned `runId` to [`resumeStream()`](https://mastra.ai/docs/agents/human-in-the-loop), `approveToolCall()`, or `declineToolCall()` to continue the run.
|
|
10
10
|
|
|
11
11
|
The filter contract mirrors the workflow run listing APIs (`listWorkflowRuns`), plus the agent-level `threadId` filter.
|
|
12
12
|
|
|
@@ -83,11 +83,11 @@ interface AgentRunToolCall {
|
|
|
83
83
|
|
|
84
84
|
## Discovery scope
|
|
85
85
|
|
|
86
|
-
Results are scoped to runs started by the agent you call `listSuspendedRuns()` on: snapshots persist the owning agent's id, so runs started by other agents on the same Mastra instance aren't returned. In [supervisor setups](https://mastra.ai/docs/agents/
|
|
86
|
+
Results are scoped to runs started by the agent you call `listSuspendedRuns()` on: snapshots persist the owning agent's id, so runs started by other agents on the same Mastra instance aren't returned. In [supervisor setups](https://mastra.ai/docs/agents/human-in-the-loop) the supervisor sees its outer run (the one to resume), while a subagent's inner run is only visible from the subagent itself. Filter by `threadId` and `resourceId` to scope results to one conversation.
|
|
87
87
|
|
|
88
|
-
Run snapshots are only persisted while a run is waiting on input and are deleted when it finishes, so suspended runs are the only runs discoverable from storage. Suspended runs only survive restarts when the Mastra instance has a persistent [storage provider](https://mastra.ai/docs/storage
|
|
88
|
+
Run snapshots are only persisted while a run is waiting on input and are deleted when it finishes, so suspended runs are the only runs discoverable from storage. Suspended runs only survive restarts when the Mastra instance has a persistent [storage provider](https://mastra.ai/docs/storage) configured. With the default in-memory store, snapshots are lost on restart.
|
|
89
89
|
|
|
90
90
|
## Related
|
|
91
91
|
|
|
92
|
-
- [Agent approval](https://mastra.ai/docs/agents/
|
|
93
|
-
- [Storage](https://mastra.ai/docs/storage
|
|
92
|
+
- [Agent approval](https://mastra.ai/docs/agents/human-in-the-loop)
|
|
93
|
+
- [Storage](https://mastra.ai/docs/storage)
|
|
@@ -30,5 +30,5 @@ await agent.listTools({
|
|
|
30
30
|
|
|
31
31
|
## Related
|
|
32
32
|
|
|
33
|
-
- [Using tools with agents](https://mastra.ai/docs/agents/
|
|
34
|
-
- [Creating tools](https://mastra.ai/docs/mcp
|
|
33
|
+
- [Using tools with agents](https://mastra.ai/docs/agents/tools)
|
|
34
|
+
- [Creating tools](https://mastra.ai/docs/connections/mcp)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
The `.network()` method enables multi-agent collaboration and routing. This method accepts messages and optional execution options.
|
|
6
6
|
|
|
7
|
-
> **Deprecated:** The `.network()` primitive has been deprecated and will be removed in a future major release. Use [supervisor agents](https://mastra.ai/docs/
|
|
7
|
+
> **Deprecated:** The `.network()` primitive has been deprecated and will be removed in a future major release. Use [supervisor agents](https://mastra.ai/docs/subagents) with `agent.stream()` or `agent.generate()` instead. See the [migration guide](https://mastra.ai/reference/migrations/network-to-supervisor) to upgrade.
|
|
8
8
|
|
|
9
9
|
## Usage example
|
|
10
10
|
|
|
@@ -100,6 +100,8 @@ await agent.network(`
|
|
|
100
100
|
|
|
101
101
|
**options.modelSettings.frequencyPenalty** (`number`): Penalty for token frequency (-2 to 2). Reduces repetition of frequent tokens.
|
|
102
102
|
|
|
103
|
+
**options.modelSettings.timeout** (`object`): Time-based execution budget for the run. Accepts totalMs, the maximum duration of the entire agent run across every loop iteration, tool call and retry, and stepMs, the maximum duration of a single model call including the time spent consuming its stream. Exceeding either budget fails with a MastraTimeoutError. A totalMs timeout ends the run and does not try fallback models, because it is a hard deadline for the whole run. A stepMs timeout is not retried against the same model but does advance to the next entry in models when fallback models are configured.
|
|
104
|
+
|
|
103
105
|
**options.modelSettings.stopSequences** (`string[]`): Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated.
|
|
104
106
|
|
|
105
107
|
**options.structuredOutput** (`StructuredOutputOptions`): Configuration for generating a typed structured output from the network result.
|
|
@@ -51,7 +51,7 @@ export const mastra = new Mastra({
|
|
|
51
51
|
|
|
52
52
|
## Parameters
|
|
53
53
|
|
|
54
|
-
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
|
|
54
|
+
**version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. Pass 'v7' when your app is typed against AI SDK v7. (Default: `'v5'`)
|
|
55
55
|
|
|
56
56
|
**path** (`string`): The route path (e.g., /chat or /chat/:agentId). Include :agentId for dynamic agent routing. (Default: `'/chat/:agentId'`)
|
|
57
57
|
|
|
@@ -50,7 +50,7 @@ export async function POST(req: Request) {
|
|
|
50
50
|
|
|
51
51
|
## Parameters
|
|
52
52
|
|
|
53
|
-
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
|
|
53
|
+
**version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. Pass 'v7' when your app is typed against AI SDK v7. (Default: `'v5'`)
|
|
54
54
|
|
|
55
55
|
**mastra** (`Mastra`): The Mastra instance containing registered agents.
|
|
56
56
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# handleNetworkStream()
|
|
4
4
|
|
|
5
|
-
> **Deprecated:** Agent networks are deprecated and will be removed in a future release. Use [supervisor agents](https://mastra.ai/docs/
|
|
5
|
+
> **Deprecated:** Agent networks are deprecated and will be removed in a future release. Use [supervisor agents](https://mastra.ai/docs/subagents) with `agent.stream()` or `agent.generate()` instead. See the [migration guide](https://mastra.ai/reference/migrations/network-to-supervisor) to upgrade.
|
|
6
6
|
|
|
7
7
|
Framework-agnostic handler for streaming network execution in AI SDK-compatible format. Use this function directly when you need to handle network streaming outside Hono or Mastra's own [apiRoutes](https://mastra.ai/docs/server/custom-api-routes) feature.
|
|
8
8
|
|
|
@@ -34,7 +34,7 @@ export async function POST(req: Request) {
|
|
|
34
34
|
|
|
35
35
|
## Parameters
|
|
36
36
|
|
|
37
|
-
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
|
|
37
|
+
**version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. Pass 'v7' when your app is typed against AI SDK v7. (Default: `'v5'`)
|
|
38
38
|
|
|
39
39
|
**mastra** (`Mastra`): The Mastra instance to use for agent lookup and execution.
|
|
40
40
|
|
|
@@ -36,7 +36,7 @@ export async function POST(req: Request) {
|
|
|
36
36
|
|
|
37
37
|
## Parameters
|
|
38
38
|
|
|
39
|
-
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
|
|
39
|
+
**version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. Pass 'v7' when your app is typed against AI SDK v7. (Default: `'v5'`)
|
|
40
40
|
|
|
41
41
|
**mastra** (`Mastra`): The Mastra instance containing registered workflows.
|
|
42
42
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# networkRoute()
|
|
4
4
|
|
|
5
|
-
> **Deprecated:** Agent networks are deprecated and will be removed in a future release. Use [supervisor agents](https://mastra.ai/docs/
|
|
5
|
+
> **Deprecated:** Agent networks are deprecated and will be removed in a future release. Use [supervisor agents](https://mastra.ai/docs/subagents) with `agent.stream()` or `agent.generate()` instead. See the [migration guide](https://mastra.ai/reference/migrations/network-to-supervisor) to upgrade.
|
|
6
6
|
|
|
7
7
|
Creates a network route handler for streaming network execution using the AI SDK format. This function registers an HTTP `POST` endpoint that accepts messages, executes an agent network, and streams the response back to the client in AI SDK-compatible format. Agent networks allow a routing agent to delegate tasks to other agents. You have to use it inside a [custom API route](https://mastra.ai/docs/server/custom-api-routes).
|
|
8
8
|
|
|
@@ -49,7 +49,7 @@ export const mastra = new Mastra({
|
|
|
49
49
|
|
|
50
50
|
## Parameters
|
|
51
51
|
|
|
52
|
-
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
|
|
52
|
+
**version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. Pass 'v7' when your app is typed against AI SDK v7. (Default: `'v5'`)
|
|
53
53
|
|
|
54
54
|
**path** (`string`): The route path (e.g., /network or /network/:agentId). Include :agentId for dynamic agent routing. (Default: `'/network/:agentId'`)
|
|
55
55
|
|
|
@@ -44,7 +44,7 @@ export default function Chat() {
|
|
|
44
44
|
|
|
45
45
|
**messages** (`MessageListInput`): Messages to convert. Can be a string, array of strings, a single message object, or an array of message objects in any supported format.
|
|
46
46
|
|
|
47
|
-
**options.version** (`'v5' | 'v6'`): Selects the AI SDK message type to return. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 useChat() message types.
|
|
47
|
+
**options.version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK message type to return. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 useChat() message types. Pass 'v7' when your app is typed against AI SDK v7.
|
|
48
48
|
|
|
49
49
|
## Returns
|
|
50
50
|
|
|
@@ -64,7 +64,7 @@ The first parameter is the Mastra stream to convert. It can be one of:
|
|
|
64
64
|
|
|
65
65
|
The second parameter is an options object:
|
|
66
66
|
|
|
67
|
-
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
|
|
67
|
+
**version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. Pass 'v7' when your app is typed against AI SDK v7. (Default: `'v5'`)
|
|
68
68
|
|
|
69
69
|
**from** (`'agent' | 'network' | 'workflow'`): The type of Mastra stream being converted. (Default: `'agent'`)
|
|
70
70
|
|
|
@@ -51,7 +51,7 @@ export const mastra = new Mastra({
|
|
|
51
51
|
|
|
52
52
|
## Parameters
|
|
53
53
|
|
|
54
|
-
**version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
|
|
54
|
+
**version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. Pass 'v7' when your app is typed against AI SDK v7. (Default: `'v5'`)
|
|
55
55
|
|
|
56
56
|
**path** (`string`): The route path (e.g., /workflow or /workflow/:workflowId). Include :workflowId for dynamic workflow routing. (Default: `'/api/workflows/:workflowId/stream'`)
|
|
57
57
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
The `IFGAProvider` interface defines a fine-grained authorization (FGA) provider. Mastra calls it to decide whether a user or a system actor may perform a permission on a specific resource. Implement it to connect Mastra to an FGA backend, such as WorkOS Authorization.
|
|
6
6
|
|
|
7
|
-
For concepts, configuration, and the lifecycle points where Mastra enforces FGA, see [Fine-grained authorization](https://mastra.ai/docs/
|
|
7
|
+
For concepts, configuration, and the lifecycle points where Mastra enforces FGA, see [Fine-grained authorization](https://mastra.ai/docs/auth/fga).
|
|
8
8
|
|
|
9
9
|
## Usage example
|
|
10
10
|
|
|
@@ -47,7 +47,7 @@ Returns: `Promise<boolean>`
|
|
|
47
47
|
|
|
48
48
|
### `require(user, params)`
|
|
49
49
|
|
|
50
|
-
Throws `FGADeniedError` when `user` lacks the permission. Mastra calls this at its [enforcement points](https://mastra.ai/docs/
|
|
50
|
+
Throws `FGADeniedError` when `user` lacks the permission. Mastra calls this at its [enforcement points](https://mastra.ai/docs/auth/fga).
|
|
51
51
|
|
|
52
52
|
Returns: `Promise<void>`
|
|
53
53
|
|
|
@@ -63,7 +63,7 @@ Authorizes a non-user system actor, such as an autonomous or scheduled agent. Op
|
|
|
63
63
|
|
|
64
64
|
System actors skip the user-centric `require()` path, so implement `requireActor` to enforce per-agent least privilege for them. Throw `FGADeniedError` to deny. When a provider doesn't implement `requireActor`, Mastra preserves the trusted-actor bypass (allow after the tenant-scope check), so adding the method remains backward compatible.
|
|
65
65
|
|
|
66
|
-
Treat `actor.permissions` as an untrusted claim. Resolve the agent's authoritative grants from a trusted source keyed by `actor.agentId`, rather than trusting the inline values. See [System actors](https://mastra.ai/docs/
|
|
66
|
+
Treat `actor.permissions` as an untrusted claim. Resolve the agent's authoritative grants from a trusted source keyed by `actor.agentId`, rather than trusting the inline values. See [System actors](https://mastra.ai/docs/auth/fga).
|
|
67
67
|
|
|
68
68
|
```typescript
|
|
69
69
|
import { FGADeniedError } from '@mastra/core/auth/ee'
|
|
@@ -122,6 +122,8 @@ Identifies a call made by a trusted non-user actor rather than an authenticated
|
|
|
122
122
|
|
|
123
123
|
**sourceWorkflow** (`string`): Name of the workflow that started the actor run, when applicable.
|
|
124
124
|
|
|
125
|
+
**propagate** (`boolean`): Forwards this actor into the agent and tool calls the framework makes for the run's declarative .then(agent) and .then(tool) steps. Custom step execute functions aren't covered and must pass actor explicitly. Ignored by authorization itself. (Default: `false`)
|
|
126
|
+
|
|
125
127
|
## `FGADeniedError`
|
|
126
128
|
|
|
127
129
|
Thrown when an authorization check is denied. `require` and `requireActor` throw it to deny, and Mastra surfaces it as an HTTP `403`.
|
|
@@ -135,6 +137,6 @@ throw new FGADeniedError(user, { type: 'agent', id: 'reporter' }, 'agents:execut
|
|
|
135
137
|
|
|
136
138
|
## Related
|
|
137
139
|
|
|
138
|
-
- [Fine-grained authorization](https://mastra.ai/docs/
|
|
139
|
-
- [System actors](https://mastra.ai/docs/
|
|
140
|
+
- [Fine-grained authorization](https://mastra.ai/docs/auth/fga)
|
|
141
|
+
- [System actors](https://mastra.ai/docs/auth/fga)
|
|
140
142
|
- [WorkOS authentication](https://mastra.ai/reference/auth/workos)
|
|
@@ -54,7 +54,7 @@ then interact with elements using their refs (e.g., @e5).`,
|
|
|
54
54
|
|
|
55
55
|
`AgentBrowser` provides 16 deterministic tools for browser automation. All tools that interact with elements use refs from the accessibility tree snapshot.
|
|
56
56
|
|
|
57
|
-
When `recording` is configured, `AgentBrowser` also adds the Beta `browser_record` and `browser_record_caption` tools. See [Browser recording (Beta)](https://mastra.ai/docs/browser
|
|
57
|
+
When `recording` is configured, `AgentBrowser` also adds the Beta `browser_record` and `browser_record_caption` tools. See [Browser recording (Beta)](https://mastra.ai/docs/browser).
|
|
58
58
|
|
|
59
59
|
### Core tools
|
|
60
60
|
|
|
@@ -403,5 +403,5 @@ The `browser_snapshot` tool returns an accessibility tree with element refs like
|
|
|
403
403
|
|
|
404
404
|
- [MastraBrowser](https://mastra.ai/reference/browser/mastra-browser): Base class reference
|
|
405
405
|
- [StagehandBrowser](https://mastra.ai/reference/browser/stagehand-browser): AI-powered alternative
|
|
406
|
-
- [Browser overview](https://mastra.ai/docs/browser
|
|
406
|
+
- [Browser overview](https://mastra.ai/docs/browser): Conceptual guide
|
|
407
407
|
- [agent-browser guide](https://mastra.ai/integrations/browsers/agent-browser): Usage guide
|
|
@@ -194,7 +194,7 @@ await viewer.injectKeyboardEvent({
|
|
|
194
194
|
|
|
195
195
|
## Supported CLIs
|
|
196
196
|
|
|
197
|
-
Each CLI must be installed separately. Each also publishes a [skill](https://mastra.ai/docs/
|
|
197
|
+
Each CLI must be installed separately. Each also publishes a [skill](https://mastra.ai/docs/sandbox/skills) that teaches the agent its commands and workflows. When a CLI command runs through `workspace_execute_command`, Mastra detects it and injects the CDP URL automatically using the correct flag.
|
|
198
198
|
|
|
199
199
|
Unlike SDK providers, `BrowserViewer` doesn't provide agent tools. The agent uses CLI commands through `workspace_execute_command` instead.
|
|
200
200
|
|
|
@@ -229,4 +229,4 @@ browse skills install
|
|
|
229
229
|
|
|
230
230
|
- [BrowserViewer guide](https://mastra.ai/integrations/browsers/browser-viewer): Setup and usage walkthrough
|
|
231
231
|
- [MastraBrowser](https://mastra.ai/reference/browser/mastra-browser): Base class API reference
|
|
232
|
-
- [Sandbox](https://mastra.ai/docs/
|
|
232
|
+
- [Sandbox](https://mastra.ai/docs/sandbox/overview): Workspace configuration
|
|
@@ -68,4 +68,4 @@ In both cases, `FirecrawlBrowser` deletes the remote Firecrawl session when the
|
|
|
68
68
|
|
|
69
69
|
- [Firecrawl docs](https://mastra.ai/integrations/browsers/firecrawl)
|
|
70
70
|
- [`AgentBrowser` reference](https://mastra.ai/reference/browser/agent-browser)
|
|
71
|
-
- [Browser overview](https://mastra.ai/docs/browser
|
|
71
|
+
- [Browser overview](https://mastra.ai/docs/browser)
|
|
@@ -285,4 +285,4 @@ const browser = new AgentBrowser({
|
|
|
285
285
|
|
|
286
286
|
- [AgentBrowser](https://mastra.ai/reference/browser/agent-browser): Deterministic browser automation
|
|
287
287
|
- [StagehandBrowser](https://mastra.ai/reference/browser/stagehand-browser): AI-powered browser automation
|
|
288
|
-
- [Browser overview](https://mastra.ai/docs/browser
|
|
288
|
+
- [Browser overview](https://mastra.ai/docs/browser): Conceptual guide to browser automation
|
|
@@ -71,7 +71,7 @@ Use stagehand_extract to get data from pages.`,
|
|
|
71
71
|
|
|
72
72
|
`StagehandBrowser` provides 7 AI-powered tools for browser automation.
|
|
73
73
|
|
|
74
|
-
When `recording` is configured, `StagehandBrowser` also adds the Beta `browser_record` and `browser_record_caption` tools. See [Browser recording (Beta)](https://mastra.ai/docs/browser
|
|
74
|
+
When `recording` is configured, `StagehandBrowser` also adds the Beta `browser_record` and `browser_record_caption` tools. See [Browser recording (Beta)](https://mastra.ai/docs/browser).
|
|
75
75
|
|
|
76
76
|
Core tools:
|
|
77
77
|
|
|
@@ -316,5 +316,5 @@ Choose `AgentBrowser` for precise, reproducible automation. Choose `StagehandBro
|
|
|
316
316
|
|
|
317
317
|
- [MastraBrowser](https://mastra.ai/reference/browser/mastra-browser): Base class reference
|
|
318
318
|
- [AgentBrowser](https://mastra.ai/reference/browser/agent-browser): Deterministic alternative
|
|
319
|
-
- [Browser overview](https://mastra.ai/docs/browser
|
|
319
|
+
- [Browser overview](https://mastra.ai/docs/browser): Conceptual guide
|
|
320
320
|
- [Stagehand guide](https://mastra.ai/integrations/browsers/stagehand): Usage guide
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Build with AI
|
|
4
4
|
|
|
5
|
-
For everyday AI-assisted development with Mastra skills and the CLI, see [Develop](https://mastra.ai/docs/
|
|
5
|
+
For everyday AI-assisted development with Mastra skills and the CLI, see [Develop](https://mastra.ai/docs/develop). This page covers other ways to give coding agents access to Mastra documentation.
|
|
6
6
|
|
|
7
7
|
## Embedded package docs
|
|
8
8
|
|
|
@@ -29,7 +29,7 @@ Examples for the [introduction page](https://mastra.ai/docs):
|
|
|
29
29
|
|
|
30
30
|
## MCP docs server
|
|
31
31
|
|
|
32
|
-
> **Warning:** The MCP docs server isn't recommended for everyday development. Use the [Mastra skill](https://mastra.ai/docs/
|
|
32
|
+
> **Warning:** The MCP docs server isn't recommended for everyday development. Use the [Mastra skill](https://mastra.ai/docs/develop) instead because it's more up to date and performs better.
|
|
33
33
|
|
|
34
34
|
The `@mastra/mcp-docs-server` package provides direct local access to Mastra’s full documentation via the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro). It works with Cursor, Windsurf, Cline, Claude Code, VS Code, Codex or any tool that supports MCP.
|
|
35
35
|
|
|
@@ -226,5 +226,5 @@ const result = await slack.connect('support-agent')
|
|
|
226
226
|
## Related
|
|
227
227
|
|
|
228
228
|
- [ChannelProvider](https://mastra.ai/reference/channels/channel-provider): the interface `SlackProvider` implements
|
|
229
|
-
- [Channels](https://mastra.ai/docs/
|
|
229
|
+
- [Channels](https://mastra.ai/docs/channels): concepts, platform setup, and the `createSlackAdapter` path
|
|
230
230
|
- [Channels reference](https://mastra.ai/reference/agents/channels): the `channels` config on the `Agent` constructor
|
|
@@ -1771,6 +1771,8 @@ When a server started with `mastra dev` or `mastra start` has observability metr
|
|
|
1771
1771
|
|
|
1772
1772
|
At server startup, Mastra also sends an anonymous project-surface snapshot: counts of registered agents, agent controllers, workflows, tools, processors, vector stores, scorers, workspaces, MCP servers, gateways, and channels, plus booleans for memory, voice, editor, and observability usage and the coarse storage backend category. It doesn't send names or identifiers. You can read the [source code](https://github.com/mastra-ai/mastra/blob/main/packages/core/src/telemetry/feature-telemetry.ts) to check what's collected.
|
|
1773
1773
|
|
|
1774
|
+
The Studio UI also collects anonymous browser-side usage analytics, such as page views and UI interactions. You can read the [source code](https://github.com/mastra-ai/mastra/blob/main/packages/playground/src/lib/analytics.tsx) to check what's collected. Setting `MASTRA_TELEMETRY_DISABLED` disables this too: the value is injected into the served page, so it applies to `mastra dev` and self-hosted builds alike.
|
|
1775
|
+
|
|
1774
1776
|
You can opt out of all CLI and usage analytics by setting an environment variable:
|
|
1775
1777
|
|
|
1776
1778
|
```bash
|
|
@@ -285,7 +285,7 @@ await subscription.processDataStream({
|
|
|
285
285
|
|
|
286
286
|
### `streamUntilIdle()`
|
|
287
287
|
|
|
288
|
-
Stream a response and keep the stream open until every [background task](https://mastra.ai/docs/
|
|
288
|
+
Stream a response and keep the stream open until every [background task](https://mastra.ai/docs/harness/background-tasks) dispatched during the run completes. The server re-enters the agentic loop on each task completion so the LLM can react to results in the same call. Requires background tasks to be [enabled on the Mastra instance](https://mastra.ai/reference/configuration) and a memory thread; otherwise the call uses a plain `stream()`.
|
|
289
289
|
|
|
290
290
|
```typescript
|
|
291
291
|
const response = await agent.streamUntilIdle('Research solana for me', {
|
|
@@ -307,7 +307,7 @@ response.processDataStream({
|
|
|
307
307
|
|
|
308
308
|
### `resumeStreamUntilIdle()`
|
|
309
309
|
|
|
310
|
-
Resume a suspended agent stream with custom data and keep the stream open until every [background task](https://mastra.ai/docs/
|
|
310
|
+
Resume a suspended agent stream with custom data and keep the stream open until every [background task](https://mastra.ai/docs/harness/background-tasks) dispatched during the run completes. Use this to continue execution after a suspension point, such as a workflow suspend within an agent. Requires background tasks to be [enabled on the Mastra instance](https://mastra.ai/reference/configuration) and a memory thread; otherwise the call uses a plain `resumeStream()`:
|
|
311
311
|
|
|
312
312
|
```typescript
|
|
313
313
|
const response = await agent.resumeStreamUntilIdle(
|
|
@@ -497,7 +497,7 @@ if (output.finishReason === 'suspended') {
|
|
|
497
497
|
|
|
498
498
|
## Agent schedules
|
|
499
499
|
|
|
500
|
-
Use the client SDK schedule methods to manage persisted agent schedules over the `/api/schedules` routes. For concepts and server-side examples, see [Schedules](https://mastra.ai/docs/
|
|
500
|
+
Use the client SDK schedule methods to manage persisted agent schedules over the `/api/schedules` routes. For concepts and server-side examples, see [Schedules](https://mastra.ai/docs/harness/schedules) and the [`mastra.schedules` reference](https://mastra.ai/reference/schedules/overview).
|
|
501
501
|
|
|
502
502
|
### `createSchedule()`
|
|
503
503
|
|
|
@@ -778,9 +778,29 @@ const agent = await mastraClient.createStoredAgent({
|
|
|
778
778
|
version: '1.0',
|
|
779
779
|
team: 'engineering',
|
|
780
780
|
},
|
|
781
|
+
durable: true,
|
|
781
782
|
})
|
|
782
783
|
```
|
|
783
784
|
|
|
785
|
+
#### Durable stored agents
|
|
786
|
+
|
|
787
|
+
Set `durable` to run the agent as a [durable agent](https://mastra.ai/docs/harness/durable-agents) once the server hydrates it. Pass `true` to accept the defaults, or an object to tune the durable loop:
|
|
788
|
+
|
|
789
|
+
```typescript
|
|
790
|
+
const agent = await mastraClient.createStoredAgent({
|
|
791
|
+
id: 'durable-agent',
|
|
792
|
+
name: 'Durable Agent',
|
|
793
|
+
instructions: 'You are a helpful assistant.',
|
|
794
|
+
model: {
|
|
795
|
+
provider: 'openai',
|
|
796
|
+
name: 'gpt-5.4',
|
|
797
|
+
},
|
|
798
|
+
durable: { maxSteps: 50, cleanupTimeoutMs: 0 },
|
|
799
|
+
})
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
Only serializable options are accepted. The durable cache and pubsub are inherited from the server's `Mastra` instance. If it has no distributed cache or pubsub configured, durability is process-local. Automatic recovery is still configured in code through `recovery.durableAgents`.
|
|
803
|
+
|
|
784
804
|
### `getStoredAgent()`
|
|
785
805
|
|
|
786
806
|
Get an instance of a specific stored agent:
|
|
@@ -839,7 +859,7 @@ console.log(result.success) // true
|
|
|
839
859
|
|
|
840
860
|
## Version management
|
|
841
861
|
|
|
842
|
-
Both `Agent` (code-defined) and `StoredAgent` instances have methods for managing configuration versions. See [Editor versioning](https://mastra.ai/docs/editor
|
|
862
|
+
Both `Agent` (code-defined) and `StoredAgent` instances have methods for managing configuration versions. See [Editor versioning](https://mastra.ai/docs/studio/editor) for lifecycle and selection behavior.
|
|
843
863
|
|
|
844
864
|
### Getting an agent with a specific version
|
|
845
865
|
|