@ai-sdk/provider-utils 5.0.43 → 5.0.45

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,19 @@
1
1
  # @ai-sdk/provider-utils
2
2
 
3
+ ## 5.0.45
4
+
5
+ ### Patch Changes
6
+
7
+ - 2973485: fix(provider-utils): detect AVIF and HEIC images with variable ftyp box sizes
8
+ - a4db5ea: fix(provider-utils): detect AAC audio with ADTS headers
9
+ - 2937ea2: fix(provider-utils): follow validated redirects without waiting for response clone cancellation
10
+
11
+ ## 5.0.44
12
+
13
+ ### Patch Changes
14
+
15
+ - 0455398: fix(provider-utils): make lazy Undici import visible to deployment tracers
16
+
3
17
  ## 5.0.43
4
18
 
5
19
  ### Patch Changes
package/dist/index.js CHANGED
@@ -518,7 +518,7 @@ function handleFetchError({
518
518
  }
519
519
 
520
520
  // src/version.ts
521
- var VERSION = true ? "5.0.43" : "0.0.0-test";
521
+ var VERSION = true ? "5.0.45" : "0.0.0-test";
522
522
 
523
523
  // src/normalize-headers.ts
524
524
  function normalizeHeaders(headers) {
@@ -684,7 +684,8 @@ var imageMediaTypeSignatures = [
684
684
  0,
685
685
  0,
686
686
  0,
687
- 32,
687
+ null,
688
+ // box size (variable)
688
689
  102,
689
690
  116,
690
691
  121,
@@ -701,7 +702,8 @@ var imageMediaTypeSignatures = [
701
702
  0,
702
703
  0,
703
704
  0,
704
- 32,
705
+ null,
706
+ // box size (variable)
705
707
  102,
706
708
  116,
707
709
  121,
@@ -721,6 +723,26 @@ var documentMediaTypeSignatures = [
721
723
  }
722
724
  ];
723
725
  var audioMediaTypeSignaturesWithoutMp4 = [
726
+ {
727
+ mediaType: "audio/aac",
728
+ bytesPrefix: [255, 240]
729
+ // MPEG-4 ADTS with CRC
730
+ },
731
+ {
732
+ mediaType: "audio/aac",
733
+ bytesPrefix: [255, 241]
734
+ // MPEG-4 ADTS without CRC
735
+ },
736
+ {
737
+ mediaType: "audio/aac",
738
+ bytesPrefix: [255, 248]
739
+ // MPEG-2 ADTS with CRC
740
+ },
741
+ {
742
+ mediaType: "audio/aac",
743
+ bytesPrefix: [255, 249]
744
+ // MPEG-2 ADTS without CRC
745
+ },
724
746
  {
725
747
  mediaType: "audio/mpeg",
726
748
  bytesPrefix: [255, 251]
@@ -1179,11 +1201,10 @@ async function getDefaultDownloadFetch() {
1179
1201
  return safeNodeFetchPromise != null ? safeNodeFetchPromise : safeNodeFetchPromise = Promise.resolve().then(createSafeNodeFetch);
1180
1202
  }
1181
1203
  function createSafeNodeFetch() {
1182
- const { createRequire } = loadBuiltinModule("node:module");
1204
+ const module = loadBuiltinModule("node:module");
1183
1205
  const { lookup } = loadBuiltinModule("node:dns");
1184
- const { Agent, fetch } = createRequire(getCurrentModulePath())(
1185
- "undici"
1186
- );
1206
+ const nodeRequire = module.createRequire(getCurrentModulePath());
1207
+ const { Agent, fetch } = nodeRequire("undici");
1187
1208
  const dispatcher = new Agent({
1188
1209
  connect: {
1189
1210
  lookup: createSafeLookup(lookup)
@@ -1319,7 +1340,7 @@ async function fetchWithValidatedRedirects({
1319
1340
  }
1320
1341
  const location = (_a3 = response.headers) == null ? void 0 : _a3.get("location");
1321
1342
  if (REDIRECT_STATUS_CODES.has(response.status) && location) {
1322
- await cancelResponseBody(response);
1343
+ void cancelResponseBody(response);
1323
1344
  const nextUrl = new URL(location, currentUrl).toString();
1324
1345
  if (currentHeaders !== void 0 && !isSameOrigin(nextUrl, currentUrl)) {
1325
1346
  const userAgent = currentHeaders.get("user-agent");