ai 7.0.156 → 7.0.158
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/CHANGELOG.md +29 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -6
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +2 -2
- package/dist/internal/index.js.map +1 -1
- package/docs/02-foundations/02-providers-and-models.mdx +32 -5
- package/docs/03-agents/01-overview.mdx +7 -0
- package/docs/03-agents/10-eve.mdx +96 -0
- package/docs/03-agents/index.mdx +6 -0
- package/docs/03-ai-sdk-core/16-mcp-tools.mdx +13 -7
- package/docs/03-ai-sdk-core/17-mcp-apps.mdx +3 -8
- package/docs/03-ai-sdk-core/26-reasoning.mdx +9 -3
- package/docs/03-ai-sdk-harnesses/03-tools.mdx +30 -0
- package/docs/06-advanced/10-vercel-deployment-guide.mdx +7 -0
- package/docs/07-reference/01-ai-sdk-core/23-create-mcp-client.mdx +6 -8
- package/docs/07-reference/01-ai-sdk-core/24-mcp-stdio-transport.mdx +4 -4
- package/docs/07-reference/01-ai-sdk-core/29-filter-active-tools.mdx +2 -7
- package/docs/07-reference/01-ai-sdk-core/34-sandbox.mdx +114 -6
- package/docs/07-reference/01-ai-sdk-core/index.mdx +1 -1
- package/docs/07-reference/02-ai-sdk-ui/48-mcp-app-renderer.mdx +6 -11
- package/docs/07-reference/02-ai-sdk-ui/index.mdx +1 -1
- package/package.json +12 -12
- package/src/generate-text/index.ts +13 -1
- package/src/index.ts +2 -0
- package/src/test/mock-sandbox.ts +7 -1
- package/src/util/fix-json.ts +0 -1
- package/src/util/is-node-runtime.ts +3 -1
|
@@ -115,6 +115,8 @@ Additionally, any self-hosted provider that supports the OpenAI specification ca
|
|
|
115
115
|
The AI providers support different language models with various capabilities.
|
|
116
116
|
Here are the capabilities of popular models:
|
|
117
117
|
|
|
118
|
+
{/* OpenAI, Anthropic, and Google rows are generated from provider model catalogs by pnpm generate:model-capabilities-docs. */}
|
|
119
|
+
|
|
118
120
|
| Provider | Model | Image Input | Object Generation | Tool Usage | Tool Streaming |
|
|
119
121
|
| -------------------------------------------------- | ------------------------------------------- | ----------- | ----------------- | ---------- | -------------- |
|
|
120
122
|
| [xAI Grok](/providers/ai-sdk-providers/xai) | `grok-4.7` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
@@ -124,6 +126,8 @@ Here are the capabilities of popular models:
|
|
|
124
126
|
| [xAI Grok](/providers/ai-sdk-providers/xai) | `grok-3` | <Cross /> | <Check /> | <Check /> | <Check /> |
|
|
125
127
|
| [xAI Grok](/providers/ai-sdk-providers/xai) | `grok-3-mini` | <Cross /> | <Check /> | <Check /> | <Check /> |
|
|
126
128
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-6-astra` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
129
|
+
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-6.1-sol` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
130
|
+
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-6.1-terra` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
127
131
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-6-luna` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
128
132
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-6-sol` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
129
133
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5.6` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
@@ -139,18 +143,26 @@ Here are the capabilities of popular models:
|
|
|
139
143
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5.2-pro` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
140
144
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5.2-chat-latest` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
141
145
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5.2` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
142
|
-
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
143
|
-
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5-mini` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
144
|
-
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5-nano` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
145
|
-
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5.1-chat-latest` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
146
146
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5.1-codex-mini` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
147
147
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5.1-codex` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
148
|
+
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5.1-chat-latest` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
148
149
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5.1` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
150
|
+
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5-pro` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
151
|
+
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
152
|
+
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5-mini` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
153
|
+
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5-nano` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
149
154
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5-codex` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
150
|
-
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5-chat-latest` | <Check /> | <
|
|
155
|
+
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5-chat-latest` | <Check /> | <Cross /> | <Cross /> | <Cross /> |
|
|
156
|
+
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-4.1` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
157
|
+
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-4.1-mini` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
158
|
+
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-4.1-nano` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
159
|
+
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-4o` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
160
|
+
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-4o-mini` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
151
161
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-opus-5-5` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
162
|
+
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-opus-5` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
152
163
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-sonnet-5-5` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
153
164
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-sonnet-5` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
165
|
+
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-haiku-5-5` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
154
166
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-fable-5-1` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
155
167
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-fable-5` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
156
168
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-opus-4-8` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
@@ -158,14 +170,29 @@ Here are the capabilities of popular models:
|
|
|
158
170
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-opus-4-6` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
159
171
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-sonnet-4-6` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
160
172
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-opus-4-5` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
173
|
+
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-haiku-4-5` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
174
|
+
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-sonnet-4-5` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
161
175
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-opus-4-1` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
162
176
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-opus-4-0` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
163
177
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-sonnet-4-0` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
178
|
+
| [Google](/providers/ai-sdk-providers/google) | `gemini-nano-banana-2.1` | <Check /> | <Cross /> | <Cross /> | <Cross /> |
|
|
179
|
+
| [Google](/providers/ai-sdk-providers/google) | `gemini-4-argon` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
164
180
|
| [Google](/providers/ai-sdk-providers/google) | `gemini-3.8-flash` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
181
|
+
| [Google](/providers/ai-sdk-providers/google) | `gemini-3.7-flash` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
182
|
+
| [Google](/providers/ai-sdk-providers/google) | `gemini-3.6-flash` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
183
|
+
| [Google](/providers/ai-sdk-providers/google) | `gemini-3.5-flash` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
184
|
+
| [Google](/providers/ai-sdk-providers/google) | `gemini-3.5-flash-lite` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
165
185
|
| [Google](/providers/ai-sdk-providers/google) | `gemini-3.1-pro-preview` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
186
|
+
| [Google](/providers/ai-sdk-providers/google) | `gemini-3.1-flash-image-preview` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
187
|
+
| [Google](/providers/ai-sdk-providers/google) | `gemini-3.1-flash-lite-preview` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
166
188
|
| [Google](/providers/ai-sdk-providers/google) | `gemini-3-pro-preview` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
189
|
+
| [Google](/providers/ai-sdk-providers/google) | `gemini-3-pro-image-preview` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
190
|
+
| [Google](/providers/ai-sdk-providers/google) | `gemini-3-flash-preview` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
167
191
|
| [Google](/providers/ai-sdk-providers/google) | `gemini-2.5-pro` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
168
192
|
| [Google](/providers/ai-sdk-providers/google) | `gemini-2.5-flash` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
193
|
+
| [Google](/providers/ai-sdk-providers/google) | `gemini-2.5-flash-lite` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
194
|
+
| [Google](/providers/ai-sdk-providers/google) | `gemini-2.5-flash-lite-preview-06-17` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
195
|
+
| [Google](/providers/ai-sdk-providers/google) | `gemini-2.0-flash` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
169
196
|
| [Mistral](/providers/ai-sdk-providers/mistral) | `pixtral-large-latest` | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
170
197
|
| [Mistral](/providers/ai-sdk-providers/mistral) | `mistral-large-latest` | <Cross /> | <Check /> | <Check /> | <Check /> |
|
|
171
198
|
| [Mistral](/providers/ai-sdk-providers/mistral) | `mistral-medium-latest` | <Cross /> | <Check /> | <Check /> | <Check /> |
|
|
@@ -133,6 +133,12 @@ Agents are flexible and powerful, but non-deterministic. When you need reliable,
|
|
|
133
133
|
|
|
134
134
|
[Explore workflow patterns](/docs/agents/workflows) to learn more about building structured, reliable systems.
|
|
135
135
|
|
|
136
|
+
## Agent Frameworks
|
|
137
|
+
|
|
138
|
+
The agent classes in this section are primitives you assemble inside your own application. When you want a production framework for durable, long-running agents — with channels, schedules, approvals, and testing included — [eve](https://eve.dev) is an open-source framework built on the AI SDK. It uses the same `tool()` shape and model settings, and runs agents durably on Vercel or self-hosted.
|
|
139
|
+
|
|
140
|
+
Learn more in [eve](/docs/agents/eve).
|
|
141
|
+
|
|
136
142
|
## Next Steps
|
|
137
143
|
|
|
138
144
|
- **[Building Agents](/docs/agents/building-agents)** - Guide to creating agents with the ToolLoopAgent
|
|
@@ -140,3 +146,4 @@ Agents are flexible and powerful, but non-deterministic. When you need reliable,
|
|
|
140
146
|
- **[Workflow Patterns](/docs/agents/workflows)** - Structured patterns using core functions for complex workflows
|
|
141
147
|
- **[Loop Control](/docs/agents/loop-control)** - Execution control with stopWhen and prepareStep
|
|
142
148
|
- **[Chat Platforms](/docs/agents/chat-platforms)** - Run agents in Slack, Microsoft Teams, Discord, and more with Chat SDK
|
|
149
|
+
- **[eve](/docs/agents/eve)** - Build production agents for durable, long-running work
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: eve
|
|
3
|
+
description: Build production AI agents with eve, an open-source agent framework for durable, long-running work that is built on the AI SDK.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# eve
|
|
7
|
+
|
|
8
|
+
[eve](https://eve.dev) is an open-source agent framework for durable, long-running work. Build, govern, and evolve enterprise-grade agents that scale — with channels, durable runs, approvals, and testing built in.
|
|
9
|
+
|
|
10
|
+
eve is built on the AI SDK:
|
|
11
|
+
|
|
12
|
+
- `defineTool` uses the same shape as [`tool()`](/docs/ai-sdk-core/tools-and-tool-calling): a `description`, an `inputSchema` (Zod, any Standard Schema, or a JSON Schema object), and an `execute` function.
|
|
13
|
+
- `defineAgent` accepts an [AI Gateway](https://vercel.com/ai-gateway) model ID such as `openai/gpt-6-luna-fast`, or any AI SDK `LanguageModel` from a [provider package](/providers).
|
|
14
|
+
- Options like `reasoning` map to the AI SDK's model settings.
|
|
15
|
+
- A [Chat SDK](/docs/agents/chat-platforms) channel connects any Chat SDK adapter to your agent.
|
|
16
|
+
|
|
17
|
+
## Built for Production
|
|
18
|
+
|
|
19
|
+
- **Channels** — Multiplayer and single-player chat across Slack, Teams, iMessage, WhatsApp, and the web. Channels are a framework primitive.
|
|
20
|
+
- **Durable runs** — Checkpoints every step. Survives crashes, restarts, and days-long waits. Runs on crons, too.
|
|
21
|
+
- **Agentic or deterministic** — Fully agentic loops, deterministic workflows, or both in one run. You choose per task.
|
|
22
|
+
- **Human in the loop** — Pause for approval. Resume durably when it arrives.
|
|
23
|
+
- **Any provider** — Swap models with a one-line edit. Provider fallback included. Route different models to different tasks.
|
|
24
|
+
- **Per-user capabilities** — Skills, schedules, memory, and tools resolved per user at runtime.
|
|
25
|
+
- **MCP, OpenAPI, and subagents** — Connect to services over MCP and OpenAPI, or delegate to focused subagents. Credentials stay in the runtime.
|
|
26
|
+
- **Testing** — Test agent behavior before and after every change.
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
Create a new agent project:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx eve@latest init my-agent
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This creates a `my-agent` directory, installs its dependencies, initializes Git, and starts the interactive terminal UI. To add an agent to an existing project, pass a path:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
cd myapp
|
|
40
|
+
npx eve@latest init .
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
<Note>
|
|
44
|
+
Like the `ai` package, `eve` bundles its full documentation, so coding agents
|
|
45
|
+
can read it locally from `node_modules/eve/docs`. See [Coding
|
|
46
|
+
Agents](/docs/getting-started/coding-agents) for the same workflow with the AI
|
|
47
|
+
SDK.
|
|
48
|
+
</Note>
|
|
49
|
+
|
|
50
|
+
## A Minimal Example
|
|
51
|
+
|
|
52
|
+
An eve agent lives in an `agent/` directory. Replace the system prompt in `agent/instructions.md`:
|
|
53
|
+
|
|
54
|
+
```md filename="agent/instructions.md"
|
|
55
|
+
You are a concise weather demo assistant. Tell users that the weather data is mocked.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Add a tool at `agent/tools/get_weather.ts`. The filename is the tool name the model sees:
|
|
59
|
+
|
|
60
|
+
```ts filename="agent/tools/get_weather.ts"
|
|
61
|
+
import { defineTool } from 'eve/tools';
|
|
62
|
+
import { z } from 'zod';
|
|
63
|
+
|
|
64
|
+
export default defineTool({
|
|
65
|
+
description: 'Return mock weather data for a city.',
|
|
66
|
+
inputSchema: z.object({ city: z.string().min(1) }),
|
|
67
|
+
async execute({ city }) {
|
|
68
|
+
return { city, condition: 'Sunny', temperatureF: 72 };
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Choose the model in `agent/agent.ts`:
|
|
74
|
+
|
|
75
|
+
```ts filename="agent/agent.ts"
|
|
76
|
+
import { defineAgent } from 'eve';
|
|
77
|
+
|
|
78
|
+
export default defineAgent({
|
|
79
|
+
model: 'openai/gpt-6-luna-fast',
|
|
80
|
+
reasoning: 'high',
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## When to Choose eve
|
|
85
|
+
|
|
86
|
+
The AI SDK gives you the primitives; eve is the production framework around them.
|
|
87
|
+
|
|
88
|
+
- Use eve when you want a complete production agent — durable, long-running work across channels, schedules, and approvals — without assembling those pieces yourself.
|
|
89
|
+
- Use [`ToolLoopAgent`](/docs/agents/building-agents) when you are assembling your own model-and-tools loop inside an application.
|
|
90
|
+
- Use [`WorkflowAgent`](/docs/agents/workflow-agent) from `@ai-sdk/workflow` when you need durable, resumable execution with explicit workflow steps.
|
|
91
|
+
- Use [Chat SDK](/docs/agents/chat-platforms) when you are adding an agent to chat platforms.
|
|
92
|
+
|
|
93
|
+
## Next Steps
|
|
94
|
+
|
|
95
|
+
- [eve documentation](https://eve.dev/docs) — the full project layout and guides
|
|
96
|
+
- [eve on GitHub](https://github.com/vercel/eve) — source code and discussions
|
package/docs/03-agents/index.mdx
CHANGED
|
@@ -74,5 +74,11 @@ The following section shows you how to build agents with the AI SDK - systems wh
|
|
|
74
74
|
'Run agents in Slack, Microsoft Teams, Discord, and more with Chat SDK.',
|
|
75
75
|
href: '/docs/agents/chat-platforms',
|
|
76
76
|
},
|
|
77
|
+
{
|
|
78
|
+
title: 'eve',
|
|
79
|
+
description:
|
|
80
|
+
'Build production AI agents with eve, an open-source framework for durable, long-running work.',
|
|
81
|
+
href: '/docs/agents/eve',
|
|
82
|
+
},
|
|
77
83
|
]}
|
|
78
84
|
/>
|
|
@@ -160,7 +160,7 @@ The Stdio transport can be imported from either the MCP SDK or the AI SDK:
|
|
|
160
160
|
import { createMCPClient } from '@ai-sdk/mcp';
|
|
161
161
|
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
162
162
|
// Or use the AI SDK's stdio transport:
|
|
163
|
-
// import {
|
|
163
|
+
// import { StdioMCPTransport as StdioClientTransport } from '@ai-sdk/mcp/mcp-stdio';
|
|
164
164
|
|
|
165
165
|
const mcpClient = await createMCPClient({
|
|
166
166
|
transport: new StdioClientTransport({
|
|
@@ -666,16 +666,12 @@ client throws an `MCPClientError`.
|
|
|
666
666
|
|
|
667
667
|
## Using MCP Prompts
|
|
668
668
|
|
|
669
|
-
<Note type="warning">
|
|
670
|
-
MCP Prompts is an experimental feature and may change in the future.
|
|
671
|
-
</Note>
|
|
672
|
-
|
|
673
669
|
According to the MCP specification, prompts are user-controlled templates that servers expose for clients to list and retrieve with optional arguments.
|
|
674
670
|
|
|
675
671
|
### Listing Prompts
|
|
676
672
|
|
|
677
673
|
```typescript
|
|
678
|
-
const prompts = await mcpClient.
|
|
674
|
+
const prompts = await mcpClient.listPrompts();
|
|
679
675
|
```
|
|
680
676
|
|
|
681
677
|
### Getting a Prompt
|
|
@@ -683,7 +679,7 @@ const prompts = await mcpClient.experimental_listPrompts();
|
|
|
683
679
|
Retrieve prompt messages, optionally passing arguments defined by the server:
|
|
684
680
|
|
|
685
681
|
```typescript
|
|
686
|
-
const prompt = await mcpClient.
|
|
682
|
+
const prompt = await mcpClient.getPrompt({
|
|
687
683
|
name: 'code_review',
|
|
688
684
|
arguments: { code: 'function add(a, b) { return a + b; }' },
|
|
689
685
|
});
|
|
@@ -742,6 +738,16 @@ mcpClient.onElicitationRequest(ElicitationRequestSchema, async request => {
|
|
|
742
738
|
|
|
743
739
|
### Elicitation Response Actions
|
|
744
740
|
|
|
741
|
+
On MCP `2026-07-28` connections, the same handler processes form elicitation
|
|
742
|
+
requests embedded in `input_required` results from tools, prompts, and resource
|
|
743
|
+
reads. The client retries the original request with the handler's answers and
|
|
744
|
+
the server's unchanged `requestState` until it receives a final result, with a
|
|
745
|
+
limit of 10 retries. State-only retries are delayed by 250 ms. Each round respects
|
|
746
|
+
`timeout`, including time spent awaiting the handler, while `maxTotalTimeout`
|
|
747
|
+
bounds the entire exchange. Missing handlers and unsupported input requests
|
|
748
|
+
reject the operation. Older connections continue to use `elicitation/create`
|
|
749
|
+
server requests.
|
|
750
|
+
|
|
745
751
|
Your handler must return an object with an `action` field that can be one of:
|
|
746
752
|
|
|
747
753
|
- `'accept'`: User provided the requested information. Must include `content` with the data.
|
|
@@ -153,18 +153,13 @@ In production, add any policy and user approval checks your app needs before for
|
|
|
153
153
|
|
|
154
154
|
## Render With React
|
|
155
155
|
|
|
156
|
-
In your React chat UI, render normal message parts as usual and pass tool parts to `
|
|
157
|
-
|
|
158
|
-
<Note type="warning">
|
|
159
|
-
`experimental_MCPAppRenderer` is experimental and may change in a future
|
|
160
|
-
release.
|
|
161
|
-
</Note>
|
|
156
|
+
In your React chat UI, render normal message parts as usual and pass tool parts to `MCPAppRenderer`.
|
|
162
157
|
|
|
163
158
|
```tsx filename="app/page.tsx"
|
|
164
159
|
'use client';
|
|
165
160
|
|
|
166
161
|
import {
|
|
167
|
-
|
|
162
|
+
MCPAppRenderer,
|
|
168
163
|
useChat,
|
|
169
164
|
type MCPAppBridgeHandlers,
|
|
170
165
|
type MCPAppMetadata,
|
|
@@ -242,7 +237,7 @@ export default function Chat() {
|
|
|
242
237
|
}
|
|
243
238
|
```
|
|
244
239
|
|
|
245
|
-
For ordinary tools, `
|
|
240
|
+
For ordinary tools, `MCPAppRenderer` renders the provided `fallback` (or nothing when no fallback is provided). For app-backed tools, it loads the resource, creates the sandbox bridge, sends tool input and result notifications to the iframe, and forwards supported app requests through your handlers.
|
|
246
241
|
|
|
247
242
|
## Best Practices
|
|
248
243
|
|
|
@@ -24,7 +24,7 @@ The `reasoning` parameter accepts the following values:
|
|
|
24
24
|
| Value | Behavior |
|
|
25
25
|
| -------------------- | -------------------------------------------------------------------- |
|
|
26
26
|
| `'provider-default'` | Use the provider's default reasoning behavior (default when omitted) |
|
|
27
|
-
| `'none'` | Disable reasoning
|
|
27
|
+
| `'none'` | Disable reasoning (lowest reasoning level if it cannot be disabled) |
|
|
28
28
|
| `'minimal'` | Bare-minimum reasoning |
|
|
29
29
|
| `'low'` | Fast, concise reasoning |
|
|
30
30
|
| `'medium'` | Balanced reasoning |
|
|
@@ -80,9 +80,15 @@ This design lets you use the portable `reasoning` parameter by default and fall
|
|
|
80
80
|
|
|
81
81
|
The `reasoning` parameter is supported by providers including OpenAI, Anthropic, Google, xAI, Groq, DeepSeek, Moonshot AI, Fireworks, Amazon Bedrock, Mistral, Cohere, Alibaba, Open Responses, OpenAI Compatible, and Perplexity. Each provider translates the value to its native reasoning API.
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
### How values are mapped
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
When a model does not support the requested value, the provider uses the closest supported value, rounding down. The values are ordered `none` < `minimal` < `low` < `medium` < `high` < `xhigh` < `max`, so `'xhigh'` becomes `'high'` on a model without an `xhigh` level. If there is no lower value, the next higher one is used.
|
|
86
|
+
|
|
87
|
+
Rounding never turns reasoning off: other values never map to `'none'`, and `'none'` on a model that cannot disable reasoning maps to the model's lowest level. Providers emit a `compatibility` warning whenever the value they send differs from the requested value. Values set in `providerOptions` are sent unchanged (see [Precedence Rules](#precedence-rules)).
|
|
88
|
+
|
|
89
|
+
Providers only round values for models and model families they recognize by model ID, so newer versions of a known family use that family's levels. Unrecognized model IDs, such as fine-tuned or custom models, and OpenAI-compatible and Open Responses endpoints receive the value directly and the API decides whether it is supported.
|
|
90
|
+
|
|
91
|
+
For providers that use a token budget, the value maps to a percentage of the model's maximum output tokens (`'max'` maps to 95% by default), within the provider's budget limits.
|
|
86
92
|
|
|
87
93
|
Maximum reasoning can substantially increase token usage, latency, cost, and the chance of reaching request or output limits. Use it when the model's additional reasoning depth is worth those tradeoffs.
|
|
88
94
|
|
|
@@ -272,12 +272,42 @@ const agent = new HarnessAgent({
|
|
|
272
272
|
`toolApproval` accepts the same status values as AI SDK tool approval status
|
|
273
273
|
objects: `not-applicable`, `approved`, `user-approval`, and `denied`.
|
|
274
274
|
|
|
275
|
+
When a host tool call is denied, the model and response messages receive an
|
|
276
|
+
`execution-denied` tool result with the denial reason, if provided. The tool's
|
|
277
|
+
`execute` and `toModelOutput` functions are not called for the denial.
|
|
278
|
+
|
|
275
279
|
When approval is required, the stream pauses after a `tool-approval-request`.
|
|
276
280
|
Continue the same session by sending a tool approval response message. In UI
|
|
277
281
|
flows, `useChat` sends those messages for you when you add the approval result.
|
|
278
282
|
In direct agent code, pass the approval response as `messages` on the next
|
|
279
283
|
`stream()` or `generate()` call.
|
|
280
284
|
|
|
285
|
+
### Native Tool Names
|
|
286
|
+
|
|
287
|
+
Built-in tool calls use the harness tool name, such as `bash`, `write`, or
|
|
288
|
+
`edit`, while their input follows the underlying runtime's schema. When an
|
|
289
|
+
adapter supplies a different native name, `HarnessAgent` exposes it as
|
|
290
|
+
`providerMetadata[harnessId].nativeToolName` on the streamed `tool-call` and
|
|
291
|
+
on the `toolCall` inside a `tool-approval-request`.
|
|
292
|
+
|
|
293
|
+
For example, a Claude Code approval request for `bash` includes
|
|
294
|
+
`toolCall.providerMetadata['claude-code'].nativeToolName: 'Bash'`. An approval
|
|
295
|
+
gate that works with Claude Code's native tool names can read it without
|
|
296
|
+
changing the harness-facing `toolName` or interpreting the input shape:
|
|
297
|
+
|
|
298
|
+
```ts
|
|
299
|
+
for await (const part of result.fullStream) {
|
|
300
|
+
if (part.type === 'tool-approval-request') {
|
|
301
|
+
const nativeToolName =
|
|
302
|
+
part.toolCall.providerMetadata?.['claude-code']?.nativeToolName;
|
|
303
|
+
console.log(nativeToolName ?? part.toolCall.toolName, part.toolCall.input);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
The metadata field is omitted when the adapter does not supply a native name
|
|
309
|
+
or when it matches `toolName`. Existing provider metadata is preserved.
|
|
310
|
+
|
|
281
311
|
## Built-in Approval Support
|
|
282
312
|
|
|
283
313
|
Most adapters can pause built-in tool calls for approval. Adapters that do not
|
|
@@ -11,6 +11,13 @@ Vercel is a platform for developers that provides the tools, workflows, and infr
|
|
|
11
11
|
|
|
12
12
|
Vercel allows for automatic deployments on every branch push and merges onto the production branch of your GitHub, GitLab, and Bitbucket projects. It is a great option for deploying your AI application.
|
|
13
13
|
|
|
14
|
+
<Note>
|
|
15
|
+
Deploying a durable backend agent instead of an application with a UI?
|
|
16
|
+
[eve](https://eve.dev) is an open-source agent framework built on the AI SDK
|
|
17
|
+
for durable, long-running work — channels, schedules, and approvals included.
|
|
18
|
+
Learn more in the [eve guide](/docs/agents/eve).
|
|
19
|
+
</Note>
|
|
20
|
+
|
|
14
21
|
## Before You Begin
|
|
15
22
|
|
|
16
23
|
To follow along with this guide, you will need:
|
|
@@ -562,13 +562,12 @@ Returns a Promise that resolves to an `MCPClient` with the following properties
|
|
|
562
562
|
],
|
|
563
563
|
},
|
|
564
564
|
{
|
|
565
|
-
name: '
|
|
565
|
+
name: 'listPrompts',
|
|
566
566
|
type: `async (options?: {
|
|
567
567
|
params?: PaginatedRequest['params'];
|
|
568
568
|
options?: RequestOptions;
|
|
569
569
|
}) => Promise<ListPromptsResult>`,
|
|
570
|
-
description:
|
|
571
|
-
'Lists available prompts from the MCP server. This method is experimental and may change in the future.',
|
|
570
|
+
description: 'Lists available prompts from the MCP server.',
|
|
572
571
|
properties: [
|
|
573
572
|
{
|
|
574
573
|
type: 'options',
|
|
@@ -591,14 +590,13 @@ Returns a Promise that resolves to an `MCPClient` with the following properties
|
|
|
591
590
|
],
|
|
592
591
|
},
|
|
593
592
|
{
|
|
594
|
-
name: '
|
|
593
|
+
name: 'getPrompt',
|
|
595
594
|
type: `async (args: {
|
|
596
595
|
name: string;
|
|
597
596
|
arguments?: Record<string, unknown>;
|
|
598
597
|
options?: RequestOptions;
|
|
599
598
|
}) => Promise<GetPromptResult>`,
|
|
600
|
-
description:
|
|
601
|
-
'Retrieves a prompt by name, optionally passing arguments. This method is experimental and may change in the future.',
|
|
599
|
+
description: 'Retrieves a prompt by name, optionally passing arguments.',
|
|
602
600
|
properties: [
|
|
603
601
|
{
|
|
604
602
|
type: 'args',
|
|
@@ -667,13 +665,13 @@ Returns a Promise that resolves to an `MCPClient` with the following properties
|
|
|
667
665
|
```typescript
|
|
668
666
|
import { createMCPClient } from '@ai-sdk/mcp';
|
|
669
667
|
import { generateText } from 'ai';
|
|
670
|
-
import {
|
|
668
|
+
import { StdioMCPTransport } from '@ai-sdk/mcp/mcp-stdio';
|
|
671
669
|
|
|
672
670
|
let client;
|
|
673
671
|
|
|
674
672
|
try {
|
|
675
673
|
client = await createMCPClient({
|
|
676
|
-
transport: new
|
|
674
|
+
transport: new StdioMCPTransport({
|
|
677
675
|
command: 'node server.js',
|
|
678
676
|
}),
|
|
679
677
|
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
2
|
+
title: StdioMCPTransport
|
|
3
3
|
description: Create a transport for Model Context Protocol (MCP) clients to communicate with MCP servers using standard input and output streams
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# `
|
|
6
|
+
# `StdioMCPTransport`
|
|
7
7
|
|
|
8
8
|
Creates a transport for Model Context Protocol (MCP) clients to communicate with MCP servers using standard input and output streams. This transport is only supported in Node.js environments.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
`Experimental_StdioMCPTransport` is a deprecated alias of `StdioMCPTransport`.
|
|
11
11
|
|
|
12
12
|
## Import
|
|
13
13
|
|
|
14
14
|
<Snippet
|
|
15
|
-
text={`import {
|
|
15
|
+
text={`import { StdioMCPTransport } from "@ai-sdk/mcp/mcp-stdio"`}
|
|
16
16
|
prompt={false}
|
|
17
17
|
/>
|
|
18
18
|
|
|
@@ -5,8 +5,6 @@ description: Filter a tool set to the currently active tools (API Reference)
|
|
|
5
5
|
|
|
6
6
|
# `filterActiveTools()`
|
|
7
7
|
|
|
8
|
-
<Note type="warning">`filterActiveTools` is an experimental feature.</Note>
|
|
9
|
-
|
|
10
8
|
`filterActiveTools` filters a tool set to only the string tool names listed in `activeTools`.
|
|
11
9
|
If `activeTools` is `undefined`, it returns the original tool set.
|
|
12
10
|
If `tools` is `undefined`, it returns `undefined`.
|
|
@@ -14,7 +12,7 @@ If `tools` is `undefined`, it returns `undefined`.
|
|
|
14
12
|
`filterActiveTools` is useful for limiting which tools are sent to a model in a particular step.
|
|
15
13
|
|
|
16
14
|
```ts
|
|
17
|
-
import {
|
|
15
|
+
import { filterActiveTools, tool } from 'ai';
|
|
18
16
|
import { z } from 'zod';
|
|
19
17
|
|
|
20
18
|
const tools = {
|
|
@@ -38,10 +36,7 @@ const filteredTools = filterActiveTools({
|
|
|
38
36
|
|
|
39
37
|
## Import
|
|
40
38
|
|
|
41
|
-
<Snippet
|
|
42
|
-
text={`import { experimental_filterActiveTools as filterActiveTools } from "ai"`}
|
|
43
|
-
prompt={false}
|
|
44
|
-
/>
|
|
39
|
+
<Snippet text={`import { filterActiveTools } from "ai"`} prompt={false} />
|
|
45
40
|
|
|
46
41
|
## API Signature
|
|
47
42
|
|
|
@@ -6,7 +6,7 @@ description: API Reference for the Experimental_SandboxSession interface.
|
|
|
6
6
|
# `Experimental_SandboxSession`
|
|
7
7
|
|
|
8
8
|
The `Experimental_SandboxSession` interface describes an execution environment that
|
|
9
|
-
tools can use to run commands. Pass an experimental sandbox using the
|
|
9
|
+
tools can use to run commands and access files. Pass an experimental sandbox using the
|
|
10
10
|
`experimental_sandbox` option to `generateText`, `streamText`,
|
|
11
11
|
`ToolLoopAgent.generate`, `ToolLoopAgent.stream`, or agent UI stream helpers to
|
|
12
12
|
make it available to tool description functions and tool execution.
|
|
@@ -30,19 +30,91 @@ make it available to tool description functions and tool execution.
|
|
|
30
30
|
```ts
|
|
31
31
|
type Experimental_SandboxSession = {
|
|
32
32
|
readonly description: string;
|
|
33
|
+
|
|
33
34
|
readonly run: (options: {
|
|
34
35
|
command: string;
|
|
35
36
|
workingDirectory?: string;
|
|
36
37
|
env?: Record<string, string>;
|
|
37
38
|
abortSignal?: AbortSignal;
|
|
38
|
-
}) => PromiseLike<{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
}) => PromiseLike<{ exitCode: number; stdout: string; stderr: string }>;
|
|
40
|
+
readonly spawn: (options: {
|
|
41
|
+
command: string;
|
|
42
|
+
workingDirectory?: string;
|
|
43
|
+
env?: Record<string, string>;
|
|
44
|
+
abortSignal?: AbortSignal;
|
|
45
|
+
stdin?: boolean;
|
|
46
|
+
}) => PromiseLike<Experimental_SandboxProcess>;
|
|
47
|
+
|
|
48
|
+
readonly readFile: (options: {
|
|
49
|
+
path: string;
|
|
50
|
+
abortSignal?: AbortSignal;
|
|
51
|
+
}) => PromiseLike<ReadableStream<Uint8Array> | null>;
|
|
52
|
+
readonly readBinaryFile: (options: {
|
|
53
|
+
path: string;
|
|
54
|
+
abortSignal?: AbortSignal;
|
|
55
|
+
}) => PromiseLike<Uint8Array | null>;
|
|
56
|
+
readonly readTextFile: (options: {
|
|
57
|
+
path: string;
|
|
58
|
+
encoding?: string;
|
|
59
|
+
startLine?: number;
|
|
60
|
+
endLine?: number;
|
|
61
|
+
abortSignal?: AbortSignal;
|
|
62
|
+
}) => PromiseLike<string | null>;
|
|
63
|
+
|
|
64
|
+
readonly writeFile: (options: {
|
|
65
|
+
path: string;
|
|
66
|
+
content: ReadableStream<Uint8Array>;
|
|
67
|
+
abortSignal?: AbortSignal;
|
|
68
|
+
}) => PromiseLike<void>;
|
|
69
|
+
readonly writeBinaryFile: (options: {
|
|
70
|
+
path: string;
|
|
71
|
+
content: Uint8Array;
|
|
72
|
+
abortSignal?: AbortSignal;
|
|
73
|
+
}) => PromiseLike<void>;
|
|
74
|
+
readonly writeTextFile: (options: {
|
|
75
|
+
path: string;
|
|
76
|
+
content: string;
|
|
77
|
+
encoding?: string;
|
|
78
|
+
abortSignal?: AbortSignal;
|
|
79
|
+
}) => PromiseLike<void>;
|
|
80
|
+
|
|
81
|
+
readonly stat: (options: {
|
|
82
|
+
path: string;
|
|
83
|
+
abortSignal?: AbortSignal;
|
|
84
|
+
}) => PromiseLike<Experimental_SandboxFileStat | null>;
|
|
85
|
+
readonly listDirectory: (options: {
|
|
86
|
+
path: string;
|
|
87
|
+
abortSignal?: AbortSignal;
|
|
88
|
+
}) => PromiseLike<Array<Experimental_SandboxDirectoryEntry> | null>;
|
|
89
|
+
readonly deleteFile: (options: {
|
|
90
|
+
path: string;
|
|
91
|
+
abortSignal?: AbortSignal;
|
|
92
|
+
}) => PromiseLike<boolean>;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
type Experimental_SandboxFileStat = {
|
|
96
|
+
type: 'file' | 'directory' | 'other';
|
|
97
|
+
size: number;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
type Experimental_SandboxDirectoryEntry = {
|
|
101
|
+
name: string;
|
|
102
|
+
type: 'file' | 'directory' | 'symlink' | 'other';
|
|
43
103
|
};
|
|
44
104
|
```
|
|
45
105
|
|
|
106
|
+
## Paths
|
|
107
|
+
|
|
108
|
+
Relative paths in every method, including the `workingDirectory` option of `run`
|
|
109
|
+
and `spawn`, resolve against the same base directory: the directory that `run`
|
|
110
|
+
and `spawn` start in when no `workingDirectory` is given. The base directory does
|
|
111
|
+
not change for the lifetime of the session. Changing the directory inside a
|
|
112
|
+
command, for example with `cd`, only affects that command. Absolute paths are
|
|
113
|
+
used as is.
|
|
114
|
+
|
|
115
|
+
This lets tools combine methods. For example, a path that a `grep` command run
|
|
116
|
+
with `run` prints can be passed to `readTextFile`.
|
|
117
|
+
|
|
46
118
|
## Properties
|
|
47
119
|
|
|
48
120
|
<PropertiesTable
|
|
@@ -90,6 +162,42 @@ type Experimental_SandboxSession = {
|
|
|
90
162
|
},
|
|
91
163
|
],
|
|
92
164
|
},
|
|
165
|
+
{
|
|
166
|
+
name: 'spawn',
|
|
167
|
+
type: '(options: { command: string; workingDirectory?: string; env?: Record<string, string>; abortSignal?: AbortSignal; stdin?: boolean }) => PromiseLike<Experimental_SandboxProcess>',
|
|
168
|
+
description:
|
|
169
|
+
'Starts a long-running process and returns immediately with a handle that streams standard output and standard error, can be waited on, and can be killed. With `stdin: true`, standard input stays open and the handle also has a writable `stdin` stream; implementations that do not support this reject before starting the command.',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: 'readFile / readBinaryFile / readTextFile',
|
|
173
|
+
type: '(options: { path: string; abortSignal?: AbortSignal }) => PromiseLike<ReadableStream<Uint8Array> | Uint8Array | string | null>',
|
|
174
|
+
description:
|
|
175
|
+
'Reads one file as a stream of bytes, raw bytes, or decoded text. Resolves to `null` when the file does not exist. `readTextFile` accepts an `encoding` (default `utf-8`) and 1-based inclusive `startLine` and `endLine`.',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: 'writeFile / writeBinaryFile / writeTextFile',
|
|
179
|
+
type: '(options: { path: string; content: ReadableStream<Uint8Array> | Uint8Array | string; abortSignal?: AbortSignal }) => PromiseLike<void>',
|
|
180
|
+
description:
|
|
181
|
+
'Writes one file from a stream of bytes, raw bytes, or a string. Creates parent directories and overwrites an existing file. Rejects when the path is a directory.',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: 'stat',
|
|
185
|
+
type: '(options: { path: string; abortSignal?: AbortSignal }) => PromiseLike<Experimental_SandboxFileStat | null>',
|
|
186
|
+
description:
|
|
187
|
+
'Returns the type (`file`, `directory`, or `other`) and size in bytes of a path. The size of a directory is implementation-defined. Symbolic links are followed. Resolves to `null` when the path does not exist.',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: 'listDirectory',
|
|
191
|
+
type: '(options: { path: string; abortSignal?: AbortSignal }) => PromiseLike<Array<Experimental_SandboxDirectoryEntry> | null>',
|
|
192
|
+
description:
|
|
193
|
+
'Lists the entries of one directory, without descending into subdirectories. Each entry has a `name` and a `type` (`file`, `directory`, `symlink`, or `other`); symbolic links are not followed. The order is unspecified. Resolves to `null` when the directory does not exist and rejects when the path is not a directory.',
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: 'deleteFile',
|
|
197
|
+
type: '(options: { path: string; abortSignal?: AbortSignal }) => PromiseLike<boolean>',
|
|
198
|
+
description:
|
|
199
|
+
'Deletes one file. A symbolic link is deleted itself, not its target. Resolves to `true` when the file was deleted and `false` when it does not exist. Rejects when the path is a directory.',
|
|
200
|
+
},
|
|
93
201
|
]}
|
|
94
202
|
/>
|
|
95
203
|
|