@mastra/mcp-docs-server 1.3.5-alpha.9 → 1.3.6-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/docs/agents/code-mode.md +0 -2
- package/.docs/docs/agents/overview.md +1 -1
- package/.docs/docs/agents/processors.md +10 -0
- package/.docs/docs/agents/tools.md +17 -0
- package/.docs/docs/auth/composite-auth.md +1 -1
- package/.docs/docs/auth/custom-auth-provider.md +28 -22
- package/.docs/docs/auth/jwt.md +1 -1
- package/.docs/docs/auth/overview.md +2 -2
- package/.docs/docs/auth/simple-auth.md +6 -1
- package/.docs/docs/browser.md +1 -2
- package/.docs/docs/channels.md +4 -0
- package/.docs/docs/deployment/overview.md +1 -1
- package/.docs/docs/deployment/web-framework.md +1 -1
- package/.docs/docs/develop.md +1 -3
- package/.docs/docs/evals/built-in-scorers.md +2 -2
- package/.docs/docs/evals/experiments.md +3 -0
- package/.docs/docs/guides/context-engineering.md +0 -2
- package/.docs/docs/guides/overview.md +15 -0
- package/.docs/docs/harness/agent-controller.md +7 -12
- package/.docs/docs/harness/goals.md +1 -3
- package/.docs/docs/harness/schedules.md +0 -2
- package/.docs/docs/harness/signal-providers.md +1 -3
- package/.docs/docs/harness/signals.md +0 -2
- package/.docs/docs/mastra-platform/configuration.md +1 -1
- package/.docs/docs/mastra-platform/connect/channels.md +153 -0
- package/.docs/docs/mastra-platform/connect/overview.md +102 -0
- package/.docs/docs/mastra-platform/connect/providers.md +149 -0
- package/.docs/docs/mastra-platform/connect/tools.md +129 -0
- package/.docs/docs/mastra-platform/environments.md +1 -1
- package/.docs/docs/mastra-platform/observability.md +1 -1
- package/.docs/docs/mastra-platform/overview.md +2 -0
- package/.docs/docs/memory/observational-memory.md +2 -0
- package/.docs/docs/observability/feedback.md +20 -0
- package/.docs/docs/observability/overview.md +0 -5
- package/.docs/docs/observability/tracing/overview.md +30 -0
- package/.docs/docs/sandbox/filesystem.md +12 -12
- package/.docs/docs/studio/observability.md +1 -1
- package/.docs/docs/workflows/error-handling.md +2 -0
- package/.docs/integrations/observability/langfuse.md +2 -0
- package/.docs/integrations/voice/livekit.md +449 -2
- package/.docs/models/gateways/netlify.md +1 -1
- package/.docs/models/gateways/openrouter.md +3 -4
- package/.docs/models/gateways/vercel.md +9 -3
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/aki-io.md +12 -12
- package/.docs/models/providers/edenai.md +15 -12
- package/.docs/models/providers/kilo.md +13 -15
- package/.docs/models/providers/llmgateway-providers.md +7 -2
- package/.docs/models/providers/llmgateway.md +5 -3
- package/.docs/models/providers/mistral.md +7 -6
- package/.docs/models/providers/nano-gpt.md +12 -3
- package/.docs/models/providers/opencode-go.md +2 -2
- package/.docs/models/providers/opencode.md +3 -1
- package/.docs/models/providers/requesty.md +3 -1
- package/.docs/models/providers/the-grid-ai.md +19 -12
- package/.docs/models/providers/wandb.md +4 -13
- package/.docs/reference/agent-controller/agent-controller-class.md +2 -4
- package/.docs/reference/agent-controller/session.md +18 -13
- package/.docs/reference/agents/createSkill.md +1 -2
- package/.docs/reference/agents/durable-agent.md +2 -0
- package/.docs/reference/agents/generate.md +4 -0
- package/.docs/reference/agents/getModel.md +1 -1
- package/.docs/reference/agents/getSkill.md +6 -1
- package/.docs/reference/agents/listSkills.md +0 -1
- package/.docs/reference/agents/network.md +2 -0
- package/.docs/reference/ai-sdk/chat-route.md +4 -0
- package/.docs/reference/ai-sdk/handle-chat-stream.md +3 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +3 -1
- package/.docs/reference/auth/jwt.md +1 -1
- package/.docs/reference/auth/supabase.md +1 -1
- package/.docs/reference/browser/mastra-browser.md +13 -11
- package/.docs/reference/channels/slack-provider.md +1 -1
- package/.docs/reference/cli/create-mastra.md +1 -1
- package/.docs/reference/cli/mastra.md +60 -5
- package/.docs/reference/client-js/agent-controller.md +19 -3
- package/.docs/reference/client-js/agents.md +1 -1
- package/.docs/reference/client-js/conversations.md +1 -1
- package/.docs/reference/client-js/mastra-client.md +2 -2
- package/.docs/reference/client-js/observability.md +28 -0
- package/.docs/reference/client-js/workflows.md +18 -2
- package/.docs/reference/code-sdk/mount-agent-controller.md +1 -3
- package/.docs/reference/connect/channels.md +91 -0
- package/.docs/reference/connect/credential.md +63 -0
- package/.docs/reference/connect/providers.md +1059 -0
- package/.docs/reference/connect/tools.md +157 -0
- package/.docs/reference/core/mastra-model-gateway.md +10 -2
- package/.docs/reference/datasets/addItem.md +2 -2
- package/.docs/reference/datasets/datasets-manager.md +1 -0
- package/.docs/reference/datasets/delete.md +1 -1
- package/.docs/reference/datasets/getExperiment.md +5 -1
- package/.docs/reference/datasets/startExperimentAsync.md +1 -0
- package/.docs/reference/editor/prompt-blocks.md +41 -0
- package/.docs/reference/editor/tool-provider.md +19 -0
- package/.docs/reference/file-based-agents/config.md +0 -2
- package/.docs/reference/file-based-agents/instructions.md +0 -2
- package/.docs/reference/file-based-agents/logger.md +0 -2
- package/.docs/reference/file-based-agents/memory.md +0 -2
- package/.docs/reference/file-based-agents/observability.md +0 -2
- package/.docs/reference/file-based-agents/processors.md +0 -2
- package/.docs/reference/file-based-agents/schedules.md +0 -2
- package/.docs/reference/file-based-agents/scorers.md +0 -2
- package/.docs/reference/file-based-agents/server.md +0 -2
- package/.docs/reference/file-based-agents/skills.md +0 -2
- package/.docs/reference/file-based-agents/storage.md +0 -2
- package/.docs/reference/file-based-agents/studio.md +0 -2
- package/.docs/reference/file-based-agents/subagents.md +0 -2
- package/.docs/reference/file-based-agents/tools.md +0 -2
- package/.docs/reference/file-based-agents/workflows.md +0 -2
- package/.docs/reference/file-based-agents/workspace.md +0 -2
- package/.docs/reference/index.md +4 -0
- package/.docs/reference/memory/observational-memory.md +2 -0
- package/.docs/reference/observability/tracing/exporters/posthog.md +9 -2
- package/.docs/reference/observability/tracing/interfaces.md +69 -2
- package/.docs/reference/observability/tracing/trace-query.md +111 -24
- package/.docs/reference/schedules/overview.md +0 -2
- package/.docs/reference/signals/create-notification-inbox-tool.md +0 -2
- package/.docs/reference/signals/signal-provider.md +1 -3
- package/.docs/reference/signals/task-signal-provider.md +1 -1
- package/.docs/reference/signals/webhook-signal-provider.md +1 -3
- package/.docs/reference/streaming/ChunkType.md +2 -0
- package/.docs/reference/streaming/agents/stream.md +2 -0
- package/.docs/reference/streaming/workflows/resumeStream.md +2 -0
- package/.docs/reference/streaming/workflows/stream.md +2 -0
- package/.docs/reference/tools/ask-user-tool.md +5 -1
- package/.docs/reference/tools/create-code-mode.md +0 -2
- package/.docs/reference/tools/create-tool.md +2 -0
- package/.docs/reference/tools/mcp-server.md +8 -2
- package/.docs/reference/vectors/lance.md +56 -10
- package/.docs/reference/workflows/run-methods/restart.md +2 -0
- package/.docs/reference/workflows/run-methods/resume.md +2 -0
- package/.docs/reference/workflows/run-methods/start.md +2 -0
- package/.docs/reference/workflows/run-methods/timeTravel.md +2 -0
- package/package.json +6 -6
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# OpenCode Go
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 34 OpenCode Go models through Mastra's model router. Authentication is handled automatically using the `OPENCODE_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [OpenCode Go documentation](https://opencode.ai/docs/go).
|
|
10
10
|
|
|
@@ -66,7 +66,7 @@ for await (const chunk of stream) {
|
|
|
66
66
|
| `opencode-go/qwen3.7-plus` | 1.0M | | | | | | $0.40 | $2 |
|
|
67
67
|
| `opencode-go/qwen3.8-flash` | 1.0M | | | | | | $0.15 | $0.47 |
|
|
68
68
|
| `opencode-go/qwen3.8-max` | 1.0M | | | | | | $2 | $6 |
|
|
69
|
-
| `opencode-go/space-bunny
|
|
69
|
+
| `opencode-go/space-bunny` | 1.0M | | | | | | $0.15 | $0.60 |
|
|
70
70
|
|
|
71
71
|
Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
|
|
72
72
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# OpenCode Zen
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 118 OpenCode Zen models through Mastra's model router. Authentication is handled automatically using the `OPENCODE_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [OpenCode Zen documentation](https://opencode.ai/docs/zen).
|
|
10
10
|
|
|
@@ -57,6 +57,7 @@ for await (const chunk of stream) {
|
|
|
57
57
|
| `opencode/deepseek-v4-flash-vision-exp` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
58
58
|
| `opencode/deepseek-v4-pro` | 1.0M | | | | | | $2 | $4 |
|
|
59
59
|
| `opencode/deepseek-v4.1-flash` | 1.0M | | | | | | $0.30 | $1 |
|
|
60
|
+
| `opencode/exo-free` | 1.0M | | | | | | — | — |
|
|
60
61
|
| `opencode/fledge-alpha-free` | 1.0M | | | | | | — | — |
|
|
61
62
|
| `opencode/gemini-3-flash` | 1.0M | | | | | | $0.50 | $3 |
|
|
62
63
|
| `opencode/gemini-3.1-pro` | 1.0M | | | | | | $2 | $12 |
|
|
@@ -109,6 +110,7 @@ for await (const chunk of stream) {
|
|
|
109
110
|
| `opencode/minimax-m2.5` | 205K | | | | | | $0.30 | $1 |
|
|
110
111
|
| `opencode/minimax-m2.7` | 205K | | | | | | $0.30 | $1 |
|
|
111
112
|
| `opencode/minimax-m3` | 512K | | | | | | $0.30 | $1 |
|
|
113
|
+
| `opencode/mistral-large-4` | 524K | | | | | | $0.68 | $2 |
|
|
112
114
|
| `opencode/muse-spark-1.2` | 1.0M | | | | | | $1 | $4 |
|
|
113
115
|
| `opencode/muse-spark-1.3` | 1.0M | | | | | | $1 | $4 |
|
|
114
116
|
| `opencode/muse-spark-1.3-contributor-free` | 1.0M | | | | | | — | — |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Requesty
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 168 Requesty models through Mastra's model router. Authentication is handled automatically using the `REQUESTY_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Requesty documentation](https://requesty.ai/solution/llm-routing/models).
|
|
10
10
|
|
|
@@ -167,6 +167,8 @@ for await (const chunk of stream) {
|
|
|
167
167
|
| `requesty/minimax-m2.7-highspeed` | 200K | | | | | | $0.60 | $2 |
|
|
168
168
|
| `requesty/minimax-m3` | 1.0M | | | | | | $0.30 | $1 |
|
|
169
169
|
| `requesty/minimax-m3@eu` | 1.0M | | | | | | $0.40 | $2 |
|
|
170
|
+
| `requesty/mistral-large-4` | 1.0M | | | | | | $0.68 | $2 |
|
|
171
|
+
| `requesty/mistral-large-4@eu` | 1.0M | | | | | | $0.68 | $2 |
|
|
170
172
|
| `requesty/mistral-medium-3-5` | 262K | | | | | | $2 | $8 |
|
|
171
173
|
| `requesty/mistral-medium-3-5@eu` | 262K | | | | | | $2 | $8 |
|
|
172
174
|
| `requesty/mistral-medium-latest` | 131K | | | | | | $0.44 | $2 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# The Grid AI
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 16 The Grid AI models through Mastra's model router. Authentication is handled automatically using the `THEGRID_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [The Grid AI documentation](https://thegrid.ai/docs).
|
|
10
10
|
|
|
@@ -36,17 +36,24 @@ for await (const chunk of stream) {
|
|
|
36
36
|
|
|
37
37
|
## Models
|
|
38
38
|
|
|
39
|
-
| Model
|
|
40
|
-
|
|
|
41
|
-
| `the-grid-ai/agent-max`
|
|
42
|
-
| `the-grid-ai/agent-prime`
|
|
43
|
-
| `the-grid-ai/agent-standard`
|
|
44
|
-
| `the-grid-ai/
|
|
45
|
-
| `the-grid-ai/
|
|
46
|
-
| `the-grid-ai/code-
|
|
47
|
-
| `the-grid-ai/
|
|
48
|
-
| `the-grid-ai/
|
|
49
|
-
| `the-grid-ai/
|
|
39
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
40
|
+
| ---------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
41
|
+
| `the-grid-ai/agent-max` | 1.0M | | | | | | — | — |
|
|
42
|
+
| `the-grid-ai/agent-prime` | 197K | | | | | | — | — |
|
|
43
|
+
| `the-grid-ai/agent-standard` | 128K | | | | | | — | — |
|
|
44
|
+
| `the-grid-ai/bytedance-pro-latest` | 262K | | | | | | — | — |
|
|
45
|
+
| `the-grid-ai/claude-opus-latest` | 1.0M | | | | | | — | — |
|
|
46
|
+
| `the-grid-ai/code-max` | 1.0M | | | | | | — | — |
|
|
47
|
+
| `the-grid-ai/code-prime` | 197K | | | | | | — | — |
|
|
48
|
+
| `the-grid-ai/code-standard` | 128K | | | | | | — | — |
|
|
49
|
+
| `the-grid-ai/deepseek-pro-latest` | 1.0M | | | | | | — | — |
|
|
50
|
+
| `the-grid-ai/gemini-pro-latest` | 1.0M | | | | | | — | — |
|
|
51
|
+
| `the-grid-ai/glm-latest` | 1.0M | | | | | | — | — |
|
|
52
|
+
| `the-grid-ai/gpt-sol-latest` | 1.0M | | | | | | — | — |
|
|
53
|
+
| `the-grid-ai/minimax-latest` | 1.0M | | | | | | — | — |
|
|
54
|
+
| `the-grid-ai/text-max` | 1.0M | | | | | | — | — |
|
|
55
|
+
| `the-grid-ai/text-prime` | 197K | | | | | | — | — |
|
|
56
|
+
| `the-grid-ai/text-standard` | 128K | | | | | | — | — |
|
|
50
57
|
|
|
51
58
|
Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
|
|
52
59
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# CoreWeave
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 20 CoreWeave models through Mastra's model router. Authentication is handled automatically using the `WANDB_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [CoreWeave documentation](https://docs.wandb.ai).
|
|
10
10
|
|
|
@@ -19,7 +19,7 @@ const agent = new Agent({
|
|
|
19
19
|
id: "my-agent",
|
|
20
20
|
name: "My Agent",
|
|
21
21
|
instructions: "You are a helpful assistant",
|
|
22
|
-
model: "wandb/
|
|
22
|
+
model: "wandb/MiniMaxAI/MiniMax-M3"
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
// Generate a response
|
|
@@ -39,17 +39,12 @@ for await (const chunk of stream) {
|
|
|
39
39
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
40
40
|
| ---------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
41
41
|
| `wandb/deepseek-ai/DeepSeek-V3.1` | 161K | | | | | | $0.55 | $2 |
|
|
42
|
-
| `wandb/deepseek-ai/DeepSeek-V4-Flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
43
42
|
| `wandb/deepseek-ai/DeepSeek-V4-Flash-0731` | 262K | | | | | | $0.13 | $0.28 |
|
|
44
|
-
| `wandb/deepseek-ai/DeepSeek-V4-Pro` | 1.0M | | | | | | $1 | $3 |
|
|
45
43
|
| `wandb/deepseek-ai/DeepSeek-V4-Pro-0813` | 1.0M | | | | | | $1 | $4 |
|
|
46
44
|
| `wandb/deepseek-ai/DeepSeek-V4.1-Flash` | 1.0M | | | | | | $0.20 | $0.65 |
|
|
47
45
|
| `wandb/google/gemma-4-26B-A4B-it` | 262K | | | | | | $0.10 | $0.30 |
|
|
48
46
|
| `wandb/google/gemma-4-31B-it` | 262K | | | | | | $0.10 | $0.34 |
|
|
49
|
-
| `wandb/ibm-granite/granite-4.1-8b` | 131K | | | | | | $0.05 | $0.10 |
|
|
50
47
|
| `wandb/ibm-granite/granite-4.2-8b` | 131K | | | | | | $0.10 | $0.15 |
|
|
51
|
-
| `wandb/JetBrains/Mellum2-12B-A2.5B-Instruct` | 131K | | | | | | $0.05 | $0.10 |
|
|
52
|
-
| `wandb/meta-llama/Llama-3.1-70B-Instruct` | 131K | | | | | | $0.80 | $0.80 |
|
|
53
48
|
| `wandb/meta-llama/Llama-3.1-8B-Instruct` | 131K | | | | | | $0.22 | $0.22 |
|
|
54
49
|
| `wandb/meta-llama/Llama-3.3-70B-Instruct` | 128K | | | | | | $0.71 | $0.71 |
|
|
55
50
|
| `wandb/MiniMaxAI/MiniMax-M3` | 262K | | | | | | $0.23 | $0.96 |
|
|
@@ -59,10 +54,6 @@ for await (const chunk of stream) {
|
|
|
59
54
|
| `wandb/nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B` | 262K | | | | | | $0.07 | $0.20 |
|
|
60
55
|
| `wandb/openai/gpt-oss-120b` | 131K | | | | | | $0.03 | $0.17 |
|
|
61
56
|
| `wandb/openai/gpt-oss-20b` | 131K | | | | | | $0.03 | $0.13 |
|
|
62
|
-
| `wandb/OpenPipe/Qwen3-14B-Instruct` | 33K | | | | | | $0.05 | $0.22 |
|
|
63
|
-
| `wandb/Qwen/Qwen3-30B-A3B-Instruct-2507` | 262K | | | | | | $0.10 | $0.30 |
|
|
64
|
-
| `wandb/Qwen/Qwen3.5-35B-A3B` | 262K | | | | | | $0.25 | $1 |
|
|
65
|
-
| `wandb/Qwen/Qwen3.6-27B` | 262K | | | | | | $0.60 | $4 |
|
|
66
57
|
| `wandb/Qwen/Qwen3.6-35B-A3B` | 262K | | | | | | $0.25 | $1 |
|
|
67
58
|
| `wandb/Qwen/Qwen3.8-27B` | 262K | | | | | | $0.40 | $3 |
|
|
68
59
|
| `wandb/zai-org/GLM-5.2` | 1.0M | | | | | | $0.76 | $2 |
|
|
@@ -80,7 +71,7 @@ const agent = new Agent({
|
|
|
80
71
|
name: "custom-agent",
|
|
81
72
|
model: {
|
|
82
73
|
url: "https://api.inference.wandb.ai/v1",
|
|
83
|
-
id: "wandb/
|
|
74
|
+
id: "wandb/MiniMaxAI/MiniMax-M3",
|
|
84
75
|
apiKey: process.env.WANDB_API_KEY,
|
|
85
76
|
headers: {
|
|
86
77
|
"X-Custom-Header": "value"
|
|
@@ -99,7 +90,7 @@ const agent = new Agent({
|
|
|
99
90
|
const useAdvanced = requestContext.task === "complex";
|
|
100
91
|
return useAdvanced
|
|
101
92
|
? "wandb/zai-org/GLM-5.3-Flash"
|
|
102
|
-
: "wandb/
|
|
93
|
+
: "wandb/MiniMaxAI/MiniMax-M3";
|
|
103
94
|
}
|
|
104
95
|
});
|
|
105
96
|
```
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
# AgentController
|
|
6
6
|
|
|
7
|
-
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
|
-
|
|
9
7
|
The `AgentController` class is a shared host for one or more [`Session`](https://mastra.ai/reference/agent-controller/session) instances. Initialize the controller, create a session, then use `session.*` APIs for conversation state and run control.
|
|
10
8
|
|
|
11
9
|
For a guided introduction, see the [AgentController overview](https://mastra.ai/docs/harness/agent-controller).
|
|
@@ -58,7 +56,7 @@ A message lifecycle starts with the initial message in `message_start`. Compact
|
|
|
58
56
|
|
|
59
57
|
**modes.name** (`string`): Display name.
|
|
60
58
|
|
|
61
|
-
**modes.defaultModelId** (`string`): Model
|
|
59
|
+
**modes.defaultModelId** (`string`): Model used when a session starts in this mode without a stored selection. Mode switches do not apply it.
|
|
62
60
|
|
|
63
61
|
**modes.description** (`string`): Text shown in mode selectors.
|
|
64
62
|
|
|
@@ -96,7 +94,7 @@ A message lifecycle starts with the initial message in `message_start`. Compact
|
|
|
96
94
|
|
|
97
95
|
**tools** (`DynamicArgument<ToolsInput | undefined>`): Tools shared by controller runs and available to configured subagents.
|
|
98
96
|
|
|
99
|
-
**workspace** (`DynamicArgument<Workspace | undefined>`): Static workspace or per-session workspace factory. A
|
|
97
|
+
**workspace** (`DynamicArgument<Workspace | undefined>`): Static workspace or per-session workspace factory. A workspace is optional. Sessions without one support threads, state, and agent runs. They have no workspace tools unless the mode's agent has its own workspace.
|
|
100
98
|
|
|
101
99
|
**browser** (`DynamicArgument<MastraBrowser | undefined>`): Static browser or per-session browser factory.
|
|
102
100
|
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
# Session
|
|
6
6
|
|
|
7
|
-
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
|
-
|
|
9
7
|
A `Session` is the isolated runtime for one resource and optional scope. It owns its event bus, thread binding, state, mode and model selections, run control, approvals, suspensions, follow-ups, and display state. The [`AgentController`](https://mastra.ai/reference/agent-controller/agent-controller-class) supplies shared agents, configuration, storage, workspaces, and services.
|
|
10
8
|
|
|
11
9
|
Create sessions through `controller.createSession()`. Direct construction and controller wiring methods aren't application APIs.
|
|
@@ -461,7 +459,7 @@ const mode = session.mode.resolve()
|
|
|
461
459
|
|
|
462
460
|
### `session.mode.switch({ modeId })`
|
|
463
461
|
|
|
464
|
-
Switch to another mode
|
|
462
|
+
Switch to another mode and persist the mode on the active thread. The session emits `mode_changed`. Switching modes doesn't change the active model; switch the model separately when your host assigns different models to different modes.
|
|
465
463
|
|
|
466
464
|
```typescript
|
|
467
465
|
await session.mode.switch({ modeId: 'build' })
|
|
@@ -469,7 +467,7 @@ await session.mode.switch({ modeId: 'build' })
|
|
|
469
467
|
|
|
470
468
|
## Model
|
|
471
469
|
|
|
472
|
-
`session.model` owns the active model selection
|
|
470
|
+
`session.model` owns the session's single active model selection.
|
|
473
471
|
|
|
474
472
|
### `session.model.get()`
|
|
475
473
|
|
|
@@ -497,21 +495,28 @@ if (session.model.hasSelection()) {
|
|
|
497
495
|
}
|
|
498
496
|
```
|
|
499
497
|
|
|
500
|
-
### `session.model.
|
|
498
|
+
### `session.model.set({ modelId })`
|
|
501
499
|
|
|
502
|
-
|
|
500
|
+
Set the active model in memory without persisting it, reporting model use, or emitting a `model_changed` event.
|
|
503
501
|
|
|
504
502
|
```typescript
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
503
|
+
session.model.set({ modelId: 'anthropic/claude-sonnet-4-6' })
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
### `session.model.switch(modelId, options?)`
|
|
507
|
+
|
|
508
|
+
Switch the session's active model. The model ID is persisted as the thread's `currentModelId` and restored with that thread. Reports the selection to the controller's `modelUseCountTracker` and emits a `model_changed` event.
|
|
510
509
|
|
|
511
|
-
|
|
512
|
-
|
|
510
|
+
Pass `{ thinkingLevel }` as the second argument to switch and persist both values in one operation. The level must be `'off'`, `'low'`, `'medium'`, `'high'`, `'xhigh'`, or `'max'`, and the controller's state schema must accept it. Both live values are updated before events are emitted. Omitting the option preserves the existing thinking-level override. Every `model_changed` event includes the current `{ modelId, thinkingLevel }`, even when the thinking level is unchanged. The level is `undefined` when the session has no override.
|
|
511
|
+
|
|
512
|
+
```typescript
|
|
513
|
+
await session.model.switch('anthropic/claude-sonnet-4-6', {
|
|
514
|
+
thinkingLevel: 'high',
|
|
515
|
+
})
|
|
513
516
|
```
|
|
514
517
|
|
|
518
|
+
The client SDK exposes the same operation as `session.switchModel(modelId, { thinkingLevel })`.
|
|
519
|
+
|
|
515
520
|
## Observational Memory
|
|
516
521
|
|
|
517
522
|
The observational-memory model selection, grouped by role under `session.om.observer` and `session.om.reflector`. Both roles expose the same methods. Reads return the value from session state when set, falling back to the controller's `omConfig` defaults.
|
|
@@ -65,12 +65,11 @@ The skill is assigned a synthetic path of `inline/<name>` (e.g., `inline/code-re
|
|
|
65
65
|
|
|
66
66
|
- `name` is required and must be a valid slug
|
|
67
67
|
- `description` is required
|
|
68
|
-
- `instructions` is required and non-empty
|
|
69
68
|
|
|
70
69
|
If validation fails, an `Error` is thrown with details about the invalid fields.
|
|
71
70
|
|
|
72
71
|
```typescript
|
|
73
|
-
// Throws: Invalid skill "": name
|
|
72
|
+
// Throws: Invalid skill "": name: Skill name cannot be empty
|
|
74
73
|
createSkill({ name: '', description: 'test', instructions: 'test' })
|
|
75
74
|
```
|
|
76
75
|
|
|
@@ -181,6 +181,8 @@ Returns: [`Promise<DurableAgentStreamResult>`](#durableagentstreamresult)
|
|
|
181
181
|
|
|
182
182
|
Reconnects to an existing run. Use this after a network disconnection. For the supported general reconnect flow, omit `offset` to replay all available cached events before receiving live events.
|
|
183
183
|
|
|
184
|
+
For runs configured with `structuredOutput`, an observer in another process reconstructs `output.object` from the persisted schema and replayed text.
|
|
185
|
+
|
|
184
186
|
```typescript
|
|
185
187
|
const { output } = await durableAgent.observe(runId, {
|
|
186
188
|
onChunk: chunk => console.log(chunk),
|
|
@@ -220,6 +220,8 @@ const result = await agent.generate('message for agent')
|
|
|
220
220
|
|
|
221
221
|
**options.tracingOptions.parentSpanId** (`string`): Parent span ID to use for this execution (1-16 hexadecimal characters). If provided, the root span will be created as a child of this span.
|
|
222
222
|
|
|
223
|
+
**options.tracingOptions.nestUnderParent** (`boolean`): Set to true together with parentSpanId to attach this run as a child of that span inside the existing trace, for example an LLM judge under the run it scores. Exporters then keep the trace's own name, input, output, and tags. Leave unset when parentSpanId comes from your own tracing system. Ignored without a valid traceId and parentSpanId.
|
|
224
|
+
|
|
223
225
|
**options.tracingOptions.tags** (`string[]`): Tags to apply to this trace. String labels for categorizing and filtering traces.
|
|
224
226
|
|
|
225
227
|
**options.versions** (`VersionOverrides`): Per-invocation version overrides for sub-agent delegation. Merged on top of Mastra instance-level versions and propagated automatically through sub-agent calls via requestContext. Requires the editor package. See Editor versioning.
|
|
@@ -444,6 +446,8 @@ const response = await agent.generate([
|
|
|
444
446
|
console.log(response.text)
|
|
445
447
|
```
|
|
446
448
|
|
|
449
|
+
The `image` value, or `data` for a `type: 'file'` part, should be an absolute URL, a data URL, or base64 content. The model can't see an attachment given as a relative path such as `/api/images/foo.png`, so resolve it to an absolute URL before sending. The agent replaces it with a placeholder and logs a warning. It does the same for inline content that can't be decoded or isn't the image or PDF its media type says, and for any attachment it can't download, instead of failing. See [attachment download failures](https://mastra.ai/docs/agents/processors).
|
|
450
|
+
|
|
447
451
|
### Using `maxSteps`
|
|
448
452
|
|
|
449
453
|
The `maxSteps` parameter controls the maximum number of sequential LLM calls an agent can make. Each step generates a response and executes any tool calls before processing the result. Limiting steps helps prevent infinite loops and reduce latency. It also controls token usage for agents that use tools. The default is 5, but can be increased:
|
|
@@ -20,7 +20,7 @@ await agent.getModel()
|
|
|
20
20
|
|
|
21
21
|
## Returns
|
|
22
22
|
|
|
23
|
-
**model** (`MastraLanguageModel | Promise<MastraLanguageModel>`): The language model configured for the agent, either as a direct instance or a promise that resolves to the model.
|
|
23
|
+
**model** (`MastraLanguageModel | MastraLegacyLanguageModel | Promise<MastraLanguageModel | MastraLegacyLanguageModel>`): The language model configured for the agent, either as a direct instance or a promise that resolves to the model.
|
|
24
24
|
|
|
25
25
|
## Extended usage example
|
|
26
26
|
|
|
@@ -40,7 +40,10 @@ interface Skill {
|
|
|
40
40
|
description: string
|
|
41
41
|
instructions: string
|
|
42
42
|
path: string
|
|
43
|
-
source:
|
|
43
|
+
source:
|
|
44
|
+
| { type: 'external'; packagePath: string }
|
|
45
|
+
| { type: 'local'; projectPath: string }
|
|
46
|
+
| { type: 'managed'; mastraPath: string }
|
|
44
47
|
references: string[]
|
|
45
48
|
scripts: string[]
|
|
46
49
|
assets: string[]
|
|
@@ -51,6 +54,8 @@ interface Skill {
|
|
|
51
54
|
}
|
|
52
55
|
```
|
|
53
56
|
|
|
57
|
+
`source` describes where Mastra discovered the skill. Skills from a path with a `node_modules` segment are `external`, skills under `.mastra/skills` are `managed`, and all other skills, including those created with [`createSkill()`](https://mastra.ai/reference/agents/createSkill), are `local`.
|
|
58
|
+
|
|
54
59
|
## Merging behavior
|
|
55
60
|
|
|
56
61
|
When both agent-level skills and workspace skills are configured, `.getSkill()` searches the merged set. Agent-level skills take precedence on name conflicts.
|
|
@@ -76,6 +76,8 @@ await agent.network(`
|
|
|
76
76
|
|
|
77
77
|
**options.tracingOptions.parentSpanId** (`string`): Parent span ID to use for this execution (1-16 hexadecimal characters). If provided, the root span will be created as a child of this span.
|
|
78
78
|
|
|
79
|
+
**options.tracingOptions.nestUnderParent** (`boolean`): Set to true together with parentSpanId to attach this run as a child of that span inside the existing trace, for example an LLM judge under the run it scores. Exporters then keep the trace's own name, input, output, and tags. Leave unset when parentSpanId comes from your own tracing system. Ignored without a valid traceId and parentSpanId.
|
|
80
|
+
|
|
79
81
|
**options.tracingOptions.tags** (`string[]`): Tags to apply to this trace. String labels for categorizing and filtering traces.
|
|
80
82
|
|
|
81
83
|
**options.telemetry** (`TelemetrySettings`): Settings for OTLP telemetry collection during streaming (not Tracing).
|
|
@@ -71,6 +71,10 @@ export const mastra = new Mastra({
|
|
|
71
71
|
|
|
72
72
|
**sendSources** (`boolean`): Whether to include source citations in the stream. (Default: `false`)
|
|
73
73
|
|
|
74
|
+
**includeSubAgentMetadata** (`boolean`): Whether to stream sub-agent progress as data-tool-agent and data-tool-agent-step parts when the agent delegates to sub-agents. These parts can include sub-agent reasoning and tool calls and results. Set to false if your clients should not receive them. (Default: `true`)
|
|
75
|
+
|
|
76
|
+
**messageMetadata** (`(options: { part: UIMessageStreamPart; traceId?: string }) => Record<string, unknown> | undefined`): A function that receives the current stream part and returns metadata to attach to start and finish chunks. Also receives the run's traceId (undefined when tracing is disabled), so you can return it as metadata, for example ({ part, traceId }) => (part.type === 'start' ? { traceId } : undefined). See the AI SDK message metadata docs for details.
|
|
77
|
+
|
|
74
78
|
**heartbeatMs** (`number`): Interval in milliseconds for SSE heartbeats that keep connections active through infrastructure with idle timeouts.
|
|
75
79
|
|
|
76
80
|
## Additional configuration
|
|
@@ -94,6 +94,8 @@ return withSseHeartbeat(createUIMessageStreamResponse({ stream }), 15000)
|
|
|
94
94
|
|
|
95
95
|
**sendSources** (`boolean`): Whether to include source citations in the stream. (Default: `false`)
|
|
96
96
|
|
|
97
|
+
**includeSubAgentMetadata** (`boolean`): Whether to stream sub-agent progress as data-tool-agent and data-tool-agent-step parts when the agent delegates to sub-agents. These parts can include sub-agent reasoning and tool calls and results. Set to false if your clients should not receive them. (Default: `true`)
|
|
98
|
+
|
|
97
99
|
**onError** (`(error: unknown) => string`): Called when the stream encounters an error. Return the string that will be sent to the client as the error message. Use this to sanitize errors before they reach the client — for example, to prevent internal infrastructure details from leaking to end users.
|
|
98
100
|
|
|
99
|
-
**messageMetadata** (`(options: { part: UIMessageStreamPart }) => Record<string, unknown> | undefined`): A function that receives the current stream part and returns metadata to attach to start and finish chunks. See the AI SDK message metadata docs for details.
|
|
101
|
+
**messageMetadata** (`(options: { part: UIMessageStreamPart; traceId?: string }) => Record<string, unknown> | undefined`): A function that receives the current stream part and returns metadata to attach to start and finish chunks. Also receives the run's traceId (undefined when tracing is disabled), so you can return it as metadata, for example ({ part, traceId }) => (part.type === 'start' ? { traceId } : undefined). See the AI SDK message metadata docs for details.
|
|
@@ -80,9 +80,11 @@ The second parameter is an options object:
|
|
|
80
80
|
|
|
81
81
|
**sendSources** (`boolean`): (Agent only) Whether to include source citations in the output. (Default: `false`)
|
|
82
82
|
|
|
83
|
+
**includeSubAgentMetadata** (`boolean`): (Agent only) Whether to stream sub-agent progress as data-tool-agent and data-tool-agent-step parts when the agent delegates to sub-agents. handleChatStream() and chatRoute() enable this by default. (Default: `false`)
|
|
84
|
+
|
|
83
85
|
**includeTextStreamParts** (`boolean`): (Workflow only) Whether to include text stream parts in the output. (Default: `true`)
|
|
84
86
|
|
|
85
|
-
**messageMetadata** (`(options: { part: UIMessageStreamPart }) => Record<string, unknown> | undefined`): (Agent only) A function that receives the current stream part and returns metadata to attach to start and finish chunks.
|
|
87
|
+
**messageMetadata** (`(options: { part: UIMessageStreamPart; traceId?: string }) => Record<string, unknown> | undefined`): (Agent only) A function that receives the current stream part and returns metadata to attach to start and finish chunks. Also receives the run's traceId (undefined when tracing is disabled), so you can return it as metadata, for example ({ part, traceId }) => (part.type === 'start' ? { traceId } : undefined).
|
|
86
88
|
|
|
87
89
|
**onError** (`(error: unknown) => string`): (Agent only) A function to handle errors during stream conversion. Receives the error and should return a string representation.
|
|
88
90
|
|
|
@@ -23,7 +23,7 @@ export const mastra = new Mastra({
|
|
|
23
23
|
|
|
24
24
|
## Constructor parameters
|
|
25
25
|
|
|
26
|
-
**secret** (`string`): A unique string used to sign and verify JSON Web Tokens (JWTs) for authenticating incoming requests.
|
|
26
|
+
**secret** (`string`): A unique string used to sign and verify JSON Web Tokens (JWTs) for authenticating incoming requests. Falls back to JWT\_AUTH\_SECRET when omitted. The resolved secret must be non-empty: the constructor throws an error if neither is set, or if this option is an empty string (an empty string does not fall back to JWT\_AUTH\_SECRET). (Default: `process.env.JWT_AUTH_SECRET`)
|
|
27
27
|
|
|
28
28
|
## Related
|
|
29
29
|
|
|
@@ -30,7 +30,7 @@ export const mastra = new Mastra({
|
|
|
30
30
|
|
|
31
31
|
**name** (`string`): Custom name for the auth provider instance.
|
|
32
32
|
|
|
33
|
-
**authorizeUser** (`(user: User, request:
|
|
33
|
+
**authorizeUser** (`(user: User, request: MastraAuthRequest) => Promise<boolean> | boolean`): Custom authorization function to determine if a user should be granted access. Called after token verification. By default, checks the 'isAdmin' column in the 'users' table.
|
|
34
34
|
|
|
35
35
|
## Related
|
|
36
36
|
|
|
@@ -157,12 +157,12 @@ const tools = browser.getTools()
|
|
|
157
157
|
|
|
158
158
|
### Screencast
|
|
159
159
|
|
|
160
|
-
#### `startScreencast(options
|
|
160
|
+
#### `startScreencast(options?)`
|
|
161
161
|
|
|
162
162
|
Starts streaming browser frames. Returns a `ScreencastStream` that emits frame events.
|
|
163
163
|
|
|
164
164
|
```typescript
|
|
165
|
-
const stream = await browser.startScreencast({ format: 'jpeg', quality: 80 }
|
|
165
|
+
const stream = await browser.startScreencast({ format: 'jpeg', quality: 80 })
|
|
166
166
|
|
|
167
167
|
stream.on('frame', frame => {
|
|
168
168
|
console.log('Frame received:', frame.data.length, 'bytes')
|
|
@@ -205,29 +205,31 @@ await browser.injectKeyboardEvent({
|
|
|
205
205
|
|
|
206
206
|
### State
|
|
207
207
|
|
|
208
|
-
#### `
|
|
208
|
+
#### `getBrowserState(threadId?)`
|
|
209
209
|
|
|
210
|
-
Gets the current browser state including
|
|
210
|
+
Gets the current browser state, including open tabs and the active tab index. Returns `null` when no state is available.
|
|
211
211
|
|
|
212
212
|
```typescript
|
|
213
|
-
const state = await browser.
|
|
214
|
-
|
|
215
|
-
console.log('
|
|
213
|
+
const state = await browser.getBrowserState('thread-123')
|
|
214
|
+
if (state) {
|
|
215
|
+
console.log('Active tab:', state.tabs[state.activeTabIndex]?.url)
|
|
216
|
+
console.log('Tabs:', state.tabs)
|
|
217
|
+
}
|
|
216
218
|
```
|
|
217
219
|
|
|
218
|
-
**Returns:** `Promise<BrowserState>`
|
|
220
|
+
**Returns:** `Promise<BrowserState | null>`
|
|
219
221
|
|
|
220
222
|
```typescript
|
|
221
223
|
interface BrowserState {
|
|
222
|
-
currentUrl: string | null
|
|
223
224
|
tabs: BrowserTabState[]
|
|
224
225
|
activeTabIndex: number
|
|
226
|
+
closeReason?: 'agent' | 'user' | 'process_restart' | 'error'
|
|
227
|
+
activeUrlChangeSource?: 'agent' | 'user'
|
|
225
228
|
}
|
|
226
229
|
|
|
227
230
|
interface BrowserTabState {
|
|
228
|
-
id: string
|
|
229
231
|
url: string
|
|
230
|
-
title
|
|
232
|
+
title?: string
|
|
231
233
|
}
|
|
232
234
|
```
|
|
233
235
|
|
|
@@ -185,7 +185,7 @@ Returns: `Promise<void>`
|
|
|
185
185
|
|
|
186
186
|
## Default manifest
|
|
187
187
|
|
|
188
|
-
When `connect()` builds a Slack app, the generated manifest requests a default set of bot scopes and event subscriptions. Override
|
|
188
|
+
When `connect()` builds a Slack app, the generated manifest requests a default set of bot scopes and event subscriptions. Configuring slash commands also adds the `commands` scope. Override the defaults with the `manifest` option on `connect()`.
|
|
189
189
|
|
|
190
190
|
| Default bot scopes | Default bot events |
|
|
191
191
|
| ------------------- | ------------------ |
|
|
@@ -187,7 +187,7 @@ Use `--no-skills` or `--no-git` to skip these steps. Skills and Git setup failur
|
|
|
187
187
|
- `--llm` and `--llm-api-key` are only valid for the default starter project.
|
|
188
188
|
- The project name must be a safe, lowercase, single directory name and the target must not already exist.
|
|
189
189
|
|
|
190
|
-
Invalid
|
|
190
|
+
Invalid flags, project names, and GitHub URLs are rejected before any project files are created. An unknown template name is rejected after the template list is fetched, and the CLI prints the available templates.
|
|
191
191
|
|
|
192
192
|
## Arguments and flags
|
|
193
193
|
|
|
@@ -428,7 +428,7 @@ mastra deploy --env staging --yes
|
|
|
428
428
|
|
|
429
429
|
Manages environments on Mastra platform. Environments are deploy targets (for example `production`, `staging`, `preview-42`) that belong to a project. The current organization is resolved from stored credentials.
|
|
430
430
|
|
|
431
|
-
Every subcommand resolves its project in a fixed order. It first checks the
|
|
431
|
+
Every subcommand resolves its project in a fixed order. It first checks the `--project <name|slug|id>` flag, then the `MASTRA_PROJECT_ID` environment variable. It then reads the `.mastra-project.json` file written by [`mastra deploy`](#mastra-deploy) in the current directory. Run from your project directory and you never need to name the project.
|
|
432
432
|
|
|
433
433
|
### `mastra env list`
|
|
434
434
|
|
|
@@ -790,7 +790,7 @@ Organization ID. Can also be set via the `MASTRA_ORG_ID` environment variable.
|
|
|
790
790
|
|
|
791
791
|
#### `--project`
|
|
792
792
|
|
|
793
|
-
Project ID or slug
|
|
793
|
+
Project ID or slug. Takes precedence over `MASTRA_PROJECT_ID`. Slugs are resolved against projects in the current organization.
|
|
794
794
|
|
|
795
795
|
#### `-c, --config`
|
|
796
796
|
|
|
@@ -858,7 +858,7 @@ The file defaults to `.env` when no argument is given. All values are double-quo
|
|
|
858
858
|
|
|
859
859
|
#### `--project`
|
|
860
860
|
|
|
861
|
-
Project ID or slug.
|
|
861
|
+
Project ID or slug. Takes precedence over `MASTRA_PROJECT_ID` and the linked project.
|
|
862
862
|
|
|
863
863
|
#### CI usage
|
|
864
864
|
|
|
@@ -913,6 +913,61 @@ Revokes an API token.
|
|
|
913
913
|
mastra auth tokens revoke <token-id>
|
|
914
914
|
```
|
|
915
915
|
|
|
916
|
+
## `mastra connect`
|
|
917
|
+
|
|
918
|
+
Manages provider connections for the linked platform project, so agents using `@mastra/connect` pick up provider toolsets without leaving the terminal.
|
|
919
|
+
|
|
920
|
+
Commands use the organization you're signed in to with `mastra auth login`. Switch organizations with `mastra auth orgs switch`.
|
|
921
|
+
|
|
922
|
+
The target project resolves from the `--project` flag, the `MASTRA_PROJECT_ID` environment variable, or the `.mastra-project.json` written by `mastra deploy`, in that order. All subcommands accept `--project <name|slug|id>`.
|
|
923
|
+
|
|
924
|
+
### `mastra connect list`
|
|
925
|
+
|
|
926
|
+
Lists providers with connected providers first. Active connections are shown in green, connections needing reauthorization in yellow, and unconnected providers in grey. Providers that aren't available yet are marked as coming soon.
|
|
927
|
+
|
|
928
|
+
```bash
|
|
929
|
+
mastra connect list
|
|
930
|
+
```
|
|
931
|
+
|
|
932
|
+
### `mastra connect add`
|
|
933
|
+
|
|
934
|
+
Connects a provider to the project. When the organization already has connections for the provider that aren't attached to the project, the command lists them and lets you attach an existing connection or create a new one. With no existing connections it goes straight to the provider's auth flow.
|
|
935
|
+
|
|
936
|
+
OAuth providers open the provider's consent screen in your browser and print its URL if you need to open it manually. API key and Basic auth providers prompt for credentials in the terminal and verify them before completing the connection. Providers with other auth types open a hosted connect page. The command waits until the connection becomes active before exiting.
|
|
937
|
+
|
|
938
|
+
Credential prompts require an interactive terminal, even with `--yes`. Run the command outside CI or connect through the platform UI. See [provider setup](https://mastra.ai/docs/mastra-platform/connect/providers) for API keys and required permissions.
|
|
939
|
+
|
|
940
|
+
Once a new connection is active, the command offers to set a display name so you can tell connections to the same provider apart. It lists the provider's existing connections, suggests a name that doesn't collide with them, and asks for confirmation if the chosen name duplicates another connection's name. Leave the field blank to skip naming. Setting a display name requires the organization admin role; if naming fails, the connection remains active.
|
|
941
|
+
|
|
942
|
+
```bash
|
|
943
|
+
mastra connect add <provider>
|
|
944
|
+
```
|
|
945
|
+
|
|
946
|
+
Pass `--yes` to skip all prompts. This always creates a new connection without a display name, even when existing connections could be reused.
|
|
947
|
+
|
|
948
|
+
### `mastra connect remove`
|
|
949
|
+
|
|
950
|
+
Unlinks a provider's connection from the project. The organization-level connection is kept and can be re-attached later.
|
|
951
|
+
|
|
952
|
+
```bash
|
|
953
|
+
mastra connect remove <provider>
|
|
954
|
+
```
|
|
955
|
+
|
|
956
|
+
When a provider has multiple connections, the command prompts for which one to remove. Pass `--yes` to skip confirmation. Without a terminal, or with `--yes`, removing several connections at once requires `--all`, and `--connection <id>` removes a single one.
|
|
957
|
+
|
|
958
|
+
### Replace a connection that needs reauthorization
|
|
959
|
+
|
|
960
|
+
`mastra connect list` marks connections that need reauthorization, for example after a provider API key is revoked. Connect tool resolution skips these connections with a warning.
|
|
961
|
+
|
|
962
|
+
Unlink the affected connection, then add a new one:
|
|
963
|
+
|
|
964
|
+
```bash
|
|
965
|
+
mastra connect remove posthog
|
|
966
|
+
mastra connect add posthog
|
|
967
|
+
```
|
|
968
|
+
|
|
969
|
+
If the project has multiple connections, select the affected one when removing it. When `add` offers to reuse an organization connection, choose **Create a new connection** and authorize it with valid credentials.
|
|
970
|
+
|
|
916
971
|
## `mastra lint`
|
|
917
972
|
|
|
918
973
|
The `mastra lint` command validates the structure and code of your Mastra project.
|
|
@@ -1100,7 +1155,7 @@ See [Import existing traces](https://mastra.ai/docs/mastra-platform/observabilit
|
|
|
1100
1155
|
|
|
1101
1156
|
#### `--project <name|slug|id>`
|
|
1102
1157
|
|
|
1103
|
-
Selects the destination Mastra Platform project.
|
|
1158
|
+
Selects the destination Mastra Platform project. Takes precedence over `MASTRA_PROJECT_ID`. Without either value, the command uses the project linked in `.mastra-project.json`.
|
|
1104
1159
|
|
|
1105
1160
|
#### `--from <date>`
|
|
1106
1161
|
|
|
@@ -1136,7 +1191,7 @@ The command loads `.env` and `.env.local` from the current directory.
|
|
|
1136
1191
|
| `MASTRA_API_TOKEN` | For headless authentication | Mastra Platform API token. Without it, the command uses credentials from `mastra auth login`. |
|
|
1137
1192
|
| `MASTRA_ORG_ID` | With `MASTRA_API_TOKEN` | Organization that owns the destination project. |
|
|
1138
1193
|
| `MASTRA_PLATFORM_ACCESS_TOKEN` | For upload and read-back with interactive login | Mastra Platform access token for the destination. Not required for `--dry-run` or when `MASTRA_API_TOKEN` is set. |
|
|
1139
|
-
| `MASTRA_PROJECT_ID` | When no project is otherwise linked | Destination project ID.
|
|
1194
|
+
| `MASTRA_PROJECT_ID` | When no project is otherwise linked | Destination project ID. The `--project` flag takes precedence over it. |
|
|
1140
1195
|
|
|
1141
1196
|
### Examples
|
|
1142
1197
|
|