ai 6.0.326 → 6.0.329
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 +26 -0
- package/dist/index.js +59 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +59 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/docs/02-foundations/02-providers-and-models.mdx +2 -0
- package/docs/03-ai-sdk-core/16-mcp-tools.mdx +18 -1
- package/package.json +5 -5
- package/src/generate-text/generate-text.ts +5 -1
- package/src/generate-text/stream-text.ts +5 -1
- package/src/telemetry/redact-tool-definition.ts +68 -0
package/dist/internal/index.js
CHANGED
|
@@ -164,7 +164,7 @@ function detectMediaType({
|
|
|
164
164
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
165
165
|
|
|
166
166
|
// src/version.ts
|
|
167
|
-
var VERSION = true ? "6.0.
|
|
167
|
+
var VERSION = true ? "6.0.329" : "0.0.0-test";
|
|
168
168
|
|
|
169
169
|
// src/util/download/download.ts
|
|
170
170
|
var download = async ({
|
package/dist/internal/index.mjs
CHANGED
|
@@ -140,6 +140,7 @@ Here are the capabilities of popular models:
|
|
|
140
140
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5.1` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
141
141
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5-codex` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
142
142
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5-chat-latest` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
143
|
+
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-fable-5-2` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
143
144
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-fable-5-1` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
144
145
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-opus-5-5` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
145
146
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-sonnet-5-5` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
@@ -153,6 +154,7 @@ Here are the capabilities of popular models:
|
|
|
153
154
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-opus-4-1` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
154
155
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-opus-4-0` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
155
156
|
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-sonnet-4-0` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
157
|
+
| [Google Generative AI](/providers/ai-sdk-providers/google-generative-ai) | `gemini-4-carbon` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
156
158
|
| [Google Generative AI](/providers/ai-sdk-providers/google-generative-ai) | `gemini-3.8-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
157
159
|
| [Google Generative AI](/providers/ai-sdk-providers/google-generative-ai) | `gemini-3.1-pro-preview` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
158
160
|
| [Google Generative AI](/providers/ai-sdk-providers/google-generative-ai) | `gemini-3-pro-preview` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
@@ -152,7 +152,11 @@ If they no longer match, leave the newer tokens in storage. The SDK retries
|
|
|
152
152
|
authorization and reads the stored tokens again.
|
|
153
153
|
|
|
154
154
|
The SDK also provides this context when invalidating stored tokens that lack an
|
|
155
|
-
authorization server pin.
|
|
155
|
+
authorization server pin. These tokens must be cleared before the SDK saves a new
|
|
156
|
+
client registration or authorization server pin. If the invalidation hook is
|
|
157
|
+
missing or refresh tokens remain in storage, authorization stops with an error;
|
|
158
|
+
clear the stored tokens and start authorization again. Other invalidations can
|
|
159
|
+
omit the context.
|
|
156
160
|
|
|
157
161
|
If an authorization-code exchange returns `invalid_grant`, the SDK propagates
|
|
158
162
|
the error without invalidating stored credentials or retrying the rejected code.
|
|
@@ -218,6 +222,19 @@ This hook is called before the SDK fetches authorization server metadata, so a
|
|
|
218
222
|
rejected URL is not requested. The hook is an optional additional restriction;
|
|
219
223
|
it does not replace the credential binding required for confidential clients.
|
|
220
224
|
|
|
225
|
+
On Node.js, OAuth discovery validates and pins DNS results for untrusted
|
|
226
|
+
URLs. On Bun, Deno, and other server runtimes without this transport, discovery
|
|
227
|
+
blocks untrusted authorization-server URLs, redirects, token endpoints, and
|
|
228
|
+
registration endpoints unless you supply a
|
|
229
|
+
custom `fetch` with equivalent connect-time address validation and DNS pinning.
|
|
230
|
+
Passing global `fetch` explicitly does not opt out of this requirement. The
|
|
231
|
+
configured MCP server origin remains supported, including local endpoints;
|
|
232
|
+
response-supplied authorization-server hosts are not automatically trusted.
|
|
233
|
+
Browser window discovery remains supported. Browser Web Workers and Service
|
|
234
|
+
Workers without a DOM follow the strict custom-fetch requirement as well;
|
|
235
|
+
worker globals alone cannot establish that the runtime is a browser rather
|
|
236
|
+
than a server worker.
|
|
237
|
+
|
|
221
238
|
### OAuth Callback Issuer Validation
|
|
222
239
|
|
|
223
240
|
When completing an OAuth authorization callback, pass the callback's `iss`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.329",
|
|
4
4
|
"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.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@opentelemetry/api": "^1.9.0",
|
|
48
|
-
"@ai-sdk/gateway": "3.0.
|
|
48
|
+
"@ai-sdk/gateway": "3.0.235",
|
|
49
49
|
"@ai-sdk/provider": "3.0.19",
|
|
50
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
50
|
+
"@ai-sdk/provider-utils": "4.0.66"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@edge-runtime/vm": "^5.0.0",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"tsx": "^4.19.2",
|
|
59
59
|
"typescript": "5.8.3",
|
|
60
60
|
"zod": "3.25.76",
|
|
61
|
-
"@ai-sdk/google": "3.0.
|
|
62
|
-
"@ai-sdk/perplexity": "3.1.
|
|
61
|
+
"@ai-sdk/google": "3.0.145",
|
|
62
|
+
"@ai-sdk/perplexity": "3.1.12",
|
|
63
63
|
"@ai-sdk/test-server": "1.0.6",
|
|
64
64
|
"@vercel/ai-tsconfig": "0.0.0"
|
|
65
65
|
},
|
|
@@ -36,6 +36,7 @@ import { getTracer } from '../telemetry/get-tracer';
|
|
|
36
36
|
import { recordSpan } from '../telemetry/record-span';
|
|
37
37
|
import { selectTelemetryAttributes } from '../telemetry/select-telemetry-attributes';
|
|
38
38
|
import { stringifyForTelemetry } from '../telemetry/stringify-for-telemetry';
|
|
39
|
+
import { redactToolDefinition } from '../telemetry/redact-tool-definition';
|
|
39
40
|
import { getGlobalTelemetryIntegration } from '../telemetry/get-global-telemetry-integration';
|
|
40
41
|
import type { TelemetrySettings } from '../telemetry/telemetry-settings';
|
|
41
42
|
import type {
|
|
@@ -831,7 +832,10 @@ export async function generateText<
|
|
|
831
832
|
},
|
|
832
833
|
'ai.prompt.tools': {
|
|
833
834
|
// convert the language model level tools:
|
|
834
|
-
input: () =>
|
|
835
|
+
input: () =>
|
|
836
|
+
stepTools?.map(tool =>
|
|
837
|
+
JSON.stringify(redactToolDefinition(tool)),
|
|
838
|
+
),
|
|
835
839
|
},
|
|
836
840
|
'ai.prompt.toolChoice': {
|
|
837
841
|
input: () =>
|
|
@@ -38,6 +38,7 @@ import { getTracer } from '../telemetry/get-tracer';
|
|
|
38
38
|
import { recordSpan } from '../telemetry/record-span';
|
|
39
39
|
import { selectTelemetryAttributes } from '../telemetry/select-telemetry-attributes';
|
|
40
40
|
import { stringifyForTelemetry } from '../telemetry/stringify-for-telemetry';
|
|
41
|
+
import { redactToolDefinition } from '../telemetry/redact-tool-definition';
|
|
41
42
|
import { getGlobalTelemetryIntegration } from '../telemetry/get-global-telemetry-integration';
|
|
42
43
|
import type { TelemetrySettings } from '../telemetry/telemetry-settings';
|
|
43
44
|
import { createTextStreamResponse } from '../text-stream/create-text-stream-response';
|
|
@@ -1898,7 +1899,10 @@ class DefaultStreamTextResult<
|
|
|
1898
1899
|
},
|
|
1899
1900
|
'ai.prompt.tools': {
|
|
1900
1901
|
// convert the language model level tools:
|
|
1901
|
-
input: () =>
|
|
1902
|
+
input: () =>
|
|
1903
|
+
stepTools?.map(tool =>
|
|
1904
|
+
JSON.stringify(redactToolDefinition(tool)),
|
|
1905
|
+
),
|
|
1902
1906
|
},
|
|
1903
1907
|
'ai.prompt.toolChoice': {
|
|
1904
1908
|
input: () =>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redact credentials in telemetry-only copies of provider tool definitions.
|
|
3
|
+
* Never modify the arguments passed to the provider or application.
|
|
4
|
+
*/
|
|
5
|
+
export function redactToolDefinition(
|
|
6
|
+
tool: Record<string, unknown>,
|
|
7
|
+
): Record<string, unknown> {
|
|
8
|
+
if (tool.type !== 'provider') {
|
|
9
|
+
return tool;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const args = tool.args;
|
|
13
|
+
if (!isRecord(args)) return tool;
|
|
14
|
+
|
|
15
|
+
if (tool.id === 'openai.mcp') {
|
|
16
|
+
return {
|
|
17
|
+
...tool,
|
|
18
|
+
args: {
|
|
19
|
+
...args,
|
|
20
|
+
...(args.authorization != null ? { authorization: '[redacted]' } : {}),
|
|
21
|
+
...(isRecord(args.headers)
|
|
22
|
+
? {
|
|
23
|
+
headers: Object.fromEntries(
|
|
24
|
+
Object.keys(args.headers).map(name => [name, '[redacted]']),
|
|
25
|
+
),
|
|
26
|
+
}
|
|
27
|
+
: {}),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const containerKey =
|
|
33
|
+
tool.id === 'openai.code_interpreter'
|
|
34
|
+
? 'container'
|
|
35
|
+
: tool.id === 'openai.shell'
|
|
36
|
+
? 'environment'
|
|
37
|
+
: undefined;
|
|
38
|
+
if (containerKey == null) return tool;
|
|
39
|
+
|
|
40
|
+
const container = args[containerKey];
|
|
41
|
+
if (!isRecord(container)) return tool;
|
|
42
|
+
const networkPolicy = container.networkPolicy;
|
|
43
|
+
if (!isRecord(networkPolicy) || !Array.isArray(networkPolicy.domainSecrets)) {
|
|
44
|
+
return tool;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
...tool,
|
|
49
|
+
args: {
|
|
50
|
+
...args,
|
|
51
|
+
[containerKey]: {
|
|
52
|
+
...container,
|
|
53
|
+
networkPolicy: {
|
|
54
|
+
...networkPolicy,
|
|
55
|
+
domainSecrets: networkPolicy.domainSecrets.map(secret =>
|
|
56
|
+
isRecord(secret) && 'value' in secret
|
|
57
|
+
? { ...secret, value: '[redacted]' }
|
|
58
|
+
: secret,
|
|
59
|
+
),
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
67
|
+
return value != null && typeof value === 'object' && !Array.isArray(value);
|
|
68
|
+
}
|