@ai-sdk/valibot 0.0.0-9477ebb9-20250403064906

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 ADDED
@@ -0,0 +1,314 @@
1
+ # @ai-sdk/valibot
2
+
3
+ ## 0.0.0-9477ebb9-20250403064906
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [9477ebb]
8
+ - ai@0.0.0-9477ebb9-20250403064906
9
+
10
+ ## 0.1.10
11
+
12
+ ### Patch Changes
13
+
14
+ - ai@4.2.10
15
+
16
+ ## 0.1.9
17
+
18
+ ### Patch Changes
19
+
20
+ - ai@4.2.9
21
+
22
+ ## 0.1.8
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [65243ce]
27
+ - ai@4.2.8
28
+
29
+ ## 0.1.7
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [e14c066]
34
+ - ai@4.2.7
35
+
36
+ ## 0.1.6
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [625591b]
41
+ - Updated dependencies [6a1506f]
42
+ - Updated dependencies [ea3d998]
43
+ - ai@4.2.6
44
+
45
+ ## 0.1.5
46
+
47
+ ### Patch Changes
48
+
49
+ - ai@4.2.5
50
+
51
+ ## 0.1.4
52
+
53
+ ### Patch Changes
54
+
55
+ - Updated dependencies [3d6d96d]
56
+ - ai@4.2.4
57
+
58
+ ## 0.1.3
59
+
60
+ ### Patch Changes
61
+
62
+ - Updated dependencies [0b3bf29]
63
+ - ai@4.2.3
64
+
65
+ ## 0.1.2
66
+
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [f10f0fa]
70
+ - ai@4.2.2
71
+
72
+ ## 0.1.1
73
+
74
+ ### Patch Changes
75
+
76
+ - Updated dependencies [b796152]
77
+ - Updated dependencies [06361d6]
78
+ - ai@4.2.1
79
+
80
+ ## 0.1.0
81
+
82
+ ### Minor Changes
83
+
84
+ - 5bc638d: AI SDK 4.2
85
+
86
+ ### Patch Changes
87
+
88
+ - Updated dependencies [5bc638d]
89
+ - ai@4.2.0
90
+
91
+ ## 0.0.33
92
+
93
+ ### Patch Changes
94
+
95
+ - Updated dependencies [5d0fc29]
96
+ - ai@4.1.66
97
+
98
+ ## 0.0.32
99
+
100
+ ### Patch Changes
101
+
102
+ - Updated dependencies [16c444f]
103
+ - ai@4.1.65
104
+
105
+ ## 0.0.31
106
+
107
+ ### Patch Changes
108
+
109
+ - ai@4.1.64
110
+
111
+ ## 0.0.30
112
+
113
+ ### Patch Changes
114
+
115
+ - Updated dependencies [0bd5bc6]
116
+ - ai@4.1.63
117
+
118
+ ## 0.0.29
119
+
120
+ ### Patch Changes
121
+
122
+ - Updated dependencies [c9ed3c4]
123
+ - ai@4.1.62
124
+
125
+ ## 0.0.28
126
+
127
+ ### Patch Changes
128
+
129
+ - Updated dependencies [2e1101a]
130
+ - ai@4.1.61
131
+
132
+ ## 0.0.27
133
+
134
+ ### Patch Changes
135
+
136
+ - Updated dependencies [0b8797f]
137
+ - ai@4.1.60
138
+
139
+ ## 0.0.26
140
+
141
+ ### Patch Changes
142
+
143
+ - Updated dependencies [dd18049]
144
+ - ai@4.1.59
145
+
146
+ ## 0.0.25
147
+
148
+ ### Patch Changes
149
+
150
+ - Updated dependencies [e9897eb]
151
+ - ai@4.1.58
152
+
153
+ ## 0.0.24
154
+
155
+ ### Patch Changes
156
+
157
+ - Updated dependencies [092fdaa]
158
+ - ai@4.1.57
159
+
160
+ ## 0.0.23
161
+
162
+ ### Patch Changes
163
+
164
+ - Updated dependencies [80be82b]
165
+ - Updated dependencies [8109a24]
166
+ - ai@4.1.56
167
+
168
+ ## 0.0.22
169
+
170
+ ### Patch Changes
171
+
172
+ - Updated dependencies [1531959]
173
+ - ai@4.1.55
174
+
175
+ ## 0.0.21
176
+
177
+ ### Patch Changes
178
+
179
+ - Updated dependencies [ee1c787]
180
+ - ai@4.1.54
181
+
182
+ ## 0.0.20
183
+
184
+ ### Patch Changes
185
+
186
+ - Updated dependencies [e1d3d42]
187
+ - ai@4.1.53
188
+
189
+ ## 0.0.19
190
+
191
+ ### Patch Changes
192
+
193
+ - Updated dependencies [5329a69]
194
+ - ai@4.1.52
195
+
196
+ ## 0.0.18
197
+
198
+ ### Patch Changes
199
+
200
+ - Updated dependencies [0cb2647]
201
+ - ai@4.1.51
202
+
203
+ ## 0.0.17
204
+
205
+ ### Patch Changes
206
+
207
+ - Updated dependencies [ae98f0d]
208
+ - ai@4.1.50
209
+
210
+ ## 0.0.16
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies [dc027d3]
215
+ - ai@4.1.49
216
+
217
+ ## 0.0.15
218
+
219
+ ### Patch Changes
220
+
221
+ - ai@4.1.48
222
+
223
+ ## 0.0.14
224
+
225
+ ### Patch Changes
226
+
227
+ - ai@4.1.47
228
+
229
+ ## 0.0.13
230
+
231
+ ### Patch Changes
232
+
233
+ - Updated dependencies [ddf9740]
234
+ - ai@4.1.46
235
+
236
+ ## 0.0.12
237
+
238
+ ### Patch Changes
239
+
240
+ - Updated dependencies [93bd5a0]
241
+ - ai@4.1.45
242
+
243
+ ## 0.0.11
244
+
245
+ ### Patch Changes
246
+
247
+ - Updated dependencies [f8e7df2]
248
+ - ai@4.1.44
249
+
250
+ ## 0.0.10
251
+
252
+ ### Patch Changes
253
+
254
+ - Updated dependencies [ef2e23b]
255
+ - ai@4.1.43
256
+
257
+ ## 0.0.9
258
+
259
+ ### Patch Changes
260
+
261
+ - ai@4.1.42
262
+
263
+ ## 0.0.8
264
+
265
+ ### Patch Changes
266
+
267
+ - ai@4.1.41
268
+
269
+ ## 0.0.7
270
+
271
+ ### Patch Changes
272
+
273
+ - ai@4.1.40
274
+
275
+ ## 0.0.6
276
+
277
+ ### Patch Changes
278
+
279
+ - Updated dependencies [075a9a9]
280
+ - ai@4.1.39
281
+
282
+ ## 0.0.5
283
+
284
+ ### Patch Changes
285
+
286
+ - Updated dependencies [4c9c194]
287
+ - Updated dependencies [2e898b4]
288
+ - ai@4.1.38
289
+
290
+ ## 0.0.4
291
+
292
+ ### Patch Changes
293
+
294
+ - Updated dependencies [c1e10d1]
295
+ - ai@4.1.37
296
+
297
+ ## 0.0.3
298
+
299
+ ### Patch Changes
300
+
301
+ - ai@4.1.36
302
+
303
+ ## 0.0.2
304
+
305
+ ### Patch Changes
306
+
307
+ - Updated dependencies [166e09e]
308
+ - ai@4.1.35
309
+
310
+ ## 0.0.1
311
+
312
+ ### Patch Changes
313
+
314
+ - 704e17f: chore (schema/valibot): release valibot schema
package/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2023 Vercel, Inc.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # AI SDK - Valibot Schema Support
2
+
3
+ ## Setup
4
+
5
+ ```bash
6
+ npm i @ai-sdk/valibot
7
+ ```
@@ -0,0 +1,6 @@
1
+ import { Schema } from 'ai';
2
+ import * as v from 'valibot';
3
+
4
+ declare function valibotSchema<OBJECT>(valibotSchema: v.GenericSchema<unknown, OBJECT>): Schema<OBJECT>;
5
+
6
+ export { valibotSchema };
@@ -0,0 +1,6 @@
1
+ import { Schema } from 'ai';
2
+ import * as v from 'valibot';
3
+
4
+ declare function valibotSchema<OBJECT>(valibotSchema: v.GenericSchema<unknown, OBJECT>): Schema<OBJECT>;
5
+
6
+ export { valibotSchema };
package/dist/index.js ADDED
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ valibotSchema: () => valibotSchema
34
+ });
35
+ module.exports = __toCommonJS(src_exports);
36
+
37
+ // src/valibot-schema.ts
38
+ var import_to_json_schema = require("@valibot/to-json-schema");
39
+ var import_ai = require("ai");
40
+ var v = __toESM(require("valibot"));
41
+ function valibotSchema(valibotSchema2) {
42
+ return (0, import_ai.jsonSchema)((0, import_to_json_schema.toJsonSchema)(valibotSchema2), {
43
+ validate: (value) => {
44
+ const result = v.safeParse(valibotSchema2, value);
45
+ return result.success ? { success: true, value: result.output } : { success: false, error: new v.ValiError(result.issues) };
46
+ }
47
+ });
48
+ }
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ valibotSchema
52
+ });
53
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/valibot-schema.ts"],"sourcesContent":["export { valibotSchema } from './valibot-schema';\n","import { toJsonSchema as valibotToJsonSchema } from '@valibot/to-json-schema';\nimport { jsonSchema, Schema } from 'ai';\nimport * as v from 'valibot';\n\nexport function valibotSchema<OBJECT>(\n valibotSchema: v.GenericSchema<unknown, OBJECT>,\n): Schema<OBJECT> {\n return jsonSchema(valibotToJsonSchema(valibotSchema), {\n validate: value => {\n const result = v.safeParse(valibotSchema, value);\n return result.success\n ? { success: true, value: result.output }\n : { success: false, error: new v.ValiError(result.issues) };\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,4BAAoD;AACpD,gBAAmC;AACnC,QAAmB;AAEZ,SAAS,cACdA,gBACgB;AAChB,aAAO,0BAAW,sBAAAC,cAAoBD,cAAa,GAAG;AAAA,IACpD,UAAU,WAAS;AACjB,YAAM,SAAW,YAAUA,gBAAe,KAAK;AAC/C,aAAO,OAAO,UACV,EAAE,SAAS,MAAM,OAAO,OAAO,OAAO,IACtC,EAAE,SAAS,OAAO,OAAO,IAAM,YAAU,OAAO,MAAM,EAAE;AAAA,IAC9D;AAAA,EACF,CAAC;AACH;","names":["valibotSchema","valibotToJsonSchema"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,16 @@
1
+ // src/valibot-schema.ts
2
+ import { toJsonSchema as valibotToJsonSchema } from "@valibot/to-json-schema";
3
+ import { jsonSchema } from "ai";
4
+ import * as v from "valibot";
5
+ function valibotSchema(valibotSchema2) {
6
+ return jsonSchema(valibotToJsonSchema(valibotSchema2), {
7
+ validate: (value) => {
8
+ const result = v.safeParse(valibotSchema2, value);
9
+ return result.success ? { success: true, value: result.output } : { success: false, error: new v.ValiError(result.issues) };
10
+ }
11
+ });
12
+ }
13
+ export {
14
+ valibotSchema
15
+ };
16
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/valibot-schema.ts"],"sourcesContent":["import { toJsonSchema as valibotToJsonSchema } from '@valibot/to-json-schema';\nimport { jsonSchema, Schema } from 'ai';\nimport * as v from 'valibot';\n\nexport function valibotSchema<OBJECT>(\n valibotSchema: v.GenericSchema<unknown, OBJECT>,\n): Schema<OBJECT> {\n return jsonSchema(valibotToJsonSchema(valibotSchema), {\n validate: value => {\n const result = v.safeParse(valibotSchema, value);\n return result.success\n ? { success: true, value: result.output }\n : { success: false, error: new v.ValiError(result.issues) };\n },\n });\n}\n"],"mappings":";AAAA,SAAS,gBAAgB,2BAA2B;AACpD,SAAS,kBAA0B;AACnC,YAAY,OAAO;AAEZ,SAAS,cACdA,gBACgB;AAChB,SAAO,WAAW,oBAAoBA,cAAa,GAAG;AAAA,IACpD,UAAU,WAAS;AACjB,YAAM,SAAW,YAAUA,gBAAe,KAAK;AAC/C,aAAO,OAAO,UACV,EAAE,SAAS,MAAM,OAAO,OAAO,OAAO,IACtC,EAAE,SAAS,OAAO,OAAO,IAAM,YAAU,OAAO,MAAM,EAAE;AAAA,IAC9D;AAAA,EACF,CAAC;AACH;","names":["valibotSchema"]}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@ai-sdk/valibot",
3
+ "version": "0.0.0-9477ebb9-20250403064906",
4
+ "license": "Apache-2.0",
5
+ "sideEffects": false,
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist/**/*",
11
+ "CHANGELOG.md"
12
+ ],
13
+ "exports": {
14
+ "./package.json": "./package.json",
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.mjs",
18
+ "require": "./dist/index.js"
19
+ }
20
+ },
21
+ "dependencies": {
22
+ "ai": "0.0.0-9477ebb9-20250403064906"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "20.17.24",
26
+ "tsup": "^8",
27
+ "typescript": "5.6.3",
28
+ "valibot": "^1.0.0-rc.0 || ^1.0.0",
29
+ "@vercel/ai-tsconfig": "0.0.0"
30
+ },
31
+ "peerDependencies": {
32
+ "@valibot/to-json-schema": "^1.0.0-rc.0 || ^1.0.0",
33
+ "valibot": "^1.0.0-rc.0 || ^1.0.0"
34
+ },
35
+ "engines": {
36
+ "node": ">=18"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "homepage": "https://sdk.vercel.ai/docs",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/vercel/ai.git"
45
+ },
46
+ "bugs": {
47
+ "url": "https://github.com/vercel/ai/issues"
48
+ },
49
+ "keywords": [
50
+ "ai"
51
+ ],
52
+ "scripts": {
53
+ "build": "tsup",
54
+ "build:watch": "tsup --watch",
55
+ "clean": "rm -rf dist",
56
+ "lint": "eslint \"./**/*.ts*\"",
57
+ "type-check": "tsc --noEmit",
58
+ "prettier-check": "prettier --check \"./**/*.ts*\""
59
+ }
60
+ }