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
|
@@ -143,7 +143,7 @@ It also contains the following helper functions:
|
|
|
143
143
|
href: '/docs/reference/ai-sdk-core/sandbox',
|
|
144
144
|
},
|
|
145
145
|
{
|
|
146
|
-
title: '
|
|
146
|
+
title: 'filterActiveTools()',
|
|
147
147
|
description: 'Filters a tool set to only the currently active tools.',
|
|
148
148
|
href: '/docs/reference/ai-sdk-core/filter-active-tools',
|
|
149
149
|
},
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
2
|
+
title: MCPAppRenderer
|
|
3
3
|
description: API reference for rendering MCP Apps with @ai-sdk/react.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# `
|
|
6
|
+
# `MCPAppRenderer`
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
`experimental_MCPAppRenderer` is experimental and may change in a future
|
|
10
|
-
release.
|
|
11
|
-
</Note>
|
|
12
|
-
|
|
13
|
-
`experimental_MCPAppRenderer` renders an MCP App for an AI SDK tool UI part. It detects MCP App metadata on the tool part, loads the app resource, renders the app in a sandbox proxy iframe, and bridges MCP Apps JSON-RPC messages between the iframe and your host application.
|
|
8
|
+
`MCPAppRenderer` renders an MCP App for an AI SDK tool UI part. It detects MCP App metadata on the tool part, loads the app resource, renders the app in a sandbox proxy iframe, and bridges MCP Apps JSON-RPC messages between the iframe and your host application.
|
|
14
9
|
|
|
15
10
|
For tool parts without MCP App metadata, the component renders the `fallback`.
|
|
16
11
|
|
|
17
12
|
## Import
|
|
18
13
|
|
|
19
14
|
<Snippet
|
|
20
|
-
text={`import {
|
|
15
|
+
text={`import { MCPAppRenderer } from "@ai-sdk/react"`}
|
|
21
16
|
prompt={false}
|
|
22
17
|
/>
|
|
23
18
|
|
|
@@ -27,7 +22,7 @@ For tool parts without MCP App metadata, the component renders the `fallback`.
|
|
|
27
22
|
'use client';
|
|
28
23
|
|
|
29
24
|
import {
|
|
30
|
-
|
|
25
|
+
MCPAppRenderer,
|
|
31
26
|
type MCPAppBridgeHandlers,
|
|
32
27
|
type MCPAppMetadata,
|
|
33
28
|
type MCPAppResource,
|
|
@@ -198,7 +193,7 @@ export function MessagePart({ part }: { part: unknown }) {
|
|
|
198
193
|
|
|
199
194
|
## Bridge Handlers
|
|
200
195
|
|
|
201
|
-
`
|
|
196
|
+
`MCPAppRenderer` uses these handlers to respond to iframe requests. In production, server-backed handlers should validate authorization and MCP Apps tool visibility before calling the MCP server.
|
|
202
197
|
|
|
203
198
|
<PropertiesTable
|
|
204
199
|
content={[
|
|
@@ -77,7 +77,7 @@ AI SDK UI contains the following hooks:
|
|
|
77
77
|
href: '/docs/reference/ai-sdk-ui/websocket-chat-transport',
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
|
-
title: '
|
|
80
|
+
title: 'MCPAppRenderer',
|
|
81
81
|
description: 'Render interactive MCP App tool UIs in React.',
|
|
82
82
|
href: '/docs/reference/ai-sdk-ui/mcp-app-renderer',
|
|
83
83
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.158",
|
|
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,20 +42,20 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ai-sdk/gateway": "4.0.
|
|
46
|
-
"@ai-sdk/provider": "4.0.
|
|
47
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
45
|
+
"@ai-sdk/gateway": "4.0.131",
|
|
46
|
+
"@ai-sdk/provider": "4.0.35",
|
|
47
|
+
"@ai-sdk/provider-utils": "5.0.72"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@ai-sdk/amazon-bedrock": "5.0.
|
|
51
|
-
"@ai-sdk/deepseek": "3.0.
|
|
52
|
-
"@ai-sdk/google": "4.0.
|
|
53
|
-
"@ai-sdk/groq": "4.0.
|
|
54
|
-
"@ai-sdk/huggingface": "2.0.
|
|
55
|
-
"@ai-sdk/moonshotai": "3.0.
|
|
56
|
-
"@ai-sdk/openai": "4.0.
|
|
50
|
+
"@ai-sdk/amazon-bedrock": "5.0.129",
|
|
51
|
+
"@ai-sdk/deepseek": "3.0.77",
|
|
52
|
+
"@ai-sdk/google": "4.0.109",
|
|
53
|
+
"@ai-sdk/groq": "4.0.74",
|
|
54
|
+
"@ai-sdk/huggingface": "2.0.82",
|
|
55
|
+
"@ai-sdk/moonshotai": "3.0.82",
|
|
56
|
+
"@ai-sdk/openai": "4.0.106",
|
|
57
57
|
"@ai-sdk/test-server": "2.0.4",
|
|
58
|
-
"@ai-sdk/xai": "5.0.
|
|
58
|
+
"@ai-sdk/xai": "5.0.34",
|
|
59
59
|
"@edge-runtime/vm": "^5.0.0",
|
|
60
60
|
"@smithy/eventstream-codec": "^4.3.3",
|
|
61
61
|
"@smithy/util-utf8": "^4.3.3",
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export type { ActiveTools } from './active-tools';
|
|
2
2
|
export type { ContentPart } from './content-part';
|
|
3
|
-
export {
|
|
3
|
+
export {
|
|
4
|
+
filterActiveTools,
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use `filterActiveTools` instead.
|
|
8
|
+
*/
|
|
9
|
+
filterActiveTools as experimental_filterActiveTools,
|
|
10
|
+
} from './filter-active-tools';
|
|
4
11
|
export { generateText, type GenerateTextInclude } from './generate-text';
|
|
5
12
|
export type {
|
|
6
13
|
GenerateTextAbortEvent,
|
|
@@ -69,6 +76,11 @@ export {
|
|
|
69
76
|
} from './stop-condition';
|
|
70
77
|
export {
|
|
71
78
|
streamLanguageModelCall as experimental_streamLanguageModelCall,
|
|
79
|
+
type LanguageModelStreamPart,
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @deprecated Use `LanguageModelStreamPart` instead. This alias will be removed in v8.
|
|
83
|
+
*/
|
|
72
84
|
type LanguageModelStreamPart as Experimental_LanguageModelStreamPart,
|
|
73
85
|
} from './stream-language-model-call';
|
|
74
86
|
export {
|
package/src/index.ts
CHANGED
package/src/test/mock-sandbox.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Experimental_SandboxSession } from '@ai-sdk/provider-utils';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* File stubs and an unimplemented spawn method on `Experimental_SandboxSession`,
|
|
4
|
+
* File and path stubs and an unimplemented spawn method on `Experimental_SandboxSession`,
|
|
5
5
|
* intended to be spread into test fixtures that only care about `run`.
|
|
6
6
|
*/
|
|
7
7
|
export const mockSandboxSessionFileStubs: Pick<
|
|
@@ -12,6 +12,9 @@ export const mockSandboxSessionFileStubs: Pick<
|
|
|
12
12
|
| 'writeFile'
|
|
13
13
|
| 'writeBinaryFile'
|
|
14
14
|
| 'writeTextFile'
|
|
15
|
+
| 'stat'
|
|
16
|
+
| 'listDirectory'
|
|
17
|
+
| 'deleteFile'
|
|
15
18
|
| 'spawn'
|
|
16
19
|
> = {
|
|
17
20
|
readFile: async () => null,
|
|
@@ -20,6 +23,9 @@ export const mockSandboxSessionFileStubs: Pick<
|
|
|
20
23
|
writeFile: async () => {},
|
|
21
24
|
writeBinaryFile: async () => {},
|
|
22
25
|
writeTextFile: async () => {},
|
|
26
|
+
stat: async () => null,
|
|
27
|
+
listDirectory: async () => null,
|
|
28
|
+
deleteFile: async () => false,
|
|
23
29
|
spawn: async () => {
|
|
24
30
|
throw new Error('spawn is not implemented in this mock.');
|
|
25
31
|
},
|
package/src/util/fix-json.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export function isNodeRuntime(): boolean {
|
|
2
|
-
|
|
2
|
+
// Access the optional global directly so Edge bundlers do not treat this
|
|
3
|
+
// runtime check as an unsupported use of the Node.js process API.
|
|
4
|
+
return globalThis.process?.release?.name === 'node';
|
|
3
5
|
}
|