@mastra/mcp-docs-server 1.2.13 → 1.2.14-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/.docs/docs/agents/a2a.md +1 -1
  2. package/.docs/docs/agents/acp.md +1 -1
  3. package/.docs/docs/agents/agent-approval.md +1 -1
  4. package/.docs/docs/agents/networks.md +2 -2
  5. package/.docs/docs/agents/overview.md +2 -2
  6. package/.docs/docs/agents/using-tools.md +2 -2
  7. package/.docs/docs/capabilities/channels/overview.md +1 -1
  8. package/.docs/docs/{agents/supervisor-agents.md → capabilities/subagents.md} +58 -58
  9. package/.docs/docs/deployment/sandbox.md +95 -1
  10. package/.docs/docs/getting-started/develop.md +2 -0
  11. package/.docs/docs/harness/agent-controller.md +370 -0
  12. package/.docs/docs/long-running-agents/background-tasks.md +1 -1
  13. package/.docs/docs/long-running-agents/goals.md +3 -3
  14. package/.docs/docs/mcp/overview.md +222 -281
  15. package/.docs/docs/memory/overview.md +2 -2
  16. package/.docs/docs/observability/integrations/exporters/confident-ai.md +140 -0
  17. package/.docs/docs/observability/integrations/overview.md +1 -1
  18. package/.docs/docs/observability/overview.md +122 -8
  19. package/.docs/docs/observability/tracing/overview.md +2 -2
  20. package/.docs/docs/server/mastra-client.md +1 -1
  21. package/.docs/docs/server/server-adapters.md +2 -0
  22. package/.docs/docs/storage/overview.md +2 -2
  23. package/.docs/guides/build-your-ui/copilotkit/channels.md +49 -39
  24. package/.docs/guides/concepts/multi-agent-systems.md +7 -7
  25. package/.docs/guides/guide/coding-agent.md +2 -2
  26. package/.docs/guides/guide/research-coordinator.md +1 -1
  27. package/.docs/guides/migrations/network-to-supervisor.md +1 -1
  28. package/.docs/models/index.md +1 -1
  29. package/.docs/models/providers/cortecs.md +2 -1
  30. package/.docs/models/providers/digitalocean.md +9 -9
  31. package/.docs/models/providers/kilo.md +1 -1
  32. package/.docs/models/providers/llmgateway.md +1 -1
  33. package/.docs/models/providers/opencode.md +2 -1
  34. package/.docs/reference/acp/acp-agent.md +1 -1
  35. package/.docs/reference/agent-controller/agent-controller-class.md +195 -506
  36. package/.docs/reference/agent-controller/session.md +274 -111
  37. package/.docs/reference/agents/network.md +1 -1
  38. package/.docs/reference/ai-sdk/handle-network-stream.md +1 -1
  39. package/.docs/reference/ai-sdk/network-route.md +1 -1
  40. package/.docs/reference/cli/create-mastra.md +1 -1
  41. package/.docs/reference/editor/versioning.md +1 -1
  42. package/.docs/reference/evals/rubric.md +1 -1
  43. package/.docs/reference/file-based-agents/observability.md +2 -2
  44. package/.docs/reference/file-based-agents/storage.md +1 -1
  45. package/.docs/reference/file-based-agents/subagents.md +1 -1
  46. package/.docs/reference/file-based-agents/tools.md +1 -1
  47. package/.docs/reference/observability/tracing/configuration.md +1 -1
  48. package/.docs/reference/observability/tracing/exporters/confident-ai.md +138 -0
  49. package/.docs/reference/observability/tracing/interfaces.md +29 -0
  50. package/.docs/reference/signals/signal-provider.md +2 -0
  51. package/.docs/reference/tools/mcp-server.md +1 -1
  52. package/.docs/reference/tools/submit-plan-tool.md +1 -1
  53. package/.docs/reference/workspace/railway-sandbox.md +5 -5
  54. package/CHANGELOG.md +14 -0
  55. package/package.json +3 -3
  56. package/.docs/docs/agent-controller/channels.md +0 -111
  57. package/.docs/docs/agent-controller/modes.md +0 -147
  58. package/.docs/docs/agent-controller/overview.md +0 -136
  59. package/.docs/docs/agent-controller/session.md +0 -161
  60. package/.docs/docs/agent-controller/subagents.md +0 -110
  61. package/.docs/docs/agent-controller/threads-and-state.md +0 -148
  62. package/.docs/docs/agent-controller/tool-approvals.md +0 -147
  63. package/.docs/docs/mcp/mcp-apps.md +0 -306
  64. package/.docs/docs/observability/config.md +0 -140
  65. package/.docs/docs/observability/storage.md +0 -81
