@mastra/mcp-docs-server 1.2.17-alpha.9 → 1.2.18-alpha.1
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/context-engineering.md +297 -0
- 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 +9 -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/echo.md +73 -0
- package/.docs/models/providers/edenai.md +26 -11
- package/.docs/models/providers/empiriolabs.md +11 -1
- package/.docs/models/providers/hetzner.md +6 -8
- package/.docs/models/providers/huggingface.md +4 -1
- package/.docs/models/providers/hyper.md +8 -7
- package/.docs/models/providers/inferx.md +19 -13
- package/.docs/models/providers/jalapeno.md +89 -0
- package/.docs/models/providers/kilo.md +12 -11
- 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 +13 -17
- package/.docs/models/providers/ofox.md +8 -4
- package/.docs/models/providers/opencode-go.md +23 -22
- package/.docs/models/providers/requesty.md +143 -53
- 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 +8 -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/workflows/run-methods/resume.md +21 -0
- 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 +81 -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
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# SCNet Token Plan
|
|
4
|
+
|
|
5
|
+
Access 13 SCNet Token Plan models through Mastra's model router. Authentication is handled automatically using the `SCNET_API_KEY` environment variable.
|
|
6
|
+
|
|
7
|
+
Learn more in the [SCNet Token Plan documentation](https://www.scnet.cn/ac/openapi/doc/2.0/moduleapi/plans/token-plan.html).
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
SCNET_API_KEY=your-api-key
|
|
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: "scnet-token-plan/DeepSeek-V3.2"
|
|
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
|
+
> **Note:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [SCNet Token Plan documentation](https://www.scnet.cn/ac/openapi/doc/2.0/moduleapi/plans/token-plan.html) for details.
|
|
34
|
+
|
|
35
|
+
## Models
|
|
36
|
+
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| ------------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `scnet-token-plan/DeepSeek-V3.2` | 128K | | | | | | — | — |
|
|
40
|
+
| `scnet-token-plan/DeepSeek-V4-Flash` | 1.0M | | | | | | — | — |
|
|
41
|
+
| `scnet-token-plan/GLM-5` | 205K | | | | | | — | — |
|
|
42
|
+
| `scnet-token-plan/GLM-5.1` | 200K | | | | | | — | — |
|
|
43
|
+
| `scnet-token-plan/GLM-5.2` | 1.0M | | | | | | — | — |
|
|
44
|
+
| `scnet-token-plan/Kimi-K2.5` | 262K | | | | | | — | — |
|
|
45
|
+
| `scnet-token-plan/Kimi-K2.6` | 262K | | | | | | — | — |
|
|
46
|
+
| `scnet-token-plan/Kimi-K2.7-Code` | 262K | | | | | | — | — |
|
|
47
|
+
| `scnet-token-plan/Kimi-K3` | 1.0M | | | | | | — | — |
|
|
48
|
+
| `scnet-token-plan/MiMo-V2.5-Pro` | 1.0M | | | | | | — | — |
|
|
49
|
+
| `scnet-token-plan/MiniMax-M2.5` | 205K | | | | | | — | — |
|
|
50
|
+
| `scnet-token-plan/MiniMax-M2.7` | 205K | | | | | | — | — |
|
|
51
|
+
| `scnet-token-plan/MiniMax-M3` | 512K | | | | | | — | — |
|
|
52
|
+
|
|
53
|
+
## Advanced configuration
|
|
54
|
+
|
|
55
|
+
### Custom headers
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
const agent = new Agent({
|
|
59
|
+
id: "custom-agent",
|
|
60
|
+
name: "custom-agent",
|
|
61
|
+
model: {
|
|
62
|
+
url: "https://api.scnet.cn/api/llm/v1",
|
|
63
|
+
id: "scnet-token-plan/DeepSeek-V3.2",
|
|
64
|
+
apiKey: process.env.SCNET_API_KEY,
|
|
65
|
+
headers: {
|
|
66
|
+
"X-Custom-Header": "value"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Dynamic model selection
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
const agent = new Agent({
|
|
76
|
+
id: "dynamic-agent",
|
|
77
|
+
name: "Dynamic Agent",
|
|
78
|
+
model: ({ requestContext }) => {
|
|
79
|
+
const useAdvanced = requestContext.task === "complex";
|
|
80
|
+
return useAdvanced
|
|
81
|
+
? "scnet-token-plan/MiniMax-M3"
|
|
82
|
+
: "scnet-token-plan/DeepSeek-V3.2";
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
```
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# SCX.ai
|
|
4
|
+
|
|
5
|
+
Access 4 SCX.ai models through Mastra's model router. Authentication is handled automatically using the `SCX_API_KEY` environment variable.
|
|
6
|
+
|
|
7
|
+
Learn more in the [SCX.ai documentation](https://platform.scx.ai/docs).
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
SCX_API_KEY=your-api-key
|
|
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: "scx-ai/GLM-5.2"
|
|
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
|
+
> **Note:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [SCX.ai documentation](https://platform.scx.ai/docs) for details.
|
|
34
|
+
|
|
35
|
+
## Models
|
|
36
|
+
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| --------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `scx-ai/GLM-5.2` | 1.0M | | | | | | $0.55 | $2 |
|
|
40
|
+
| `scx-ai/gpt-oss-120b` | 131K | | | | | | $0.17 | $0.55 |
|
|
41
|
+
| `scx-ai/MiniMax-M2.7` | 197K | | | | | | $0.48 | $2 |
|
|
42
|
+
| `scx-ai/Qwen3.8-Max` | 1.0M | | | | | | $2 | $5 |
|
|
43
|
+
|
|
44
|
+
## Advanced configuration
|
|
45
|
+
|
|
46
|
+
### Custom headers
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
const agent = new Agent({
|
|
50
|
+
id: "custom-agent",
|
|
51
|
+
name: "custom-agent",
|
|
52
|
+
model: {
|
|
53
|
+
url: "https://api.scx.ai/v1",
|
|
54
|
+
id: "scx-ai/GLM-5.2",
|
|
55
|
+
apiKey: process.env.SCX_API_KEY,
|
|
56
|
+
headers: {
|
|
57
|
+
"X-Custom-Header": "value"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Dynamic model selection
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
const agent = new Agent({
|
|
67
|
+
id: "dynamic-agent",
|
|
68
|
+
name: "Dynamic Agent",
|
|
69
|
+
model: ({ requestContext }) => {
|
|
70
|
+
const useAdvanced = requestContext.task === "complex";
|
|
71
|
+
return useAdvanced
|
|
72
|
+
? "scx-ai/gpt-oss-120b"
|
|
73
|
+
: "scx-ai/GLM-5.2";
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Together AI
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 36 Together AI models through Mastra's model router. Authentication is handled automatically using the `TOGETHER_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Together AI documentation](https://docs.together.ai/docs/serverless-models).
|
|
8
8
|
|
|
@@ -37,6 +37,7 @@ for await (const chunk of stream) {
|
|
|
37
37
|
| `togetherai/deepcogito/cogito-v2-1-671b` | 164K | | | | | | $1 | $1 |
|
|
38
38
|
| `togetherai/deepseek-ai/DeepSeek-V4-Flash-0731` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
39
39
|
| `togetherai/deepseek-ai/DeepSeek-V4-Pro` | 512K | | | | | | $2 | $3 |
|
|
40
|
+
| `togetherai/deepseek-ai/DeepSeek-V4-Pro-0813` | 1.0M | | | | | | $1 | $4 |
|
|
40
41
|
| `togetherai/google/gemma-3n-E4B-it` | 33K | | | | | | $0.06 | $0.12 |
|
|
41
42
|
| `togetherai/google/gemma-4-31B-it` | 262K | | | | | | $0.39 | $0.97 |
|
|
42
43
|
| `togetherai/LiquidAI/LFM2-24B-A2B` | 33K | | | | | | $0.03 | $0.12 |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Umans AI Coding Plan
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 9 Umans AI Coding Plan models through Mastra's model router. Authentication is handled automatically using the `UMANS_AI_CODING_PLAN_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Umans AI Coding Plan documentation](https://app.umans.ai/offers/code/docs).
|
|
8
8
|
|
|
@@ -38,6 +38,7 @@ for await (const chunk of stream) {
|
|
|
38
38
|
| --------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
39
|
| `umans-ai-coding-plan/umans-coder` | 262K | | | | | | — | — |
|
|
40
40
|
| `umans-ai-coding-plan/umans-deepseek-v4-flash-0731` | 1.0M | | | | | | — | — |
|
|
41
|
+
| `umans-ai-coding-plan/umans-deepseek-v4-pro-0813` | 1.0M | | | | | | — | — |
|
|
41
42
|
| `umans-ai-coding-plan/umans-flash` | 262K | | | | | | — | — |
|
|
42
43
|
| `umans-ai-coding-plan/umans-glm-5.1` | 205K | | | | | | — | — |
|
|
43
44
|
| `umans-ai-coding-plan/umans-glm-5.2` | 406K | | | | | | — | — |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Umans AI
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 8 Umans AI models through Mastra's model router. Authentication is handled automatically using the `UMANS_AI_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Umans AI documentation](https://app.umans.ai/offers/code/docs/orgs).
|
|
8
8
|
|
|
@@ -38,6 +38,7 @@ for await (const chunk of stream) {
|
|
|
38
38
|
| --------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
39
|
| `umans-ai/umans-coder` | 262K | | | | | | $0.95 | $4 |
|
|
40
40
|
| `umans-ai/umans-deepseek-v4-flash-0731` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
41
|
+
| `umans-ai/umans-deepseek-v4-pro-0813` | 1.0M | | | | | | $1 | $4 |
|
|
41
42
|
| `umans-ai/umans-flash` | 262K | | | | | | $0.15 | $1 |
|
|
42
43
|
| `umans-ai/umans-glm-5.1` | 205K | | | | | | $1 | $4 |
|
|
43
44
|
| `umans-ai/umans-glm-5.2` | 406K | | | | | | $1 | $4 |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Vivgrid
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 20 Vivgrid models through Mastra's model router. Authentication is handled automatically using the `VIVGRID_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Vivgrid documentation](https://docs.vivgrid.com/models).
|
|
8
8
|
|
|
@@ -42,6 +42,7 @@ for await (const chunk of stream) {
|
|
|
42
42
|
| `vivgrid/gemini-3.1-flash-lite-preview` | 1.0M | | | | | | $0.25 | $2 |
|
|
43
43
|
| `vivgrid/gemini-3.1-pro-preview` | 1.0M | | | | | | $2 | $12 |
|
|
44
44
|
| `vivgrid/glm-5.2` | 1.0M | | | | | | $1 | $4 |
|
|
45
|
+
| `vivgrid/glm-5.3` | 1.0M | | | | | | $1 | $4 |
|
|
45
46
|
| `vivgrid/gpt-5-mini` | 272K | | | | | | $0.25 | $2 |
|
|
46
47
|
| `vivgrid/gpt-5.1-codex` | 400K | | | | | | $1 | $10 |
|
|
47
48
|
| `vivgrid/gpt-5.1-codex-max` | 400K | | | | | | $1 | $10 |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Weights & Biases
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 29 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
|
|
|
@@ -62,6 +62,7 @@ for await (const chunk of stream) {
|
|
|
62
62
|
| `wandb/Qwen/Qwen3.5-35B-A3B` | 262K | | | | | | $0.25 | $1 |
|
|
63
63
|
| `wandb/Qwen/Qwen3.6-27B` | 262K | | | | | | $0.60 | $4 |
|
|
64
64
|
| `wandb/Qwen/Qwen3.6-35B-A3B` | 262K | | | | | | $0.25 | $1 |
|
|
65
|
+
| `wandb/Qwen/Qwen3.8-27B` | 262K | | | | | | $0.40 | $3 |
|
|
65
66
|
| `wandb/zai-org/GLM-5.1` | 203K | | | | | | $1 | $4 |
|
|
66
67
|
| `wandb/zai-org/GLM-5.2` | 262K | | | | | | $0.76 | $2 |
|
|
67
68
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# xAI
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 12 xAI models through Mastra's model router. Authentication is handled automatically using the `XAI_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [xAI documentation](https://docs.x.ai/docs/models).
|
|
8
8
|
|
|
@@ -42,6 +42,7 @@ for await (const chunk of stream) {
|
|
|
42
42
|
| `xai/grok-4.6` | 500K | | | | | | $2 | $6 |
|
|
43
43
|
| `xai/grok-build-0.1` | 256K | | | | | | $1 | $2 |
|
|
44
44
|
| `xai/grok-imagine-image` | 8K | | | | | | — | — |
|
|
45
|
+
| `xai/grok-imagine-image-2.0` | 8K | | | | | | — | — |
|
|
45
46
|
| `xai/grok-imagine-image-quality` | 8K | | | | | | — | — |
|
|
46
47
|
| `xai/grok-imagine-video` | 1K | | | | | | — | — |
|
|
47
48
|
| `xai/grok-imagine-video-1.5` | 1K | | | | | | — | — |
|
|
@@ -24,7 +24,9 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
24
24
|
- [Alibaba Token Plan](https://mastra.ai/models/providers/alibaba-token-plan)
|
|
25
25
|
- [Alibaba Token Plan (China)](https://mastra.ai/models/providers/alibaba-token-plan-cn)
|
|
26
26
|
- [Ambient](https://mastra.ai/models/providers/ambient)
|
|
27
|
+
- [AMD](https://mastra.ai/models/providers/amd)
|
|
27
28
|
- [AnyAPI](https://mastra.ai/models/providers/anyapi)
|
|
29
|
+
- [Arcee](https://mastra.ai/models/providers/arcee)
|
|
28
30
|
- [Atomic Chat](https://mastra.ai/models/providers/atomic-chat)
|
|
29
31
|
- [Auriko](https://mastra.ai/models/providers/auriko)
|
|
30
32
|
- [Bailing](https://mastra.ai/models/providers/bailing)
|
|
@@ -51,6 +53,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
51
53
|
- [DigitalOcean](https://mastra.ai/models/providers/digitalocean)
|
|
52
54
|
- [DInference](https://mastra.ai/models/providers/dinference)
|
|
53
55
|
- [EBCloud](https://mastra.ai/models/providers/ebcloud)
|
|
56
|
+
- [Echo](https://mastra.ai/models/providers/echo)
|
|
54
57
|
- [Eden AI](https://mastra.ai/models/providers/edenai)
|
|
55
58
|
- [EmpirioLabs AI](https://mastra.ai/models/providers/empiriolabs)
|
|
56
59
|
- [evroc](https://mastra.ai/models/providers/evroc)
|
|
@@ -73,10 +76,12 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
73
76
|
- [InferX](https://mastra.ai/models/providers/inferx)
|
|
74
77
|
- [Infomaniak](https://mastra.ai/models/providers/infomaniak)
|
|
75
78
|
- [IO.NET](https://mastra.ai/models/providers/io-net)
|
|
79
|
+
- [Jalapeno Cloud](https://mastra.ai/models/providers/jalapeno)
|
|
76
80
|
- [Jiekou.AI](https://mastra.ai/models/providers/jiekou)
|
|
77
81
|
- [Kenari](https://mastra.ai/models/providers/kenari)
|
|
78
82
|
- [Kilo Gateway](https://mastra.ai/models/providers/kilo)
|
|
79
83
|
- [Kimi For Coding](https://mastra.ai/models/providers/kimi-for-coding)
|
|
84
|
+
- [Kosmik Compute](https://mastra.ai/models/providers/kosmik)
|
|
80
85
|
- [KUAE Cloud Coding Plan](https://mastra.ai/models/providers/kuae-cloud-coding-plan)
|
|
81
86
|
- [Lilac](https://mastra.ai/models/providers/lilac)
|
|
82
87
|
- [Llama](https://mastra.ai/models/providers/llama)
|
|
@@ -87,7 +92,6 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
87
92
|
- [LucidQuery](https://mastra.ai/models/providers/lucidquery)
|
|
88
93
|
- [Lynkr](https://mastra.ai/models/providers/lynkr)
|
|
89
94
|
- [Meganova](https://mastra.ai/models/providers/meganova)
|
|
90
|
-
- [Merge Gateway](https://mastra.ai/models/providers/merge-gateway)
|
|
91
95
|
- [Meta](https://mastra.ai/models/providers/meta)
|
|
92
96
|
- [MiniMax (minimax.io)](https://mastra.ai/models/providers/minimax)
|
|
93
97
|
- [MiniMax (minimaxi.com)](https://mastra.ai/models/providers/minimax-cn)
|
|
@@ -126,10 +130,12 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
126
130
|
- [Regolo AI](https://mastra.ai/models/providers/regolo-ai)
|
|
127
131
|
- [Requesty](https://mastra.ai/models/providers/requesty)
|
|
128
132
|
- [routing.run](https://mastra.ai/models/providers/routing-run)
|
|
133
|
+
- [RunInfra](https://mastra.ai/models/providers/runinfra)
|
|
129
134
|
- [Sakana AI](https://mastra.ai/models/providers/sakana)
|
|
130
135
|
- [Sarvam AI](https://mastra.ai/models/providers/sarvam)
|
|
131
136
|
- [Scaleway](https://mastra.ai/models/providers/scaleway)
|
|
132
|
-
- [
|
|
137
|
+
- [SCNet Token Plan](https://mastra.ai/models/providers/scnet-token-plan)
|
|
138
|
+
- [SCX.ai](https://mastra.ai/models/providers/scx-ai)
|
|
133
139
|
- [SiliconFlow](https://mastra.ai/models/providers/siliconflow)
|
|
134
140
|
- [SiliconFlow (China)](https://mastra.ai/models/providers/siliconflow-cn)
|
|
135
141
|
- [Snowflake Cortex](https://mastra.ai/models/providers/snowflake-cortex)
|
|
@@ -224,9 +224,9 @@ Use this callback to enforce local policy or inspect the permission title. It ca
|
|
|
224
224
|
|
|
225
225
|
## Related
|
|
226
226
|
|
|
227
|
-
- [Agent Client Protocol docs](https://mastra.ai/docs/
|
|
227
|
+
- [Agent Client Protocol docs](https://mastra.ai/docs/connections/acp)
|
|
228
228
|
- [createACPTool() reference](https://mastra.ai/reference/acp/create-acp-tool)
|
|
229
229
|
- [Agent reference](https://mastra.ai/reference/agents/agent)
|
|
230
|
-
- [Subagents](https://mastra.ai/docs/
|
|
230
|
+
- [Subagents](https://mastra.ai/docs/subagents)
|
|
231
231
|
- [Agent Client Protocol introduction](https://agentclientprotocol.com/overview/introduction)
|
|
232
232
|
- [Agent Client Protocol schema](https://agentclientprotocol.com/protocol/schema)
|
|
@@ -154,7 +154,7 @@ Return a fully custom `Client` implementation when you need to change the standa
|
|
|
154
154
|
|
|
155
155
|
## Related
|
|
156
156
|
|
|
157
|
-
- [Agent Client Protocol docs](https://mastra.ai/docs/
|
|
157
|
+
- [Agent Client Protocol docs](https://mastra.ai/docs/connections/acp)
|
|
158
158
|
- [AcpAgent class reference](https://mastra.ai/reference/acp/acp-agent)
|
|
159
159
|
- [Tool reference](https://mastra.ai/reference/tools/create-tool)
|
|
160
160
|
- [Agent Client Protocol introduction](https://agentclientprotocol.com/overview/introduction)
|
|
@@ -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
|
|