ai 6.0.324 → 6.0.326

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.
@@ -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.324" : "0.0.0-test";
167
+ var VERSION = true ? "6.0.326" : "0.0.0-test";
168
168
 
169
169
  // src/util/download/download.ts
170
170
  var download = async ({
@@ -144,7 +144,7 @@ import {
144
144
  } from "@ai-sdk/provider-utils";
145
145
 
146
146
  // src/version.ts
147
- var VERSION = true ? "6.0.324" : "0.0.0-test";
147
+ var VERSION = true ? "6.0.326" : "0.0.0-test";
148
148
 
149
149
  // src/util/download/download.ts
150
150
  var download = async ({
@@ -43,12 +43,17 @@ const mcpClient = await createMCPClient({
43
43
  // optional: provide an OAuth client provider for automatic authorization
44
44
  authProvider: myOAuthClientProvider,
45
45
 
46
- // optional: reject redirect responses to prevent SSRF
46
+ // optional: reject redirect responses (the default for HTTP transport)
47
47
  redirect: 'error',
48
48
  },
49
49
  });
50
50
  ```
51
51
 
52
+ The built-in HTTP transport rejects redirects by default for GET, POST, and DELETE
53
+ requests. Configure the final MCP endpoint URL directly, including private endpoints
54
+ you intend to access. Only set `redirect: 'follow'` when you trust all redirect
55
+ destinations, since redirects can reach unintended hosts and private networks.
56
+
52
57
  Alternatively, you can use `StreamableHTTPClientTransport` from MCP's official TypeScript SDK:
53
58
 
54
59
  ```typescript
@@ -114,7 +114,7 @@ It currently does not support accepting notifications from an MCP server, and cu
114
114
  type: "'follow' | 'error'",
115
115
  isOptional: true,
116
116
  description:
117
- "Controls how HTTP redirects are handled for transport requests. Set to 'error' to reject any redirect response, preventing servers from redirecting requests to unintended hosts. Defaults to 'follow'.",
117
+ "Controls how HTTP redirects are handled for transport requests. Defaults to 'error' for HTTP transport and 'follow' for SSE transport. Only set to 'follow' when redirect destinations are trusted, since redirects can reach unintended hosts and private networks.",
118
118
  },
119
119
  ],
120
120
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "6.0.324",
3
+ "version": "6.0.326",
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.230",
48
+ "@ai-sdk/gateway": "3.0.232",
49
49
  "@ai-sdk/provider": "3.0.19",
50
- "@ai-sdk/provider-utils": "4.0.64"
50
+ "@ai-sdk/provider-utils": "4.0.65"
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.142",
62
- "@ai-sdk/perplexity": "3.1.10",
61
+ "@ai-sdk/google": "3.0.143",
62
+ "@ai-sdk/perplexity": "3.1.11",
63
63
  "@ai-sdk/test-server": "1.0.6",
64
64
  "@vercel/ai-tsconfig": "0.0.0"
65
65
  },
@@ -382,9 +382,9 @@ export async function generateObject<
382
382
  'ai.response.model': responseData.modelId,
383
383
  'ai.response.timestamp':
384
384
  responseData.timestamp.toISOString(),
385
- 'ai.response.providerMetadata': JSON.stringify(
386
- result.providerMetadata,
387
- ),
385
+ 'ai.response.providerMetadata': {
386
+ output: () => JSON.stringify(result.providerMetadata),
387
+ },
388
388
 
389
389
  // TODO rename telemetry attributes to inputTokens and outputTokens
390
390
  'ai.usage.promptTokens': result.usage.inputTokens.total,
@@ -449,9 +449,9 @@ export async function generateObject<
449
449
  'ai.response.object': {
450
450
  output: () => JSON.stringify(object),
451
451
  },
452
- 'ai.response.providerMetadata': JSON.stringify(
453
- resultProviderMetadata,
454
- ),
452
+ 'ai.response.providerMetadata': {
453
+ output: () => JSON.stringify(resultProviderMetadata),
454
+ },
455
455
 
456
456
  // TODO rename telemetry attributes to inputTokens and outputTokens
457
457
  'ai.usage.promptTokens': usage.inputTokens,
@@ -814,8 +814,9 @@ class DefaultStreamObjectResult<
814
814
  'ai.response.model': fullResponse.modelId,
815
815
  'ai.response.timestamp':
816
816
  fullResponse.timestamp.toISOString(),
817
- 'ai.response.providerMetadata':
818
- JSON.stringify(providerMetadata),
817
+ 'ai.response.providerMetadata': {
818
+ output: () => JSON.stringify(providerMetadata),
819
+ },
819
820
 
820
821
  'ai.usage.inputTokens': finalUsage.inputTokens,
821
822
  'ai.usage.outputTokens': finalUsage.outputTokens,
@@ -851,8 +852,9 @@ class DefaultStreamObjectResult<
851
852
  'ai.response.object': {
852
853
  output: () => JSON.stringify(object),
853
854
  },
854
- 'ai.response.providerMetadata':
855
- JSON.stringify(providerMetadata),
855
+ 'ai.response.providerMetadata': {
856
+ output: () => JSON.stringify(providerMetadata),
857
+ },
856
858
  },
857
859
  }),
858
860
  );
@@ -903,9 +903,9 @@ export async function generateText<
903
903
  'ai.response.model': responseData.modelId,
904
904
  'ai.response.timestamp':
905
905
  responseData.timestamp.toISOString(),
906
- 'ai.response.providerMetadata': JSON.stringify(
907
- result.providerMetadata,
908
- ),
906
+ 'ai.response.providerMetadata': {
907
+ output: () => JSON.stringify(result.providerMetadata),
908
+ },
909
909
 
910
910
  'ai.usage.inputTokens': result.usage.inputTokens.total,
911
911
  'ai.usage.inputTokenDetails.noCacheTokens':
@@ -1251,9 +1251,10 @@ export async function generateText<
1251
1251
  : JSON.stringify(toolCalls);
1252
1252
  },
1253
1253
  },
1254
- 'ai.response.providerMetadata': JSON.stringify(
1255
- currentModelResponse.providerMetadata,
1256
- ),
1254
+ 'ai.response.providerMetadata': {
1255
+ output: () =>
1256
+ JSON.stringify(currentModelResponse.providerMetadata),
1257
+ },
1257
1258
  },
1258
1259
  }),
1259
1260
  );
@@ -1323,9 +1323,9 @@ class DefaultStreamTextResult<
1323
1323
  ? JSON.stringify(finalStep.toolCalls)
1324
1324
  : undefined,
1325
1325
  },
1326
- 'ai.response.providerMetadata': JSON.stringify(
1327
- finalStep.providerMetadata,
1328
- ),
1326
+ 'ai.response.providerMetadata': {
1327
+ output: () => JSON.stringify(finalStep.providerMetadata),
1328
+ },
1329
1329
  'ai.usage.inputTokens': totalUsage.inputTokens,
1330
1330
  'ai.usage.inputTokenDetails.noCacheTokens':
1331
1331
  totalUsage.inputTokenDetails?.noCacheTokens,
@@ -2333,9 +2333,10 @@ class DefaultStreamTextResult<
2333
2333
  'ai.response.reasoning': {
2334
2334
  output: () => processedStep.reasoningText,
2335
2335
  },
2336
- 'ai.response.providerMetadata': JSON.stringify(
2337
- processedStep.providerMetadata,
2338
- ),
2336
+ 'ai.response.providerMetadata': {
2337
+ output: () =>
2338
+ JSON.stringify(processedStep.providerMetadata),
2339
+ },
2339
2340
  },
2340
2341
  }),
2341
2342
  );