@@ -0,0 +1,140 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # Confident AI exporter
4
+
5
+ [Confident AI](https://www.confident-ai.com/) is an LLM observability and evaluation platform for teams to build reliable AI applications in both development and production.
6
+
7
+ The `@mastra/deepeval` package sends your Mastra traces to Confident AI, where you can run metrics against them and track quality over time. It builds on [DeepEval](https://www.confident-ai.com/docs), the open-source evaluation SDK behind the platform.
8
+
9
+ ## Installation
10
+
11
+ **npm**:
12
+
13
+ ```bash
14
+ npm install @mastra/deepeval@latest
15
+ ```
16
+
17
+ **pnpm**:
18
+
19
+ ```bash
20
+ pnpm add @mastra/deepeval@latest
21
+ ```
22
+
23
+ **Yarn**:
24
+
25
+ ```bash
26
+ yarn add @mastra/deepeval@latest
27
+ ```
28
+
29
+ **Bun**:
30
+
31
+ ```bash
32
+ bun add @mastra/deepeval@latest
33
+ ```
34
+
35
+ ## Configuration
36
+
37
+ ### Prerequisites
38
+
39
+ 1. **Confident AI account**: Sign up at [confident-ai.com](https://www.confident-ai.com/)
40
+ 2. **API key**: Generate one in your Confident AI project settings
41
+ 3. **Environment variables**: Set your credentials:
42
+
43
+ ```bash
44
+ CONFIDENT_API_KEY=confident_proj_xxxxxxxxxxxxx
45
+
46
+ # Optional
47
+ CONFIDENT_TRACE_ENVIRONMENT=production # Defaults to "development"
48
+ ```
49
+
50
+ ### Zero-Config Setup
51
+
52
+ With environment variables set, use the exporter with no configuration:
53
+
54
+ ```typescript
55
+ import { Mastra } from '@mastra/core'
56
+ import { Observability } from '@mastra/observability'
57
+ import { DeepEvalExporter } from '@mastra/deepeval'
58
+
59
+ export const mastra = new Mastra({
60
+ observability: new Observability({
61
+ configs: {
62
+ deepeval: {
63
+ serviceName: 'my-service',
64
+ exporters: [new DeepEvalExporter()],
65
+ },
66
+ },
67
+ }),
68
+ })
69
+ ```
70
+
71
+ ### Explicit Configuration
72
+
73
+ You can also pass credentials directly (takes precedence over environment variables):
74
+
75
+ ```typescript
76
+ import { Mastra } from '@mastra/core'
77
+ import { Observability } from '@mastra/observability'
78
+ import { DeepEvalExporter } from '@mastra/deepeval'
79
+
80
+ export const mastra = new Mastra({
81
+ observability: new Observability({
82
+ configs: {
83
+ deepeval: {
84
+ serviceName: 'my-service',
85
+ exporters: [
86
+ new DeepEvalExporter({
87
+ apiKey: process.env.CONFIDENT_API_KEY,
88
+ environment: 'production',
89
+ }),
90
+ ],
91
+ },
92
+ },
93
+ }),
94
+ })
95
+ ```
96
+
97
+ ### Metric collections
98
+
99
+ Confident AI evaluates incoming traces against metric collections defined in your project. Attach them at the trace level or per span type. Trace-level metrics run against the whole trace, and per-type metrics run against matching spans.
100
+
101
+ ```typescript
102
+ new DeepEvalExporter({
103
+ metricCollection: 'trace-metrics', // trace-level
104
+ llmMetricCollection: 'llm-metrics', // applied to LLM spans
105
+ agentMetricCollection: 'agent-metrics', // applied to agent spans
106
+ toolMetricCollectionMap: {
107
+ search: 'search-tool-metrics', // applied to the "search" tool
108
+ },
109
+ })
110
+ ```
111
+
112
+ ### Complete Configuration
113
+
114
+ ```typescript
115
+ new DeepEvalExporter({
116
+ apiKey: process.env.CONFIDENT_API_KEY,
117
+ environment: 'production', // Default: "development"
118
+ name: 'my-trace', // Default: the Mastra serviceName
119
+ tags: ['production'],
120
+ metadata: { team: 'growth' },
121
+ })
122
+ ```
123
+
124
+ ## Span type mapping
125
+
126
+ Mastra spans map to the span types shown in Confident AI:
127
+
128
+ | Mastra span type | Confident AI span type |
129
+ | ---------------------------------------------------------------------- | ---------------------- |
130
+ | `AGENT_RUN`, `WORKFLOW_RUN` | `AGENT` |
131
+ | `MODEL_GENERATION` | `LLM` |
132
+ | `TOOL_CALL`, `MCP_TOOL_CALL`, `PROVIDER_TOOL_CALL`, `CLIENT_TOOL_CALL` | `TOOL` |
133
+ | `RAG_EMBEDDING`, `RAG_VECTOR_OPERATION` | `RETRIEVER` |
134
+ | All other exported span types | `CUSTOM` |
135
+
136
+ ## Related
137
+
138
+ - [Tracing Overview](https://mastra.ai/docs/observability/tracing/overview)
139
+ - [DeepEvalExporter reference](https://mastra.ai/reference/observability/tracing/exporters/confident-ai)
140
+ - [Confident AI documentation](https://www.confident-ai.com/docs)
@@ -41,7 +41,7 @@ Processors transform or redact spans before export:
41
41
 
42
42
  ## Next steps
43
43
 
44
- - [Configuration](https://mastra.ai/docs/observability/config)
44
+ - [Configuration](https://mastra.ai/docs/observability/overview)
45
45
  - [Tracing](https://mastra.ai/docs/observability/tracing/overview)
46
46
  - [Mastra Storage](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage)
47
47
  - [OpenTelemetry bridge](https://mastra.ai/docs/observability/integrations/bridges/otel)
@@ -4,8 +4,8 @@
4
4
 
5
5
  Mastra's observability system gives you visibility into every agent run, workflow step, tool call, and model interaction. Agent behavior depends on model responses, prompts, tools, memory, and workflow state, so observability helps you inspect runtime decisions from day one. It captures complementary signals that work together to help you understand what your application is doing and why.
6
6
 
7
- - [**Configuration**](https://mastra.ai/docs/observability/config): Configure observability once for traces, logs, metrics, and feedback.
8
- - [**Storage**](https://mastra.ai/docs/observability/storage): Choose storage backends for persisted traces, logs, metrics aggregation, and feedback queries.
7
+ - [**Configuration**](#configuration): Configure observability once for traces, logs, metrics, and feedback.
8
+ - [**Storage**](#storage): Choose storage backends for persisted traces, logs, metrics aggregation, and feedback queries.
9
9
  - [**Tracing**](https://mastra.ai/docs/observability/tracing/overview): Records every operation as a hierarchical timeline of spans, capturing inputs, outputs, token usage, and timing.
10
10
  - [**Logging**](https://mastra.ai/docs/observability/logging): Forwards structured log entries from your application and Mastra internals to observability storage, correlated to traces automatically.
11
11
  - [**Metrics**](https://mastra.ai/docs/observability/metrics/overview): Extracts trace usage and cost data. No additional instrumentation is required.
@@ -96,21 +96,137 @@ export const mastra = new Mastra({
96
96
  spanOutputProcessors: [
97
97
  new SensitiveDataFilter(), // Redacts sensitive data like passwords, tokens, keys
98
98
  ],
99
+ logging: {
100
+ enabled: true,
101
+ level: 'info',
102
+ },
99
103
  },
100
104
  },
101
105
  }),
102
106
  })
103
107
  ```
104
108
 
105
- It enables tracing, log forwarding, and metrics. Mastra also supports external tracing providers like Langfuse, Datadog, and any OpenTelemetry-compatible platform. Use [Configuration](https://mastra.ai/docs/observability/config), [Storage](https://mastra.ai/docs/observability/storage), and [Integrations overview](https://mastra.ai/docs/observability/integrations/overview) to set up observability.
109
+ It enables tracing, log forwarding, and metrics. Mastra also supports external tracing providers like Langfuse, Datadog, and any OpenTelemetry-compatible platform. See [Maintaining Studio access](#maintaining-studio-access) to keep Mastra Studio access while sending data to an external provider.
106
110
 
107
- ## Mastra platform
111
+ ## Configuration
108
112
 
109
- For hosted traces, logs, and metrics across projects and deploys, see [Observability on Mastra platform](https://mastra.ai/docs/mastra-platform/observability).
113
+ Observability is configured once on your Mastra instance and applies across traces, logs, and metrics.
114
+
115
+ ### Basic config
116
+
117
+ An observability config usually contains:
118
+
119
+ - `serviceName`: The service identifier attached to exported observability data.
120
+ - `exporters`: One or more destinations for traces, logs, and derived metrics.
121
+ - `spanOutputProcessors`: Transformations that run before spans are exported.
122
+ - `logging`: Log forwarding settings for observability storage.
123
+
124
+ For destinations and processors, see [Integrations overview](https://mastra.ai/docs/observability/integrations/overview).
125
+
126
+ ### Maintaining Studio access
127
+
128
+ When you add external exporters, keep `MastraStorageExporter` for Studio observability and/or `MastraPlatformExporter` for hosted Mastra platform observability.
129
+
130
+ The following example shows only the observability config. Configure storage separately.
131
+
132
+ ```ts
133
+ import { Observability, MastraStorageExporter, MastraPlatformExporter } from '@mastra/observability'
134
+ import { ArizeExporter } from '@mastra/arize'
135
+
136
+ export const observability = new Observability({
137
+ configs: {
138
+ production: {
139
+ serviceName: 'my-service',
140
+ exporters: [
141
+ new ArizeExporter({
142
+ endpoint: process.env.PHOENIX_COLLECTOR_ENDPOINT,
143
+ apiKey: process.env.PHOENIX_API_KEY,
144
+ }),
145
+ new MastraStorageExporter(),
146
+ new MastraPlatformExporter(),
147
+ ],
148
+ },
149
+ },
150
+ })
151
+ ```
152
+
153
+ ### Flushing in serverless environments
154
+
155
+ In serverless environments, flush observability exporters before the runtime pauses or exits:
156
+
157
+ ```ts
158
+ await mastra.observability.flush()
159
+ ```
160
+
161
+ Use external storage in serverless environments instead of local file storage. See [Storage](#storage) for storage selection and routing.
162
+
163
+ ### Multi-config setup
164
+
165
+ Use multiple configs when different environments or request types need different exporters or sampling behavior. Select the active config at runtime with `configSelector`.
166
+
167
+ ```ts
168
+ import { Mastra } from '@mastra/core'
169
+ import { Observability, MastraStorageExporter } from '@mastra/observability'
170
+ import { LangfuseExporter } from '@mastra/langfuse'
171
+
172
+ const storageExporter = new MastraStorageExporter()
173
+ const langfuseExporter = new LangfuseExporter()
174
+
175
+ export const mastra = new Mastra({
176
+ observability: new Observability({
177
+ configs: {
178
+ development: {
179
+ serviceName: 'my-service-dev',
180
+ exporters: [storageExporter],
181
+ },
182
+ production: {
183
+ serviceName: 'my-service-prod',
184
+ exporters: [storageExporter, langfuseExporter],
185
+ },
186
+ },
187
+ configSelector: () => process.env.NODE_ENV || 'development',
188
+ }),
189
+ })
190
+ ```
191
+
192
+ For trace sampling, see [Tracing](https://mastra.ai/docs/observability/tracing/overview).
110
193
 
111
194
  ## Storage
112
195
 
113
- Not all storage backends support every signal. Traces work with most backends, but metrics and logs require an OLAP-capable store like DuckDB (development) or ClickHouse (production). For setup guidance, see [Storage](https://mastra.ai/docs/observability/storage).
196
+ Storage determines which observability signals persist, which queries are available, and whether metrics aggregation works. Use a dedicated observability store instead of your primary application store.
197
+
198
+ ### Signal support
199
+
200
+ Storage support depends on the signal and workload. `MastraStorageExporter` can persist traces to ClickHouse, PostgreSQL, MSSQL, MongoDB, and LibSQL. Metrics require an analytics-capable store:
201
+
202
+ - DuckDB: Recommended for local testing and development.
203
+ - ClickHouse: Recommended for high-volume production observability.
204
+ - `PostgresStoreVNext`: Supports metrics when the observability domain is enabled. Always provide a time range to avoid full partition scans.
205
+ - Mastra platform: Use `MastraPlatformExporter` for hosted observability without managing the backend yourself.
206
+
207
+ For the complete provider list and supported tracing strategies, see [Mastra Storage exporter](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage). Use composite storage to route the `observability` domain separately when your primary store doesn't support observability or when the workload needs independent scaling.
208
+
209
+ ### Local development
210
+
211
+ For local development, use:
212
+
213
+ - `LibSQLStore` for primary application storage
214
+ - `DuckDBStore` for the `observability` domain
215
+ - `MastraStorageExporter` for local Studio access
216
+
217
+ ### Production deployment
218
+
219
+ Observability traffic is usually more write-heavy than the rest of the application. In production:
220
+
221
+ - Use `MastraStorageExporter` with ClickHouse for the `observability` domain when you keep observability in your own storage.
222
+ - Use `MastraPlatformExporter` for hosted Mastra platform observability instead of managing the backend yourself.
223
+ - Use composite storage when observability needs a different backend or scaling policy from your primary application data.
224
+
225
+ For backend compatibility details and exporter batching behavior, see [Mastra Storage exporter](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage).
226
+
227
+ ## Mastra platform
228
+
229
+ For hosted traces, logs, and metrics across projects and deploys, see [Observability on Mastra platform](https://mastra.ai/docs/mastra-platform/observability).
114
230
 
115
231
  ## Next steps
116
232
 
@@ -118,8 +234,6 @@ Not all storage backends support every signal. Traces work with most backends, b
118
234
  - [Logging](https://mastra.ai/docs/observability/logging)
119
235
  - [Metrics](https://mastra.ai/docs/observability/metrics/overview)
120
236
  - [Feedback](https://mastra.ai/docs/observability/feedback)
121
- - [Configuration](https://mastra.ai/docs/observability/config)
122
- - [Storage](https://mastra.ai/docs/observability/storage)
123
237
  - [Integrations overview](https://mastra.ai/docs/observability/integrations/overview)
124
238
  - [Mastra Studio](https://mastra.ai/docs/studio/observability)
125
239
  - [Automatic metrics reference](https://mastra.ai/reference/observability/metrics/automatic-metrics)
@@ -19,8 +19,8 @@ This page focuses on trace-specific concepts: span hierarchy, sampling, metadata
19
19
 
20
20
  To get started with tracing, configure observability in your Mastra instance and run an agent or workflow. You can configure behavior through the following features:
21
21
 
22
- - [Configuration](https://mastra.ai/docs/observability/config): Base observability config and multiple configs, plus serverless flushing
23
- - [Storage](https://mastra.ai/docs/observability/storage): Storage routing for traces, logs, and metrics
22
+ - [Configuration](https://mastra.ai/docs/observability/overview): Base observability config and multiple configs, plus serverless flushing
23
+ - [Storage](https://mastra.ai/docs/observability/overview): Storage routing for traces, logs, and metrics
24
24
  - [Integrations overview](https://mastra.ai/docs/observability/integrations/overview): Exporters, bridges, and processors
25
25
 
26
26
  ## Sampling strategies
@@ -73,7 +73,7 @@ The Mastra Client SDK exposes all resources served by the Mastra Server.
73
73
 
74
74
  Use `upsertStoredWorkflow()` to create or replace a persisted workflow definition. A successful upsert validates the complete definition, registers it with the running Mastra instance, and makes it available through the standard workflow execution API.
75
75
 
76
- The following example creates a mapping workflow, reads the stored definition, runs it, and then deletes it:
76
+ The following example shows the full lifecycle of a mapping workflow, from creation and inspection through execution and deletion:
77
77
 
78
78
  ```typescript
79
79
  import { MastraClient } from '@mastra/client-js'
@@ -4,6 +4,8 @@
4
4
 
5
5
  Server adapters let you run Mastra with your own HTTP server instead of the Hono server generated by `mastra build`. They provide more control over the server setup, including custom middleware ordering, authentication, logging, and deployment configuration. You can still integrate Mastra into any Node.js application without changing how agents or workflows execute.
6
6
 
7
+ > **Warning:** Server adapters use the `mastra` instance you pass them and don't run file-based discovery. Register agents on that instance in code. To use file-based agents, run Mastra as a separate server with `mastra dev` or `mastra build`.
8
+
7
9
  ## When to use server adapters
8
10
 
9
11
  - You want Mastra’s endpoints added automatically to an existing application
@@ -184,7 +184,7 @@ export const mastra = new Mastra({
184
184
  })
185
185
  ```
186
186
 
187
- You can also route `observability` to a dedicated analytics backend. See [observability storage](https://mastra.ai/docs/observability/storage) for an observability-specific example.
187
+ You can also route `observability` to a dedicated analytics backend. See the [observability quickstart](https://mastra.ai/docs/observability/overview) for an observability-specific example.
188
188
 
189
189
  ## Supported providers
190
190
 
@@ -211,4 +211,4 @@ Each provider page includes installation instructions, configuration parameters,
211
211
  - [Storage retention](https://mastra.ai/reference/storage/retention)
212
212
  - [Storage schemas](https://mastra.ai/reference/storage/overview)
213
213
  - [Memory](https://mastra.ai/docs/memory/overview)
214
- - [Observability storage](https://mastra.ai/docs/observability/storage)
214
+ - [Observability storage](https://mastra.ai/docs/observability/overview)
@@ -2,70 +2,69 @@
2
2
 
3
3
  # CopilotKit channels
4
4
 
5
- The same Mastra agent that powers your in-app copilot can also run as a bot in messaging platforms. CopilotKit's bot layer connects your agent to Slack, Discord, Telegram, WhatsApp, and Microsoft Teams, with threads, tool calls, and human-in-the-loop approvals handled in the channel.
5
+ The same Mastra agent that powers your in-app copilot can also run as a bot in messaging platforms. CopilotKit's Channels SDK connects your agent to Slack and other messaging platforms, with threads, tool calls, rich interactive messages, and human-in-the-loop approvals handled natively in the channel.
6
6
 
7
- > **Info:** The full setup lives in the [CopilotKit bot documentation](https://docs.copilotkit.ai/slack). This page shows how it fits together with a Mastra agent.
7
+ > **Info:** Full platform setup lives in the [CopilotKit Channels documentation](https://docs.copilotkit.ai/slack/mastra). This page shows how Channels fit together with a Mastra agent.
8
8
 
9
9
  ## How it fits together
10
10
 
11
- Your Mastra agent stays where it's, exposed through `registerCopilotKit()` as described in [CopilotKit overview](https://mastra.ai/guides/build-your-ui/copilotkit/overview). The bot is a separate process built with `@copilotkit/bot`: you attach one or more platform adapters and point the bot at your agent. `createBot` takes an array of adapters, so a single bot can serve several platforms at once.
11
+ Your Mastra agent stays where it's deployed, exposed over AG-UI through `registerCopilotKit()` (see [CopilotKit overview](https://mastra.ai/guides/build-your-ui/copilotkit/overview)). A channel is a separate long-running process built with `@copilotkit/channels`: you attach one or more platform adapters and point the channel at your agent. `createChannel` takes an array of adapters, so a single process can serve several platforms at once.
12
12
 
13
- ```typescript
14
- import { createBot } from '@copilotkit/bot'
15
- import { slack } from '@copilotkit/bot-slack'
16
-
17
- const bot = createBot({
18
- adapters: [
19
- slack({
20
- botToken: process.env.SLACK_BOT_TOKEN!,
21
- appToken: process.env.SLACK_APP_TOKEN!,
22
- }),
23
- ],
24
- // Point the bot at your agent.
25
- agent: threadId => {
26
- // ...connect to your CopilotKit runtime / Mastra agent
27
- },
28
- })
29
-
30
- bot.onMention(async ({ thread }) => {
31
- await thread.runAgent()
32
- })
33
-
34
- await bot.start()
35
- ```
36
-
37
- Rich messages are written as JSX and rendered to each platform's native message format (Block Kit on Slack, for example), so an interactive card degrades gracefully where a platform has no equivalent.
38
-
39
- ## Slack
40
-
41
- The [Slack quickstart](https://docs.copilotkit.ai/slack) takes you from zero to a bot you can `@`-mention in a channel, then adds an interactive button card. Slack runs over Socket Mode, which opens an outbound WebSocket to Slack, so no public URL or tunnel is required during development.
42
-
43
- Install the packages:
13
+ Install the SDK (batteries-included, every adapter):
44
14
 
45
15
  **npm**:
46
16
 
47
17
  ```bash
48
- npm install @copilotkit/bot @copilotkit/bot-ui @copilotkit/bot-slack
18
+ npm install @copilotkit/channels
49
19
  ```
50
20
 
51
21
  **pnpm**:
52
22
 
53
23
  ```bash
54
- pnpm add @copilotkit/bot @copilotkit/bot-ui @copilotkit/bot-slack
24
+ pnpm add @copilotkit/channels
55
25
  ```
56
26
 
57
27
  **Yarn**:
58
28
 
59
29
  ```bash
60
- yarn add @copilotkit/bot @copilotkit/bot-ui @copilotkit/bot-slack
30
+ yarn add @copilotkit/channels
61
31
  ```
62
32
 
63
33
  **Bun**:
64
34
 
65
35
  ```bash
66
- bun add @copilotkit/bot @copilotkit/bot-ui @copilotkit/bot-slack
36
+ bun add @copilotkit/channels
67
37
  ```
68
38
 
39
+ ```typescript
40
+ import { createChannel, Message, Section } from '@copilotkit/channels'
41
+ import { slack } from '@copilotkit/channels/slack'
42
+ import { mastraAgent } from './agent' // your AG-UI Mastra agent
43
+
44
+ const channel = createChannel({
45
+ // Point the channel at your Mastra agent (an AbstractAgent, or a per-thread factory).
46
+ agent: mastraAgent,
47
+ adapters: [
48
+ slack({
49
+ botToken: process.env.SLACK_BOT_TOKEN!,
50
+ appToken: process.env.SLACK_APP_TOKEN!,
51
+ }),
52
+ ],
53
+ })
54
+
55
+ channel.onMention(async ({ thread }) => {
56
+ await thread.runAgent()
57
+ })
58
+
59
+ await channel.start()
60
+ ```
61
+
62
+ The agent receives ordinary AG-UI input and emits ordinary AG-UI events; the platform mechanics stay behind the adapter, so the same Mastra agent runs unchanged across every channel. Rich messages are written as JSX and rendered to each platform's native format (Block Kit on Slack, for example), so an interactive card degrades gracefully where a platform has no equivalent.
63
+
64
+ ## Slack
65
+
66
+ The [Slack quickstart](https://docs.copilotkit.ai/slack/mastra) takes you from zero to a bot you can `@`-mention in a channel, then adds an interactive button card. Slack runs over Socket Mode, which opens an outbound WebSocket to Slack, so no public URL or tunnel is required during development.
67
+
69
68
  Set the Slack credentials in your environment:
70
69
 
71
70
  - `SLACK_BOT_TOKEN`: Bot User OAuth token (`xoxb-...`)
@@ -73,4 +72,15 @@ Set the Slack credentials in your environment:
73
72
 
74
73
  ## Other platforms
75
74
 
76
- The bot adapters share one `@copilotkit/bot` API and differ only in what each platform natively supports. For Discord, Telegram, WhatsApp, and Microsoft Teams, set the relevant platform credentials and add the matching adapter to the `adapters` array. See the [CopilotKit bot documentation](https://docs.copilotkit.ai/slack) for platform-specific setup.
75
+ The Channels SDK isn't limited to Slack. Other platforms like Microsoft Teams run through the same `@copilotkit/channels` API: add the matching adapter to the `adapters` array and the rest of your agent code stays the same. See the [CopilotKit Channels documentation](https://docs.copilotkit.ai/slack/mastra) for the current platform list and per-platform setup.
76
+
77
+ ## Message pipeline and architecture
78
+
79
+ Managed channels keep a deliberate credential split, which matters when your Mastra agent uses separate model keys and tools:
80
+
81
+ - **You keep** the agent logic, model credentials, tools, and the channel process.
82
+ - **CopilotKit Intelligence holds** the platform credentials, message delivery, registration, health, and reconnects.
83
+
84
+ A turn begins when a user messages the app. Intelligence receives the platform event, and the gateway delivers the turn to your running channel process. Your Mastra agent runs and renders a reply. Intelligence then returns the reply as native platform content. Platform credentials never enter the agent process, and enterprise Intelligence can be self-hosted for data residency.
85
+
86
+ > **Note:** By default, interactive actions live in memory and reset on restart. Back the channel with a durable action and state store (Redis or Postgres) so buttons and per-thread state survive restarts and span multiple instances.
@@ -44,7 +44,7 @@ A supervisor pattern keeps one lead agent in control for the full task. The supe
44
44
 
45
45
  Use this pattern when the task is open-ended and the full sequence isn't known in advance. For example, a research task may require different lines of inquiry based on what earlier steps uncover. A supervisor can adapt as the task unfolds. The tradeoff is that the supervisor becomes the main coordination point. That makes the pattern flexible, but it also means the result depends heavily on good delegation behavior and clear subagent boundaries.
46
46
 
47
- In Mastra, this pattern maps directly to [supervisor agents](https://mastra.ai/docs/agents/supervisor-agents). A supervisor agent defines subagents on the `agents` property and uses `stream()` or `generate()` to coordinate them. Mastra also provides delegation hooks, message filtering, and memory isolation to help control this pattern.
47
+ In Mastra, this pattern maps directly to [supervisor agents](https://mastra.ai/docs/capabilities/subagents). A supervisor agent defines subagents on the `agents` property and uses `stream()` or `generate()` to coordinate them. Mastra also provides delegation hooks, message filtering, and memory isolation to help control this pattern.
48
48
 
49
49
  > **Tip:** Follow the [supervisor agents tutorial](https://mastra.ai/guides/guide/research-coordinator) for a step-by-step guide.
50
50
 
@@ -60,12 +60,12 @@ Mastra doesn't provide a dedicated council primitive. In Mastra, implement this
60
60
 
61
61
  These patterns differ mainly in how they distribute control:
62
62
 
63
- | Pattern | Who stays in control | Use when | Tradeoff | Mastra implementation |
64
- | ----------------- | -------------------- | ------------------------------------------------ | -------------------------------------------------------- | -------------------------------------------------------------------- |
65
- | Handoffs | Current specialist | Ownership should move between specialists | Context transfer becomes more important | Agents with workflows and memory |
66
- | Workflows | Execution graph | The path is known in advance | Less adaptive when the task changes | [Workflows](https://mastra.ai/docs/workflows/overview) |
67
- | Supervisor agents | One lead agent | Delegation must adapt during execution | Results depend on good coordination and clear boundaries | [Supervisor agents](https://mastra.ai/docs/agents/supervisor-agents) |
68
- | Council | Final synthesis step | The task needs multiple independent perspectives | Higher cost and latency | Agents with workflow parallelism |
63
+ | Pattern | Who stays in control | Use when | Tradeoff | Mastra implementation |
64
+ | ----------------- | -------------------- | ------------------------------------------------ | -------------------------------------------------------- | ------------------------------------------------------------------ |
65
+ | Handoffs | Current specialist | Ownership should move between specialists | Context transfer becomes more important | Agents with workflows and memory |
66
+ | Workflows | Execution graph | The path is known in advance | Less adaptive when the task changes | [Workflows](https://mastra.ai/docs/workflows/overview) |
67
+ | Supervisor agents | One lead agent | Delegation must adapt during execution | Results depend on good coordination and clear boundaries | [Supervisor agents](https://mastra.ai/docs/capabilities/subagents) |
68
+ | Council | Final synthesis step | The task needs multiple independent perspectives | Higher cost and latency | Agents with workflow parallelism |
69
69
 
70
70
  In practice, these patterns are often combined:
71
71
 
@@ -191,7 +191,7 @@ export async function createCodingAgentSession() {
191
191
  }
192
192
  ```
193
193
 
194
- This example uses one mode and disables the controller's additional built-in tools so the introductory UI can focus on workspace execution. The simplified setup is intended for this tutorial. In a production application, enable the built-in tools your product needs and implement their UI flows: interactive tools such as `ask_user` and `submit_plan` suspend until your interface resumes them, while task and subagent tools have their own lifecycle events. See [tool approvals and suspensions](https://mastra.ai/docs/agent-controller/tool-approvals).
194
+ This example uses one mode and disables the controller's additional built-in tools so the introductory UI can focus on workspace execution. The simplified setup is intended for this tutorial. In a production application, enable the built-in tools your product needs and implement their UI flows: interactive tools such as `ask_user` and `submit_plan` suspend until your interface resumes them, while task and subagent tools have their own lifecycle events. See [tool approvals and suspensions](https://mastra.ai/docs/harness/agent-controller).
195
195
 
196
196
  The example also omits storage, so the conversation lasts only for the current process. You can add storage later when you want to resume sessions.
197
197
 
@@ -387,6 +387,6 @@ Learn more:
387
387
 
388
388
  - [`createCodingAgent()` reference](https://mastra.ai/reference/coding-agent/create-coding-agent)
389
389
  - [`buildBasePrompt()` reference](https://mastra.ai/reference/coding-agent/build-base-prompt)
390
- - [AgentController overview](https://mastra.ai/docs/agent-controller/overview)
390
+ - [AgentController overview](https://mastra.ai/docs/harness/agent-controller)
391
391
  - [`AgentController` reference](https://mastra.ai/reference/agent-controller/agent-controller-class)
392
392
  - [Workspace overview](https://mastra.ai/docs/workspace/overview)
@@ -414,5 +414,5 @@ You can extend this research coordinator to:
414
414
 
415
415
  Learn more:
416
416
 
417
- - [Supervisor Agents](https://mastra.ai/docs/agents/supervisor-agents)
417
+ - [Supervisor Agents](https://mastra.ai/docs/capabilities/subagents)
418
418
  - [Agent.stream() Reference](https://mastra.ai/reference/streaming/agents/stream)
@@ -255,7 +255,7 @@ const stream = await supervisorAgent.stream('Research AI in education', {
255
255
 
256
256
  ## See also
257
257
 
258
- - [Supervisor Agents](https://mastra.ai/docs/agents/supervisor-agents)
258
+ - [Supervisor Agents](https://mastra.ai/docs/capabilities/subagents)
259
259
  - [Agent Networks](https://mastra.ai/docs/agents/networks)
260
260
  - [Agent.stream() Reference](https://mastra.ai/reference/streaming/agents/stream)
261
261
  - [Agent.generate() Reference](https://mastra.ai/reference/agents/generate)
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Model Providers
4
4
 
5
- Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 5288 models from 168 providers through a single API.
5
+ Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 5290 models from 168 providers through a single API.
6
6
 
7
7
  ## Features
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Cortecs logo](https://models.dev/logos/cortecs.svg)Cortecs
4
4
 
5
- Access 58 Cortecs models through Mastra's model router. Authentication is handled automatically using the `CORTECS_API_KEY` environment variable.
5
+ Access 59 Cortecs models through Mastra's model router. Authentication is handled automatically using the `CORTECS_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [Cortecs documentation](https://cortecs.ai).
8
8
 
@@ -49,6 +49,7 @@ for await (const chunk of stream) {
49
49
  | `cortecs/deepseek-v3-0324` | 128K | | | | | | $0.55 | $2 |
50
50
  | `cortecs/deepseek-v3.2` | 164K | | | | | | $0.27 | $0.44 |
51
51
  | `cortecs/deepseek-v4-flash` | 1.0M | | | | | | $0.13 | $0.27 |
52
+ | `cortecs/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.26 | $0.31 |
52
53
  | `cortecs/deepseek-v4-pro` | 1.0M | | | | | | $2 | $3 |
53
54
  | `cortecs/devstral-2512` | 262K | | | | | | — | — |
54
55
  | `cortecs/gemini-2.5-pro` | 1.0M | | | | | | $2 | $11 |