ai 7.0.67 → 7.0.69
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 +14 -0
- package/dist/index.js +1 -1
- package/dist/internal/index.js +1 -1
- package/docs/02-foundations/02-providers-and-models.mdx +1 -0
- package/docs/03-ai-sdk-core/16-mcp-tools.mdx +35 -2
- package/docs/03-ai-sdk-core/38-video-generation.mdx +17 -16
- package/docs/03-ai-sdk-harnesses/02-harness-agent.mdx +51 -4
- package/docs/07-reference/01-ai-sdk-core/23-create-mcp-client.mdx +7 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 7.0.69
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [1f7a464]
|
|
8
|
+
- @ai-sdk/gateway@4.0.55
|
|
9
|
+
|
|
10
|
+
## 7.0.68
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [257632b]
|
|
15
|
+
- @ai-sdk/gateway@4.0.54
|
|
16
|
+
|
|
3
17
|
## 7.0.67
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1143,7 +1143,7 @@ import {
|
|
|
1143
1143
|
} from "@ai-sdk/provider-utils";
|
|
1144
1144
|
|
|
1145
1145
|
// src/version.ts
|
|
1146
|
-
var VERSION = true ? "7.0.
|
|
1146
|
+
var VERSION = true ? "7.0.69" : "0.0.0-test";
|
|
1147
1147
|
|
|
1148
1148
|
// src/util/download/download.ts
|
|
1149
1149
|
var download = async ({
|
package/dist/internal/index.js
CHANGED
|
@@ -97,6 +97,7 @@ The open-source community has created the following providers:
|
|
|
97
97
|
- [ZeroEntropy Provider](/providers/community-providers/zeroentropy) (`zeroentropy-ai-provider`)
|
|
98
98
|
- [Crusoe Provider](/providers/community-providers/crusoe) (`crusoe-ai-provider`)
|
|
99
99
|
- [Neon AI Gateway Provider](/providers/community-providers/neon-ai-gateway) (`@neon/ai-sdk-provider`)
|
|
100
|
+
- [Interfaze Provider](/providers/community-providers/interfaze) (`@interfaze-ai/ai-sdk`)
|
|
100
101
|
|
|
101
102
|
## Self-Hosted Models
|
|
102
103
|
|
|
@@ -25,6 +25,12 @@ Create an MCP client using one of the following transport options:
|
|
|
25
25
|
- SSE (Server-Sent Events): An alternative HTTP-based transport
|
|
26
26
|
- `stdio`: For local development only. Uses standard input/output streams for local MCP servers
|
|
27
27
|
|
|
28
|
+
The AI SDK MCP client supports both legacy initialization-based protocol
|
|
29
|
+
versions and stateless MCP `2026-07-28`. The built-in stdio transport probes
|
|
30
|
+
with `server/discover` and automatically falls back to the legacy
|
|
31
|
+
`initialize` handshake for older servers. Custom transports can opt into this
|
|
32
|
+
negotiation with `supportsProtocolVersionDiscovery: true`.
|
|
33
|
+
|
|
28
34
|
### HTTP Transport (Recommended)
|
|
29
35
|
|
|
30
36
|
For production deployments, we recommend using the HTTP transport. You can configure it directly on the client:
|
|
@@ -49,8 +55,9 @@ const mcpClient = await createMCPClient({
|
|
|
49
55
|
});
|
|
50
56
|
```
|
|
51
57
|
|
|
52
|
-
If
|
|
53
|
-
session by restoring both the previous session id and initialize result
|
|
58
|
+
If a legacy MCP server uses Streamable HTTP sessions, you can reattach to a
|
|
59
|
+
saved session by restoring both the previous session id and initialize result.
|
|
60
|
+
MCP `2026-07-28` is stateless and does not use these options:
|
|
54
61
|
|
|
55
62
|
```typescript
|
|
56
63
|
import { createMCPClient } from '@ai-sdk/mcp';
|
|
@@ -203,6 +210,32 @@ This hook is called before the SDK fetches authorization server metadata, so a
|
|
|
203
210
|
rejected URL is not requested. It is optional and does not change existing OAuth
|
|
204
211
|
flows unless you implement it.
|
|
205
212
|
|
|
213
|
+
### OAuth Callback Issuer Validation
|
|
214
|
+
|
|
215
|
+
When completing an OAuth authorization callback, pass the callback's `iss`
|
|
216
|
+
parameter to `auth` as `callbackIssuer`:
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
import { auth } from '@ai-sdk/mcp';
|
|
220
|
+
|
|
221
|
+
const callbackUrl = new URL(request.url);
|
|
222
|
+
|
|
223
|
+
await auth(myOAuthClientProvider, {
|
|
224
|
+
serverUrl: 'https://mcp.example.com',
|
|
225
|
+
authorizationCode: callbackUrl.searchParams.get('code')!,
|
|
226
|
+
callbackState: callbackUrl.searchParams.get('state') ?? undefined,
|
|
227
|
+
callbackIssuer: callbackUrl.searchParams.get('iss') ?? undefined,
|
|
228
|
+
});
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
When `iss` is present, it must exactly match the discovered authorization
|
|
232
|
+
server issuer. The authorization code is not exchanged when it does not match.
|
|
233
|
+
|
|
234
|
+
Dynamic client registration requests include an OAuth `application_type`. The
|
|
235
|
+
client infers `native` for loopback, localhost, and custom-scheme redirects,
|
|
236
|
+
and `web` for remote HTTP(S) redirects. You can override this by setting
|
|
237
|
+
`application_type` in the provider's `clientMetadata`.
|
|
238
|
+
|
|
206
239
|
### Retrying Transient Tool Failures
|
|
207
240
|
|
|
208
241
|
MCP tool calls can fail for transient transport reasons, such as rate limits,
|
|
@@ -466,21 +466,22 @@ try {
|
|
|
466
466
|
|
|
467
467
|
## Video Models
|
|
468
468
|
|
|
469
|
-
| Provider
|
|
470
|
-
|
|
|
471
|
-
| [
|
|
472
|
-
| [FAL](/providers/ai-sdk-providers/fal#video-models)
|
|
473
|
-
| [
|
|
474
|
-
| [Google
|
|
475
|
-
| [Google Vertex](/providers/ai-sdk-providers/google-vertex#video-models)
|
|
476
|
-
| [Google Vertex](/providers/ai-sdk-providers/google-vertex#video-models)
|
|
477
|
-
| [Google Vertex](/providers/ai-sdk-providers/google-vertex#video-models)
|
|
478
|
-
| [Google Vertex](/providers/ai-sdk-providers/google-vertex#video-models)
|
|
479
|
-
| [
|
|
480
|
-
| [Kling AI](/providers/ai-sdk-providers/klingai#video-models)
|
|
481
|
-
| [Kling AI](/providers/ai-sdk-providers/klingai#video-models)
|
|
482
|
-
| [
|
|
483
|
-
| [
|
|
484
|
-
| [xAI](/providers/ai-sdk-providers/xai#video-models)
|
|
469
|
+
| Provider | Model | Features |
|
|
470
|
+
| ------------------------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------ |
|
|
471
|
+
| [Black Forest Labs](/providers/ai-sdk-providers/black-forest-labs#video-models) | `flux-3-video` | Text-to-video, image-to-video, keyframes, video continuation, audio generation |
|
|
472
|
+
| [FAL](/providers/ai-sdk-providers/fal#video-models) | `luma-dream-machine/ray-2` | Text-to-video, image-to-video |
|
|
473
|
+
| [FAL](/providers/ai-sdk-providers/fal#video-models) | `minimax-video` | Text-to-video |
|
|
474
|
+
| [Google](/providers/ai-sdk-providers/google#video-models) | `veo-2.0-generate-001` | Text-to-video, up to 4 videos per call |
|
|
475
|
+
| [Google Vertex](/providers/ai-sdk-providers/google-vertex#video-models) | `veo-3.1-generate-001` | Text-to-video, audio generation |
|
|
476
|
+
| [Google Vertex](/providers/ai-sdk-providers/google-vertex#video-models) | `veo-3.1-fast-generate-001` | Text-to-video, audio generation |
|
|
477
|
+
| [Google Vertex](/providers/ai-sdk-providers/google-vertex#video-models) | `veo-3.0-generate-001` | Text-to-video, audio generation |
|
|
478
|
+
| [Google Vertex](/providers/ai-sdk-providers/google-vertex#video-models) | `veo-3.0-fast-generate-001` | Text-to-video, audio generation |
|
|
479
|
+
| [Google Vertex](/providers/ai-sdk-providers/google-vertex#video-models) | `veo-2.0-generate-001` | Text-to-video, up to 4 videos per call |
|
|
480
|
+
| [Kling AI](/providers/ai-sdk-providers/klingai#video-models) | `kling-v2.6-t2v` | Text-to-video |
|
|
481
|
+
| [Kling AI](/providers/ai-sdk-providers/klingai#video-models) | `kling-v2.6-i2v` | Image-to-video |
|
|
482
|
+
| [Kling AI](/providers/ai-sdk-providers/klingai#video-models) | `kling-v2.6-motion-control` | Motion control |
|
|
483
|
+
| [Replicate](/providers/ai-sdk-providers/replicate#video-models) | `minimax/video-01` | Text-to-video |
|
|
484
|
+
| [xAI](/providers/ai-sdk-providers/xai#video-models) | `grok-imagine-video` | Text-to-video, image-to-video, editing, extension, R2V |
|
|
485
|
+
| [xAI](/providers/ai-sdk-providers/xai#video-models) | `grok-imagine-video-1.5` | Text-to-video, image-to-video, editing, extension, R2V (with reference audio) |
|
|
485
486
|
|
|
486
487
|
Above are a small subset of the video models supported by the AI SDK providers. For more, see the respective provider documentation.
|
|
@@ -180,6 +180,11 @@ End every session explicitly:
|
|
|
180
180
|
Use `destroy()` for one-off scripts and tests. Use `detach()` or `stop()` for
|
|
181
181
|
HTTP routes that need multi-turn continuity.
|
|
182
182
|
|
|
183
|
+
When you pass `sandboxSession` to `agent.createSession()`, the caller retains
|
|
184
|
+
ownership of that sandbox. `session.stop()` and `session.destroy()` still end
|
|
185
|
+
the harness runtime but do not stop or destroy the supplied sandbox session.
|
|
186
|
+
In this case, the agent does not need a `sandbox` provider in its constructor.
|
|
187
|
+
|
|
183
188
|
```ts
|
|
184
189
|
const session = await agent.createSession({ sessionId: chatId });
|
|
185
190
|
|
|
@@ -401,10 +406,7 @@ const sandboxFromSnapshot = await Sandbox.create({
|
|
|
401
406
|
|
|
402
407
|
const agent = new HarnessAgent({
|
|
403
408
|
harness: claudeCode,
|
|
404
|
-
sandbox: createVercelSandbox({
|
|
405
|
-
sandbox: sandboxFromSnapshot,
|
|
406
|
-
bridgePorts: [4000],
|
|
407
|
-
}),
|
|
409
|
+
sandbox: createVercelSandbox({ sandbox: sandboxFromSnapshot }),
|
|
408
410
|
sandboxConfig,
|
|
409
411
|
});
|
|
410
412
|
|
|
@@ -437,6 +439,51 @@ console.log(preparation.identity);
|
|
|
437
439
|
Adapter-specific settings belong on the adapter factory, for example
|
|
438
440
|
`createCodex({ reasoningEffort: 'high' })`.
|
|
439
441
|
|
|
442
|
+
## Custom Sandbox Orchestration
|
|
443
|
+
|
|
444
|
+
When your application creates and manages sandboxes itself, prepare the network
|
|
445
|
+
sandbox session first and then pass that same session to `agent.createSession()`.
|
|
446
|
+
The agent does not need a sandbox provider and does not stop or destroy the
|
|
447
|
+
caller-owned sandbox.
|
|
448
|
+
|
|
449
|
+
```ts
|
|
450
|
+
import { HarnessAgent, prepareSandboxForHarness } from '@ai-sdk/harness/agent';
|
|
451
|
+
import { claudeCode } from '@ai-sdk/harness-claude-code';
|
|
452
|
+
import { createVercelSandbox } from '@ai-sdk/sandbox-vercel';
|
|
453
|
+
import { Sandbox } from '@vercel/sandbox';
|
|
454
|
+
|
|
455
|
+
const sandbox = await Sandbox.create({
|
|
456
|
+
runtime: 'node24',
|
|
457
|
+
ports: [4000],
|
|
458
|
+
});
|
|
459
|
+
const sandboxProvider = createVercelSandbox({ sandbox });
|
|
460
|
+
const sandboxSession = await sandboxProvider.createSession();
|
|
461
|
+
|
|
462
|
+
await prepareSandboxForHarness({
|
|
463
|
+
session: sandboxSession.restricted(),
|
|
464
|
+
harnesses: [claudeCode],
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
const agent = new HarnessAgent({ harness: claudeCode });
|
|
468
|
+
const session = await agent.createSession({ sandboxSession });
|
|
469
|
+
|
|
470
|
+
try {
|
|
471
|
+
const result = await agent.stream({
|
|
472
|
+
session,
|
|
473
|
+
prompt: 'Create a short TODO.md for this repository.',
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
for await (const part of result.stream) {
|
|
477
|
+
if (part.type === 'text-delta') {
|
|
478
|
+
process.stdout.write(part.text);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
} finally {
|
|
482
|
+
await session.destroy();
|
|
483
|
+
await sandbox.stop();
|
|
484
|
+
}
|
|
485
|
+
```
|
|
486
|
+
|
|
440
487
|
## Next Steps
|
|
441
488
|
|
|
442
489
|
- [Tools](/docs/ai-sdk-harnesses/tools) for built-in and host-executed tools.
|
|
@@ -121,14 +121,14 @@ It currently does not support accepting notifications from an MCP server, and cu
|
|
|
121
121
|
type: 'string',
|
|
122
122
|
isOptional: true,
|
|
123
123
|
description:
|
|
124
|
-
'Initial MCP session id to send with resumed Streamable HTTP requests after initialization. Pair with initialInitializeResult when using createMCPClient. Only used by the HTTP transport.',
|
|
124
|
+
'Initial legacy MCP session id to send with resumed Streamable HTTP requests after initialization. Pair with initialInitializeResult when using createMCPClient. Only used by the HTTP transport and initialization-based protocol versions.',
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
name: 'initialProtocolVersion',
|
|
128
128
|
type: 'string',
|
|
129
129
|
isOptional: true,
|
|
130
130
|
description:
|
|
131
|
-
'Initial MCP protocol version to send before initialize negotiates one. Only used by the HTTP transport.',
|
|
131
|
+
'Initial legacy MCP protocol version to send before initialize negotiates one. Only used by the HTTP transport.',
|
|
132
132
|
},
|
|
133
133
|
{
|
|
134
134
|
name: 'onSessionIdChange',
|
|
@@ -167,7 +167,7 @@ It currently does not support accepting notifications from an MCP server, and cu
|
|
|
167
167
|
type: 'RequestOptions',
|
|
168
168
|
isOptional: true,
|
|
169
169
|
description:
|
|
170
|
-
'Optional signal and timeout settings that bound transport startup and
|
|
170
|
+
'Optional signal and timeout settings that bound transport startup and protocol negotiation. A timeout or abort closes the transport and rejects createMCPClient.',
|
|
171
171
|
},
|
|
172
172
|
{
|
|
173
173
|
name: 'clientName',
|
|
@@ -206,14 +206,14 @@ It currently does not support accepting notifications from an MCP server, and cu
|
|
|
206
206
|
type: 'InitializeResult',
|
|
207
207
|
isOptional: true,
|
|
208
208
|
description:
|
|
209
|
-
'Initialize result from a previous MCP session. When provided, the client starts the transport and reuses this metadata without sending a new initialize request.',
|
|
209
|
+
'Initialize result from a previous legacy MCP session. When provided, the client starts the transport and reuses this metadata without sending a new initialize request.',
|
|
210
210
|
},
|
|
211
211
|
{
|
|
212
212
|
name: 'capabilities',
|
|
213
213
|
type: 'ClientCapabilities',
|
|
214
214
|
isOptional: true,
|
|
215
215
|
description:
|
|
216
|
-
'Optional client capabilities to advertise during initialization. For example, set { elicitation: {} } to enable handling elicitation requests from the server.',
|
|
216
|
+
'Optional client capabilities to advertise during legacy initialization or on each stateless modern request. For example, set { elicitation: {} } to enable handling elicitation requests from the server.',
|
|
217
217
|
},
|
|
218
218
|
],
|
|
219
219
|
},
|
|
@@ -232,13 +232,13 @@ Returns a Promise that resolves to an `MCPClient` with the following properties
|
|
|
232
232
|
name: 'initializeResult',
|
|
233
233
|
type: 'InitializeResult',
|
|
234
234
|
description:
|
|
235
|
-
'
|
|
235
|
+
'Connection metadata used by this client. For legacy servers this is the initialize result; for modern servers an equivalent value is derived from protocol discovery.',
|
|
236
236
|
},
|
|
237
237
|
{
|
|
238
238
|
name: 'serverInfo',
|
|
239
239
|
type: 'Configuration',
|
|
240
240
|
description:
|
|
241
|
-
'Information about the connected MCP server (name, version, optional title), as reported during
|
|
241
|
+
'Information about the connected MCP server (name, version, optional title), as reported during initialization or protocol discovery.',
|
|
242
242
|
},
|
|
243
243
|
{
|
|
244
244
|
name: 'instructions',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.69",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ai-sdk/gateway": "4.0.
|
|
45
|
+
"@ai-sdk/gateway": "4.0.55",
|
|
46
46
|
"@ai-sdk/provider": "4.0.7",
|
|
47
47
|
"@ai-sdk/provider-utils": "5.0.27"
|
|
48
48
|
},
|