@ai-sdk/provider-utils 4.0.37 → 4.0.39

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/dist/index.mjs CHANGED
@@ -677,7 +677,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
677
677
  }
678
678
 
679
679
  // src/version.ts
680
- var VERSION = true ? "4.0.37" : "0.0.0-test";
680
+ var VERSION = true ? "4.0.39" : "0.0.0-test";
681
681
 
682
682
  // src/get-from-api.ts
683
683
  var getOriginalFetch = () => globalThis.fetch;
@@ -2236,11 +2236,18 @@ function asSchema(schema) {
2236
2236
  }
2237
2237
  function standardSchema(standardSchema2) {
2238
2238
  return jsonSchema(
2239
- () => addAdditionalPropertiesToJsonSchema(
2240
- standardSchema2["~standard"].jsonSchema.input({
2241
- target: "draft-07"
2242
- })
2243
- ),
2239
+ () => {
2240
+ if (!hasStandardJsonSchema(standardSchema2)) {
2241
+ throw new Error(
2242
+ `Standard schema vendor '${standardSchema2["~standard"].vendor}' does not support JSON Schema conversion.`
2243
+ );
2244
+ }
2245
+ return addAdditionalPropertiesToJsonSchema(
2246
+ standardSchema2["~standard"].jsonSchema.input({
2247
+ target: "draft-07"
2248
+ })
2249
+ );
2250
+ },
2244
2251
  {
2245
2252
  validate: async (value) => {
2246
2253
  const result = await standardSchema2["~standard"].validate(value);
@@ -2255,6 +2262,9 @@ function standardSchema(standardSchema2) {
2255
2262
  }
2256
2263
  );
2257
2264
  }
2265
+ function hasStandardJsonSchema(schema) {
2266
+ return schema["~standard"].jsonSchema != null;
2267
+ }
2258
2268
  function zod3Schema(zodSchema2, options) {
2259
2269
  var _a2;
2260
2270
  const useReferences = (_a2 = options == null ? void 0 : options.useReferences) != null ? _a2 : false;