@mastra/mcp-docs-server 1.2.7-alpha.1 → 1.2.7-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/docs/agent-builder/integrations.md +45 -3
- package/.docs/docs/agent-builder/overview.md +4 -3
- package/.docs/docs/agent-builder/skill-registries.md +1 -3
- package/.docs/docs/agent-controller/modes.md +1 -1
- package/.docs/docs/agent-controller/overview.md +4 -3
- package/.docs/docs/agent-controller/session.md +3 -5
- package/.docs/docs/agents/a2a.md +2 -1
- package/.docs/docs/agents/agent-approval.md +2 -2
- package/.docs/docs/agents/code-mode.md +1 -1
- package/.docs/docs/agents/guardrails.md +10 -9
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/overview.md +5 -5
- package/.docs/docs/agents/skills.md +3 -5
- package/.docs/docs/agents/structured-output.md +1 -1
- package/.docs/docs/agents/supervisor-agents.md +3 -4
- package/.docs/docs/agents/using-tools.md +2 -4
- package/.docs/docs/browser/agent-browser.md +1 -3
- package/.docs/docs/browser/browser-viewer.md +1 -3
- package/.docs/docs/browser/overview.md +2 -1
- package/.docs/docs/browser/recording.md +1 -1
- package/.docs/docs/browser/stagehand.md +1 -1
- package/.docs/docs/capabilities/channels/discord.md +98 -0
- package/.docs/docs/capabilities/channels/other-adapters.md +68 -0
- package/.docs/docs/capabilities/channels/overview.md +255 -0
- package/.docs/docs/capabilities/channels/slack.md +225 -0
- package/.docs/docs/capabilities/channels/teams.md +100 -0
- package/.docs/docs/capabilities/channels/telegram.md +98 -0
- package/.docs/docs/capabilities/channels/whatsapp.md +99 -0
- package/.docs/docs/deployment/mastra-server.md +2 -4
- package/.docs/docs/editor/overview.md +2 -6
- package/.docs/docs/editor/prompts.md +1 -1
- package/.docs/docs/editor/tools.md +3 -5
- package/.docs/docs/evals/built-in-scorers.md +2 -2
- package/.docs/docs/evals/custom-scorers.md +1 -3
- package/.docs/docs/evals/datasets/overview.md +4 -5
- package/.docs/docs/evals/datasets/running-experiments.md +10 -8
- package/.docs/docs/evals/evals-with-memory.md +1 -3
- package/.docs/docs/evals/gates-and-verdicts.md +2 -4
- package/.docs/docs/evals/overview.md +4 -1
- package/.docs/docs/evals/quick-checks.md +3 -5
- package/.docs/docs/getting-started/file-based-agents.md +116 -0
- package/.docs/docs/getting-started/manual-install.md +17 -4
- package/.docs/docs/index.md +1 -1
- package/.docs/docs/long-running-agents/background-tasks.md +3 -3
- package/.docs/docs/long-running-agents/durable-agents.md +5 -7
- package/.docs/docs/long-running-agents/goals.md +5 -7
- package/.docs/docs/long-running-agents/schedules.md +1 -1
- package/.docs/docs/long-running-agents/signal-providers.md +1 -3
- package/.docs/docs/long-running-agents/signals.md +12 -23
- package/.docs/docs/mastra-platform/database.md +2 -2
- package/.docs/docs/mastra-platform/github.md +1 -1
- package/.docs/docs/mastra-platform/observability.md +5 -1
- package/.docs/docs/mcp/mcp-apps.md +3 -3
- package/.docs/docs/mcp/overview.md +6 -10
- package/.docs/docs/memory/memory-processors.md +67 -0
- package/.docs/docs/memory/message-history.md +56 -2
- package/.docs/docs/memory/observational-memory.md +5 -4
- package/.docs/docs/memory/overview.md +8 -6
- package/.docs/docs/memory/semantic-recall.md +36 -2
- package/.docs/docs/memory/working-memory.md +3 -3
- package/.docs/docs/observability/integrations/exporters/mastra-platform.md +1 -3
- package/.docs/docs/observability/integrations/exporters/mastra-storage.md +1 -1
- package/.docs/docs/observability/logging.md +1 -1
- package/.docs/docs/observability/tracing/overview.md +1 -1
- package/.docs/docs/rag/vector-databases.md +7 -2
- package/.docs/docs/server/auth/auth0.md +1 -1
- package/.docs/docs/server/auth/better-auth.md +2 -2
- package/.docs/docs/server/auth/clerk.md +1 -1
- package/.docs/docs/server/auth/firebase.md +1 -1
- package/.docs/docs/server/auth/google.md +3 -3
- package/.docs/docs/server/auth/jwt.md +2 -2
- package/.docs/docs/server/auth/okta.md +2 -2
- package/.docs/docs/server/auth/workos.md +1 -1
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/mastra-server.md +1 -1
- package/.docs/docs/server/pubsub.md +1 -1
- package/.docs/docs/server/request-context.md +4 -4
- package/.docs/docs/server/server-adapters.md +8 -8
- package/.docs/docs/storage/overview.md +214 -0
- package/.docs/docs/studio/auth.md +1 -3
- package/.docs/docs/studio/overview.md +1 -1
- package/.docs/docs/voice/livekit.md +101 -4
- package/.docs/docs/workflows/agents-and-tools.md +3 -5
- package/.docs/docs/workflows/control-flow.md +1 -3
- package/.docs/docs/workflows/overview.md +6 -7
- package/.docs/docs/workflows/snapshots.md +1 -1
- package/.docs/docs/workspace/overview.md +2 -1
- package/.docs/docs/workspace/sandbox.md +2 -0
- package/.docs/guides/build-your-ui/assistant-ui.md +1 -1
- package/.docs/guides/build-your-ui/copilotkit/channels.md +1 -1
- package/.docs/guides/build-your-ui/copilotkit/generative-ui.md +2 -2
- package/.docs/guides/build-your-ui/copilotkit/overview.md +1 -1
- package/.docs/guides/concepts/streaming.md +3 -3
- package/.docs/guides/getting-started/quickstart.md +4 -2
- package/.docs/guides/guide/chef-michel.md +0 -2
- package/.docs/guides/guide/slack-assistant.md +2 -2
- package/.docs/guides/guide/stock-agent.md +0 -2
- package/.docs/models/embeddings.md +119 -0
- package/.docs/models/environment-variables.md +7 -0
- package/.docs/models/gateways/netlify.md +4 -1
- package/.docs/models/gateways/openrouter.md +10 -7
- package/.docs/models/gateways/vercel.md +8 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/abacus.md +44 -14
- package/.docs/models/providers/crossmodel.md +109 -0
- package/.docs/models/providers/empiriolabs.md +106 -0
- package/.docs/models/providers/google.md +2 -1
- package/.docs/models/providers/llmgateway.md +185 -181
- package/.docs/models/providers/meta.md +101 -0
- package/.docs/models/providers/model-oracle-ai.md +87 -0
- package/.docs/models/providers/nano-gpt.md +2 -2
- package/.docs/models/providers/neon.md +40 -29
- package/.docs/models/providers/nvidia.md +1 -3
- package/.docs/models/providers/openai.md +6 -1
- package/.docs/models/providers/opencode.md +6 -2
- package/.docs/models/providers/pioneer.md +148 -0
- package/.docs/models/providers/poolside.md +6 -5
- package/.docs/models/providers/routing-run.md +23 -34
- package/.docs/models/providers/the-grid-ai.md +3 -3
- package/.docs/models/providers/unorouter.md +95 -0
- package/.docs/models/providers/wandb.md +21 -14
- package/.docs/models/providers/xai.md +2 -1
- package/.docs/models/providers/zenifra.md +73 -0
- package/.docs/models/providers.md +7 -0
- package/.docs/reference/agent-controller/agent-controller-class.md +3 -3
- package/.docs/reference/agent-controller/session.md +4 -4
- package/.docs/reference/agents/agent.md +1 -1
- package/.docs/reference/agents/channels.md +2 -2
- package/.docs/reference/agents/inngest-agent.md +1 -1
- package/.docs/reference/agents/listSkills.md +1 -1
- package/.docs/reference/agents/listSuspendedRuns.md +3 -3
- package/.docs/reference/auth/google.md +5 -5
- package/.docs/reference/channels/channel-provider.md +1 -1
- package/.docs/reference/channels/slack-provider.md +3 -3
- package/.docs/reference/cli/mastra.md +119 -12
- package/.docs/reference/code-sdk/mount-agent-controller.md +76 -0
- package/.docs/reference/coding-agent/create-coding-agent.md +1 -1
- package/.docs/reference/configuration.md +1 -1
- package/.docs/reference/evals/checks.md +4 -4
- package/.docs/reference/evals/create-scorer.md +8 -0
- package/.docs/reference/file-based-agents/config.md +97 -0
- package/.docs/reference/file-based-agents/instructions.md +54 -0
- package/.docs/reference/file-based-agents/logger.md +26 -0
- package/.docs/reference/file-based-agents/memory.md +58 -0
- package/.docs/reference/file-based-agents/observability.md +32 -0
- package/.docs/reference/file-based-agents/processors.md +56 -0
- package/.docs/reference/file-based-agents/scorers.md +54 -0
- package/.docs/reference/file-based-agents/server.md +37 -0
- package/.docs/reference/file-based-agents/skills.md +56 -0
- package/.docs/reference/file-based-agents/storage.md +30 -0
- package/.docs/reference/file-based-agents/studio.md +56 -0
- package/.docs/reference/file-based-agents/subagents.md +123 -0
- package/.docs/reference/file-based-agents/tools.md +63 -0
- package/.docs/reference/file-based-agents/workflows.md +52 -0
- package/.docs/reference/file-based-agents/workspace.md +74 -0
- package/.docs/reference/index.md +18 -0
- package/.docs/reference/memory/memory-class.md +1 -1
- package/.docs/reference/memory/observational-memory.md +1 -1
- package/.docs/reference/memory/serialized-memory-config.md +1 -1
- package/.docs/reference/memory/summarizeConversation.md +99 -0
- package/.docs/reference/memory/summarizeThread.md +93 -0
- package/.docs/{docs/getting-started → reference}/project-structure.md +3 -10
- package/.docs/reference/pubsub/lease-provider.md +5 -5
- package/.docs/reference/server/express-adapter.md +1 -3
- package/.docs/reference/server/fastify-adapter.md +1 -3
- package/.docs/reference/server/hono-adapter.md +1 -3
- package/.docs/reference/server/koa-adapter.md +1 -3
- package/.docs/reference/server/nestjs-adapter.md +1 -3
- package/.docs/reference/signals/task-signal-provider.md +1 -1
- package/.docs/reference/storage/clickhouse.md +34 -2
- package/.docs/reference/storage/cloudflare-d1.md +1 -1
- package/.docs/reference/storage/composite.md +64 -6
- package/.docs/reference/storage/convex.md +1 -1
- package/.docs/reference/storage/dynamodb.md +1 -1
- package/.docs/reference/storage/mongodb.md +46 -46
- package/.docs/reference/storage/retention.md +74 -6
- package/.docs/reference/tools/create-tool.md +2 -2
- package/.docs/reference/tools/mcp-client.md +22 -0
- package/.docs/reference/tools/mcp-server.md +161 -4
- package/.docs/reference/vectors/mongodb.md +93 -4
- package/.docs/reference/voice/livekit.md +272 -8
- package/.docs/reference/workspace/agentcore-runtime-sandbox.md +1 -3
- package/.docs/reference/workspace/agentfs-filesystem.md +1 -3
- package/.docs/reference/workspace/apple-container-sandbox.md +6 -8
- package/.docs/reference/workspace/archil-filesystem.md +1 -3
- package/.docs/reference/workspace/azure-blob-filesystem.md +1 -3
- package/.docs/reference/workspace/blaxel-sandbox.md +1 -3
- package/.docs/reference/workspace/daytona-sandbox.md +1 -3
- package/.docs/reference/workspace/docker-sandbox.md +1 -3
- package/.docs/reference/workspace/e2b-sandbox.md +1 -3
- package/.docs/reference/workspace/files-sdk-filesystem.md +1 -3
- package/.docs/reference/workspace/gcs-filesystem.md +1 -3
- package/.docs/reference/workspace/google-drive-filesystem.md +1 -3
- package/.docs/reference/workspace/local-filesystem.md +1 -3
- package/.docs/reference/workspace/local-sandbox.md +1 -3
- package/.docs/reference/workspace/mesa-filesystem.md +4 -4
- package/.docs/reference/workspace/modal-sandbox.md +1 -3
- package/.docs/reference/workspace/railway-sandbox.md +2 -4
- package/.docs/reference/workspace/s3-filesystem.md +1 -3
- package/.docs/reference/workspace/vercel-sandbox.md +5 -7
- package/.docs/reference/workspace/vercel-serverless.md +2 -4
- package/CHANGELOG.md +36 -0
- package/package.json +5 -5
- package/.docs/docs/agents/channels.md +0 -225
- package/.docs/docs/agents/file-based-agents.md +0 -297
- package/.docs/docs/memory/storage.md +0 -267
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# UnoRouter
|
|
4
|
+
|
|
5
|
+
Access 23 UnoRouter models through Mastra's model router. Authentication is handled automatically using the `UNOROUTER_API_KEY` environment variable.
|
|
6
|
+
|
|
7
|
+
Learn more in the [UnoRouter documentation](https://unorouter.com/models).
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
UNOROUTER_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: "unorouter/claude-haiku-4-5-20251001"
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Generate a response
|
|
24
|
+
const response = await agent.generate("Hello!");
|
|
25
|
+
|
|
26
|
+
// Stream a response
|
|
27
|
+
const stream = await agent.stream("Tell me a story");
|
|
28
|
+
for await (const chunk of stream) {
|
|
29
|
+
console.log(chunk);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [UnoRouter documentation](https://unorouter.com/models) for details.
|
|
34
|
+
|
|
35
|
+
## Models
|
|
36
|
+
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| ------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `unorouter/claude-haiku-4-5-20251001` | 200K | | | | | | $1 | $6 |
|
|
40
|
+
| `unorouter/claude-opus-4-8` | 1.0M | | | | | | $0.42 | $2 |
|
|
41
|
+
| `unorouter/claude-sonnet-5` | 1.0M | | | | | | $1 | $7 |
|
|
42
|
+
| `unorouter/deepseek-v4-flash` | 1.0M | | | | | | $0.06 | $0.13 |
|
|
43
|
+
| `unorouter/deepseek-v4-flash:free` | 1.0M | | | | | | — | — |
|
|
44
|
+
| `unorouter/deepseek-v4-pro` | 1.0M | | | | | | $0.90 | $2 |
|
|
45
|
+
| `unorouter/deepseek-v4-pro:free` | 1.0M | | | | | | — | — |
|
|
46
|
+
| `unorouter/gemini-3.5-flash` | 1.0M | | | | | | $0.19 | $1 |
|
|
47
|
+
| `unorouter/gemma-4-31b-it:free` | 262K | | | | | | — | — |
|
|
48
|
+
| `unorouter/glm-4.5-flash:free` | 131K | | | | | | — | — |
|
|
49
|
+
| `unorouter/glm-5.2` | 1.0M | | | | | | $2 | $5 |
|
|
50
|
+
| `unorouter/glm-5.2:free` | 1.0M | | | | | | — | — |
|
|
51
|
+
| `unorouter/gpt-5.2` | 400K | | | | | | $1 | $8 |
|
|
52
|
+
| `unorouter/gpt-5.4` | 1.1M | | | | | | $2 | $11 |
|
|
53
|
+
| `unorouter/gpt-5.4:free` | 1.1M | | | | | | — | — |
|
|
54
|
+
| `unorouter/gpt-5.5` | 1.1M | | | | | | $0.19 | $1 |
|
|
55
|
+
| `unorouter/gpt-5.5:free` | 1.1M | | | | | | — | — |
|
|
56
|
+
| `unorouter/kimi-k2.6` | 262K | | | | | | $1 | $5 |
|
|
57
|
+
| `unorouter/minimax-m2.7` | 205K | | | | | | $0.82 | $3 |
|
|
58
|
+
| `unorouter/minimax-m2.7:free` | 205K | | | | | | — | — |
|
|
59
|
+
| `unorouter/nemotron-3-ultra-550b-a55b:free` | 1.0M | | | | | | — | — |
|
|
60
|
+
| `unorouter/qwen3.5-397b-a17b:free` | 262K | | | | | | — | — |
|
|
61
|
+
| `unorouter/step-3.7-flash:free` | 256K | | | | | | — | — |
|
|
62
|
+
|
|
63
|
+
## Advanced configuration
|
|
64
|
+
|
|
65
|
+
### Custom headers
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
const agent = new Agent({
|
|
69
|
+
id: "custom-agent",
|
|
70
|
+
name: "custom-agent",
|
|
71
|
+
model: {
|
|
72
|
+
url: "https://api.unorouter.com/v1",
|
|
73
|
+
id: "unorouter/claude-haiku-4-5-20251001",
|
|
74
|
+
apiKey: process.env.UNOROUTER_API_KEY,
|
|
75
|
+
headers: {
|
|
76
|
+
"X-Custom-Header": "value"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Dynamic model selection
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
const agent = new Agent({
|
|
86
|
+
id: "dynamic-agent",
|
|
87
|
+
name: "Dynamic Agent",
|
|
88
|
+
model: ({ requestContext }) => {
|
|
89
|
+
const useAdvanced = requestContext.task === "complex";
|
|
90
|
+
return useAdvanced
|
|
91
|
+
? "unorouter/step-3.7-flash:free"
|
|
92
|
+
: "unorouter/claude-haiku-4-5-20251001";
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Weights & Biases
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 25 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
|
|
|
@@ -17,7 +17,7 @@ const agent = new Agent({
|
|
|
17
17
|
id: "my-agent",
|
|
18
18
|
name: "My Agent",
|
|
19
19
|
instructions: "You are a helpful assistant",
|
|
20
|
-
model: "wandb/
|
|
20
|
+
model: "wandb/JetBrains/Mellum2-12B-A2.5B-Instruct"
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
// Generate a response
|
|
@@ -37,23 +37,30 @@ for await (const chunk of stream) {
|
|
|
37
37
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
38
|
| ---------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
39
|
| `wandb/deepseek-ai/DeepSeek-V3.1` | 161K | | | | | | $0.55 | $2 |
|
|
40
|
+
| `wandb/deepseek-ai/DeepSeek-V4-Flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
41
|
+
| `wandb/deepseek-ai/DeepSeek-V4-Pro` | 1.0M | | | | | | $2 | $3 |
|
|
42
|
+
| `wandb/google/gemma-4-31B-it` | 262K | | | | | | $0.12 | $0.35 |
|
|
43
|
+
| `wandb/ibm-granite/granite-4.1-8b` | 131K | | | | | | $0.05 | $0.10 |
|
|
44
|
+
| `wandb/JetBrains/Mellum2-12B-A2.5B-Instruct` | 131K | | | | | | $0.05 | $0.10 |
|
|
40
45
|
| `wandb/meta-llama/Llama-3.1-70B-Instruct` | 128K | | | | | | $0.80 | $0.80 |
|
|
41
46
|
| `wandb/meta-llama/Llama-3.1-8B-Instruct` | 128K | | | | | | $0.22 | $0.22 |
|
|
42
47
|
| `wandb/meta-llama/Llama-3.3-70B-Instruct` | 128K | | | | | | $0.71 | $0.71 |
|
|
43
|
-
| `wandb/meta-llama/Llama-4-Scout-17B-16E-Instruct` | 64K | | | | | | $0.17 | $0.66 |
|
|
44
|
-
| `wandb/microsoft/Phi-4-mini-instruct` | 128K | | | | | | $0.08 | $0.35 |
|
|
45
48
|
| `wandb/MiniMaxAI/MiniMax-M2.5` | 197K | | | | | | $0.30 | $1 |
|
|
46
|
-
| `wandb/moonshotai/Kimi-K2.5` | 262K | | | | | | $0.
|
|
49
|
+
| `wandb/moonshotai/Kimi-K2.5` | 262K | | | | | | $0.60 | $3 |
|
|
50
|
+
| `wandb/moonshotai/Kimi-K2.6` | 262K | | | | | | $0.95 | $4 |
|
|
51
|
+
| `wandb/moonshotai/Kimi-K2.7-Code` | 262K | | | | | | $0.94 | $4 |
|
|
47
52
|
| `wandb/nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-FP8` | 262K | | | | | | $0.20 | $0.80 |
|
|
48
|
-
| `wandb/
|
|
49
|
-
| `wandb/openai/gpt-oss-
|
|
53
|
+
| `wandb/nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B` | 262K | | | | | | $0.75 | $3 |
|
|
54
|
+
| `wandb/openai/gpt-oss-120b` | 131K | | | | | | $0.04 | $0.14 |
|
|
55
|
+
| `wandb/openai/gpt-oss-20b` | 131K | | | | | | $0.03 | $0.13 |
|
|
50
56
|
| `wandb/OpenPipe/Qwen3-14B-Instruct` | 33K | | | | | | $0.05 | $0.22 |
|
|
51
|
-
| `wandb/Qwen/Qwen3-235B-A22B-Instruct-2507` | 262K | | | | | | $0.10 | $0.10 |
|
|
52
|
-
| `wandb/Qwen/Qwen3-235B-A22B-Thinking-2507` | 262K | | | | | | $0.10 | $0.10 |
|
|
53
57
|
| `wandb/Qwen/Qwen3-30B-A3B-Instruct-2507` | 262K | | | | | | $0.10 | $0.30 |
|
|
54
58
|
| `wandb/Qwen/Qwen3-Coder-480B-A35B-Instruct` | 262K | | | | | | $1 | $2 |
|
|
55
|
-
| `wandb/
|
|
56
|
-
| `wandb/
|
|
59
|
+
| `wandb/Qwen/Qwen3.5-35B-A3B` | 262K | | | | | | $0.25 | $1 |
|
|
60
|
+
| `wandb/Qwen/Qwen3.6-27B` | 262K | | | | | | $0.60 | $4 |
|
|
61
|
+
| `wandb/Qwen/Qwen3.6-35B-A3B` | 262K | | | | | | $0.25 | $1 |
|
|
62
|
+
| `wandb/zai-org/GLM-5.1` | 203K | | | | | | $1 | $4 |
|
|
63
|
+
| `wandb/zai-org/GLM-5.2` | 262K | | | | | | $1 | $4 |
|
|
57
64
|
|
|
58
65
|
## Advanced configuration
|
|
59
66
|
|
|
@@ -65,7 +72,7 @@ const agent = new Agent({
|
|
|
65
72
|
name: "custom-agent",
|
|
66
73
|
model: {
|
|
67
74
|
url: "https://api.inference.wandb.ai/v1",
|
|
68
|
-
id: "wandb/
|
|
75
|
+
id: "wandb/JetBrains/Mellum2-12B-A2.5B-Instruct",
|
|
69
76
|
apiKey: process.env.WANDB_API_KEY,
|
|
70
77
|
headers: {
|
|
71
78
|
"X-Custom-Header": "value"
|
|
@@ -83,8 +90,8 @@ const agent = new Agent({
|
|
|
83
90
|
model: ({ requestContext }) => {
|
|
84
91
|
const useAdvanced = requestContext.task === "complex";
|
|
85
92
|
return useAdvanced
|
|
86
|
-
? "wandb/zai-org/GLM-5.
|
|
87
|
-
: "wandb/
|
|
93
|
+
? "wandb/zai-org/GLM-5.2"
|
|
94
|
+
: "wandb/JetBrains/Mellum2-12B-A2.5B-Instruct";
|
|
88
95
|
}
|
|
89
96
|
});
|
|
90
97
|
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# xAI
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 9 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
|
|
|
@@ -38,6 +38,7 @@ for await (const chunk of stream) {
|
|
|
38
38
|
| `xai/grok-4.20-0309-reasoning` | 1.0M | | | | | | $1 | $3 |
|
|
39
39
|
| `xai/grok-4.20-multi-agent-0309` | 1.0M | | | | | | $1 | $3 |
|
|
40
40
|
| `xai/grok-4.3` | 1.0M | | | | | | $1 | $3 |
|
|
41
|
+
| `xai/grok-4.5` | 500K | | | | | | $2 | $6 |
|
|
41
42
|
| `xai/grok-build-0.1` | 256K | | | | | | $1 | $2 |
|
|
42
43
|
| `xai/grok-imagine-image` | 8K | | | | | | — | — |
|
|
43
44
|
| `xai/grok-imagine-image-quality` | 8K | | | | | | — | — |
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Zenifra
|
|
4
|
+
|
|
5
|
+
Access 1 Zenifra model through Mastra's model router. Authentication is handled automatically using the `ZENIFRA_AI_KEY` environment variable.
|
|
6
|
+
|
|
7
|
+
Learn more in the [Zenifra documentation](https://docs.zenifra.com).
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ZENIFRA_AI_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: "zenifra/alibaba/qwen3.6-35b-a3b"
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Generate a response
|
|
24
|
+
const response = await agent.generate("Hello!");
|
|
25
|
+
|
|
26
|
+
// Stream a response
|
|
27
|
+
const stream = await agent.stream("Tell me a story");
|
|
28
|
+
for await (const chunk of stream) {
|
|
29
|
+
console.log(chunk);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Zenifra documentation](https://docs.zenifra.com) for details.
|
|
34
|
+
|
|
35
|
+
## Models
|
|
36
|
+
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| --------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `zenifra/alibaba/qwen3.6-35b-a3b` | 262K | | | | | | $0.19 | $0.48 |
|
|
40
|
+
|
|
41
|
+
## Advanced configuration
|
|
42
|
+
|
|
43
|
+
### Custom headers
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
const agent = new Agent({
|
|
47
|
+
id: "custom-agent",
|
|
48
|
+
name: "custom-agent",
|
|
49
|
+
model: {
|
|
50
|
+
url: "https://ai.zenifra.com/v1",
|
|
51
|
+
id: "zenifra/alibaba/qwen3.6-35b-a3b",
|
|
52
|
+
apiKey: process.env.ZENIFRA_AI_KEY,
|
|
53
|
+
headers: {
|
|
54
|
+
"X-Custom-Header": "value"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Dynamic model selection
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
const agent = new Agent({
|
|
64
|
+
id: "dynamic-agent",
|
|
65
|
+
name: "Dynamic Agent",
|
|
66
|
+
model: ({ requestContext }) => {
|
|
67
|
+
const useAdvanced = requestContext.task === "complex";
|
|
68
|
+
return useAdvanced
|
|
69
|
+
? "zenifra/alibaba/qwen3.6-35b-a3b"
|
|
70
|
+
: "zenifra/alibaba/qwen3.6-35b-a3b";
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
```
|
|
@@ -35,11 +35,13 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
35
35
|
- [Cloudflare Workers AI](https://mastra.ai/models/providers/cloudflare-workers-ai)
|
|
36
36
|
- [Cortecs](https://mastra.ai/models/providers/cortecs)
|
|
37
37
|
- [CrofAI](https://mastra.ai/models/providers/crof)
|
|
38
|
+
- [CrossModel](https://mastra.ai/models/providers/crossmodel)
|
|
38
39
|
- [D.Run (China)](https://mastra.ai/models/providers/drun)
|
|
39
40
|
- [Databricks](https://mastra.ai/models/providers/databricks)
|
|
40
41
|
- [Deep Infra](https://mastra.ai/models/providers/deepinfra)
|
|
41
42
|
- [DigitalOcean](https://mastra.ai/models/providers/digitalocean)
|
|
42
43
|
- [DInference](https://mastra.ai/models/providers/dinference)
|
|
44
|
+
- [EmpirioLabs AI](https://mastra.ai/models/providers/empiriolabs)
|
|
43
45
|
- [evroc](https://mastra.ai/models/providers/evroc)
|
|
44
46
|
- [FastRouter](https://mastra.ai/models/providers/fastrouter)
|
|
45
47
|
- [Fireworks AI](https://mastra.ai/models/providers/fireworks-ai)
|
|
@@ -69,12 +71,14 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
69
71
|
- [LongCat](https://mastra.ai/models/providers/longcat)
|
|
70
72
|
- [LucidQuery](https://mastra.ai/models/providers/lucidquery)
|
|
71
73
|
- [Meganova](https://mastra.ai/models/providers/meganova)
|
|
74
|
+
- [Meta](https://mastra.ai/models/providers/meta)
|
|
72
75
|
- [MiniMax (minimax.io)](https://mastra.ai/models/providers/minimax)
|
|
73
76
|
- [MiniMax (minimaxi.com)](https://mastra.ai/models/providers/minimax-cn)
|
|
74
77
|
- [MiniMax Token Plan (minimax.io)](https://mastra.ai/models/providers/minimax-coding-plan)
|
|
75
78
|
- [MiniMax Token Plan (minimaxi.com)](https://mastra.ai/models/providers/minimax-cn-coding-plan)
|
|
76
79
|
- [Mixlayer](https://mastra.ai/models/providers/mixlayer)
|
|
77
80
|
- [Moark](https://mastra.ai/models/providers/moark)
|
|
81
|
+
- [Model Oracle AI](https://mastra.ai/models/providers/model-oracle-ai)
|
|
78
82
|
- [ModelScope](https://mastra.ai/models/providers/modelscope)
|
|
79
83
|
- [Moonshot AI](https://mastra.ai/models/providers/moonshotai)
|
|
80
84
|
- [Moonshot AI (China)](https://mastra.ai/models/providers/moonshotai-cn)
|
|
@@ -94,6 +98,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
94
98
|
- [OVHcloud AI Endpoints](https://mastra.ai/models/providers/ovhcloud)
|
|
95
99
|
- [Perplexity](https://mastra.ai/models/providers/perplexity)
|
|
96
100
|
- [Perplexity Agent](https://mastra.ai/models/providers/perplexity-agent)
|
|
101
|
+
- [Pioneer](https://mastra.ai/models/providers/pioneer)
|
|
97
102
|
- [Poe](https://mastra.ai/models/providers/poe)
|
|
98
103
|
- [Poolside](https://mastra.ai/models/providers/poolside)
|
|
99
104
|
- [Privatemode AI](https://mastra.ai/models/providers/privatemode-ai)
|
|
@@ -123,6 +128,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
123
128
|
- [TrustedRouter](https://mastra.ai/models/providers/trustedrouter)
|
|
124
129
|
- [Umans AI](https://mastra.ai/models/providers/umans-ai)
|
|
125
130
|
- [Umans AI Coding Plan](https://mastra.ai/models/providers/umans-ai-coding-plan)
|
|
131
|
+
- [UnoRouter](https://mastra.ai/models/providers/unorouter)
|
|
126
132
|
- [Upstage](https://mastra.ai/models/providers/upstage)
|
|
127
133
|
- [Vivgrid](https://mastra.ai/models/providers/vivgrid)
|
|
128
134
|
- [Vultr](https://mastra.ai/models/providers/vultr)
|
|
@@ -136,6 +142,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
136
142
|
- [Z.AI](https://mastra.ai/models/providers/zai)
|
|
137
143
|
- [Z.AI Coding Plan](https://mastra.ai/models/providers/zai-coding-plan)
|
|
138
144
|
- [Zeldoc](https://mastra.ai/models/providers/zeldoc)
|
|
145
|
+
- [Zenifra](https://mastra.ai/models/providers/zenifra)
|
|
139
146
|
- [ZenMux](https://mastra.ai/models/providers/zenmux)
|
|
140
147
|
- [Zhipu AI](https://mastra.ai/models/providers/zhipuai)
|
|
141
148
|
- [Zhipu AI Coding Plan](https://mastra.ai/models/providers/zhipuai-coding-plan)
|
|
@@ -174,7 +174,7 @@ await agentController.init()
|
|
|
174
174
|
|
|
175
175
|
Create a new, fully-wired `Session` and bring it online. The session starts in the default mode with the seeded model, connects to the AgentController's shared machinery (agent, storage/lock, config catalog), and has a current thread (the most recent thread for the resource, or a freshly created one). Call `init()` once before creating sessions so shared storage is ready.
|
|
176
176
|
|
|
177
|
-
The AgentController owns no session of its own — every consumer creates its own session and drives all work through it.
|
|
177
|
+
The AgentController owns no session of its own — every consumer creates its own session and drives all work through it. A `resourceId` maps to exactly one session per AgentController (get-or-create): calling `createSession` with the same `resourceId` returns the existing session, so reconnects resume rather than fork the conversation. Different `resourceId`s produce independent sessions with isolated event bus, mode, model, state, and current thread. Use `session.thread.create()` and `session.thread.switch()` to manage multiple conversations within one session.
|
|
178
178
|
|
|
179
179
|
`id` and `ownerId` are required — they mirror `SessionRecord.id` and `SessionRecord.ownerId` and are stable for the life of the session. `resourceId` is optional and defaults to `config.resourceId` then `config.id`.
|
|
180
180
|
|
|
@@ -270,7 +270,7 @@ const mastra = agentController.getMastra()
|
|
|
270
270
|
|
|
271
271
|
#### `getWorkspace()`
|
|
272
272
|
|
|
273
|
-
Return the AgentController-level workspace if it
|
|
273
|
+
Return the AgentController-level workspace if it's a static `Workspace` instance. Dynamic factory workspaces aren't resolved here — use [`resolveWorkspace()`](#resolveworkspace-session-requestcontext-) to resolve a factory against a session's request context.
|
|
274
274
|
|
|
275
275
|
```typescript
|
|
276
276
|
const workspace = agentController.getWorkspace()
|
|
@@ -478,7 +478,7 @@ Responding to a pending tool approval is owned by the session — see [`session.
|
|
|
478
478
|
|
|
479
479
|
Respond to a pending tool suspension. Interactive built-in tools such as `ask_user` and `request_access` pause through the native tool-suspension primitive, which emits a `tool_suspended` event carrying `toolCallId`, `toolName`, and `suspendPayload`. Pass `resumeData` to resume the suspended tool with the user's response.
|
|
480
480
|
|
|
481
|
-
Provide `toolCallId` to select which suspension to resume. It
|
|
481
|
+
Provide `toolCallId` to select which suspension to resume. It's required when more than one tool is suspended at the same time (for example, parallel `ask_user` calls). When omitted, it resolves to the sole pending suspension.
|
|
482
482
|
|
|
483
483
|
```typescript
|
|
484
484
|
agentController.subscribe(event => {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **Beta:** The `AgentController` feature is in beta stage and subject to breaking changes in minor versions until it graduates from its beta status.
|
|
6
6
|
|
|
7
|
-
A `Session` owns all the state tied to a single conversation. The [`AgentController`](https://mastra.ai/reference/agent-controller/agent-controller-class) is the shared host — agents, storage, config, the thread lock, and the event bus — while the `Session` holds everything that
|
|
7
|
+
A `Session` owns all the state tied to a single conversation. The [`AgentController`](https://mastra.ai/reference/agent-controller/agent-controller-class) is the shared host — agents, storage, config, the thread lock, and the event bus — while the `Session` holds everything that's per-conversation: identity, the active thread binding and reads, mode and model selection, run and abort state, the live agent stream, tool suspensions, follow-ups, approvals, permission grants, token usage, and the display-state snapshot.
|
|
8
8
|
|
|
9
9
|
Access the session through `agentController.session`.
|
|
10
10
|
|
|
@@ -129,7 +129,7 @@ const usage = agentController.session.getTokenUsage()
|
|
|
129
129
|
|
|
130
130
|
## Identity
|
|
131
131
|
|
|
132
|
-
`session.identity` owns the stable identifiers for the conversation: the resource ID, a session `id`, and an `ownerId`. The `id` and `ownerId` are stable for the life of the session and
|
|
132
|
+
`session.identity` owns the stable identifiers for the conversation: the resource ID, a session `id`, and an `ownerId`. The `id` and `ownerId` are stable for the life of the session and don't change when the resource ID is switched. They mirror the `id` and `ownerId` fields on `SessionRecord` in storage.
|
|
133
133
|
|
|
134
134
|
### `session.identity.getId()`
|
|
135
135
|
|
|
@@ -163,7 +163,7 @@ Return the resource ID the session was created with.
|
|
|
163
163
|
const defaultResourceId = agentController.session.identity.getDefaultResourceId()
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
-
To change the resource ID, use [`agentController.setResourceId()`](https://mastra.ai/reference/agent-controller/agent-controller-class), which also tears down the active thread. The session `id` and `ownerId`
|
|
166
|
+
To change the resource ID, use [`agentController.setResourceId()`](https://mastra.ai/reference/agent-controller/agent-controller-class), which also tears down the active thread. The session `id` and `ownerId` aren't affected by resource switches.
|
|
167
167
|
|
|
168
168
|
## Thread
|
|
169
169
|
|
|
@@ -534,7 +534,7 @@ const displayState = agentController.session.displayState.get()
|
|
|
534
534
|
|
|
535
535
|
### `session.displayState.restoreTasks(tasks)`
|
|
536
536
|
|
|
537
|
-
Restore the task portion of the snapshot after a UI replays persisted task tool history. This is a pure update of the snapshot and
|
|
537
|
+
Restore the task portion of the snapshot after a UI replays persisted task tool history. This is a pure update of the snapshot and doesn't emit an event, so re-render explicitly after calling it.
|
|
538
538
|
|
|
539
539
|
```typescript
|
|
540
540
|
agentController.session.displayState.restoreTasks(replayedTasks)
|
|
@@ -481,7 +481,7 @@ Returns an `AgentThreadSubscription` object with these members:
|
|
|
481
481
|
|
|
482
482
|
## `generate()` memory options
|
|
483
483
|
|
|
484
|
-
Pass `memory` when you call `agent.generate()` to choose which conversation thread the run should read from and write to. The common shape is `memory: { resource: string, thread: string }`, where `resource` identifies the owner and `thread` identifies the conversation. See [Threads and resources](https://mastra.ai/docs/memory/
|
|
484
|
+
Pass `memory` when you call `agent.generate()` to choose which conversation thread the run should read from and write to. The common shape is `memory: { resource: string, thread: string }`, where `resource` identifies the owner and `thread` identifies the conversation. See [Threads and resources](https://mastra.ai/docs/memory/message-history) for the concept model.
|
|
485
485
|
|
|
486
486
|
```typescript
|
|
487
487
|
const response = await agent.generate('What did we decide about retries?', {
|
|
@@ -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
|
|
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/capabilities/channels/overview) for concepts and platform setup instructions.
|
|
8
8
|
|
|
9
9
|
## Usage example
|
|
10
10
|
|
|
@@ -291,6 +291,6 @@ type InlineLinkEntry =
|
|
|
291
291
|
|
|
292
292
|
## Related
|
|
293
293
|
|
|
294
|
-
- [Channels
|
|
294
|
+
- [Channels overview](https://mastra.ai/docs/capabilities/channels/overview): Concepts, quickstart, and platform setup
|
|
295
295
|
- [Agent class](https://mastra.ai/reference/agents/agent): Constructor parameters and methods
|
|
296
296
|
- [Chat SDK adapters](https://chat-sdk.dev/adapters): Adapter configuration and platform setup
|
|
@@ -165,7 +165,7 @@ const { output, cleanup } = await durableAgent.observe(runId, {
|
|
|
165
165
|
await output.text
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
The result from `observe()`
|
|
168
|
+
The result from `observe()` doesn't include `threadId` or `resourceId`.
|
|
169
169
|
|
|
170
170
|
Returns: `Promise<Omit<InngestAgentStreamResult, 'threadId' | 'resourceId'>>`
|
|
171
171
|
|
|
@@ -46,7 +46,7 @@ interface SkillMetadata {
|
|
|
46
46
|
|
|
47
47
|
## Merging behavior
|
|
48
48
|
|
|
49
|
-
When both agent-level skills and workspace skills are configured, `.listSkills()` returns the merged set. Agent-level skills take precedence on name conflicts — if both define a skill named `code-review`, only the agent-level version
|
|
49
|
+
When both agent-level skills and workspace skills are configured, `.listSkills()` returns the merged set. Agent-level skills take precedence on name conflicts — if both define a skill named `code-review`, only the agent-level version is returned.
|
|
50
50
|
|
|
51
51
|
## Related
|
|
52
52
|
|
|
@@ -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
|
|
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/agent-approval) 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/
|
|
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/overview) configured. With the default in-memory store, snapshots are lost on restart.
|
|
89
89
|
|
|
90
90
|
## Related
|
|
91
91
|
|
|
92
92
|
- [Agent approval](https://mastra.ai/docs/agents/agent-approval)
|
|
93
|
-
- [Storage](https://mastra.ai/docs/
|
|
93
|
+
- [Storage](https://mastra.ai/docs/storage/overview)
|
|
@@ -75,7 +75,7 @@ The following environment variables are automatically used when constructor opti
|
|
|
75
75
|
1. **Session cookie**: When SSO is enabled, reads the encrypted session cookie and decrypts it. If the session is valid and not expired, the user is authenticated.
|
|
76
76
|
2. **Google ID token fallback**: If no valid session cookie is present, verifies the `Authorization` header token against Google's JWKS endpoint.
|
|
77
77
|
|
|
78
|
-
After authentication, `authorizeUser` checks that the user has a valid Google user ID, the token-derived expiration
|
|
78
|
+
After authentication, `authorizeUser` checks that the user has a valid Google user ID, the token-derived expiration hasn't passed, and the user's verified `hd` claim matches `allowedDomains` when domains are configured.
|
|
79
79
|
|
|
80
80
|
### Authentication methods
|
|
81
81
|
|
|
@@ -101,7 +101,7 @@ Returns: `Promise<GoogleUser | null>`
|
|
|
101
101
|
|
|
102
102
|
#### `authorizeUser(user)`
|
|
103
103
|
|
|
104
|
-
Returns `true` when the user has an ID,
|
|
104
|
+
Returns `true` when the user has an ID, hasn't expired, and matches `allowedDomains` when domains are configured.
|
|
105
105
|
|
|
106
106
|
```typescript
|
|
107
107
|
const allowed = auth.authorizeUser(user)
|
|
@@ -111,7 +111,7 @@ Returns: `boolean`
|
|
|
111
111
|
|
|
112
112
|
#### `getUser(userId)`
|
|
113
113
|
|
|
114
|
-
Returns `null`. Google ID tokens are verified directly, so this provider
|
|
114
|
+
Returns `null`. Google ID tokens are verified directly, so this provider doesn't perform user lookup by ID.
|
|
115
115
|
|
|
116
116
|
```typescript
|
|
117
117
|
const user = await auth.getUser(userId)
|
|
@@ -348,9 +348,9 @@ Returns: `{ size: number; maxSize: number }`
|
|
|
348
348
|
|
|
349
349
|
`MastraRBACGoogle` uses `GET https://admin.googleapis.com/admin/directory/v1/groups?userKey=...` and handles pagination. Provide a service account with domain-wide delegation for production Google Workspace deployments, or pass `accessToken` / `getAccessToken` if your application already manages Google API tokens.
|
|
350
350
|
|
|
351
|
-
If `user.groups` is already an array, `MastraRBACGoogle` uses that value and
|
|
351
|
+
If `user.groups` is already an array, `MastraRBACGoogle` uses that value and doesn't call the Directory API. An empty `groups` array means the user has no Google group roles and resolves to `_default` permissions when `_default` is configured.
|
|
352
352
|
|
|
353
|
-
`MastraRBACGoogle`
|
|
353
|
+
`MastraRBACGoogle` doesn't automatically read service-account environment variables. Pass service-account credentials through the `serviceAccount` option, or pass `accessToken` / `getAccessToken`.
|
|
354
354
|
|
|
355
355
|
## Related
|
|
356
356
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# SlackProvider
|
|
4
4
|
|
|
5
|
-
`SlackProvider` is the managed path for connecting agents to Slack. Register it on `Mastra.channels` and it provisions Slack apps via the Manifest API, runs the OAuth install flow, rotates configuration tokens, and routes Slack events to your agents. Use it when you want Mastra to own app creation and installation. For the lower-level path where you create the Slack app and configure scopes and webhooks yourself, use [`createSlackAdapter`](https://mastra.ai/docs/
|
|
5
|
+
`SlackProvider` is the managed path for connecting agents to Slack. Register it on `Mastra.channels` and it provisions Slack apps via the Manifest API, runs the OAuth install flow, rotates configuration tokens, and routes Slack events to your agents. Use it when you want Mastra to own app creation and installation. For the lower-level path where you create the Slack app and configure scopes and webhooks yourself, use [`createSlackAdapter`](https://mastra.ai/docs/capabilities/channels/slack) on the agent's `channels.adapters` instead.
|
|
6
6
|
|
|
7
7
|
## Usage example
|
|
8
8
|
|
|
@@ -171,7 +171,7 @@ slack.setBaseUrl('https://abc123.trycloudflare.com')
|
|
|
171
171
|
|
|
172
172
|
#### `initialize()`
|
|
173
173
|
|
|
174
|
-
Recreates a `SlackAdapter` for each active installation in storage and injects `AgentChannels` into the corresponding agent so it receives Slack events on startup.
|
|
174
|
+
Recreates a `SlackAdapter` for each active installation in storage and injects `AgentChannels` into the corresponding agent so it receives Slack events on startup. Doesn't auto-provision new apps; use `connect()` to create one. Mastra calls this automatically, so you rarely call it directly.
|
|
175
175
|
|
|
176
176
|
```typescript
|
|
177
177
|
await slack.initialize()
|
|
@@ -224,5 +224,5 @@ const result = await slack.connect('support-agent')
|
|
|
224
224
|
## Related
|
|
225
225
|
|
|
226
226
|
- [ChannelProvider](https://mastra.ai/reference/channels/channel-provider): the interface `SlackProvider` implements
|
|
227
|
-
- [Channels](https://mastra.ai/docs/
|
|
227
|
+
- [Channels](https://mastra.ai/docs/capabilities/channels/overview): concepts, platform setup, and the `createSlackAdapter` path
|
|
228
228
|
- [Channels reference](https://mastra.ai/reference/agents/channels): the `channels` config on the `Agent` constructor
|