@ai-sdk/provider-utils 5.0.50 → 5.0.51

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/provider-utils
2
2
 
3
+ ## 5.0.51
4
+
5
+ ### Patch Changes
6
+
7
+ - c2511c1: fix: use standards-compliant User-Agent header
8
+
3
9
  ## 5.0.50
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -404,19 +404,16 @@ function extractResponseHeaders(response) {
404
404
 
405
405
  // src/get-runtime-environment-user-agent.ts
406
406
  function getRuntimeEnvironmentUserAgent(globalThisAny = globalThis) {
407
- if (globalThisAny.window) {
408
- return `runtime/browser`;
409
- }
410
407
  if (globalThisAny.navigator?.userAgent) {
411
- return `runtime/${globalThisAny.navigator.userAgent.toLowerCase()}`;
408
+ return globalThisAny.navigator.userAgent.toLowerCase();
412
409
  }
413
410
  if (globalThisAny.process?.versions?.node) {
414
- return `runtime/node.js/${globalThisAny.process.version.substring(0)}`;
411
+ return `node.js/${globalThisAny.process.version}`;
415
412
  }
416
413
  if (globalThisAny.EdgeRuntime) {
417
- return `runtime/vercel-edge`;
414
+ return "vercel-edge";
418
415
  }
419
- return "runtime/unknown";
416
+ return "";
420
417
  }
421
418
 
422
419
  // src/handle-fetch-error.ts
@@ -503,7 +500,7 @@ function handleFetchError({
503
500
  }
504
501
 
505
502
  // src/version.ts
506
- var VERSION = true ? "5.0.50" : "0.0.0-test";
503
+ var VERSION = true ? "5.0.51" : "0.0.0-test";
507
504
 
508
505
  // src/normalize-headers.ts
509
506
  function normalizeHeaders(headers) {
@@ -554,7 +551,7 @@ var deleteFromApi = async ({
554
551
  method: "DELETE",
555
552
  headers: withUserAgentSuffix(
556
553
  headers,
557
- `ai-sdk/provider-utils/${VERSION}`,
554
+ `ai-sdk-provider-utils/${VERSION}`,
558
555
  getRuntimeEnvironmentUserAgent()
559
556
  ),
560
557
  signal: abortSignal
@@ -1549,7 +1546,7 @@ var getFromApi = async ({
1549
1546
  const outgoingHeaders = credentialedOrigin !== void 0 && !isSameOrigin(url, credentialedOrigin) ? {} : headers;
1550
1547
  const requestHeaders = withUserAgentSuffix(
1551
1548
  outgoingHeaders,
1552
- `ai-sdk/provider-utils/${VERSION}`,
1549
+ `ai-sdk-provider-utils/${VERSION}`,
1553
1550
  getRuntimeEnvironmentUserAgent()
1554
1551
  );
1555
1552
  const response = validateUrl ? await fetchWithValidatedRedirects({
@@ -3499,7 +3496,7 @@ var postMultipartStreamToApi = async ({
3499
3496
  ...headers,
3500
3497
  "Content-Type": `multipart/form-data; boundary=${boundary}`
3501
3498
  },
3502
- `ai-sdk/provider-utils/${VERSION}`,
3499
+ `ai-sdk-provider-utils/${VERSION}`,
3503
3500
  getRuntimeEnvironmentUserAgent()
3504
3501
  ),
3505
3502
  body: body.stream,
@@ -3618,7 +3615,7 @@ var postToApi = async ({
3618
3615
  method: "POST",
3619
3616
  headers: withUserAgentSuffix(
3620
3617
  headers,
3621
- `ai-sdk/provider-utils/${VERSION}`,
3618
+ `ai-sdk-provider-utils/${VERSION}`,
3622
3619
  getRuntimeEnvironmentUserAgent()
3623
3620
  ),
3624
3621
  body: body.content,