@ai-sdk/provider-utils 4.0.0-beta.13 → 4.0.0-beta.14

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
+ ## 4.0.0-beta.14
4
+
5
+ ### Patch Changes
6
+
7
+ - 3b1d015: feat(ai): Effect schema support
8
+
3
9
  ## 4.0.0-beta.13
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -285,7 +285,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
285
285
  }
286
286
 
287
287
  // src/version.ts
288
- var VERSION = true ? "4.0.0-beta.13" : "0.0.0-test";
288
+ var VERSION = true ? "4.0.0-beta.14" : "0.0.0-test";
289
289
 
290
290
  // src/get-from-api.ts
291
291
  var getOriginalFetch = () => globalThis.fetch;
@@ -1088,13 +1088,23 @@ var arktypeToJsonSchema = async (schema) => {
1088
1088
  return schema.toJsonSchema();
1089
1089
  };
1090
1090
 
1091
+ // src/to-json-schema/effect-to-json-schema.ts
1092
+ var effectToJsonSchema = async (schema) => {
1093
+ try {
1094
+ const { JSONSchema } = await import("effect");
1095
+ return JSONSchema.make(schema);
1096
+ } catch (e) {
1097
+ throw new Error(`Failed to import module 'effect'`);
1098
+ }
1099
+ };
1100
+
1091
1101
  // src/to-json-schema/valibot-to-json-schema.ts
1092
1102
  var valibotToJsonSchema = async (schema) => {
1093
1103
  try {
1094
1104
  const { toJsonSchema } = await import("@valibot/to-json-schema");
1095
1105
  return toJsonSchema(schema);
1096
1106
  } catch (e) {
1097
- throw new Error(`Failed to import @valibot/to-json-schema`);
1107
+ throw new Error(`Failed to import module '@valibot/to-json-schema'`);
1098
1108
  }
1099
1109
  };
1100
1110
 
@@ -2330,6 +2340,12 @@ function standardSchema(standardSchema2) {
2330
2340
  arktypeToJsonSchema
2331
2341
  );
2332
2342
  }
2343
+ case "effect": {
2344
+ return standardSchemaWithJsonSchemaResolver(
2345
+ standardSchema2,
2346
+ effectToJsonSchema
2347
+ );
2348
+ }
2333
2349
  case "valibot": {
2334
2350
  return standardSchemaWithJsonSchemaResolver(
2335
2351
  standardSchema2,