@ai-sdk/provider-utils 3.0.22 → 3.0.24

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
+ ## 3.0.24
4
+
5
+ ### Patch Changes
6
+
7
+ - 0a00b9b: trigger release for all packages after provenance setup
8
+ - Updated dependencies [0a00b9b]
9
+ - @ai-sdk/provider@2.0.2
10
+
11
+ ## 3.0.23
12
+
13
+ ### Patch Changes
14
+
15
+ - a27a978: fix: allow inline data URLs in download validation
16
+
3
17
  ## 3.0.22
4
18
 
5
19
  ### Patch Changes
@@ -13,7 +27,7 @@
13
27
 
14
28
  - 20565b8: security: prevent unbounded memory growth in download functions
15
29
 
16
- The `download()` and `downloadBlob()` functions now enforce a default 2 GiB size limit when downloading from user-provided URLs. Downloads that exceed this limit are aborted with a `DownloadError` instead of consuming unbounded memory and crashing the process. The `abortSignal` parameter is now passed through to `fetch()` in all download call sites.
30
+ The `download()` function now enforces a default 2 GiB size limit when downloading from user-provided URLs. Downloads that exceed this limit are aborted with a `DownloadError` instead of consuming unbounded memory and crashing the process. The `abortSignal` parameter is now passed through to `fetch()` in all download call sites.
17
31
 
18
32
  Added `download` option to `transcribe()` and `experimental_generateVideo()` for providing a custom download function. Use the new `createDownload({ maxBytes })` factory to configure download size limits.
19
33
 
package/dist/index.js CHANGED
@@ -29,8 +29,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
30
 
31
31
  // src/index.ts
32
- var src_exports = {};
33
- __export(src_exports, {
32
+ var index_exports = {};
33
+ __export(index_exports, {
34
34
  DEFAULT_MAX_DOWNLOAD_SIZE: () => DEFAULT_MAX_DOWNLOAD_SIZE,
35
35
  DelayedPromise: () => DelayedPromise,
36
36
  DownloadError: () => DownloadError,
@@ -93,7 +93,7 @@ __export(src_exports, {
93
93
  withoutTrailingSlash: () => withoutTrailingSlash,
94
94
  zodSchema: () => zodSchema
95
95
  });
96
- module.exports = __toCommonJS(src_exports);
96
+ module.exports = __toCommonJS(index_exports);
97
97
 
98
98
  // src/combine-headers.ts
99
99
  function combineHeaders(...headers) {
@@ -440,7 +440,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
440
440
  }
441
441
 
442
442
  // src/version.ts
443
- var VERSION = true ? "3.0.22" : "0.0.0-test";
443
+ var VERSION = true ? "3.0.24" : "0.0.0-test";
444
444
 
445
445
  // src/get-from-api.ts
446
446
  var getOriginalFetch = () => globalThis.fetch;
@@ -723,7 +723,7 @@ var import_provider8 = require("@ai-sdk/provider");
723
723
 
724
724
  // src/validator.ts
725
725
  var import_provider7 = require("@ai-sdk/provider");
726
- var validatorSymbol = Symbol.for("vercel.ai.validator");
726
+ var validatorSymbol = /* @__PURE__ */ Symbol.for("vercel.ai.validator");
727
727
  function validator(validate) {
728
728
  return { [validatorSymbol]: true, validate };
729
729
  }
@@ -1281,7 +1281,7 @@ var getRelativePath = (pathA, pathB) => {
1281
1281
  };
1282
1282
 
1283
1283
  // src/zod-to-json-schema/options.ts
1284
- var ignoreOverride = Symbol(
1284
+ var ignoreOverride = /* @__PURE__ */ Symbol(
1285
1285
  "Let zodToJsonSchema decide on which parser to use"
1286
1286
  );
1287
1287
  var defaultOptions = {
@@ -2501,7 +2501,7 @@ function zodSchema(zodSchema2, options) {
2501
2501
  }
2502
2502
 
2503
2503
  // src/schema.ts
2504
- var schemaSymbol = Symbol.for("vercel.ai.schema");
2504
+ var schemaSymbol = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
2505
2505
  function lazySchema(createSchema) {
2506
2506
  let schema;
2507
2507
  return () => {
@@ -2567,10 +2567,13 @@ function validateDownloadUrl(url) {
2567
2567
  message: `Invalid URL: ${url}`
2568
2568
  });
2569
2569
  }
2570
+ if (parsed.protocol === "data:") {
2571
+ return;
2572
+ }
2570
2573
  if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
2571
2574
  throw new DownloadError({
2572
2575
  url,
2573
- message: `URL scheme must be http or https, got ${parsed.protocol}`
2576
+ message: `URL scheme must be http, https, or data, got ${parsed.protocol}`
2574
2577
  });
2575
2578
  }
2576
2579
  const hostname = parsed.hostname;
@@ -2682,7 +2685,7 @@ async function* executeTool({
2682
2685
  }
2683
2686
 
2684
2687
  // src/index.ts
2685
- __reExport(src_exports, require("@standard-schema/spec"), module.exports);
2688
+ __reExport(index_exports, require("@standard-schema/spec"), module.exports);
2686
2689
  var import_stream2 = require("eventsource-parser/stream");
2687
2690
  // Annotate the CommonJS export names for ESM import in node:
2688
2691
  0 && (module.exports = {