@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/CHANGELOG.md +12 -0
- package/dist/index.js +31 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
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
|
+
|
9
|
+
## 4.0.0-beta.13
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- d116b4b: feat(ai): arktype support
|
14
|
+
|
3
15
|
## 4.0.0-beta.12
|
4
16
|
|
5
17
|
### 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.
|
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;
|
@@ -1083,13 +1083,28 @@ var createStatusCodeErrorResponseHandler = () => async ({ response, url, request
|
|
1083
1083
|
var import_provider12 = require("@ai-sdk/provider");
|
1084
1084
|
var z4 = __toESM(require("zod/v4"));
|
1085
1085
|
|
1086
|
-
// src/
|
1086
|
+
// src/to-json-schema/arktype-to-json-schema.ts
|
1087
|
+
var arktypeToJsonSchema = async (schema) => {
|
1088
|
+
return schema.toJsonSchema();
|
1089
|
+
};
|
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
|
+
|
1101
|
+
// src/to-json-schema/valibot-to-json-schema.ts
|
1087
1102
|
var valibotToJsonSchema = async (schema) => {
|
1088
1103
|
try {
|
1089
1104
|
const { toJsonSchema } = await import("@valibot/to-json-schema");
|
1090
1105
|
return toJsonSchema(schema);
|
1091
1106
|
} catch (e) {
|
1092
|
-
throw new Error(`Failed to import @valibot/to-json-schema`);
|
1107
|
+
throw new Error(`Failed to import module '@valibot/to-json-schema'`);
|
1093
1108
|
}
|
1094
1109
|
};
|
1095
1110
|
|
@@ -2309,7 +2324,7 @@ function asSchema(schema) {
|
|
2309
2324
|
return schema == null ? jsonSchema({
|
2310
2325
|
properties: {},
|
2311
2326
|
additionalProperties: false
|
2312
|
-
}) : isSchema(schema) ? schema :
|
2327
|
+
}) : isSchema(schema) ? schema : "~standard" in schema ? standardSchema(schema) : schema();
|
2313
2328
|
}
|
2314
2329
|
function standardSchema(standardSchema2) {
|
2315
2330
|
const vendor = standardSchema2["~standard"].vendor;
|
@@ -2319,6 +2334,18 @@ function standardSchema(standardSchema2) {
|
|
2319
2334
|
standardSchema2
|
2320
2335
|
);
|
2321
2336
|
}
|
2337
|
+
case "arktype": {
|
2338
|
+
return standardSchemaWithJsonSchemaResolver(
|
2339
|
+
standardSchema2,
|
2340
|
+
arktypeToJsonSchema
|
2341
|
+
);
|
2342
|
+
}
|
2343
|
+
case "effect": {
|
2344
|
+
return standardSchemaWithJsonSchemaResolver(
|
2345
|
+
standardSchema2,
|
2346
|
+
effectToJsonSchema
|
2347
|
+
);
|
2348
|
+
}
|
2322
2349
|
case "valibot": {
|
2323
2350
|
return standardSchemaWithJsonSchemaResolver(
|
2324
2351
|
standardSchema2,
|