@ai-sdk/provider-utils 4.0.0-beta.12 → 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/dist/index.mjs CHANGED
@@ -194,7 +194,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
194
194
  }
195
195
 
196
196
  // src/version.ts
197
- var VERSION = true ? "4.0.0-beta.12" : "0.0.0-test";
197
+ var VERSION = true ? "4.0.0-beta.14" : "0.0.0-test";
198
198
 
199
199
  // src/get-from-api.ts
200
200
  var getOriginalFetch = () => globalThis.fetch;
@@ -997,13 +997,28 @@ var createStatusCodeErrorResponseHandler = () => async ({ response, url, request
997
997
  import { TypeValidationError as TypeValidationError4 } from "@ai-sdk/provider";
998
998
  import * as z4 from "zod/v4";
999
999
 
1000
- // src/valibot-to-json-schema/valibot-to-json-schema.ts
1000
+ // src/to-json-schema/arktype-to-json-schema.ts
1001
+ var arktypeToJsonSchema = async (schema) => {
1002
+ return schema.toJsonSchema();
1003
+ };
1004
+
1005
+ // src/to-json-schema/effect-to-json-schema.ts
1006
+ var effectToJsonSchema = async (schema) => {
1007
+ try {
1008
+ const { JSONSchema } = await import("effect");
1009
+ return JSONSchema.make(schema);
1010
+ } catch (e) {
1011
+ throw new Error(`Failed to import module 'effect'`);
1012
+ }
1013
+ };
1014
+
1015
+ // src/to-json-schema/valibot-to-json-schema.ts
1001
1016
  var valibotToJsonSchema = async (schema) => {
1002
1017
  try {
1003
1018
  const { toJsonSchema } = await import("@valibot/to-json-schema");
1004
1019
  return toJsonSchema(schema);
1005
1020
  } catch (e) {
1006
- throw new Error(`Failed to import @valibot/to-json-schema`);
1021
+ throw new Error(`Failed to import module '@valibot/to-json-schema'`);
1007
1022
  }
1008
1023
  };
1009
1024
 
@@ -2225,7 +2240,7 @@ function asSchema(schema) {
2225
2240
  return schema == null ? jsonSchema({
2226
2241
  properties: {},
2227
2242
  additionalProperties: false
2228
- }) : isSchema(schema) ? schema : typeof schema === "function" ? schema() : standardSchema(schema);
2243
+ }) : isSchema(schema) ? schema : "~standard" in schema ? standardSchema(schema) : schema();
2229
2244
  }
2230
2245
  function standardSchema(standardSchema2) {
2231
2246
  const vendor = standardSchema2["~standard"].vendor;
@@ -2235,6 +2250,18 @@ function standardSchema(standardSchema2) {
2235
2250
  standardSchema2
2236
2251
  );
2237
2252
  }
2253
+ case "arktype": {
2254
+ return standardSchemaWithJsonSchemaResolver(
2255
+ standardSchema2,
2256
+ arktypeToJsonSchema
2257
+ );
2258
+ }
2259
+ case "effect": {
2260
+ return standardSchemaWithJsonSchemaResolver(
2261
+ standardSchema2,
2262
+ effectToJsonSchema
2263
+ );
2264
+ }
2238
2265
  case "valibot": {
2239
2266
  return standardSchemaWithJsonSchemaResolver(
2240
2267
  standardSchema2,